[PPL-devel] [GIT] ppl/ppl(master): Shadowing avoided. Comments improved.
Roberto Bagnara
roberto.bagnara at bugseng.com
Sat Nov 29 21:00:19 CET 2014
Module: ppl/ppl
Branch: master
Commit: 7e35231d886889650dda6f14c7eb25fb9679694a
URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=7e35231d886889650dda6f14c7eb25fb9679694a
Author: Roberto Bagnara <roberto.bagnara at bugseng.com>
Date: Sat Nov 29 21:00:04 2014 +0100
Shadowing avoided. Comments improved.
---
src/Linear_Expression_defs.hh | 45 ++++++++++++++++++++-----------------
src/Linear_Expression_inlines.hh | 38 ++++++++++++++++----------------
src/MIP_Problem_defs.hh | 3 +-
src/MIP_Problem_inlines.hh | 4 +-
4 files changed, 47 insertions(+), 43 deletions(-)
diff --git a/src/Linear_Expression_defs.hh b/src/Linear_Expression_defs.hh
index af0284c..8892d1b 100644
--- a/src/Linear_Expression_defs.hh
+++ b/src/Linear_Expression_defs.hh
@@ -402,32 +402,32 @@ public:
//! The copy constructor.
/*!
- \param itr
+ \param i
The %iterator that will be copied.
This constructor takes \f$O(1)\f$ time.
*/
- const_iterator(const const_iterator& itr);
+ const_iterator(const const_iterator& i);
~const_iterator();
- //! Swaps itr with *this.
+ //! Swaps \p i with \p *this.
/*!
- \param itr
- The %iterator that will be swapped with *this.
+ \param i
+ The %iterator that will be swapped with \p *this.
This method takes \f$O(1)\f$ time.
*/
- void m_swap(const_iterator& itr);
+ void m_swap(const_iterator& i);
- //! Assigns \p itr to *this .
+ //! Assigns \p i to *this .
/*!
- \param itr
+ \param i
The %iterator that will be assigned into *this.
This method takes \f$O(1)\f$ time.
*/
- const_iterator& operator=(const const_iterator& itr);
+ const_iterator& operator=(const const_iterator& i);
//! Navigates to the next nonzero coefficient.
/*!
@@ -452,24 +452,24 @@ public:
*/
Variable variable() const;
- //! Compares \p *this with x .
+ //! Compares \p *this with \p i.
/*!
- \param x
+ \param i
The %iterator that will be compared with *this.
*/
- bool operator==(const const_iterator& x) const;
+ bool operator==(const const_iterator& i) const;
- //! Compares \p *this with x .
+ //! Compares \p *this with \p i .
/*!
\param x
The %iterator that will be compared with *this.
*/
- bool operator!=(const const_iterator& x) const;
+ bool operator!=(const const_iterator& i) const;
private:
//! Constructor from a const_iterator_interface*.
//! The new object takes ownership of the dynamic object.
- const_iterator(Linear_Expression_Interface::const_iterator_interface* itr);
+ const_iterator(Linear_Expression_Interface::const_iterator_interface* i);
Linear_Expression_Interface::const_iterator_interface* itr;
@@ -784,14 +784,17 @@ private:
Coefficient_traits::const_reference c2,
dimension_type start, dimension_type end) const;
- //! Sets `row' to a copy of the row that implements *this.
- void get_row(Dense_Row& row) const;
+ //! Sets \p row to a copy of the row that implements \p *this.
+ void get_row(Dense_Row& r) const;
- //! Sets `row' to a copy of the row that implements *this.
- void get_row(Sparse_Row& row) const;
+ //! Sets \p r to a copy of the row that implements \p *this.
+ void get_row(Sparse_Row& r) const;
- //! Returns true if there is a variable in [first,last) whose coefficient
- //! is nonzero in both *this and x.
+ /*! \brief
+ Returns \p true if there is a variable from index \p first (included)
+ to index \p last (excluded) whose coefficient is nonzero in both
+ \p *this and \p x.
+ */
bool have_a_common_variable(const Linear_Expression& x,
Variable first, Variable last) const;
diff --git a/src/Linear_Expression_inlines.hh b/src/Linear_Expression_inlines.hh
index d2f120c..9f6c5c1 100644
--- a/src/Linear_Expression_inlines.hh
+++ b/src/Linear_Expression_inlines.hh
@@ -551,14 +551,14 @@ Linear_Expression
inline void
Linear_Expression
-::get_row(Dense_Row& row) const {
- return impl->get_row(row);
+::get_row(Dense_Row& r) const {
+ return impl->get_row(r);
}
inline void
Linear_Expression
-::get_row(Sparse_Row& row) const {
- return impl->get_row(row);
+::get_row(Sparse_Row& r) const {
+ return impl->get_row(r);
}
inline void
@@ -626,27 +626,27 @@ Linear_Expression::const_iterator
inline
Linear_Expression::const_iterator
-::const_iterator(const const_iterator& x)
- : itr(x.itr->clone()) {
+::const_iterator(const const_iterator& i)
+ : itr(i.itr->clone()) {
}
inline
Linear_Expression::const_iterator
::~const_iterator() {
- // Note that this does nothing if itr==NULL.
+ // Note that this does nothing if itr == NULL.
delete itr;
}
inline void
-Linear_Expression::const_iterator::m_swap(const_iterator& x) {
+Linear_Expression::const_iterator::m_swap(const_iterator& i) {
using std::swap;
- swap(itr, x.itr);
+ swap(itr, i.itr);
}
inline Linear_Expression::const_iterator&
Linear_Expression::const_iterator
-::operator=(const const_iterator& itr) {
- const_iterator tmp = itr;
+::operator=(const const_iterator& i) {
+ const_iterator tmp = i;
using std::swap;
swap(*this, tmp);
return *this;
@@ -684,23 +684,23 @@ Linear_Expression::const_iterator
inline bool
Linear_Expression::const_iterator
-::operator==(const const_iterator& x) const {
+::operator==(const const_iterator& i) const {
PPL_ASSERT(itr != NULL);
- PPL_ASSERT(x.itr != NULL);
- return *itr == *(x.itr);
+ PPL_ASSERT(i.itr != NULL);
+ return *itr == *(i.itr);
}
inline bool
Linear_Expression::const_iterator
-::operator!=(const const_iterator& x) const {
- return !(*this == x);
+::operator!=(const const_iterator& i) const {
+ return !(*this == i);
}
inline
Linear_Expression::const_iterator
-::const_iterator(Linear_Expression_Interface::const_iterator_interface* itr)
- : itr(itr) {
- PPL_ASSERT(itr != NULL);
+::const_iterator(Linear_Expression_Interface::const_iterator_interface* i)
+ : itr(i) {
+ PPL_ASSERT(i != NULL);
}
inline Linear_Expression::const_iterator
diff --git a/src/MIP_Problem_defs.hh b/src/MIP_Problem_defs.hh
index a30173e..faa9ec4 100644
--- a/src/MIP_Problem_defs.hh
+++ b/src/MIP_Problem_defs.hh
@@ -242,6 +242,7 @@ public:
private:
typedef Constraint_Sequence::const_iterator Base;
typedef std::iterator_traits<Base> Base_Traits;
+
public:
typedef Base_Traits::iterator_category iterator_category;
typedef Base_Traits::difference_type difference_type;
@@ -298,7 +299,7 @@ public:
private:
//! Constructor from a Base iterator.
- explicit const_iterator(Base base);
+ explicit const_iterator(Base b);
//! The Base iterator on the Constraint_Sequence.
Base itr;
diff --git a/src/MIP_Problem_inlines.hh b/src/MIP_Problem_inlines.hh
index d415351..8fafceb 100644
--- a/src/MIP_Problem_inlines.hh
+++ b/src/MIP_Problem_inlines.hh
@@ -238,8 +238,8 @@ MIP_Problem::total_memory_in_bytes() const {
}
inline
-MIP_Problem::const_iterator::const_iterator(Base base)
- : itr(base) {
+MIP_Problem::const_iterator::const_iterator(Base b)
+ : itr(b) {
}
inline MIP_Problem::const_iterator::difference_type
More information about the PPL-devel
mailing list