@@ -491,11 +491,11 @@ RParameterEntity RAMPL::getParameter(std::string name) const {
491491*/
492492Rcpp::List RAMPL::getVariables () const {
493493 Rcpp::List list;
494- ampl::EntityMap<ampl::Variable> map = _impl.getVariables ();
494+ const ampl::EntityMap<ampl::Variable> map = _impl.getVariables ();
495495 ampl::EntityMap<ampl::Variable>::iterator begin = map.begin ();
496496 ampl::EntityMap<ampl::Variable>::iterator end = map.end ();
497497 for (ampl::EntityMap<ampl::Variable>::iterator itr = begin; itr != end; itr++){
498- list[itr->first ] = RVariableEntity (itr-> second );
498+ list[itr->name () ] = RVariableEntity (* itr);
499499 }
500500 return list;
501501}
@@ -508,11 +508,11 @@ Rcpp::List RAMPL::getVariables() const {
508508*/
509509Rcpp::List RAMPL::getConstraints () const {
510510 Rcpp::List list;
511- ampl::EntityMap<ampl::Constraint> map = _impl.getConstraints ();
511+ const ampl::EntityMap<ampl::Constraint> map = _impl.getConstraints ();
512512 ampl::EntityMap<ampl::Constraint>::iterator begin = map.begin ();
513513 ampl::EntityMap<ampl::Constraint>::iterator end = map.end ();
514514 for (ampl::EntityMap<ampl::Constraint>::iterator itr = begin; itr != end; itr++){
515- list[itr->first ] = RConstraintEntity (itr-> second );
515+ list[itr->name () ] = RConstraintEntity (* itr);
516516 }
517517 return list;
518518}
@@ -525,11 +525,11 @@ Rcpp::List RAMPL::getConstraints() const {
525525*/
526526Rcpp::List RAMPL::getObjectives () const {
527527 Rcpp::List list;
528- ampl::EntityMap<ampl::Objective> map = _impl.getObjectives ();
528+ const ampl::EntityMap<ampl::Objective> map = _impl.getObjectives ();
529529 ampl::EntityMap<ampl::Objective>::iterator begin = map.begin ();
530530 ampl::EntityMap<ampl::Objective>::iterator end = map.end ();
531531 for (ampl::EntityMap<ampl::Objective>::iterator itr = begin; itr != end; itr++){
532- list[itr->first ] = RObjectiveEntity (itr-> second );
532+ list[itr->name () ] = RObjectiveEntity (* itr);
533533 }
534534 return list;
535535}
@@ -542,11 +542,11 @@ Rcpp::List RAMPL::getObjectives() const {
542542*/
543543Rcpp::List RAMPL::getSets () const {
544544 Rcpp::List list;
545- ampl::EntityMap<ampl::Set> map = _impl.getSets ();
545+ const ampl::EntityMap<ampl::Set> map = _impl.getSets ();
546546 ampl::EntityMap<ampl::Set>::iterator begin = map.begin ();
547547 ampl::EntityMap<ampl::Set>::iterator end = map.end ();
548548 for (ampl::EntityMap<ampl::Set>::iterator itr = begin; itr != end; itr++){
549- list[itr->first ] = RSetEntity (itr-> second );
549+ list[itr->name () ] = RSetEntity (* itr);
550550 }
551551 return list;
552552}
@@ -559,11 +559,11 @@ Rcpp::List RAMPL::getSets() const {
559559*/
560560Rcpp::List RAMPL::getParameters () const {
561561 Rcpp::List list;
562- ampl::EntityMap<ampl::Parameter> map = _impl.getParameters ();
562+ const ampl::EntityMap<ampl::Parameter> map = _impl.getParameters ();
563563 ampl::EntityMap<ampl::Parameter>::iterator begin = map.begin ();
564564 ampl::EntityMap<ampl::Parameter>::iterator end = map.end ();
565565 for (ampl::EntityMap<ampl::Parameter>::iterator itr = begin; itr != end; itr++){
566- list[itr->first ] = RParameterEntity (itr-> second );
566+ list[itr->name () ] = RParameterEntity (* itr);
567567 }
568568 return list;
569569}
0 commit comments