FunctionTable.h

Go to the documentation of this file.
00001 /*
00002  * Expression Template Matrix Library
00003  *
00004  * Copyright (C) 2004 - 2006 Ricky Lung <mtlung@users.sourceforge.net>
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  *
00020  */
00021 
00022 
00030 #ifndef EXMAT_MATH_FUNCTIONTABLE_H
00031 #define EXMAT_MATH_FUNCTIONTABLE_H
00032 
00033 #ifdef _MSC_VER
00034 #   pragma warning( push )
00035 #   pragma warning( disable : 4786 )
00036 #endif  // _MSC_VER
00037 
00038 #include "../Mat.h"
00039 #include <cmath>
00040 
00041 #if (EXMAT_VC6 && EXMAT_VC6_DEFAULT_STL || EXMAT_ICL)
00042 #   define VC6_STD_MATH_WKAR
00043 #else
00044 #   define VC6_STD_MATH_WKAR std
00045 #endif
00046 
00047 namespace exmat {
00048 
00049 namespace Math {
00050 
00051 
00053 
00056 namespace ConsistencyLevel {
00057     enum {
00059         Improved = 0,
00061         Default,
00063         Performance
00064     };
00065 };
00066 
00068 
00071 extern void setConsistency(int cl = ConsistencyLevel::Default);
00072 
00073 namespace PNS {
00074     // IDs for functions (float (float* in, size_t N))
00075     namespace FUNffpi_ID {
00076         enum {
00077             min = 0,
00078             max,
00079             sum,
00080             FUNffpi_ID_END
00081         };
00082     }
00083     // IDs for functions (float (float))
00084     namespace FUNff_ID {
00085         enum {
00086             rcp = 0,
00087             sqrt, rsqrt,
00088             exp,
00089             log,
00090             sin, cos, tan,
00091             asin, acos, atan,
00092             FUNff_ID_END
00093         };
00094     };
00095     // IDs for functions (float (float, float))
00096     namespace FUNfff_ID {
00097         enum {
00098             pow = 0,
00099             FUNfff_ID_END
00100         };
00101     };
00102     // IDs for functions (void (float, float&, float&))
00103     namespace FUNvffafa_ID {
00104         enum {
00105             sincos = 0,
00106             FUNvffafa_ID_END
00107         };
00108     };
00109 
00110     // Typedef for the function
00111     typedef float (*FUNffpi)(const float* in, size_t N);
00112     typedef float (*FUNff)(float x);
00113     typedef void (*FUNvfpfpi)(const float* in, float* out, size_t N);
00114     typedef float (*FUNfff)(float x, float y);
00115     typedef void (*FUNvffafa)(float x, float& s, float& c);
00116     // The function tables
00117     extern FUNffpi FUNffpiTable[FUNffpi_ID::FUNffpi_ID_END];
00118     extern FUNff FUNffTable[FUNff_ID::FUNff_ID_END];
00119     extern FUNvfpfpi FUNvfpfpiTable[FUNff_ID::FUNff_ID_END];
00120     extern FUNfff FUNfffTable[FUNfff_ID::FUNfff_ID_END];
00121     extern FUNvffafa FUNvffafaTable[FUNvffafa_ID::FUNvffafa_ID_END];
00122 
00123 }   // namespace exmat
00124 
00125 };  // namespace Math
00126 
00127 }   // namespace exmat
00128 
00129 #ifdef _MSC_VER
00130 #   pragma warning( pop )
00131 #endif  // _MSC_VER
00132 
00133 #ifdef VC6_STD_MATH_WKAR
00134 #   undef VC6_STD_MATH_WKAR
00135 #endif
00136 
00137 #endif  // EXMAT_MATH_FUNCTIONTABLE_H

Generated on Sat May 6 23:11:57 2006 for Exmat by  doxygen 1.4.6-NO