Adds size() to RowVector.
authorTim King <taking@cs.nyu.edu>
Wed, 3 Nov 2010 18:46:46 +0000 (18:46 +0000)
committerTim King <taking@cs.nyu.edu>
Wed, 3 Nov 2010 18:46:46 +0000 (18:46 +0000)
src/theory/arith/row_vector.h

index efb64d1c72d5c436df009ef5b1e187fb34403626..a967f8d68fd7f5a2a63d00fe4ce3b6ef5fb6e260 100644 (file)
@@ -73,13 +73,16 @@ protected:
 
 public:
 
-  //RowVector() : d_entries() {}
-
   RowVector(const std::vector< ArithVar >& variables,
             const std::vector< Rational >& coefficients,
             std::vector<uint32_t>& counts);
 
 
+  /** Returns the number of nonzero variables in the vector. */
+  uint32_t size() const {
+    return d_entries.size();
+  }
+
   //Iterates over the nonzero entries in the Vector
   NonZeroIterator beginNonZero() const { return d_entries.begin(); }
   NonZeroIterator endNonZero() const { return d_entries.end(); }