namespace gpr::linalg::fixed¶
Overview¶
namespace fixed {
// global functions
bool choleskyLower(double* a, std::int64_t lda, std::int64_t n);
void solveRightLowerTranspose(const double* l, std::int64_t ldl, std::int64_t n, double* x, std::int64_t ldx, std::int64_t rows);
void solveLeftTriangular(const double* t, std::int64_t ldt, std::int64_t n, bool lower, double* b, std::int64_t ldb, std::int64_t cols);
void subtractProduct(const double* a, std::int64_t lda, bool transpose_a, const double* b, std::int64_t ldb, double* c, std::int64_t ldc, std::int64_t m, std::int64_t n, std::int64_t k);
void subtractProductTransposed(const double* a, std::int64_t lda, const double* bt, std::int64_t ldbt, double* c, std::int64_t ldc, std::int64_t m, std::int64_t n, std::int64_t k);
} // namespace fixed
Detailed Documentation¶
Global Functions¶
bool choleskyLower(double* a, std::int64_t lda, std::int64_t n)
Cholesky factor of the lower triangle of the n x n block a (column-major, leading dimension lda), in place. Left-looking: column j receives a(j:, j) -= a(j:, l) a(j, l) for l = 0 .. j-1 in ascending order, then is scaled by its pivot. Returns false at the first pivot that is not positive and finite; the block is then partly overwritten.
void solveRightLowerTranspose(const double* l, std::int64_t ldl, std::int64_t n, double* x, std::int64_t ldx, std::int64_t rows)
X := X L^-T for X (rows x n, leading dimension ldx) and the lower triangle of L (n x n). Column c of X is (X(:, c) - sum_{l<c} X(:, l) L(c, l)) / L(c, c), terms in ascending l.
void solveLeftTriangular(const double* t, std::int64_t ldt, std::int64_t n, bool lower, double* b, std::int64_t ldb, std::int64_t cols)
B := T^-1 B for the lower (lower == true) or upper triangle of T (n x n) and B (n x cols): forward or back substitution, one right-hand side at a time, row r taking the terms of the solved rows in order of solution.
void subtractProduct(const double* a, std::int64_t lda, bool transpose_a, const double* b, std::int64_t ldb, double* c, std::int64_t ldc, std::int64_t m, std::int64_t n, std::int64_t k)
C -= op(A) B with op(A) = A (m x k) or A^T (A stored k x m), B (k x n): entry (i, j) subtracts its k terms one at a time in ascending order. For products too narrow to amortize a Scheme II reconstruction.
void subtractProductTransposed(const double* a, std::int64_t lda, const double* bt, std::int64_t ldbt, double* c, std::int64_t ldc, std::int64_t m, std::int64_t n, std::int64_t k)
C -= A Bt^T with A (m x k, leading dimension lda) and Bt (n x k, leading dimension ldbt): entry (i, j) subtracts A(i, l) Bt(j, l) one term at a time, l ascending.