KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Namespaces | Macros | Functions
gsl_vector.h File Reference

C++ wrapper on GSL vector class to prevent resource leaks. More...

#include <l/l_sys_sys.h>
#include <m_cpp/m_cpp_incl.h>
#include "gsl_cpp/gsl_util.h"
#include <iterator>
#include <ostream>
#include <cmath>

Go to the source code of this file.

Classes

struct  gsl_vector
 
class  kjb::Gsl_Vector
 RAII wrapper for GSL vector objects. More...
 

Namespaces

 kjb
 Classes and functions for dealing with trajectory files.
 
 std
 

Macros

#define gsl_vector_alloc(x)   (new gsl_vector(x)) /* don't actually use this! */
 
#define gsl_vector_set(w, i, x)   ((w)->at(i)=(x))
 
#define gsl_vector_get(w, i)   ((w)->at(i))
 

Functions

Gsl_Vector kjb::operator* (double scalar, const Gsl_Vector &vector)
 multiply scalar and vector, scalar written on the left side More...
 
std::ostream & operator<< (std::ostream &os, const kjb::Gsl_Vector &v)
 Print out a vector as a column of ASCII-rendered values + newlines. More...
 
std::istream & operator>> (std::istream &is, kjb::Gsl_Vector &v)
 Read in ASCII-rendered, WS-delimited contents to a presized vector. More...
 
template<>
void std::swap (kjb::Gsl_Vector &v1, kjb::Gsl_Vector &v2)
 Swap two vectors. More...
 

Detailed Description

C++ wrapper on GSL vector class to prevent resource leaks.

Author
Andrew Predoehl

Macro Definition Documentation

#define gsl_vector_alloc (   x)    (new gsl_vector(x)) /* don't actually use this! */
#define gsl_vector_get (   w,
  i 
)    ((w)->at(i))
#define gsl_vector_set (   w,
  i,
  x 
)    ((w)->at(i)=(x))

Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const kjb::Gsl_Vector v 
)
inline

Print out a vector as a column of ASCII-rendered values + newlines.

std::istream& operator>> ( std::istream &  is,
kjb::Gsl_Vector v 
)
inline

Read in ASCII-rendered, WS-delimited contents to a presized vector.

This is not super-robust: prior to using this routine, vector v must already be set to the size of the number of values that you want to read in.

Input values are ASCII-rendered decimal real values, delimited by white space.