Changeset 1064
 Timestamp:
 Feb 10, 2008, 11:06:52 PM (15 years ago)
 Location:
 trunk/yat/utility
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

trunk/yat/utility/matrix.cc
r1028 r1064 160 160 161 161 162 matrix::iterator matrix::begin(void) 163 { 164 return iterator(&(*this)(0,0), 1); 165 } 166 167 168 matrix::const_iterator matrix::begin(void) const 169 { 170 return const_iterator(&(*this)(0,0), 1); 171 } 172 173 174 matrix::iterator matrix::begin_column(size_t i) 175 { 176 return iterator(&(*this)(0,i), this>columns()); 177 } 178 179 180 matrix::const_iterator matrix::begin_column(size_t i) const 181 { 182 return const_iterator(&(*this)(0,i), this>columns()); 183 } 184 185 186 matrix::iterator matrix::begin_row(size_t i) 187 { 188 return iterator(&(*this)(i,0), 1); 189 } 190 191 192 matrix::const_iterator matrix::begin_row(size_t i) const 193 { 194 return const_iterator(&(*this)(i,0), 1); 195 } 196 197 162 198 const matrix& matrix::clone(const matrix& other) 163 199 { … … 226 262 if (status) 227 263 throw utility::GSL_error(std::string("matrix::div_elements",status)); 264 } 265 266 267 matrix::iterator matrix::end(void) 268 { 269 return iterator(&(*this)(0,0)+rows()*columns(), 1); 270 } 271 272 273 matrix::const_iterator matrix::end(void) const 274 { 275 return const_iterator(&(*this)(0,0)+rows()*columns(), 1); 276 } 277 278 279 matrix::iterator matrix::end_column(size_t i) 280 { 281 return iterator(&(*this)(0,i)+rows()*columns(), this>columns()); 282 } 283 284 285 matrix::const_iterator matrix::end_column(size_t i) const 286 { 287 return const_iterator(&(*this)(0,i)+rows()*columns(), this>columns()); 288 } 289 290 291 matrix::iterator matrix::end_row(size_t i) 292 { 293 return iterator(&(*this)(i,0)+columns(), 1); 294 } 295 296 297 matrix::const_iterator matrix::end_row(size_t i) const 298 { 299 return const_iterator(&(*this)(i,0)+columns(), 1); 228 300 } 229 301 
trunk/yat/utility/matrix.h
r1028 r1064 9 9 Copyright (C) 2005, 2006 Jari Häkkinen, Markus Ringnér, Peter Johansson 10 10 Copyright (C) 2007 Jari Häkkinen, Peter Johansson 11 Copyright (C) 2008 Peter Johansson 11 12 12 13 This file is part of the yat library, http://trac.thep.lu.se/yat … … 28 29 */ 29 30 31 #include "Exception.h" 32 #include "StrideIterator.h" 30 33 #include "vector.h" 31 34 #include "VectorConstView.h" 32 35 #include "VectorView.h" 33 #include "Exception.h"34 36 35 37 #include <gsl/gsl_matrix.h> … … 70 72 { 71 73 public: 74 /** 75 */ 76 typedef StrideIterator<double*> iterator; 77 78 /** 79 */ 80 typedef StrideIterator<const double*> const_iterator; 72 81 73 82 /** … … 149 158 150 159 /** 160 */ 161 iterator begin(void); 162 163 /** 164 */ 165 const_iterator begin(void) const; 166 167 /** 168 */ 169 iterator begin_column(size_t); 170 171 /** 172 */ 173 const_iterator begin_column(size_t) const; 174 175 /** 176 */ 177 iterator begin_row(size_t); 178 179 /** 180 */ 181 const_iterator begin_row(size_t) const; 182 183 /** 151 184 \brief Make a copy of \a other. 152 185 … … 177 210 */ 178 211 void div(const matrix& b); 212 213 /** 214 */ 215 iterator end(void); 216 217 /** 218 */ 219 const_iterator end(void) const; 220 221 /** 222 */ 223 iterator end_column(size_t); 224 225 /** 226 */ 227 const_iterator end_column(size_t) const; 228 229 /** 230 */ 231 iterator end_row(size_t); 232 233 /** 234 */ 235 const_iterator end_row(size_t) const; 179 236 180 237 /**
Note: See TracChangeset
for help on using the changeset viewer.