Changeset 1110


Ignore:
Timestamp:
Feb 19, 2008, 11:03:34 PM (14 years ago)
Author:
Peter
Message:

changing name of Iterator and some left-over from prev commit

Location:
trunk
Files:
7 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/configure.ac

    r1097 r1110  
    5757AC_PROG_SED
    5858AC_CHECK_PROG([HAVE_DOXYGEN], [doxygen], [true], [false])
    59 AC_CHECK_PROG([HAVE_DVIPDFM], [dvipdfm], [true], [false])
    6059AC_CHECK_PROG([HAVE_LATEX], [latex], [true], [false])
    61 AC_CHECK_PROG([HAVE_LATEX2HTML], [latex2html], [true], [false])
    6260
    6361# Checks for libraries.
     
    165163  Doxygen was not found. Yat will compile and work without doxygen.
    166164  However, in order to enable generation of documentation, please
    167   install doxygen available at http://www.doxygen.org/
     165  install Doxygen available at http://www.doxygen.org/
    168166  ])
    169167fi
     
    171169  AC_MSG_WARN([
    172170  latex was not found. Yat will compile and work without latex.
    173   However, supporting documentation on statistics used in yat
    174   cannot be generated without latex.
    175   ])
    176 fi
    177 if (test "$HAVE_DVIPDFM" != "true") ; then
    178   AC_MSG_WARN([
    179   dvipdfm was not found. Yat will compile and work without dvipdfm.
    180   However, pdf document on statistics used in yat cannot be
    181   generated without dvipdfm.
    182   ])
    183 fi
    184 if (test "$HAVE_LATEX2HTML" != "true") ; then
    185   AC_MSG_WARN([
    186   latex2html was not found. Yat will compile and work without
    187   latex. However, html document on statistics used in yat cannot
    188   be generated without latex.
     171  However, in order to enable Doxygen to generate LaTeX,
     172  Postscript, and PDF output, please install latex
     173  http://www.tug.org/interest.html\#free
    189174  ])
    190175fi
  • trunk/yat/classifier/DataLookup1D.h

    r1083 r1110  
    2828
    2929#include "DataLookup2D.h"
    30 #include "yat/utility/Iterator.h"
     30#include "yat/utility/Container2DIterator.h"
    3131#include "yat/utility/iterator_traits.h"
    3232#include "yat/utility/StrideIterator.h"
     
    5151    /// 'Read Only' iterator
    5252    typedef utility::StrideIterator<
    53     utility::Iterator<const DataLookup2D, const double, void, const double> >
     53    utility::Container2DIterator<const DataLookup2D, const double, void,
     54                                 const double> >
    5455    const_iterator;
    5556
  • trunk/yat/classifier/DataLookupWeighted1D.h

    r1090 r1110  
    5050    /// 'Read Only' iterator
    5151    typedef utility::StrideIterator<
    52     utility::Iterator<const MatrixLookupWeighted,
    53                       const std::pair<double, double>, void,
    54                       const std::pair<double, double>,
    55                       utility::IteratorPolicyWeighted<const MatrixLookupWeighted,
    56                                                       const double,
    57                                                       const double> > >
     52    utility::Container2DIterator<const MatrixLookupWeighted,
     53                                 const std::pair<double, double>, void,
     54                                 const std::pair<double, double>,
     55             utility::IteratorPolicyWeighted<const MatrixLookupWeighted,
     56                                             const double,
     57                                             const double> > >
    5858    const_iterator;
    5959
  • trunk/yat/classifier/KernelLookup.h

    r1105 r1110  
    3030#include "DataLookup2D.h"
    3131#include "MatrixLookup.h"
    32 #include "yat/utility/Iterator.h"
     32#include "yat/utility/Container2DIterator.h"
    3333#include "yat/utility/iterator_traits.h"
    3434#include "yat/utility/StrideIterator.h"
     
    7272    /// 'Read Only' iterator
    7373    typedef utility::StrideIterator<
    74     utility::Iterator<const KernelLookup, const double, void, const double> >
     74    utility::Container2DIterator<const KernelLookup, const double, void,
     75                                 const double> >
    7576    const_iterator;
    7677
  • trunk/yat/classifier/MatrixLookup.h

    r1104 r1110  
    2828
    2929#include "DataLookup2D.h"
    30 #include "yat/utility/Iterator.h"
     30#include "yat/utility/Container2DIterator.h"
    3131#include "yat/utility/iterator_traits.h"
    3232#include "yat/utility/StrideIterator.h"
     
    7575    /// 'Read Only' iterator
    7676    typedef utility::StrideIterator<
    77     utility::Iterator<const MatrixLookup, const double, void, const double> >
     77    utility::Container2DIterator<const MatrixLookup, const double, void,
     78                                 const double> >
    7879    const_iterator;
    7980
  • trunk/yat/classifier/MatrixLookupWeighted.h

    r1105 r1110  
    2727
    2828#include "DataLookup2D.h"
    29 #include "yat/utility/Iterator.h"
     29#include "yat/utility/Container2DIterator.h"
    3030#include "yat/utility/IteratorPolicy.h"
    3131#include "yat/utility/StrideIterator.h"
     
    7272    /// 'Read Only' iterator
    7373    typedef utility::StrideIterator<
    74     utility::Iterator<const MatrixLookupWeighted,
    75                       const std::pair<double, double>, void, 
    76                       const std::pair<double, double>,
    77                       utility::IteratorPolicyWeighted<const MatrixLookupWeighted,
    78                                                       const double,
    79                                                       const double> > >
     74    utility::Container2DIterator<const MatrixLookupWeighted,
     75                                 const std::pair<double, double>, void,
     76                                 const std::pair<double, double>,
     77             utility::IteratorPolicyWeighted<const MatrixLookupWeighted,
     78                                             const double,
     79                                             const double> > >
    8080    const_iterator;
    8181
  • trunk/yat/utility/Container2DIterator.h

    r1107 r1110  
    1 #ifndef _theplu_yat_utility_iterator_
    2 #define _theplu_yat_utility_iterator_
     1#ifndef _theplu_yat_utility_container2d_iterator_
     2#define _theplu_yat_utility_container2d_iterator_
    33
    44// $Id$
     
    4343           typename pointer = value*, typename reference = value&,
    4444           class Policy = IteratorPolicy<Container, reference, value> >
    45   class Iterator
     45  class Container2DIterator
    4646    : public std::iterator<std::random_access_iterator_tag, value, size_t,
    4747                           pointer, reference>
     
    5151
    5252  private:
    53     typedef Iterator<Container, value, pointer, reference, Policy> self;
     53    typedef Container2DIterator<Container, value, pointer,reference,Policy> self;
    5454
    5555  public:
     
    5757       \brief Default Constructor
    5858    */
    59     Iterator(void) {};
     59    Container2DIterator(void) {};
    6060
    6161    /**
     
    6666       \param colun telling which column iterator points to
    6767    */
    68     Iterator(Container& container, size_t row, size_t column)
     68    Container2DIterator(Container& container, size_t row, size_t column)
    6969      : container_(&container), index_(row*container.columns()+column) {}
    7070
     
    7474    typename Policy::data_type data(void) const
    7575    { yat_assert<std::out_of_range>(index_<this->size(),
    76                                     "Iterator::data");
     76                                    "Container2DIterator::data");
    7777      return ip_.data(*container_, row(index_), column(index_));
    7878    }
     
    8383    typename Policy::weight_type weight(void) const
    8484    { yat_assert<std::out_of_range>(index_<this->size(),
    85                                     "Iterator::weight");
     85                                    "Container2DIterator::weight");
    8686      return ip_.weight(*container_, row(index_), column(index_));
    8787    }
     
    9393    {
    9494      yat_assert<std::out_of_range>(index_ < this->size(),
    95                                     "Iterator::operator*");
     95                                    "Container2DIterator::operator*");
    9696      return ip_.dereference(*container_, row(index_), column(index_));
    9797    }
     
    103103    {
    104104      yat_assert<std::out_of_range>(index_+n < this->size(),
    105                                     "Iterator::operator[]");
     105                                    "Container2DIterator::operator[]");
    106106      return ip_.dereference(*container_, row(index_+n), column(index_+n));
    107107    }
     
    112112       \return reference to *this
    113113     */
    114     Iterator& operator++(void) { ++index_; return *this; }
     114    Container2DIterator& operator++(void) { ++index_; return *this; }
    115115
    116116    /**
     
    119119       \return copy of iterator prior increment
    120120     */
    121     Iterator operator++(int)
     121    Container2DIterator operator++(int)
    122122    { self tmp(*this); ++index_; return tmp;}
    123123
     
    127127       \return reference to resulting iterator
    128128     */
    129     Iterator& operator+=(int n) { index_+=n; return *this; }
     129    Container2DIterator& operator+=(int n) { index_+=n; return *this; }
    130130
    131131    /**
     
    134134       \return copy of iterator prior decrement
    135135     */
    136     Iterator operator--(int)
     136    Container2DIterator operator--(int)
    137137    { self tmp(*this); --index_; return tmp;}
    138138
     
    142142       \return reference to resulting iterator
    143143     */
    144     Iterator& operator--(void) { --index_; return *this; }
     144    Container2DIterator& operator--(void) { --index_; return *this; }
    145145
    146146    /**
     
    149149       \return reference to resulting iterator
    150150     */
    151     Iterator& operator-=(int n) { index_-=n; return *this; }
     151    Container2DIterator& operator-=(int n) { index_-=n; return *this; }
    152152
    153153    /**
     
    156156       \return copy of resulting iterator
    157157     */
    158     friend Iterator operator+(const Iterator& lhs, size_t n)
     158    friend Container2DIterator operator+(const Container2DIterator& lhs,
     159                                         size_t n)
    159160    { return self(*lhs.container_, lhs.index_+n); }
    160161
     
    164165       \return copy of resulting iterator
    165166     */
    166     friend Iterator operator-(const Iterator& lhs, size_t n)
     167    friend Container2DIterator operator-(const Container2DIterator& lhs,
     168                                         size_t n)
    167169    { return self(*lhs.container_, lhs.index_-n); }
    168170
     
    172174       \return distance between \a lhs and \a rhs
    173175     */
    174     friend size_t operator-(const Iterator& lhs, const Iterator& rhs)
    175     {
    176       yat_assert<std::runtime_error>(lhs.container_==rhs.container_,
    177                                      "Iterator::operator-");
     176    friend size_t operator-(const Container2DIterator& lhs, \
     177                            const Container2DIterator& rhs)
     178    {
     179      yat_assert<std::runtime_error>(lhs.container_==rhs.container_,
     180                                     "Container2DIterator::operator-");
    178181      return lhs.index_-rhs.index_;
    179182    }
     
    188191    {
    189192      yat_assert<std::runtime_error>(lhs.container_==rhs.container_,
    190                                      "Iterator::operator==");
     193                                     "Container2DIterator::operator==");
    191194      return lhs.index_==rhs.index_;
    192195    }
     
    197200       \return False if \a lhs and \a rhs are pointing to same element
    198201     */
    199     friend bool operator!=(const Iterator& lhs, const Iterator& rhs)
    200     {
    201       yat_assert<std::runtime_error>(lhs.container_==rhs.container_,
    202                                      "Iterator::operator!=");
     202    friend bool operator!=(const Container2DIterator& lhs,
     203                           const Container2DIterator& rhs)
     204    {
     205      yat_assert<std::runtime_error>(lhs.container_==rhs.container_,
     206                                     "Container2DIterator::operator!=");
    203207      return !(lhs==rhs);
    204208    }
     
    210214    {
    211215      yat_assert<std::runtime_error>(lhs.container_==rhs.container_,
    212                                      "Iterator::operator<");
     216                                     "Container2DIterator::operator<");
    213217      return lhs.index_<rhs.index_;
    214218    }
     
    220224    {
    221225      yat_assert<std::runtime_error>(lhs.container_==rhs.container_,
    222                                      "Iterator::operator<=");
     226                                     "Container2DIterator::operator<=");
    223227      return lhs.index_<=rhs.index_;
    224228    }
     
    230234    {
    231235      yat_assert<std::runtime_error>(lhs.container_==rhs.container_,
    232                                      "Iterator::operator>");
     236                                     "Container2DIterator::operator>");
    233237      return lhs.index_>rhs.index_;
    234238    }
     
    240244    {
    241245      yat_assert<std::runtime_error>(lhs.container_==rhs.container_,
    242                                      "Iterator::operator>=");
     246                                     "Container2DIterator::operator>=");
    243247      return lhs.index_>=rhs.index_;
    244248    }
     
    258262
    259263    // Using compiler generated copy
    260     //Iterator(const Iterator&);
    261     //Iterator& operator=(const Iterator&);
     264    //Container2DIterator(const Container2DIterator&);
     265    //Container2DIterator& operator=(const Container2DIterator&);
    262266  };
    263267
    264268  /**
    265      Whether Iterator is weighted is desiced by Policy.
     269     Whether Container2DIterator is weighted is desiced by Policy.
    266270   */
    267271  template<typename A, typename B, typename C, typename D, typename Policy>
    268   struct weighted_iterator_traits<Iterator<A, B, C, D, Policy> > {
     272  struct weighted_iterator_traits<Container2DIterator<A, B, C, D, Policy> > {
    269273    typedef typename Policy::weighted_iterator_type type;
    270274  };
    271275
    272276  template<typename A, typename B, typename C, typename D, typename E>
    273   struct iterator_traits<Iterator<A, B, C, D, E> > {
     277  struct iterator_traits<Container2DIterator<A, B, C, D, E> > {
    274278    /**
    275279       \return data
    276280    */
    277     double data(Iterator<A, B, C, D, E> iter) const
     281    double data(Container2DIterator<A, B, C, D, E> iter) const
    278282    { return iter.data(); }
    279283
     
    281285       \return weight
    282286    */
    283     double weight(Iterator<A, B, C, D, E> iter) const
     287    double weight(Container2DIterator<A, B, C, D, E> iter) const
    284288    { return iter.weight(); }
    285289
  • trunk/yat/utility/Makefile.am

    r1106 r1110  
    3636include_utility_HEADERS = \
    3737  Alignment.h ColumnStream.h CommandLine.h \
    38   Exception.h FileUtil.h Index.h Iterator.h IteratorPolicy.h iterator_traits.h \
     38  Container2DIterator.h \
     39  Exception.h FileUtil.h Index.h IteratorPolicy.h iterator_traits.h \
    3940  kNNI.h matrix.h NNI.h \
    4041  Option.h OptionArg.h OptionFile.h OptionInFile.h OptionOutFile.h \
Note: See TracChangeset for help on using the changeset viewer.