@@ -310,6 +310,16 @@ bool RAMPL::isRunning() const {
310310 return _impl.isRunning ();
311311}
312312
313+ /* .. method:: AMPL.solve(problem, solver)
314+
315+ Solve the current model.
316+
317+ :raises Error: If the underlying interpreter is not running.
318+ */
319+ void RAMPL::solve () {
320+ _impl.solve (" " , " " );
321+ }
322+
313323/* .. method:: AMPL.solve(problem, solver)
314324
315325 Solve the current model.
@@ -318,11 +328,8 @@ bool RAMPL::isRunning() const {
318328 :param string solver: The solver that will be used to solve the problem.
319329 :raises Error: If the underlying interpreter is not running.
320330*/
321- void RAMPL::solve (Rcpp::Nullable<std::string> problem, Rcpp::Nullable<std::string> solver) {
322- std::string cpp_problem = problem.isNotNull () ? Rcpp::as<std::string>(problem) : " " ;
323- std::string cpp_solver = solver.isNotNull () ? Rcpp::as<std::string>(solver) : " " ;
324-
325- _impl.solve (cpp_problem, cpp_solver);
331+ void RAMPL::solve (std::string problem, std::string solver) {
332+ _impl.solve (problem, solver);
326333}
327334
328335
@@ -658,7 +665,8 @@ RCPP_MODULE(rampl){
658665 .method (" reset" , &RAMPL::reset)
659666 .method (" close" , &RAMPL::close)
660667 .method (" isRunning" , &RAMPL::isRunning)
661- .method (" solve" , &RAMPL::solve, List::create ( _[" problem" ], _[" solver" ] = " " ))
668+ .method (" solve" , ( void (RAMPL::*)() )(&RAMPL::solve))
669+ .method (" solve" , ( void (RAMPL::*)(std:string, std:string) )(&RAMPL::solve))
662670
663671 .method (" getData" , &RAMPL::getData)
664672 .method (" getValue" , &RAMPL::getValue)
0 commit comments