types.cpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /****************************************************************************
  2. *
  3. * MODULE: r.terraflow
  4. *
  5. * COPYRIGHT (C) 2007 Laura Toma
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. *****************************************************************************/
  18. #include "types.h"
  19. cclabel_type labelFactory::label = labelFactory::getLabelInit();
  20. /* ---------------------------------------------------------------------- */
  21. int
  22. ijBaseType::compare(const ijBaseType &a, const ijBaseType &b) {
  23. if(a.i < b.i) return -1;
  24. if(a.i > b.i) return 1;
  25. if(a.j < b.j) return -1;
  26. if(a.j > b.j) return 1;
  27. return 0;
  28. }
  29. std::ostream&
  30. operator << (std::ostream& s, const ijBaseType &p) {
  31. return s << "(" << p.i << "," << p.j << ")";
  32. }
  33. /* ---------------------------------------------------------------------- */