Go to the documentation of this file.
28 using std::runtime_error;
164 mpr(0,1,a.mrr.mextent*a.mcr.mextent),
175 mpr(0,0,1), mrr(0,0,1), mcr(0,0,1), mdata(NULL)
233 for ( ; ip!=end_page; ++ip )
252 const Range& c)
const
274 const Range& c)
const
285 const Range& c)
const
296 const Range& c)
const
444 throw std::runtime_error(
"A Tensor3View can only be converted to a plain C-array if it's pointing to a continuous block of data");
460 throw std::runtime_error(
"A Tensor3View can only be converted to a plain C-array if it's pointing to a continuous block of data");
611 for ( ; p!=ep ; ++p,++xp )
627 for ( ; p!=ep ; ++p,++xp )
643 for ( ; p!=ep ; ++p,++xp )
659 for ( ; p!=ep ; ++p,++xp )
669 Range(0,1,a.mrr.mextent*a.mcr.mextent),
732 for ( ; origin!=end ; ++origin,++target )
747 for ( ; target!=end ; ++target )
798 Range( 0, m.npages(), m.nrows()*m.ncols() ),
799 Range( 0, m.nrows(), m.ncols() ),
800 Range( 0, m.ncols() ) )
809 Range( 0, m.npages(), m.nrows()*m.ncols() ),
810 Range( 0, m.nrows(), m.ncols() ),
811 Range( 0, m.ncols() ) )
926 double (&my_func)(
double),
937 for ( ; xi!=xe; ++xi, ++yi )
955 for ( ; xi!=xe ; ++xi )
977 for ( ; xi!=xe ; ++xi )
1036 assert(A.
nrows() ==
C.nrows());
1037 assert(A.
ncols() ==
C.ncols());
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.
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.
void swap(Tensor3 &t1, Tensor3 &t2)
Swaps two objects.
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.
Index nelem() const
Returns the number of elements.
void mult(Tensor3View A, const ConstVectorView B, const ConstMatrixView C)
mult Tensor3
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.
Tensor3 & operator=(Tensor3 x)
Assignment operator from another tensor.
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.
friend void swap(Tensor3 &t1, Tensor3 &t2)
Swaps two objects.
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.
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.
std::ostream & operator<<(std::ostream &os, const ConstTensor3View &v)
Output operator.
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.