Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

ObjFcn.cpp

Go to the documentation of this file.
00001 //============================================================
00002 // COOOL           version 1.1           ---     Nov,  1995
00003 //   Center for Wave Phenomena, Colorado School of Mines
00004 //============================================================
00005 //
00006 //   This code is part of a preliminary release of COOOL (CWP
00007 // Object-Oriented Optimization Library) and associated class 
00008 // libraries. 
00009 //
00010 // The COOOL library is a free software. You can do anything you want
00011 // with it including make a fortune.  However, neither the authors,
00012 // the Center for Wave Phenomena, nor anyone else you can think of
00013 // makes any guarantees about anything in this package or any aspect
00014 // of its functionality.
00015 //
00016 // Since you've got the source code you can also modify the
00017 // library to suit your own purposes. We would appreciate it 
00018 // if the headers that identify the authors are kept in the 
00019 // source code.
00020 //
00021 //=============================================================
00022 // Author: H. Lydia Deng
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 }

Generated on Wed Dec 15 21:20:29 2004 for vuVolume by  doxygen 1.3.9.1