ERC CISST - cisst software

nmrIsOrthonormalDynamicData< _elementType > Class Template Reference
[Numerical Methods]

#include <nmrIsOrthonormal.h>

Collaboration diagram for nmrIsOrthonormalDynamicData< _elementType >:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<class _elementType>
class nmrIsOrthonormalDynamicData< _elementType >

Data (workspace) for nmrIsOrthonormal (Dynamic).

Any size mismatch will lead to an exception thrown (std::runtime_error). Since we are using cmnThrow, it is possible to configure cisst (at compilation time) to abort the program instead of throwing an exception.

The nmrIsOrthonormalDynamicData class allows 2 different configurations:

See also:
nmrIsOrthonormal

Definition at line 65 of file nmrIsOrthonormal.h.

Public Types

Public Member Functions

Static Public Member Functions

Protected Member Functions

Protected Attributes


Member Typedef Documentation

template<class _elementType>
typedef vct::size_type nmrIsOrthonormalDynamicData< _elementType >::size_type

Type used for sizes within nmrIsOrthonormalDynamicData.

Definition at line 69 of file nmrIsOrthonormal.h.


Constructor & Destructor Documentation

template<class _elementType>
nmrIsOrthonormalDynamicData< _elementType >::nmrIsOrthonormalDynamicData (  )  [inline]

The default constuctor. For dynamic size, there are assigned default values, i.e. sets all the dimensions to zero. These MUST be changed by calling the appropriate method.

See also:
nmrIsOrthonormalDynamicData::Allocate nmrIsOrthonormalDynamicData::SetRef

Definition at line 198 of file nmrIsOrthonormal.h.

References nmrIsOrthonormalDynamicData< _elementType >::AllocateWorkspace().

template<class _elementType>
nmrIsOrthonormalDynamicData< _elementType >::nmrIsOrthonormalDynamicData ( size_type  m  )  [inline]

Constructor where the user specifies the size. Memory allocation is performed for the workspace. This should be used when the user doesn't need to share the workspace between different algorithms.

Parameters:
m Number of rows of the matrix to be decomposed. The matrix must be square.
See also:
nmrIsOrthonormalDynamicData::Allocate

Definition at line 214 of file nmrIsOrthonormal.h.

References nmrIsOrthonormalDynamicData< _elementType >::Allocate().

template<class _elementType>
template<class __matrixOwnerTypeA>
nmrIsOrthonormalDynamicData< _elementType >::nmrIsOrthonormalDynamicData ( const vctDynamicConstMatrixBase< __matrixOwnerTypeA, _elementType > &  A  )  [inline]

Constructor where the user provides the input matrix to specify the size. Memory allocation is performed for the workspace. This should be used when the user doesn't need to share the workspace between different algorithms.

Parameters:
A input matrix
See also:
nmrIsOrthonormalDynamicData::Allocate

Definition at line 229 of file nmrIsOrthonormal.h.

References nmrIsOrthonormalDynamicData< _elementType >::Allocate().

template<class _elementType>
template<class __matrixOwnerTypeA, class __vectorOwnerTypeWorkspace>
nmrIsOrthonormalDynamicData< _elementType >::nmrIsOrthonormalDynamicData ( const vctDynamicConstMatrixBase< __matrixOwnerTypeA, _elementType > &  A,
vctDynamicVectorBase< __vectorOwnerTypeWorkspace, _elementType > &  inWorkspace 
) [inline]

Constructor where the user provides the input matrix to specify the size and storage order. There is no memory allocation performed in this case. This constructor should be used when the user cares wants to avoid allocating different workspaces for different numerical routines. Please note that since multiple routines can share the workspace, these routines must be called in a thread safe manner.

Parameters:
A input matrix
inWorkspace workspace
See also:
nmrIsOrthonormalDynamicData::SetRefWorkspace

Definition at line 248 of file nmrIsOrthonormal.h.

References nmrIsOrthonormalDynamicData< _elementType >::SetRef().


Member Function Documentation

template<class _elementType>
void nmrIsOrthonormalDynamicData< _elementType >::SetDimension ( size_type  m  )  [inline, protected]

Private method to set the data member Size. This method must be called before AllocateWorkspace or ThrowUnlessWorkspaceSizeIsCorrect.

Definition at line 78 of file nmrIsOrthonormal.h.

References nmrIsOrthonormalDynamicData< _elementType >::Size.

Referenced by nmrIsOrthonormalDynamicData< _elementType >::Allocate(), and nmrIsOrthonormalDynamicData< _elementType >::SetRef().

template<class _elementType>
void nmrIsOrthonormalDynamicData< _elementType >::AllocateWorkspace ( bool  allocateWorkspace  )  [inline, protected]

Private method to allocate memory for the workspace if needed. This method assumes that the size of the problem has been set. It is important to use this method in all the methods provided in the user API, even if all the memory is provided by the user since this method will ensure that the data (nmrIsOrthonormalDynamicData) does not keep any memory allocated. This is for the case where a single data object is used first to allocate everything and, later on, used with user allocated memory (for either the workspace or the output). For example:

      vctDynamicMatrix<double> A(20, 20);
      vctRandom(A, 10, 10);
      nmrIsOrthonormalDynamicData data(A); // allocate workspace
      vctDynamicVector<double> workspace(nmrIsOrthonormalDynamicData::WorkspaceSize(A));
      data.SetRef(A, workspace); // after all, use my own workspace

Note:
The method SetDimension must have been called before.

Definition at line 103 of file nmrIsOrthonormal.h.

References nmrIsOrthonormalDynamicData< _elementType >::Size, nmrIsOrthonormalDynamicData< _elementType >::WorkspaceMemory, and nmrIsOrthonormalDynamicData< _elementType >::WorkspaceReference.

Referenced by nmrIsOrthonormalDynamicData< _elementType >::Allocate(), nmrIsOrthonormalDynamicData< _elementType >::nmrIsOrthonormalDynamicData(), and nmrIsOrthonormalDynamicData< _elementType >::SetRef().

template<class _elementType>
template<typename __vectorOwnerTypeWorkspace>
void nmrIsOrthonormalDynamicData< _elementType >::ThrowUnlessWorkspaceSizeIsCorrect ( vctDynamicVectorBase< __vectorOwnerTypeWorkspace, _elementType > &  inWorkspace  )  const throw (std::runtime_error) [inline, protected]

Verifies that the user provided references for the workspace match (or is greated than) the size of the data object as set by SetDimension. This method also checks that the workspace is compact.

Note:
The method SetDimension must have been called before.

Definition at line 122 of file nmrIsOrthonormal.h.

References cmnThrow(), and nmrIsOrthonormalDynamicData< _elementType >::Size.

Referenced by nmrIsOrthonormalDynamicData< _elementType >::SetRef().

template<class _elementType>
static size_type nmrIsOrthonormalDynamicData< _elementType >::WorkspaceSize ( size_type  m  )  [inline, static]

Helper methods for user to set minimum working space required for nmrIsOrthonormal.

Parameters:
m The number or rows of matrix to be tested. The matrix must be square.

Definition at line 149 of file nmrIsOrthonormal.h.

Referenced by nmrIsOrthonormalDynamicData< _elementType >::WorkspaceSize().

template<class _elementType>
template<class __matrixOwnerTypeA>
static size_type nmrIsOrthonormalDynamicData< _elementType >::WorkspaceSize ( const vctDynamicConstMatrixBase< __matrixOwnerTypeA, _elementType > &  A  )  [inline, static]

Helper methods for user to set minimum working space required for nmrIsOrthonormal.

Parameters:
A The matrix to be tested. A must be square.

Definition at line 160 of file nmrIsOrthonormal.h.

References vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::rows(), and nmrIsOrthonormalDynamicData< _elementType >::WorkspaceSize().

template<class _elementType>
template<class __matrixOwnerTypeA>
void nmrIsOrthonormalDynamicData< _elementType >::Allocate ( const vctDynamicConstMatrixBase< __matrixOwnerTypeA, _elementType > &  A  )  [inline]

This method allocates memory for the workspace. The input matrix is used only to determine the size of the problem.

This method should be called before the nmrIsOrthonormalDynamicData object is passed on to nmrIsOrthonormal function.

Parameters:
A The matrix to be used with nmrIsOrthonormal.

Definition at line 264 of file nmrIsOrthonormal.h.

References vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::rows().

Referenced by nmrIsOrthonormal(), and nmrIsOrthonormalDynamicData< _elementType >::nmrIsOrthonormalDynamicData().

template<class _elementType>
template<class __matrixOwnerTypeA, class __vectorOwnerTypeWorkspace>
void nmrIsOrthonormalDynamicData< _elementType >::SetRef ( const vctDynamicConstMatrixBase< __matrixOwnerTypeA, _elementType > &  A,
vctDynamicVectorBase< __vectorOwnerTypeWorkspace, _elementType > &  inWorkspace 
) [inline]

This method uses the memory provided by user for workspace. The input matrix A is used to determine the size of the problem.

This method verifies that the workspace provided by the user is large enough and is compact.

Parameters:
A The matrix to be used with IsOrthonormal.
inWorkspace The vector used for workspace.

Definition at line 279 of file nmrIsOrthonormal.h.

References nmrIsOrthonormalDynamicData< _elementType >::AllocateWorkspace(), vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::rows(), nmrIsOrthonormalDynamicData< _elementType >::SetDimension(), nmrIsOrthonormalDynamicData< _elementType >::ThrowUnlessWorkspaceSizeIsCorrect(), and nmrIsOrthonormalDynamicData< _elementType >::WorkspaceReference.

Referenced by nmrIsOrthonormal(), and nmrIsOrthonormalDynamicData< _elementType >::nmrIsOrthonormalDynamicData().

template<class _elementType>
void nmrIsOrthonormalDynamicData< _elementType >::Allocate ( size_type  m  )  [inline]

This method allocates the memory for the workspace. This method is not meant to be a top-level user API, but is used by other overloaded Allocate methods.

Parameters:
m Number of rows of input matrix A. A must be a square matrix.

Definition at line 298 of file nmrIsOrthonormal.h.

References nmrIsOrthonormalDynamicData< _elementType >::AllocateWorkspace(), and nmrIsOrthonormalDynamicData< _elementType >::SetDimension().


Member Data Documentation

template<class _elementType>
vctDynamicVector<_elementType> nmrIsOrthonormalDynamicData< _elementType >::WorkspaceMemory [protected]

Memory allocated for Workspace matrices if needed.

Definition at line 73 of file nmrIsOrthonormal.h.

Referenced by nmrIsOrthonormalDynamicData< _elementType >::AllocateWorkspace().

template<class _elementType>
vctDynamicVectorRef<_elementType> nmrIsOrthonormalDynamicData< _elementType >::WorkspaceReference [protected]

References to work or return types, these point either to user allocated memory or our memory chunks if needed.

Definition at line 136 of file nmrIsOrthonormal.h.

Referenced by nmrIsOrthonormalDynamicData< _elementType >::AllocateWorkspace(), and nmrIsOrthonormalDynamicData< _elementType >::SetRef().

template<class _elementType>
size_type nmrIsOrthonormalDynamicData< _elementType >::Size [protected]

Just store the size of the matrix, i.e. M * N.

Definition at line 139 of file nmrIsOrthonormal.h.

Referenced by nmrIsOrthonormalDynamicData< _elementType >::AllocateWorkspace(), nmrIsOrthonormal(), nmrIsOrthonormalDynamicData< _elementType >::SetDimension(), and nmrIsOrthonormalDynamicData< _elementType >::ThrowUnlessWorkspaceSizeIsCorrect().


The documentation for this class was generated from the following file:
erc-cisst-devel<at>lists.johnshopkins.edu