#include <nmrNNLS.h>
Collaboration diagram for nmrNNLSDynamicData:

--- description of problem here ---
The sizes of these components must match exactly the input matrix A. To ease the use of the NNLS routine, the user can rely on the nmrNNLSDynamicData class to perform the required memory allocation. Furthermore, the underlying Fortran routine from LAPACK requires a workspace (aka a scratch space). This workspace can also be allocated by the nmrNNLSDynamicData.
Another good reason to use a "data" object is that the memory allocation can be performed once during an initialization phase while the function nmrNNLS can be called numerous times later on without any new dynamic memory allocation. This is crucial for such things as real time tasks.
The NNLS routine must be used with matrices allocated column first, i.e. using VCT_COL_MAJOR. Matrices and vectors must also be compact, i.e. use a contiguous block of memory.
Any size or storage order 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.
Contrary to most "data" objects of cisstNumerical (see nmrSVDDynamicData or nmrLUDynamicData), the "data" object for NNLS can also be used to allocate memory for the input. So far, we have referred to the input as the couple (A, b). For efficiency reasons, the underlying Fortran routine actually bundles the matrix A and the vector b in one single matrix Ab. The class nmrNNLSDynamicData allows to use either a single matrix Ab or the matrix A and the vector b separately. If one prefers to use (A, b) instead of Ab, this is possible. The programmer just has to be consistent, i.e. use the same input for all the nmrNNLSDynamicData methods and the function nmrNNLS. The only drawback of this approach is that everytime the function nmrNNLS will be called, the content of A and b will be copied to a single matrix Ab compatible with the Fortran routine.
The nmrNNLSDynamicData class allows 4 different configurations, for each of these, Ab can be replaced by A, b:
Definition at line 119 of file nmrNNLS.h.
| typedef unsigned int nmrNNLSDynamicData::size_type |
Type used for sizes within nmrNNLSDynamicData. This type is compatible with the cisstVector containers such as vctDynamicMatrix and vctDynamicVector (unsigned int). To call the Fortran based routines, these values must be cast to CISSTNETLIB_INTEGER.
| nmrNNLSDynamicData::nmrNNLSDynamicData | ( | ) | [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.
Definition at line 354 of file nmrNNLS.h.
References AbMemory, AllocateOutputWorkspaces(), and vctDynamicMatrix< _elementType >::SetSize().
| nmrNNLSDynamicData::nmrNNLSDynamicData | ( | const vctDynamicMatrixBase< _matrixOwnerTypeAb, CISSTNETLIB_DOUBLE > & | Ab | ) | [inline] |
Constructor where the user provides the input matrix to specify the size and storage order. Memory allocation is performed for the output matrices and vectors as well as workspaces. This should be used when the user doesn't care much about where the output should be stored and doesn't need to share the workspace between different algorithms.
Definition at line 374 of file nmrNNLS.h.
References Allocate().
| nmrNNLSDynamicData::nmrNNLSDynamicData | ( | const vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > & | A, | |
| const vctDynamicVectorBase< _vectorOwnerTypeB, CISSTNETLIB_DOUBLE > & | b | |||
| ) | [inline] |
Constructor where the user provides the input matrix to specify the size and storage order. Memory allocation is performed for the output matrices and vectors as well as workspaces. This should be used when the user doesn't care much about where the output should be stored and doesn't need to share the workspace between different algorithms.
Definition at line 379 of file nmrNNLS.h.
References Allocate().
| nmrNNLSDynamicData::nmrNNLSDynamicData | ( | const vctDynamicMatrixBase< _matrixOwnerTypeAb, CISSTNETLIB_DOUBLE > & | Ab, | |
| vctDynamicVectorBase< _vectorOwnerTypeWorkspace, CISSTNETLIB_DOUBLE > & | workspace, | |||
| vctDynamicVectorBase< _vectorOwnerTypeWorkspaceInt, CISSTNETLIB_INTEGER > & | workspaceInt | |||
| ) | [inline] |
Constructor where the user provides the input matrix to specify the size and storage order. Memory allocation is performed for the output matrices and vectors only. 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.
| nmrNNLSDynamicData::nmrNNLSDynamicData | ( | const vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > & | A, | |
| const vctDynamicVectorBase< _vectorOwnerTypeB, CISSTNETLIB_DOUBLE > & | b, | |||
| vctDynamicVectorBase< _vectorOwnerTypeWorkspace, CISSTNETLIB_DOUBLE > & | workspace, | |||
| vctDynamicVectorBase< _vectorOwnerTypeWorkspaceInt, CISSTNETLIB_INTEGER > & | workspaceInt | |||
| ) | [inline] |
Constructor where the user provides the input matrix to specify the size and storage order. Memory allocation is performed for the output matrices and vectors only. 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.
| nmrNNLSDynamicData::nmrNNLSDynamicData | ( | const vctDynamicMatrixBase< _matrixOwnerTypeAb, CISSTNETLIB_DOUBLE > & | Ab, | |
| vctDynamicVectorBase< _vectorOwnerTypeX, CISSTNETLIB_DOUBLE > & | X, | |||
| vctDynamicVectorBase< _vectorOwnerTypeW, CISSTNETLIB_DOUBLE > & | W, | |||
| vctDynamicVectorBase< _vectorOwnerTypeWorkspace, CISSTNETLIB_DOUBLE > & | workspace, | |||
| vctDynamicVectorBase< _vectorOwnerTypeWorkspaceInt, CISSTNETLIB_INTEGER > & | workspaceInt | |||
| ) | [inline] |
Constructor where the user provides the vectors X and W as well as the workspaces. The data object now acts as a composite container to hold, pass and manipulate a convenient storage for NNLS algorithm. Checks are made on the validity of the input and its consitency in terms of size. Please note that since the workspace and the input are now created by the user, special attention must be given to thread safety issues.
| nmrNNLSDynamicData::nmrNNLSDynamicData | ( | const vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > & | A, | |
| const vctDynamicVectorBase< _vectorOwnerTypeB, CISSTNETLIB_DOUBLE > & | b, | |||
| vctDynamicVectorBase< _vectorOwnerTypeX, CISSTNETLIB_DOUBLE > & | X, | |||
| vctDynamicVectorBase< _vectorOwnerTypeW, CISSTNETLIB_DOUBLE > & | W, | |||
| vctDynamicVectorBase< _vectorOwnerTypeWorkspace, CISSTNETLIB_DOUBLE > & | workspace, | |||
| vctDynamicVectorBase< _vectorOwnerTypeWorkspaceInt, CISSTNETLIB_INTEGER > & | workspaceInt | |||
| ) | [inline] |
Constructor where the user provides the vectors X and W as well as the workspaces. The data object now acts as a composite container to hold, pass and manipulate a convenient storage for NNLS algorithm. Checks are made on the validity of the input and its consitency in terms of size. Please note that since the workspace and the input are now created by the user, special attention must be given to thread safety issues.
| nmrNNLSDynamicData::nmrNNLSDynamicData | ( | const vctDynamicMatrixBase< _matrixOwnerTypeAb, CISSTNETLIB_DOUBLE > & | Ab, | |
| vctDynamicVectorBase< _vectorOwnerTypeX, CISSTNETLIB_DOUBLE > & | X, | |||
| vctDynamicVectorBase< _vectorOwnerTypeW, CISSTNETLIB_DOUBLE > & | W | |||
| ) | [inline] |
Constructor where the user provides the vectors X and W. The workspaces will be allocated and managed by the "data". This constructor should be used when the user already has a storage for the data but doesn't care much about the workspace.
Definition at line 464 of file nmrNNLS.h.
References SetRefOutput(), W(), and X().
| nmrNNLSDynamicData::nmrNNLSDynamicData | ( | const vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > & | A, | |
| const vctDynamicVectorBase< _vectorOwnerTypeB, CISSTNETLIB_DOUBLE > & | b, | |||
| vctDynamicVectorBase< _vectorOwnerTypeX, CISSTNETLIB_DOUBLE > & | X, | |||
| vctDynamicVectorBase< _vectorOwnerTypeW, CISSTNETLIB_DOUBLE > & | W | |||
| ) | [inline] |
Constructor where the user provides the vectors X and W. The workspaces will be allocated and managed by the "data". This constructor should be used when the user already has a storage for the data but doesn't care much about the workspace.
Definition at line 472 of file nmrNNLS.h.
References SetRefOutput(), W(), and X().
| nmrNNLSDynamicData::nmrNNLSDynamicData | ( | const vctDynamicMatrixBase< _matrixOwnerTypeAb, CISSTNETLIB_DOUBLE > & | Ab | ) | [inline] |
Constructor where the user provides the input matrix to specify the size and storage order. Memory allocation is performed for the output matrices and vectors as well as workspaces. This should be used when the user doesn't care much about where the output should be stored and doesn't need to share the workspace between different algorithms.
Definition at line 374 of file nmrNNLS.h.
References Allocate().
| nmrNNLSDynamicData::nmrNNLSDynamicData | ( | const vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > & | A, | |
| const vctDynamicVectorBase< _vectorOwnerTypeB, CISSTNETLIB_DOUBLE > & | b | |||
| ) | [inline] |
Constructor where the user provides the input matrix to specify the size and storage order. Memory allocation is performed for the output matrices and vectors as well as workspaces. This should be used when the user doesn't care much about where the output should be stored and doesn't need to share the workspace between different algorithms.
Definition at line 379 of file nmrNNLS.h.
References Allocate().
| nmrNNLSDynamicData::nmrNNLSDynamicData | ( | const vctDynamicMatrixBase< _matrixOwnerTypeAb, CISSTNETLIB_DOUBLE > & | Ab, | |
| vctDynamicVectorBase< _vectorOwnerTypeWorkspace, CISSTNETLIB_DOUBLE > & | workspace, | |||
| vctDynamicVectorBase< _vectorOwnerTypeWorkspaceInt, CISSTNETLIB_INTEGER > & | workspaceInt | |||
| ) | [inline] |
Constructor where the user provides the input matrix to specify the size and storage order. Memory allocation is performed for the output matrices and vectors only. 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.
| nmrNNLSDynamicData::nmrNNLSDynamicData | ( | const vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > & | A, | |
| const vctDynamicVectorBase< _vectorOwnerTypeB, CISSTNETLIB_DOUBLE > & | b, | |||
| vctDynamicVectorBase< _vectorOwnerTypeWorkspace, CISSTNETLIB_DOUBLE > & | workspace, | |||
| vctDynamicVectorBase< _vectorOwnerTypeWorkspaceInt, CISSTNETLIB_INTEGER > & | workspaceInt | |||
| ) | [inline] |
Constructor where the user provides the input matrix to specify the size and storage order. Memory allocation is performed for the output matrices and vectors only. 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.
| nmrNNLSDynamicData::nmrNNLSDynamicData | ( | const vctDynamicMatrixBase< _matrixOwnerTypeAb, CISSTNETLIB_DOUBLE > & | Ab, | |
| vctDynamicVectorBase< _vectorOwnerTypeX, CISSTNETLIB_DOUBLE > & | X, | |||
| vctDynamicVectorBase< _vectorOwnerTypeW, CISSTNETLIB_DOUBLE > & | W, | |||
| vctDynamicVectorBase< _vectorOwnerTypeWorkspace, CISSTNETLIB_DOUBLE > & | workspace, | |||
| vctDynamicVectorBase< _vectorOwnerTypeWorkspaceInt, CISSTNETLIB_INTEGER > & | workspaceInt | |||
| ) | [inline] |
Constructor where the user provides the vectors X and W as well as the workspaces. The data object now acts as a composite container to hold, pass and manipulate a convenient storage for NNLS algorithm. Checks are made on the validity of the input and its consitency in terms of size. Please note that since the workspace and the input are now created by the user, special attention must be given to thread safety issues.
| nmrNNLSDynamicData::nmrNNLSDynamicData | ( | const vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > & | A, | |
| const vctDynamicVectorBase< _vectorOwnerTypeB, CISSTNETLIB_DOUBLE > & | b, | |||
| vctDynamicVectorBase< _vectorOwnerTypeX, CISSTNETLIB_DOUBLE > & | X, | |||
| vctDynamicVectorBase< _vectorOwnerTypeW, CISSTNETLIB_DOUBLE > & | W, | |||
| vctDynamicVectorBase< _vectorOwnerTypeWorkspace, CISSTNETLIB_DOUBLE > & | workspace, | |||
| vctDynamicVectorBase< _vectorOwnerTypeWorkspaceInt, CISSTNETLIB_INTEGER > & | workspaceInt | |||
| ) | [inline] |
Constructor where the user provides the vectors X and W as well as the workspaces. The data object now acts as a composite container to hold, pass and manipulate a convenient storage for NNLS algorithm. Checks are made on the validity of the input and its consitency in terms of size. Please note that since the workspace and the input are now created by the user, special attention must be given to thread safety issues.
| nmrNNLSDynamicData::nmrNNLSDynamicData | ( | const vctDynamicMatrixBase< _matrixOwnerTypeAb, CISSTNETLIB_DOUBLE > & | Ab, | |
| vctDynamicVectorBase< _vectorOwnerTypeX, CISSTNETLIB_DOUBLE > & | X, | |||
| vctDynamicVectorBase< _vectorOwnerTypeW, CISSTNETLIB_DOUBLE > & | W | |||
| ) | [inline] |
Constructor where the user provides the vectors X and W. The workspaces will be allocated and managed by the "data". This constructor should be used when the user already has a storage for the data but doesn't care much about the workspace.
Definition at line 464 of file nmrNNLS.h.
References SetRefOutput(), W(), and X().
| nmrNNLSDynamicData::nmrNNLSDynamicData | ( | const vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > & | A, | |
| const vctDynamicVectorBase< _vectorOwnerTypeB, CISSTNETLIB_DOUBLE > & | b, | |||
| vctDynamicVectorBase< _vectorOwnerTypeX, CISSTNETLIB_DOUBLE > & | X, | |||
| vctDynamicVectorBase< _vectorOwnerTypeW, CISSTNETLIB_DOUBLE > & | W | |||
| ) | [inline] |
Constructor where the user provides the vectors X and W. The workspaces will be allocated and managed by the "data". This constructor should be used when the user already has a storage for the data but doesn't care much about the workspace.
Definition at line 472 of file nmrNNLS.h.
References SetRefOutput(), W(), and X().
Private method to set the data members MMember and NMember. This method must be called before AllocateOutputWorkspace, ThrowUnlessOutputSizeIsCorrect or ThrowUnlessWorkspaceSizeIsCorrect.
Definition at line 171 of file nmrNNLS.h.
References MMember, and NMember.
Referenced by Allocate(), SetRef(), SetRefOutput(), and SetRefWorkspaces().
| void nmrNNLSDynamicData::AllocateOutputWorkspaces | ( | bool | allocateOutput, | |
| bool | allocateWorkspaces | |||
| ) | [inline, protected] |
Private method to allocate memory for the output and the workspaces if needed. This method assumes that the dimension m and n are already 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" (nmrNNLSDynamicData) does not keep any memory allocated. This is for the case where a single "data" is used first to allocate everything and, later on, used with user allocated memory (for either the workspace or the output).
Definition at line 189 of file nmrNNLS.h.
References MMember, NMember, OutputMemory, vctDynamicMatrixRef< _elementType >::SetRef(), vctDynamicVectorRef< _elementType >::SetRef(), vctDynamicVector< _elementType >::SetSize(), WorkspaceIntMemory, WorkspaceIntReference, WorkspaceMemory, WorkspaceReference, WReference, and XReference.
Referenced by Allocate(), nmrNNLSDynamicData(), SetRefOutput(), and SetRefWorkspaces().
| void nmrNNLSDynamicData::ThrowUnlessOutputSizeIsCorrect | ( | const vctDynamicVectorBase< _matrixOwnerTypeX, CISSTNETLIB_DOUBLE > & | inX, | |
| const vctDynamicVectorBase< _vectorOwnerTypeW, CISSTNETLIB_DOUBLE > & | inW | |||
| ) | const throw (std::runtime_error) [inline, protected] |
Verifies that the user provided references for the output match the size of the "data" as set by SetDimension. This method also checks that the storage orders are consistent across the provided matrices and that all containers are compact.
Definition at line 221 of file nmrNNLS.h.
References cmnThrow(), and NMember.
Referenced by SetRef(), and SetRefOutput().
| void nmrNNLSDynamicData::ThrowUnlessWorkspacesSizeIsCorrect | ( | const vctDynamicVectorBase< _vectorOwnerTypeWorkspace, CISSTNETLIB_DOUBLE > & | inWorkspace, | |
| const vctDynamicVectorBase< _vectorOwnerTypeWorkspaceInt, CISSTNETLIB_INTEGER > & | inWorkspaceInt | |||
| ) | const throw (std::runtime_error) [inline, protected] |
Verifies that the user provided references for the workspaces match (or is greated than) the size of the "data" as set by SetDimension. This method also checks that the workspaces are compact.
Definition at line 251 of file nmrNNLS.h.
References cmnThrow(), MMember, and NMember.
Referenced by SetRef(), and SetRefWorkspaces().
| static size_type nmrNNLSDynamicData::WorkspaceSize | ( | const vctDynamicMatrixBase< _matrixOwnerTypeAb, CISSTNETLIB_DOUBLE > & | Ab | ) | [inline, static] |
Helper method to determine the minimum working space required by NNLS routine.
Definition at line 277 of file nmrNNLS.h.
References vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::rows().
Referenced by nmrNNLS().
| static size_type nmrNNLSDynamicData::WorkspaceSize | ( | const vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > & | A, | |
| const vctDynamicVectorBase< _vectorOwnerTypeB, CISSTNETLIB_DOUBLE > & | b | |||
| ) | [inline, static] |
Helper method to determine the minimum working space required by NNLS routine.
Definition at line 282 of file nmrNNLS.h.
References vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::rows().
| static size_type nmrNNLSDynamicData::WorkspaceIntSize | ( | const vctDynamicMatrixBase< _matrixOwnerTypeAb, CISSTNETLIB_DOUBLE > & | Ab | ) | [inline, static] |
Helper method to determine the minimum integer working space required by NNLS routine.
Definition at line 294 of file nmrNNLS.h.
References vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::cols().
| static size_type nmrNNLSDynamicData::WorkspaceIntSize | ( | const vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > & | A, | |
| const vctDynamicVectorBase< _vectorOwnerTypeB, CISSTNETLIB_DOUBLE > & | b | |||
| ) | [inline, static] |
Helper method to determine the minimum integer working space required by NNLS routine.
Definition at line 300 of file nmrNNLS.h.
References vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::cols().
| void nmrNNLSDynamicData::Allocate | ( | const vctDynamicMatrixBase< _matrixOwnerTypeAb, CISSTNETLIB_DOUBLE > & | Ab | ) | [inline] |
This method allocates memory for the output vectors as well as the workspace. The input matrix is used only to determine the size of the problem.
This method should be called before the nmrNNLSDynamicData object is passed on to nmrNNLS function.
Definition at line 490 of file nmrNNLS.h.
References vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::cols(), vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::rows(), and SetDimension().
Referenced by nmrNNLSDynamicData().
| void nmrNNLSDynamicData::Allocate | ( | const vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > & | A, | |
| const vctDynamicVectorBase< _vectorOwnerTypeB, CISSTNETLIB_DOUBLE > & | b | |||
| ) | [inline] |
This method allocates memory for the output vectors as well as the workspace. The input matrix is used only to determine the size of the problem.
This method should be called before the nmrNNLSDynamicData object is passed on to nmrNNLS function.
Definition at line 496 of file nmrNNLS.h.
References AbMemory, AllocateOutputWorkspaces(), vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::cols(), MMember, NMember, vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::rows(), SetDimension(), vctDynamicMatrix< _elementType >::SetSize(), and VCT_COL_MAJOR.
| void nmrNNLSDynamicData::SetRefWorkspaces | ( | const vctDynamicMatrixBase< _matrixOwnerTypeAb, CISSTNETLIB_DOUBLE > & | Ab, | |
| vctDynamicVectorBase< _vectorOwnerTypeWorkspace, CISSTNETLIB_DOUBLE > & | workspace, | |||
| vctDynamicVectorBase< _vectorOwnerTypeWorkspaceInt, CISSTNETLIB_INTEGER > & | workspaceInt | |||
| ) | [inline] |
This method allocates the memory for the output vectors and uses the memory provided by user for workspaces. The input matrix A is used to determine the size of the problem.
This method verifies that the workspaces provided by the user is large enough and is compact.
Definition at line 516 of file nmrNNLS.h.
References AllocateOutputWorkspaces(), vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::cols(), vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::rows(), SetDimension(), vctDynamicVectorRef< _elementType >::SetRef(), ThrowUnlessWorkspacesSizeIsCorrect(), WorkspaceIntReference, and WorkspaceReference.
| void nmrNNLSDynamicData::SetRefWorkspaces | ( | const vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > & | A, | |
| const vctDynamicVectorBase< _vectorOwnerTypeB, CISSTNETLIB_DOUBLE > & | b, | |||
| vctDynamicVectorBase< _vectorOwnerTypeWorkspace, CISSTNETLIB_DOUBLE > & | workspace, | |||
| vctDynamicVectorBase< _vectorOwnerTypeWorkspaceInt, CISSTNETLIB_INTEGER > & | workspaceInt | |||
| ) | [inline] |
This method allocates the memory for the output vectors and uses the memory provided by user for workspaces. The input matrix A is used to determine the size of the problem.
This method verifies that the workspaces provided by the user is large enough and is compact.
Definition at line 532 of file nmrNNLS.h.
References AbMemory, AllocateOutputWorkspaces(), vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::cols(), MMember, NMember, vctDynamicConstMatrixBase< _matrixOwnerType, _elementType >::rows(), SetDimension(), vctDynamicVectorRef< _elementType >::SetRef(), vctDynamicMatrix< _elementType >::SetSize(), ThrowUnlessWorkspacesSizeIsCorrect(), VCT_COL_MAJOR, WorkspaceIntReference, and WorkspaceReference.
| void nmrNNLSDynamicData::SetRef | ( | const vctDynamicMatrixBase< _matrixOwnerTypeAb, CISSTNETLIB_DOUBLE > & | Ab, | |
| vctDynamicVectorBase< _vectorOwnerTypeX, CISSTNETLIB_DOUBLE > & | X, | |||
| vctDynamicVectorBase< _vectorOwnerTypeW, CISSTNETLIB_DOUBLE > & | W, | |||
| vctDynamicVectorBase< _vectorOwnerTypeWorkspace, CISSTNETLIB_DOUBLE > & | workspace, | |||
| vctDynamicVectorBase< _vectorOwnerTypeWorkspaceInt, CISSTNETLIB_INTEGER > & | workspaceInt | |||
| ) | throw (std::runtime_error) [inline] |
This method doesn't allocate any memory as it relies on user provided vectors for the output as well as the workspaces.
The data object now acts as a composite container to hold, pass and manipulate a convenient storage for NNLS algorithm. The method tests that all the containers provided by the user have the correct size and are compact.
Definition at line 565 of file nmrNNLS.h.
References SetDimension(), vctDynamicVectorRef< _elementType >::SetRef(), vctDynamicMatrixRef< _elementType >::SetRef(), ThrowUnlessOutputSizeIsCorrect(), ThrowUnlessWorkspacesSizeIsCorrect(), W(), WorkspaceReference, WReference, X(), and XReference.
Referenced by nmrNNLSDynamicData().
| void nmrNNLSDynamicData::SetRef | ( | const vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > & | A, | |
| const vctDynamicVectorBase< _vectorOwnerTypeB, CISSTNETLIB_DOUBLE > & | b, | |||
| vctDynamicVectorBase< _vectorOwnerTypeX, CISSTNETLIB_DOUBLE > & | X, | |||
| vctDynamicVectorBase< _vectorOwnerTypeW, CISSTNETLIB_DOUBLE > & | W, | |||
| vctDynamicVectorBase< _vectorOwnerTypeWorkspace, CISSTNETLIB_DOUBLE > & | workspace, | |||
| vctDynamicVectorBase< _vectorOwnerTypeWorkspaceInt, CISSTNETLIB_INTEGER > & | workspaceInt | |||
| ) | throw (std::runtime_error) [inline] |
This method doesn't allocate any memory as it relies on user provided vectors for the output as well as the workspaces.
The data object now acts as a composite container to hold, pass and manipulate a convenient storage for NNLS algorithm. The method tests that all the containers provided by the user have the correct size and are compact.
Definition at line 585 of file nmrNNLS.h.
References AbMemory, MMember, NMember, SetDimension(), vctDynamicVectorRef< _elementType >::SetRef(), vctDynamicMatrixRef< _elementType >::SetRef(), vctDynamicMatrix< _elementType >::SetSize(), ThrowUnlessOutputSizeIsCorrect(), ThrowUnlessWorkspacesSizeIsCorrect(), VCT_COL_MAJOR, W(), WorkspaceReference, WReference, X(), and XReference.
| void nmrNNLSDynamicData::SetRefOutput | ( | const vctDynamicMatrixBase< _matrixOwnerTypeAb, CISSTNETLIB_DOUBLE > & | Ab, | |
| vctDynamicVectorBase< _vectorOwnerTypeX, CISSTNETLIB_DOUBLE > & | X, | |||
| vctDynamicVectorBase< _vectorOwnerTypeW, CISSTNETLIB_DOUBLE > & | W | |||
| ) | throw (std::runtime_error) [inline] |
This method allocates the memory for the workspaces. The output memory is provided by the user. The method computes the size of the problem based on the user provided output and verifies that the output components (X and W) are consistent with respect to their size.
Definition at line 616 of file nmrNNLS.h.
References AllocateOutputWorkspaces(), SetDimension(), vctDynamicMatrixRef< _elementType >::SetRef(), ThrowUnlessOutputSizeIsCorrect(), W(), WReference, X(), and XReference.
Referenced by nmrNNLSDynamicData().
| void nmrNNLSDynamicData::SetRefOutput | ( | const vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > & | A, | |
| const vctDynamicMatrixBase< _vectorOwnerTypeB, CISSTNETLIB_DOUBLE > & | b, | |||
| vctDynamicVectorBase< _vectorOwnerTypeX, CISSTNETLIB_DOUBLE > & | X, | |||
| vctDynamicVectorBase< _vectorOwnerTypeW, CISSTNETLIB_DOUBLE > & | W | |||
| ) | throw (std::runtime_error) [inline] |
This method allocates the memory for the workspaces. The output memory is provided by the user. The method computes the size of the problem based on the user provided output and verifies that the output components (X and W) are consistent with respect to their size.
Definition at line 631 of file nmrNNLS.h.
References AbMemory, AllocateOutputWorkspaces(), MMember, NMember, SetDimension(), vctDynamicMatrixRef< _elementType >::SetRef(), vctDynamicMatrix< _elementType >::SetSize(), ThrowUnlessOutputSizeIsCorrect(), VCT_COL_MAJOR, W(), WReference, X(), and XReference.
| const vctDynamicVectorRef<CISSTNETLIB_DOUBLE>& nmrNNLSDynamicData::X | ( | void | ) | const [inline] |
Const reference to the result vector X. This method must be called after the data has been computed by the nmrNNLS function.
Definition at line 652 of file nmrNNLS.h.
References XReference.
Referenced by nmrNNLSDynamicData(), SetRef(), and SetRefOutput().
| const vctDynamicVectorRef<CISSTNETLIB_DOUBLE>& nmrNNLSDynamicData::W | ( | void | ) | const [inline] |
Const reference to the result vector W (dual). This method must be called after the data has been computed by the nmrNNLS function.
Definition at line 659 of file nmrNNLS.h.
References WReference.
Referenced by nmrNNLSDynamicData(), SetRef(), and SetRefOutput().
vctDynamicVector<CISSTNETLIB_DOUBLE> nmrNNLSDynamicData::WorkspaceMemory [protected] |
Memory allocated for Workspace vectors if needed.
Definition at line 134 of file nmrNNLS.h.
Referenced by AllocateOutputWorkspaces().
vctDynamicVector<CISSTNETLIB_INTEGER> nmrNNLSDynamicData::WorkspaceIntMemory [protected] |
Memory allocated for Workspace vectors if needed.
Definition at line 135 of file nmrNNLS.h.
Referenced by AllocateOutputWorkspaces().
vctDynamicVector<CISSTNETLIB_DOUBLE> nmrNNLSDynamicData::OutputMemory [protected] |
Memory allocated for vector X and W if needed. This method allocates a single block of memory for these 2 containers; m elements of X followed by n elements of W.
Definition at line 142 of file nmrNNLS.h.
Referenced by AllocateOutputWorkspaces().
vctDynamicMatrix<CISSTNETLIB_DOUBLE> nmrNNLSDynamicData::AbMemory [protected] |
Memory allocated for the input. This is used only if the user provides separate A and b and the class needs to copy them in the single matrix Ab.
Definition at line 147 of file nmrNNLS.h.
Referenced by Allocate(), nmrNNLSDynamicData(), SetRef(), SetRefOutput(), and SetRefWorkspaces().
vctDynamicMatrixRef<CISSTNETLIB_DOUBLE> nmrNNLSDynamicData::AbReference [protected] |
vctDynamicMatrixRef<CISSTNETLIB_DOUBLE> nmrNNLSDynamicData::XReference [protected] |
References to workspaces or return containers, these point either to user allocated memory or our memory chunks if needed.
Definition at line 154 of file nmrNNLS.h.
Referenced by AllocateOutputWorkspaces(), SetRef(), SetRefOutput(), and X().
vctDynamicMatrixRef<CISSTNETLIB_DOUBLE> nmrNNLSDynamicData::WReference [protected] |
References to workspaces or return containers, these point either to user allocated memory or our memory chunks if needed.
Definition at line 155 of file nmrNNLS.h.
Referenced by AllocateOutputWorkspaces(), SetRef(), SetRefOutput(), and W().
vctDynamicVectorRef<CISSTNETLIB_DOUBLE> nmrNNLSDynamicData::WorkspaceReference [protected] |
References to workspaces or return containers, these point either to user allocated memory or our memory chunks if needed.
Definition at line 156 of file nmrNNLS.h.
Referenced by AllocateOutputWorkspaces(), SetRef(), and SetRefWorkspaces().
vctDynamicVectorRef<CISSTNETLIB_INTEGER> nmrNNLSDynamicData::WorkspaceIntReference [protected] |
References to workspaces or return containers, these point either to user allocated memory or our memory chunks if needed.
Definition at line 157 of file nmrNNLS.h.
Referenced by AllocateOutputWorkspaces(), and SetRefWorkspaces().
size_type nmrNNLSDynamicData::MMember [protected] |
Store M, N which are needed to check if input matrix passed to solve method matches the allocated size.
Definition at line 163 of file nmrNNLS.h.
Referenced by Allocate(), AllocateOutputWorkspaces(), SetDimension(), SetRef(), SetRefOutput(), SetRefWorkspaces(), and ThrowUnlessWorkspacesSizeIsCorrect().
size_type nmrNNLSDynamicData::NMember [protected] |
Store M, N which are needed to check if input matrix passed to solve method matches the allocated size.
Definition at line 164 of file nmrNNLS.h.
Referenced by Allocate(), AllocateOutputWorkspaces(), SetDimension(), SetRef(), SetRefOutput(), SetRefWorkspaces(), ThrowUnlessOutputSizeIsCorrect(), and ThrowUnlessWorkspacesSizeIsCorrect().