iRoCS Toolbox  1.1.0
lNumerical.hh
Go to the documentation of this file.
1 /**************************************************************************
2  *
3  * Copyright (C) 2015 Kun Liu, 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 /*
24  * lNumerical.hh
25  *
26  * Created on: Nov 19, 2010
27  * Author: liu
28  */
29 
30 #ifndef LNUMERICAL_HH_
31 #define LNUMERICAL_HH_
32 
33 #ifdef HAVE_CONFIG_H
34 #include <config.hh>
35 #endif
36 
37 #include "helper.hh"
38 
39 /*
40  * Central First Derivative
41  * Parameter: flag - 0 - first order approximation
42  *
43  * on boundary, derivative is set to left or right derivative
44  */
45 template<typename Type, typename dType, int Dim>
46 void nCentralFirst(
47  blitz::Array<Type,Dim> const &data,
48  blitz::Array<dType,Dim> &derivative, int dim, int flag = 0);
49 
50 /*
51  * Central First Derivative for all dimensions
52  * Parameter: flag - 0 - first order approximation
53  *
54  * on boundary, derivative is set to left or right derivative
55  */
56 template<typename Type, typename dType, int Dim>
57 void nCentralFirst(
58  blitz::Array<Type,Dim> const &data,
59  blitz::Array<blitz::TinyVector<dType,Dim>,Dim> &derivative, int flag = 0);
60 
61 /*
62  * Central Second Derivative
63  * but with small change to Dxy(), referenced to Prof. Brox PhD thesis
64  * pg109 (5.21)
65  *
66  * Parameter: flag - 0 - first order approximation
67  *
68  * on boundary, derivative is set to be continuous
69  */
70 template<typename Type, typename dType, int Dim>
71 void nCentralSecond(
72  blitz::Array<Type,Dim> const &data,
73  blitz::Array<dType,Dim> &dd, int dim, int flag = 0);
74 
75 /*
76  * Central Second Derivative for all dimensions
77  * but with small change to Dxy(), referenced to Prof. Brox PhD thesis
78  * pg109 (5.21)
79  *
80  * Parameter: flag - 0 - first order approximation
81  *
82  * on boundary, derivative is set to be continuous
83  */
84 template<typename Type, typename dType, int Dim>
85 void nCentralSecond(
86  blitz::Array<Type,Dim> const &data,
87  blitz::Array<blitz::TinyVector<dType,Dim>,Dim> const &derivative,
88  blitz::Array<blitz::TinyVector<dType,(Dim+1)*Dim/2>,Dim>& dd,
89  int flag = 0);
90 
91 #include "lNumerical.icc"
92 
93 #endif /* LNUMERICAL_HH_ */
void nCentralSecond(blitz::Array< Type, Dim > const &data, blitz::Array< dType, Dim > &dd, int dim, int flag=0)
void nCentralFirst(blitz::Array< Type, Dim > const &data, blitz::Array< dType, Dim > &derivative, int dim, int flag=0)