Skip to content

Commit 703ebf0

Browse files
committed
solve with one parameter
1 parent 4015fab commit 703ebf0

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

src/rampl.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ bool RAMPL::isRunning() const {
310310
return _impl.isRunning();
311311
}
312312

313-
/*.. method:: AMPL.solve(problem, solver)
313+
/*.. method:: AMPL.solve()
314314
315315
Solve the current model.
316316
@@ -320,6 +320,17 @@ void RAMPL::solve() {
320320
_impl.solve("", "");
321321
}
322322

323+
/*.. method:: AMPL.solve(problem)
324+
325+
Solve the current model.
326+
327+
:param string problem: The problem that will be solved.
328+
:raises Error: If the underlying interpreter is not running.
329+
*/
330+
void RAMPL::solve(std::string problem) {
331+
_impl.solve(problem, "");
332+
}
333+
323334
/*.. method:: AMPL.solve(problem, solver)
324335
325336
Solve the current model.
@@ -666,6 +677,7 @@ RCPP_MODULE(rampl){
666677
.method("close", &RAMPL::close)
667678
.method("isRunning", &RAMPL::isRunning)
668679
.method("solve", ( void (RAMPL::*)() )(&RAMPL::solve))
680+
.method("solve", ( void (RAMPL::*)(std::string) )(&RAMPL::solve))
669681
.method("solve", ( void (RAMPL::*)(std::string, std::string) )(&RAMPL::solve))
670682

671683
.method("getData", &RAMPL::getData)

src/rampl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ class RAMPL {
105105
void close();
106106
bool isRunning() const;
107107
void solve();
108+
void solve(std::string problem);
108109
void solve(std::string problem, std::string solver);
109110
Rcpp::DataFrame getData(Rcpp::List statements) const;
110111
SEXP getValue(std::string scalarExpression) const;

0 commit comments

Comments
 (0)