00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include "ObjFcn.hh"
00027
00028 static const char* myNameIs = "objective base function";
00029
00030 const char* ObjectiveFunction::className() const
00031 {
00032 return (myNameIs);
00033 }
00034
00035 ObjectiveFunction::ObjectiveFunction(int n)
00036 {
00037 nparam = n;
00038 gradient = new Vector<double>(n);
00039 niteration = 0;
00040 }
00041
00042 Vector<double>* ObjectiveFunction::getGradient(const Model<double>& )
00043 {
00044 delete gradient;
00045 gradient = NULL;
00046 return gradient;
00047 }
00048
00049 Vector<double>* ObjectiveFunction::getGradient(const Model<long>&)
00050 {
00051 delete gradient;
00052 gradient = NULL;
00053 return gradient;
00054 }
00055
00056 Vector<double>* ObjectiveFunction::getGradient(const Model<float>&)
00057 {
00058 delete gradient;
00059 gradient = NULL;
00060 return gradient;
00061 }
00062
00063 double ObjectiveFunction::performance(const Model<double>& p)
00064 {
00065 niteration++;
00066 return realPerformance(p);
00067 }
00068
00069 double ObjectiveFunction::performance(const Model<long>& p)
00070 {
00071 niteration++;
00072 return realPerformance(p);
00073 }
00074 double ObjectiveFunction::performance(const Model<float>& p)
00075 {
00076 niteration++;
00077 return realPerformance(p);
00078 }