ReFRACtor
FullPhysics::GslVector Class Reference

This provides thin wrapper around the GNU Scientific Library gsl_vector. More...

#include <fp_gsl_matrix.h>

+ Inheritance diagram for FullPhysics::GslVector:
+ Collaboration diagram for FullPhysics::GslVector:

Public Member Functions

 GslVector ()
 Default constructor. More...
 
 GslVector (gsl_vector *M, bool Owned=true)
 Use data owned by gsl_vector. More...
 
 GslVector (blitz::Array< double, 1 > &M)
 Use data owned by blitz::Array. More...
 
 ~GslVector ()
 Destructor. More...
 
const blitz::Array< double, 1 > & blitz_array () const
 Return blitz::Array look at data. More...
 
blitz::Array< double, 1 > & blitz_array ()
 Return blitz::Array look at data. More...
 
const gsl_vector * gsl () const
 Return gsl_vector look at data. More...
 
gsl_vector * gsl ()
 Return gsl_vector look at data. More...
 
void reset (gsl_vector *M, bool Owned=true)
 Reset class to point to new vector. More...
 
void reset (blitz::Array< double, 1 > &M)
 Reset to use data owned by blitz::Array. More...
 

Public Attributes

blitz::Array< double, 1 > blitz_array_
 
bool block_owned_
 
gsl_vector * gsl_vector_
 
bool owned_
 

Detailed Description

This provides thin wrapper around the GNU Scientific Library gsl_vector.

The GSL is a pretty complete scientific library. However, is C based and out of the box doesn't place nicely with other C++ classes (such as blitz::Array). We provide some thin wrapper code around the GSL code to interface these two classes. This provides both a blitz::Array and a gsl_vector view of the same underlying data.

Definition at line 96 of file fp_gsl_matrix.h.

Constructor & Destructor Documentation

◆ GslVector() [1/3]

FullPhysics::GslVector::GslVector ( )
inline

Default constructor.

Definition at line 102 of file fp_gsl_matrix.h.

◆ GslVector() [2/3]

FullPhysics::GslVector::GslVector ( gsl_vector *  M,
bool  Owned = true 
)
inline

Use data owned by gsl_vector.

This data can either have ownership passed to this class (in which case we delete it when done with it), or just a reference (in which case the lifetime is handled outside of this class).

Definition at line 111 of file fp_gsl_matrix.h.

◆ GslVector() [3/3]

FullPhysics::GslVector::GslVector ( blitz::Array< double, 1 > &  M)
inline

Use data owned by blitz::Array.

Note that if this data isStorageContiguous(), and in C order then we use the data in place. If it isn't be make a contiguous copy of it. This means that in one case the original vector will be modified if the gsl_vector view of the data is modified, and the second case it won't. If you don't want this behaviour, you can form a copy before you pass it to this constructor.

Definition at line 125 of file fp_gsl_matrix.h.

◆ ~GslVector()

GslVector::~GslVector ( )

Destructor.

Definition at line 125 of file fp_gsl_matrix.cc.

Member Function Documentation

◆ blitz_array() [1/2]

const blitz::Array<double, 1>& FullPhysics::GslVector::blitz_array ( ) const
inline

Return blitz::Array look at data.

Definition at line 147 of file fp_gsl_matrix.h.

◆ blitz_array() [2/2]

blitz::Array<double, 1>& FullPhysics::GslVector::blitz_array ( )
inline

Return blitz::Array look at data.

Definition at line 153 of file fp_gsl_matrix.h.

◆ gsl() [1/2]

const gsl_vector* FullPhysics::GslVector::gsl ( ) const
inline

Return gsl_vector look at data.

Definition at line 135 of file fp_gsl_matrix.h.

◆ gsl() [2/2]

gsl_vector* FullPhysics::GslVector::gsl ( )
inline

Return gsl_vector look at data.

Definition at line 141 of file fp_gsl_matrix.h.

◆ reset() [1/2]

void GslVector::reset ( gsl_vector *  M,
bool  Owned = true 
)

Reset class to point to new vector.

This data can either have ownership passed to this class (in which case we delete it when done with it), or just a reference (in which case the lifetime is handled outside of this class).

Definition at line 78 of file fp_gsl_matrix.cc.

◆ reset() [2/2]

void GslVector::reset ( blitz::Array< double, 1 > &  M)

Reset to use data owned by blitz::Array.

Note that if this data isStorageContiguous(), then we use the data in place. If it isn't be make a contiguous copy of it. This means that in one case the original vector will be modified if the gsl_vector view of the data is modified, and the second case it won't. If you don't want this behaviour, you can form a copy before you pass it to this constructor.

Definition at line 102 of file fp_gsl_matrix.cc.

Member Data Documentation

◆ blitz_array_

blitz::Array<double, 1> FullPhysics::GslVector::blitz_array_

Definition at line 155 of file fp_gsl_matrix.h.

◆ block_owned_

bool FullPhysics::GslVector::block_owned_

Definition at line 159 of file fp_gsl_matrix.h.

◆ gsl_vector_

gsl_vector* FullPhysics::GslVector::gsl_vector_

Definition at line 156 of file fp_gsl_matrix.h.

◆ owned_

bool FullPhysics::GslVector::owned_

Definition at line 157 of file fp_gsl_matrix.h.


The documentation for this class was generated from the following files:

Copyright © 2017, California Institute of Technology.
ALL RIGHTS RESERVED.
U.S. Government Sponsorship acknowledged.
Generated Fri Aug 24 2018 15:44:12