H2Lib  3.0
Data Structures | Typedefs | Functions
realavector.h File Reference
#include <assert.h>
#include <math.h>
#include <stdlib.h>
#include "settings.h"
#include "basic.h"
#include "blas.h"

Go to the source code of this file.

Data Structures

struct  _realavector
 

Typedefs

typedef struct _realavector realavector
 
typedef realavectorprealavector
 
typedef const realavectorpcrealavector
 

Functions

prealavector init_realavector (prealavector v, uint dim)
 Initialize an realavector object. More...
 
prealavector init_sub_realavector (prealavector v, prealavector src, uint dim, uint off)
 Initialize an realavector object to represent a subvector. More...
 
prealavector init_pointer_realavector (prealavector v, preal src, uint dim)
 Initialize an realavector object using a given array for the coefficients. More...
 
void uninit_realavector (prealavector v)
 Uninitialize an realavector object. More...
 
prealavector new_realavector (uint dim)
 Create a new realavector object. More...
 
prealavector new_sub_realavector (prealavector src, uint dim, uint off)
 Create a new realavector object representing a subvector. More...
 
prealavector new_pointer_realavector (preal src, uint dim)
 Create a new realavector object using a given array for the coefficients. More...
 
void del_realavector (prealavector v)
 Delete an realavector object. More...
 
void resize_realavector (prealavector v, uint dim)
 Change the dimension of an realavector object without preserving its coefficients. More...
 
void shrink_realavector (prealavector v, uint dim)
 Reduce the dimension of an realavector object without reallocating storage, preserving its coefficients. More...
 
real getentry_realavector (pcrealavector v, uint i)
 Read a vector entry $v_i$. More...
 
void setentry_realavector (prealavector v, uint i, real x)
 Set a vector entry, $v_i \gets x$. More...
 
real addentry_realavector (prealavector v, uint i, real x)
 Add to a vector entry, $v_i \gets v_i + x$. More...
 
uint getactives_realavector ()
 Get number of currently initialized realavector objects. More...
 
size_t getsize_realavector (pcrealavector v)
 Get size of a given realavector object. More...
 
size_t getsize_heap_realavector (pcrealavector v)
 Get heap size of a given realavector object. More...
 
void clear_realavector (prealavector v)
 Set a vector to zero. More...
 
void fill_realavector (prealavector v, real x)
 Set all coefficients in a vector to the same value. More...
 
void random_realavector (prealavector v)
 Fill a vector with random values. More...
 
void copy_realavector (pcrealavector v, prealavector w)
 Copy a vector into another vector, $w \gets v$. More...
 
void copy_sub_realavector (pcrealavector v, prealavector w)
 Copy a vector into another vector, $w \gets v$. More...
 
void print_realavector (pcrealavector v)
 Print a vector. More...
 
void scale_realavector (real alpha, prealavector v)
 Scale a vector $v$ by a factor $\alpha$, $v \gets \alpha v$. More...
 
real norm2_realavector (pcrealavector v)
 Compute the Euclidean norm $\|v\|_2$ of a vector $v$. More...
 
real dotprod_realavector (pcrealavector x, pcrealavector y)
 Compute the Euclidean innner product $\langle x, y\rangle_2$ of two vectors $x$ and $y$. More...
 
void add_realavector (real alpha, pcrealavector x, prealavector y)
 Add two vectors, $y \gets y + \alpha x$. More...
 

Detailed Description

Author
Sven Christophersen