Public Member Functions | Static Public Member Functions | Protected Attributes

vector Class Reference

Wrapper class for GSL double precision vector routines. More...

#include <src/gsl_wrappers/gsl_vector_double.h>

Inheritance diagram for vector:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 vector ()
 Class constructor without specified vector dimensions.
 vector (size_t n, bool clear=true)
 Class constructor with specified vector size.
 ~vector ()
 Class destructor.
int fprintf (FILE *stream, const char *format) const
 Function that prints the contents of the vector.
int fscanf (FILE *stream)
 Function that reads contents and assigns then to a vector.
void resize (size_t n)
 Function that resizes a vector.
void copy (const vector &other)
 Function copies the contents of a vector to another vector.
size_t size () const
 Function that returns the size (dimension) of the vector.
void set (size_t i, double x)
 Function that assigns a real number to a vector entry.
double get (size_t i) const
 Function that returns a real number stored in a vector entry.
void set_all (double x)
 Function that sets all vector entries to a given number.
void set_zero ()
 Function that sets all vector entries to zero.
double max () const
 Function that returns the maximum value stored in the vector.
double min () const
 Function that returns the minimum value stored in the vector.
size_t max_index ()
 Function that returns the index where the maximum value is stored.
size_t min_index ()
 Function that returns the index where the minimum value is stored.
double & operator[] (size_t i)
 Function returning pointer to ith element of a vector.
const double & operator[] (size_t i) const
 Amother function returning pointer to ith element of a vector.
bool operator== (const vector &other) const
 Function that checks if two vectors are equivalent.
bool operator!= (const vector &other) const
 Function that checks if two mvectors are not equivalent.
vectoroperator= (const vector &other)
 Function that assigns one vector as another.
vector operator+ (const vector &other) const
 Function to add to a vector another vector.
vector operator- (const vector &other) const
 Function to subtract a vector from another vector.
int operator+= (const vector &other)
 Function to add to a vector another vector.
int operator-= (const vector &other)
 Function to subtract a vector from another vector.
int operator*= (const vector &other)
 Function to multiply two vectors.
int operator/= (const vector &other)
 Function to divide vectors.
int operator*= (double x)
 Function to scale a vector by a constant factor.
int operator+= (double x)
 Function to add to a vector a constant factor.
int operator/= (double x)
 Function to divide by a vector by a scalar.
void alloc (size_t n)
 Function to intitialize a vector by allocating memory.
void calloc (size_t n)
 Function that does the same as alloc with calloc.
void free ()
bool is_set () const
 Function that checks if the vector is set.
double sum () const
 Function that computes the sum of all entries of a vector.
double norm2 () const
 Function that computes the l2 norm of a vector.
gsl_vector * gslobj ()
 Vector object for interfacing with BLAS and/or GSL C libraies.
const gsl_vector * gslobj () const
 Const vector object for interfacing with BLAS and/or GSL C libraies.
vector_view subvector (size_t offset, size_t n)
 Functions return a vector view of a subvector of another vector v.
const vector_view subvector (size_t offset, size_t n) const
 Functions return a vector view of a subvector of another vector v declared as const.

Static Public Member Functions

static vector_view create_vector_view (const gsl_vector_view &other)
 Function to create a vector view.

Protected Attributes

gsl_vector * v
 GSL vector of double precision object.

Detailed Description

Wrapper class for GSL double precision vector routines.


The documentation for this class was generated from the following files:
All Classes Files Functions Variables Typedefs Friends Defines