Skip to content

Commit

Permalink
Man, compilers are just garbage.
Browse files Browse the repository at this point in the history
  • Loading branch information
khuck committed Sep 17, 2024
1 parent c9d5ea8 commit 5c30039
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/apex/nelder_mead.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Variable {
std::vector<double> dvalues;
std::vector<long> lvalues;
std::vector<std::string> svalues;
std::array<double,2> limits;
std::vector<double> limits;
VariableType vtype;
size_t current_index;
size_t best_index;
Expand All @@ -33,7 +33,7 @@ class Variable {
void * value; // for the client to get the values
size_t maxlen;
Variable () = delete;
Variable (VariableType vtype, void * ptr) : limits({0.0,0.0}), vtype(vtype), current_index(0),
Variable (VariableType vtype, void * ptr) : vtype(vtype), current_index(0),
best_index(0), current_value(0), best_value(0), value(ptr), maxlen(0) { }
void set_current_value() {
if (vtype == VariableType::continuous) {
Expand Down Expand Up @@ -102,7 +102,8 @@ class Variable {
//return ((double)maxlen / 2.0);
return 0.5;
}
const std::array<double,2>& get_limits(void) {
const std::vector<double>& get_limits(void) {
limits.reserve(2);
// if our variable is continuous, we have been initialized with
// two values, the min and the max
if (vtype == VariableType::continuous) {
Expand Down

0 comments on commit 5c30039

Please sign in to comment.