Utils

Logger

spdlog::logger& ipc::logger()

Retrieves the current logger.

Returns:

A const reference to the logger object.

void ipc::set_logger(std::shared_ptr<spdlog::logger> logger)

Setup a logger object.

Calling this function with other function is not thread-safe.

Parameters:
std::shared_ptr<spdlog::logger> logger

New logger object to be used.

Positive Semi-Definite Projection

template <typename _Scalar, int _Rows, int _Cols, int _Options,
    
int _MaxRows, int _MaxCols>
Eigen
::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>
ipc::project_to_psd(const Eigen::Matrix<_Scalar, _Rows, _Cols,
                        
_Options, _MaxRows, _MaxCols>& A
,
    const
 PSDProjectionMethod method = PSDProjectionMethod::CLAMP
)

Matrix projection onto positive semi-definite cone.

Parameters:
const Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> &A

Symmetric matrix to project

const PSDProjectionMethod method = PSDProjectionMethod::CLAMP

PSD projection method

Returns:

Projected matrix

template <typename _Scalar, int _Rows, int _Cols, int _Options,
    
int _MaxRows, int _MaxCols>
Eigen
::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>
ipc::project_to_pd(const Eigen::Matrix<_Scalar, _Rows, _Cols,
                       
_Options, _MaxRows, _MaxCols>& A
,
    double
 eps = 1e-8
)

Matrix projection onto positive definite cone.

Parameters:
const Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> &A

Symmetric matrix to project

Returns:

Projected matrix

enum class ipc::PSDProjectionMethod

Enumeration of implemented PSD projection methods.

Values:

enumerator NONE

No PSD projection.

enumerator CLAMP

Clamp negative eigenvalues to zero.

enumerator ABS

Flip negative eigenvalues to positive.


Last update: Dec 12, 2024