#include <vector_int.h>
Inheritance diagram for gsl::vector_int::
Public Methods | |
vector_int () | |
vector_int (const vector_int &other) | |
template<class oclass> | vector_int (const oclass &other) |
~vector_int () | |
vector_int (const size_t &n, bool clear=true) | |
vector_int (const int &n, bool clear=true) | |
void | resize (size_t n) |
template<class oclass> void | copy (const oclass &other) |
void | copy (const vector_int &other) |
size_t | size () const |
gsl_vector_int* | gslobj () |
const gsl_vector_int* | gslobj () const |
int | get (size_t i) const |
void | set (size_t i, int x) |
int& | operator[] (size_t i) |
const int& | operator[] (size_t i) const |
int& | operator() (size_t i) |
const int& | operator() (size_t i) const |
void | set_all (int 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_int_view | subvector (size_t offset, size_t n) |
const vector_int_view | subvector (size_t offset, size_t n) const |
vector_int& | operator= (const vector_int &other) |
int | swap_elements (size_t i, size_t j) |
int | reverse () |
int | operator+= (const vector_int &other) |
int | operator-= (const vector_int &other) |
int | operator *= (const vector_int &other) |
int | operator/= (const vector_int &other) |
int | operator *= (int x) |
int | operator+= (int x) |
int | operator/= (int x) |
bool | operator== (const vector_int &other) const |
bool | operator!= (const vector_int &other) const |
int | sum () const |
double | norm2 () const |
Static Public Methods | |
vector_int_view | create_vector_view (const gsl_vector_int_view &other) |
Protected Methods | |
void | free () |
void | alloc (size_t n) |
void | calloc (size_t n) |
Protected Attributes | |
gsl_vector_int* | gsldata |
|
Definition at line 40 of file vector_int.h. 00040 : gsldata(NULL) {;} |
|
Definition at line 41 of file vector_int.h. |
|
Definition at line 43 of file vector_int.h. |
|
Definition at line 44 of file vector_int.h. 00044 {free();} |
|
Definition at line 45 of file vector_int.h. |
|
Definition at line 50 of file vector_int.h. |
|
Definition at line 37 of file vector_int.h. Referenced by resize(), and vector_int().
00037 {gsldata=gsl_vector_int_alloc(n);} |
|
Definition at line 38 of file vector_int.h. Referenced by vector_int().
00038 {gsldata=gsl_vector_int_calloc(n);} |
|
Definition at line 58 of file vector_int.cc. 00059 { 00060 resize(other.size()); 00061 gsl_vector_int_memcpy (gsldata,other.gsldata); 00062 } |
|
Definition at line 59 of file vector_int.h. Referenced by operator=(), and vector_int().
|
|
Definition at line 30 of file vector_int.cc. 00031 { 00032 vector_int view; 00033 view.gsldata = (gsl_vector_int*)malloc(sizeof(gsl_vector_int)); 00034 *(view.gslobj()) = other.vector; 00035 view.gslobj()->owner = 0; 00036 return view; 00037 } |
|
Definition at line 122 of file vector_int.h. 00122 {return gsl_vector_int_fprintf (stream, gsldata,format) ;} |
|
Definition at line 119 of file vector_int.h. 00119 {return gsl_vector_int_fread (stream, gsldata);} |
|
Definition at line 36 of file vector_int.h. Referenced by gsl::vector_int_view::init(), resize(), and ~vector_int().
00036 {if(gsldata) gsl_vector_int_free(gsldata);gsldata=NULL;} |
|
Definition at line 125 of file vector_int.h. 00125 {return gsl_vector_int_fscanf (stream, gsldata); } |
|
Definition at line 116 of file vector_int.h. 00116 {return gsl_vector_int_fwrite (stream, gsldata);} |
|
Definition at line 86 of file vector_int.h. 00086 {return gsl_vector_int_get(gsldata,i);} |
|
Definition at line 74 of file vector_int.h. 00074 {if (!gsldata){cout << "vector_int::gslobj ERROR, data not initialized!! " << endl; exit(-1);}return gsldata;} |
|
for interfacing with gsl c Definition at line 73 of file vector_int.h. 00073 {if (!gsldata){cout << "vector_int::gslobj ERROR, data not initialized!! " << endl; exit(-1);}return gsldata;} |
|
Definition at line 107 of file vector_int.cc. 00108 { 00109 vector t=*this; 00110 return gsl_blas_dnrm2(t.gslobj()); 00111 } |
|
Definition at line 281 of file vector_int.h. 00281 {return gsl_vector_int_scale (gsldata, x);} |
|
Definition at line 275 of file vector_int.h. 00275 {return gsl_vector_int_mul (gsldata, other.gsldata);} |
|
Definition at line 292 of file vector_int.h. 00292 { return (!((*this)==other));} |
|
Definition at line 96 of file vector_int.h. 00096 { return *gsl_vector_int_ptr(gsldata,i);} |
|
Definition at line 95 of file vector_int.h. 00095 { return *gsl_vector_int_ptr(gsldata,i);} |
|
Definition at line 285 of file vector_int.h. 00285 {return gsl_vector_int_add_constant (gsldata,x);} |
|
Definition at line 268 of file vector_int.h. 00268 {return gsl_vector_int_add (gsldata, other.gsldata);} |
|
Definition at line 271 of file vector_int.h. 00271 {return gsl_vector_int_sub (gsldata, other.gsldata);} |
|
Definition at line 288 of file vector_int.h. 00288 {return gsl_vector_int_scale (gsldata, 1/x);} |
|
Definition at line 278 of file vector_int.h. 00278 {return gsl_vector_int_div (gsldata, other.gsldata);} |
|
Definition at line 246 of file vector_int.h. 00246 {copy(other);return (*this);} |
|
Definition at line 65 of file vector_int.cc. 00066 { 00067 if (size() != other.size()) 00068 return false; 00069 for (int i=0;i<size(); i++) 00070 { 00071 if (this->operator[](i) != other[i]) 00072 return false; 00073 } 00074 return true; 00075 } |
|
Definition at line 93 of file vector_int.h. 00093 { return *gsl_vector_int_ptr(gsldata,i);} |
|
Definition at line 92 of file vector_int.h. Referenced by operator==().
00092 { return *gsl_vector_int_ptr(gsldata,i);} |
|
Definition at line 40 of file vector_int.cc. Referenced by copy().
00041 { 00042 if (gsldata) 00043 { 00044 if (n==size()) 00045 return; 00046 if (!gsldata->owner) 00047 { 00048 cout << "vector_int::resize ERROR can't resize a vector view" << endl; 00049 exit(-1); 00050 // GSL_ERROR("You can't resize a vector view", GSL_EINVAL); 00051 } 00052 free(); 00053 } 00054 alloc(n); 00055 } |
|
Definition at line 261 of file vector_int.h. 00261 {return gsl_vector_int_reverse (gsldata) ;} |
|
Definition at line 89 of file vector_int.h. 00089 {gsl_vector_int_set(gsldata,i,x);} |
|
Definition at line 103 of file vector_int.h. 00103 {gsl_vector_int_set_all (gsldata,x);} |
|
Definition at line 108 of file vector_int.h. 00108 {return gsl_vector_int_set_basis (gsldata,i);} |
|
Definition at line 105 of file vector_int.h. 00105 {gsl_vector_int_set_zero (gsldata);} |
|
Definition at line 70 of file vector_int.h. Referenced by copy(), operator==(), resize(), and sum().
00070 {if (!gsldata) {cout << "vector_int::size vector not initialized" << endl; exit(-1);}return gsldata->size;} |
|
Definition at line 86 of file vector_int.cc. 00087 { 00088 gsl_vector_int_view view = gsl_vector_int_subvector (gsldata, offset, n); 00089 return vector_int_view::create_vector_view(view); 00090 } |
|
Definition at line 78 of file vector_int.cc. 00079 { 00080 gsl_vector_int_view view = gsl_vector_int_subvector (gsldata, offset, n); 00081 return vector_int_view::create_vector_view(view); 00082 } |
|
returns sum of all the vector elements. Definition at line 93 of file vector_int.cc. 00094 { 00095 int i; 00096 int sum = 0; 00097 00098 for ( i = 0; i < size(); i++ ) 00099 { 00100 sum += gsl_vector_int_get(gsldata, i); 00101 } 00102 00103 return( sum ); 00104 } |
|
Definition at line 257 of file vector_int.h. 00257 {return gsl_vector_int_swap_elements (gsldata, i,j);} |
|
Definition at line 35 of file vector_int.h. |