iRoCS Toolbox  1.1.0
ATBGSLWrapper.hh
Go to the documentation of this file.
1 /**************************************************************************
2  *
3  * Copyright (C) 2015 Thorsten Falk
4  *
5  * Image Analysis Lab, University of Freiburg, Germany
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software Foundation,
19  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  *
21  **************************************************************************/
22 
23 /*======================================================================*/
29 /*======================================================================*/
30 
31 #ifndef ATBGSLWRAPPER_HH
32 #define ATBGSLWRAPPER_HH
33 
34 #ifdef HAVE_CONFIG_H
35 #include <config.hh>
36 #endif
37 
38 #include <gsl/gsl_linalg.h>
39 
40 #include <blitz/array.h>
41 
42 #include "RuntimeError.hh"
43 
44 namespace atb
45 {
46 
47 /*======================================================================*/
63 /*======================================================================*/
64  extern void atb_gsl_error_handler(char const *reason, char const *file,
65  int line, int gsl_errno);
66 
67 /*======================================================================*/
76 /*======================================================================*/
77  class GSLWrapper
78  {
79 
80  public:
81 
82 /*======================================================================*/
97 /*======================================================================*/
98  static gsl_matrix *getGSLView(blitz::Array<double,2> &data);
99 
100 /*======================================================================*/
115 /*======================================================================*/
116  template<int Dim1, int Dim2>
117  static gsl_matrix *getGSLView(blitz::TinyMatrix<double,Dim1,Dim2> &data);
118 
119 /*======================================================================*/
134 /*======================================================================*/
135  static gsl_vector *getGSLView(blitz::Array<double,1> &data);
136 
137 /*======================================================================*/
152 /*======================================================================*/
153  template<int Dim>
154  static gsl_vector *getGSLView(blitz::TinyVector<double,Dim> &data);
155 
156  };
157 
158 }
159 
160 #include "ATBGSLWrapper.icc"
161 
162 #endif
The GSLWrapper class provides static wrapper functions to obtain GSL views onto Array data structures...
Exception specialization for error handling within libArrayToolbox.
static gsl_matrix * getGSLView(blitz::Array< double, 2 > &data)
Create a gsl_matrix view to the given blitz++ Array.
void atb_gsl_error_handler(char const *reason, char const *file, int line, int gsl_errno)
Default Arraytoolbox_Qt4 GSL error handler.