ADOL-C: Automatic Differentiation in C/C++ 2.7.3
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
ADOLC::Sparse::SparseJacInfos Struct Reference

Cached sparse Jacobian recovery data stored on a tape. More...

#include <sparseinfos.h>

Collaboration diagram for ADOLC::Sparse::SparseJacInfos:
Collaboration graph
[legend]

Public Member Functions

 ~SparseJacInfos ()
 
 SparseJacInfos ()
 
 SparseJacInfos (const SparseJacInfos &)=delete
 
 SparseJacInfos (SparseJacInfos &&other) noexcept
 
SparseJacInfos & operator= (const SparseJacInfos &)=delete
 
SparseJacInfos & operator= (SparseJacInfos &&other) noexcept
 
void setJP (std::vector< uint * > &&JPIn)
 Replace the cached sparsity pattern.
 
std::vector< uint * > & getJP ()
 Access the cached CRS Jacobian pattern.
 
void initColoring (int dimOut, int dimIn)
 Initialize ColPack coloring state for the given matrix shape.
 
void generateSeedJac (const std::string &coloringVariant)
 Generate and cache a Jacobian seed matrix.
 
void recoverRowFormatUserMem (SparseMatrix &sparseJac) const
 Recover row-compressed sparse Jacobian entries into SparseMatrix.
 
void recoverRowFormat (SparseMatrix &sparseJac) const
 Resize and recover a row-compressed sparse Jacobian.
 
void recoverColFormatUserMem (SparseMatrix &sparseJac) const
 Recover column-compressed sparse Jacobian entries into SparseMatrix.
 
void recoverColFormat (SparseMatrix &sparseJac) const
 Resize and recover a column-compressed sparse Jacobian.
 
void recoverANFUserMem (SparseANF &sparseANF, int indep, int numSwitches) const
 Split the recovered extended Jacobian into caller-sized ANF blocks.
 
void recoverANF (SparseANF &sparseANF, int indep, int numSwitches) const
 Split the recovered extended Jacobian into abs-normal blocks.
 

Public Attributes

std::unique_ptr< Impl > pimpl_
 
double * y_ {nullptr}
 
double ** Seed_ {nullptr}
 
double ** B_ {nullptr}
 
std::vector< uint * > JP_
 
int depen_ {0}
 
int nnzIn_ {0}
 
int seedClms_ {0}
 
int seedRows_ {0}
 

Detailed Description

Cached sparse Jacobian recovery data stored on a tape.

This helper owns the ColPack graph/coloring objects and all temporary buffers required to recover sparse Jacobians from compressed directional evaluations.

Constructor & Destructor Documentation

◆ ~SparseJacInfos()

ADOLC::Sparse::SparseJacInfos::~SparseJacInfos ( )

◆ SparseJacInfos() [1/3]

ADOLC::Sparse::SparseJacInfos::SparseJacInfos ( )

◆ SparseJacInfos() [2/3]

ADOLC::Sparse::SparseJacInfos::SparseJacInfos ( const SparseJacInfos &  )
delete

◆ SparseJacInfos() [3/3]

ADOLC::Sparse::SparseJacInfos::SparseJacInfos ( SparseJacInfos &&  other)
noexcept

Member Function Documentation

◆ generateSeedJac()

void ADOLC::Sparse::SparseJacInfos::generateSeedJac ( const std::string &  coloringVariant)

Generate and cache a Jacobian seed matrix.

◆ getJP()

std::vector< uint * > & ADOLC::Sparse::SparseJacInfos::getJP ( )
inline

Access the cached CRS Jacobian pattern.

◆ initColoring()

void ADOLC::Sparse::SparseJacInfos::initColoring ( int  dimOut,
int  dimIn 
)

Initialize ColPack coloring state for the given matrix shape.

◆ operator=() [1/2]

SparseJacInfos & ADOLC::Sparse::SparseJacInfos::operator= ( const SparseJacInfos &  )
delete

◆ operator=() [2/2]

SparseJacInfos & ADOLC::Sparse::SparseJacInfos::operator= ( SparseJacInfos &&  other)
noexcept

◆ recoverANF()

void ADOLC::Sparse::SparseJacInfos::recoverANF ( SparseANF &  sparseANF,
int  indep,
int  numSwitches 
) const

Split the recovered extended Jacobian into abs-normal blocks.

The recovered matrix is interpreted as [Y J; Z L] with rows [y ; z] and columns [x ; |z|]. The four sparse blocks are resized automatically and filled with block-local coordinates.

◆ recoverANFUserMem()

void ADOLC::Sparse::SparseJacInfos::recoverANFUserMem ( SparseANF &  sparseANF,
int  indep,
int  numSwitches 
) const

Split the recovered extended Jacobian into caller-sized ANF blocks.

sparseANF.Y, sparseANF.J, sparseANF.Z, and sparseANF.L must already contain exactly the number of entries required by the cached abs-normal sparsity pattern. Recovered entries use block-local coordinates.

◆ recoverColFormat()

void ADOLC::Sparse::SparseJacInfos::recoverColFormat ( SparseMatrix &  sparseJac) const

Resize and recover a column-compressed sparse Jacobian.

◆ recoverColFormatUserMem()

void ADOLC::Sparse::SparseJacInfos::recoverColFormatUserMem ( SparseMatrix &  sparseJac) const

Recover column-compressed sparse Jacobian entries into SparseMatrix.

Note
The structure is adapted from ColPack's JacobianRecovery1D::RecoverD2Cln_CoordinateFormat_usermem to work with an array of row-column-value triplets (aka. CoordinateFormatTripled) rather than separate arrays for rows, columns, and values.

◆ recoverRowFormat()

void ADOLC::Sparse::SparseJacInfos::recoverRowFormat ( SparseMatrix &  sparseJac) const

Resize and recover a row-compressed sparse Jacobian.

◆ recoverRowFormatUserMem()

void ADOLC::Sparse::SparseJacInfos::recoverRowFormatUserMem ( SparseMatrix &  sparseJac) const

Recover row-compressed sparse Jacobian entries into SparseMatrix.

Note
The structure is adapted from ColPack's JacobianRecovery1D::RecoverD2Row_CoordinateFormat_usermem to work with an array of row-column-value triplets (aka. CoordinateFormatTripled) rather than separate arrays for rows, columns, and values.

◆ setJP()

void ADOLC::Sparse::SparseJacInfos::setJP ( std::vector< uint * > &&  JPIn)
inline

Replace the cached sparsity pattern.

Existing CRS rows are deleted before the new storage is adopted.

Parameters
JPInNew CRS sparsity rows.

Member Data Documentation

◆ B_

double** ADOLC::Sparse::SparseJacInfos::B_ {nullptr}

◆ depen_

int ADOLC::Sparse::SparseJacInfos::depen_ {0}

◆ JP_

std::vector<uint *> ADOLC::Sparse::SparseJacInfos::JP_

◆ nnzIn_

int ADOLC::Sparse::SparseJacInfos::nnzIn_ {0}

◆ pimpl_

std::unique_ptr<Impl> ADOLC::Sparse::SparseJacInfos::pimpl_

◆ Seed_

double** ADOLC::Sparse::SparseJacInfos::Seed_ {nullptr}

◆ seedClms_

int ADOLC::Sparse::SparseJacInfos::seedClms_ {0}

◆ seedRows_

int ADOLC::Sparse::SparseJacInfos::seedRows_ {0}

◆ y_

double* ADOLC::Sparse::SparseJacInfos::y_ {nullptr}

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