NABLA  Nabla Ain't Basic Linear Algebra
Requirements for Template Parameter value_t

The type of elements – value_t – manipulated by various enities, that is the template parameter of several entities, have the same requirements as in the C++ Standard Template Library (STL): value_t must supply

- public default constructor,
- public copy constructor,
- public destructor,
- public assignment operator and
- public equivalence operator.
.

Typically the element type has value semantics and automatically satisfies the requirements above.

Using complex types

If you use a complex type other than std::complex it is assumed that conj() function is defined for this type. If the function have different name than conj() then you have to define a redirection function in type's namespace. It may look like this:

template<typename type>
inline my_complex<type> conj(const my_complex<type> &a)
{
return conjugate(a); //returns conjugated entity here
}

Special constants

Additionally several entities use special constants defined in traits template class. To use this entities value_t must supply constructor taking 0 and 1 integer literals to represent zero (additive identity) and unit (multiplicative identity) entities respectively. This requirement is met when e.g. floating point types (i.e. float or double) or STL complex class are used. Otherwise traits class must be specialized with proper traits::zero and traits::unit initialization.

Here goes a list of entities which use special constants.

Member nabla::accumulate (const vector_expression< value_t, expr1, tag1 > &a, const vector_expression< value_t, expr2, tag2 > &b)
This function uses traits<value_t>::zero.
Member nabla::accumulate (const vector_expression< value_t, expr_t, tag > &a)
This function uses traits<value_t>::zero.
Member nabla::dot_product (const vector_expression< value_t, expr1, tag1 > &v1, const vector_expression< value_t, expr2, tag2 > &v2)
This function uses traits<value_t>::zero.
Member nabla::dot_product (const vector_expression< value_t, expr1, tag1 > &v1, const vector_expression< value_t, expr2, tag2 > &v2)
This function uses traits<value_t>::zero.
Member nabla::norm (const vector_expression< value_t, expr_t, tag > &v)
This function uses traits<value_t>::zero.
Member nabla::norm (const vector_expression< value_t, expr_t, tag > &v)
This function uses traits<value_t>::zero.
Member nabla::sqrnorm (const vector_expression< value_t, expr_t, tag > &v)
This function uses traits<value_t>::zero.
Member nabla::sqrnorm (const vector_expression< value_t, expr_t, tag > &v)
This function uses traits<value_t>::zero.
Member nabla::sum_of_products (const vector_expression< value_t, expr1, tag1 > &a, const vector_expression< value_t, expr2, tag2 > &b)
This function uses traits<value_t>::zero.
Member nabla::sum_of_products (const vector_expression< value_t, expr1, tag1 > &a, const vector_expression< value_t, expr2, tag2 > &b)
This function uses traits<value_t>::zero.