ExactConstraintSatisfaction.hh 1.62 KB
Newer Older
1
2
3
4
#ifndef EXACTCONSTRAINTSATISFACTION_HH
#define EXACTCONSTRAINTSATISFACTION_HH

#include <CoMISo/Config/config.hh>
Robin Brost's avatar
Robin Brost committed
5
#include <CoMISo/Config/CoMISoDefines.hh>
6
7
8

#include <CoMISo/NSolver/NProblemInterface.hh>
#include <vector>
9
#include <list>
10

Robin Brost's avatar
Robin Brost committed
11
class COMISODLLEXPORT ExactConstraintSatisfaction
12
13
14
15
16
17
18
{
public:
    ExactConstraintSatisfaction();

    //-----------------------helpfull variables-------------------------------

    int number_pivots = 0; //number of rows with a pivot;
Robin Brost's avatar
Robin Brost committed
19
20
    int largest_exponent = 0;
    double delta = 0;
21
22
23
24
25
26
27
28
29
30
31
32

    //-----------------------helpfull methods---------------------------------

    int gcd(const int a, const int b);

    int gcdRow(const Eigen::SparseMatrix<int>::RowXpr row, const int b);

    void swapRows(Eigen::SparseMatrix<int>* A, int row1, int row2);

    void printMatrix(Eigen::SparseMatrix<int> A);
    void printVector(Eigen::VectorXi b);

Robin Brost's avatar
Robin Brost committed
33
34
35
    int largestExponent(Eigen::VectorXd x);
    double F_delta(double x);
    int lcm(const int a, const int b);
36
    int lcm_list(const std::list<int> D);
Robin Brost's avatar
Robin Brost committed
37
38
    int indexPivot(Eigen::SparseMatrix<int>::RowXpr row);

39
40
41
42
43
44
45
    //--------------------matrix transformation-------------------------------

    void IREF_Gaussian(Eigen::SparseMatrix<int>* A, Eigen::VectorXi* b);
    void IRREF_Jordan(Eigen::SparseMatrix<int>* A, Eigen::VectorXi* b);

    //-------------------Evaluation--------------------------------------------

46
47
48
    void evaluation(Eigen::SparseMatrix<int>* A, Eigen::VectorXi* b, Eigen::VectorXd* x);
    double makeDiv(const std::list<int>& D, double x);
    double safeDot(const std::list<std::pair<double, double>>& S);
49
50
51
};

#endif // EXACTCONSTRAINTSATISFACTION_HH