1 |
#ifndef ASCXX_SOLVER_H |
2 |
#define ASCXX_SOLVER_H |
3 |
|
4 |
#include <string> |
5 |
#include <vector> |
6 |
|
7 |
#include "config.h" |
8 |
extern "C"{ |
9 |
#include <utilities/ascConfig.h> |
10 |
#include <compiler/instance_enum.h> |
11 |
#include <solver/slv_types.h> |
12 |
#include <solver/mtx.h> |
13 |
#include <solver/var.h> |
14 |
#include <solver/rel.h> |
15 |
#include <solver/discrete.h> |
16 |
#include <solver/conditional.h> |
17 |
#include <solver/logrel.h> |
18 |
#include <solver/bnd.h> |
19 |
#include <solver/linsol.h> |
20 |
#include <solver/linsolqr.h> |
21 |
#include <solver/slv_common.h> |
22 |
#include <solver/slv_client.h> |
23 |
} |
24 |
|
25 |
/** |
26 |
This is a rather problematic wrapper for slv_client.h. It's hard because registerd solvers |
27 |
are referenced primarily by index, not by pointer etc, so given the index, we always have |
28 |
to look up the solver in some way or other. |
29 |
|
30 |
Because the index is changeable from session to session, depending on the order of |
31 |
registration, we'll use the *name* as the primary key and look up the index as needed. |
32 |
*/ |
33 |
class Solver{ |
34 |
private: |
35 |
std::string name; |
36 |
public: |
37 |
Solver(); |
38 |
Solver(const Solver &); |
39 |
Solver(const std::string &name); |
40 |
|
41 |
const int getIndex() const; |
42 |
const std::string& getName() const; |
43 |
}; |
44 |
|
45 |
/** |
46 |
Some global functions |
47 |
*/ |
48 |
void registerStandardSolvers(); |
49 |
void registerSolver(SlvRegistration regfuncptr); |
50 |
const std::vector<Solver> getSolvers(); |
51 |
|
52 |
#endif |