Skip to content

Commit

Permalink
#1097: remove solve alias for evaluate
Browse files Browse the repository at this point in the history
  • Loading branch information
ghorn committed May 12, 2014
1 parent 61d8d6d commit 896fe11
Show file tree
Hide file tree
Showing 21 changed files with 17 additions and 34 deletions.
4 changes: 0 additions & 4 deletions casadi/core/function/function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,6 @@ namespace casadi {
(*this)->evaluate();
}

void Function::solve() {
evaluate();
}

int Function::getNumInputNonzeros() const {
return (*this)->getNumInputNonzeros();
}
Expand Down
3 changes: 0 additions & 3 deletions casadi/core/function/function.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,6 @@ namespace casadi {
/** \brief Evaluate */
void evaluate();

/// the same as evaluate()
void solve();

///@{
/** \brief Generate a Jacobian function of output \a oind with respect to input \a iind
* \param iind The index of the input
Expand Down
4 changes: 0 additions & 4 deletions casadi/core/function/lp_internal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ void LPSolverInternal::evaluate() {
throw CasadiException("LPSolverInternal::evaluate: Not implemented");
}

void LPSolverInternal::solve() {
throw CasadiException("LPSolverInternal::solve: Not implemented");
}

This comment has been minimized.

Copy link
@ghorn

ghorn May 12, 2014

Author Member

@jgillis is this OK?

This comment has been minimized.

Copy link
@jaeandersson

jaeandersson May 12, 2014

Member

This is not related to the change above so it belongs to a separate commit.

This comment has been minimized.

Copy link
@ghorn

ghorn May 12, 2014

Author Member

ok fixed in next commit

void LPSolverInternal::checkInputs() const {
for (int i=0;i<input(LP_SOLVER_LBX).size();++i) {
casadi_assert_message(input(LP_SOLVER_LBX).at(i)<=input(LP_SOLVER_UBX).at(i),
Expand Down
3 changes: 0 additions & 3 deletions casadi/core/function/lp_internal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ class CASADI_CORE_EXPORT LPSolverInternal : public FunctionInternal {
// Solve the system of equations
virtual void evaluate();

// Solve the system of equations
virtual void solve();

/// \brief Check if the numerical values of the supplied bounds make sense
virtual void checkInputs() const;

Expand Down
2 changes: 1 addition & 1 deletion casadi/optimal_control/direct_collocation_internal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ void DirectCollocationInternal::evaluate() {
nlp_solver_.input(NLP_SOLVER_UBG).data());

//Solve the problem
nlp_solver_.solve();
nlp_solver_.evaluate();

// Save the optimal solution
setOptimalSolution(nlp_solver_.output(NLP_SOLVER_X).data());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ void DirectMultipleShootingInternal::evaluate() {
nlp_solver_.input(NLP_SOLVER_UBG).data());

//Solve the problem
nlp_solver_.solve();
nlp_solver_.evaluate();

// Save the optimal solution
setOptimalSolution(nlp_solver_.output(NLP_SOLVER_X).data());
Expand Down
2 changes: 1 addition & 1 deletion casadi/optimal_control/direct_single_shooting_internal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ void DirectSingleShootingInternal::evaluate() {
nlp_solver_.input(NLP_SOLVER_UBG).data());

//Solve the problem
nlp_solver_.solve();
nlp_solver_.evaluate();

// Save the optimal solution
setOptimalSolution(nlp_solver_.output(NLP_SOLVER_X).data());
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/cplusplus/cstr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ int main(){
}

// Solve the problem
ocp_solver.solve();
ocp_solver.evaluate();



Expand Down
2 changes: 1 addition & 1 deletion docs/examples/cplusplus/ipopt_nl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ int main(int argc, char **argv){
nlp_solver.setInput(nl.x_init,"x0");

// Solve NLP
nlp_solver.solve();
nlp_solver.evaluate();

return 0;
}
2 changes: 1 addition & 1 deletion docs/examples/cplusplus/knitro_nl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ int main(int argc, char **argv){
nlp_solver.setInput(nl.x_init,"x0");

// Solve NLP
nlp_solver.solve();
nlp_solver.evaluate();
return 0;
}
2 changes: 1 addition & 1 deletion docs/examples/cplusplus/multiple_shooting_from_scratch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ int main(){
nlp_solver.setInput(0.,"ubg");

// Solve the problem
nlp_solver.solve();
nlp_solver.evaluate();

// Optimal solution of the NLP
const Matrix<double>& V_opt = nlp_solver.output("x");
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/cplusplus/rocket_ipopt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ int main(){
solver.setInput(gmax,"ubg");

// Solve the problem
solver.solve();
solver.evaluate();

// Print the optimal cost
double cost;
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/cplusplus/rocket_mx_and_sx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ int main(){
solver.setInput(Gmax,"ubg");

// Solve the problem
solver.solve();
solver.evaluate();

// Get the solution
solver.getOutput(Usol,"x");
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/cplusplus/rocket_single_shooting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ int main(){
solver.setInput(Gmax,"ubg");

// Solve the problem
solver.solve();
solver.evaluate();

// Get the solution
solver.getOutput(Usol,"x");
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/cplusplus/rocket_snopt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ int main(){
solver.setInput(gmax,"ubg");

// Solve the problem
solver.solve();
solver.evaluate();

// Print the optimal cost
double cost;
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/cplusplus/snopt_nl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ int main(int argc, char **argv){
nlp_solver.setInput(nl.x_init,"x0");

// Solve NLP
nlp_solver.solve();
nlp_solver.evaluate();

return 0;
}
2 changes: 1 addition & 1 deletion docs/examples/cplusplus/sqpmethod_nl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,6 @@ int main(int argc, char **argv){
nlp_solver.setInput(nl.x_init,"x0");

// Solve NLP
nlp_solver.solve();
nlp_solver.evaluate();
return 0;
}
2 changes: 1 addition & 1 deletion docs/examples/cplusplus/stabilized_sqpmethod_nl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,6 @@ int main(int argc, char **argv){
nlp_solver.setInput(nl.x_init,"x0");

// Solve NLP
nlp_solver.solve();
nlp_solver.evaluate();
return 0;
}
2 changes: 1 addition & 1 deletion docs/examples/cplusplus/test_liftopt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ int main(){
solver.input("ubx").setAll(1);

// Solve the problem
solver.solve();
solver.evaluate();

return 0;
}
5 changes: 1 addition & 4 deletions docs/examples/cplusplus/vdp_multiple_shooting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,10 @@ int main(){
ms.input("lbx")(1,ns) = ms.input("ubx")(1,ns) = 0;

// Solve the problem
ms.solve();
ms.evaluate();

cout << ms.output("x_opt") << endl;
cout << ms.output("u_opt") << endl;

return 0;
}



2 changes: 1 addition & 1 deletion docs/examples/cplusplus/worhp_nl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ int main(int argc, char **argv){
nlp_solver.setInput(nl.x_init,"x0");

// Solve NLP
nlp_solver.solve();
nlp_solver.evaluate();
return 0;
}

0 comments on commit 896fe11

Please sign in to comment.