WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
slp::Inertia Class Reference

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

#include </home/runner/work/allwpilib/allwpilib/wpimath/src/main/native/thirdparty/sleipnir/include/sleipnir/optimization/solver/util/inertia.hpp>

Public Member Functions

constexpr Inertia ()=default
constexpr Inertia (int positive, int negative, int zero)
 Constructs Inertia with the given number of positive, negative, and zero eigenvalues.
template<typename Scalar>
 Inertia (const Eigen::Vector< Scalar, Eigen::Dynamic > &D)
 Constructs Inertia from the D matrix of an LDLT decomposition (see https://en.wikipedia.org/wiki/Sylvester's_law_of_inertia).
template<typename Scalar>
 Inertia (const Eigen::Diagonal< const Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > > &D)
 Constructs Inertia from the D matrix of an LDLT decomposition (see https://en.wikipedia.org/wiki/Sylvester's_law_of_inertia).
bool operator== (const Inertia &) const =default
 Inertia equality operator.

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/4]

slp::Inertia::Inertia ( )
constexprdefault

◆ Inertia() [2/4]

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() [3/4]

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() [4/4]

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.

Member Data Documentation

◆ negative

int slp::Inertia::negative = 0

The number of negative eigenvalues.

◆ positive

int slp::Inertia::positive = 0

The number of positive eigenvalues.

◆ zero

int slp::Inertia::zero = 0

The number of zero eigenvalues.


The documentation for this class was generated from the following file:
  • /home/runner/work/allwpilib/allwpilib/wpimath/src/main/native/thirdparty/sleipnir/include/sleipnir/optimization/solver/util/inertia.hpp