10using realvec = Eigen::Matrix<real_t, Eigen::Dynamic, 1>;
12using realmat = Eigen::Matrix<real_t, Eigen::Dynamic, Eigen::Dynamic>;
16using rvec = Eigen::Ref<vec>;
18using crvec = Eigen::Ref<const vec>;
22using rmat = Eigen::Ref<mat>;
24using crmat = Eigen::Ref<const mat>;
26constexpr real_t inf = std::numeric_limits<real_t>::infinity();
28constexpr real_t NaN = std::numeric_limits<real_t>::quiet_NaN();
34template <
class V,
class M>
36 return v.dot(
Σ.asDiagonal() *
v);
43 return v.template lpNorm<Eigen::Infinity>();
50 return v.template lpNorm<1>();
real_t norm_1(const Vec &v)
Get the 1-norm of the given vector.
auto norm_squared_weighted(V &&v, M &&Σ)
Get the Σ norm squared of a given vector, with Σ a diagonal matrix.
real_t norm_inf(const Vec &v)
Get the maximum or infinity-norm of the given vector.
Eigen::Matrix< real_t, Eigen::Dynamic, Eigen::Dynamic > realmat
Default type for floating point matrices.
Eigen::Ref< const vec > crvec
Default type for immutable references to vectors.
Eigen::Ref< const mat > crmat
Default type for immutable references to matrices.
constexpr real_t NaN
Not a number.
realmat mat
Default type for matrices.
realvec vec
Default type for vectors.
Eigen::Ref< mat > rmat
Default type for mutable references to matrices.
double real_t
Default floating point type.
Eigen::Matrix< real_t, Eigen::Dynamic, 1 > realvec
Default type for floating point vectors.
Eigen::Ref< vec > rvec
Default type for mutable references to vectors.