gsl::Vector Class Reference

#include <mia/core/gsl_vector.hh>

Inheritance diagram for gsl::Vector:
[legend]

Public Types

typedef const_vector_iterator const_iterator
 
typedef const double & const_reference
 
typedef vector_iterator iterator
 
typedef double & reference
 
typedef size_t size_type
 
typedef double value_type
 
typedef const gsl_vector * vector_const_pointer_type
 
typedef gsl_vector * vector_pointer_type
 
typedef gsl_vector vector_type
 

Public Member Functions

iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
 operator Vector::vector_const_pointer_type () const
 vector const pointer type operator to enable transparent calls to the GSL APL More...
 
 operator Vector::vector_pointer_type ()
 vector pointer type operator to enable transparent calls to the GSL APL More...
 
const gsl_vector * operator-> () const
 
gsl_vector * operator-> ()
 
Vectoroperator= (const Vector &other)
 
value_type operator[] (size_t i) const
 
reference operator[] (size_t i)
 
void print (std::ostream &os) const
 
size_type size () const
 
 Vector ()
 
 Vector (size_type size, bool clear)
 
 Vector (size_type size, const double *init)
 
 Vector (gsl_vector *holder)
 
 Vector (const gsl_vector *holder)
 
 Vector (const Vector &other)
 
 ~Vector ()
 Destructor. More...
 

Protected Member Functions

void reset_holder (gsl_vector *holder)
 
void reset_holder (const gsl_vector *holder)
 

Detailed Description

This is a wrapper class around the GSL vector type. It provides a compatibility layer to make it possible to use STL algorithms and constructs.

Definition at line 37 of file gsl_vector.hh.

Member Typedef Documentation

typedef const double& gsl::Vector::const_reference

Definition at line 45 of file gsl_vector.hh.

Definition at line 40 of file gsl_vector.hh.

typedef double& gsl::Vector::reference

Definition at line 44 of file gsl_vector.hh.

typedef size_t gsl::Vector::size_type

Definition at line 42 of file gsl_vector.hh.

typedef double gsl::Vector::value_type

Definition at line 43 of file gsl_vector.hh.

typedef const gsl_vector* gsl::Vector::vector_const_pointer_type

Definition at line 48 of file gsl_vector.hh.

typedef gsl_vector* gsl::Vector::vector_pointer_type

Definition at line 47 of file gsl_vector.hh.

typedef gsl_vector gsl::Vector::vector_type

Definition at line 46 of file gsl_vector.hh.

Constructor & Destructor Documentation

gsl::Vector::Vector ( )

Construct an empty vector without allocating the GSL data structures

gsl::Vector::Vector ( size_type  size,
bool  clear 
)

Construct a vector of given size

Parameters
size
clearif set to true set all values to zero at allocation
gsl::Vector::Vector ( size_type  size,
const double *  init 
)

Construct a vector of given size and initialize it with the given data

Parameters
size
initdouble array that must be at least of size size
gsl::Vector::Vector ( gsl_vector *  holder)

Wrap a pre-constructed GSL vector. The passed GSL-vector will not be destroyed when the destructor is called. The values of the GSL vector can be changed

Parameters
holderthe already allocated GSL vector
gsl::Vector::Vector ( const gsl_vector *  holder)

Wrap a pre-constructed GSL vector. The passed GSL-vector will not be destroyed when the destructor is called. The values of the GSL vector can not be changed

Parameters
holderthe already allocated GSL vector
gsl::Vector::Vector ( const Vector other)

Copy constructor, does a deep copy of the internal data structures.

gsl::Vector::~Vector ( )

Destructor.

Member Function Documentation

iterator gsl::Vector::begin ( )
Returns
an STL compatible read-write iterator to the vector data pointing to the beginning
const_iterator gsl::Vector::begin ( ) const
Returns
an STL compatible read-only iterator to the vector data pointing to the beginning
iterator gsl::Vector::end ( )
Returns
an STL compatible read-write iterator to the vector data pointing to the past end
const_iterator gsl::Vector::end ( ) const
Returns
an STL compatible read-only iterator to the vector data pointing to the past end
gsl::Vector::operator Vector::vector_const_pointer_type ( ) const

vector const pointer type operator to enable transparent calls to the GSL APL

gsl::Vector::operator Vector::vector_pointer_type ( )

vector pointer type operator to enable transparent calls to the GSL APL

const gsl_vector* gsl::Vector::operator-> ( ) const
Returns
transparent read-only access to underlying gsl_vector structure
gsl_vector* gsl::Vector::operator-> ( )
Returns
transparent read-write access to underlying gsl_vector structure
Vector& gsl::Vector::operator= ( const Vector other)

Copy operator, does a deep copy of the internal data structures.

value_type gsl::Vector::operator[] ( size_t  i) const
inline

Element read only access operator

Parameters
i
Returns
value

Definition at line 129 of file gsl_vector.hh.

reference gsl::Vector::operator[] ( size_t  i)
inline

Element read only access operator

Parameters
i
Returns
reference to value

Definition at line 139 of file gsl_vector.hh.

void gsl::Vector::print ( std::ostream &  os) const

Write the vector to a stream

Parameters
osthe output stream

Referenced by gsl::operator<<().

void gsl::Vector::reset_holder ( gsl_vector *  holder)
inlineprotected

Definition at line 164 of file gsl_vector.hh.

void gsl::Vector::reset_holder ( const gsl_vector *  holder)
inlineprotected

Definition at line 169 of file gsl_vector.hh.

size_type gsl::Vector::size ( ) const
Returns
number of elements in the vector

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