MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
Loading...
Searching...
No Matches
signum.hpp File Reference
#include <limits>
#include <mtl/concepts/vector.hpp>
#include <mtl/concepts/matrix.hpp>
#include <mtl/vec/dense_vector.hpp>
#include <mtl/mat/dense2D.hpp>

Namespaces

namespace  mtl
namespace  mtl::detail
 mat*vec multiply into pre-allocated y: y = A * x.

Functions

template<typename T>
constexpr T mtl::detail::signum_scalar (const T &x)
 +1, 0 or -1; an unsigned type has no -1, so 1 or 0 (T{-1} narrowed and did not compile, issue 887).
template<Vector V>
auto mtl::signum (const V &v)
 Element-wise signum for vectors: +1, 0, or -1.
template<Matrix M>
auto mtl::signum (const M &m)
 Element-wise signum for matrices.