forked from maik-nack/OptimizationSolver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
IProblem.h
50 lines (38 loc) · 1.44 KB
/
IProblem.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef IPROBLEM_H
#define IPROBLEM_H
#include "IVector.h"
#include "SHARED_EXPORT.h"
class SHARED_EXPORT IProblem
{
public:
enum InterfaceTypes
{
INTERFACE_0,
DIMENSION_INTERFACE_IMPL
};
enum DerivedType
{
BY_ARGS,
BY_PARAMS,
DIMENSION_DERIVED
};
virtual int getId() const = 0;
virtual int goalFunction(IVector const* args, IVector const* params, double& res) const = 0;
virtual int goalFunctionByArgs(IVector const* args, double& res) const = 0;
virtual int goalFunctionByParams(IVector const* params, double& res) const = 0;
virtual int getArgsDim(size_t& dim) const = 0;
virtual int getParamsDim(size_t& dim) const = 0;
virtual int setParams(IVector const* params) = 0;
virtual int setArgs(IVector const* args) = 0;
virtual int derivativeGoalFunction(size_t order, size_t idx, DerivedType dr, double& value, IVector const* args, IVector const* params) const = 0;
virtual int derivativeGoalFunctionByArgs(size_t order, size_t idx, DerivedType dr, double& value, IVector const* args) const = 0;
virtual int derivativeGoalFunctionByParams(size_t order, size_t idx, DerivedType dr, double& value, IVector const* params) const = 0;
protected:
virtual ~IProblem(){}
IProblem() = default;
private:
/*non default copyable*/
IProblem(const IProblem& other) = delete;
void operator=(const IProblem& other) = delete;
};
#endif // IPROBLEM_H