Skip to content

Commit

Permalink
small compile fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hschreiber committed Nov 9, 2023
1 parent 840a6e7 commit 2ddf03e
Show file tree
Hide file tree
Showing 9 changed files with 928 additions and 914 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class Boundary_matrix //TODO: factorize/inheritate/compose with base matrix?
bool is_zero_cell(index columnIndex, index rowIndex) const;
bool is_zero_column(index columnIndex);

index get_pivot(index columnIndex);
int get_pivot(index columnIndex);

Boundary_matrix& operator=(const Boundary_matrix& other);
friend void swap(Boundary_matrix& matrix1, Boundary_matrix& matrix2){
Expand Down Expand Up @@ -499,7 +499,7 @@ inline bool Boundary_matrix<Master_matrix>::is_zero_column(index columnIndex)
}

template<class Master_matrix>
inline typename Boundary_matrix<Master_matrix>::index Boundary_matrix<Master_matrix>::get_pivot(index columnIndex)
inline int Boundary_matrix<Master_matrix>::get_pivot(index columnIndex)
{
if constexpr (activeSwapOption){
if (swap_opt::rowSwapped_) swap_opt::_orderRows();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class Chain_matrix
bool is_zero_column(index columnIndex); //just for sanity checks as a valid chain matrix never has an empty column.

index get_column_with_pivot(index simplexIndex) const;
index get_pivot(index columnIndex);
int get_pivot(index columnIndex);

Chain_matrix& operator=(const Chain_matrix& other);
friend void swap(Chain_matrix& matrix1,
Expand Down Expand Up @@ -524,7 +524,7 @@ inline typename Chain_matrix<Master_matrix>::index Chain_matrix<Master_matrix>::
}

template<class Master_matrix>
inline typename Chain_matrix<Master_matrix>::index Chain_matrix<Master_matrix>::get_pivot(index columnIndex)
inline int Chain_matrix<Master_matrix>::get_pivot(index columnIndex)
{
if constexpr (Master_matrix::Option_list::has_removable_columns){
return matrix_.at(columnIndex).get_pivot();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ inline void Chain_representative_cycles<Master_matrix>::update_representative_cy

for (index i = 0; i < _matrix()->get_number_of_columns(); i++){
auto &col = _matrix()->get_column(_matrix()->get_column_with_pivot(i));
if (!col.is_paired() || i < col.get_paired_chain_index()){
if (!col.is_paired() || static_cast<int>(i) < col.get_paired_chain_index()){
cycle_type cycle;
for (auto& c : col){
cycle.push_back(c.get_row_index());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ inline bool Chain_vine_swap<Master_matrix>::_is_negative_in_pair(index columnInd
if constexpr (Master_matrix::Option_list::has_column_pairings){
return CP::is_negative_in_pair(_matrix()->get_pivot(columnIndex));
} else {
const auto& col = _matrix()->get_column(columnIndex);
auto& col = _matrix()->get_column(columnIndex);
if (!col.is_paired()) return false;
return col.get_pivot() > _matrix()->get_pivot(col.get_paired_chain_index());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Chain_column_extra_properties{
Chain_column_extra_properties(Chain_column_extra_properties&& col)
: pivot_(std::exchange(col.pivot_, -1)), pairedColumn_(std::exchange(col.pairedColumn_, -1)) {}

index get_paired_chain_index() const { return pairedColumn_; }
int get_paired_chain_index() const { return pairedColumn_; }
bool is_paired() const { return pairedColumn_ != -1; }
void assign_paired_chain(index other_col){ pairedColumn_ = other_col; }
void unassign_paired_chain() { pairedColumn_ = -1; };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class Id_to_position_indexation_overlay
//boundary
//ru
//chain
index get_pivot(index columnIndex);
int get_pivot(index columnIndex);

Id_to_position_indexation_overlay& operator=(Id_to_position_indexation_overlay other);
friend void swap(Id_to_position_indexation_overlay& matrix1,
Expand Down Expand Up @@ -350,15 +350,14 @@ template<class Matrix_type, class Master_matrix_type>
inline typename Id_to_position_indexation_overlay<Matrix_type,Master_matrix_type>::index
Id_to_position_indexation_overlay<Matrix_type,Master_matrix_type>::get_column_with_pivot(index simplexIndex) const
{
index pos = matrix_.get_column_with_pivot(simplexIndex);
int pos = matrix_.get_column_with_pivot(simplexIndex);
unsigned int i = 0;
while (_column_id_to_position(i) != pos) ++i;
return i;
}

template<class Matrix_type, class Master_matrix_type>
inline typename Id_to_position_indexation_overlay<Matrix_type,Master_matrix_type>::index
Id_to_position_indexation_overlay<Matrix_type,Master_matrix_type>::get_pivot(index columnIndex)
inline int Id_to_position_indexation_overlay<Matrix_type,Master_matrix_type>::get_pivot(index columnIndex)
{
return matrix_.get_pivot(_column_id_to_position(columnIndex));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class Position_to_id_indexation_overlay
//boundary
//ru
//chain
index get_pivot(index columnIndex);
int get_pivot(index columnIndex);

Position_to_id_indexation_overlay& operator=(Position_to_id_indexation_overlay other);
friend void swap(Position_to_id_indexation_overlay& matrix1,
Expand Down Expand Up @@ -365,8 +365,7 @@ Position_to_id_indexation_overlay<Matrix_type,Master_matrix_type>::get_column_wi
}

template<class Matrix_type, class Master_matrix_type>
inline typename Position_to_id_indexation_overlay<Matrix_type,Master_matrix_type>::index
Position_to_id_indexation_overlay<Matrix_type,Master_matrix_type>::get_pivot(index columnIndex)
inline int Position_to_id_indexation_overlay<Matrix_type,Master_matrix_type>::get_pivot(index columnIndex)
{
return matrix_.get_pivot(columnPositionToID_[columnIndex]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class RU_matrix
bool is_zero_column(index columnIndex, bool inR = true);

index get_column_with_pivot(index simplexIndex) const; //assumes that pivot exists
index get_pivot(index columnIndex);
int get_pivot(index columnIndex);

RU_matrix& operator=(RU_matrix other);
friend void swap(RU_matrix& matrix1, RU_matrix& matrix2){
Expand Down Expand Up @@ -334,7 +334,7 @@ inline typename RU_matrix<Master_matrix>::index RU_matrix<Master_matrix>::get_co
}

template<class Master_matrix>
inline typename RU_matrix<Master_matrix>::index RU_matrix<Master_matrix>::get_pivot(index columnIndex)
inline int RU_matrix<Master_matrix>::get_pivot(index columnIndex)
{
return reducedMatrixR_.get_column(columnIndex).get_pivot();
}
Expand Down Expand Up @@ -401,7 +401,7 @@ inline void RU_matrix<Master_matrix>::_reduce()
{
Column_type &curr = reducedMatrixR_.get_column(i);
int pivot = curr.get_pivot();
index currIndex = get_column_with_pivot_(pivot);
int currIndex = get_column_with_pivot_(pivot);

while (pivot != -1 && currIndex != -1){
if constexpr (Master_matrix::Option_list::is_z2){
Expand Down Expand Up @@ -487,7 +487,7 @@ inline void RU_matrix<Master_matrix>::_reduce_last_column()
}

int pivot = curr.get_pivot();
index currIndex = get_column_with_pivot_(pivot);
int currIndex = get_column_with_pivot_(pivot);

while (pivot != -1 && currIndex != -1){
if constexpr (Master_matrix::Option_list::is_z2){
Expand Down
Loading

0 comments on commit 2ddf03e

Please sign in to comment.