#include <algorithm>
#include <cmath>
#include <iostream>
#include <limits>
#include <random>
using batmat::index_t;
using batmat::real_t;
using batch_size = std::integral_constant<index_t, 4>;
constexpr auto storage_order = batmat::matrix::StorageOrder::ColMajor;
index_t n = 3, m = n + 5;
Mat C{{.rows = n, .cols = n}}, A{{.rows = n, .cols = m}};
std::mt19937 rng{12345};
std::uniform_real_distribution<real_t> uni{-1.0, 1.0};
std::ranges::generate(A, [&] { return uni(rng); });
for (index_t l = 0; l < C.depth(); ++l) {
}
int errors = 0;
const auto eps = std::numeric_limits<real_t>::epsilon();
for (index_t l = 0; l < C.depth(); ++l)
for (index_t c = 0; c < C.cols(); ++c)
for (index_t r = c; r < C.rows(); ++r)
errors += std::abs(C(l, r, c) - L(l, r, c)) < 10 * eps ? 0 : 1;
return errors;
}
std::ostream & print_python(std::ostream &os, std::span< T, E > x, std::string_view end="\n", bool squeeze=true)
void syrk(Structured< VA, SA > A, Structured< VD, SD > D, Opts... opts)
D = A Aᵀ with D symmetric.
void potrf(Structured< VC, SC > C, Structured< VD, SC > D, simdified_value_t< VC > regularization=0)
D = chol(C) with C symmetric, D triangular.
void fill(simdified_value_t< VB > a, VB &&B)
B = a.
constexpr auto triu(M &&m)
Upper-triangular view.
constexpr auto tril(M &&m)
Lower-triangular view.
struct batmat::matrix::uninitialized_t uninitialized
Tag type to indicate that memory should not be initialized.
Class for a batch of matrices that owns its storage.
Class for a batch of matrices that owns its storage.