Skip to content

Commit

Permalink
fixed error in variation of initial guess in commit fb31cf3e8a7b1523d…
Browse files Browse the repository at this point in the history
…3e86170359c4a8ef279ae47
  • Loading branch information
qichenghua authored and OpenModelica-Hudson committed Jul 18, 2017
1 parent 7c973e6 commit 6eee27b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions SimulationRuntime/cpp/Solver/Nox/Nox.cpp
Expand Up @@ -906,9 +906,9 @@ bool Nox::modify_y(const int counter){
BinRep(startvaluemodifier,counter);

//replace 0 by -1.
std::for_each(startvaluemodifier.begin(),startvaluemodifier.end(), [](double d){return (d==0.0) ? -1.0 : d;});
std::for_each(startvaluemodifier.begin(),startvaluemodifier.end(), [](double &d){d=(d==0.0) ? -1.0 : d;});

std::cout << "Varying initial guess by 10%:" << std::endl;
if(_generateoutput) std::cout << "Varying initial guess by 10%:" << std::endl;
for (int i=0;i<_dimSys;i++){
_y[i] += (_y[i]!=0.0) ? 0.1*_y[i]*startvaluemodifier[i] : 0.1*startvaluemodifier[i];
}
Expand Down

0 comments on commit 6eee27b

Please sign in to comment.