36 template <
typename Scalar>
37 explicit Inertia(
const Eigen::Vector<Scalar, Eigen::Dynamic>& D) {
38 for (
const auto& elem : D) {
39 if (elem > Scalar(0)) {
41 }
else if (elem < Scalar(0)) {
54 template <
typename Scalar>
56 const Eigen::Diagonal<
57 const Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>>& D) {
58 for (
const auto& elem : D) {
59 if (elem > Scalar(0)) {
61 }
else if (elem < Scalar(0)) {
constexpr Inertia()=default
int zero
The number of zero eigenvalues.
Definition inertia.hpp:18
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....
Definition inertia.hpp:55
constexpr Inertia(int positive, int negative, int zero)
Constructs Inertia with the given number of positive, negative, and zero eigenvalues.
Definition inertia.hpp:28
bool operator==(const Inertia &) const =default
Inertia equality operator.
int positive
The number of positive eigenvalues.
Definition inertia.hpp:14
Inertia(const Eigen::Vector< Scalar, Eigen::Dynamic > &D)
Constructs Inertia from the D matrix of an LDLT decomposition (see https://en.wikipedia....
Definition inertia.hpp:37
int negative
The number of negative eigenvalues.
Definition inertia.hpp:16
Definition expression_graph.hpp:11