Calculator.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef CALC
  2. #define CALC
  3. #include <list>
  4. #include <vector>
  5. #include <string>
  6. #include <memory>
  7. using namespace std;
  8. class Calculator
  9. {
  10. private:
  11. size_t numBat;
  12. size_t numTarg;
  13. size_t numMis;
  14. vector<vector<string>> artyInfo;
  15. vector<vector<string>> targInfo;
  16. vector<pair<size_t, size_t>> calculatedNum; //ïàðû (÷èñëî ñíàðÿäîâ íà ïîðàæåíèå, âðåìÿ íà ïîðàæåíèå â ìèíóòàõ)
  17. size_t r; //÷èñëî áàçèñíûõ ïåðåìåííûõ 2 * numBat + numTarg
  18. size_t k; //÷èñëî ñâîáîäíûõ ïåðåìåííûõ numTarg * numBat
  19. vector<vector<double>>* AMtx;
  20. vector<double>* BVec;
  21. vector<double>* CVec;
  22. double val;
  23. public:
  24. Calculator();
  25. ~Calculator();
  26. size_t countRangesAndAmount(size_t whatTarget);
  27. void simplexInit(double a, double b);
  28. void outputInfeasible(vector<vector<double> >* a, vector<double>* b, vector<double>* c);
  29. void reduce(vector<vector<double> >* a, vector<double>* b, vector<double>* c, double* opt, int row, int col);
  30. void outputUnbounded(vector<vector<double> >* a, vector<double>* b, vector<double>* c, bool minimize);
  31. void output(vector<vector<double> >* a, vector<double>* b, vector<double>* c, vector<double> x, double opt, int numVars);
  32. void reduceC(vector<vector<double> >* a, vector<double>* b, vector<double>* c, double* opt);
  33. void simplex(vector<vector<double>>* a, vector<double>* b, vector<double>* c,
  34. vector<double> initialC, double initialOpt, int numVars, int phase, bool minimize, double _aa, double _bb);
  35. void gomoriInit(double a, double b);
  36. };
  37. #endif