// index2.cpp
//
// Jiangguo (James) Liu
// ColoState, Jan.-Jun. 2007


#include <iostream>
#include "index2.h"


bool operator<=(const Index2 &ind1, const Index2 &ind2) 
{
   bool b = false;
   if (ind1.ix<ind2.ix)  b = true;
   if (ind1.ix==ind2.ix && ind1.iy<=ind2.iy)  b = true;
   return b;
}


int lindex(const Index2 &ind, const Index2 &MaxInd) 
{
   return (ind.ix-1)*MaxInd.iy + ind.iy;
}


// Index2: output stream

std::ostream &operator<<(std::ostream &strm, const Index2&ind) 
{
   std::cout << "index: " << ind.ix << ", " << ind.iy << "\n"; 
   return strm;
}
