Go to the documentation of this file.
118 const Range& c)
const
135 const Range& c)
const
152 const Range& c)
const
209 const Range& c)
const
229 const Range& c)
const
269 const Range& c)
const
358 const Range& c)
const
388 throw runtime_error(
"A Tensor4View can only be converted to a plain C-array if mbr.mstart == 0 and mbr.mstride == mrp.extent*mrr.extent*mcr.extent and mpr.mstart == 0 and mpr.mstride == mrr.extent*mcr.extent and mrr.mstart == 0 and mrr.mstride == mcr.extent and mcr.mstart == 0 and mcr.mstride == 1");
405 throw runtime_error(
"A Tensor4View can only be converted to a plain C-array if mbr.mstart == 0 and mbr.mstride == mrp.extent*mrr.extent*mcr.extent and mpr.mstart == 0 and mpr.mstride == mrr.extent*mcr.extent and mrr.mstart == 0 and mrr.mstride == mcr.extent and mcr.mstart == 0 and mcr.mstride == 1");
429 mbr(0,1,a.mpr.mextent*a.mrr.mextent*a.mcr.mextent),
502 if ( ib != end_book ) {
507 for ( ; ib != end_book; ++ib ) {
526 const Range& c)
const
550 const Range& c)
const
562 const Range& c)
const
574 const Range& c)
const
610 const Range& c)
const
622 const Range& c)
const
646 const Range& c)
const
694 const Range& c)
const
1135 for ( ; b !=
eb ; ++b, ++xb )
1152 for ( ; b !=
eb ; ++b, ++xb )
1169 for ( ; b !=
eb ; ++b, ++xb )
1186 for ( ; b !=
eb ; ++b, ++xb )
1268 for ( ; origin != end ; ++origin, ++target )
1281 for ( ; target != end ; ++target )
1307 Range( 0, b, p*r*c ),
1318 Range( 0, b, p*r*c ),
1334 Range( 0, m.nbooks(), m.npages()*m.nrows()*m.ncols() ),
1335 Range( 0, m.npages(), m.nrows()*m.ncols() ),
1336 Range( 0, m.nrows(), m.ncols() ),
1337 Range( 0, m.ncols() ) )
1346 Range( 0, m.nbooks(), m.npages()*m.nrows()*m.ncols() ),
1347 Range( 0, m.npages(), m.nrows()*m.ncols() ),
1348 Range( 0, m.nrows(), m.ncols() ),
1349 Range( 0, m.ncols() ) )
1463 double (&my_func)(
double),
1475 for ( ; xi != xe; ++xi, ++yi )
1493 for ( ; xi != xe ; ++xi )
1498 if ( maxi > themax )
1515 for ( ; xi != xe ; ++xi )
1520 if ( mini < themin )
1550 return tv(b, p, r, c);
ConstIterator3D end() const
Return const iterator behind last row.
void resize(Index b, Index p, Index r, Index c)
Resize function.
Range mpr
The page range of mdata that is actually used.
The declarations of all the exception classes.
ConstIterator4D end() const
Return const iterator behind last book.
Tensor4View()
Default constructor.
Numeric min(const ConstTensor4View &x)
Min function, tensor version.
void transform(Tensor4View y, double(&my_func)(double), ConstTensor4View x)
A generic transform function for tensors, which can be used to implement mathematical functions opera...
Tensor4View & operator*=(Numeric x)
Multiplication by scalar.
Range mbr
The book range of mdata that is actually used.
ConstTensor4View operator()(const Range &b, const Range &p, const Range &r, const Range &c) const
Const index operator for subrange.
Range mcr
The column range of mdata that is actually used.
virtual ~Tensor4()
Destructor for Tensor4.
Tensor4 & operator=(const Tensor4 &x)
Assignment operator from another tensor.
Index mstart
The start index.
Tensor4()
Default constructor.
Tensor3View * operator->()
The -> operator is needed, so that we can write i->begin() to get the 3D iterators.
Const version of Iterator4D.
A constant view of a Tensor4.
Tensor4View & operator+=(Numeric x)
Addition of scalar.
const ConstTensor3View * operator->() const
The -> operator is needed, so that we can write i->begin() to get the 3D iterators.
ConstIterator3D begin() const
Return const iterator to first page.
Numeric debug_tensor4view_get_elem(Tensor4View &tv, Index b, Index p, Index r, Index c)
Helper function to access tensor elements.
Index ncols() const
Returns the number of columns.
ConstIterator4D begin() const
Return const iterator to first book.
NUMERIC Numeric
The type to use for all floating point numbers.
Index npages() const
Returns the number of pages.
Index nbooks() const
Returns the number of books.
Tensor4View & operator=(const ConstTensor4View &v)
Assignment operator.
ConstIterator4D end() const
Return const iterator behind last book.
Tensor3View msv
Current position.
Tensor4View & operator/=(Numeric x)
Division by scalar.
A constant view of a Matrix.
ConstIterator4D begin() const
Return const iterator to first book.
Index nrows() const
Returns the number of rows.
ConstIterator3D end() const
Return const iterator behind last page.
const ConstTensor3View & operator*() const
Dereferencing.
Index mextent
The number of elements.
Tensor3View & operator*()
Dereferencing.
Implementation of Tensors of Rank 4.
ConstIterator3D begin() const
Return const iterator to first row.
void copy(ConstIterator4D origin, const ConstIterator4D &end, Iterator4D target)
Copy data between begin and end to target.
ConstTensor4View operator()(const Range &b, const Range &p, const Range &r, const Range &c) const
Const index operator for subrange.
Range mrr
The row range of mdata that is actually used.
A constant view of a Tensor3.
ConstTensor3View msv
Current position.
Tensor4View & operator-=(Numeric x)
Subtraction of scalar.
INDEX Index
The type to use for all integer numbers and indices.
ostream & operator<<(ostream &os, const ConstTensor4View &v)
Output operator.
Numeric max(const ConstTensor4View &x)
Max function, tensor version.
ConstTensor4View()
Default constructor.
A constant view of a Vector.
const Numeric * get_c_array() const
Conversion to plain C-array.
Numeric * mdata
Pointer to the plain C array that holds the data.