-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFunction.h
More file actions
23 lines (18 loc) · 898 Bytes
/
Function.h
File metadata and controls
23 lines (18 loc) · 898 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef UNTITLED2_FUNCTION_H
#define UNTITLED2_FUNCTION_H
#include <list>
#include <string>
#include <map>
#include "SharedPtr.h"
class Function{
protected:
std::list<std::string> variables;//list of the variables in the function
void MargeVatiable(std::list<std::string> listR, std::list<std::string> listL);//marge lists with out duplicate
public:
virtual ~Function(){};
virtual double Evaluate(const std::map<std::string,double> &variables)const = 0;//return the value
std::list<std::string> Variables() const{return this->variables;};//return the list of the variables
virtual SharedPtr<Function> DeriveBy(const std::string& variable)const = 0;//return pointer to the derive function
std::map<std::string, std::map<std::string, SharedPtr<Function> > > Hessian() const;//return the Hessian of the function
};
#endif //UNTITLED2_FUNCTION_H