A->coeffRef(i,j)=A->coeffRef(k,col_index)*A->coeffRef(i,j)-under_pivot*A->coeffRef(k,j);//eliminate the rows below the row with pivot, only one pivot per column
intunder_pivot=A.coeffRef(i,col_index);
for(intj=col_index;j<cols;j++){//change k+1 to k to eliminate the elements below the pivot
A.coeffRef(i,j)=A.coeffRef(k,col_index)*A.coeffRef(i,j)-under_pivot*A.coeffRef(k,j);//eliminate the rows below the row with pivot, only one pivot per column