Sleipnir C++ API
Loading...
Searching...
No Matches
slp::Inertia Class Reference

#include <sleipnir/optimization/solver/util/inertia.hpp>

Public Member Functions

constexpr Inertia (int positive, int negative, int zero)
 
template<typename Scalar >
 Inertia (const Eigen::Vector< Scalar, Eigen::Dynamic > &D)
 
template<typename Scalar >
 Inertia (const Eigen::Diagonal< const Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > > &D)
 
bool operator== (const Inertia &) const =default
 

Public Attributes

int positive = 0
 The number of positive eigenvalues.
 
int negative = 0
 The number of negative eigenvalues.
 
int zero = 0
 The number of zero eigenvalues.
 

Detailed Description

Represents the inertia of a matrix (the number of positive, negative, and zero eigenvalues).

Constructor & Destructor Documentation

◆ Inertia() [1/3]

constexpr slp::Inertia::Inertia ( int  positive,
int  negative,
int  zero 
)
inlineconstexpr

Constructs Inertia with the given number of positive, negative, and zero eigenvalues.

Parameters
positiveThe number of positive eigenvalues.
negativeThe number of negative eigenvalues.
zeroThe number of zero eigenvalues.

◆ Inertia() [2/3]

template<typename Scalar >
slp::Inertia::Inertia ( const Eigen::Vector< Scalar, Eigen::Dynamic > &  D)
inlineexplicit

Constructs Inertia from the D matrix of an LDLT decomposition (see https://en.wikipedia.org/wiki/Sylvester's_law_of_inertia).

Template Parameters
ScalarScalar type.
Parameters
DThe D matrix of an LDLT decomposition in vector form.

◆ Inertia() [3/3]

template<typename Scalar >
slp::Inertia::Inertia ( const Eigen::Diagonal< const Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > > &  D)
inlineexplicit

Constructs Inertia from the D matrix of an LDLT decomposition (see https://en.wikipedia.org/wiki/Sylvester's_law_of_inertia).

Template Parameters
ScalarScalar type.
Parameters
DThe D matrix of an LDLT decomposition in vector form.

Member Function Documentation

◆ operator==()

bool slp::Inertia::operator== ( const Inertia ) const
default

Inertia equality operator.

Returns
True if Inertia is equal.

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