12#ifndef SANDALS_LINEAR_SYSTEM_HXX
13#define SANDALS_LINEAR_SYSTEM_HXX
35 template <Integer N, Integer M = 0>
39 using Pointer = std::shared_ptr<SemiExplicit<N, M>>;
48 Eigen::FullPivLU<MatrixE>
m_lu;
77 return this->
E(t)*x_dot - this->
A(t)*x - this->
b(t);
127 this->m_lu.compute(this->
E(t));
128 SANDALS_ASSERT(this->m_lu.rank() == N,
"Sandals:Linear::f(...): singular mass matrix E(t) detected.");
129 return this->m_lu.solve(this->
A(t)*x + this->
b(t));
147 this->m_lu.compute(this->
E(t));
148 SANDALS_ASSERT(this->m_lu.rank() == N,
"Sandals:Linear::Jf_x(...): singular mass matrix E(t) detected.");
149 return this->m_lu.solve(this->
A(t));
#define SANDALS_ASSERT(COND, MSG)
Definition Sandals.hh:43
typename Implicit< N, M >::MatrixJF MatrixJF
Definition Explicit.hxx:42
Explicit(Type t_type, std::string t_name)
Definition Explicit.hxx:52
typename Implicit< N, M >::Type Type
Definition Explicit.hxx:43
typename Implicit< N, M >::VectorF VectorF
Definition Explicit.hxx:41
typename Explicit< N, M >::MatrixJF MatrixE
Definition Linear.hxx:42
MatrixJF JF_x(VectorF const &, VectorF const &, Real t) const override
Definition Linear.hxx:95
Linear()
Definition Linear.hxx:54
MatrixJF JF_x_dot(VectorF const &, VectorF const &, Real t) const override
Definition Linear.hxx:112
VectorF F(VectorF const &x, VectorF const &x_dot, Real t) const override
Definition Linear.hxx:75
virtual MatrixE E(Real t) const =0
VectorF f(VectorF const &x, Real t) const override
Definition Linear.hxx:125
typename Explicit< N, M >::Type Type
Definition Linear.hxx:45
virtual MatrixA A(Real t) const =0
typename Explicit< N, M >::MatrixJF MatrixA
Definition Linear.hxx:43
typename Explicit< N, M >::MatrixJF MatrixJF
Definition Linear.hxx:41
typename Explicit< N, M >::VectorF VectorF
Definition Linear.hxx:40
Linear(std::string t_name)
Definition Linear.hxx:60
Eigen::FullPivLU< MatrixE > m_lu
Definition Linear.hxx:48
typename Explicit< N, M >::VectorF VectorB
Definition Linear.hxx:44
std::shared_ptr< SemiExplicit< N, M > > Pointer
Definition Linear.hxx:39
MatrixJF Jf_x(VectorF const &, Real t) const override
Definition Linear.hxx:145
virtual VectorB b(Real t) const =0
The namespace for the Sandals library.
Definition Sandals.hh:73
double Real
Definition Sandals.hh:84