ReFRACtor
FullPhysics::GslMatrix Class Reference

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

#include <fp_gsl_matrix.h>

+ Inheritance diagram for FullPhysics::GslMatrix:
+ Collaboration diagram for FullPhysics::GslMatrix:

Public Member Functions

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

Public Attributes

blitz::Array< double, 2 > blitz_array_
 
bool block_owned_
 
gsl_matrix * gsl_matrix_
 
bool owned_
 

Detailed Description

This provides thin wrapper around the GNU Scientific Library gsl_matrix.

The GSL is a pretty complete scientific library. However, it 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_matrix view of the same underlying data.

Definition at line 20 of file fp_gsl_matrix.h.

Constructor & Destructor Documentation

◆ GslMatrix() [1/3]

FullPhysics::GslMatrix::GslMatrix ( )
inline

Default constructor.

Definition at line 26 of file fp_gsl_matrix.h.

◆ GslMatrix() [2/3]

FullPhysics::GslMatrix::GslMatrix ( gsl_matrix *  M,
bool  Owned = true 
)
inline

Use data owned by gsl_matrix.

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 35 of file fp_gsl_matrix.h.

◆ GslMatrix() [3/3]

FullPhysics::GslMatrix::GslMatrix ( blitz::Array< double, 2 > &  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 matrix will be modified if the gsl_matrix 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 49 of file fp_gsl_matrix.h.

◆ ~GslMatrix()

GslMatrix::~GslMatrix ( )

Destructor.

Definition at line 63 of file fp_gsl_matrix.cc.

Member Function Documentation

◆ blitz_array() [1/2]

const blitz::Array<double, 2>& FullPhysics::GslMatrix::blitz_array ( ) const
inline

Return blitz::Array look at data.

Definition at line 70 of file fp_gsl_matrix.h.

◆ blitz_array() [2/2]

blitz::Array<double, 2>& FullPhysics::GslMatrix::blitz_array ( )
inline

Return blitz::Array look at data.

Definition at line 76 of file fp_gsl_matrix.h.

◆ gsl() [1/2]

const gsl_matrix* FullPhysics::GslMatrix::gsl ( ) const
inline

Return gsl_matrix look at data.

Definition at line 58 of file fp_gsl_matrix.h.

◆ gsl() [2/2]

gsl_matrix* FullPhysics::GslMatrix::gsl ( )
inline

Return gsl_matrix look at data.

Definition at line 64 of file fp_gsl_matrix.h.

◆ reset() [1/2]

void GslMatrix::reset ( gsl_matrix *  M,
bool  Owned = true 
)

Reset class to point to new matrix.

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 14 of file fp_gsl_matrix.cc.

◆ reset() [2/2]

void GslMatrix::reset ( blitz::Array< double, 2 > &  M)

Reset to 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 matrix will be modified if the gsl_matrix 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 39 of file fp_gsl_matrix.cc.

Member Data Documentation

◆ blitz_array_

blitz::Array<double, 2> FullPhysics::GslMatrix::blitz_array_

Definition at line 78 of file fp_gsl_matrix.h.

◆ block_owned_

bool FullPhysics::GslMatrix::block_owned_

Definition at line 82 of file fp_gsl_matrix.h.

◆ gsl_matrix_

gsl_matrix* FullPhysics::GslMatrix::gsl_matrix_

Definition at line 79 of file fp_gsl_matrix.h.

◆ owned_

bool FullPhysics::GslMatrix::owned_

Definition at line 80 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