12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- #ifndef CALC
- #define CALC
- #include <list>
- #include <vector>
- #include <string>
- #include <memory>
- using namespace std;
- class Calculator
- {
- private:
- size_t numBat;
- size_t numTarg;
- size_t numMis;
- vector<vector<string>> artyInfo;
- vector<vector<string>> targInfo;
- vector<pair<size_t, size_t>> calculatedNum; //ïàðû (÷èñëî ñíàðÿäîâ íà ïîðàæåíèå, âðåìÿ íà ïîðàæåíèå â ìèíóòàõ)
- size_t r; //÷èñëî áàçèñíûõ ïåðåìåííûõ 2 * numBat + numTarg
- size_t k; //÷èñëî ñâîáîäíûõ ïåðåìåííûõ numTarg * numBat
- vector<vector<double>>* AMtx;
- vector<double>* BVec;
- vector<double>* CVec;
- double val;
- public:
- Calculator();
- ~Calculator();
- size_t countRangesAndAmount(size_t whatTarget);
- void simplexInit(double a, double b);
- void outputInfeasible(vector<vector<double> >* a, vector<double>* b, vector<double>* c);
- void reduce(vector<vector<double> >* a, vector<double>* b, vector<double>* c, double* opt, int row, int col);
- void outputUnbounded(vector<vector<double> >* a, vector<double>* b, vector<double>* c, bool minimize);
- void output(vector<vector<double> >* a, vector<double>* b, vector<double>* c, vector<double> x, double opt, int numVars);
- void reduceC(vector<vector<double> >* a, vector<double>* b, vector<double>* c, double* opt);
- void simplex(vector<vector<double>>* a, vector<double>* b, vector<double>* c,
- vector<double> initialC, double initialOpt, int numVars, int phase, bool minimize, double _aa, double _bb);
- void gomoriInit(double a, double b);
- };
- #endif
|