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
50 void setIface(MINOTAUR_AMPL::AMPLInterface* iface);
51
52
53 protected:
54 EnvPtr env_;
56
60
61 virtual int writeSol_(EnvPtr env, VarVector *orig_v, PresolverPtr pres,
62 SolutionPtr sol, SolveStatus status,
64
65 private:
66 const static std::string me_;
67
68 };
69}
70#endif
71
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: Presolver.h:39
Definition: Problem.h:74
Definition: Solution.h:30
Definition: Solver.h:28
bool ownIface_
Definition: Solver.h:59
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 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 Fri Apr 25 2025