10 #define MatchingDefs_h
18 template <
typename T1,
typename T2>
26 if(vtx1.comp==vtx2.comp)
return vtx1.parent<vtx2.parent;
27 else return vtx1.comp<vtx2.comp;
30 friend std::ostream&
operator<<(std::ostream& os,
const VertexTypeML & vertex ){os <<
"(" << vertex.parent <<
"," << vertex.comp <<
")";
return os;};
38 template <
typename IT>
45 if(vtx1.comp==vtx2.comp)
47 if(vtx1.parent==vtx2.parent)
48 return vtx1.root<vtx2.root;
49 else return vtx1.parent<vtx2.parent;
51 else return vtx1.comp<vtx2.comp;
55 friend std::ostream&
operator<<(std::ostream& os,
const VertexTypeMM & vertex ){os <<
"(" << vertex.parent <<
"," << vertex.root <<
","<< vertex.comp <<
")";
return os;};
64 template <
typename T1,
typename T2>
67 static T2
id(){
return 1; };
69 static MPI_Op
mpi_op() {
return MPI_SUM; };
71 static T2
add(
const T2 & arg1,
const T2 & arg2)
73 return std::plus<T2>()(arg1, arg2);
76 static T2
multiply(
const T1 & arg1,
const T2 & arg2)
78 return static_cast<T2
> (1);
81 static void axpy(
const T1 a,
const T2 & x, T2 & y)
89 template <
typename T1,
typename T2>
92 static T2
id(){
return T2(); };
94 static MPI_Op
mpi_op() {
return MPI_MIN; };
96 static T2
add(
const T2 & arg1,
const T2 & arg2)
98 return std::min(arg1, arg2);
101 static T2
multiply(
const T1 & arg1,
const T2 & arg2)
106 static void axpy(
const T1 a,
const T2 & x, T2 & y)
113 template <
typename T1,
typename T2>
116 static T2
id(){
return T2(-1, std::numeric_limits<T1>::lowest()); };
118 static MPI_Op
mpi_op() {
return MPI_MAX; };
120 static T2
add(
const T2 & arg1,
const T2 & arg2)
122 return std::max(arg1, arg2);
125 static T2
multiply(
const T1 & arg1,
const T2 & arg2)
127 return T2(arg2.parent, arg1);
130 static void axpy(
const T1 a,
const T2 & x, T2 & y)
140 template <
typename T1,
typename T2>
143 static T2
id(){
return T2(-1, -1, std::numeric_limits<T1>::lowest()); };
145 static MPI_Op
mpi_op() {
return MPI_MAX; };
147 static T2
add(
const T2 & arg1,
const T2 & arg2)
149 return std::max(arg1, arg2);
152 static T2
multiply(
const T1 & arg1,
const T2 & arg2)
154 return T2(arg2.parent, arg2.root, arg1);
158 static void axpy(
const T1 a,
const T2 & x, T2 & y)
static bool returnedSAID()
static void axpy(const T1 a, const T2 &x, T2 &y)
static T2 add(const T2 &arg1, const T2 &arg2)
static T2 multiply(const T1 &arg1, const T2 &arg2)
static void axpy(const T1 a, const T2 &x, T2 &y)
static bool returnedSAID()
static T2 add(const T2 &arg1, const T2 &arg2)
static T2 multiply(const T1 &arg1, const T2 &arg2)
friend std::ostream & operator<<(std::ostream &os, const VertexTypeML &vertex)
friend bool operator==(const VertexTypeML &vtx1, const VertexTypeML &vtx2)
friend bool operator<(const VertexTypeML &vtx1, const VertexTypeML &vtx2)
VertexTypeML(T1 p=-1, T2 com=0)
friend std::ostream & operator<<(std::ostream &os, const VertexTypeMM &vertex)
friend bool operator==(const VertexTypeMM &vtx1, const VertexTypeMM &vtx2)
VertexTypeMM(IT p=-1, IT r=-1, double w=0)
friend bool operator<(const VertexTypeMM &vtx1, const VertexTypeMM &vtx2)
static void axpy(const T1 a, const T2 &x, T2 &y)
static T2 add(const T2 &arg1, const T2 &arg2)
static T2 multiply(const T1 &arg1, const T2 &arg2)
static bool returnedSAID()
static T2 multiply(const T1 &arg1, const T2 &arg2)
static T2 add(const T2 &arg1, const T2 &arg2)
static bool returnedSAID()
static void axpy(const T1 a, const T2 &x, T2 &y)