proxsuite-nlp  0.10.0
A primal-dual augmented Lagrangian-type solver for nonlinear programming on manifolds.
Loading...
Searching...
No Matches
ldlt-base.hpp
Go to the documentation of this file.
1
5#pragma once
6
10
11#include <Eigen/Cholesky>
12
13namespace proxsuite {
14namespace nlp {
15
18namespace linalg {
19
20using isize = Eigen::Index;
21using Eigen::internal::SignMatrix;
22
24template <typename Scalar> struct ldlt_base {
26 using DView = Eigen::Map<const VectorXs, Eigen::Unaligned,
27 Eigen::InnerStride<Eigen::Dynamic>>;
28
29 template <typename Mat> static DView diag_view_impl(Mat &&mat) {
30 Eigen::InnerStride<Eigen::Dynamic> stride{mat.outerStride() + 1};
31 return {mat.data(), mat.rows(), 1, stride};
32 }
33
34 virtual ldlt_base &compute(const ConstMatrixRef &mat) = 0;
35 bool solveInPlace(MatrixRef) const {
36 PROXSUITE_NLP_RUNTIME_ERROR("Not implemented");
37 }
38 virtual DView vectorD() const = 0;
39 virtual const MatrixXs &matrixLDLT() const {
40 PROXSUITE_NLP_RUNTIME_ERROR("Not implemented");
41 }
42 virtual MatrixXs reconstructedMatrix() const = 0;
43 Eigen::ComputationInfo info() const { return m_info; }
44 SignMatrix sign() const { return m_sign; }
45 virtual ~ldlt_base() = 0;
46
47protected:
48 Eigen::ComputationInfo m_info;
49 SignMatrix m_sign = SignMatrix::ZeroSign;
50};
51
52template <typename Scalar> ldlt_base<Scalar>::~ldlt_base() {}
53
54} // namespace linalg
55} // namespace nlp
56} // namespace proxsuite
#define PROXSUITE_NLP_RUNTIME_ERROR(msg)
Definition exceptions.hpp:8
#define PROXSUITE_NLP_DYNAMIC_TYPEDEFS(Scalar)
Definition math.hpp:26
Main package namespace.
Definition bcl-params.hpp:5
Base interface for LDLT solvers.
Definition ldlt-base.hpp:24
Eigen::ComputationInfo m_info
Definition ldlt-base.hpp:48
Eigen::Map< const VectorXs, Eigen::Unaligned, Eigen::InnerStride< Eigen::Dynamic > > DView
Definition ldlt-base.hpp:26
bool solveInPlace(MatrixRef) const
Definition ldlt-base.hpp:35
virtual DView vectorD() const =0
virtual const MatrixXs & matrixLDLT() const
Definition ldlt-base.hpp:39
static DView diag_view_impl(Mat &&mat)
Definition ldlt-base.hpp:29
virtual ldlt_base & compute(const ConstMatrixRef &mat)=0
virtual MatrixXs reconstructedMatrix() const =0
Eigen::ComputationInfo info() const
Definition ldlt-base.hpp:43