Skip to content

Commit 01917bb

Browse files
authored
Merge pull request #500 from ibex-team/add-for-ampl
Add for AMPL
2 parents 3ea8e7e + 2303cbe commit 01917bb

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/system/ibex_SystemFactory.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,13 @@ void SystemFactory::init_args() {
9999
varcopy(input_args, sys_args);
100100
}
101101

102-
void SystemFactory::add_goal(const ExprNode& goal) {
102+
void SystemFactory::add_goal(const ExprNode& goal, const char* name) {
103103
init_args();
104104

105105
Array<const ExprSymbol> goal_vars(input_args.size());
106106
varcopy(input_args,goal_vars);
107107
const ExprNode& goal_expr=ExprCopy().copy(input_args, goal_vars, goal).simplify(simpl_level);
108-
this->goal = new Function(goal_vars, goal_expr);
108+
this->goal = new Function(goal_vars, goal_expr, name);
109109
}
110110

111111
void SystemFactory::add_goal(const Function& goal) {
@@ -118,14 +118,14 @@ void SystemFactory::add_goal(const Function& goal) {
118118
this->goal = new Function(goal);
119119
}
120120

121-
void SystemFactory::add_ctr(const ExprCtr& ctr) {
121+
void SystemFactory::add_ctr(const ExprCtr& ctr, const char* name) {
122122
init_args();
123123

124124
Array<const ExprSymbol> ctr_args(input_args.size());
125125
varcopy(input_args,ctr_args);
126126
const ExprNode& ctr_expr=ExprCopy().copy(input_args, ctr_args, ctr.e).simplify(simpl_level);
127127

128-
ctrs.push_back(new NumConstraint(*new Function(ctr_args, ctr_expr), ctr.op, true));
128+
ctrs.push_back(new NumConstraint(*new Function(ctr_args, ctr_expr, name), ctr.op, true));
129129

130130
f_ctrs.push_back(& f_ctrs_copy.copy(input_args, sys_args, ctr.e, true));
131131
}

src/system/ibex_SystemFactory.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class SystemFactory {
5959
* \warning for convenience, goal is cleaned up (the expression
6060
* does not exist anymore after this function call).
6161
*/
62-
void add_goal(const ExprNode& goal);
62+
void add_goal(const ExprNode& goal,const char* name=NULL);
6363

6464
/**
6565
* \brief Add a goal function (by copy).
@@ -74,7 +74,7 @@ class SystemFactory {
7474
* \warning the ctr expression must no be deleted until the final system has been built
7575
* (the factory keeps track of nodes for building DAGS).
7676
*/
77-
void add_ctr(const ExprCtr& ctr);
77+
void add_ctr(const ExprCtr& ctr, const char* name=NULL);
7878

7979
/**
8080
* \brief Add a new constraint (by copy).

0 commit comments

Comments
 (0)