Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

gsl::typeext Class Reference

#include <matrix_source.h>

List of all members.

Public Methods

matrix matrix void copy (const matrix#typeext#&other)
template<class oclass> void copy (const oclass &other)
template<class oclass> matrix matrix ~matrix size_t get_rows () const
size_t get_cols () const
size_t size1 () const
size_t size2 () const
void dimensions (size_t *num_rows, size_t *num_cols) const
const void set_element (size_t row, size_t col, const#type#&v)
void set_elements (const#type#&new_value)
void set_all (const#type#&new_value)
void set_zero ()
void set_dimensions (size_t new_rows, size_t new_cols)
void load (const char *filename)
void save (const char *filename) const
int fwrite (FILE *stream) const
int fread (FILE *stream)
void load_binary (const char *filename)
void save_binary (const char *filename) const
bool operator== (const matrix#typeext#&other) const
bool operator!= (const matrix#typeext#&other) const
double LU_lndet () const
vector const vector vector
const vector matrix matrix
matrix matrix double 
trace () const
int cholesky_decomp (matrix#typeext#&a) const
matrix bool is_square () const
void set_diagonal (#type#f)
void identity (size_t k)
double norm (double n) const
template<class oclass> void copy (const oclass &other)
void copy (const vector#typeext#&other)
size_t size () const
const const void set_all (#type#x)
void set_zero ()
int set_basis (size_t i)
int fwrite (FILE *stream) const
int fread (FILE *stream)
int fprintf (FILE *stream, const char *format) const
int fscanf (FILE *stream)
vector const vector vector int swap_elements (size_t i, size_t j)
int reverse ()
int operator+= (const vector#typeext#&other)
int operator-= (const vector#typeext#&other)
int operator *= (const vector#typeext#&other)
int operator/= (const vector#typeext#&other)
int operator *= (#type#x)
int operator+= (#type#x)
int operator/= (#type#x)
bool operator== (const vector#typeext#&other) const
bool operator!= (const vector#typeext#&other) const
double norm2 () const

Static Public Methods

gsl_vector const gsl_vector
vector void 
set (size_t i,#type#x)

Protected Methods

gsl_vector void free ()
void alloc (size_t n)
void calloc (size_t n)

Friends

class  matrix_float
class  matrix_int
ostream& operator<< (ostream &os, const matrix#typeext#&m)


Member Function Documentation

double gsl::typeext::LU_lndet ( ) const
 

returns logarithm of the determinant of the matrix.

void gsl::typeext::alloc ( size_t n ) [inline, protected]
 

Definition at line 37 of file vector_source.h.

00037 {gsldata=gsl_vector#typeext#_alloc(n);}

void gsl::typeext::calloc ( size_t n ) [inline, protected]
 

Definition at line 38 of file vector_source.h.

00038 {gsldata=gsl_vector#typeext#_calloc(n);}

int gsl::typeext::cholesky_decomp ( matrix#typeext#& a ) const
 

calculates cholesky decomposition of the matrix, returning success if matrix is positive definite.

void gsl::typeext::copy ( const vector#typeext#& other )
 

template<class oclass>
void gsl::typeext::copy ( const oclass & other ) [inline]
 

Definition at line 59 of file vector_source.h.

00060                 {
00061                         resize(other.size());
00062                         for (size_t i=0;i<size();i++)
00063                         {
00064                                 gsl_vector#typeext#_set(gsldata, i, (#type#)other[i]);
00065                         }
00066                 }

template<class oclass>
void gsl::typeext::copy ( const oclass & other ) [inline]
 

Definition at line 63 of file matrix_source.h.

00064         {
00065                 set_dimensions( other.get_rows(), other.get_cols() );
00066                 for ( size_t i = 0; i < get_rows(); i++ ) 
00067                 {
00068                         for ( size_t j = 0; j < get_cols(); j++ ) 
00069                         {
00070                                 gsl_matrix#typeext#_set( m, i, j, (#type#)other(i,j));
00071                         }
00072                 }
00073         }

matrix matrix void gsl::typeext::copy ( const matrix#typeext#& other ) [inline]
 

Definition at line 57 of file matrix_source.h.

00058         {
00059                 set_dimensions(other.size1(),other.size2());
00060                 gsl_matrix#typeext#_memcpy( m, other.m );
00061         }

void gsl::typeext::dimensions ( size_t * num_rows,
size_t * num_cols ) const
 

int gsl::typeext::fprintf ( FILE * stream,
const char * format ) const [inline]
 

Definition at line 122 of file vector_source.h.

00122 {return gsl_vector#typeext#_fprintf (stream, gsldata,format) ;}

int gsl::typeext::fread ( FILE * stream ) [inline]
 

Definition at line 119 of file vector_source.h.

00119 {return gsl_vector#typeext#_fread (stream, gsldata);}

int gsl::typeext::fread ( FILE * stream ) [inline]
 

Definition at line 117 of file matrix_source.h.

00117 {return gsl_matrix#typeext#_fread (stream, m);}

gsl_vector void gsl::typeext::free ( ) [inline, protected]
 

Definition at line 36 of file vector_source.h.

00036 {if(gsldata) gsl_vector#typeext#_free(gsldata);gsldata=NULL;}

int gsl::typeext::fscanf ( FILE * stream ) [inline]
 

Definition at line 125 of file vector_source.h.

00125 {return gsl_vector#typeext#_fscanf (stream, gsldata); }

int gsl::typeext::fwrite ( FILE * stream ) const [inline]
 

Definition at line 116 of file vector_source.h.

00116 {return gsl_vector#typeext#_fwrite (stream, gsldata);}

int gsl::typeext::fwrite ( FILE * stream ) const [inline]
 

Definition at line 114 of file matrix_source.h.

00114 {return gsl_matrix#typeext#_fwrite (stream, m);}

size_t gsl::typeext::get_cols ( ) const [inline]
 

Definition at line 86 of file matrix_source.h.

Referenced by copy().

00086 {return m->size2;}

template<class oclass>
matrix matrix~matrix size_t gsl::typeext::get_rows ( ) const [inline]
 

Definition at line 84 of file matrix_source.h.

Referenced by copy().

00084 {return m->size1;}

void gsl::typeext::identity ( size_t k )
 

sets matrix to a k dimensional unit matrix.

matrix bool gsl::typeext::is_square ( ) const
 

returns 1 if matrix is square, 0 otherwise.

void gsl::typeext::load ( const char * filename )
 

void gsl::typeext::load_binary ( const char * filename )
 

double gsl::typeext::norm ( double n ) const
 

returns sum of nth power of all elements.

double gsl::typeext::norm2 ( ) const
 

returns sum of all the vector elements.

int gsl::typeext::operator *= ( #type# x ) [inline]
 

Definition at line 281 of file vector_source.h.

00281 {return gsl_vector#typeext#_scale (gsldata, x);}

int gsl::typeext::operator *= ( const vector#typeext#& other ) [inline]
 

Definition at line 275 of file vector_source.h.

00275 {return gsl_vector#typeext#_mul (gsldata, other.gsldata);}

bool gsl::typeext::operator!= ( const vector#typeext#& other ) const [inline]
 

Definition at line 292 of file vector_source.h.

00292 { return (!((*this)==other));}

bool gsl::typeext::operator!= ( const matrix#typeext#& other ) const [inline]
 

Definition at line 125 of file matrix_source.h.

00125 {return !((*this)==other);}

int gsl::typeext::operator+= ( #type# x ) [inline]
 

Definition at line 285 of file vector_source.h.

00285 {return gsl_vector#typeext#_add_constant (gsldata,x);}

int gsl::typeext::operator+= ( const vector#typeext#& other ) [inline]
 

Definition at line 268 of file vector_source.h.

00268 {return gsl_vector#typeext#_add (gsldata, other.gsldata);}

int gsl::typeext::operator-= ( const vector#typeext#& other ) [inline]
 

Definition at line 271 of file vector_source.h.

00271 {return gsl_vector#typeext#_sub (gsldata, other.gsldata);}

int gsl::typeext::operator/= ( #type# x ) [inline]
 

Definition at line 288 of file vector_source.h.

00288 {return gsl_vector#typeext#_scale (gsldata, 1/x);}

int gsl::typeext::operator/= ( const vector#typeext#& other ) [inline]
 

Definition at line 278 of file vector_source.h.

00278 {return gsl_vector#typeext#_div (gsldata, other.gsldata);}

bool gsl::typeext::operator== ( const vector#typeext#& other ) const
 

bool gsl::typeext::operator== ( const matrix#typeext#& other ) const
 

int gsl::typeext::reverse ( ) [inline]
 

Definition at line 261 of file vector_source.h.

00261 {return  gsl_vector#typeext#_reverse (gsldata) ;}

void gsl::typeext::save ( const char * filename ) const
 

void gsl::typeext::save_binary ( const char * filename ) const
 

gsl_vector const gsl_vector vector void gsl::typeext::set ( size_t i,
#type# x ) [inline, static]
 

for interfacing with gsl c

Definition at line 89 of file vector_source.h.

00089 {gsl_vector#typeext#_set(gsldata,i,x);}

const const void gsl::typeext::set_all ( #type# x ) [inline]
 

Definition at line 103 of file vector_source.h.

00103 {gsl_vector#typeext#_set_all (gsldata,x);}

void gsl::typeext::set_all ( const#type#& new_value ) [inline]
 

Definition at line 103 of file matrix_source.h.

00103 {gsl_matrix#typeext#_set_all ( m, new_value );}

int gsl::typeext::set_basis ( size_t i ) [inline]
 

Definition at line 108 of file vector_source.h.

00108 {return gsl_vector#typeext#_set_basis (gsldata,i);}

void gsl::typeext::set_diagonal ( #type# f )
 

set diagonal elements of a square matrix to f.

void gsl::typeext::set_dimensions ( size_t new_rows,
size_t new_cols )
 

Referenced by copy().

const void gsl::typeext::set_element ( size_t row,
size_t col,
const#type#& v ) [inline]
 

Definition at line 100 of file matrix_source.h.

00100 { gsl_matrix#typeext#_set( m, row, col, v );}

void gsl::typeext::set_elements ( const#type#& new_value )
 

void gsl::typeext::set_zero ( ) [inline]
 

Definition at line 105 of file vector_source.h.

00105 {gsl_vector#typeext#_set_zero (gsldata);}

void gsl::typeext::set_zero ( ) [inline]
 

Definition at line 104 of file matrix_source.h.

00104 {gsl_matrix#typeext#_set_zero( m );}

size_t gsl::typeext::size ( ) const [inline]
 

Definition at line 70 of file vector_source.h.

Referenced by copy().

00070 {if (!gsldata) {cout << "vector#typeext#::size vector not initialized" << endl; exit(-1);}return gsldata->size;}

size_t gsl::typeext::size1 ( ) const [inline]
 

Definition at line 88 of file matrix_source.h.

00088 {return m->size1;}

size_t gsl::typeext::size2 ( ) const [inline]
 

Definition at line 90 of file matrix_source.h.

00090 {return m->size2;}

vector const vector vector int gsl::typeext::swap_elements ( size_t i,
size_t j ) [inline]
 

Definition at line 257 of file vector_source.h.

00257 {return gsl_vector#typeext#_swap_elements (gsldata, i,j);}

vector const vector vector const vector matrix matrix matrix matrix double gsl::typeext::trace ( ) const
 

returns trace (diagonal sum) of a square matrix.


Friends And Related Function Documentation

class matrix_float [friend]
 

Definition at line 48 of file matrix_source.h.

class matrix_int [friend]
 

Definition at line 49 of file matrix_source.h.

ostream & operator<< ( ostream & os,
const matrix#typeext#& m ) [friend]
 


The documentation for this class was generated from the following files:
Generated at Sun Dec 16 23:44:46 2001 for gslwrap by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001