Go to the documentation of this file.
161 mpr(0,1,a.mrr.mextent*a.mcr.mextent),
172 mpr(0,0,1), mrr(0,0,1), mcr(0,0,1), mdata(NULL)
230 for ( ; ip!=end_page; ++ip )
249 const Range& c)
const
271 const Range& c)
const
282 const Range& c)
const
293 const Range& c)
const
441 throw runtime_error(
"A Tensor3View can only be converted to a plain C-array if 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");
457 throw runtime_error(
"A Tensor3View can only be converted to a plain C-array if 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");
608 for ( ; p!=ep ; ++p,++xp )
624 for ( ; p!=ep ; ++p,++xp )
640 for ( ; p!=ep ; ++p,++xp )
656 for ( ; p!=ep ; ++p,++xp )
666 Range(0,1,a.mrr.mextent*a.mcr.mextent),
729 for ( ; origin!=end ; ++origin,++target )
744 for ( ; target!=end ; ++target )
795 Range( 0, m.npages(), m.nrows()*m.ncols() ),
796 Range( 0, m.nrows(), m.ncols() ),
797 Range( 0, m.ncols() ) )
806 Range( 0, m.npages(), m.nrows()*m.ncols() ),
807 Range( 0, m.nrows(), m.ncols() ),
808 Range( 0, m.ncols() ) )
916 double (&my_func)(
double),
927 for ( ; xi!=xe; ++xi, ++yi )
945 for ( ; xi!=xe ; ++xi )
967 for ( ; xi!=xe ; ++xi )
Tensor3View()
Default constructor.
ConstIterator3D end() const
Return const iterator behind last row.
The declarations of all the exception classes.
ConstTensor3View operator()(const Range &p, const Range &r, const Range &c) const
Const index operator for subrange.
ostream & operator<<(ostream &os, const ConstTensor3View &v)
Output operator.
Const version of Iterator3D.
ConstTensor3View()
Default constructor.
ConstTensor3View operator()(const Range &p, const Range &r, const Range &c) const
Const index operator for subrange.
virtual ~Tensor3()
Destructor for Tensor3.
Index mstart
The start index.
Numeric add(Numeric x, Numeric y)
void resize(Index p, Index r, Index c)
Resize function.
Tensor3View & operator-=(Numeric x)
Subtraction of scalar.
Index npages() const
Returns the number of pages.
Implementation of Tensors of Rank 3.
ConstIterator2D begin() const
Return const iterator to first row.
ConstIterator2D end() const
Return const iterator behind last row.
ConstIterator3D begin() const
Return const iterator to first page.
Range mrr
The row range of mdata that is actually used.
Range mcr
The column range of mdata that is actually used.
Range mpr
The page range of mdata that is actually used.
NUMERIC Numeric
The type to use for all floating point numbers.
void transform(Tensor3View y, double(&my_func)(double), ConstTensor3View x)
A generic transform function for tensors, which can be used to implement mathematical functions opera...
Numeric * mdata
Pointer to the plain C array that holds the data.
Numeric debug_tensor3view_get_elem(Tensor3View &tv, Index p, Index r, Index c)
Helper function to access tensor elements.
Tensor3View & operator/=(Numeric x)
Division by scalar.
Index nrows() const
Returns the number of rows.
A constant view of a Matrix.
Tensor3View & operator*=(Numeric x)
Multiplication by scalar.
ConstIterator3D end() const
Return const iterator behind last page.
Numeric max(const ConstTensor3View &x)
Max function, tensor version.
Index mextent
The number of elements.
ConstIterator2D end() const
Return const iterator behind last row.
Index ncols() const
Returns the number of columns.
ConstIterator3D begin() const
Return const iterator to first row.
A constant view of a Tensor3.
Tensor3 & operator=(const Tensor3 &x)
Assignment operator from another tensor.
ConstIterator2D begin() const
Return const iterator to first row.
Tensor3View & operator+=(Numeric x)
Addition of scalar.
INDEX Index
The type to use for all integer numbers and indices.
Tensor3View & operator=(const ConstTensor3View &v)
Assignment operator.
const Numeric * get_c_array() const
Conversion to plain C-array.
Numeric min(const ConstTensor3View &x)
Min function, tensor version.
A constant view of a Vector.
Tensor3()
Default constructor.
void copy(ConstIterator3D origin, const ConstIterator3D &end, Iterator3D target)
Copy data between begin and end to target.