Logo MTL4

mtl::vector::dense_vector< Value, Parameters > Class Template Reference

Dense vector. More...

#include <dense_vector.hpp>

Inherits mtl::vector::vec_expr<dense_vector<Value, Parameters> >, mtl::detail::contiguous_memory_block< Value, Parameters::on_stack, Parameters::dimension::value >, and mtl::vector::crtp_base_vector< dense_vector<Value, Parameters>, Value, std::size_t >.

List of all members.

Public Member Functions

void check_index (size_type i) const
 Check whether index is non-negative and less than size.
void check_dim (size_type s) const
 Check for a given vector if the sizes are equal or this has size 0 (and can take the size of source).
void static_check (size_type s) const
 Check at compile time for a given vector if the sizes are equal.
template<class E >
void check_consistent_shape (vec_expr< E > const &e) const
 Check if a given vector expression whether it has the same shape as the object.
 dense_vector ()
 Default constructor.
 dense_vector (size_type n)
 Constructor for size n.
 dense_vector (size_type n, value_type value)
 Constructor for size n and value value that is set in all entries.
 dense_vector (size_type n, value_type *address)
 Constructor for size n and address.
 dense_vector (const self &src)
 Copy constructor.
template<typename VectorSrc >
 dense_vector (const VectorSrc &src, typename boost::disable_if< boost::is_integral< VectorSrc >, int >::type=0)
 Constructor from vector expressions.
size_type stride () const
 Stride is always 1.
reference operator() (size_type i)
 i-th entry
const_reference operator() (size_type i) const
 i-th entry (constant)
reference operator[] (size_type i)
 i-th entry
const_reference operator[] (size_type i) const
 i-th entry (constant)
self operator[] (irange r)
 sub-vector
const self operator[] (irange r) const
 sub-vector
value_type * address_data ()
 Address of first data entry; to be used with care.
selfoperator= (self src)
 Move assignment.

Friends

size_type size (const self &v)
 Size of v (like a free function).
void swap (self &vector1, self &vector2)
 swap two vectors


Detailed Description

template<class Value, typename Parameters = parameters<>>
class mtl::vector::dense_vector< Value, Parameters >

Dense vector.

Constructor & Destructor Documentation

template<class Value, typename Parameters = parameters<>>
mtl::vector::dense_vector< Value, Parameters >::dense_vector ( size_type  n,
value_type *  address 
) [inline, explicit]

Constructor for size n and address.

Can be used to handle vectors from other libraries, even in other languages like Fortran


Member Function Documentation

template<class Value, typename Parameters = parameters<>>
template<class E >
void mtl::vector::dense_vector< Value, Parameters >::check_consistent_shape ( vec_expr< E > const &  e  )  const [inline]

Check if a given vector expression whether it has the same shape as the object.

Both must be row vectors or column vectors. The elements must have the same algebraic shape, e.g. a row vector of scalars is not compatible with a row vector of matrices.


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


mtl::vector::dense_vector< Value, Parameters > Class Template Reference -- MTL 4 -- Peter Gottschling and Andrew Lumsdaine -- Gen. with rev. 7542 on 7 Apr 2011 by doxygen 1.5.9 -- © 2010 by SimuNova UG.