1 #ifndef SCALARMATRIX_H_ 2 #define SCALARMATRIX_H_ 15 template <
typename T >
25 return (pos[0] == pos[1] ? m_value : 0);
28 value_type
value()
const {
return m_value; }
29 value_type &
value() {
return m_value; }
37 template <
typename T,
typename TArray >
38 T
matdot(ScalarMatrix<T> m,
const TArray & x)
40 return norm2<T>(n) * m.value();
Belongs to package Box Do not include directly, include til/Box.h instead.
value_type operator()(const numeric_array< std::size_t, 2 > &pos)
T matdot(ScalarMatrix< T > m, const TArray &x)
Compute x^T.M.x.
ScalarMatrix(prec_type value)