Minotaur 0.4.1
Docs for developers
Solver.h
Go to the documentation of this file.
1//
2// Minotaur -- It's only half bull!
3//
4// (C)opyright 2009 - 2025 The Minotaur Team.
5//
6
13#ifndef Solver_H
14#define Solver_H
15
16#include "Types.h"
17#include "AMPLInterface.h"
18#include "Environment.h"
19#include "LPEngine.h"
20#include "Presolver.h"
21
22namespace Minotaur {
28 class Solver {
29 public:
31 Solver();
32
34 virtual ~Solver();
35
37 virtual FileType getFileType(std::string fname);
38
39 virtual ProblemPtr readProblem(std::string fname, std::string dname,
40 std::string sname, int &err);
41
42 virtual bool timeCheck();
43
45 virtual int solve(ProblemPtr p) = 0;
46
48 virtual SolveStatus getStatus() = 0;
49
51 virtual SolutionPtr getSol() = 0;
52
53 void setIface(MINOTAUR_AMPL::AMPLInterface* iface);
54
55
56 protected:
59
62
66
67 virtual int writeSol_(EnvPtr env, VarVector *orig_v,
68 SolutionPtr sol, SolveStatus status,
70
71 private:
72 const static std::string me_;
73
74 };
75}
76#endif
77
Declare the AMPLInterface class fo reading problems from AMPL.
Define the Environment class.
Declare the class LPEngine for solving LPs and getting solution.
Declare Presolver class for presolving.
Declare important 'types' used in Minotaur.
Interface to read ampl models using AMPL Solver Library. AMPLInterface class provides methods to read...
Definition: AMPLInterface.h:74
Definition: Environment.h:28
Definition: Problem.h:74
Definition: Solution.h:30
Definition: Solver.h:28
MINOTAUR_AMPL::AMPLInterface * iface_
AMPL Interface.
Definition: Solver.h:61
EnvPtr env_
Minotaur Environment.
Definition: Solver.h:58
bool ownIface_
Definition: Solver.h:65
virtual SolveStatus getStatus()=0
get status of the last solve
Solver()
Default constructor.
Definition: Solver.cpp:27
virtual int solve(ProblemPtr p)=0
Solve the problem.
virtual ~Solver()
Destroy.
Definition: Solver.cpp:35
virtual SolutionPtr getSol()=0
get solution of the last solve
virtual FileType getFileType(std::string fname)
Helper function to determin file type (mps, nl etc)
Definition: Solver.cpp:43
Definition: ActiveNodeStore.h:20
FileType
Different types of files for reading/writing.
Definition: Types.h:41
SolveStatus
Different states an algorithm like branch-and-bound can be in.
Definition: Types.h:158

Minotaur source code documented by Doxygen 1.9.4 on Mon Aug 4 2025