expo=std::max(expo,(int)std::ceil(std::abs(std::log2(std::abs(x.coeffRef(i)))))+1);//added a norm around the log2 because it can get negative and ruin the max
//std::cout << "vecor x at posion i: " << std::log2(x.coeffRef(i)) << std::endl;
//std::cout << "expo = " << expo << std::endl;
}
largest_exponent=expo;
delta=std::pow(2,expo);
...
...
@@ -82,7 +85,7 @@ int ExactConstraintSatisfaction::lcm(const int a, const int b)
@@ -133,8 +136,11 @@ void ExactConstraintSatisfaction::IREF_Gaussian(Eigen::SparseMatrix<int>* A, Eig
}
}
for(inti=k+1;i<rows;i++){
for(intj=k;j<cols;j++){//change k+1 to k to eliminate the elements below the pivot
A->coeffRef(i,j)=A->coeffRef(k,k)*A->coeffRef(i,j)-A->coeffRef(i,k)*A->coeffRef(k,j);//eliminate the rows below the row with pivot, only one pivot per column
intunder_pivot=A->coeffRef(i,k);
for(intj=k;j<cols;j++){//change k+1 to k to eliminate the elements below the pivot
std::cout<<" outer for i = "<<i<<"inner for j = "<<j<<"set A(i, j) = "<<A->coeffRef(k,k)<<" * "<<A->coeffRef(i,j)<<" - "<<A->coeffRef(i,k)<<" * "<<A->coeffRef(k,j)<<std::endl;
A->coeffRef(i,j)=A->coeffRef(k,k)*A->coeffRef(i,j)-under_pivot*A->coeffRef(k,j);//eliminate the rows below the row with pivot, only one pivot per column