linbox
BlasVector< _Field, _Storage > Class Template Reference

#include <blas-vector.h>

Data Structures

struct  rebind
 Rebind operator. More...
 

Public Types

typedef _Field Field
 
typedef Field::Element Element
 Element type.
 
typedef Element value_type
 
typedef Field::Element_ptr Element_ptr
 Element type.
 
typedef Element_ptr pointer
 
typedef Field::ConstElement_ptr ConstElement_ptr
 Element type.
 
typedef _Storage Storage
 Actually a std::vector<Element> (or alike.)
 
typedef Storage::reference reference
 
typedef Storage::const_reference const_reference
 
typedef BlasVector< _Field, _Storage > Self_t
 Self type.
 
typedef Self_t vectorType
 vector type
 
typedef BlasSubvector< Self_tsubVectorType
 SubVector type.
 
typedef BlasSubvector< const Self_tconstSubVectorType
 const SubVector type
 
typedef Storage::iterator iterator
 
typedef Storage::const_iterator const_iterator
 
typedef std::reverse_iterator< iteratorreverse_iterator
 
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 

Public Member Functions

void resize (size_t n)
 
void resize (size_t n, const Element &val)
 
 BlasVector (const _Field &F)
 Allocates a new \( 0 \) vector (shaped and ready).
 
 BlasVector (const Self_t &V)
 Copy Constructor of a vector (copying data).
 
template<class SizeType, typename std::enable_if< std::is_arithmetic< SizeType >::value, int >::type = 0>
 BlasVector (const _Field &F, const SizeType &m)
 Allocates a new \( m \) zero vector (shaped and ready).
 
template<class SizeType, typename std::enable_if< std::is_arithmetic< SizeType >::value, int >::type = 0>
 BlasVector (const _Field &F, const SizeType &m, const Element &e)
 
template<typename ConstIterator, typename std::enable_if<!std::is_arithmetic< ConstIterator >::value, int >::type = 0>
 BlasVector (const _Field &F, const ConstIterator &jt, const size_t m)
 Create a BlasVector from an iterator of elements.
 
template<class VectorBase, typename std::enable_if<!std::is_arithmetic< VectorBase >::value, int >::type = 0>
 BlasVector (const _Field &F, const VectorBase &V)
 Create a BlasVector from a container of elements.
 
template<class OtherVector>
 BlasVector (const OtherVector &V, const _Field &F)
 Create a BlasVector from another vector defined over a different field (use homomorphism if it exists)
 
Self_toperator= (const Self_t &A)
 operator = (copying data)
 
template<class _Vector>
Self_toperator= (const _Vector &A)
 operator = (copying data from different vector type)
 
template<class _Vector>
Self_tcopy (const _Vector &A)
 
const _Field & field () const
 
size_t size () const
 
size_t max_size () const
 
ConstElement_ptr getPointer () const
 _
 
Element_ptr getPointer ()
 
ConstElement_ptr getConstPointer () const
 
const StoragegetRep () const
 
size_t getInc () const
 Get the increment in the vector.
 
void push_back (const Element &e)
 add an element at the end of the vector (possibly invalidate existing iterators)
 
void clear (void)
 
void reserve (const size_t &m)
 
void setEntry (size_t i, const Element &a_i)
 
reference refEntry (size_t i)
 
const_reference getEntry (size_t i) const
 
ElementgetEntry (Element &x, size_t i) const
 
std::ostream & write (std::ostream &os, Tag::FileFormat fmt=Tag::FileFormat::Pretty) const
 
std::istream & read (std::istream &is, Tag::FileFormat fmt=Tag::FileFormat::Pretty)
 
iterator begin (void)
 
const_iterator begin (void) const
 
iterator end (void)
 
const_iterator end (void) const
 
reverse_iterator rbegin (void)
 
const_reverse_iterator rbegin (void) const
 
reverse_iterator rend (void)
 
const_reverse_iterator rend (void) const
 
iterator Begin (void)
 
const_iterator Begin (void) const
 
iterator End (void)
 
const_iterator End (void) const
 
reference operator[] (size_t n)
 
const_reference operator[] (size_t n) const
 
reference at (size_t n)
 
const_reference at (size_t n) const
 
reference front (void)
 
const_reference front (void) const
 
reference back (void)
 
const_reference back (void) const
 
bool empty () const
 
void random ()
 
template<class RandIter>
void random (RandIter r)
 

Protected Attributes

size_t _size =0
 
Storage _rep
 
Element_ptr _ptr
 
const Field_field
 

Member Typedef Documentation

◆ Field

template<class _Field, class _Storage>
typedef _Field Field

◆ Element

template<class _Field, class _Storage>
typedef Field::Element Element

Element type.

◆ value_type

template<class _Field, class _Storage>
typedef Element value_type

◆ Element_ptr

template<class _Field, class _Storage>
typedef Field::Element_ptr Element_ptr

Element type.

◆ pointer

template<class _Field, class _Storage>
typedef Element_ptr pointer

◆ ConstElement_ptr

template<class _Field, class _Storage>
typedef Field::ConstElement_ptr ConstElement_ptr

Element type.

◆ Storage

template<class _Field, class _Storage>
typedef _Storage Storage

Actually a std::vector<Element> (or alike.)

◆ reference

template<class _Field, class _Storage>
typedef Storage::reference reference

◆ const_reference

template<class _Field, class _Storage>
typedef Storage::const_reference const_reference

◆ Self_t

template<class _Field, class _Storage>
typedef BlasVector<_Field,_Storage> Self_t

Self type.

◆ vectorType

template<class _Field, class _Storage>
typedef Self_t vectorType

vector type

◆ subVectorType

template<class _Field, class _Storage>
typedef BlasSubvector<Self_t> subVectorType

SubVector type.

◆ constSubVectorType

template<class _Field, class _Storage>
typedef BlasSubvector<const Self_t> constSubVectorType

const SubVector type

◆ iterator

template<class _Field, class _Storage>
typedef Storage::iterator iterator

◆ const_iterator

template<class _Field, class _Storage>
typedef Storage::const_iterator const_iterator

◆ reverse_iterator

template<class _Field, class _Storage>
typedef std::reverse_iterator<iterator> reverse_iterator

◆ const_reverse_iterator

template<class _Field, class _Storage>
typedef std::reverse_iterator<const_iterator> const_reverse_iterator

Constructor & Destructor Documentation

◆ BlasVector() [1/7]

template<class _Field, class _Storage>
BlasVector ( const _Field & F)
inline

Allocates a new \( 0 \) vector (shaped and ready).

◆ BlasVector() [2/7]

template<class _Field, class _Storage>
BlasVector ( const Self_t & V)
inline

Copy Constructor of a vector (copying data).

Parameters
Vvector to be copied.

◆ BlasVector() [3/7]

template<class _Field, class _Storage>
template<class SizeType, typename std::enable_if< std::is_arithmetic< SizeType >::value, int >::type = 0>
BlasVector ( const _Field & F,
const SizeType & m )
inline

Allocates a new \( m \) zero vector (shaped and ready).

Parameters
F
mvector dimension

◆ BlasVector() [4/7]

template<class _Field, class _Storage>
template<class SizeType, typename std::enable_if< std::is_arithmetic< SizeType >::value, int >::type = 0>
BlasVector ( const _Field & F,
const SizeType & m,
const Element & e )
inline

◆ BlasVector() [5/7]

template<class _Field, class _Storage>
template<typename ConstIterator, typename std::enable_if<!std::is_arithmetic< ConstIterator >::value, int >::type = 0>
BlasVector ( const _Field & F,
const ConstIterator & jt,
const size_t m )
inline

Create a BlasVector from an iterator of elements.

Parameters
FField of the created vector
ititerator to be copied from
mvector dimension
incincrement value for iterating

◆ BlasVector() [6/7]

template<class _Field, class _Storage>
template<class VectorBase, typename std::enable_if<!std::is_arithmetic< VectorBase >::value, int >::type = 0>
BlasVector ( const _Field & F,
const VectorBase & V )
inline

Create a BlasVector from a container of elements.

Parameters
FField of the created vector
Viterator to be copied from

◆ BlasVector() [7/7]

template<class _Field, class _Storage>
template<class OtherVector>
BlasVector ( const OtherVector & V,
const _Field & F )
inline

Create a BlasVector from another vector defined over a different field (use homomorphism if it exists)

Parameters
FField of the created vector
VVector to be copied

Member Function Documentation

◆ resize() [1/2]

template<class _Field, class _Storage>
void resize ( size_t n)
inline

◆ resize() [2/2]

template<class _Field, class _Storage>
void resize ( size_t n,
const Element & val )
inline

◆ operator=() [1/2]

template<class _Field, class _Storage>
Self_t & operator= ( const Self_t & A)
inline

operator = (copying data)

◆ operator=() [2/2]

template<class _Field, class _Storage>
template<class _Vector>
Self_t & operator= ( const _Vector & A)
inline

operator = (copying data from different vector type)

◆ copy()

template<class _Field, class _Storage>
template<class _Vector>
Self_t & copy ( const _Vector & A)
inline

◆ field()

template<class _Field, class _Storage>
const _Field & field ( ) const
inline

◆ size()

template<class _Field, class _Storage>
size_t size ( ) const
inline

◆ max_size()

template<class _Field, class _Storage>
size_t max_size ( ) const
inline

◆ getPointer() [1/2]

template<class _Field, class _Storage>
ConstElement_ptr getPointer ( ) const
inline

_

Get access to the vector data.

◆ getPointer() [2/2]

template<class _Field, class _Storage>
Element_ptr getPointer ( )
inline

◆ getConstPointer()

template<class _Field, class _Storage>
ConstElement_ptr getConstPointer ( ) const
inline

◆ getRep()

template<class _Field, class _Storage>
const Storage & getRep ( ) const
inline

◆ getInc()

template<class _Field, class _Storage>
size_t getInc ( ) const
inline

Get the increment in the vector.

Returns
the inc value of the subvector

◆ push_back()

template<class _Field, class _Storage>
void push_back ( const Element & e)
inline

add an element at the end of the vector (possibly invalidate existing iterators)

Parameters
eelement to add

◆ clear()

template<class _Field, class _Storage>
void clear ( void )
inline

◆ reserve()

template<class _Field, class _Storage>
void reserve ( const size_t & m)
inline

◆ setEntry()

template<class _Field, class _Storage>
void setEntry ( size_t i,
const Element & a_i )
inline

◆ refEntry()

template<class _Field, class _Storage>
reference refEntry ( size_t i)
inline

◆ getEntry() [1/2]

template<class _Field, class _Storage>
const_reference getEntry ( size_t i) const
inline

◆ getEntry() [2/2]

template<class _Field, class _Storage>
Element & getEntry ( Element & x,
size_t i ) const
inline

◆ write()

template<class _Field, class _Storage>
std::ostream & write ( std::ostream & os,
Tag::FileFormat fmt = Tag::FileFormat::Pretty ) const
inline

◆ read()

template<class _Field, class _Storage>
std::istream & read ( std::istream & is,
Tag::FileFormat fmt = Tag::FileFormat::Pretty )
inline

◆ begin() [1/2]

template<class _Field, class _Storage>
iterator begin ( void )
inline

◆ begin() [2/2]

template<class _Field, class _Storage>
const_iterator begin ( void ) const
inline

◆ end() [1/2]

template<class _Field, class _Storage>
iterator end ( void )
inline

◆ end() [2/2]

template<class _Field, class _Storage>
const_iterator end ( void ) const
inline

◆ rbegin() [1/2]

template<class _Field, class _Storage>
reverse_iterator rbegin ( void )
inline

◆ rbegin() [2/2]

template<class _Field, class _Storage>
const_reverse_iterator rbegin ( void ) const
inline

◆ rend() [1/2]

template<class _Field, class _Storage>
reverse_iterator rend ( void )
inline

◆ rend() [2/2]

template<class _Field, class _Storage>
const_reverse_iterator rend ( void ) const
inline

◆ Begin() [1/2]

template<class _Field, class _Storage>
iterator Begin ( void )
inline

◆ Begin() [2/2]

template<class _Field, class _Storage>
const_iterator Begin ( void ) const
inline

◆ End() [1/2]

template<class _Field, class _Storage>
iterator End ( void )
inline

◆ End() [2/2]

template<class _Field, class _Storage>
const_iterator End ( void ) const
inline

◆ operator[]() [1/2]

template<class _Field, class _Storage>
reference operator[] ( size_t n)
inline

◆ operator[]() [2/2]

template<class _Field, class _Storage>
const_reference operator[] ( size_t n) const
inline

◆ at() [1/2]

template<class _Field, class _Storage>
reference at ( size_t n)
inline

◆ at() [2/2]

template<class _Field, class _Storage>
const_reference at ( size_t n) const
inline

◆ front() [1/2]

template<class _Field, class _Storage>
reference front ( void )
inline

◆ front() [2/2]

template<class _Field, class _Storage>
const_reference front ( void ) const
inline

◆ back() [1/2]

template<class _Field, class _Storage>
reference back ( void )
inline

◆ back() [2/2]

template<class _Field, class _Storage>
const_reference back ( void ) const
inline

◆ empty()

template<class _Field, class _Storage>
bool empty ( ) const
inline

◆ random() [1/2]

template<class _Field, class _Storage>
void random ( )
inline

◆ random() [2/2]

template<class _Field, class _Storage>
template<class RandIter>
void random ( RandIter r)
inline

Field Documentation

◆ _size

template<class _Field, class _Storage>
size_t _size =0
protected

◆ _rep

template<class _Field, class _Storage>
Storage _rep
protected

◆ _ptr

template<class _Field, class _Storage>
Element_ptr _ptr
protected

◆ _field

template<class _Field, class _Storage>
const Field& _field
protected

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