18#include <tnt/tnt_array1d.h> 
   19#include <tnt/tnt_array1d_utils.h> 
   20#include <tnt/tnt_array2d.h> 
   21#include <tnt/tnt_array2d_utils.h> 
   23#include <gsl/gsl_vector.h> 
   24#include <gsl/gsl_matrix.h> 
   29#define GSL_RANGE_CHECK_OFF 1 
   33#include "IException.h" 
   71        typedef TNT::Array1D<double> GSLVector;
 
   72        typedef TNT::Array2D<double> GSLMatrix;
 
   78          return (
status == GSL_SUCCESS);
 
 
   87        inline QString 
status(
int gsl_errno)
 const {
 
 
   91        void check(
int gsl_status, 
const char *src = __FILE__, 
int line = __LINE__)
 
   95        size_t Rows(
const gsl_matrix *m) 
const;
 
   96        size_t Columns(
const gsl_matrix *m) 
const;
 
   98        size_t Rows(
const GSLMatrix &m) 
const;
 
   99        size_t Columns(
const GSLMatrix &m) 
const;
 
  101        size_t size(
const gsl_vector *v) 
const;
 
  102        size_t size(
const gsl_matrix *m) 
const;
 
  104        gsl_vector *
vector(
size_t n, 
bool zero = 
false) 
const;
 
  105        gsl_matrix *
matrix(
size_t n1, 
size_t n2, 
bool zero = 
false) 
const;
 
  106        gsl_matrix *
identity(
size_t n1, 
size_t n2) 
const;
 
  109        void free(gsl_vector *v) 
const;
 
  110        void free(gsl_matrix *m) 
const;
 
  112        GSLVector 
gslToGSL(
const gsl_vector *v) 
const;
 
  113        GSLMatrix 
gslToGSL(
const gsl_matrix *m) 
const;
 
  114        gsl_vector *
GSLTogsl(
const GSLVector &v, gsl_vector *gv = 0) 
const;
 
  115        gsl_matrix *
GSLTogsl(
const GSLMatrix &m, gsl_matrix *gm = 0) 
const;
 
  125        static void handler(
const char *reason, 
const char *file, 
int line,
 
 
GSLUtility Provides top level interface to the GNU GSL.
size_t Rows(const gsl_matrix *m) const
Returns number of rows in a GSL matrix.
void free(gsl_vector *v) const
Frees a GSL vector.
size_t size(const gsl_vector *v) const
Returns the size of a GSL vector.
GSLVector gslToGSL(const gsl_vector *v) const
Converts a GSL vector to a TNT-based vector.
void setIdentity(gsl_matrix *m) const
Initializes an existing GSL matrix to the identity matrix.
gsl_vector * GSLTogsl(const GSLVector &v, gsl_vector *gv=0) const
Converts TNT-based vector to GSL vector.
static GSLUtility * _instance
Singleton self-reference pointer.
static void handler(const char *reason, const char *file, int line, int gsl_errno)
Special GSL errror handler.
bool success(int status) const
Tests if status is success.
GSLUtility()
Contructs a GSLUtility object with an error handler.
void check(int gsl_status, const char *src=__FILE__, int line=__LINE__) const
Performs a check on GSL library function return status.
gsl_matrix * matrix(size_t n1, size_t n2, bool zero=false) const
Creates a GSL matrix.
static GSLUtility * getInstance()
Return a reference to the GSL (singleton) object.
QString status(int gsl_errno) const
Returns GSL specific error text.
size_t Columns(const gsl_matrix *m) const
Returns the number of coulumns in a GSL matrix.
gsl_vector * vector(size_t n, bool zero=false) const
Creates a GSL vector.
gsl_matrix * identity(size_t n1, size_t n2) const
Returns a GSL identity matrix of the specified size.
This is free and unencumbered software released into the public domain.