00001 // -*- C++ -*- 00002 00008 #if !defined(__geom_SimplexCondNum_h__) 00009 #define __geom_SimplexCondNum_h__ 00010 00011 #if defined(DEBUG_geom) && !defined(DEBUG_SimplexCondNum) 00012 #define DEBUG_SimplexCondNum 00013 #endif 00014 00015 #include "SimplexAdjJacQF.h" 00016 00017 #include <limits> 00018 00019 BEGIN_NAMESPACE_GEOM 00020 00022 00045 template<int N, typename T = double> 00046 class SimplexCondNum : 00047 public SimplexAdjJacQF<N,T> { 00048 private: 00049 00050 typedef SimplexAdjJacQF<N,T> Base; 00051 00052 public: 00053 00054 // 00055 // Public types. 00056 // 00057 00059 typedef T Number; 00060 00062 typedef typename Base::Vertex Vertex; 00063 00065 typedef typename Base::Simplex Simplex; 00066 00068 typedef typename Base::Matrix Matrix; 00069 00070 public: 00071 00072 //-------------------------------------------------------------------------- 00075 00077 SimplexCondNum() : 00078 Base() 00079 {} 00080 00082 SimplexCondNum(const SimplexCondNum& other) : 00083 Base(other) 00084 {} 00085 00087 SimplexCondNum(const Simplex& s) : 00088 Base(s) 00089 {} 00090 00092 SimplexCondNum& 00093 operator=(const SimplexCondNum& other) { 00094 if (&other != this) { 00095 Base::operator=(other); 00096 } 00097 return *this; 00098 } 00099 00101 ~SimplexCondNum() 00102 {} 00103 00105 //-------------------------------------------------------------------------- 00109 00110 00112 using Base::getMatrix; 00113 00115 using Base::getGradientMatrix; 00116 00118 using Base::getDeterminant; 00119 00121 using Base::getGradientDeterminant; 00122 00124 using Base::computeContent; 00125 00127 using Base::computeGradientContent; 00128 00130 using Base::getDimension; 00131 00133 using Base::getAdjointMatrix; 00134 00136 using Base::getAdjointGradientMatrix; 00137 00139 //-------------------------------------------------------------------------- 00142 00144 using Base::setFunction; 00145 00147 using Base::set; 00148 00150 //-------------------------------------------------------------------------- 00153 00155 00164 Number 00165 operator()() const; 00166 00168 00177 Number 00178 operator()(const Simplex& simplex) const { 00179 setFunction(simplex); 00180 return operator()(); 00181 } 00182 00184 00193 void 00194 computeGradient(Vertex* gradient) const; 00195 00197 00198 protected: 00199 00201 Number 00202 computeFunction(Number snj, Number sna) const; 00203 00204 }; 00205 00206 END_NAMESPACE_GEOM 00207 00208 #define __geom_SimplexCondNum_ipp__ 00209 #include "SimplexCondNum.ipp" 00210 #undef __geom_SimplexCondNum_ipp__ 00211 00212 #endif