00001 #ifndef _BETA_DIAGSOFTABSMETRIC_ 00002 00003 #include <Eigen/Dense> 00004 00005 #include "dynamMetric.h" 00006 00012 00013 class diagSoftAbsMetric: public dynamMetric 00014 { 00015 00016 public: 00017 00018 explicit diagSoftAbsMetric(int dim); 00019 virtual ~diagSoftAbsMetric() {}; 00020 00022 // Accessors // 00024 00025 double T(); 00026 double tau(); 00027 00028 void bounceP(const VectorXd& normal); 00029 00031 // Mutators // 00033 00034 void sampleP(Random& random); 00035 00037 void setSoftAbsAlpha(double a) { mSoftAbsAlpha = a; } 00038 00040 // Auxiliary Functions // 00042 00043 void checkEvolution(const double epsilon = 1e-6); 00044 00045 void displayState(); 00046 00047 protected: 00048 00049 double mSoftAbsAlpha; 00050 00051 VectorXd mDiagH; 00052 MatrixXd mGradDiagH; 00053 00054 VectorXd mLambda; 00055 VectorXd mGradHelper; 00056 00058 virtual void fComputeDiagH() = 0; 00059 00061 virtual void fComputeGradDiagH() = 0; 00062 00063 void fComputeMetric(); 00064 void fPrepareSpatialGradients() { fComputeGradDiagH(); gradV(); } 00065 00066 VectorXd& dTaudp(); 00067 VectorXd& dTaudq(); 00068 VectorXd& dPhidq(); 00069 00070 }; 00071 00072 #define _BETA_DIAGSOFTABSMETRIC_ 00073 #endif