Changeset 1110
- Timestamp:
- Feb 19, 2008, 11:03:34 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/configure.ac
r1097 r1110 57 57 AC_PROG_SED 58 58 AC_CHECK_PROG([HAVE_DOXYGEN], [doxygen], [true], [false]) 59 AC_CHECK_PROG([HAVE_DVIPDFM], [dvipdfm], [true], [false])60 59 AC_CHECK_PROG([HAVE_LATEX], [latex], [true], [false]) 61 AC_CHECK_PROG([HAVE_LATEX2HTML], [latex2html], [true], [false])62 60 63 61 # Checks for libraries. … … 165 163 Doxygen was not found. Yat will compile and work without doxygen. 166 164 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/ 168 166 ]) 169 167 fi … … 171 169 AC_MSG_WARN([ 172 170 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 189 174 ]) 190 175 fi -
trunk/yat/classifier/DataLookup1D.h
r1083 r1110 28 28 29 29 #include "DataLookup2D.h" 30 #include "yat/utility/ Iterator.h"30 #include "yat/utility/Container2DIterator.h" 31 31 #include "yat/utility/iterator_traits.h" 32 32 #include "yat/utility/StrideIterator.h" … … 51 51 /// 'Read Only' iterator 52 52 typedef utility::StrideIterator< 53 utility::Iterator<const DataLookup2D, const double, void, const double> > 53 utility::Container2DIterator<const DataLookup2D, const double, void, 54 const double> > 54 55 const_iterator; 55 56 -
trunk/yat/classifier/DataLookupWeighted1D.h
r1090 r1110 50 50 /// 'Read Only' iterator 51 51 typedef utility::StrideIterator< 52 utility:: Iterator<const MatrixLookupWeighted,53 const std::pair<double, double>, void,54 const std::pair<double, double>,55 56 57 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> > > 58 58 const_iterator; 59 59 -
trunk/yat/classifier/KernelLookup.h
r1105 r1110 30 30 #include "DataLookup2D.h" 31 31 #include "MatrixLookup.h" 32 #include "yat/utility/ Iterator.h"32 #include "yat/utility/Container2DIterator.h" 33 33 #include "yat/utility/iterator_traits.h" 34 34 #include "yat/utility/StrideIterator.h" … … 72 72 /// 'Read Only' iterator 73 73 typedef utility::StrideIterator< 74 utility::Iterator<const KernelLookup, const double, void, const double> > 74 utility::Container2DIterator<const KernelLookup, const double, void, 75 const double> > 75 76 const_iterator; 76 77 -
trunk/yat/classifier/MatrixLookup.h
r1104 r1110 28 28 29 29 #include "DataLookup2D.h" 30 #include "yat/utility/ Iterator.h"30 #include "yat/utility/Container2DIterator.h" 31 31 #include "yat/utility/iterator_traits.h" 32 32 #include "yat/utility/StrideIterator.h" … … 75 75 /// 'Read Only' iterator 76 76 typedef utility::StrideIterator< 77 utility::Iterator<const MatrixLookup, const double, void, const double> > 77 utility::Container2DIterator<const MatrixLookup, const double, void, 78 const double> > 78 79 const_iterator; 79 80 -
trunk/yat/classifier/MatrixLookupWeighted.h
r1105 r1110 27 27 28 28 #include "DataLookup2D.h" 29 #include "yat/utility/ Iterator.h"29 #include "yat/utility/Container2DIterator.h" 30 30 #include "yat/utility/IteratorPolicy.h" 31 31 #include "yat/utility/StrideIterator.h" … … 72 72 /// 'Read Only' iterator 73 73 typedef utility::StrideIterator< 74 utility:: Iterator<const MatrixLookupWeighted,75 const std::pair<double, double>, void,76 const std::pair<double, double>,77 78 79 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> > > 80 80 const_iterator; 81 81 -
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_ 3 3 4 4 // $Id$ … … 43 43 typename pointer = value*, typename reference = value&, 44 44 class Policy = IteratorPolicy<Container, reference, value> > 45 class Iterator45 class Container2DIterator 46 46 : public std::iterator<std::random_access_iterator_tag, value, size_t, 47 47 pointer, reference> … … 51 51 52 52 private: 53 typedef Iterator<Container, value, pointer, reference,Policy> self;53 typedef Container2DIterator<Container, value, pointer,reference,Policy> self; 54 54 55 55 public: … … 57 57 \brief Default Constructor 58 58 */ 59 Iterator(void) {};59 Container2DIterator(void) {}; 60 60 61 61 /** … … 66 66 \param colun telling which column iterator points to 67 67 */ 68 Iterator(Container& container, size_t row, size_t column)68 Container2DIterator(Container& container, size_t row, size_t column) 69 69 : container_(&container), index_(row*container.columns()+column) {} 70 70 … … 74 74 typename Policy::data_type data(void) const 75 75 { yat_assert<std::out_of_range>(index_<this->size(), 76 " Iterator::data");76 "Container2DIterator::data"); 77 77 return ip_.data(*container_, row(index_), column(index_)); 78 78 } … … 83 83 typename Policy::weight_type weight(void) const 84 84 { yat_assert<std::out_of_range>(index_<this->size(), 85 " Iterator::weight");85 "Container2DIterator::weight"); 86 86 return ip_.weight(*container_, row(index_), column(index_)); 87 87 } … … 93 93 { 94 94 yat_assert<std::out_of_range>(index_ < this->size(), 95 " Iterator::operator*");95 "Container2DIterator::operator*"); 96 96 return ip_.dereference(*container_, row(index_), column(index_)); 97 97 } … … 103 103 { 104 104 yat_assert<std::out_of_range>(index_+n < this->size(), 105 " Iterator::operator[]");105 "Container2DIterator::operator[]"); 106 106 return ip_.dereference(*container_, row(index_+n), column(index_+n)); 107 107 } … … 112 112 \return reference to *this 113 113 */ 114 Iterator& operator++(void) { ++index_; return *this; }114 Container2DIterator& operator++(void) { ++index_; return *this; } 115 115 116 116 /** … … 119 119 \return copy of iterator prior increment 120 120 */ 121 Iterator operator++(int)121 Container2DIterator operator++(int) 122 122 { self tmp(*this); ++index_; return tmp;} 123 123 … … 127 127 \return reference to resulting iterator 128 128 */ 129 Iterator& operator+=(int n) { index_+=n; return *this; }129 Container2DIterator& operator+=(int n) { index_+=n; return *this; } 130 130 131 131 /** … … 134 134 \return copy of iterator prior decrement 135 135 */ 136 Iterator operator--(int)136 Container2DIterator operator--(int) 137 137 { self tmp(*this); --index_; return tmp;} 138 138 … … 142 142 \return reference to resulting iterator 143 143 */ 144 Iterator& operator--(void) { --index_; return *this; }144 Container2DIterator& operator--(void) { --index_; return *this; } 145 145 146 146 /** … … 149 149 \return reference to resulting iterator 150 150 */ 151 Iterator& operator-=(int n) { index_-=n; return *this; }151 Container2DIterator& operator-=(int n) { index_-=n; return *this; } 152 152 153 153 /** … … 156 156 \return copy of resulting iterator 157 157 */ 158 friend Iterator operator+(const Iterator& lhs, size_t n) 158 friend Container2DIterator operator+(const Container2DIterator& lhs, 159 size_t n) 159 160 { return self(*lhs.container_, lhs.index_+n); } 160 161 … … 164 165 \return copy of resulting iterator 165 166 */ 166 friend Iterator operator-(const Iterator& lhs, size_t n) 167 friend Container2DIterator operator-(const Container2DIterator& lhs, 168 size_t n) 167 169 { return self(*lhs.container_, lhs.index_-n); } 168 170 … … 172 174 \return distance between \a lhs and \a rhs 173 175 */ 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-"); 178 181 return lhs.index_-rhs.index_; 179 182 } … … 188 191 { 189 192 yat_assert<std::runtime_error>(lhs.container_==rhs.container_, 190 " Iterator::operator==");193 "Container2DIterator::operator=="); 191 194 return lhs.index_==rhs.index_; 192 195 } … … 197 200 \return False if \a lhs and \a rhs are pointing to same element 198 201 */ 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!="); 203 207 return !(lhs==rhs); 204 208 } … … 210 214 { 211 215 yat_assert<std::runtime_error>(lhs.container_==rhs.container_, 212 " Iterator::operator<");216 "Container2DIterator::operator<"); 213 217 return lhs.index_<rhs.index_; 214 218 } … … 220 224 { 221 225 yat_assert<std::runtime_error>(lhs.container_==rhs.container_, 222 " Iterator::operator<=");226 "Container2DIterator::operator<="); 223 227 return lhs.index_<=rhs.index_; 224 228 } … … 230 234 { 231 235 yat_assert<std::runtime_error>(lhs.container_==rhs.container_, 232 " Iterator::operator>");236 "Container2DIterator::operator>"); 233 237 return lhs.index_>rhs.index_; 234 238 } … … 240 244 { 241 245 yat_assert<std::runtime_error>(lhs.container_==rhs.container_, 242 " Iterator::operator>=");246 "Container2DIterator::operator>="); 243 247 return lhs.index_>=rhs.index_; 244 248 } … … 258 262 259 263 // Using compiler generated copy 260 // Iterator(constIterator&);261 // Iterator& operator=(constIterator&);264 //Container2DIterator(const Container2DIterator&); 265 //Container2DIterator& operator=(const Container2DIterator&); 262 266 }; 263 267 264 268 /** 265 Whether Iterator is weighted is desiced by Policy.269 Whether Container2DIterator is weighted is desiced by Policy. 266 270 */ 267 271 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> > { 269 273 typedef typename Policy::weighted_iterator_type type; 270 274 }; 271 275 272 276 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> > { 274 278 /** 275 279 \return data 276 280 */ 277 double data( Iterator<A, B, C, D, E> iter) const281 double data(Container2DIterator<A, B, C, D, E> iter) const 278 282 { return iter.data(); } 279 283 … … 281 285 \return weight 282 286 */ 283 double weight( Iterator<A, B, C, D, E> iter) const287 double weight(Container2DIterator<A, B, C, D, E> iter) const 284 288 { return iter.weight(); } 285 289 -
trunk/yat/utility/Makefile.am
r1106 r1110 36 36 include_utility_HEADERS = \ 37 37 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 \ 39 40 kNNI.h matrix.h NNI.h \ 40 41 Option.h OptionArg.h OptionFile.h OptionInFile.h OptionOutFile.h \
Note: See TracChangeset
for help on using the changeset viewer.