FMT 0.9.8
Forest management tools for forest planning
Loading...
Searching...
No Matches
FMTmatrixbuild.hpp
Go to the documentation of this file.
1/*
2Copyright (c) 2019 Gouvernement du Québec
3
4SPDX-License-Identifier: LiLiQ-R-1.1
5License-Filename: LICENSES/EN/LiLiQ-R11unicode.txt
6*/
7
8#ifdef FMTWITHOSI
9
10#ifndef FMTmatrixbuild_H_INCLUDED
11#define FMTmatrixbuild_H_INCLUDED
12
13
14#include <vector>
15#include <string>
16#include <memory>
17#include "FMTutility.hpp"
18#include "FMTobject.hpp"
19class OsiSolverInterface;
20class CoinBuild;
21
22
23namespace Models
24
25{
26 // DocString: FMTmatrixbuild
34 {
35 // DocString: FMTmatrixbuild::lastcol
37 int colscount;
38 // DocString: FMTmatrixbuild::lastrow
40 int rowscount;
41 // DocString: FMTmatrixbuild::colsbuild
43 std::unique_ptr<CoinBuild>colsbuild;
44 // DocString: FMTmatrixbuild::rowsbuild
46 std::unique_ptr<CoinBuild>rowsbuild;
47 // DocString: FMTmatrixbuild::deletedconstraints
49 std::vector<int>deletedconstraints;
50 // DocString: FMTmatrixbuild::deletedvariables
52 std::vector<int>deletedvariables;
53 // DocString: FMTmatrixbuild::columnnames
55 std::vector<std::string>columnnames;
56 // DocString: FMTmatrixbuild::rownames
58 std::vector<std::string>rownames;
59 // DocString: FMTmatrixbuild::sortelementsandclean
63 void sortelementsandclean(std::vector<int>& elements) const;
64 // DocString: FMTmatrixbuild::formatformatrixname
68 std::string formatformatrixname(std::string name, bool shortformat) const;
69 public:
70 // DocString: FMTmatrixbuild::swap
74 void swap(FMTmatrixbuild& rhs);
75 // DocString: FMTmatrixbuild::getcolumnnames
79 inline std::vector<std::string>& getcolumnnames()
80 {
81 return columnnames;
82 }
83 // DocString: FMTmatrixbuild::getrownames
87 inline std::vector<std::string>& getrownames()
88 {
89 return rownames;
90 }
91 // DocString: FMTmatrixbuild::formatallnames
95 void formatallnames(bool shortformat);
96 // DocString: FMTmatrixbuild::setcolname
100 void setcolname(const std::string& name,const int& columnid);
101 // DocString: FMTmatrixbuild::setrowname
105 void setrowname(const std::string& name, const int& rowid);
106 // DocString: FMTmatrixbuild::synchronize
111 void synchronize(std::shared_ptr<OsiSolverInterface> solver);
112 // DocString: FMTmatrixbuild()
117 // DocString: FMTmatrixbuild(const FMTmatrixbuild)
122 // DocString: FMTmatrixbuild::operator=
126 FMTmatrixbuild& operator = (const FMTmatrixbuild& rhs);
127 // DocString: ~FMTmatrixbuild()
132 // DocString: FMTmatrixbuild::addCol
136 void addCol(int numberInColumn, const int * rows, const double * elements, double columnLower = 0.0,
137 double columnUpper = std::numeric_limits<double>::max(), double objectiveValue = 0.0);
138 // DocString: FMTmatrixbuild::addRow
142 void addRow(int numberInRow, const int * columns, const double * elements,
143 double rowLower = -std::numeric_limits<double>::max(), double rowUpper = std::numeric_limits<double>::max());
144 // DocString: FMTmatrixbuild::deleteRow
148 void deleteRow(const int& rowindex);
149 // DocString: FMTmatrixbuild::deleteCol
153 void deleteCol(const int& colindex);
154 // DocString: FMTmatrixbuild::numbernewRows
158 inline int numbernewRows() const
159 {
160 return rowscount;
161 }
162 // DocString: FMTmatrixbuild::numbernewCols
166 inline int numbernewCols() const
167 {
168 return colscount;
169 }
170 // DocString: FMTmatrixbuild::numberofdeletedRows
174 inline int numberofdeletedRows() const
175 {
176 return static_cast<int>(deletedconstraints.size());
177 }
178 // DocString: FMTmatrixbuild::numberofdeletedCols
182 inline int numberofdeletedCols() const
183 {
184 return static_cast<int>(deletedvariables.size());
185 }
186 // DocString: FMTmatrixbuild::getdeletedconstraints
190 inline const std::vector<int>& getdeletedconstraints() const
191 {
192 return deletedconstraints;
193 }
194 // DocString: FMTmatrixbuild::getdeletedvariables
198 inline const std::vector<int>& getdeletedvariables() const
199 {
200 return deletedvariables;
201 }
202 // DocString: FMTmatrixbuild::sortandcleandeleted
207 // DocString: FMTmatrixbuild::getrowstosynchronize
211 std::string getrowstosynchronize() const;
212 // DocString: FMTmatrixbuild::getrowstosynchronize
216 std::string getcolstosynchronize() const;
217 // DocString: FMTmatrixbuild::getrow
222 int getrow(int whichRow, double &rowLower, double &rowUpper,
223 std::vector<int>& indices, std::vector<double>&elements) const;
224 // DocString: FMTmatrixbuild::getcol
229 int getcol(int whichCol, double &colLower, double &colUpper, double &objectiveValue,
230 std::vector<int>& indices, std::vector<double>&elements) const;
231
232
233 };
234}
235
236#endif
237#endif
#define FMTEXPORT
Definition: FMTutility.hpp:92
Definition: FMTmatrixbuild.hpp:34
const std::vector< int > & getdeletedconstraints() const
Definition: FMTmatrixbuild.hpp:190
void deleteRow(const int &rowindex)
int getrow(int whichRow, double &rowLower, double &rowUpper, std::vector< int > &indices, std::vector< double > &elements) const
std::string getcolstosynchronize() const
void synchronize(std::shared_ptr< OsiSolverInterface > solver)
void formatallnames(bool shortformat)
void setcolname(const std::string &name, const int &columnid)
void swap(FMTmatrixbuild &rhs)
const std::vector< int > & getdeletedvariables() const
Definition: FMTmatrixbuild.hpp:198
std::vector< std::string > & getrownames()
Definition: FMTmatrixbuild.hpp:87
int numberofdeletedCols() const
Definition: FMTmatrixbuild.hpp:182
std::vector< std::string > & getcolumnnames()
Definition: FMTmatrixbuild.hpp:79
int numbernewRows() const
Definition: FMTmatrixbuild.hpp:158
void addRow(int numberInRow, const int *columns, const double *elements, double rowLower=-std::numeric_limits< double >::max(), double rowUpper=std::numeric_limits< double >::max())
int numberofdeletedRows() const
Definition: FMTmatrixbuild.hpp:174
std::string getrowstosynchronize() const
void addCol(int numberInColumn, const int *rows, const double *elements, double columnLower=0.0, double columnUpper=std::numeric_limits< double >::max(), double objectiveValue=0.0)
int numbernewCols() const
Definition: FMTmatrixbuild.hpp:166
int getcol(int whichCol, double &colLower, double &colUpper, double &objectiveValue, std::vector< int > &indices, std::vector< double > &elements) const
FMTmatrixbuild(const FMTmatrixbuild &rhs)
void setrowname(const std::string &name, const int &rowid)
void deleteCol(const int &colindex)
Namespace containing all enumerator and classes used to construct or manipulate the different type of...
Definition: FMTareaparser.hpp:50