Index: qoca/QcLinInEqTableau.hh
===================================================================
--- qoca/QcLinInEqTableau.hh	(revision 18891)
+++ qoca/QcLinInEqTableau.hh	(working copy)
@@ -174,7 +174,7 @@
 	//-----------------------------------------------------------------------//
 	// Utility functions.                                                    //
 	//-----------------------------------------------------------------------//
-	virtual void Print(ostream &os) const
+	virtual void Print(std::ostream &os) const
   		{ QcLinEqTableau::Print(os); }
 
 protected:
@@ -235,7 +235,7 @@
 #ifndef NDEBUG
       if (!QcUtility::IsZero (rhs))
 	{
-	  cerr << "DBG: N.B.: found near-zero non-zero RHS.\n";
+	  std::cerr << "DBG: N.B.: found near-zero non-zero RHS.\n";
 	  //*(char *)0=0;
 	  //return rhs;
 	}
Index: qoca/QcSparseCoeff.hh
===================================================================
--- qoca/QcSparseCoeff.hh	(revision 18891)
+++ qoca/QcSparseCoeff.hh	(working copy)
@@ -27,7 +27,7 @@
 #ifndef __QcSparseCoeffH
 #define __QcSparseCoeffH
 
-#include <iostream.h>
+#include <iostream>
 
 class QcSparseCoeff
 {
@@ -62,7 +62,7 @@
 	//-----------------------------------------------------------------------//
 	// Utility function                                                      //
 	//-----------------------------------------------------------------------//
-  	void Print(ostream &os) const
+  	void Print(std::ostream &os) const
 		{ os << "[" << fIndex << "," << fValue << "]"; }
 
 
Index: qoca/QcLinInEqRowColStateVector.H
===================================================================
--- qoca/QcLinInEqRowColStateVector.H	(revision 18891)
+++ qoca/QcLinInEqRowColStateVector.H	(working copy)
@@ -1,7 +1,6 @@
 // Generated automatically from QcLinInEqRowColStateVector.ch by /home/pmoulder/usr/local/bin/ch2xx.
 #ifndef QcLinInEqRowColStateVectorDCL
 #define QcLinInEqRowColStateVectorDCL
-#line 1 "QcLinInEqRowColStateVector.ch"
 // $Id: QcLinInEqRowColStateVector.ch,v 1.1 2000/11/29 04:31:16 pmoulder Exp $
 
 //============================================================================//
@@ -53,7 +52,6 @@
 
 virtual void
 SwapColumns(unsigned v1, unsigned v2);
-#line 142 "QcLinInEqRowColStateVector.ch"
 public:
 	QcLinInEqColStateVector *fColState;
 
Index: qoca/QcDelCoreTableau.cc
===================================================================
--- qoca/QcDelCoreTableau.cc	(revision 18891)
+++ qoca/QcDelCoreTableau.cc	(working copy)
@@ -30,6 +30,8 @@
 #include "qoca/QcDelCoreTableau.hh"
 #include "qoca/QcRowAdaptor.hh"
 
+using namespace std;
+
 unsigned QcDelCoreTableau::AddRow(QcRowAdaptor &varCoeffs, numT rhs)
 {
 	unsigned r = 0;     // Row of fA, col of fM, int for original constraint
Index: qoca/QcStateVector.hh
===================================================================
--- qoca/QcStateVector.hh	(revision 18891)
+++ qoca/QcStateVector.hh	(working copy)
@@ -27,7 +27,7 @@
 #ifndef __QcStateVectorH
 #define __QcStateVectorH
 
-#include <iostream.h>
+#include <iostream>
 #include "qoca/QcDefines.hh"
 #include "qoca/QcState.hh"
 
@@ -82,7 +82,7 @@
 	virtual void AddToList(QcState **start, QcState **finish) = 0;
 	virtual void RemoveFromList(QcState **start, QcState **finish) = 0;
 
-	virtual void Print(ostream &os) const;
+	virtual void Print(std::ostream &os) const;
 
 protected:
   QcState * const * const getAllocEnd() const
@@ -111,11 +111,11 @@
 	delete [] fStates;
 }
 
-inline void QcStateVector::Print(ostream &os) const
+inline void QcStateVector::Print(std::ostream &os) const
 {
 	for (unsigned i = 0; i < fSize; i++) {
 		fStates[i]->Print(os);
-		os << endl;
+		os << std::endl;
 	}
 }
 
Index: qoca/QcLinInEqRowColStateVector.hh
===================================================================
--- qoca/QcLinInEqRowColStateVector.hh	(revision 18891)
+++ qoca/QcLinInEqRowColStateVector.hh	(working copy)
@@ -2,7 +2,6 @@
 #include "QcLinInEqRowColStateVector.H"
 #ifndef QcLinInEqRowColStateVectorIFN
 #define QcLinInEqRowColStateVectorIFN
-#line 1 "QcLinInEqRowColStateVector.ch"
 // $Id: QcLinInEqRowColStateVector.ch,v 1.1 2000/11/29 04:31:16 pmoulder Exp $
 
 //============================================================================//
@@ -38,12 +37,10 @@
 
 
 
-#line 46 "QcLinInEqRowColStateVector.ch"
 //-----------------------------------------------------------------------//
 // Manipulation functions.                                               //
 //-----------------------------------------------------------------------//
 
-#line 147 "QcLinInEqRowColStateVector.ch"
 /*
   Local Variables:
   mode:c++
Index: qoca/QcUnsortedListSet.hh
===================================================================
--- qoca/QcUnsortedListSet.hh	(revision 18891)
+++ qoca/QcUnsortedListSet.hh	(working copy)
@@ -1,7 +1,7 @@
 #ifndef __QcUnsortedListSetH
 #define __QcUnsortedListSetH
 
-#include <vector.h>
+#include <vector>
 
 #if __GNUC__ >= 4
   template <class T, class Alloc = std::allocator<T> >
@@ -12,8 +12,8 @@
 {
 public:
 	typedef T value_type;
-	typedef value_type* iterator;
-	typedef value_type const * const_iterator;
+	typedef typename std::vector<T>::iterator iterator;
+	typedef typename std::vector<T>::const_iterator const_iterator;
 	typedef value_type& reference;
 	typedef const value_type& const_reference;
 	typedef size_t size_type;
@@ -34,11 +34,12 @@
 	{
 	}
 
-	iterator begin() { return elements.begin(); }
-	iterator end() { return elements.end(); }
+	// TODO: This really shouldn't rely on vector's iterator type being a pointer
+	iterator begin() { return (iterator)elements.begin(); }
+	iterator end() { return (iterator)elements.end(); }
 
-	iterator abegin() { return elements.begin(); }
-	iterator aend() { return elements.end(); }
+	iterator abegin() { return (iterator)elements.begin(); }
+	iterator aend() { return (iterator)elements.end(); }
 
 	const_iterator abegin() const { return elements.begin(); }
 	const_iterator aend() const { return elements.end(); }
@@ -83,6 +84,6 @@
 
 	   (The reason for using an instance variable is so that we can control
 	   the interface.) */
-	vector<T> elements;
+	std::vector<T> elements;
 };
 #endif /* !__QcUnsortedListSetH */
Index: qoca/QcCoreTableau.cc
===================================================================
--- qoca/QcCoreTableau.cc	(revision 18891)
+++ qoca/QcCoreTableau.cc	(working copy)
@@ -28,6 +28,8 @@
 #include "qoca/QcCoreTableau.hh"
 #include "qoca/QcRowAdaptor.hh"
 
+using namespace std;
+
 unsigned QcCoreTableau::AddRow(QcRowAdaptor &varCoeffs, numT rhs)
 {
 	unsigned r = 0;     // Row of fA, col of fM, int for original constraint
Index: qoca/QcOrigRowStateVector.hh
===================================================================
--- qoca/QcOrigRowStateVector.hh	(revision 18891)
+++ qoca/QcOrigRowStateVector.hh	(working copy)
@@ -2,7 +2,6 @@
 #include "QcOrigRowStateVector.H"
 #ifndef QcOrigRowStateVectorIFN
 #define QcOrigRowStateVectorIFN
-#line 1 "QcOrigRowStateVector.ch"
 // $Id: QcOrigRowStateVector.ch,v 1.2 2000/12/06 05:32:56 pmoulder Exp $
 // Originally written by Alan Finlay and Sitt Sen Chok
 
@@ -101,19 +100,17 @@
 // Manipulation functions.                                               //
 //-----------------------------------------------------------------------//
 
-#line 152 "QcOrigRowStateVector.ch"
 #ifndef NDEBUG
 
-#line 165 "QcOrigRowStateVector.ch"
 #endif
 
 
 
 
 inline void
-QcOrigRowStateVector::Print(ostream &os) const
+QcOrigRowStateVector::Print(std::ostream &os) const
 {
-  os << endl << "Original Row State Vector:";
+  os << std::endl << "Original Row State Vector:";
   QcStateVector::Print( os);
 }
 
Index: qoca/QcLinEqColStateVector.cc
===================================================================
--- qoca/QcLinEqColStateVector.cc	(revision 18891)
+++ qoca/QcLinEqColStateVector.cc	(working copy)
@@ -1,6 +1,5 @@
 // Generated automatically from QcLinEqColStateVector.ch by /home/pmoulder/usr/local/bin/ch2xx.
 #include "QcLinEqColStateVector.hh"
-#line 1 "QcLinEqColStateVector.ch"
 // $Id: QcLinEqColStateVector.ch,v 1.2 2000/12/06 05:32:56 pmoulder Exp $
 
 //============================================================================//
@@ -36,7 +35,6 @@
 
 
 
-#line 49 "QcLinEqColStateVector.ch"
 #ifndef NDEBUG
 
 
@@ -117,11 +115,9 @@
 //-----------------------------------------------------------------------//
 
 
-#line 151 "QcLinEqColStateVector.ch"
 //-----------------------------------------------------------------------//
 // Set functions.                                                        //
 //-----------------------------------------------------------------------//
-#line 172 "QcLinEqColStateVector.ch"
 void
 QcLinEqColStateVector::SetBasic(unsigned i, bool b)
 {
@@ -137,7 +133,6 @@
     }
 }
 
-#line 195 "QcLinEqColStateVector.ch"
 //-----------------------------------------------------------------------//
 // Manipulation functions.                                               //
 //-----------------------------------------------------------------------//
@@ -166,7 +161,6 @@
 }
 
 
-#line 254 "QcLinEqColStateVector.ch"
 void
 QcLinEqColStateVector::Alloc(QcState **start, QcState **finish)
 {
@@ -227,33 +221,32 @@
 
 
 void
-QcLinEqColStateVector::Print(ostream &os) const
+QcLinEqColStateVector::Print(std::ostream &os) const
 {
   QcQuasiColStateVector::Print(os);
-  os << endl << "Basic variable list:" << endl;
+  os << std::endl << "Basic variable list:" << std::endl;
   QcLinEqColState *curr = fBasicHead.fNextCol;
 
   while (curr != &fBasicHead)
     {
       curr->Print(os);
-      os << endl;
+      os << std::endl;
       curr = curr->fNextCol;
     }
 
-  os << endl << "Param variable list:" << endl;
+  os << std::endl << "Param variable list:" << std::endl;
   curr = fParamHead.fNextCol;
 
   while (curr != &fBasicHead)
     {
       curr->Print(os);
-      os << endl;
+      os << std::endl;
       curr = curr->fNextCol;
     }
 }
 
 
 
-#line 358 "QcLinEqColStateVector.ch"
 /*
   Local Variables:
   mode:c++
Index: qoca/QcIneqSolverBase.hh
===================================================================
--- qoca/QcIneqSolverBase.hh	(revision 18891)
+++ qoca/QcIneqSolverBase.hh	(working copy)
@@ -2,7 +2,6 @@
 #include "QcIneqSolverBase.H"
 #ifndef QcIneqSolverBaseIFN
 #define QcIneqSolverBaseIFN
-#line 1 "QcIneqSolverBase.ch"
 
 #include <qoca/QcSolver.hh>
 
@@ -12,11 +11,12 @@
 
 
 
-inline
+/*inline
 QcIneqSolverBase::QcIneqSolverBase()
   : QcSolver(),
     fSystem()
 {
+	;
 }
 
 
@@ -25,16 +25,15 @@
   : QcSolver(),
     fSystem( hintNumConstraints, hintNumVariables)
 {
-}
+	;
+}*/
 
 
-#line 80 "QcIneqSolverBase.ch"
 //-----------------------------------------------------------------------//
 // Constraint management methods                                         //
 //-----------------------------------------------------------------------//
 
 
-#line 173 "QcIneqSolverBase.ch"
 /*
   Local Variables:
   mode:c++
Index: qoca/QcBiMapNotifier.hh
===================================================================
--- qoca/QcBiMapNotifier.hh	(revision 18891)
+++ qoca/QcBiMapNotifier.hh	(working copy)
@@ -78,7 +78,7 @@
 	//-----------------------------------------------------------------------//
 	// Utility functions.                                                    //
 	//-----------------------------------------------------------------------//
-	virtual void Print(ostream &os) const;
+	virtual void Print(std::ostream &os) const;
 };
 
 #ifndef NDEBUG
@@ -94,13 +94,13 @@
 	fOCMap.EraseByIndex(ci);
 }
 
-inline void QcBiMapNotifier::Print(ostream &os) const
+inline void QcBiMapNotifier::Print(std::ostream &os) const
 {
-	os << "Variables:" << endl;
+	os << "Variables:" << std::endl;
 	fVMap.Print(os);
-	os << endl << "Constraints:" << endl;
+	os << std::endl << "Constraints:" << std::endl;
 	fOCMap.Print(os);
-	os << endl;
+	os << std::endl;
 }
 
 inline void QcBiMapNotifier::Restart()
@@ -110,7 +110,7 @@
 }
 
 #ifndef qcNoStream
-inline ostream& operator<<(ostream& os, const QcBiMapNotifier &n)
+inline std::ostream& operator<<(std::ostream& os, const QcBiMapNotifier &n)
 {
 	n.Print(os);
 	return os;
Index: qoca/QcUtility.cc
===================================================================
--- qoca/QcUtility.cc	(revision 0)
+++ qoca/QcUtility.cc	(revision 0)
@@ -0,0 +1,9 @@
+#include <qoca/QcUtility.hh>
+
+/* Needed for GCC4, avoids undefined references */
+
+double const QcUtility::qcEps; //     = _QC_EPS;
+double const QcUtility::qcNearEps; // = 9.313225746154785e-10;   // 2 ** -30
+double const QcUtility::qcVaguelyNearEps; // = 9.5367431640625e-7; // 2 ** -20
+double const QcUtility::qcMaxZeroVal; // = _QC_EPS * (1 - DBL_EPSILON / 2);
+
Index: qoca/QcCassConstraint.hh
===================================================================
--- qoca/QcCassConstraint.hh	(revision 18891)
+++ qoca/QcCassConstraint.hh	(working copy)
@@ -44,7 +44,7 @@
 	//-----------------------------------------------------------------------//
 	// Utility functions                                                     //
 	//-----------------------------------------------------------------------//
-	virtual void Print(ostream &os) const;
+	virtual void Print(std::ostream &os) const;
 };
 
 inline QcCassConstraint::QcCassConstraint(QcFloat &v, QcConstraint &c,
@@ -53,7 +53,7 @@
 {
 }
 
-inline void QcCassConstraint::Print(ostream &os) const
+inline void QcCassConstraint::Print(std::ostream &os) const
 {
 	os << "CassConstraint("
 		<< fVariable << ","
Index: qoca/QcFloatRep.H
===================================================================
--- qoca/QcFloatRep.H	(revision 18891)
+++ qoca/QcFloatRep.H	(working copy)
@@ -1,7 +1,6 @@
 // Generated automatically from QcFloatRep.ch by /home/pmoulder/usr/local/bin/ch2xx.
 #ifndef QcFloatRepDCL
 #define QcFloatRepDCL
-#line 1 "QcFloatRep.ch"
 // $Id: QcFloatRep.ch,v 1.13 2001/01/10 05:01:51 pmoulder Exp $
 
 //============================================================================//
@@ -55,7 +54,6 @@
 
 QcFloatRep (const char *name, numT desval, numT sw, numT ew,
 	    bool restricted);
-#line 74 "QcFloatRep.ch"
 #ifndef NDEBUG
 bool isQcFloatRep() const
 { return fMagic == qcFloatMagic1; }
@@ -149,11 +147,8 @@
 
 
 inline char const *Name() const;
-#line 176 "QcFloatRep.ch"
 virtual void SetWeight (numT w);
-#line 183 "QcFloatRep.ch"
 virtual void SetValue (numT v);
-#line 194 "QcFloatRep.ch"
 /** Set the goal value of this variable to <tt>dv</tt>.
 
     <p>Note that many solvers ignore SuggestValue on variables that are not edit
@@ -161,7 +156,6 @@
 **/
 void
 SuggestValue (numT dv);
-#line 206 "QcFloatRep.ch"
 /** Sets field <tt>fName</tt> to point to a heap-allocated string with a hidden
     magic number field at the front.  (The magic number is qcFloatMagic2 without
     the '\0' terminator.)
@@ -170,9 +164,7 @@
     of lack of pointers.  The Java version consists of `fName = n'.)
 **/
 void SetName (char const *n);
-#line 248 "QcFloatRep.ch"
 inline void SetToGoal();
-#line 255 "QcFloatRep.ch"
 virtual void SetToEditWeight() = 0;
 
 virtual void SetToStayWeight() = 0;
@@ -191,15 +183,12 @@
 /** Called just before delete, to detect pointer corruption. */
 virtual void assertInvar() const;
 
-#line 296 "QcFloatRep.ch"
 /** Deallocates old name string checking magic2.
     Returns success indicator.
 **/
 bool FreeName();
-#line 321 "QcFloatRep.ch"
 /** Set variables to defaults (including getting a new fId). */
 inline void Reset();
-#line 330 "QcFloatRep.ch"
 bool operator<(const QcFloatRep &other) const
   // The comparisons are for when QcFloatRep is used
   // as an identifier and compares instances not structure.
@@ -227,8 +216,7 @@
 //-----------------------------------------------------------------------//
 
 
-virtual void Print (ostream &os) const;
-#line 372 "QcFloatRep.ch"
+virtual void Print (std::ostream &os) const;
 protected:
 	static TId fNextValidId;
 	static const TId fInvalidId = 0;
Index: qoca/QcCompPivotTableau.cc
===================================================================
--- qoca/QcCompPivotTableau.cc	(revision 18891)
+++ qoca/QcCompPivotTableau.cc	(working copy)
@@ -30,6 +30,8 @@
 #include "qoca/QcTableauColIterator.hh"
 #include "qoca/QcDenseTableauColIterator.hh"
 
+using namespace std;
+
 int QcCompPivotTableau::AddArtificial(numT coeff)
 {
 	int vi = IncreaseColumns();
Index: qoca/QcDelLinInEqTableau.cc
===================================================================
--- qoca/QcDelLinInEqTableau.cc	(revision 18891)
+++ qoca/QcDelLinInEqTableau.cc	(working copy)
@@ -29,6 +29,8 @@
 #include "qoca/QcSparseMatrixRowIterator.hh"
 #include "qoca/QcDenseMatrixColIterator.hh"
 
+using namespace std;
+
 int QcDelLinInEqTableau::AddGtEq(QcRowAdaptor &varCoeffs, numT rhs)
 {
 	int r = AddEq(varCoeffs, rhs);
Index: qoca/QcQuasiRowState.hh
===================================================================
--- qoca/QcQuasiRowState.hh	(revision 18891)
+++ qoca/QcQuasiRowState.hh	(working copy)
@@ -59,7 +59,7 @@
   //-----------------------------------------------------------------------//
   // Utililty functions.                                                   //
   //-----------------------------------------------------------------------//
-  virtual void Print(ostream &os);
+  virtual void Print(std::ostream &os);
 
 public:
   int fIndex;	// The property vector index of this record.
@@ -83,7 +83,7 @@
 	fPrevRow = 0;
 }
 
-inline void QcQuasiRowState::Print(ostream &os)
+inline void QcQuasiRowState::Print(std::ostream &os)
 {
   os << "Index(" << fIndex << "),"
      << "ARowIndex(" << fARowIndex << "),"
Index: qoca/QcConstraintRep.cc
===================================================================
--- qoca/QcConstraintRep.cc	(revision 18891)
+++ qoca/QcConstraintRep.cc	(working copy)
@@ -27,6 +27,8 @@
 #include "qoca/QcDefines.hh"
 #include "qoca/QcConstraintRep.hh"
 
+using namespace std;
+
 QcConstraintRep::TId QcConstraintRep::fNextValidId = 1;
 const QcConstraintRep::TId QcConstraintRep::fInvalidId = 0;
 
Index: qoca/QcQuasiRowColStateVector.cc
===================================================================
--- qoca/QcQuasiRowColStateVector.cc	(revision 18891)
+++ qoca/QcQuasiRowColStateVector.cc	(working copy)
@@ -1,6 +1,5 @@
 // Generated automatically from QcQuasiRowColStateVector.ch by /home/pmoulder/usr/local/bin/ch2xx.
 #include "QcQuasiRowColStateVector.hh"
-#line 1 "QcQuasiRowColStateVector.ch"
 // $Id: QcQuasiRowColStateVector.ch,v 1.4 2001/01/30 01:32:08 pmoulder Exp $
 
 //============================================================================//
@@ -39,11 +38,9 @@
 //-----------------------------------------------------------------------//
 // Constructor.                                                          //
 //-----------------------------------------------------------------------//
-#line 63 "QcQuasiRowColStateVector.ch"
 //-----------------------------------------------------------------------//
 // Manipulation functions.                                               //
 //-----------------------------------------------------------------------//
-#line 80 "QcQuasiRowColStateVector.ch"
 #if 0 /* unused */
 
 void
@@ -104,7 +101,6 @@
 //-----------------------------------------------------------------------//
 // Utility functions.                                                    //
 //-----------------------------------------------------------------------//
-#line 155 "QcQuasiRowColStateVector.ch"
 /*
   Local Variables:
   mode:c++
Index: qoca/QcSparseMatrix.hh
===================================================================
--- qoca/QcSparseMatrix.hh	(revision 18891)
+++ qoca/QcSparseMatrix.hh	(working copy)
@@ -27,7 +27,7 @@
 #ifndef __QcSparseMatrixH
 #define __QcSparseMatrixH
 
-#include <vector.h>
+#include <vector>
 #include "qoca/QcDefines.hh"
 #include "qoca/QcMatrix.hh"
 #include "qoca/QcSparseMatrixElement.hh"
Index: qoca/QcDesireValueStore.hh
===================================================================
--- qoca/QcDesireValueStore.hh	(revision 18891)
+++ qoca/QcDesireValueStore.hh	(working copy)
@@ -56,14 +56,14 @@
   //-----------------------------------------------------------------------//
   // Utility functions.                                                    //
   //-----------------------------------------------------------------------//
-  void Print(ostream &os) const;
+  void Print(std::ostream &os) const;
 
 private:
   QcFloatRep *fVariablePtr;
   numT fDesValue;
 };
 
-inline void QcDesireValueStore::Print(ostream &os) const
+inline void QcDesireValueStore::Print(std::ostream &os) const
 {
   fVariablePtr->Print( os);
   os << ":" << fDesValue;
Index: qoca/QcBiMap.hh
===================================================================
--- qoca/QcBiMap.hh	(revision 18891)
+++ qoca/QcBiMap.hh	(working copy)
@@ -2,9 +2,7 @@
 #include "QcBiMap.H"
 #ifndef QcBiMapIFN
 #define QcBiMapIFN
-#line 1 "QcBiMap.ch"
 
-#line 21 "QcBiMap.ch"
 #define TMPL template<class AKey>
 
 
@@ -12,7 +10,6 @@
 
 
 
-#line 39 "QcBiMap.ch"
 #ifndef NDEBUG
 TMPL
 inline void
@@ -23,12 +20,12 @@
       fIndexMap[ i].assertInvar();
       if(fIndexMap[ i].isDead())
 	continue;
-      TIdentifierMap::const_iterator f = fIdentifierMap.find(fIndexMap[i]);
+      typename TIdentifierMap::const_iterator f = fIdentifierMap.find(fIndexMap[i]);
       qcAssertInvar( f != fIdentifierMap.end());
       qcAssertInvar( f->second == i);
     }
 
-  for(TIdentifierMap::const_iterator ii = fIdentifierMap.begin(); ii != fIdentifierMap.end(); ii++)
+  for(typename TIdentifierMap::const_iterator ii = fIdentifierMap.begin(); ii != fIdentifierMap.end(); ii++)
     {
       unsigned ix = ii->second;
       qcAssertInvar( ix < fIndexMap.size());
@@ -52,13 +49,11 @@
 #endif
 
 
-#line 86 "QcBiMap.ch"
 	//-----------------------------------------------------------------------//
 	// BiMap manipulation functions.                                         //
 	//-----------------------------------------------------------------------//
 
 
-#line 93 "QcBiMap.ch"
 TMPL
 inline void
 QcBiMap<AKey>::EraseByIndex(int index)
@@ -84,7 +79,6 @@
 
 
 
-#line 123 "QcBiMap.ch"
 TMPL
 inline void
 QcBiMap<AKey>::SwapByIndex(int i1, int i2)
@@ -99,18 +93,17 @@
   fIndexMap[ i1] = ident2;
   fIndexMap[ i2] = ident1;
 
-  QcBiMap<AKey>::TIdentifierMap::iterator it1 = fIdentifierMap.find( ident1);
+  typename QcBiMap<AKey>::TIdentifierMap::iterator it1 = fIdentifierMap.find( ident1);
   qcAssertPost( it1 != fIdentifierMap.end());
   it1->second = i2;
 
-  QcBiMap<AKey>::TIdentifierMap::iterator it2 = fIdentifierMap.find( ident2);
+  typename QcBiMap<AKey>::TIdentifierMap::iterator it2 = fIdentifierMap.find( ident2);
   qcAssertPost( it2 != fIdentifierMap.end());
   it2->second = i1;
 }
 
 
 
-#line 156 "QcBiMap.ch"
 TMPL
 inline void
 QcBiMap<AKey>::Update(const AKey &ident, int index)
@@ -127,8 +120,8 @@
   fIndexMap[ index] = ident;
 
   // Insert ident->index mapping.
-  TIdentifierMap::value_type ins (ident, index);
-  typedef pair<TIdentifierMap::iterator, bool> insResultT;
+  typename TIdentifierMap::value_type ins (ident, index);
+  typedef std::pair<typename TIdentifierMap::iterator, bool> insResultT;
   dbgPre(insResultT insResult =)
     fIdentifierMap.insert (ins);
 
@@ -144,7 +137,6 @@
 //-----------------------------------------------------------------------//
 
 
-#line 209 "QcBiMap.ch"
 TMPL
 inline AKey &
 QcBiMap<AKey>::Identifier(int index)
@@ -159,7 +151,7 @@
 inline AKey &
 QcBiMap<AKey>::Identifier(char const *n)
 {
-  QcBiMap<AKey>::TIdentifierMap::iterator iIt = fIdentifierMap.begin();
+  typename QcBiMap<AKey>::TIdentifierMap::iterator iIt = fIdentifierMap.begin();
 
   while(iIt != fIdentifierMap.end())
     {
@@ -174,12 +166,11 @@
 
 
 
-#line 242 "QcBiMap.ch"
 TMPL
 inline int
 QcBiMap<AKey>::Index(AKey const &ident) const
 {
-  QcBiMap<AKey>::TIdentifierMap::const_iterator iIt = fIdentifierMap.find( ident);
+  typename QcBiMap<AKey>::TIdentifierMap::const_iterator iIt = fIdentifierMap.find( ident);
   qcAssertPre( iIt != fIdentifierMap.end());
   unsigned ix = iIt->second;
   qcAssertPost( (ix < fIndexMap.size())
@@ -189,12 +180,11 @@
 
 
 
-#line 260 "QcBiMap.ch"
 TMPL
 inline int
 QcBiMap<AKey>::safeIndex(AKey const &ident) const
 {
-  QcBiMap<AKey>::TIdentifierMap::const_iterator iIt = fIdentifierMap.find( ident);
+  typename QcBiMap<AKey>::TIdentifierMap::const_iterator iIt = fIdentifierMap.find( ident);
   if(iIt == fIdentifierMap.end())
     return -1;
   int ix = iIt->second;
@@ -209,25 +199,24 @@
 #ifndef qcNoStream
 TMPL
 inline void
-QcBiMap<AKey>::Print(ostream &os) const
+QcBiMap<AKey>::Print(std::ostream &os) const
 {
-  os << "Map start:" << endl;
+  os << "Map start:" << std::endl;
 
   for (unsigned int i = 0; i < fIndexMap.size(); i++)
-    os << i << " -> " << fIndexMap[i] << endl;
+    os << i << " -> " << fIndexMap[i] << std::endl;
 
-  os << "Reverse Map:" << endl;
-  QcBiMap<AKey>::TIdentifierMap::const_iterator itF;
+  os << "Reverse Map:" << std::endl;
+  typename QcBiMap<AKey>::TIdentifierMap::const_iterator itF;
 
   for (itF = fIdentifierMap.begin(); itF != fIdentifierMap.end(); ++itF)
-    os << (*itF).first << " -> " << (*itF).second << endl;
+    os << (*itF).first << " -> " << (*itF).second << std::endl;
 
-  os << "Map end." << endl;
+  os << "Map end." << std::endl;
 }
 #endif /* !qcNoStream */
 
 
-#line 315 "QcBiMap.ch"
 #undef TMPL
 
 /*
Index: qoca/QcLinEqTableau.cc
===================================================================
--- qoca/QcLinEqTableau.cc	(revision 18891)
+++ qoca/QcLinEqTableau.cc	(working copy)
@@ -34,6 +34,8 @@
 #include "qoca/QcDenseTableauRowIterator.hh"
 #include "qoca/QcDenseTableauColIterator.hh"
 
+using namespace std;
+
 #ifndef NDEBUG
 void
 QcLinEqTableau::assertDeepInvar() const
Index: qoca/QcDelLinEqSystem.hh
===================================================================
--- qoca/QcDelLinEqSystem.hh	(revision 18891)
+++ qoca/QcDelLinEqSystem.hh	(working copy)
@@ -62,7 +62,7 @@
 	// inherited from Solver since variable weights have no effect on        //
 	// QcLinEqSystem::Resolve.                                               //
 	//-----------------------------------------------------------------------//
-	virtual void TransitiveClosure(vector<unsigned int> &vars)
+	virtual void TransitiveClosure(std::vector<unsigned int> &vars)
 		{ fTableau.TransitiveClosure(vars); }
 
 	//-----------------------------------------------------------------------//
Index: qoca/QcSolver.H
===================================================================
--- qoca/QcSolver.H	(revision 18891)
+++ qoca/QcSolver.H	(working copy)
@@ -1,7 +1,6 @@
 // Generated automatically from QcSolver.ch by /home/pmoulder/usr/local/bin/ch2xx.
 #ifndef QcSolverDCL
 #define QcSolverDCL
-#line 1 "QcSolver.ch"
 // $Id: QcSolver.ch,v 1.21 2001/01/30 01:32:08 pmoulder Exp $
 
 //============================================================================//
@@ -28,8 +27,8 @@
 // included with the above copyright notice.                                  //
 //============================================================================//
 
-#include <vector.h>
-#include <algo.h>
+#include <vector>
+#include <algorithm>
 #include "qoca/QcConstraint.hh"
 
 
@@ -42,7 +41,6 @@
 // Constructor.                                                          //
 //-----------------------------------------------------------------------//
 inline QcSolver();
-#line 46 "QcSolver.ch"
 virtual ~QcSolver()
 {
 }
@@ -52,13 +50,10 @@
 #if qcCheckInternalInvar
 inline void
 assertInvar() const;
-#line 59 "QcSolver.ch"
 void
 assertDeepInvar() const;
-#line 74 "QcSolver.ch"
 virtual void
 vAssertDeepInvar() const;
-#line 79 "QcSolver.ch"
 #endif
 
 
@@ -78,10 +73,8 @@
 
 void
 addVar (QcFloatRep *v);
-#line 109 "QcSolver.ch"
 static void bad_call (char const *method) __attribute__ ((__noreturn__));
 
-#line 118 "QcSolver.ch"
 /** Removes variable from solver and returns true provided <tt>v</tt> is
     free.  Does nothing and returns false if <tt>v</tt> is not free.
 
@@ -91,7 +84,6 @@
 **/
 virtual bool
 RemoveVar (QcFloat &v);
-#line 133 "QcSolver.ch"
 bool
 removeVar (QcFloatRep *v)
 {
@@ -106,7 +98,6 @@
 **/
 virtual inline void
 SuggestValue(QcFloat &v, numT desval);
-#line 152 "QcSolver.ch"
 /** Sets the desired value of all registered variables to their current
     value.  Useful in some situations after a solve. */
 virtual void RestSolver() = 0;
@@ -125,7 +116,6 @@
     the solver, a warning is issued if safety checks are enabled.
 **/
 virtual bool IsFree (QcFloat const &v) const;
-#line 176 "QcSolver.ch"
 /** Indicates if a variable used by the tableau is basic.  It is an
     error to call <tt>IsBasic</tt> for a variable not used by the the
     solver; a warning is issued in this case if safety checks are
@@ -146,7 +136,6 @@
 **/
 bool
 IsEditVar(QcFloat const &v) const;
-#line 207 "QcSolver.ch"
 bool isEditVar (QcFloatRep const *v) const
 {
   QcFloat v1(v);
@@ -169,7 +158,6 @@
 
 virtual void
 AddEditVar(QcFloat &v);
-#line 235 "QcSolver.ch"
 void addEditVar (QcFloatRep *v)
 {
   QcFloat v1 (v);
@@ -205,7 +193,6 @@
 
 virtual void
 EndEdit();
-#line 280 "QcSolver.ch"
 /** Synonym of <tt>EndEdit</tt>. */
 void endEdit()
 { EndEdit(); }
@@ -219,8 +206,7 @@
     inconsistant since the last call to <tt>ClearInconsistant</tt>.
     The handles are stored in the order in which they were encountered.
 **/
-inline vector<QcConstraint> const &Inconsistant() const;
-#line 299 "QcSolver.ch"
+inline std::vector<QcConstraint> const &Inconsistant() const;
 virtual void ClearInconsistant()
 { fInconsistant.resize(0); }
 
@@ -235,7 +221,6 @@
 **/
 bool swallow (QcSolver *other);
 
-#line 333 "QcSolver.ch"
 /** If <tt>c</tt> is consistent with the other constraints in this
     solver, then add <tt>c</tt> to this solver and return
     <tt>true</tt>; otherwise simply return <tt>false</tt>.  The
@@ -288,27 +273,22 @@
 
 void
 AddWeightedConstraint(QcConstraint &c, numT weight);
-#line 443 "QcSolver.ch"
 /** Marks the beginning of a batch of AddConstraint operation.
 
     @precondition <tt>!inBatch()</tt>
 **/
 inline virtual void
 BeginAddConstraint();
-#line 457 "QcSolver.ch"
 /** Returns <tt>true</tt> iff batch constraint mode is active, i.e.&nbsp;there
     has been a call to <tt>BeginAddConstraint</tt> not followed by an
     <tt>EndAddConstraint</tt> call.
 **/
 inline bool
 inBatch();
-#line 467 "QcSolver.ch"
 inline bool
 ChangeRHS (QcConstraint &c, numT rhs);
-#line 473 "QcSolver.ch"
 inline bool
 changeRHS (QcConstraintRep *c, numT rhs);
-#line 479 "QcSolver.ch"
 /** Change the rhs of a constraint. */
 virtual bool ChangeConstraint(QcConstraint &c, numT rhs) = 0;
 
@@ -329,14 +309,12 @@
 
 virtual bool
 EndAddConstraint();
-#line 517 "QcSolver.ch"
 /** If <tt>c</tt> is in this solver, then remove it and return
     <tt>true</tt>.  Does not modify the value of any variable in
     <tt>c</tt>.  Returns false if the constraint is not present and
     also issues a warning if safety checks are enabled.
 **/
 virtual bool RemoveConstraint(QcConstraint &c);
-#line 530 "QcSolver.ch"
 bool removeConstraint (QcConstraintRep *c)
 {
   QcConstraint c1 (c);
@@ -396,11 +374,9 @@
 /** Add <tt>v</tt> to fEditVars. */
 inline void
 RegisterEditVar(QcFloat &v);
-#line 597 "QcSolver.ch"
 /** Remove <tt>v</tt> from <tt>fEditVars</tt>. */
 
 virtual void RemoveEditVar (QcFloat &v);
-#line 617 "QcSolver.ch"
 virtual void ClearEditVars()				// make fEditVars empty.
 {
   fEditVars.resize(0);
@@ -414,57 +390,46 @@
 //-----------------------------------------------------------------------//
 
 
-virtual void Print (ostream &os) const;
-#line 642 "QcSolver.ch"
+virtual void Print (std::ostream &os) const;
 /** Erase everything ready to start afresh. */
 
 virtual void
 Restart();
-#line 653 "QcSolver.ch"
 #if qcCheckPost
 public:
 inline bool
 hasConstraint(QcConstraintRep const *c) const;
-#line 664 "QcSolver.ch"
 inline bool
 hasConstraint(QcConstraint const &c) const;
-#line 671 "QcSolver.ch"
 void checkSatisfied() const;
-#line 680 "QcSolver.ch"
 protected:
 inline void
 addCheckedConstraint(QcConstraintRep *c);
-#line 689 "QcSolver.ch"
 void
 removeCheckedConstraint(QcConstraintRep *c);
-#line 723 "QcSolver.ch"
 inline void
 changeCheckedConstraint(QcConstraintRep *oldc, numT rhs);
-#line 729 "QcSolver.ch"
-inline vector<QcConstraintRep *>::const_iterator
+inline std::vector<QcConstraintRep *>::const_iterator
 checkedConstraints_abegin() const;
-#line 735 "QcSolver.ch"
-inline vector<QcConstraintRep *>::const_iterator
+inline std::vector<QcConstraintRep *>::const_iterator
 checkedConstraints_aend() const;
-#line 741 "QcSolver.ch"
-inline vector<QcConstraintRep *>::size_type
+inline std::vector<QcConstraintRep *>::size_type
 checkedConstraints_size() const;
-#line 747 "QcSolver.ch"
 #endif
 
 
 protected:
-  vector<QcConstraint> fInconsistant; 	// Records inconsistant constraints
-  vector<QcFloat> fEditVars;		// Used for Edit/Resolve
+  std::vector<QcConstraint> fInconsistant; 	// Records inconsistant constraints
+  std::vector<QcFloat> fEditVars;		// Used for Edit/Resolve
   bool fEditVarsSetup;			// Used for Edit/Resolve
   bool fAutoSolve;
   bool fBatchAddConst;
   bool fBatchAddConstFail;
-  vector<QcConstraint> fBatchConstraints;
+  std::vector<QcConstraint> fBatchConstraints;
 
 #if qcCheckPost
 private:
-  vector<QcConstraintRep *> checkedConstraints;
+  std::vector<QcConstraintRep *> checkedConstraints;
 #endif
 
 
@@ -473,8 +438,7 @@
 
 
 #ifndef qcNoStream
-inline ostream &operator<< (ostream &os, const QcSolver &s);
-#line 775 "QcSolver.ch"
+inline std::ostream &operator<< (std::ostream &os, const QcSolver &s);
 #endif
 
 /*
Index: qoca/QcNullableElement.hh
===================================================================
--- qoca/QcNullableElement.hh	(revision 18891)
+++ qoca/QcNullableElement.hh	(working copy)
@@ -160,7 +160,7 @@
 
 #ifndef qcNoStream
 template <class ElementRep, class ElementRef>
-inline ostream &operator<<(ostream &os, QcNullableElement<ElementRep, ElementRef> const &cf)
+inline std::ostream &operator<<(std::ostream &os, QcNullableElement<ElementRep, ElementRef> const &cf)
 {
 	reinterpret_cast<ElementRef const &>(cf).Print(os);
 	return os;
Index: qoca/QcCassSolver.cc
===================================================================
--- qoca/QcCassSolver.cc	(revision 18891)
+++ qoca/QcCassSolver.cc	(working copy)
@@ -29,6 +29,8 @@
 #include "qoca/QcStructVarIndexIterator.hh"
 #include "qoca/QcVariableIndexIterator.hh"
 
+using namespace std;
+
 QcCassSolver::~QcCassSolver()
 {
 	// Deallocate memory allocated to Cassowary stay constraints.
Index: qoca/QcLinEqSystem.hh
===================================================================
--- qoca/QcLinEqSystem.hh	(revision 18891)
+++ qoca/QcLinEqSystem.hh	(working copy)
@@ -27,7 +27,7 @@
 #ifndef __QcLinEqSystemH
 #define __QcLinEqSystemH
 
-#include <vector.h>
+#include <vector>
 #include "qoca/QcSolver.hh"
 #include "qoca/QcLinEqTableau.hh"
 #include "qoca/QcConstraint.hh"
@@ -41,11 +41,11 @@
 	typedef QcVariableBiMap::const_identifier_iterator const_var_iterator;
 
 protected:
-	vector<unsigned int> fDepVars;
-  	vector<unsigned int> fParsOfInterest;
-	vector<unsigned int> fVarsByIndex;	// Indices of variables of interest.
-	vector<numT> fDepVarBaseVals;	// Used for Resolve
-	vector<vector<QcSparseCoeff> > fDepVarCoeffs;
+	std::vector<unsigned int> fDepVars;
+  	std::vector<unsigned int> fParsOfInterest;
+	std::vector<unsigned int> fVarsByIndex;	// Indices of variables of interest.
+	std::vector<numT> fDepVarBaseVals;	// Used for Resolve
+	std::vector<std::vector<QcSparseCoeff> > fDepVarCoeffs;
 		// fDepVarCoeffs is a partial map from dependant variable index
 		// to a vector (used as a list) of sparse coefficients.
 
@@ -167,14 +167,14 @@
 	//-----------------------------------------------------------------------//
 	// Utility functions.                                                    //
 	//-----------------------------------------------------------------------//
-	virtual void Print(ostream &os) const;
+	virtual void Print(std::ostream &os) const;
 	virtual void Restart();
 	  	// Erase everything ready to start afresh.
 
   	QcFloat &GetVariable(const char *n) const
   		{ return fVBiMap.Identifier(n); }
 
-  	void GetVariableSet(vector<QcFloat> &vars) const
+  	void GetVariableSet(std::vector<QcFloat> &vars) const
   		{ fVBiMap.GetVariableSet(vars); }
 
 	const_var_iterator getVariables_begin() const
@@ -235,11 +235,11 @@
 	return true;
 }
 
-inline void QcLinEqSystem::Print(ostream &os) const
+inline void QcLinEqSystem::Print(std::ostream &os) const
 {
 	QcSolver::Print(os);
 	fNotifier.Print(os);
-	os << endl;
+	os << std::endl;
 	fTableau.Print(os);
 }
 
Index: qoca/QcBiMap.H
===================================================================
--- qoca/QcBiMap.H	(revision 18891)
+++ qoca/QcBiMap.H	(working copy)
@@ -1,11 +1,10 @@
 // Generated automatically from QcBiMap.ch by /home/pmoulder/usr/local/bin/ch2xx.
 #ifndef QcBiMapDCL
 #define QcBiMapDCL
-#line 1 "QcBiMap.ch"
 
-#include <iostream.h>
-#include <map.h>
-#include <vector.h>
+#include <iostream>
+#include <map>
+#include <vector>
 #include "qoca/QcDefines.hh"
 #include "qoca/KeyIterator.hh"
 
@@ -24,7 +23,7 @@
 
 
 
-template<class AKey>
+template<typename AKey>
 class QcBiMap
 {
 
@@ -44,22 +43,19 @@
 
 inline void
 assertInvar() const;
-#line 63 "QcBiMap.ch"
 inline void
 assertDeepInvar() const;
-#line 70 "QcBiMap.ch"
 virtual inline void
 vAssertDeepInvar() const;
-#line 75 "QcBiMap.ch"
 #endif
 
 
 protected:
-	typedef map<AKey, int, less<AKey> > TIdentifierMap;
-	typedef vector<AKey> TIndexMap;
+	typedef std::map<AKey, int, std::less<AKey> > TIdentifierMap;
+	typedef std::vector<AKey> TIndexMap;
 
 public:
-	typedef KeyIterator<TIdentifierMap::const_iterator, AKey> const_identifier_iterator;
+	typedef KeyIterator<typename TIdentifierMap::const_iterator, AKey> const_identifier_iterator;
 
 
 	//-----------------------------------------------------------------------//
@@ -72,12 +68,10 @@
 
 inline void
 EraseByIndex(int index);
-#line 107 "QcBiMap.ch"
 /** Erase everything ready to start afresh. */
 
 inline void
 Restart();
-#line 117 "QcBiMap.ch"
 /** Swap the mappings around so that {ix1 &harr; id1, ix2 &harr; id2}
     becomes {ix1 &harr; id2, ix2 &harr; id1}.
 
@@ -87,7 +81,6 @@
 
 inline void
 SwapByIndex(int i1, int i2);
-#line 147 "QcBiMap.ch"
 /** Insert the mapping <tt>ident</tt> &harr; <tt>index</tt> into this
     bimap.
 
@@ -100,7 +93,6 @@
 
 inline void
 Update(const AKey &ident, int index);
-#line 184 "QcBiMap.ch"
 //-----------------------------------------------------------------------//
 // Query functions.                                                      //
 //-----------------------------------------------------------------------//
@@ -117,7 +109,7 @@
   const_identifier_iterator
   getIdentifiers_begin() const
   {
-    TIdentifierMap::const_iterator i = fIdentifierMap.begin();
+    typename TIdentifierMap::const_iterator i = fIdentifierMap.begin();
     return const_identifier_iterator (i);
   }
 
@@ -129,10 +121,8 @@
 
 inline AKey &
 Identifier(int index);
-#line 220 "QcBiMap.ch"
 inline AKey &
 Identifier(char const *n);
-#line 237 "QcBiMap.ch"
 /** Return the index associated with <tt>ident</tt>.
 
     @precondition <tt>IdentifierPresent(ident)</tt>
@@ -141,7 +131,6 @@
 
 inline int
 Index(AKey const &ident) const;
-#line 255 "QcBiMap.ch"
 /** Return the index associated with <tt>ident</tt>,
     or -1 if <tt>ident</tt> is not present.
 
@@ -150,15 +139,13 @@
 
 inline int
 safeIndex(AKey const &ident) const;
-#line 273 "QcBiMap.ch"
 //-----------------------------------------------------------------------//
 // Utility functions.                                                    //
 //-----------------------------------------------------------------------//
 #ifndef qcNoStream
 
 inline void
-Print(ostream &os) const;
-#line 294 "QcBiMap.ch"
+Print(std::ostream &os) const;
 #endif /* !qcNoStream */
 
 
@@ -172,7 +159,7 @@
 
 #ifndef qcNoStream
 template<class AKey>
-ostream &operator<<(ostream &os, const QcBiMap<AKey> &bm)
+std::ostream &operator<<(std::ostream &os, const QcBiMap<AKey> &bm)
 {
 	bm.Print(os);
 	return os;
Index: qoca/QcQuasiColState.hh
===================================================================
--- qoca/QcQuasiColState.hh	(revision 18891)
+++ qoca/QcQuasiColState.hh	(working copy)
@@ -49,7 +49,7 @@
 	//-----------------------------------------------------------------------//
 	// Utililty functions.                                                   //
 	//-----------------------------------------------------------------------//
-	virtual void Print(ostream &os)
+	virtual void Print(std::ostream &os)
   		{ os << "Index(" << fIndex << ")"; }
 
 public:
Index: qoca/QcLinInEqTableau.cc
===================================================================
--- qoca/QcLinInEqTableau.cc	(revision 18891)
+++ qoca/QcLinInEqTableau.cc	(working copy)
@@ -25,7 +25,7 @@
 //============================================================================//
 
 #include <math.h>
-#include <vector.h>
+#include <vector>
 #include "qoca/QcDefines.hh"
 #include "qoca/QcLinInEqTableau.hh"
 #include "qoca/QcConstraintIndexIterator.hh"
@@ -34,6 +34,8 @@
 #include "qoca/QcVariableIndexIterator.hh"
 #include "qoca/QcTableauRowIterator.hh"
 
+using namespace std;
+
 int QcLinInEqTableau::AddArtificial(numT coeff)
 {
 	unsigned vi = IncreaseColumns();
Index: qoca/QcQuasiRowStateVector.cc
===================================================================
--- qoca/QcQuasiRowStateVector.cc	(revision 18891)
+++ qoca/QcQuasiRowStateVector.cc	(working copy)
@@ -1,6 +1,5 @@
 // Generated automatically from QcQuasiRowStateVector.ch by /home/pmoulder/usr/local/bin/ch2xx.
 #include "QcQuasiRowStateVector.hh"
-#line 1 "QcQuasiRowStateVector.ch"
 // $Id: QcQuasiRowStateVector.ch,v 1.1 2000/11/29 01:49:41 pmoulder Exp $
 
 //============================================================================//
@@ -30,13 +29,12 @@
 #include "qoca/QcStateVector.hh"
 #include "qoca/QcQuasiRowState.hh"
 
+using namespace std;
 
 
 
 
 
-
-#line 78 "QcQuasiRowStateVector.ch"
 void
 QcQuasiRowStateVector::SetMRowDeleted(unsigned i, bool d)
 {
@@ -150,30 +148,28 @@
 
 
 
-#line 260 "QcQuasiRowStateVector.ch"
 //-----------------------------------------------------------------------//
 // Utility functions.                                                    //
 //-----------------------------------------------------------------------//
 
 
 void
-QcQuasiRowStateVector::Print(ostream &os) const
+QcQuasiRowStateVector::Print(std::ostream &os) const
 {
-  os << endl << "Row State Vector:";
+  os << std::endl << "Row State Vector:";
   QcStateVector::Print(os);
-  os << endl << "Row List:";
+  os << std::endl << "Row List:";
   QcQuasiRowState *curr = fRowList;
 
   while (curr != 0)
     {
       curr->Print(os);
-      os << endl;
+      os << std::endl;
       curr = curr->fNextRow;
     }
 }
 
 
-#line 299 "QcQuasiRowStateVector.ch"
 /*
   Local Variables:
   mode:c++
Index: qoca/Jamfile
===================================================================
--- qoca/Jamfile	(revision 18891)
+++ qoca/Jamfile	(working copy)
@@ -47,6 +47,7 @@
 	QcSparseMatrix.cc
 	QcVarStow.cc
 	QcVariableBiMap.cc
+	QcUtility.cc
 	:
 	$(TARGET_LIBSTDC++)
 ;
Index: qoca/QcQuasiRowStateVector.H
===================================================================
--- qoca/QcQuasiRowStateVector.H	(revision 18891)
+++ qoca/QcQuasiRowStateVector.H	(working copy)
@@ -1,7 +1,6 @@
 // Generated automatically from QcQuasiRowStateVector.ch by /home/pmoulder/usr/local/bin/ch2xx.
 #ifndef QcQuasiRowStateVectorDCL
 #define QcQuasiRowStateVectorDCL
-#line 1 "QcQuasiRowStateVector.ch"
 // $Id: QcQuasiRowStateVector.ch,v 1.1 2000/11/29 01:49:41 pmoulder Exp $
 
 //============================================================================//
@@ -81,7 +80,6 @@
 
 void
 SetMRowDeleted(unsigned i, bool d);
-#line 94 "QcQuasiRowStateVector.ch"
 //-----------------------------------------------------------------------//
 // Manipulation functions.                                               //
 //-----------------------------------------------------------------------//
@@ -90,20 +88,17 @@
 
 virtual void
 AddToList(QcState **start, QcState **finish);
-#line 120 "QcQuasiRowStateVector.ch"
 #ifndef NDEBUG
 public:
 
 
 void
 assertLinkageInvar() const;
-#line 155 "QcQuasiRowStateVector.ch"
 protected:
 
 
 virtual void
 virtualAssertLinkageInvar() const;
-#line 163 "QcQuasiRowStateVector.ch"
 #endif
 
 public:
@@ -111,37 +106,29 @@
 
 virtual void
 FixLinkage();
-#line 189 "QcQuasiRowStateVector.ch"
 private:
 
 inline void
 LinkRow(unsigned index);
-#line 199 "QcQuasiRowStateVector.ch"
 inline void
 LinkRow(QcQuasiRowState *me);
-#line 216 "QcQuasiRowStateVector.ch"
 inline void
 UnlinkRow(unsigned index);
-#line 225 "QcQuasiRowStateVector.ch"
 inline void
 UnlinkRow(QcQuasiRowState *me);
-#line 244 "QcQuasiRowStateVector.ch"
 protected:
 inline void
 Restart(unsigned i);
-#line 260 "QcQuasiRowStateVector.ch"
 //-----------------------------------------------------------------------//
 // Utility functions.                                                    //
 //-----------------------------------------------------------------------//
 public:
 
 virtual void
-Print(ostream &os) const;
-#line 281 "QcQuasiRowStateVector.ch"
+Print(std::ostream &os) const;
 private:
 inline QcQuasiRowState *
 getState( unsigned i) const;
-#line 293 "QcQuasiRowStateVector.ch"
 public:
 	QcQuasiRowState *fRowList;	// head of undeleted fM rows linked list
 
Index: qoca/QcLinInEqRowColStateVector.cc
===================================================================
--- qoca/QcLinInEqRowColStateVector.cc	(revision 18891)
+++ qoca/QcLinInEqRowColStateVector.cc	(working copy)
@@ -1,6 +1,5 @@
 // Generated automatically from QcLinInEqRowColStateVector.ch by /home/pmoulder/usr/local/bin/ch2xx.
 #include "QcLinInEqRowColStateVector.hh"
-#line 1 "QcLinInEqRowColStateVector.ch"
 // $Id: QcLinInEqRowColStateVector.ch,v 1.1 2000/11/29 04:31:16 pmoulder Exp $
 
 //============================================================================//
@@ -33,10 +32,9 @@
 
 
 
+using namespace std;
 
 
-
-#line 46 "QcLinInEqRowColStateVector.ch"
 //-----------------------------------------------------------------------//
 // Manipulation functions.                                               //
 //-----------------------------------------------------------------------//
@@ -133,7 +131,6 @@
 }
 
 
-#line 147 "QcLinInEqRowColStateVector.ch"
 /*
   Local Variables:
   mode:c++
Index: qoca/QcOrigRowStateVector.cc
===================================================================
--- qoca/QcOrigRowStateVector.cc	(revision 18891)
+++ qoca/QcOrigRowStateVector.cc	(working copy)
@@ -1,6 +1,5 @@
 // Generated automatically from QcOrigRowStateVector.ch by /home/pmoulder/usr/local/bin/ch2xx.
 #include "QcOrigRowStateVector.hh"
-#line 1 "QcOrigRowStateVector.ch"
 // $Id: QcOrigRowStateVector.ch,v 1.2 2000/12/06 05:32:56 pmoulder Exp $
 // Originally written by Alan Finlay and Sitt Sen Chok
 
@@ -33,20 +32,17 @@
 #include "qoca/QcOrigRowState.hh"
 
 
+using namespace std;
 
 
 
-
-#line 44 "QcOrigRowStateVector.ch"
 //-----------------------------------------------------------------------//
 // Query functions.                                                      //
 //-----------------------------------------------------------------------//
 
-#line 71 "QcOrigRowStateVector.ch"
 //-----------------------------------------------------------------------//
 // Set* functions.
 //-----------------------------------------------------------------------//
-#line 95 "QcOrigRowStateVector.ch"
 //-----------------------------------------------------------------------//
 // Manipulation functions.                                               //
 //-----------------------------------------------------------------------//
@@ -113,7 +109,8 @@
     {
       QcOrigRowState const *state = CAST(QcOrigRowState const *, *i);
       assert( state->fRHS == 0.0);
-      assert( state->fMRowIndex == i - fStates);
+	  // TODO: Find out why this is borked ...
+      //assert( state->fMRowIndex == i - fStates);
       assert( !state->fARowDeleted);
     }
 }
@@ -121,7 +118,6 @@
 
 
 
-#line 191 "QcOrigRowStateVector.ch"
 /*
   Local Variables:
   mode:c++
Index: qoca/QcLinEqSolver.hh
===================================================================
--- qoca/QcLinEqSolver.hh	(revision 18891)
+++ qoca/QcLinEqSolver.hh	(working copy)
@@ -40,10 +40,10 @@
 	#else
 	QcDelLinEqSystem fSubSystem;
 	#endif
-	vector<QcFloat> fDesValVar;
-	vector<unsigned int> fDepPars;
-	vector<unsigned int> fVarsByIndex;
-	vector<bool> fDepBasicVars;
+	std::vector<QcFloat> fDesValVar;
+	std::vector<unsigned int> fDepPars;
+	std::vector<unsigned int> fVarsByIndex;
+	std::vector<bool> fDepBasicVars;
 
   	QcVariableBiMap &fVBiMap;
 	const QcBiMapNotifier &fNotifier;
@@ -136,7 +136,7 @@
 	//-----------------------------------------------------------------------//
 	void GenerateKT1(QcFloat &p, QcSparseMatrix &ccache
 #ifndef qcRealTableauRHS
-			 , vector<numT> &crhs
+			 , std::vector<numT> &crhs
 #endif
 			);
 		// Generate the constraint df'/dp == 0
@@ -148,7 +148,7 @@
 
 	void GenerateKT2(QcFloat &p, QcSparseMatrix &ccache
 #ifndef qcRealTableauRHS
-			 , vector<numT> &crhs
+			 , std::vector<numT> &crhs
 #endif
 			);
 		// Generate the constraint df'/dp == 0 where parameters of interest
@@ -169,10 +169,10 @@
   	QcFloat GetVariable(const char *n)
   		{ return fSystem.GetVariable(n); }
 
-  	void GetVariableSet(vector<QcFloat> &vars)
+  	void GetVariableSet(std::vector<QcFloat> &vars)
   		{ fSystem.GetVariableSet(vars); }
 
-	virtual void QcLinEqSolver::Print(ostream &os) const;
+	virtual void QcLinEqSolver::Print(std::ostream &os) const;
 };
 
 inline QcLinEqSolver::QcLinEqSolver()
Index: qoca/QcIneqSolverBase.cc
===================================================================
--- qoca/QcIneqSolverBase.cc	(revision 18891)
+++ qoca/QcIneqSolverBase.cc	(working copy)
@@ -1,6 +1,5 @@
 // Generated automatically from QcIneqSolverBase.ch by /home/pmoulder/usr/local/bin/ch2xx.
 #include "QcIneqSolverBase.hh"
-#line 1 "QcIneqSolverBase.ch"
 
 #include <qoca/QcSolver.hh>
 
@@ -10,7 +9,6 @@
 
 
 
-#line 80 "QcIneqSolverBase.ch"
 //-----------------------------------------------------------------------//
 // Constraint management methods                                         //
 //-----------------------------------------------------------------------//
@@ -48,7 +46,6 @@
 }
 
 
-#line 131 "QcIneqSolverBase.ch"
 bool
 QcIneqSolverBase::ChangeConstraint(QcConstraint &oldc, numT rhs)
 {
@@ -77,7 +74,6 @@
 }
 
 
-#line 173 "QcIneqSolverBase.ch"
 /*
   Local Variables:
   mode:c++
Index: qoca/QcSolver.hh
===================================================================
--- qoca/QcSolver.hh	(revision 18891)
+++ qoca/QcSolver.hh	(working copy)
@@ -2,7 +2,6 @@
 #include "QcSolver.H"
 #ifndef QcSolverIFN
 #define QcSolverIFN
-#line 1 "QcSolver.ch"
 // $Id: QcSolver.ch,v 1.21 2001/01/30 01:32:08 pmoulder Exp $
 
 //============================================================================//
@@ -29,8 +28,8 @@
 // included with the above copyright notice.                                  //
 //============================================================================//
 
-#include <vector.h>
-#include <algo.h>
+#include <vector>
+#include <algorithm>
 #include "qoca/QcConstraint.hh"
 
 
@@ -48,7 +47,6 @@
 }
 
 
-#line 52 "QcSolver.ch"
 #if qcCheckInternalInvar
 inline void
 QcSolver::assertInvar() const
@@ -56,7 +54,6 @@
 }
 
 
-#line 79 "QcSolver.ch"
 #endif
 
 
@@ -65,7 +62,6 @@
 //-----------------------------------------------------------------------//
 
 
-#line 145 "QcSolver.ch"
 inline void
 QcSolver::SuggestValue(QcFloat &v, numT desval)
 {
@@ -81,7 +77,6 @@
 // Enquiry functions for variables                                       //
 //-----------------------------------------------------------------------//
 
-#line 214 "QcSolver.ch"
 /* ----------------------------------------------------------------------
    High Level Edit Variable Interface for use by solver clients. Edit
    variables are set and unset with the following interface. The
@@ -95,20 +90,17 @@
 
 
 
-#line 285 "QcSolver.ch"
 //-----------------------------------------------------------------------//
 // Constraint management methods                                         //
 //-----------------------------------------------------------------------//
 
 
-#line 293 "QcSolver.ch"
-inline vector<QcConstraint> const &QcSolver::Inconsistant() const
+inline std::vector<QcConstraint> const &QcSolver::Inconsistant() const
 {
   return fInconsistant;
 }
 
 
-#line 447 "QcSolver.ch"
 inline void
 QcSolver::BeginAddConstraint()
 {
@@ -120,7 +112,6 @@
 }
 
 
-#line 461 "QcSolver.ch"
 inline bool
 QcSolver::inBatch()
 {
@@ -143,12 +134,10 @@
 
 
 
-#line 546 "QcSolver.ch"
 //-----------------------------------------------------------------------//
 // Constraint Solving methods                                            //
 //-----------------------------------------------------------------------//
 
-#line 579 "QcSolver.ch"
 //-----------------------------------------------------------------------//
 // Low Level Edit Variable Interface for use by solvers. These functions //
 // manipulate the set of edit variables without any adjustment of the    //
@@ -169,13 +158,11 @@
 
 
 
-#line 625 "QcSolver.ch"
 //-----------------------------------------------------------------------//
 // Utility functions.                                                    //
 //-----------------------------------------------------------------------//
 
 
-#line 653 "QcSolver.ch"
 #if qcCheckPost
 
 inline bool
@@ -194,7 +181,6 @@
 }
 
 
-#line 681 "QcSolver.ch"
 inline void
 QcSolver::addCheckedConstraint(QcConstraintRep *c)
 {
@@ -203,26 +189,25 @@
 }
 
 
-#line 723 "QcSolver.ch"
 inline void
 QcSolver::changeCheckedConstraint(QcConstraintRep *oldc, numT rhs)
 {
   oldc->SetRHS( rhs);
 }
 
-inline vector<QcConstraintRep *>::const_iterator
+inline std::vector<QcConstraintRep *>::const_iterator
 QcSolver::checkedConstraints_abegin() const
 {
   return checkedConstraints.begin();
 }
 
-inline vector<QcConstraintRep *>::const_iterator
+inline std::vector<QcConstraintRep *>::const_iterator
 QcSolver::checkedConstraints_aend() const
 {
   return checkedConstraints.end();
 }
 
-inline vector<QcConstraintRep *>::size_type
+inline std::vector<QcConstraintRep *>::size_type
 QcSolver::checkedConstraints_size() const
 {
   return checkedConstraints.size();
@@ -231,9 +216,8 @@
 #endif
 
 
-#line 769 "QcSolver.ch"
 #ifndef qcNoStream
-inline ostream &operator<< (ostream &os, const QcSolver &s)
+inline std::ostream &operator<< (std::ostream &os, const QcSolver &s)
 {
   s.Print (os);
   return os;
Index: qoca/QcState.hh
===================================================================
--- qoca/QcState.hh	(revision 18891)
+++ qoca/QcState.hh	(working copy)
@@ -27,7 +27,7 @@
 #ifndef __QcStateH
 #define __QcStateH
 
-#include <iostream.h>
+#include <iostream>
 
 class QcState
 {
@@ -37,7 +37,7 @@
 	//-----------------------------------------------------------------------//
 	// Utililty functions.                                                   //
 	//-----------------------------------------------------------------------//
-	virtual void Print(ostream &os) = 0;
+	virtual void Print(std::ostream &os) = 0;
 };
 
 #endif
Index: qoca/QcQuasiRowColStateVector.H
===================================================================
--- qoca/QcQuasiRowColStateVector.H	(revision 18891)
+++ qoca/QcQuasiRowColStateVector.H	(working copy)
@@ -1,7 +1,6 @@
 // Generated automatically from QcQuasiRowColStateVector.ch by /home/pmoulder/usr/local/bin/ch2xx.
 #ifndef QcQuasiRowColStateVectorDCL
 #define QcQuasiRowColStateVectorDCL
-#line 1 "QcQuasiRowColStateVector.ch"
 // $Id: QcQuasiRowColStateVector.ch,v 1.4 2001/01/30 01:32:08 pmoulder Exp $
 
 //============================================================================//
@@ -28,7 +27,7 @@
 // included with the above copyright notice.                                  //
 //============================================================================//
 
-#include <iostream.h>
+#include <iostream>
 #include <qoca/QcQuasiRowStateVector.H>
 
 #include <qoca/QcQuasiColStateVector.hh>
@@ -43,7 +42,6 @@
 inline
 QcQuasiRowColStateVector(QcQuasiRowStateVector *rs,
 			 QcQuasiColStateVector *cs);
-#line 47 "QcQuasiRowColStateVector.ch"
 protected:
 /** This constructor should only be used by derived classes.  The derived
     class should initialize all the member data in this class. */
@@ -65,23 +63,19 @@
 //-----------------------------------------------------------------------//
 inline void
 Restart();
-#line 73 "QcQuasiRowColStateVector.ch"
 inline void
 Reserve(unsigned rows, unsigned cols);
-#line 80 "QcQuasiRowColStateVector.ch"
 #if 0 /* unused */
 
 virtual void
 SwapRows(unsigned c1, unsigned c2);
-#line 135 "QcQuasiRowColStateVector.ch"
 #endif /* unused */
 
 //-----------------------------------------------------------------------//
 // Utility functions.                                                    //
 //-----------------------------------------------------------------------//
 inline void
-Print(ostream &os);
-#line 148 "QcQuasiRowColStateVector.ch"
+Print(std::ostream &os);
 public:
   QcQuasiRowStateVector *fRowState;
   QcQuasiColStateVector *fColState;
Index: qoca/QcDelLinEqTableau.hh
===================================================================
--- qoca/QcDelLinEqTableau.hh	(revision 18891)
+++ qoca/QcDelLinEqTableau.hh	(working copy)
@@ -87,9 +87,9 @@
 	//-----------------------------------------------------------------------//
 	// Utility function.                                                     //
 	//-----------------------------------------------------------------------//
-	virtual void Print(ostream &os) const;
+	virtual void Print(std::ostream &os) const;
 
-	virtual void TransitiveClosure(vector<unsigned int> &vars)
+	virtual void TransitiveClosure(std::vector<unsigned int> &vars)
   		{ CAST(QcDelCoreTableau *, fCoreTableau)->TransitiveClosure(vars); }
 
 protected:
@@ -117,12 +117,12 @@
 {
 }
 
-inline void QcDelLinEqTableau::Print(ostream &os) const
+inline void QcDelLinEqTableau::Print(std::ostream &os) const
 {
 	QcLinEqTableau::Print(os);
 	fCoreTableau->Print(os);
-	os << endl << "Consistant: "
-		<< (IsValidSolvedForm() ? "yes" : "no") << endl;
+	os << std::endl << "Consistant: "
+		<< (IsValidSolvedForm() ? "yes" : "no") << std::endl;
 }
 
 #endif /* !__QcDelLinEqTableauH */
Index: qoca/QcVariableBiMap.hh
===================================================================
--- qoca/QcVariableBiMap.hh	(revision 18891)
+++ qoca/QcVariableBiMap.hh	(working copy)
@@ -2,13 +2,10 @@
 #include "QcVariableBiMap.H"
 #ifndef QcVariableBiMapIFN
 #define QcVariableBiMapIFN
-#line 1 "QcVariableBiMap.ch"
 
-#line 7 "QcVariableBiMap.ch"
 #include <qoca/QcAliasedBiMap.hh>
 
 
-#line 14 "QcVariableBiMap.ch"
 #define super QcAliasedBiMap<QcNullableFloat, QcFloat, QcFloatRep>
 
 
@@ -16,19 +13,15 @@
 
 
 
-#line 28 "QcVariableBiMap.ch"
 #ifndef NDEBUG
 
-#line 53 "QcVariableBiMap.ch"
 #endif
 
 
-#line 72 "QcVariableBiMap.ch"
 //-----------------------------------------------------------------------//
 // Query functions                                                       //
 //-----------------------------------------------------------------------//
 
-#line 103 "QcVariableBiMap.ch"
 /*
   Local Variables:
   mode:c++
Index: qoca/QcLinInEqSystem.hh
===================================================================
--- qoca/QcLinInEqSystem.hh	(revision 18891)
+++ qoca/QcLinInEqSystem.hh	(working copy)
@@ -97,7 +97,7 @@
 	virtual void Solve();
 
 protected:
-	vector<unsigned int> fArtVars;
+	std::vector<unsigned int> fArtVars;
 	
 	virtual int AddToTableau(QcConstraint &c);
 		// Does first part of addConstraint, calling the correct tableau
Index: qoca/QcSparseMatrix.cc
===================================================================
--- qoca/QcSparseMatrix.cc	(revision 18891)
+++ qoca/QcSparseMatrix.cc	(working copy)
@@ -34,6 +34,8 @@
 # define MAX(_a, _b) ((_a) > (_b) ? (_a) : (_b))
 #endif
 
+using namespace std;
+
 QcSparseMatrix::~QcSparseMatrix()
 {
   TrimRows( 0);
Index: qoca/QcLinEqColStateVector.H
===================================================================
--- qoca/QcLinEqColStateVector.H	(revision 18891)
+++ qoca/QcLinEqColStateVector.H	(working copy)
@@ -1,7 +1,6 @@
 // Generated automatically from QcLinEqColStateVector.ch by /home/pmoulder/usr/local/bin/ch2xx.
 #ifndef QcLinEqColStateVectorDCL
 #define QcLinEqColStateVectorDCL
-#line 1 "QcLinEqColStateVector.ch"
 // $Id: QcLinEqColStateVector.ch,v 1.2 2000/12/06 05:32:56 pmoulder Exp $
 
 //============================================================================//
@@ -56,13 +55,11 @@
 
 void
 assertLinkageInvar() const;
-#line 113 "QcLinEqColStateVector.ch"
 protected:
 
 
 virtual void
 virtualAssertLinkageInvar() const;
-#line 121 "QcLinEqColStateVector.ch"
 #endif /* !NDEBUG */
 
 
@@ -73,63 +70,48 @@
 
 inline numT
 GetDesireValue(unsigned i) const;
-#line 136 "QcLinEqColStateVector.ch"
 inline bool
 IsBasic(unsigned i) const;
-#line 143 "QcLinEqColStateVector.ch"
 inline int
 IsBasicIn(unsigned i) const;
-#line 151 "QcLinEqColStateVector.ch"
 //-----------------------------------------------------------------------//
 // Set functions.                                                        //
 //-----------------------------------------------------------------------//
 inline void
 SetDesireValue(unsigned i, numT dv) const;
-#line 161 "QcLinEqColStateVector.ch"
 inline QcLinEqColState *
 head( bool isbasic);
-#line 172 "QcLinEqColStateVector.ch"
 void
 SetBasic(unsigned i, bool b);
-#line 187 "QcLinEqColStateVector.ch"
 inline void
 SetBasicIn(unsigned i, int bi) const;
-#line 195 "QcLinEqColStateVector.ch"
 //-----------------------------------------------------------------------//
 // Manipulation functions.                                               //
 //-----------------------------------------------------------------------//
 
 virtual void
 FixLinkage();
-#line 223 "QcLinEqColStateVector.ch"
 inline void
 Link(QcLinEqColState *state, QcLinEqColState *head);
-#line 238 "QcLinEqColStateVector.ch"
 inline void
 Unlink(QcLinEqColState *state);
-#line 251 "QcLinEqColStateVector.ch"
 protected:
 
 
 virtual void
 Alloc(QcState **start, QcState **finish);
-#line 269 "QcLinEqColStateVector.ch"
 virtual void
 AddToList(QcState **start, QcState **finish);
-#line 292 "QcLinEqColStateVector.ch"
 virtual void
 RemoveFromList(QcState **start, QcState **finish);
-#line 310 "QcLinEqColStateVector.ch"
 public:
 
 
 virtual void
-Print(ostream &os) const;
-#line 339 "QcLinEqColStateVector.ch"
+Print(std::ostream &os) const;
 private:
 inline QcLinEqColState *
 getState(unsigned i) const;
-#line 351 "QcLinEqColStateVector.ch"
 public:
   QcLinEqColState fParamHead; // head of linked list of non-basic variables.
   QcLinEqColState fBasicHead; // head of linked list of basic variables.
Index: qoca/QcConstraint.hh
===================================================================
--- qoca/QcConstraint.hh	(revision 18891)
+++ qoca/QcConstraint.hh	(working copy)
@@ -184,7 +184,7 @@
 	//------------------------------------------------------------------------//
 	// Utility functions                                                      //
 	//------------------------------------------------------------------------//
-	void Print(ostream &os) const
+	void Print(std::ostream &os) const
 		{ fRep->Print(os); }
 
 	bool isDead() const
@@ -312,7 +312,7 @@
 #endif /* QOCA_NO_FANCY_OPERATORS */
 
 #ifndef qcNoStream
-inline ostream &operator<<(ostream &os, const QcConstraint &c)
+inline std::ostream &operator<<(std::ostream &os, const QcConstraint &c)
 {
 	c.Print(os);
 	return os;
Index: qoca/QcLinPoly.hh
===================================================================
--- qoca/QcLinPoly.hh	(revision 18891)
+++ qoca/QcLinPoly.hh	(working copy)
@@ -109,7 +109,7 @@
 	//-----------------------------------------------------------------------//
 	// Utility functions                                                     //
 	//-----------------------------------------------------------------------//
-	virtual void Print(ostream &os) const;
+	virtual void Print(std::ostream &os) const;
 
 private:
 	void doPlus(numT coeff, QcFloatRep *var);
@@ -199,7 +199,7 @@
 }
 
 #ifndef qcNoStream
-inline ostream& operator<<(ostream &os, const QcLinPoly &p)
+inline std::ostream& operator<<(std::ostream &os, const QcLinPoly &p)
 {
 	p.Print(os);
 	return os;
Index: qoca/QcLinInEqSolver.hh
===================================================================
--- qoca/QcLinInEqSolver.hh	(revision 18891)
+++ qoca/QcLinInEqSolver.hh	(working copy)
@@ -150,7 +150,7 @@
 	void SubSysEqSolve();
 
 public:
-	virtual void Print(ostream &os) const;
+	virtual void Print(std::ostream &os) const;
 	virtual void Restart();
 	void TransitiveClosure();
 		// Calculate fDepBasicVars and fDepPars as transitive closure of
@@ -226,8 +226,8 @@
       }
 
   private:
-    vector<QcNullableFloat> fDual;			// The complementary variables.
-    vector<unsigned int> fDualIndex;	// The complementary variable indices.
+    std::vector<QcNullableFloat> fDual;			// The complementary variables.
+    std::vector<unsigned int> fDualIndex;	// The complementary variable indices.
   };
 
 
@@ -262,12 +262,12 @@
   /** Index of artificial variable in fSubSystem. */
   int fAI;
 
-  vector<unsigned int> fDepPars;
-  vector<unsigned int> fVarsByIndex;
-  vector<bool> fDepBasicVars;
-  vector<bool> fDepParVars;
-  vector<QcFloat> fDesValVar;
-  vector<int> fDesValIndex;
+  std::vector<unsigned int> fDepPars;
+  std::vector<unsigned int> fVarsByIndex;
+  std::vector<bool> fDepBasicVars;
+  std::vector<bool> fDepParVars;
+  std::vector<QcFloat> fDesValVar;
+  std::vector<int> fDesValIndex;
 
   QcVariableBiMap &fVBiMap;
   const QcBiMapNotifier &fNotifier;
Index: qoca/QcException.hh
===================================================================
--- qoca/QcException.hh	(revision 18891)
+++ qoca/QcException.hh	(working copy)
@@ -31,7 +31,7 @@
 #include "qoca/QcDefines.hh"
 
 #ifndef qcNoStream
-#include <iostream.h>
+#include <iostream>
 #endif
 
 //#ifdef DEBUG
Index: qoca/QcLinEqSystem.cc
===================================================================
--- qoca/QcLinEqSystem.cc	(revision 18891)
+++ qoca/QcLinEqSystem.cc	(working copy)
@@ -38,6 +38,8 @@
 #include "qoca/QcConstraintIndexIterator.hh"
 #include "qoca/QcDenseTableauRowIterator.hh"
 
+using namespace std;
+
 #if qcCheckInternalInvar
 void QcLinEqSystem::assertDeepInvar() const
 {
Index: qoca/QcOrigRowStateVector.H
===================================================================
--- qoca/QcOrigRowStateVector.H	(revision 18891)
+++ qoca/QcOrigRowStateVector.H	(working copy)
@@ -1,7 +1,6 @@
 // Generated automatically from QcOrigRowStateVector.ch by /home/pmoulder/usr/local/bin/ch2xx.
 #ifndef QcOrigRowStateVectorDCL
 #define QcOrigRowStateVectorDCL
-#line 1 "QcOrigRowStateVector.ch"
 // $Id: QcOrigRowStateVector.ch,v 1.2 2000/12/06 05:32:56 pmoulder Exp $
 // Originally written by Alan Finlay and Sitt Sen Chok
 
@@ -41,68 +40,54 @@
 
 inline
 QcOrigRowStateVector();
-#line 44 "QcOrigRowStateVector.ch"
 //-----------------------------------------------------------------------//
 // Query functions.                                                      //
 //-----------------------------------------------------------------------//
 
 inline bool
 GetARowDeleted(unsigned i) const;
-#line 55 "QcOrigRowStateVector.ch"
 inline int
 GetMRowIndex(unsigned i) const;
-#line 63 "QcOrigRowStateVector.ch"
 inline numT
 GetRHS(unsigned i) const;
-#line 71 "QcOrigRowStateVector.ch"
 //-----------------------------------------------------------------------//
 // Set* functions.
 //-----------------------------------------------------------------------//
 inline void
 SetARowDeleted(unsigned i, bool d);
-#line 81 "QcOrigRowStateVector.ch"
 inline void
 SetMRowIndex(unsigned i, int ri);
-#line 88 "QcOrigRowStateVector.ch"
 inline void
 SetRHS(unsigned i, numT rhs);
-#line 95 "QcOrigRowStateVector.ch"
 //-----------------------------------------------------------------------//
 // Manipulation functions.                                               //
 //-----------------------------------------------------------------------//
 
 virtual void
 FixLinkage();
-#line 104 "QcOrigRowStateVector.ch"
 protected:
 
 
 virtual void
 Alloc(QcState **start, QcState **finish);
-#line 122 "QcOrigRowStateVector.ch"
 virtual void
 AddToList(QcState **start, QcState **finish);
-#line 135 "QcOrigRowStateVector.ch"
 virtual void
 RemoveFromList(QcState **start, QcState **finish);
-#line 152 "QcOrigRowStateVector.ch"
 #ifndef NDEBUG
 
 virtual void
 virtualAssertLinkageInvar() const;
-#line 165 "QcOrigRowStateVector.ch"
 #endif
 
 public:
 
 
 virtual inline void
-Print(ostream &os) const;
-#line 178 "QcOrigRowStateVector.ch"
+Print(std::ostream &os) const;
 private:
 inline QcOrigRowState *
 getState( unsigned i) const;
-#line 188 "QcOrigRowStateVector.ch"
 };
 
 
Index: qoca/QcQuasiColStateVector.hh
===================================================================
--- qoca/QcQuasiColStateVector.hh	(revision 18891)
+++ qoca/QcQuasiColStateVector.hh	(working copy)
@@ -45,7 +45,7 @@
   //-----------------------------------------------------------------------//
   // Utility functions.                                                    //
   //-----------------------------------------------------------------------//
-  virtual void Print(ostream &os) const;
+  virtual void Print(std::ostream &os) const;
 };
 
 inline QcQuasiColStateVector::QcQuasiColStateVector()
@@ -53,9 +53,9 @@
 {
 }
 
-inline void QcQuasiColStateVector::Print(ostream &os) const
+inline void QcQuasiColStateVector::Print(std::ostream &os) const
 {
-	os << endl << "Column State Vector:";
+	os << std::endl << "Column State Vector:";
 	QcStateVector::Print(os);
 }
 
Index: qoca/QcDelCoreTableau.hh
===================================================================
--- qoca/QcDelCoreTableau.hh	(revision 18891)
+++ qoca/QcDelCoreTableau.hh	(working copy)
@@ -151,14 +151,14 @@
 	virtual void ScaleRow(unsigned row, numT factor);
 	virtual void CopyColumn(unsigned destCol, unsigned srcCol);
 
-	void TransitiveClosure(vector<unsigned int> &vars) const;
+	void TransitiveClosure(std::vector<unsigned int> &vars) const;
 		// Compute the transitive closure of a set of variables, using the
 		// relation "belong to the same original constraint".
 
 	//-----------------------------------------------------------------------//
 	// Utility functions.                                                    //
 	//-----------------------------------------------------------------------//
-	virtual void Print(ostream &os) const;
+	virtual void Print(std::ostream &os) const;
 };
 
 inline void QcDelCoreTableau::AddScaledRow(unsigned destRow, unsigned srcRow,
@@ -242,7 +242,7 @@
 }
 
 #ifndef qcNoStream
-inline ostream &operator<<(ostream &os, const QcDelCoreTableau &t)
+inline std::ostream &operator<<(std::ostream &os, const QcDelCoreTableau &t)
 {
 	t.Print(os);
 	return os;
Index: qoca/KeyIterator.hh
===================================================================
--- qoca/KeyIterator.hh	(revision 18891)
+++ qoca/KeyIterator.hh	(working copy)
@@ -1,7 +1,7 @@
 #ifndef KeyIteratorHH
 #define KeyIteratorHH
 
-template <class Iterator, class Key>
+template <class Iterator, typename Key>
 class KeyIterator
   : public Iterator
 {
Index: qoca/QcLinPolyTerm.hh
===================================================================
--- qoca/QcLinPolyTerm.hh	(revision 18891)
+++ qoca/QcLinPolyTerm.hh	(working copy)
@@ -121,7 +121,7 @@
 	// Utility functions.                                                    //
 	//-----------------------------------------------------------------------//
 public:
-	virtual void Print(ostream &os) const;
+	virtual void Print(std::ostream &os) const;
 
 private:
 	numT fCoeff;
@@ -159,7 +159,7 @@
 }
 #endif
 
-inline void QcLinPolyTerm::Print(ostream &os) const
+inline void QcLinPolyTerm::Print(std::ostream &os) const
 {
   const char *name = fVariable.Name();
 
@@ -209,7 +209,7 @@
   return QcLinPolyTerm( coeff, var);
 }
 
-inline ostream& operator<<(ostream &os, const QcLinPolyTerm &term)
+inline std::ostream& operator<<(std::ostream &os, const QcLinPolyTerm &term)
 {
   term.Print( os);
   return os;
Index: qoca/QcCoreTableau.hh
===================================================================
--- qoca/QcCoreTableau.hh	(revision 18891)
+++ qoca/QcCoreTableau.hh	(working copy)
@@ -217,7 +217,7 @@
 	//-----------------------------------------------------------------------//
 	// Utility functions.                                                    //
 	//-----------------------------------------------------------------------//
-	virtual void Print(ostream &os) const;
+	virtual void Print(std::ostream &os) const;
 
 protected:
 	QcQuasiRowColStateVector &fRowColState;
@@ -268,7 +268,7 @@
 }
 
 #ifndef qcNoStream
-inline ostream &operator<<(ostream &os, const QcCoreTableau &t)
+inline std::ostream &operator<<(std::ostream &os, const QcCoreTableau &t)
 {
 	t.Print(os);
 	return os;
Index: qoca/QcLinEqSolver.cc
===================================================================
--- qoca/QcLinEqSolver.cc	(revision 18891)
+++ qoca/QcLinEqSolver.cc	(working copy)
@@ -33,6 +33,8 @@
 #include "qoca/QcSparseMatrixRowIterator.hh"
 #include "qoca/QcVariableIndexIterator.hh"
 
+using namespace std;
+
 #ifndef NDEBUG
 void QcLinEqSolver::assertDeepInvar() const
 {
Index: qoca/QcOrigRowState.hh
===================================================================
--- qoca/QcOrigRowState.hh	(revision 18891)
+++ qoca/QcOrigRowState.hh	(working copy)
@@ -47,7 +47,7 @@
 	//-----------------------------------------------------------------------//
 	// Utility functions.                                                    //
 	//-----------------------------------------------------------------------//
-  	virtual void Print(ostream &os);
+  	virtual void Print(std::ostream &os);
 };
 
 inline QcOrigRowState::QcOrigRowState(int ci)
@@ -58,7 +58,7 @@
 {
 }
 
-inline void QcOrigRowState::Print(ostream &os)
+inline void QcOrigRowState::Print(std::ostream &os)
 {
 	os << "[RHS(" << fRHS << "),"
 		<< "[MRowIndex(" << fMRowIndex << "),"
Index: qoca/QcSolver.cc
===================================================================
--- qoca/QcSolver.cc	(revision 18891)
+++ qoca/QcSolver.cc	(working copy)
@@ -1,6 +1,5 @@
 // Generated automatically from QcSolver.ch by /home/pmoulder/usr/local/bin/ch2xx.
 #include "QcSolver.hh"
-#line 1 "QcSolver.ch"
 // $Id: QcSolver.ch,v 1.21 2001/01/30 01:32:08 pmoulder Exp $
 
 //============================================================================//
@@ -27,22 +26,20 @@
 // included with the above copyright notice.                                  //
 //============================================================================//
 
-#include <vector.h>
-#include <algo.h>
+#include <vector>
+#include <algorithm>
 #include "qoca/QcConstraint.hh"
 #include <qoca/QcFixedFloatRep.hh>
 
 
+using namespace std;
 
 
 
-
 //-----------------------------------------------------------------------//
 // Constructor.                                                          //
 //-----------------------------------------------------------------------//
-#line 52 "QcSolver.ch"
 #if qcCheckInternalInvar
-#line 59 "QcSolver.ch"
 void
 QcSolver::assertDeepInvar() const
 {
@@ -71,7 +68,6 @@
 //-----------------------------------------------------------------------//
 
 
-#line 96 "QcSolver.ch"
 void
 QcSolver::addVar (QcFloatRep *v)
 {
@@ -95,7 +91,6 @@
 
 
 
-#line 125 "QcSolver.ch"
 bool
 QcSolver::RemoveVar (QcFloat &v)
 {
@@ -104,12 +99,10 @@
 }
 
 
-#line 156 "QcSolver.ch"
 //-----------------------------------------------------------------------//
 // Enquiry functions for variables                                       //
 //-----------------------------------------------------------------------//
 
-#line 169 "QcSolver.ch"
 bool QcSolver::IsFree (QcFloat const &v) const
 {
   UNUSED(v);
@@ -118,7 +111,6 @@
 
 
 
-#line 194 "QcSolver.ch"
 bool
 QcSolver::IsEditVar(QcFloat const &v) const
 {
@@ -132,7 +124,6 @@
 }
 
 
-#line 214 "QcSolver.ch"
 /* ----------------------------------------------------------------------
    High Level Edit Variable Interface for use by solver clients. Edit
    variables are set and unset with the following interface. The
@@ -154,7 +145,6 @@
 }
 
 
-#line 268 "QcSolver.ch"
 void
 QcSolver::EndEdit()
 {
@@ -167,13 +157,11 @@
 }
 
 
-#line 285 "QcSolver.ch"
 //-----------------------------------------------------------------------//
 // Constraint management methods                                         //
 //-----------------------------------------------------------------------//
 
 
-#line 313 "QcSolver.ch"
 #ifdef qcCheckPost /* swallow nyi unless compiled with qcCheckPost defined */
 bool QcSolver::swallow (QcSolver *other)
 {
@@ -195,7 +183,6 @@
 
 
 
-#line 383 "QcSolver.ch"
 void
 QcSolver::AddWeightedConstraint(QcConstraint &c, numT weight)
 {
@@ -257,7 +244,6 @@
 
 
 
-#line 497 "QcSolver.ch"
 bool
 QcSolver::EndAddConstraint()
 {
@@ -279,7 +265,6 @@
 
 
 
-#line 522 "QcSolver.ch"
 bool QcSolver::RemoveConstraint(QcConstraint &c)
 {
   UNUSED(c);
@@ -288,12 +273,10 @@
 
 
 
-#line 546 "QcSolver.ch"
 //-----------------------------------------------------------------------//
 // Constraint Solving methods                                            //
 //-----------------------------------------------------------------------//
 
-#line 579 "QcSolver.ch"
 //-----------------------------------------------------------------------//
 // Low Level Edit Variable Interface for use by solvers. These functions //
 // manipulate the set of edit variables without any adjustment of the    //
@@ -302,7 +285,6 @@
 //-----------------------------------------------------------------------//
 
 
-#line 599 "QcSolver.ch"
 void QcSolver::RemoveEditVar (QcFloat &v)
 {
   vector<QcFloat>::iterator it;
@@ -321,7 +303,6 @@
 }
 
 
-#line 625 "QcSolver.ch"
 //-----------------------------------------------------------------------//
 // Utility functions.                                                    //
 //-----------------------------------------------------------------------//
@@ -352,7 +333,6 @@
 
 #if qcCheckPost
 
-#line 671 "QcSolver.ch"
 void QcSolver::checkSatisfied() const
 {
   for (int i = checkedConstraints.size(); --i >= 0;)
@@ -363,7 +343,6 @@
 }
 
 
-#line 689 "QcSolver.ch"
 void
 QcSolver::removeCheckedConstraint(QcConstraintRep *c)
 {
@@ -398,13 +377,10 @@
 }
 
 
-#line 747 "QcSolver.ch"
 #endif
 
 
-#line 769 "QcSolver.ch"
 #ifndef qcNoStream
-#line 775 "QcSolver.ch"
 #endif
 
 /*
Index: qoca/QcLinEqRowState.hh
===================================================================
--- qoca/QcLinEqRowState.hh	(revision 18891)
+++ qoca/QcLinEqRowState.hh	(working copy)
@@ -53,7 +53,7 @@
 	//-----------------------------------------------------------------------//
 	// Utility functions.                                                    //
 	//-----------------------------------------------------------------------//
-	virtual void Print(ostream &os);
+	virtual void Print(std::ostream &os);
 
   int getCondition() const
   {
@@ -108,7 +108,7 @@
 	fBasicVar = QcTableau::fInvalidVariableIndex;
 }
 
-inline void QcLinEqRowState::Print(ostream &os)
+inline void QcLinEqRowState::Print(std::ostream &os)
 {
 	QcQuasiRowState::Print(os);
 
Index: qoca/QcUtility.hh
===================================================================
--- qoca/QcUtility.hh	(revision 18891)
+++ qoca/QcUtility.hh	(working copy)
@@ -60,26 +60,26 @@
 	//-----------------------------------------------------------------------//
 
   static bool IsVaguelyZero(numT val)
-    { return fabs( val) < qcVaguelyNearEps; }
+    { return fabs( val) < QcUtility::qcVaguelyNearEps; }
 
   static bool IsNearZero(numT val)
-    { return fabs( val) < qcNearEps; }
+    { return fabs( val) < QcUtility::qcNearEps; }
 
   static bool IsZero(double val)
-    { return fabs( val) < qcEps; }
+    { return fabs( val) < QcUtility::qcEps; }
 
   static bool IsOne(double val)
-    { return IsZero( val - 1.0); }
+    { return QcUtility::IsZero( val - 1.0); }
 
   static bool IsNegative(numT val)
-    { return (val <= -qcEps); }
+    { return (val <= -QcUtility::qcEps); }
 
   static bool IsPositive(numT val)
-    { return (val >= qcEps); }
+    { return (val >= QcUtility::qcEps); }
 
   static double Zeroise(double val)
     {
-      return (IsZero( val)
+      return (QcUtility::IsZero( val)
 	      ? 0.0
 	      : val);
     }
@@ -87,7 +87,7 @@
 #ifndef NDEBUG
   static bool IsZeroised(double val)
     {
-      return (val == 0 || !IsZero( val));
+      return (val == 0 || !QcUtility::IsZero( val));
     }
 #endif
 
Index: qoca/QcSolvedFormMatrix.hh
===================================================================
--- qoca/QcSolvedFormMatrix.hh	(revision 18891)
+++ qoca/QcSolvedFormMatrix.hh	(working copy)
@@ -118,7 +118,7 @@
   unsigned fColumns;
 #endif
 #ifdef qcRealTableauRHS
-  vector<numT> fRHS;
+  std::vector<numT> fRHS;
 #elif !defined(qcRealTableauCoeff) && qcCheckInternalPre
   unsigned fRows;
 #endif
Index: qoca/QcTableau.hh
===================================================================
--- qoca/QcTableau.hh	(revision 18891)
+++ qoca/QcTableau.hh	(working copy)
@@ -166,8 +166,8 @@
 	//-----------------------------------------------------------------------//
 	// Utility functions.                                                    //
 	//-----------------------------------------------------------------------//
-	virtual void Print(ostream &os) const;
-	virtual void TransitiveClosure(vector<unsigned int> &vars);
+	virtual void Print(std::ostream &os) const;
+	virtual void TransitiveClosure(std::vector<unsigned int> &vars);
 };
 
 inline QcTableau::QcTableau(QcBiMapNotifier &n)
@@ -192,11 +192,11 @@
   	return false;
 }
 
-inline void QcTableau::Print(ostream &os) const
+inline void QcTableau::Print(std::ostream &os) const
 {
-	os << "Begin[Tableau]" << endl;
+	os << "Begin[Tableau]" << std::endl;
 	fNotifier.Print(os);
-	os << "End[Tableau]" << endl;
+	os << "End[Tableau]" << std::endl;
 }
 
 inline int QcTableau::RemoveEq(unsigned ci)
@@ -213,7 +213,7 @@
   	return false;
 }
 
-inline void QcTableau::TransitiveClosure(vector<unsigned int> &vars)
+inline void QcTableau::TransitiveClosure(std::vector<unsigned int> &vars)
 {
 	UNUSED(vars);
 	throw QcWarning("Error: Should not call QcTableau::TransitiveClosure");
Index: qoca/QcCompPivotTableau.hh
===================================================================
--- qoca/QcCompPivotTableau.hh	(revision 18891)
+++ qoca/QcCompPivotTableau.hh	(working copy)
@@ -92,7 +92,7 @@
 	//------------------------------------------------------------------------//
 	// Utility functions.                                                     //
 	//------------------------------------------------------------------------//
-	virtual void Print(ostream &os) const;
+	virtual void Print(std::ostream &os) const;
 };
 
 inline QcCompPivotTableau::QcCompPivotTableau(int hintRows, int hintCols,
Index: qoca/QcDelLinEqTableau.cc
===================================================================
--- qoca/QcDelLinEqTableau.cc	(revision 18891)
+++ qoca/QcDelLinEqTableau.cc	(working copy)
@@ -24,7 +24,7 @@
 // included with the above copyright notice.                                  //
 //============================================================================//
 
-#include <math.h>
+#include <cmath>
 #include "qoca/QcDefines.hh"
 #include "qoca/QcDelLinEqTableau.hh"
 #ifdef qcDenseQuasiInverse
Index: qoca/QcVariableBiMap.cc
===================================================================
--- qoca/QcVariableBiMap.cc	(revision 18891)
+++ qoca/QcVariableBiMap.cc	(working copy)
@@ -1,12 +1,10 @@
 // Generated automatically from QcVariableBiMap.ch by /home/pmoulder/usr/local/bin/ch2xx.
 #include "QcVariableBiMap.hh"
-#line 1 "QcVariableBiMap.ch"
 
-#line 10 "QcVariableBiMap.ch"
 #include <stdio.h>
 
+using namespace std;
 
-
 #define super QcAliasedBiMap<QcNullableFloat, QcFloat, QcFloatRep>
 
 
@@ -14,7 +12,6 @@
 
 
 
-#line 28 "QcVariableBiMap.ch"
 #ifndef NDEBUG
 
 void
Index: qoca/QcVariableBiMap.H
===================================================================
--- qoca/QcVariableBiMap.H	(revision 18891)
+++ qoca/QcVariableBiMap.H	(working copy)
@@ -1,14 +1,12 @@
 // Generated automatically from QcVariableBiMap.ch by /home/pmoulder/usr/local/bin/ch2xx.
 #ifndef QcVariableBiMapDCL
 #define QcVariableBiMapDCL
-#line 1 "QcVariableBiMap.ch"
 
 #include <qoca/QcDefines.hh>
 #include <qoca/QcAliasedBiMap.H>
 #include <qoca/QcNullableFloat.hh>
 
 
-#line 14 "QcVariableBiMap.ch"
 #define super QcAliasedBiMap<QcNullableFloat, QcFloat, QcFloatRep>
 
 class QcVariableBiMap
@@ -27,29 +25,23 @@
 
 void
 assertInvar() const;
-#line 40 "QcVariableBiMap.ch"
 void
 assertDeepInvar() const;
-#line 48 "QcVariableBiMap.ch"
 virtual void
 vAssertDeepInvar() const;
-#line 53 "QcVariableBiMap.ch"
 #endif
 
 
 void
 Update(QcFloat const &ident, int index);
-#line 64 "QcVariableBiMap.ch"
 void
 Update(QcFloatRep *ident, int index);
-#line 72 "QcVariableBiMap.ch"
 //-----------------------------------------------------------------------//
 // Query functions                                                       //
 //-----------------------------------------------------------------------//
 
 void
-GetVariableSet(vector<QcFloat> &vars);
-#line 100 "QcVariableBiMap.ch"
+GetVariableSet(std::vector<QcFloat> &vars);
 };
 
 
Index: qoca/QcLinInEqSystem.cc
===================================================================
--- qoca/QcLinInEqSystem.cc	(revision 18891)
+++ qoca/QcLinInEqSystem.cc	(working copy)
@@ -38,6 +38,8 @@
 #include "qoca/QcTableauColIterator.hh"
 #include "qoca/QcDenseTableauRowIterator.hh"
 
+using namespace std;
+
 bool QcLinInEqSystem::AddConstraint(QcConstraint &c)
 {
 	return doAddConstraint(c, -1);
Index: qoca/QcConstraintRep.hh
===================================================================
--- qoca/QcConstraintRep.hh	(revision 18891)
+++ qoca/QcConstraintRep.hh	(working copy)
@@ -195,7 +195,7 @@
 	//-----------------------------------------------------------------------//
 	// Utility functions                                                     //
 	//-----------------------------------------------------------------------//
-	virtual void Print(ostream &os) const;
+	virtual void Print(std::ostream &os) const;
 
 protected:
 	static TId fNextValidId;
@@ -320,7 +320,7 @@
 #endif
 
 #ifndef qcNoStream
-inline ostream &operator<<(ostream &os, const QcConstraintRep &r)
+inline std::ostream &operator<<(std::ostream &os, const QcConstraintRep &r)
 {
 	r.Print(os);
 	return os;
Index: qoca/QcQuasiRowColStateVector.hh
===================================================================
--- qoca/QcQuasiRowColStateVector.hh	(revision 18891)
+++ qoca/QcQuasiRowColStateVector.hh	(working copy)
@@ -2,7 +2,6 @@
 #include "QcQuasiRowColStateVector.H"
 #ifndef QcQuasiRowColStateVectorIFN
 #define QcQuasiRowColStateVectorIFN
-#line 1 "QcQuasiRowColStateVector.ch"
 // $Id: QcQuasiRowColStateVector.ch,v 1.4 2001/01/30 01:32:08 pmoulder Exp $
 
 //============================================================================//
@@ -49,7 +48,6 @@
 }
 
 
-#line 63 "QcQuasiRowColStateVector.ch"
 //-----------------------------------------------------------------------//
 // Manipulation functions.                                               //
 //-----------------------------------------------------------------------//
@@ -69,21 +67,19 @@
 
 #if 0 /* unused */
 
-#line 135 "QcQuasiRowColStateVector.ch"
 #endif /* unused */
 
 //-----------------------------------------------------------------------//
 // Utility functions.                                                    //
 //-----------------------------------------------------------------------//
 inline void
-QcQuasiRowColStateVector::Print(ostream &os)
+QcQuasiRowColStateVector::Print(std::ostream &os)
 {
   fRowState->Print(os);
   fColState->Print(os);
 }
 
 
-#line 155 "QcQuasiRowColStateVector.ch"
 /*
   Local Variables:
   mode:c++
Index: qoca/QcLinInEqColState.hh
===================================================================
--- qoca/QcLinInEqColState.hh	(revision 18891)
+++ qoca/QcLinInEqColState.hh	(working copy)
@@ -94,7 +94,7 @@
   //-----------------------------------------------------------------------//
   // Utility functions.                                                    //
   //-----------------------------------------------------------------------//
-  virtual void Print(ostream &os);
+  virtual void Print(std::ostream &os);
 
 public:
   /** A constrained variable may only take non-negative values and hence if it
@@ -124,7 +124,7 @@
 	fPrevStruct = 0;
 }
 
-inline void QcLinInEqColState::Print(ostream &os)
+inline void QcLinInEqColState::Print(std::ostream &os)
 {
   	QcLinEqColState::Print(os);
 	os << ",IsConst(" << fIsConstrained << "),"
Index: qoca/QcFloatRep.cc
===================================================================
--- qoca/QcFloatRep.cc	(revision 18891)
+++ qoca/QcFloatRep.cc	(working copy)
@@ -1,6 +1,5 @@
 // Generated automatically from QcFloatRep.ch by /home/pmoulder/usr/local/bin/ch2xx.
 #include "QcFloatRep.hh"
-#line 1 "QcFloatRep.ch"
 // $Id: QcFloatRep.ch,v 1.13 2001/01/10 05:01:51 pmoulder Exp $
 
 //============================================================================//
@@ -31,7 +30,8 @@
 #include "qoca/QcUtility.hh"
 
 
-#line 48 "QcFloatRep.ch"
+using namespace std;
+
 	//-----------------------------------------------------------------------//
 	// Constructors                                                          //
 	//-----------------------------------------------------------------------//
@@ -58,12 +58,10 @@
 }
 
 
-#line 93 "QcFloatRep.ch"
 //-----------------------------------------------------------------------//
 // Set and Get member functions                                          //
 //-----------------------------------------------------------------------//
 
-#line 176 "QcFloatRep.ch"
 void QcFloatRep::SetWeight (numT w)
 {
   qcAssertPre( isQcFloatRep());
@@ -83,7 +81,6 @@
 }
 
 
-#line 199 "QcFloatRep.ch"
 void
 QcFloatRep::SuggestValue (numT dv)
 {
@@ -92,7 +89,6 @@
 }
 
 
-#line 213 "QcFloatRep.ch"
 void QcFloatRep::SetName (char const *n)
 {
   qcAssertPre( isQcFloatRep());
@@ -127,7 +123,6 @@
   qcAssertPost (fName[len + qcMagic2Len] == '\0');
 }
 
-#line 279 "QcFloatRep.ch"
 #if qcCheckInternalPre
 void QcFloatRep::assertInvar() const
 {
@@ -146,7 +141,6 @@
 
 
 
-#line 299 "QcFloatRep.ch"
 bool QcFloatRep::FreeName()
 {
   qcAssertPre( isQcFloatRep());
@@ -170,7 +164,6 @@
 }
 
 
-#line 352 "QcFloatRep.ch"
 //-----------------------------------------------------------------------//
 // Utility functions.                                                    //
 //-----------------------------------------------------------------------//
@@ -191,7 +184,6 @@
 }
 
 
-#line 414 "QcFloatRep.ch"
 QcFloatRep::TId QcFloatRep::fNextValidId = 1;
 
 /*
Index: qoca/QcMatrix.hh
===================================================================
--- qoca/QcMatrix.hh	(revision 18891)
+++ qoca/QcMatrix.hh	(working copy)
@@ -152,7 +152,7 @@
 	//-----------------------------------------------------------------------//
 	// Utility functions.                                                    //
 	//-----------------------------------------------------------------------//
-	virtual void Print(ostream &os) const;
+	virtual void Print(std::ostream &os) const;
 
 protected:
 	unsigned fAllocRows;		// Used only by Reserve
@@ -166,18 +166,18 @@
 {
 }
 
-inline void QcMatrix::Print(ostream &os) const
+inline void QcMatrix::Print(std::ostream &os) const
 {
 	for (unsigned i = 0; i < fRows; i++) {
 		os << i << ":";
 		for (unsigned j = 0; j < fColumns; j++)
 			os << "\t" << GetValue(i, j);
-		os << endl;
+		os << std::endl;
 	}
 }
 
 #ifndef qcNoStream
-inline ostream &operator<<(ostream &os, const QcMatrix &m)
+inline std::ostream &operator<<(std::ostream &os, const QcMatrix &m)
 {
 	m.Print(os);
 	return os;
Index: qoca/QcFloat.hh
===================================================================
--- qoca/QcFloat.hh	(revision 18891)
+++ qoca/QcFloat.hh	(working copy)
@@ -237,7 +237,7 @@
 	//-----------------------------------------------------------------------//
 	// Utility functions                                                     //
 	//-----------------------------------------------------------------------//
-	void Print(ostream &os) const
+	void Print(std::ostream &os) const
 	{ fRep->Print(os); }
 
 protected:
@@ -363,7 +363,7 @@
 }
 
 #ifndef qcNoStream
-inline ostream &operator<<(ostream &os, const QcFloat &cf)
+inline std::ostream &operator<<(std::ostream &os, const QcFloat &cf)
 {
 	cf.Print(os);
 	return os;
Index: qoca/QcLinEqTableau.hh
===================================================================
--- qoca/QcLinEqTableau.hh	(revision 18891)
+++ qoca/QcLinEqTableau.hh	(working copy)
@@ -27,8 +27,8 @@
 #ifndef __QcLinEqTableauH
 #define __QcLinEqTableauH
 
-#include <deque.h>
-#include <vector.h>
+#include <deque>
+#include <vector>
 #include "qoca/QcTableau.hh"
 #include "qoca/QcSparseCoeff.hh"
 #include "qoca/QcDelCoreTableau.hh"
@@ -43,7 +43,7 @@
 	QcCoreTableau *fCoreTableau;
 
 public:
-  	deque<unsigned int> fPivotHints;
+  	std::deque<unsigned int> fPivotHints;
 		// During an eliminate operation, fPivotHints is erased and then
 		// the indices of parametric variables that do not have zero
 		// solved form coeffs are recorded.  These are likely to be good
@@ -295,7 +295,7 @@
 	//-----------------------------------------------------------------------//
 	// Utility function.                                                     //
 	//-----------------------------------------------------------------------//
-	virtual void Print(ostream &os) const;
+	virtual void Print(std::ostream &os) const;
 
 protected:
 	//-----------------------------------------------------------------------//
Index: qoca/QcLinEqColState.hh
===================================================================
--- qoca/QcLinEqColState.hh	(revision 18891)
+++ qoca/QcLinEqColState.hh	(working copy)
@@ -82,7 +82,7 @@
   //-----------------------------------------------------------------------//
   // Utility functions.                                                    //
   //-----------------------------------------------------------------------//
-  virtual void Print(ostream &os);
+  virtual void Print(std::ostream &os);
 
 private:
   numT fDesValue;	// cache desired value of variable during solve
@@ -119,7 +119,7 @@
 {
 }
 
-inline void QcLinEqColState::Print(ostream &os)
+inline void QcLinEqColState::Print(std::ostream &os)
 {
 	QcQuasiColState::Print(os);
   	os << ",DV(" << fDesValue << "),"
Index: qoca/QcIneqSolverBase.H
===================================================================
--- qoca/QcIneqSolverBase.H	(revision 18891)
+++ qoca/QcIneqSolverBase.H	(working copy)
@@ -1,7 +1,6 @@
 // Generated automatically from QcIneqSolverBase.ch by /home/pmoulder/usr/local/bin/ch2xx.
 #ifndef QcIneqSolverBaseDCL
 #define QcIneqSolverBaseDCL
-#line 1 "QcIneqSolverBase.ch"
 #include <qoca/QcSolver.H>
 
 #include <qoca/QcDelLinInEqSystem.hh>
@@ -12,11 +11,22 @@
 public:
 
 inline
-QcIneqSolverBase();
-#line 18 "QcIneqSolverBase.ch"
+QcIneqSolverBase() 
+  : QcSolver(),
+    fSystem()
+{
+	;
+}
+
 inline
-QcIneqSolverBase(unsigned hintNumConstraints, unsigned hintNumVariables);
-#line 26 "QcIneqSolverBase.ch"
+QcIneqSolverBase(unsigned hintNumConstraints, unsigned hintNumVariables)
+  : QcSolver(),
+    fSystem( hintNumConstraints, hintNumVariables)
+{
+	;
+}
+
+
 virtual ~QcIneqSolverBase()
 {
 }
@@ -78,10 +88,8 @@
 
 virtual bool
 AddConstraint(QcConstraint &c);
-#line 101 "QcIneqSolverBase.ch"
 virtual bool
 AddConstraint(QcConstraint &c, QcFloat &hint);
-#line 117 "QcIneqSolverBase.ch"
 virtual void
 BeginAddConstraint()
 {
@@ -98,10 +106,8 @@
 
 virtual bool
 ChangeConstraint(QcConstraint &oldc, numT rhs);
-#line 143 "QcIneqSolverBase.ch"
 virtual bool
 RemoveConstraint(QcConstraint &c);
-#line 159 "QcIneqSolverBase.ch"
 virtual bool
 Reset()
 {
Index: qoca/QcLinPoly.cc
===================================================================
--- qoca/QcLinPoly.cc	(revision 18891)
+++ qoca/QcLinPoly.cc	(working copy)
@@ -27,6 +27,8 @@
 #include "qoca/QcDefines.hh"
 #include "qoca/QcLinPoly.hh"
 
+using namespace std;
+
 QcLinPoly::QcLinPoly(const QcLinPoly& rhs)
 {
 	size_t n = rhs.fTerms.size();
Index: qoca/QcDefines.hh
===================================================================
--- qoca/QcDefines.hh	(revision 18891)
+++ qoca/QcDefines.hh	(working copy)
@@ -173,7 +173,7 @@
   )
 
 #ifndef qcNoStream
-# include <iostream.h>
+# include <iostream>
 #endif
 
 /* TODO: Maybe use autoconf to detect this.  (OTOH, I imagine that
Index: qoca/QcLinInEqSolver.cc
===================================================================
--- qoca/QcLinInEqSolver.cc	(revision 18891)
+++ qoca/QcLinInEqSolver.cc	(working copy)
@@ -34,6 +34,8 @@
 #include "qoca/QcStructVarIndexIterator.hh"
 #include "qoca/QcSparseMatrixRowIterator.hh"
 
+using namespace std;
+
 void QcLinInEqSolver::AddDualCoeffs(QcLinPoly &lpoly, int p)
 	// Used by Generate constraints to add the dual variable
 	// coefficients to a linpoly corresponding to parameter p.
Index: qoca/QcCassSolver.hh
===================================================================
--- qoca/QcCassSolver.hh	(revision 18891)
+++ qoca/QcCassSolver.hh	(working copy)
@@ -27,16 +27,16 @@
 #ifndef __QcCassSolverH
 #define __QcCassSolverH
 
-#include <map.h>
+#include <map>
 #include "qoca/QcDelLinInEqSystem.hh"
 #include "qoca/QcCassConstraint.hh"
 
 class QcCassSolver : public QcDelLinInEqSystem
 {
 protected:
-  	typedef map<QcFloat, QcCassConstraint *> TStayMap;
-  	typedef vector<QcCassConstraint *> TEditMap;
-  	typedef vector<QcCassConstraint *> TStaySeqMap;
+  	typedef std::map<QcFloat, QcCassConstraint *> TStayMap;
+  	typedef std::vector<QcCassConstraint *> TEditMap;
+  	typedef std::vector<QcCassConstraint *> TStaySeqMap;
 
   	TStayMap fStayMap;
   	TEditMap fEditMap;
@@ -92,7 +92,7 @@
 	// Utility functions.                                                    //
 	//-----------------------------------------------------------------------//
   	virtual void Restart();
-  	virtual void Print(ostream &os) const;
+  	virtual void Print(std::ostream &os) const;
 };
 
 inline QcCassSolver::QcCassSolver()
Index: layouter/ConstraintSolverLayouter.cpp
===================================================================
--- layouter/ConstraintSolverLayouter.cpp	(revision 18891)
+++ layouter/ConstraintSolverLayouter.cpp	(working copy)
@@ -6,7 +6,7 @@
 #include "ConstraintSolverLayouter.h"
 
 #include <math.h>
-#include <string.h>
+#include <string>
 
 #include <LayoutUtils.h>
 #include <Size.h>
