Container class for pair of int. More...
#include <MC_int_pair.hpp>
Public Member Functions | |
| MC_int_pair () | |
| Empty constructor. | |
| MC_int_pair (const MC_int_pair &i) | |
| copy constructor | |
| MC_int_pair (const int &_u0, const int &_u1) | |
| direct constructor | |
| template<typename U , typename V > | |
| MC_int_pair (const std::pair< U, V > &p) | |
| constructor from std::pair(a,b) | |
| ~MC_int_pair () | |
| destructor | |
| const int & | operator[] (const int &k) const |
| access (k must be 0 or 1) | |
| int & | operator[] (const int &k) |
| access (k must be 0 or 1) | |
| const int & | operator() (const int &k) const |
| access (k must be 0 or 1) | |
| int & | operator() (const int &k) |
| access (k must be 0 or 1) | |
| MC_int_pair & | operator= (const MC_int_pair &to_copy) |
| affectation | |
| MC_int_pair | ordonated () const |
| ordonate the int_pair in the same order (lower value is the first one) | |
| void | assert_bounds (const int &u) const |
| assert the index is either 0 or 1 | |
Private Attributes | |
| int | u0 |
| the pair | |
| int | u1 |
Friends | |
| bool | operator== (const MC_int_pair &p1, const MC_int_pair &p2) |
| test equality | |
| bool | operator!= (const MC_int_pair &p1, const MC_int_pair &p2) |
| test equality | |
| MC_int_pair | operator+ (const MC_int_pair &p, const int &a) |
| add a value to the pair | |
| MC_int_pair | operator- (const MC_int_pair &p, const int &a) |
| substract a value to the pair | |
| std::ostream & | operator<< (std::ostream &flux, const MC_int_pair &_v) |
Container class for pair of int.
(u0,u1) == (u1,u0)
Definition at line 34 of file MC_int_pair.hpp.
| mesh_conv::MC_int_pair::MC_int_pair | ( | ) |
Empty constructor.
Definition at line 8 of file MC_int_pair.cpp.
Referenced by ordonated().

| mesh_conv::MC_int_pair::MC_int_pair | ( | const MC_int_pair & | i | ) |
| mesh_conv::MC_int_pair::MC_int_pair | ( | const int & | _u0, | |
| const int & | _u1 | |||
| ) |
| mesh_conv::MC_int_pair::MC_int_pair | ( | const std::pair< U, V > & | p | ) | [inline] |
constructor from std::pair(a,b)
Definition at line 53 of file MC_int_pair.hpp.
| mesh_conv::MC_int_pair::~MC_int_pair | ( | ) |
| void mesh_conv::MC_int_pair::assert_bounds | ( | const int & | u | ) | const |
assert the index is either 0 or 1
Definition at line 40 of file MC_int_pair.cpp.
Referenced by operator()(), and operator[]().
00041 { 00042 if(u!=0 && u!=1) 00043 {std::cout<<"Error in MC_int_pair::assert_bounds("<<u<<"), index must be 0 or 1"<<std::endl;exit(-1);} 00044 }

| int & mesh_conv::MC_int_pair::operator() | ( | const int & | k | ) |
access (k must be 0 or 1)
Definition at line 64 of file MC_int_pair.cpp.
References assert_bounds(), u0, and u1.
00065 { 00066 assert_bounds(k); 00067 if(k==0) return u0; 00068 return u1; 00069 }

| const int & mesh_conv::MC_int_pair::operator() | ( | const int & | k | ) | const |
access (k must be 0 or 1)
Definition at line 58 of file MC_int_pair.cpp.
References assert_bounds(), u0, and u1.
00059 { 00060 assert_bounds(k); 00061 if(k==0) return u0; 00062 return u1; 00063 }

| MC_int_pair & mesh_conv::MC_int_pair::operator= | ( | const MC_int_pair & | to_copy | ) |
| int & mesh_conv::MC_int_pair::operator[] | ( | const int & | k | ) |
access (k must be 0 or 1)
Definition at line 52 of file MC_int_pair.cpp.
References assert_bounds(), u0, and u1.
00053 { 00054 assert_bounds(k); 00055 if(k==0) return u0; 00056 return u1; 00057 }

| const int & mesh_conv::MC_int_pair::operator[] | ( | const int & | k | ) | const |
access (k must be 0 or 1)
Definition at line 46 of file MC_int_pair.cpp.
References assert_bounds(), u0, and u1.
00047 { 00048 assert_bounds(k); 00049 if(k==0) return u0; 00050 return u1; 00051 }

| MC_int_pair mesh_conv::MC_int_pair::ordonated | ( | ) | const |
ordonate the int_pair in the same order (lower value is the first one)
Definition at line 71 of file MC_int_pair.cpp.
References MC_int_pair(), u0, and u1.
Referenced by mesh_conv::MC_int_pair_less::operator()().
00072 { 00073 if(u0<u1) 00074 return MC_int_pair(u0,u1); 00075 return MC_int_pair(u1,u0); 00076 }


| bool operator!= | ( | const MC_int_pair & | p1, | |
| const MC_int_pair & | p2 | |||
| ) | [friend] |
test equality
| MC_int_pair operator+ | ( | const MC_int_pair & | p, | |
| const int & | a | |||
| ) | [friend] |
add a value to the pair
| MC_int_pair operator- | ( | const MC_int_pair & | p, | |
| const int & | a | |||
| ) | [friend] |
substract a value to the pair
| std::ostream& operator<< | ( | std::ostream & | flux, | |
| const MC_int_pair & | _v | |||
| ) | [friend] |
output
| bool operator== | ( | const MC_int_pair & | p1, | |
| const MC_int_pair & | p2 | |||
| ) | [friend] |
test equality
int mesh_conv::MC_int_pair::u0 [private] |
the pair
Definition at line 121 of file MC_int_pair.hpp.
Referenced by MC_int_pair(), mesh_conv::operator!=(), operator()(), operator=(), mesh_conv::operator==(), operator[](), and ordonated().
int mesh_conv::MC_int_pair::u1 [private] |
Definition at line 121 of file MC_int_pair.hpp.
Referenced by MC_int_pair(), mesh_conv::operator!=(), operator()(), operator=(), mesh_conv::operator==(), operator[](), and ordonated().
1.6.1