GradFunc.h
Go to the documentation of this file.00001 #ifndef GRADFUNC_H_
00002 #define GRADFUNC_H_
00003
00004 #include "VecMat.h"
00005 #include "GeneralObjective.h"
00006
00007 namespace ublas = boost::numeric::ublas;
00008
00009
00010 gplib::rvec CalcGradient(GeneralObjective &Objective, const gplib::rvec &Model);
00011
00012 gplib::rmat CalcPartialDerivs(GeneralObjective &Objective,
00013 const gplib::rvec &Model, const gplib::rvec varfactor);
00014
00015
00016
00017
00018
00019
00020 class ModelAnalysis
00021 {
00022 private:
00023 bool haveModel;
00024 bool haveSVD;
00025 bool changedThreshold;
00026 double SVDThreshold;
00027 GeneralObjective &Objective;
00028 gplib::rvec Model;
00029 gplib::rmat OldSensitivityMatrix;
00030 gplib::rmat SensitivityMatrix;
00031 gplib::rmat SensitivityInv;
00032 gplib::rvec s;
00033 gplib::rmat u, vt;
00034 gplib::rmat vnull, unull;
00035 gplib::rmat sinv;
00036 gplib::rvec varfactor;
00037 void CalcSensitivityMatrix();
00038 void CalcSVD();
00039 void ApplyThreshold();
00040 public:
00041 void SetVariationFactor(const gplib::rvec varfac)
00042 {
00043 varfactor = varfac;
00044 }
00045 void SetModel(const gplib::rvec &TheModel);
00046 void SetRelativeSVDThreshold(const double t)
00047 {
00048 changedThreshold = true;
00049 SVDThreshold = t;
00050 }
00051 const gplib::rmat &GetSensitivityMatrix()
00052 {
00053 CalcSensitivityMatrix();
00054 return SensitivityMatrix;
00055 }
00056 const gplib::rmat &GetSensitivityInverse() const
00057 {
00058 return SensitivityInv;
00059 }
00060 gplib::rmat GetModelCorrelation(const gplib::rmat &DataCovar);
00061 gplib::rmat GetModelResolution();
00062 gplib::rmat GetDataResolution();
00063 gplib::rmat GetModelCovariance(const gplib::rmat &DataCovar);
00064 gplib::rmat GetModelNullspace();
00065 gplib::rvec GetSingularValues();
00066 ModelAnalysis(GeneralObjective &TheObjective) :
00067 haveModel(false), haveSVD(false), changedThreshold(true), Objective(
00068 TheObjective), SVDThreshold(0.0)
00069 {
00070 }
00071 ;
00072 ~ModelAnalysis()
00073 {
00074 }
00075 ;
00076 };
00077 #endif