cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
nmrIsOrthonormalDynamicData< _elementType > Class Template Reference

Data (workspace) for nmrIsOrthonormal (Dynamic). More...

#include <nmrIsOrthonormal.h>

Classes

class  Friend
 

Public Types

typedef vct::size_type size_type
 

Public Member Functions

 nmrIsOrthonormalDynamicData ()
 
 nmrIsOrthonormalDynamicData (size_type m)
 
template<class __matrixOwnerTypeA >
 nmrIsOrthonormalDynamicData (const vctDynamicConstMatrixBase< __matrixOwnerTypeA, _elementType > &A)
 
template<class __matrixOwnerTypeA , class __vectorOwnerTypeWorkspace >
 nmrIsOrthonormalDynamicData (const vctDynamicConstMatrixBase< __matrixOwnerTypeA, _elementType > &A, vctDynamicVectorBase< __vectorOwnerTypeWorkspace, _elementType > &inWorkspace)
 
template<class __matrixOwnerTypeA >
void Allocate (const vctDynamicConstMatrixBase< __matrixOwnerTypeA, _elementType > &A)
 
template<class __matrixOwnerTypeA , class __vectorOwnerTypeWorkspace >
void SetRef (const vctDynamicConstMatrixBase< __matrixOwnerTypeA, _elementType > &A, vctDynamicVectorBase< __vectorOwnerTypeWorkspace, _elementType > &inWorkspace)
 
void Allocate (size_type m)
 

Static Public Member Functions

static size_type WorkspaceSize (size_type m)
 
template<class __matrixOwnerTypeA >
static size_type WorkspaceSize (const vctDynamicConstMatrixBase< __matrixOwnerTypeA, _elementType > &A)
 

Protected Member Functions

void SetDimension (size_type m)
 
void AllocateWorkspace (bool allocateWorkspace)
 
template<typename __vectorOwnerTypeWorkspace >
void ThrowUnlessWorkspaceSizeIsCorrect (vctDynamicVectorBase< __vectorOwnerTypeWorkspace, _elementType > &inWorkspace) const throw (std::runtime_error)
 

Protected Attributes

vctDynamicVector< _elementType > WorkspaceMemory
 
vctDynamicVectorRef< _elementType > WorkspaceReference
 
size_type Size
 

Friends

class Friend
 

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

Member Typedef Documentation

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

Type used for sizes within nmrIsOrthonormalDynamicData.

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
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
mNumber of rows of the matrix to be decomposed. The matrix must be square.
See Also
nmrIsOrthonormalDynamicData::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
Ainput matrix
See Also
nmrIsOrthonormalDynamicData::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
Ainput matrix
inWorkspaceworkspace
See Also
nmrIsOrthonormalDynamicData::SetRefWorkspace

Member Function Documentation

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
AThe matrix to be used with nmrIsOrthonormal.
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
mNumber of rows of input matrix A. A must be a square matrix.
template<class _elementType>
void nmrIsOrthonormalDynamicData< _elementType >::AllocateWorkspace ( bool  allocateWorkspace)
inlineprotected

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:

vctRandom(A, 10, 10);
nmrIsOrthonormalDynamicData data(A); // allocate workspace
data.SetRef(A, workspace); // after all, use my own workspace
Note
The method SetDimension must have been called before.
template<class _elementType>
void nmrIsOrthonormalDynamicData< _elementType >::SetDimension ( size_type  m)
inlineprotected

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

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
AThe matrix to be used with IsOrthonormal.
inWorkspaceThe vector used for workspace.
template<class _elementType>
template<typename __vectorOwnerTypeWorkspace >
void nmrIsOrthonormalDynamicData< _elementType >::ThrowUnlessWorkspaceSizeIsCorrect ( vctDynamicVectorBase< __vectorOwnerTypeWorkspace, _elementType > &  inWorkspace) const
throw (std::runtime_error
)
inlineprotected

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.
template<class _elementType>
static size_type nmrIsOrthonormalDynamicData< _elementType >::WorkspaceSize ( size_type  m)
inlinestatic

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

Parameters
mThe number or rows of matrix to be tested. The matrix must be square.
template<class _elementType>
template<class __matrixOwnerTypeA >
static size_type nmrIsOrthonormalDynamicData< _elementType >::WorkspaceSize ( const vctDynamicConstMatrixBase< __matrixOwnerTypeA, _elementType > &  A)
inlinestatic

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

Parameters
AThe matrix to be tested. A must be square.

Friends And Related Function Documentation

template<class _elementType>
friend class Friend
friend

Member Data Documentation

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

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

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

Memory allocated for Workspace matrices if needed.

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.


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