7 #ifndef COLUMN_ITERATOR
8 #error This class is not to be included by the user directly. Use ColumnIteratorf.h or ColumnIteratord.h instead.
12 class COLUMN_ITERATOR :
public std::iterator<std::random_access_iterator_tag, REAL>
35 _data_start = _current_data = NULL;
46 return *
this + (_sz - _count);
48 return *
this - (_count - _sz);
64 _current_data = _data_start + (_count / _rows)*_ld + (_count % _rows);
82 _current_data = _data_start + (_count / _rows)*_ld + (_count % _rows);
87 REAL& operator[](
int i)
const
94 throw std::runtime_error(
"Data outside of scope!");
95 return _data_start[(j / _rows)*_ld + (j % _rows)];
114 return _count < j._count;
119 return _count > j._count;
122 REAL& operator*()
const
124 if (_count < 0 || _count >= _sz)
125 throw std::runtime_error(
"Iterator outside of range!");
126 return *_current_data;
131 return _count - b._count;
137 assert(_data_start == b._data_start &&
141 _columns == b._columns);
143 return (_count == b._count);
146 bool operator!=(
const COLUMN_ITERATOR& j)
const {
return !operator==(j); }
156 if (_count % _rows == 0)
157 _current_data -= (_ld - _rows);
170 if (_count % _rows == 0)
171 _current_data += (_ld - _rows);
195 _current_data = i._current_data;
198 _data_start = i._data_start;
200 _columns = i._columns;
237 _data_start = _current_data = NULL;
248 _data_start = i._data_start;
249 _current_data = i._current_data;
254 _columns = i._columns;
261 return *
this + (_sz - _count);
263 return *
this - (_count - _sz);
279 _current_data = _data_start + (_count / _rows)*_ld + (_count % _rows);
297 _current_data = _data_start + (_count / _rows)*_ld + (_count % _rows);
302 const REAL& operator[](
int i)
const
308 if (j > _sz || j < 0)
309 throw std::runtime_error(
"Data outside of scope!");
310 return _data_start[(j / _rows)*_ld + (j % _rows)];
329 return _count < j._count;
334 return _count > j._count;
337 const REAL& operator*()
const
339 if (_count < 0 || _count >= _sz)
340 throw std::runtime_error(
"Iterator outside of range!");
341 return *_current_data;
346 return _count - b._count;
352 assert(_data_start == b._data_start &&
355 _columns == b._columns &&
358 return (_count == b._count);
371 if (_count % _rows == 0)
372 _current_data -= (_ld - _rows);
385 if (_count % _rows == 0)
386 _current_data += (_ld - _rows);
413 _current_data = i._current_data;
416 _data_start = i._data_start;
418 _columns = i._columns;
425 const REAL* _data_start;
426 const REAL* _current_data;
CONST_COLUMN_ITERATOR end() const
Gets the iterator at the end of this block.
Definition: ColumnIterator.h:258
A general 2x2 matrix.
Definition: Matrix2.h:16
A two-dimensional floating point vector used for computational geometry calculations and with associa...
Definition: Vector2.h:15
SACCEL operator-() const
Returns the negation of this vector.
Definition: SAccel.h:96
A generic, possibly non-square matrix.
Definition: MatrixN.h:18
A generic N-dimensional floating point vector.
Definition: SharedVectorN.h:77
A generic, possibly non-square matrix using shared data.
Definition: SharedMatrixN.h:59
A spatial velocity (a twist)
Definition: SVelocity.h:15
A generic N-dimensional floating point vector.
Definition: SharedVectorN.h:15
A 6-dimensional floating-point vector for use with spatial algebra.
Definition: SVector6.h:22
A spatial (six dimensional) acceleration.
Definition: SAccel.h:14
A generic N-dimensional floating point vector.
Definition: VectorN.h:16
A three-dimensional floating point vector used for representing points and vectors in 3D with associa...
Definition: Vector3.h:15
A spatial force (a wrench)
Definition: SForce.h:14
A three-dimensional floating point vector used for representing points and vectors in 3D and without ...
Definition: Origin3.h:16
A construct for iterating over a rectangular block of a matrix.
Definition: ColumnIterator.h:12
A generic, possibly non-square matrix using constant shared data.
Definition: SharedMatrixN.h:19
A construct for iterating over a rectangular block of a matrix.
Definition: ColumnIterator.h:215
A two-dimensional floating point vector used for computational geometry calculations and without asso...
Definition: Origin2.h:14
A 3x3 matrix that may be used for orientation, inertia tensors, etc.
Definition: Matrix3.h:20
CONST_COLUMN_ITERATOR(COLUMN_ITERATOR i)
Converts a non-constant column iterator to a constant one.
Definition: ColumnIterator.h:246