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
 
bool is_valid () const
 
bool is_writable () 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)
 
Vectoroperator= (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 (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

◆ const_iterator

◆ const_reference

typedef const double& gsl::Vector::const_reference

Definition at line 45 of file gsl_vector.hh.

◆ iterator

Definition at line 40 of file gsl_vector.hh.

◆ reference

typedef double& gsl::Vector::reference

Definition at line 44 of file gsl_vector.hh.

◆ size_type

typedef size_t gsl::Vector::size_type

Definition at line 42 of file gsl_vector.hh.

◆ value_type

typedef double gsl::Vector::value_type

Definition at line 43 of file gsl_vector.hh.

◆ vector_const_pointer_type

typedef const gsl_vector* gsl::Vector::vector_const_pointer_type

Definition at line 48 of file gsl_vector.hh.

◆ vector_pointer_type

typedef gsl_vector* gsl::Vector::vector_pointer_type

Definition at line 47 of file gsl_vector.hh.

◆ vector_type

typedef gsl_vector gsl::Vector::vector_type

Definition at line 46 of file gsl_vector.hh.

Constructor & Destructor Documentation

◆ Vector() [1/7]

gsl::Vector::Vector ( )

Construct an empty vector without allocating the GSL data structures

◆ Vector() [2/7]

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

◆ Vector() [3/7]

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

◆ Vector() [4/7]

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

◆ Vector() [5/7]

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

◆ Vector() [6/7]

gsl::Vector::Vector ( const Vector other)

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

◆ Vector() [7/7]

gsl::Vector::Vector ( Vector &&  other)

Move constructor, does move the internal data structure to the new object.

◆ ~Vector()

gsl::Vector::~Vector ( )

Destructor.

Member Function Documentation

◆ begin() [1/2]

iterator gsl::Vector::begin ( )
Returns
an STL compatible read-write iterator to the vector data pointing to the beginning

◆ begin() [2/2]

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

◆ end() [1/2]

iterator gsl::Vector::end ( )
Returns
an STL compatible read-write iterator to the vector data pointing to the past end

◆ end() [2/2]

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

◆ is_valid()

bool gsl::Vector::is_valid ( ) const

◆ is_writable()

bool gsl::Vector::is_writable ( ) const

◆ operator Vector::vector_const_pointer_type()

gsl::Vector::operator Vector::vector_const_pointer_type ( ) const

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

◆ operator Vector::vector_pointer_type()

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

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

◆ operator->() [1/2]

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

◆ operator->() [2/2]

gsl_vector* gsl::Vector::operator-> ( )
Returns
transparent read-write access to underlying gsl_vector structure

◆ operator=() [1/2]

Vector& gsl::Vector::operator= ( const Vector other)

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

◆ operator=() [2/2]

Vector& gsl::Vector::operator= ( Vector &&  other)

Move operator, does move the internal data structure to the new object.

◆ operator[]() [1/2]

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

Element read only access operator

Parameters
i
Returns
value

Definition at line 141 of file gsl_vector.hh.

◆ operator[]() [2/2]

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

Element read only access operator

Parameters
i
Returns
reference to value

Definition at line 151 of file gsl_vector.hh.

◆ print()

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

Write the vector to a stream

Parameters
osthe output stream

Referenced by gsl::operator<<().

◆ reset_holder() [1/2]

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

Definition at line 179 of file gsl_vector.hh.

◆ reset_holder() [2/2]

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

Definition at line 184 of file gsl_vector.hh.

◆ size()

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

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