Contents

class

SushiDSP::dk::DenseLu< 2 >

template <>

Closed-form 2x2 LU with partial pivoting; N = 2 is the shape of every triode block and of the D6c clip stage's diode pair, so it is the hot Jacobian size in the tree.

Declared in
include/SushiDSP/math/dk/DenseLu.hpp

Static public attributes

static constexpr double kMinimumPivot = 1e-300

Smallest pivot magnitude accepted as non-singular.

Public member functions

bool factorise(const std::array< std::array< double, 2 >, 2 > &matrix)

Factorises the 2x2 matrix into the internal L/U storage.

Parameters

matrix

The system matrix; not modified.

Returns

False when a pivot is numerically zero; solve() must not be called after that.

bool factorise(const std::array< std::array< double, 2 >, 2 > &matrix, std::size_t order)

Factorises the leading order x order block of the 2x2 matrix.

Parameters

matrix

The system matrix; only its leading block is read, and it is not modified.

order

Active dimension, 0, 1, or 2. An order of zero always succeeds.

Returns

False when a pivot is numerically zero; solve() must not be called after that.

void solve(const std::array< double, 2 > &right_hand_side, std::array< double, 2 > &solution) const

Solves the 2x2 system A x = b using the factors from the last factorise().

Parameters

right_hand_side

b.

solution

x, overwritten.

void solve(const std::array< double, 2 > &right_hand_side, std::array< double, 2 > &solution, std::size_t order) const

Solves the leading order x order block using the factors from the last factorise() of the same order.

Parameters

right_hand_side

b; only its leading order entries are read.

solution

x; only its leading order entries are written.

order

Active dimension, 0, 1, or 2, matching the last factorise().