Skip to content

Commit

Permalink
fix for android termux + xmake
Browse files Browse the repository at this point in the history
  • Loading branch information
luk036 committed Dec 14, 2024
1 parent 738db90 commit b9bf531
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions source/lowpass_oracle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ auto LowpassOracle::assess_feas(const Vec &x, const double &Spsq) -> ParallelCut
if (this->idx1 == this->nwpass) {
this->idx1 = 0; // round robin
}
double v = matrix_vector(this->idx1);
double v = matrix_vector(size_t(this->idx1));
if (v > this->Upsq) {
cut.second = Vec{v - this->Upsq, v - this->Lpsq};
cut.first = this->A[this->idx1];
cut.first = this->A[size_t(this->idx1)];
return &cut;
}
if (v < this->Lpsq) {
cut.second = Vec{-v + this->Lpsq, -v + this->Upsq};
cut.first = -this->A[this->idx1];
cut.first = -this->A[size_t(this->idx1)];
return &cut;
}
}
Expand All @@ -116,15 +116,15 @@ auto LowpassOracle::assess_feas(const Vec &x, const double &Spsq) -> ParallelCut
if (this->idx3 == N) {
this->idx3 = this->nwstop; // round robin
}
double v = matrix_vector(this->idx3);
double v = matrix_vector(size_t(this->idx3));
if (v > Spsq) {
cut.second = Vec{v - Spsq, v};
cut.first = this->A[this->idx3];
cut.first = this->A[size_t(this->idx3)];
return &cut;
}
if (v < 0.0) {
cut.second = Vec{-v, -v + Spsq};
cut.first = -this->A[this->idx3];
cut.first = -this->A[size_t(this->idx3)];
return &cut;
}
if (v > this->_fmax) {
Expand All @@ -140,10 +140,10 @@ auto LowpassOracle::assess_feas(const Vec &x, const double &Spsq) -> ParallelCut
if (this->idx2 == this->nwstop) {
this->idx2 = this->nwpass; // round robin
}
double v = matrix_vector(this->idx2);
double v = matrix_vector(size_t(this->idx2));
if (v < 0.0) {
cut.second = Vec{-v};
cut.first = -this->A[this->idx2];
cut.first = -this->A[size_t(this->idx2)];
return &cut;
}
}
Expand Down Expand Up @@ -182,5 +182,5 @@ auto LowpassOracle::assess_optim(const Vec &x, double &Spsq) -> std::tuple<Paral
}
// Begin objective function
Spsq = this->_fmax; // output
return {{this->A[this->_kmax], Vec{0.0, this->_fmax}}, true};
return {{this->A[size_t(this->_kmax)], Vec{0.0, this->_fmax}}, true};
}

0 comments on commit b9bf531

Please sign in to comment.