idep_binrel.h File Reference

#include <iosfwd>

Go to the source code of this file.

Classes

class  idep_BinRel

Functions

std::ostream & operator<< (std::ostream &out, const idep_BinRel &rel)
int operator== (const idep_BinRel &left, const idep_BinRel &right)
int operator!= (const idep_BinRel &left, const idep_BinRel &right)

Function Documentation

int operator!= ( const idep_BinRel left,
const idep_BinRel right 
) [inline]

Definition at line 140 of file idep_binrel.h.

References idep_BinRel::cmp().

00141 {
00142     return left.cmp(right) != 0;
00143 }

std::ostream& operator<< ( std::ostream &  out,
const idep_BinRel rel 
)

Definition at line 208 of file idep_binrel.cxx.

References idep_BinRel::get(), and idep_BinRel::length().

00209 {
00210     int r, c;
00211     const int GAP_GRID = 10;
00212     const char *SP = rel.length() < 30 ? " " : "";
00213     for (r = 0; r < rel.length(); ++r) {
00214         if (r && 0 == r % GAP_GRID) { 
00215             o << std::endl;
00216         }
00217         
00218         for (c = 0; c < rel.length(); ++c) {
00219             if (c && 0 == c % GAP_GRID) { 
00220                 o << ' ' << SP;
00221             }
00222             o << (rel.get(r,c) ? '1' : '_') << SP;
00223         }
00224         o << std::endl;
00225     }
00226     return o;
00227 }

int operator== ( const idep_BinRel left,
const idep_BinRel right 
) [inline]

Definition at line 134 of file idep_binrel.h.

References idep_BinRel::cmp().

00135 {
00136     return left.cmp(right) == 0;
00137 }


Generated on 3 Dec 2018 for loon by  doxygen 1.6.1