IMP logo

IMP::algebra::Matrix3D< T > Class Template Reference


Detailed Description

template<typename T>
class IMP::algebra::Matrix3D< T >

Template class for managing 3D matrices. This class is based on boost multi_array. Check MultiArray class for a list of added functionality
Inheritance diagram for IMP::algebra::Matrix3D< T >:

Inheritance graph
[legend]

Public Types

typedef
boost::multi_array_types::index 
index
typedef MultiArray< T, 3 > MA3
typedef Matrix3D< T > This

Public Member Functions

template<typename T1 >
void cast_values (Matrix3D< T1 > &out)
 Cast values.
int get_number_of_columns () const
 Returns the number of columns in the matrix.
int get_number_of_rows () const
 Returns the number of rows in the matrix.
int get_number_of_slices () const
 Returns the number of slices in the matrix.
 Matrix3D (const This &v)
 Matrix3D (int Zdim, int Ydim, int Xdim)
 Constructor.
 Matrix3D ()
 Empty constructor.
template<typename T1 >
T & operator() (T1 &idx) const
T & operator() (int k, int j, int i) const
This operator* (const T &v) const
 Multiplication operator for an array and a scalar.
This operator* (const This &v) const
 Multiplication operator.
Thisoperator*= (const T &v)
 Multiplication operator for an array and a scalar.
Thisoperator*= (const This &v)
 Multiplication operator.
This operator+ (const T &v) const
 Sum operator for an array and a scalar.
This operator+ (const This &v) const
 Sum operator.
Thisoperator+= (const T &v)
 Addition operator for an array and a scalar.
Thisoperator+= (const This &v)
 Addition operator.
This operator- (const T &v) const
 Minus operator for an array and a scalar.
This operator- (const This &v) const
 Minus operator.
Thisoperator-= (const T &v)
 Substraction operator for an array and a scalar.
Thisoperator-= (const This &v)
 Substraction operator.
This operator/ (const T &v) const
 Division operator for an array and a scalar.
This operator/ (const This &v) const
 Division operator.
Thisoperator/= (const T &v)
 Division operator for an array and a scalar.
Thisoperator/= (const This &v)
 Division operator.
void operator= (const This &v)
void pad (This &padded)
void pad (This &padded, T val)
template<typename T1 >
void reshape (const Matrix3D< T1 > &v)
 Reshapes the matrix copying the size and range of a given one.
template<typename T1 >
void resize (const Matrix3D< T1 > &v)
 Resizes the matrix copying the size of a given one.
void resize (int Zdim, int Ydim, int Xdim)
 Resizes the matrix.

Friends

This operator* (const T &X, const This &a1)
 Multiplication operator for a scalar and an array.
This operator+ (const T &X, const This &a1)
 Sum operator for a scalar and an array.
This operator- (const T &X, const This &a1)
 Minus operator for a scalar and an array.
This operator/ (const T &X, const This &a1)
 Division operator for a scalar and an array.

Related Functions

(Note that these are not member functions.)

template<typename T >
interpolate (algebra::Matrix3D< T > &m, VectorD< 3 > &idx, bool wrap=false, T outside=0.0, int interp=0)
 General function to call in case of interpolation in 3D matrices.
template<typename T >
trilinear_interpolation (Matrix3D< T > &m, VectorD< 3 > &idx, bool wrap, T outside)
 Trilinear interpolation for a point using the 8 closest values in the matrix.

Member Function Documentation

template<typename T>
template<typename T1 >
T& IMP::algebra::Matrix3D< T >::operator() ( T1 &  idx  )  const

Access operator. The returned element is the LOGICAL element of the matrix, NOT the direct one

Parameters:
[in] idx must be a class supporting access via []

template<typename T>
T& IMP::algebra::Matrix3D< T >::operator() ( int  k,
int  j,
int  i 
) const

Access operator. The returned element is the LOGICAL element of the matrix, NOT the direct one

Parameters:
[in] k first index
[in] j second index
[in] i third index

template<typename T>
void IMP::algebra::Matrix3D< T >::pad ( This padded  ) 

Pad the MultiArray. Padding is defined as doubling the size in each dimension and fill the new values with the previous average value.

Parameters:
[in] padded the MultiArray padded

template<typename T>
void IMP::algebra::Matrix3D< T >::pad ( This padded,
val 
)

Pad with a given value. Padding is defined as doubling the size in each dimension and fill the new values with the value.

Parameters:
[out] padded the output MultiArray
[in] val the value to pad with

template<typename T>
template<typename T1 >
void IMP::algebra::Matrix3D< T >::reshape ( const Matrix3D< T1 > &  v  ) 

Reshapes the matrix copying the size and range of a given one.

Parameters:
[in] v Matrix3D whose shape to copy

template<typename T>
template<typename T1 >
void IMP::algebra::Matrix3D< T >::resize ( const Matrix3D< T1 > &  v  ) 

Resizes the matrix copying the size of a given one.

Parameters:
[in] v Matrix3D whose size to copy

template<typename T>
void IMP::algebra::Matrix3D< T >::resize ( int  Zdim,
int  Ydim,
int  Xdim 
)

Resizes the matrix.

Parameters:
[in] Zdim Number of slices
[in] Ydim Number of rows
[in] Xdim Number of columns


Friends And Related Function Documentation

template<typename T >
T interpolate ( algebra::Matrix3D< T > &  m,
VectorD< 3 > &  idx,
bool  wrap = false,
outside = 0.0,
int  interp = 0 
) [related]

General function to call in case of interpolation in 3D matrices.

Parameters:
[in] m The matrix to interpolate within.
[in] idx must be a class supporting access via [] and must have 2 elements.
[in] wrap If true, the matrix is wrapped: values from the right are used when the left limit is excedeed, and viceversa. Same thing for other dimensions.
[in] outside Value to apply if the requested idx falls outside the limits of the matrix. (Never used if wrap is requested)
[in] interp Interpolation method desired. Right now it is only trilinear interpolation

template<typename T >
T trilinear_interpolation ( Matrix3D< T > &  m,
VectorD< 3 > &  idx,
bool  wrap,
outside 
) [related]

Trilinear interpolation for a point using the 8 closest values in the matrix.

Parameters:
[in] m the 3D Matrix
[in] idx Vector with the values to interpolate
[in] wrap If true, the matrix is wrapped and values from the right are used when the left limit is excedeed, and viceversa. Same thing is done in other dimensions.
[in] outside Value to apply if the requested idx falls outside the limits of the matrix. (It is never used if wrap is requested)


The documentation for this class was generated from the following files:

Generated on Mon Mar 8 23:08:47 2010 for IMP by doxygen 1.5.8