Go to the documentation of this file.
28 using std::runtime_error;
121 const Range& c)
const
138 const Range& c)
const
155 const Range& c)
const
212 const Range& c)
const
232 const Range& c)
const
272 const Range& c)
const
361 const Range& c)
const
391 throw std::runtime_error(
"A Tensor4View can only be converted to a plain C-array if it's pointing to a continuous block of data");
408 throw std::runtime_error(
"A Tensor4View can only be converted to a plain C-array if it's pointing to a continuous block of data");
432 mbr(0,1,a.mpr.mextent*a.mrr.mextent*a.mcr.mextent),
505 if ( ib != end_book ) {
510 for ( ; ib != end_book; ++ib ) {
529 const Range& c)
const
553 const Range& c)
const
565 const Range& c)
const
577 const Range& c)
const
613 const Range& c)
const
625 const Range& c)
const
649 const Range& c)
const
697 const Range& c)
const
1138 for ( ; b !=
eb ; ++b, ++xb )
1155 for ( ; b !=
eb ; ++b, ++xb )
1172 for ( ; b !=
eb ; ++b, ++xb )
1189 for ( ; b !=
eb ; ++b, ++xb )
1271 for ( ; origin != end ; ++origin, ++target )
1284 for ( ; target != end ; ++target )
1310 Range( 0, b, p*r*c ),
1321 Range( 0, b, p*r*c ),
1337 Range( 0, m.nbooks(), m.npages()*m.nrows()*m.ncols() ),
1338 Range( 0, m.npages(), m.nrows()*m.ncols() ),
1339 Range( 0, m.nrows(), m.ncols() ),
1340 Range( 0, m.ncols() ) )
1349 Range( 0, m.nbooks(), m.npages()*m.nrows()*m.ncols() ),
1350 Range( 0, m.npages(), m.nrows()*m.ncols() ),
1351 Range( 0, m.nrows(), m.ncols() ),
1352 Range( 0, m.ncols() ) )
1474 double (&my_func)(
double),
1486 for ( ; xi != xe; ++xi, ++yi )
1504 for ( ; xi != xe ; ++xi )
1509 if ( maxi > themax )
1526 for ( ; xi != xe ; ++xi )
1531 if ( mini < themin )
1561 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.
Tensor4 & operator=(Tensor4 x)
Assignment operator from another tensor.
Tensor4View()
Default constructor.
void swap(Tensor4 &t1, Tensor4 &t2)
Swaps two objects.
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.
friend void swap(Tensor4 &t1, Tensor4 &t2)
Swaps two objects.
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.
std::ostream & operator<<(std::ostream &os, const ConstTensor4View &v)
Output operator.
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.
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.