21 #ifndef RFFGEN_UTIL_ZERO_HH
22 #define RFFGEN_UTIL_ZERO_HH
35 template <
class Matrix>
36 using TryCallToZeroes = decltype(std::declval<Matrix>().zeros());
38 template <
class Matrix>
39 using TryCallToFill = decltype(std::declval<Matrix>().fill(0));
45 template <
class Matrix,
class =
void>
59 template <
class Matrix>
60 struct Zero< Matrix ,
void_t<Checks::TryCallToFill<Matrix> > >
86 template <
class Matrix,
class = std::enable_if_t<Checks::isConstantSizeMatrix<Matrix>()> >
96 template <
class Matrix,
class = std::enable_if_t<!Checks::isConstantSizeMatrix<Matrix>()> >
97 constexpr Matrix
zero(
int rows,
int cols)
105 #endif // RFFGEN_UTIL_ZERO_HH
typename Detail::voider< Types...>::type void_t
Most fascinating type ever. Is always void.
Definition: voider.hh:40
Static checks for detection of presence of different operators and functions.
Specialize this struct for your matrix type if a zero matrix cannot be generated via Matrix(0...
Definition: zero.hh:47
Matrix & operator()(Matrix &m) const
Set all entries of m to 0.
Definition: zero.hh:75
Matrix zero()
Definition: zero.hh:87
Matrix operator()() const
Definition: zero.hh:52
Matrix operator()() const
Definition: zero.hh:65