00001 #ifndef Impala_Core_Array_InvCompDer_h
00002 #define Impala_Core_Array_InvCompDer_h
00003
00004 #include <vector>
00005
00006 #include "Core/Array/ProjectRange.h"
00007 #include "Core/Array/GaussDerivative.h"
00008 #include "Core/Array/RecGauss.h"
00009
00010 namespace Impala
00011 {
00012 namespace Core
00013 {
00014 namespace Array
00015 {
00016
00017
00020 inline std::vector<Array2dScalarReal64*>
00021 InvCompDer(Array2dScalarReal64* src, double sigma, double precision,
00022 bool useRecGauss = false)
00023 {
00024 std::vector<Array2dScalarReal64*> resList;
00025 Array2dScalarReal64* p = 0;
00026 if (useRecGauss)
00027 {
00028 RecGauss(p, src, sigma, sigma, 0, 0, precision);
00029 resList.push_back(p);
00030 p = 0;
00031 RecGauss(p, src, sigma, sigma, 1, 0, precision);
00032 resList.push_back(p);
00033 p = 0;
00034 RecGauss(p, src, sigma, sigma, 0, 1, precision);
00035 resList.push_back(p);
00036 p = 0;
00037 RecGauss(p, src, sigma, sigma, 2, 0, precision);
00038 resList.push_back(p);
00039 p = 0;
00040 RecGauss(p, src, sigma, sigma, 1, 1, precision);
00041 resList.push_back(p);
00042 p = 0;
00043 RecGauss(p, src, sigma, sigma, 0, 2, precision);
00044 resList.push_back(p);
00045 }
00046 else
00047 {
00048 GaussDerivative(p, src, sigma, 0, 0, precision);
00049 resList.push_back(p);
00050 p = 0;
00051 GaussDerivative(p, src, sigma, 1, 0, precision);
00052 resList.push_back(p);
00053 p = 0;
00054 GaussDerivative(p, src, sigma, 0, 1, precision);
00055 resList.push_back(p);
00056 p = 0;
00057 GaussDerivative(p, src, sigma, 2, 0, precision);
00058 resList.push_back(p);
00059 p = 0;
00060 GaussDerivative(p, src, sigma, 1, 1, precision);
00061 resList.push_back(p);
00062 p = 0;
00063 GaussDerivative(p, src, sigma, 0, 2, precision);
00064 resList.push_back(p);
00065 }
00066 return resList;
00067 }
00068
00069
00074 inline std::vector<Array2dScalarReal64*>
00075 InvCompDer(Array2dVec3Real64* src, double sigma, double precision,
00076 bool useRecGauss = false)
00077 {
00078 std::vector<Array2dScalarReal64*> resList;
00079 for (int d=1 ; d<=3 ; d++)
00080 {
00081 Array2dScalarReal64* comp = 0;
00082 ProjectRange(comp, src, d);
00083 Array2dScalarReal64* p = 0;
00084 if (useRecGauss)
00085 {
00086 RecGauss(p, comp, sigma, sigma, 0, 0, precision);
00087 resList.push_back(p);
00088 p = 0;
00089 RecGauss(p, comp, sigma, sigma, 1, 0, precision);
00090 resList.push_back(p);
00091 p = 0;
00092 RecGauss(p, comp, sigma, sigma, 0, 1, precision);
00093 resList.push_back(p);
00094 }
00095 else
00096 {
00097 GaussDerivative(p, comp, sigma, 0, 0, precision);
00098 resList.push_back(p);
00099 p = 0;
00100 GaussDerivative(p, comp, sigma, 1, 0, precision);
00101 resList.push_back(p);
00102 p = 0;
00103 GaussDerivative(p, comp, sigma, 0, 1, precision);
00104 resList.push_back(p);
00105 }
00106 delete comp;
00107 }
00108 return resList;
00109 }
00110
00111 }
00112 }
00113 }
00114
00115 #endif