Function uw12::utils::square

Function Documentation

inline auto uw12::utils::square(const linalg::Vec &vec, const double factor = 1)

Generate a square symmetric matrix from a vector

Generate a square symmetric matrix of size n * n from a vector of size n * (n+1) /2 where the elements are the lower triangular elements of the output matrix in column major ordering. Inverse of lower.

Parameters
  • vec – Vector of lower triangular elements of symmetric matrix

  • factor – Off-diagonal factor

Returns

Resulting symmetric matrix