34 #ifndef __UG__LIB_ALGEBRA__ORDERING_STRATEGIES_ALGORITHMS_NATIVE_CUTHILL_MCKEE_ORDERING__
35 #define __UG__LIB_ALGEBRA__ORDERING_STRATEGIES_ALGORITHMS_NATIVE_CUTHILL_MCKEE_ORDERING__
89 std::vector<std::vector<size_t> >& vvNeighbour,
91 bool bPreserveConsec =
true);
94 template <
typename TAlgebra,
typename O_t>
98 typedef typename TAlgebra::matrix_type
M_t;
99 typedef typename TAlgebra::vector_type
V_t;
114 std::vector<std::vector<size_t> > neighbors;
115 neighbors.resize(
m->num_rows());
117 for(
size_t i=0; i<
m->num_rows(); i++)
119 for(
typename M_t::row_iterator i_it =
m->begin_row(i); i_it !=
m->end_row(i); ++i_it){
120 neighbors[i].push_back(i_it.index());
147 #ifdef UG_ENABLE_DEBUG_LOGS
155 UG_THROW(
name() <<
"::init: induced subgraph version not implemented yet!");
159 UG_THROW(
name() <<
"::init: induced subgraph version not implemented yet!");
166 virtual const char*
name()
const {
168 return "ReverseNativeCuthillMcKeeOrdering (ug4 version)";
171 return "NativeCuthillMcKeeOrdering (ug4 version)";
Definition: smart_pointer.h:108
Definition: IOrderingAlgorithm.h:52
Definition: native_cuthill_mckee.h:96
void init(M_t *A, const V_t &)
Definition: native_cuthill_mckee.h:141
void check()
Definition: native_cuthill_mckee.h:133
SmartPtr< IOrderingAlgorithm< TAlgebra, O_t > > clone()
Definition: native_cuthill_mckee.h:108
void init(M_t *A)
Definition: native_cuthill_mckee.h:145
IOrderingAlgorithm< TAlgebra, O_t > baseclass
Definition: native_cuthill_mckee.h:100
M_t * m
Definition: native_cuthill_mckee.h:176
void init(M_t *, const O_t &)
Definition: native_cuthill_mckee.h:158
void init(M_t *, const V_t &, const O_t &)
Definition: native_cuthill_mckee.h:154
void compute()
Definition: native_cuthill_mckee.h:113
TAlgebra::vector_type V_t
Definition: native_cuthill_mckee.h:99
void set_reverse(bool b)
Definition: native_cuthill_mckee.h:162
NativeCuthillMcKeeOrdering()
Definition: native_cuthill_mckee.h:102
bool m_bReverse
Definition: native_cuthill_mckee.h:178
TAlgebra::matrix_type M_t
Definition: native_cuthill_mckee.h:98
virtual const char * name() const
Definition: native_cuthill_mckee.h:166
O_t o
Definition: native_cuthill_mckee.h:175
NativeCuthillMcKeeOrdering(const NativeCuthillMcKeeOrdering< TAlgebra, O_t > &parent)
clone constructor
Definition: native_cuthill_mckee.h:105
O_t & ordering()
Definition: native_cuthill_mckee.h:137
#define UG_THROW(msg)
Definition: error.h:57
#define UG_LOG(msg)
Definition: log.h:367
#define UG_COND_THROW(cond, msg)
UG_COND_THROW(cond, msg) : performs a UG_THROW(msg) if cond == true.
Definition: error.h:61
void ComputeCuthillMcKeeOrder(std::vector< size_t > &vNewIndex, std::vector< std::vector< size_t > > &vvConnection, bool bReverse, bool bPreserveConsec)
returns an array describing the needed index mapping for Cuthill-McKee ordering
Definition: native_cuthill_mckee.cpp:100
bool is_permutation(O_t &o)
Definition: permutation_util.h:135
SmartPtr< T, FreePolicy > make_sp(T *inst)
returns a SmartPtr for the passed raw pointer
Definition: smart_pointer.h:836