NABLA  Nabla Ain't Basic Linear Algebra
expression< complexity > Struct Template Reference

Expression tag. More...

Detailed Description

template<size_t complexity>
struct nabla::tag::expression< complexity >

Expression tag.

This tag holds algorithmic complexity value for an expression. For more info see Complexity Concept.

Requirements:
Expressions tagged with expression must provide access to elements, i.e. one can get object's elements using subscript operator.

Expression concept description

Here is a concept description of a matrix expression class.

class type_id : public expression_id<value_type_id, type_id, tag::expression<complexity> >
{
public:
//Type of elements manipulated by this class.
typedef value_type_id value_type;
//Reference to constant value type, typically 'const value_type&'.
typedef implementation_defined const_reference;
//Subscript operator.
const_reference operator()(size_t row, size_t col) const;
//Returns number of rows.
size_t rows() const;
//Returns number of columns.
size_t cols() const;
private:
//Inaccessible copy constructor.
type_id(const type_id&); //do not define
//Inaccessible copy assignment operator.
type_id &operator=(const type_id&); //do not define
};

And here is one for a vector expression class.

class type_id : public expression_id<value_type_id, type_id, tag::expression<complexity> >
{
public:
//Type of elements manipulated by this class.
typedef value_type_id value_type;
//Reference to constant value type, typically 'const value_type&'.
typedef implementation_defined const_reference;
//Subscript operator.
const_reference operator()(size_t i) const;
//Returns size of vector.
size_t size() const;
private:
//Inaccessible copy constructor.
type_id(const type_id&); //do not define
//Inaccessible copy assignment operator.
type_id &operator=(const type_id&); //do not define
};

All entities are fully analogous to the case of tag::storage.

For description of value_type, const_reference, subscript operator, rows(), cols() and size() members see Storage Concept Description.

The complexity constant represents the complexity value as defined by Complexity Concept.

Objects of this type are intended to be immediate constant (i.e. read-only) values. Thus it is forbidden to copy construct them or directly assign an expression to them. That's why the copy constructor and copy assignment operator must be hidden (declared private and not implemented). It states that copy constructor and copy assignment are not the part of the interface implied by tag::expression, however they may be implemented in user types as convenience functions.

See Also
storage, reference

Definition at line 989 of file matrix.h.


The documentation for this struct was generated from the following file: