@@ -471,12 +471,11 @@ RParameterEntity RAMPL::getParameter(std::string name) const {
471471*/
472472Rcpp::List RAMPL::getVariables () const {
473473 Rcpp::List list;
474- // const ampl::EntityMap<ampl::Variable> map = _impl.getVariables();
475- ampl::EntityMap<ampl::Variable> map = _impl.getVariables ();
474+ const ampl::EntityMap<ampl::Variable> map = _impl.getVariables ();
476475 ampl::EntityMap<ampl::Variable>::iterator begin = map.begin ();
477476 ampl::EntityMap<ampl::Variable>::iterator end = map.end ();
478477 for (ampl::EntityMap<ampl::Variable>::iterator itr = begin; itr != end; itr++){
479- list[itr->first ] = RVariableEntity (itr-> second );
478+ list[itr->name () ] = RVariableEntity (* itr);
480479 }
481480 return list;
482481}
@@ -489,12 +488,11 @@ Rcpp::List RAMPL::getVariables() const {
489488*/
490489Rcpp::List RAMPL::getConstraints () const {
491490 Rcpp::List list;
492- // const ampl::EntityMap<ampl::Constraint> map = _impl.getConstraints();
493- ampl::EntityMap<ampl::Constraint> map = _impl.getConstraints ();
491+ const ampl::EntityMap<ampl::Constraint> map = _impl.getConstraints ();
494492 ampl::EntityMap<ampl::Constraint>::iterator begin = map.begin ();
495493 ampl::EntityMap<ampl::Constraint>::iterator end = map.end ();
496494 for (ampl::EntityMap<ampl::Constraint>::iterator itr = begin; itr != end; itr++){
497- list[itr->first ] = RConstraintEntity (itr-> second );
495+ list[itr->name () ] = RConstraintEntity (* itr);
498496 }
499497 return list;
500498}
@@ -507,12 +505,11 @@ Rcpp::List RAMPL::getConstraints() const {
507505*/
508506Rcpp::List RAMPL::getObjectives () const {
509507 Rcpp::List list;
510- // const ampl::EntityMap<ampl::Objective> map = _impl.getObjectives();
511- ampl::EntityMap<ampl::Objective> map = _impl.getObjectives ();
508+ const ampl::EntityMap<ampl::Objective> map = _impl.getObjectives ();
512509 ampl::EntityMap<ampl::Objective>::iterator begin = map.begin ();
513510 ampl::EntityMap<ampl::Objective>::iterator end = map.end ();
514511 for (ampl::EntityMap<ampl::Objective>::iterator itr = begin; itr != end; itr++){
515- list[itr->first ] = RObjectiveEntity (itr-> second );
512+ list[itr->name () ] = RObjectiveEntity (* itr);
516513 }
517514 return list;
518515}
@@ -525,12 +522,11 @@ Rcpp::List RAMPL::getObjectives() const {
525522*/
526523Rcpp::List RAMPL::getSets () const {
527524 Rcpp::List list;
528- // const ampl::EntityMap<ampl::Set> map = _impl.getSets();
529- ampl::EntityMap<ampl::Set> map = _impl.getSets ();
525+ const ampl::EntityMap<ampl::Set> map = _impl.getSets ();
530526 ampl::EntityMap<ampl::Set>::iterator begin = map.begin ();
531527 ampl::EntityMap<ampl::Set>::iterator end = map.end ();
532528 for (ampl::EntityMap<ampl::Set>::iterator itr = begin; itr != end; itr++){
533- list[itr->first ] = RSetEntity (itr-> second );
529+ list[itr->name () ] = RSetEntity (* itr);
534530 }
535531 return list;
536532}
@@ -543,12 +539,11 @@ Rcpp::List RAMPL::getSets() const {
543539*/
544540Rcpp::List RAMPL::getParameters () const {
545541 Rcpp::List list;
546- // const ampl::EntityMap<ampl::Parameter> map = _impl.getParameters();
547- ampl::EntityMap<ampl::Parameter> map = _impl.getParameters ();
542+ const ampl::EntityMap<ampl::Parameter> map = _impl.getParameters ();
548543 ampl::EntityMap<ampl::Parameter>::iterator begin = map.begin ();
549544 ampl::EntityMap<ampl::Parameter>::iterator end = map.end ();
550545 for (ampl::EntityMap<ampl::Parameter>::iterator itr = begin; itr != end; itr++){
551- list[itr->first ] = RParameterEntity (itr-> second );
546+ list[itr->name () ] = RParameterEntity (* itr);
552547 }
553548 return list;
554549}
0 commit comments