MatrixFunctions::MatrixResource< T > Class Template Reference

This is a Resource class that creates and destroys two-dimensional matrices. More...

#include <MatrixFunctions.h>

Inheritance diagram for MatrixFunctions::MatrixResource< T >:

Inheritance graph

List of all members.

Public Member Functions

 MatrixResource (const int &numRows, const int &numCols, const T *pInitialData=NULL)
 operator T ** ()
 operator const T ** () const
T *& operator[] (const int &index)
const T *& operator[] (const int &index) const


Detailed Description

template<typename T>
class MatrixFunctions::MatrixResource< T >

This is a Resource class that creates and destroys two-dimensional matrices.

This is a Resource class that creates and destroys two-dimensional matrices. It has a conversion operator to allow a MatrixResource object to be used whereever a double** would normally be used.

Definition at line 94 of file MatrixFunctions.h.


Constructor & Destructor Documentation

template<typename T>
MatrixFunctions::MatrixResource< T >::MatrixResource ( const int &  numRows,
const int &  numCols,
const T *  pInitialData = NULL 
)

Constructs a Resource object that wraps a double**.

Constructs a Resource object that wraps a double**. Creates a matrix of the specified size with (optional) initial data.

Parameters:
numRows The number of rows to allocate. This parameter cannot be less than or equal to 0.
numCols The number of columns to allocate. This parameter cannot be less than or equal to 0.
pInitialData The initial values to copy into the matrix. There should be numRows * numCols elements available in this buffer. If this parameter is NULL, the returned matrix will be set to 0 before returning.

Definition at line 116 of file MatrixFunctions.h.


Member Function Documentation

template<typename T>
MatrixFunctions::MatrixResource< T >::operator T ** (  ) 

Returns a pointer to the underlying T**.

Returns a pointer to the underlying T**. This operator allows the MatrixResource object to be used whereever a T** would normally be used.

Returns:
A pointer to the underlying T**.

Definition at line 128 of file MatrixFunctions.h.

template<typename T>
MatrixFunctions::MatrixResource< T >::operator const T ** (  )  const

Returns a const pointer to the underlying T**.

Returns a const pointer to the underlying T**. This operator allows the MatrixResource object to be used whereever a const T** would normally be used.

Returns:
A const pointer to the underlying T**.

Definition at line 142 of file MatrixFunctions.h.

template<typename T>
T*& MatrixFunctions::MatrixResource< T >::operator[] ( const int &  index  ) 

Returns a pointer to a row.

Parameters:
index The zero-based row to obtain.
Warning:
This overload is only valid for int variables.
Returns:
A pointer to the requested row.

Definition at line 157 of file MatrixFunctions.h.

template<typename T>
const T*& MatrixFunctions::MatrixResource< T >::operator[] ( const int &  index  )  const

Returns a const pointer to a row.

Parameters:
index The zero-based row to obtain.
Warning:
This overload is only valid for int variables.
Returns:
A const pointer to the requested row.

Definition at line 173 of file MatrixFunctions.h.


Software Development Kit - Opticks 4.9.0 Build 16218