![]() |
Rosetta
2019.07
|
#include <MathNTensor.hh>
Public Types | |
typedef numeric::Size | Size |
typedef MathNTensorBase< T > | parent |
![]() | |
typedef numeric::Size | Size |
Public Member Functions | |
MathNTensor () | |
Default constructor – make a MathNTensor that's 0-dimensional with 0 elements. More... | |
MathNTensor (utility::fixedsizearray1< Size, N > const &n_bins, T const &value=T()) | |
Constructor: make a MathNTensor from fixedsizearray of dims and single element. More... | |
MathNTensor (utility::vector1< Size > const &n_bins, T const &value=T()) | |
Constructor: make a MathNTensor from vector of dims and single element. More... | |
MathNTensor (MathNTensor const &src) | |
Copy constructor. More... | |
MathNTensorBaseOP< T > | clone () const override |
Implementation of pure virtual clone function from base class. More... | |
MathNTensor< T, N > & | operator= (MathNTensor< T, N > const &rhs) |
Assignment operator. More... | |
~MathNTensor () | |
Destructor. More... | |
T | sum () const |
bool | is_valid_position (utility::fixedsizearray1< Size, N > const &positions) const |
Is the position in the N-Tensor given by the positions vector a valid position? More... | |
bool | is_valid_position (utility::vector1< Size > const &positions) const override |
Is the given coordinate a valid position in the tensor? More... | |
void | set_value (utility::vector1< Size > const &position, T const &value_in) override |
Set a value in a tensor. More... | |
T const & | value (utility::vector1< Size > const &position) const override |
Get a value from a tensor. More... | |
MathNTensor (utility::fixedsizearray1< Size, N > const &n_bins, T const *data) | |
Raw pointer constructor. Avoid this. More... | |
Size | n_bins (Size const dimension) const override |
return number of bins for ith dimension More... | |
T | min () const override |
Get the minimum value stored in this tensor. More... | |
T | max () const override |
Get the maximum value stored in this tensor. More... | |
Size | num_dimensions () const |
Return number of dimensions overall (i.e. the dimensionality of this MathNTensor). More... | |
void | replace_layer (Size layer, MathNTensor< T, N-1 > const &matrix) |
Copies elements of argument matrix into this object at position ( layer ) More... | |
T const & | data (Size const index) const |
void | replace_layer (Size const layer, MathMatrix< T > const &matrix) |
ONLY for 3-dimensional tensors, replace a layer with a 2D matrix. More... | |
MathMatrix< T > | get_mathmatrix () |
ONLY for 2-dimensional tensors, give me a MathMatrix that's identical to the tensor. (That is, convert the MathNTensor to MathMatrix form. More... | |
T & | operator() (utility::fixedsizearray1< Size, N > const &position) |
Access a position in the N-dimensional tensor. More... | |
T const & | operator() (utility::fixedsizearray1< Size, N > const &position) const |
Use an N-vector of coordinates to access a position in the N-dimensional tensor. More... | |
T & | operator() (utility::vector1< Size > const &position) |
T const & | operator() (utility::vector1< Size > const &position) const |
T & | operator() (Size const b1, Size const b2) |
T & | operator() (Size const b1, Size const b2) const |
T & | operator() (Size const b1, Size const b2, Size const b3) |
T const & | operator() (Size const b1, Size const b2, Size const b3) const |
T & | operator() (Size const b1, Size const b2, Size const b3, Size const b4) |
T const & | operator() (Size const b1, Size const b2, Size const b3, Size const b4) const |
T const & | operator() (Size const b1, Size const b2, Size const b3, Size const b4, Size const b5) const |
T const & | operator() (Size const b1, Size const b2, Size const b3, Size const b4, Size const b5, Size const b6) const |
void | operator/= (Real const divisor) |
Size | size () const |
utility::fixedsizearray1< Size, N > const & | n_bins () const |
![]() | |
MathNTensorBase () | |
Default constructor. More... | |
virtual | ~MathNTensorBase () |
Virtual destructor needed for polymorphism. More... | |
MathNTensorBase (Size const dimensionality_in) | |
Costructor with dimensionality value. More... | |
Size | dimensionality () const |
Get the dimensionality of derived classes. More... | |
Private Attributes | |
utility::fixedsizearray1< Size, N > | n_bins_ |
Size | size_ |
The total number of bins in the MathNTensor (the product of all dimensions). More... | |
T * | data_ |
Array of data stored in this N-tensor. More... | |
Additional Inherited Members | |
![]() | |
void | set_dimensionality (Size const dimensionality_in) |
Lets the derived class set the dimensionality stored in the base class. More... | |
typedef MathNTensorBase<T> numeric::MathNTensor< T, N >::parent |
typedef numeric::Size numeric::MathNTensor< T, N >::Size |
|
inline |
Default constructor – make a MathNTensor that's 0-dimensional with 0 elements.
|
inline |
Constructor: make a MathNTensor from fixedsizearray of dims and single element.
The single element gets copied to every entry in the MathNTensor, initializing it.
|
inline |
Constructor: make a MathNTensor from vector of dims and single element.
The single element gets copied to every entry in the MathNTensor, initializing it.
|
inline |
Copy constructor.
|
inline |
Destructor.
|
inline |
Raw pointer constructor. Avoid this.
|
inlineoverridevirtual |
Implementation of pure virtual clone function from base class.
Creates a copy of this object and returns an owning pointer to the copy. Must be implemented by derived classes.
Implements numeric::MathNTensorBase< T >.
|
inline |
Referenced by numeric::write_tensor_to_file_without_json().
|
inline |
ONLY for 2-dimensional tensors, give me a MathMatrix that's identical to the tensor. (That is, convert the MathNTensor to MathMatrix form.
Throws if this is not a 2D tensor.
|
inline |
Is the position in the N-Tensor given by the positions vector a valid position?
Returns true if each coordinate is in the range [1, dimension], false otherwise.
Referenced by numeric::interpolation::get_val(), numeric::MathNTensor< double, 2 >::operator()(), numeric::MathNTensor< double, 2 >::replace_layer(), numeric::MathNTensor< double, 2 >::set_value(), and numeric::MathNTensor< double, 2 >::value().
|
inlineoverridevirtual |
Is the given coordinate a valid position in the tensor?
Returns false if out of range. Pure virtual; must be implemented by derived classes.
Implements numeric::MathNTensorBase< T >.
|
inlineoverridevirtual |
Get the maximum value stored in this tensor.
Implements pure virtual from base class.
Implements numeric::MathNTensorBase< T >.
|
inlineoverridevirtual |
Get the minimum value stored in this tensor.
Implements pure virtual from base class.
Implements numeric::MathNTensorBase< T >.
|
inlineoverridevirtual |
return number of bins for ith dimension
Implements numeric::MathNTensorBase< T >.
Referenced by numeric::interpolation::get_val(), numeric::interpolation::multilinear_interpolation(), numeric::interpolation::spline::PolycubicSpline< N >::train(), and numeric::write_tensor_to_file().
|
inline |
Referenced by numeric::MathNTensor< double, 2 >::operator()().
|
inline |
Return number of dimensions overall (i.e. the dimensionality of this MathNTensor).
|
inline |
Access a position in the N-dimensional tensor.
Accessors, both as const and nonconst reference and via fixedsizearray1, vector1, or sequences of values.
|
inline |
Use an N-vector of coordinates to access a position in the N-dimensional tensor.
Const access (assignment prohibited).
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Assignment operator.
|
inline |
Copies elements of argument matrix into this object at position ( layer )
layer is the FIRST index.
|
inline |
ONLY for 3-dimensional tensors, replace a layer with a 2D matrix.
|
inlineoverridevirtual |
Set a value in a tensor.
Note that bounds-checking only occurs in debug builds!
Implements numeric::MathNTensorBase< T >.
|
inline |
Referenced by numeric::write_tensor_to_file_without_json().
|
inline |
|
inlineoverridevirtual |
Get a value from a tensor.
Note that bounds-checking only occurs in debug builds!
Implements numeric::MathNTensorBase< T >.
Referenced by numeric::MathNTensor< double, 2 >::MathNTensor().
|
private |
Array of data stored in this N-tensor.
Referenced by numeric::MathNTensor< double, 2 >::data(), numeric::MathNTensor< double, 2 >::get_mathmatrix(), numeric::MathNTensor< double, 2 >::MathNTensor(), numeric::MathNTensor< double, 2 >::max(), numeric::MathNTensor< double, 2 >::min(), numeric::MathNTensor< double, 2 >::operator()(), numeric::MathNTensor< double, 2 >::operator/=(), numeric::MathNTensor< double, 2 >::operator=(), numeric::MathNTensor< double, 2 >::replace_layer(), numeric::MathNTensor< double, 2 >::sum(), and numeric::MathNTensor< double, 2 >::~MathNTensor().
|
private |
Referenced by numeric::MathNTensor< double, 2 >::get_mathmatrix(), numeric::MathNTensor< double, 2 >::is_valid_position(), numeric::MathNTensor< double, 2 >::MathNTensor(), numeric::MathNTensor< double, 2 >::n_bins(), numeric::MathNTensor< double, 2 >::operator()(), numeric::MathNTensor< double, 2 >::operator=(), and numeric::MathNTensor< double, 2 >::replace_layer().
|
private |
The total number of bins in the MathNTensor (the product of all dimensions).
Referenced by numeric::MathNTensor< double, 2 >::data(), numeric::MathNTensor< double, 2 >::MathNTensor(), numeric::MathNTensor< double, 2 >::max(), numeric::MathNTensor< double, 2 >::min(), numeric::MathNTensor< double, 2 >::operator/=(), numeric::MathNTensor< double, 2 >::operator=(), numeric::MathNTensor< double, 2 >::size(), and numeric::MathNTensor< double, 2 >::sum().