26 int run(std::vector<MatchingType> &matchings)
override;
34 inline int setInput(std::vector<std::vector<dataType>> &C_)
override {
39 auto r = (
unsigned long)this->
rowSize;
40 auto c = (
unsigned long)this->
colSize;
45 rowLimitsMinus.resize(r);
46 rowLimitsPlus.resize(r);
47 colLimitsMinus.resize(c);
48 colLimitsPlus.resize(c);
51 for(
int row = 0; row < this->
rowSize; ++row)
55 path.resize((
unsigned long)nbPaths);
56 for(
int p = 0; p < nbPaths; ++p)
66 std::stringstream msg;
67 for(
int r = 0; r < this->
rowSize; ++r) {
68 msg << std::endl <<
" ";
69 for(
int c = 0; c < this->
colSize; ++c)
70 msg << std::fixed << std::setprecision(3) << (*C)[r][c] <<
" ";
77 std::stringstream msg;
78 msg << std::endl <<
" | ";
79 for(
int c = 0; c < this->
colSize; ++c) {
80 msg << colCover[c] <<
" ";
82 msg << std::endl <<
" | ";
83 for(
int c = 0; c < this->
colSize; ++c) {
87 for(
int r = 0; r < this->
rowSize; ++r) {
88 msg <<
" " << rowCover[r] <<
" | ";
89 for(
int c = 0; c < this->
colSize; ++c)
90 msg << M[r][c] <<
" ";
97 std::vector<std::vector<int>> M;
98 std::vector<bool> rowCover;
99 std::vector<bool> colCover;
101 std::vector<int> rowLimitsMinus;
102 std::vector<int> rowLimitsPlus;
103 std::vector<int> colLimitsMinus;
104 std::vector<int> colLimitsPlus;
106 std::vector<std::vector<int>> path;
107 std::vector<std::pair<int, int>> createdZeros;
114 int stepOne(
int &step);
116 int stepTwo(
int &step);
118 int stepThree(
int &step);
120 int stepFour(
int &step);
121 int findZero(
int &row,
int &col);
122 int findStarInRow(
int row);
124 int stepFive(
int &step);
125 int findStarInCol(
int col);
126 int findPrimeInRow(
int row);
128 int stepSix(
int &step);
130 int stepSeven(
int &step);
132 int affect(std::vector<MatchingType> &matchings,
133 const std::vector<std::vector<dataType>> &C);
135 int computeAffectationCost(
const std::vector<std::vector<dataType>> &C);
137 inline bool isZero(dataType t) {
142 inline int resetMasks() {
143 for(
int r = 0; r < this->
rowSize; ++r) {
145 for(
int c = 0; c < this->
colSize; ++c)
148 for(
int c = 0; c < this->
colSize; ++c)
153 inline int copyInputMatrix(std::vector<std::vector<dataType>> &saveInput) {
158 for(
int r = 0; r < rS; ++r)
159 for(
int c = 0; c < cS; ++c)
160 saveInput[r][c] = (*C)[r][c];
printMsg(debug::output::BOLD+" | | | | | . \\ | | (__| | / __/| |_| / __/|__ _|"+debug::output::ENDCOLOR, debug::Priority::PERFORMANCE, debug::LineMode::NEW, stream)