ColPack
ColPack::JacobianRecovery2D Class Reference

class JacobianRecovery2D in group5. More...

#include <JacobianRecovery2D.h>

Inheritance diagram for ColPack::JacobianRecovery2D:
Collaboration diagram for ColPack::JacobianRecovery2D:

List of all members.

Public Member Functions

int DirectRecover_RowCompressedFormat (BipartiteGraphBicoloringInterface *g, double **dp2_RowCompressedMatrix, double **dp2_ColumnCompressedMatrix, unsigned int **uip2_JacobianSparsityPattern, double ***dp3_JacobianValue)
 A routine for recovering a Jacobian from a Star-Bicoloring based compressed representation.
int DirectRecover_RowCompressedFormat_unmanaged (BipartiteGraphBicoloringInterface *g, double **dp2_RowCompressedMatrix, double **dp2_ColumnCompressedMatrix, unsigned int **uip2_JacobianSparsityPattern, double ***dp3_JacobianValue)
 Same as DirectRecover_RowCompressedFormat(), except that the output is NOT managed by ColPack.
int DirectRecover_RowCompressedFormat_usermem (BipartiteGraphBicoloringInterface *g, double **dp2_RowCompressedMatrix, double **dp2_ColumnCompressedMatrix, unsigned int **uip2_JacobianSparsityPattern, double ***dp3_JacobianValue)
 Same as DirectRecover_RowCompressedFormat_unmanaged(), except that memory allocation for output vector(s) is done by user.
int DirectRecover_CoordinateFormat (BipartiteGraphBicoloringInterface *g, double **dp2_RowCompressedMatrix, double **dp2_ColumnCompressedMatrix, unsigned int **uip2_JacobianSparsityPattern, unsigned int **ip2_RowIndex, unsigned int **ip2_ColumnIndex, double **dp2_JacobianValue)
 A routine for recovering a Jacobian from a Star-Bicoloring based compressed representation.
int DirectRecover_CoordinateFormat_unmanaged (BipartiteGraphBicoloringInterface *g, double **dp2_RowCompressedMatrix, double **dp2_ColumnCompressedMatrix, unsigned int **uip2_JacobianSparsityPattern, unsigned int **ip2_RowIndex, unsigned int **ip2_ColumnIndex, double **dp2_JacobianValue)
 Same as DirectRecover_CoordinateFormat(), except that the output is NOT managed by ColPack.
int DirectRecover_CoordinateFormat_usermem (BipartiteGraphBicoloringInterface *g, double **dp2_RowCompressedMatrix, double **dp2_ColumnCompressedMatrix, unsigned int **uip2_JacobianSparsityPattern, unsigned int **ip2_RowIndex, unsigned int **ip2_ColumnIndex, double **dp2_JacobianValue)
 Same as DirectRecover_CoordinateFormat_unmanaged(), except that memory allocation for output vector(s) is done by user.
int DirectRecover_SparseSolversFormat (BipartiteGraphBicoloringInterface *g, double **dp2_RowCompressedMatrix, double **dp2_ColumnCompressedMatrix, unsigned int **uip2_JacobianSparsityPattern, unsigned int **ip2_RowIndex, unsigned int **ip2_ColumnIndex, double **dp2_JacobianValue)
 A routine for recovering a Jacobian from a Star-Bicoloring based compressed representation.
int DirectRecover_SparseSolversFormat_unmanaged (BipartiteGraphBicoloringInterface *g, double **dp2_RowCompressedMatrix, double **dp2_ColumnCompressedMatrix, unsigned int **uip2_JacobianSparsityPattern, unsigned int **ip2_RowIndex, unsigned int **ip2_ColumnIndex, double **dp2_JacobianValue)
 Same as DirectRecover_SparseSolversFormat(), except that the output is NOT managed by ColPack.
int DirectRecover_SparseSolversFormat_usermem (BipartiteGraphBicoloringInterface *g, double **dp2_RowCompressedMatrix, double **dp2_ColumnCompressedMatrix, unsigned int **uip2_JacobianSparsityPattern, unsigned int **ip2_RowIndex, unsigned int **ip2_ColumnIndex, double **dp2_JacobianValue)
 Same as DirectRecover_SparseSolversFormat_unmanaged(), except that memory allocation for output vector(s) is done by user.

Detailed Description

class JacobianRecovery2D in group5.

Definition at line 31 of file JacobianRecovery2D.h.


Member Function Documentation

int ColPack::JacobianRecovery2D::DirectRecover_CoordinateFormat ( BipartiteGraphBicoloringInterface g,
double **  dp2_RowCompressedMatrix,
double **  dp2_ColumnCompressedMatrix,
unsigned int **  uip2_JacobianSparsityPattern,
unsigned int **  ip2_RowIndex,
unsigned int **  ip2_ColumnIndex,
double **  dp2_JacobianValue 
)

A routine for recovering a Jacobian from a Star-Bicoloring based compressed representation.

Precondition:

  • (*ip2_RowIndex), (*ip2_ColumnIndex), and (*dp2_JacobianValue) are equal to NULL, i.e. no memory has been allocated for these 3 vectors yet

Return value: size of (*ip2_RowIndex) array

Return by recovery routine: three vectors in "Coordinate Format" (zero-based indexing) http://www.intel.com/software/products/mkl/docs/webhelp/appendices/mkl_appA_SMSF.html#mkl_appA_SMSF_5

  • unsigned int** ip2_RowIndex
  • unsigned int** ip2_ColumnIndex
  • double** dp2_JacobianValue // corresponding non-zero values

The memory allocated for these 3 output vectors are managed by ColPack. The memory will be deallocated when this function is called again or when the Recovery ojbect is deallocated.

Definition at line 362 of file JacobianRecovery2D.cpp.

References ColPack::BipartiteGraphCore::GetRowVertexCount().

Here is the call graph for this function:

int ColPack::JacobianRecovery2D::DirectRecover_CoordinateFormat_unmanaged ( BipartiteGraphBicoloringInterface g,
double **  dp2_RowCompressedMatrix,
double **  dp2_ColumnCompressedMatrix,
unsigned int **  uip2_JacobianSparsityPattern,
unsigned int **  ip2_RowIndex,
unsigned int **  ip2_ColumnIndex,
double **  dp2_JacobianValue 
)

Same as DirectRecover_CoordinateFormat(), except that the output is NOT managed by ColPack.

Notes:

  • The output is NOT managed by ColPack. Therefore, the user should free the output manually using free() (NOT delete) function when it is no longer needed.

Definition at line 348 of file JacobianRecovery2D.cpp.

References _FALSE, and ColPack::BipartiteGraphCore::GetEdgeCount().

Here is the call graph for this function:

int ColPack::JacobianRecovery2D::DirectRecover_CoordinateFormat_usermem ( BipartiteGraphBicoloringInterface g,
double **  dp2_RowCompressedMatrix,
double **  dp2_ColumnCompressedMatrix,
unsigned int **  uip2_JacobianSparsityPattern,
unsigned int **  ip2_RowIndex,
unsigned int **  ip2_ColumnIndex,
double **  dp2_JacobianValue 
)

Same as DirectRecover_CoordinateFormat_unmanaged(), except that memory allocation for output vector(s) is done by user.

Notes:

  • This function will assume the user has properly allocate memory output vector(s). No checking will be done so if you got a SEGMENTATION FAULT in this function, you should check and see if you have allocated memory properly for the output vector(s).

Definition at line 276 of file JacobianRecovery2D.cpp.

References _FALSE, free_2DMatrix(), ColPack::BipartiteGraphBicoloring::GetLeftVertexColors(), ColPack::BipartiteGraphBicoloring::GetRightVertexColorCount(), ColPack::BipartiteGraphBicoloring::GetRightVertexColors_Transformed(), ColPack::BipartiteGraphBicoloring::GetRightVertexDefaultColor(), and ColPack::BipartiteGraphCore::GetRowVertexCount().

Here is the call graph for this function:

int ColPack::JacobianRecovery2D::DirectRecover_RowCompressedFormat ( BipartiteGraphBicoloringInterface g,
double **  dp2_RowCompressedMatrix,
double **  dp2_ColumnCompressedMatrix,
unsigned int **  uip2_JacobianSparsityPattern,
double ***  dp3_JacobianValue 
)

A routine for recovering a Jacobian from a Star-Bicoloring based compressed representation.

Parameter:

  • Input:
    • dp2_RowCompressedMatrix: The row compressed matrix that contains all computed values. Row compressed matrix is the matrix where all rows with the same color ID (the values of m_vi_LeftVertexColors[] are equal) are merged together.
    • dp2_ColumnCompressedMatrix: The column compressed matrix that contains all computed values. Column compressed matrix is the matrix where all columns with the same color ID (the values of m_vi_RightVertexColors[] are equal) are merged together.
    • uip2_JacobianSparsityPattern.
  • Output:
    • dp3_JacobianValue

Precondition:

  • Star Bicoloring routine has been called.
  • uip2_JacobianSparsityPattern: The Jacobian matrix must be stored in compressed sparse rows format
  • dp3_JacobianValue is just a pointer pointing to a 2D matrix (no memory allocated yet). This matrix will be created (memory will be allocated) by DirectRecover() and the pointer will be assigned to dp3_JacobianValue

Postcondition:

  • dp3_JacobianValue points to a 2d matrix contains the numerical values of the Jacobian. Row Compressed Format is used. The memory allocated for this output vector is managed by ColPack. The memory will be deallocated when this function is called again or when the Recovery ojbect is deallocated.

Return value: size of (*dp3_JacobianValue) array

About input parameters:

  • This routine doesn't need to take (Star) Bicoloring results (m_vi_LeftVertexColors and m_vi_RightVertexColors) of the Jacobian as another paramenter because that information is known internally already (because of the 1st precondition).

Row Compressed Format for dp3_JacobianValue:

  • This is a 2D matrix of doubles.
  • The first element of each row will specify the number of non-zeros in the Jacobian => Value of the first element + 1 will be the length of that row.
  • The value of each element after the 1st element is the value of the non-zero in the Jacobian. The value of dp3_JacobianValue[col][row] is the value of element [col][uip2_JacobianSparsityPattern[col][row]] in the real (uncompressed) Jacobian
  • An example of compressed sparse rows format:
    • Uncompressed matrix:
      1 .5 0
      .2 2 3
      0 6 -.5
    • Corresponding uip2_JacobianSparsityPattern:
      2 0 1
      3 0 1 2
      2 1 2
    • Corresponding dp3_JacobianValue:
      2 1 .5
      3 .2 2 3
      2 6 -.5

Algorithm: Basically the combination of RecoverForPD2RowWise() (for dp2_RowCompressedMatrix) and RecoverForPD2ColumnWise() (for dp2_ColumnCompressedMatrix) in BipartiteGraphPartialColoringInterface class

Definition at line 117 of file JacobianRecovery2D.cpp.

References ColPack::BipartiteGraphCore::GetRowVertexCount().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int ColPack::JacobianRecovery2D::DirectRecover_RowCompressedFormat_unmanaged ( BipartiteGraphBicoloringInterface g,
double **  dp2_RowCompressedMatrix,
double **  dp2_ColumnCompressedMatrix,
unsigned int **  uip2_JacobianSparsityPattern,
double ***  dp3_JacobianValue 
)

Same as DirectRecover_RowCompressedFormat(), except that the output is NOT managed by ColPack.

Notes:

  • The output is NOT managed by ColPack. Therefore, the user should free the output manually using free() (NOT delete) function when it is no longer needed.

Definition at line 96 of file JacobianRecovery2D.cpp.

References _FALSE, and ColPack::BipartiteGraphCore::GetRowVertexCount().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int ColPack::JacobianRecovery2D::DirectRecover_RowCompressedFormat_usermem ( BipartiteGraphBicoloringInterface g,
double **  dp2_RowCompressedMatrix,
double **  dp2_ColumnCompressedMatrix,
unsigned int **  uip2_JacobianSparsityPattern,
double ***  dp3_JacobianValue 
)

Same as DirectRecover_RowCompressedFormat_unmanaged(), except that memory allocation for output vector(s) is done by user.

Notes:

  • This function will assume the user has properly allocate memory output vector(s). No checking will be done so if you got a SEGMENTATION FAULT in this function, you should check and see if you have allocated memory properly for the output vector(s). (*dp3_JacobianValue) should have the same structure as uip2_JacobianSparsityPattern

Definition at line 28 of file JacobianRecovery2D.cpp.

References _FALSE, free_2DMatrix(), ColPack::BipartiteGraphBicoloring::GetLeftVertexColors(), ColPack::BipartiteGraphBicoloring::GetRightVertexColorCount(), ColPack::BipartiteGraphBicoloring::GetRightVertexColors_Transformed(), ColPack::BipartiteGraphBicoloring::GetRightVertexDefaultColor(), and ColPack::BipartiteGraphCore::GetRowVertexCount().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int ColPack::JacobianRecovery2D::DirectRecover_SparseSolversFormat ( BipartiteGraphBicoloringInterface g,
double **  dp2_RowCompressedMatrix,
double **  dp2_ColumnCompressedMatrix,
unsigned int **  uip2_JacobianSparsityPattern,
unsigned int **  ip2_RowIndex,
unsigned int **  ip2_ColumnIndex,
double **  dp2_JacobianValue 
)

A routine for recovering a Jacobian from a Star-Bicoloring based compressed representation.

Precondition:

  • (*ip2_RowIndex), (*ip2_ColumnIndex), and (*dp2_JacobianValue) are equal to NULL, i.e. no memory has been allocated for these 3 vectors yet

Return value: size of (*ip2_RowIndex) array

Return by recovery routine: three vectors in "Storage Formats for the Direct Sparse Solvers" (one-based indexing) http://software.intel.com/sites/products/documentation/hpc/mkl/webhelp/appendices/mkl_appA_SMSF.html#mkl_appA_SMSF_1

The memory allocated for these 3 output vectors are managed by ColPack. The memory will be deallocated when this function is called again or when the Recovery ojbect is deallocated.

Definition at line 255 of file JacobianRecovery2D.cpp.

References ColPack::BipartiteGraphCore::GetRowVertexCount().

Here is the call graph for this function:

int ColPack::JacobianRecovery2D::DirectRecover_SparseSolversFormat_unmanaged ( BipartiteGraphBicoloringInterface g,
double **  dp2_RowCompressedMatrix,
double **  dp2_ColumnCompressedMatrix,
unsigned int **  uip2_JacobianSparsityPattern,
unsigned int **  ip2_RowIndex,
unsigned int **  ip2_ColumnIndex,
double **  dp2_JacobianValue 
)

Same as DirectRecover_SparseSolversFormat(), except that the output is NOT managed by ColPack.

Notes:

  • The output is NOT managed by ColPack. Therefore, the user should free the output manually using free() (NOT delete) function when it is no longer needed.

Definition at line 227 of file JacobianRecovery2D.cpp.

References _FALSE, ColPack::BipartiteGraphCore::GetColumnIndices(), ColPack::BipartiteGraphCore::GetRowVertexCount(), and ColPack::BipartiteGraphCore::GetRowVertices().

Here is the call graph for this function:

int ColPack::JacobianRecovery2D::DirectRecover_SparseSolversFormat_usermem ( BipartiteGraphBicoloringInterface g,
double **  dp2_RowCompressedMatrix,
double **  dp2_ColumnCompressedMatrix,
unsigned int **  uip2_JacobianSparsityPattern,
unsigned int **  ip2_RowIndex,
unsigned int **  ip2_ColumnIndex,
double **  dp2_JacobianValue 
)

Same as DirectRecover_SparseSolversFormat_unmanaged(), except that memory allocation for output vector(s) is done by user.

Notes:

  • This function will assume the user has properly allocate memory output vector(s). No checking will be done so if you got a SEGMENTATION FAULT in this function, you should check and see if you have allocated memory properly for the output vector(s).

Definition at line 136 of file JacobianRecovery2D.cpp.

References _FALSE, free_2DMatrix(), ColPack::BipartiteGraphCore::GetEdgeCount(), ColPack::BipartiteGraphBicoloring::GetLeftVertexColors(), ColPack::BipartiteGraphBicoloring::GetRightVertexColorCount(), ColPack::BipartiteGraphBicoloring::GetRightVertexColors_Transformed(), ColPack::BipartiteGraphBicoloring::GetRightVertexDefaultColor(), and ColPack::BipartiteGraphCore::GetRowVertexCount().

Here is the call graph for this function:

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines