50 #ifndef _ZOLTAN2_ORDERINGPROBLEM_HPP_ 51 #define _ZOLTAN2_ORDERINGPROBLEM_HPP_ 59 #ifdef HAVE_ZOLTAN2_OVIS 65 using Teuchos::rcp_dynamic_cast;
89 template<
typename Adapter>
95 typedef typename Adapter::gno_t
gno_t;
96 typedef typename Adapter::lno_t
lno_t;
97 typedef typename Adapter::user_t
user_t;
100 #ifdef HAVE_ZOLTAN2_MPI 101 typedef Teuchos::OpaqueWrapper<MPI_Comm> mpiWrapper_t;
109 #ifdef HAVE_ZOLTAN2_MPI 116 createOrderingProblem();
125 createOrderingProblem();
144 void solve(
bool updateInputData=
true);
153 if (!(solution_->havePerm()))
154 solution_->computePerm();
155 if (!(solution_->haveInverse()))
156 solution_->computeInverse();
157 return solution_.getRawPtr();
161 void createOrderingProblem();
163 RCP<OrderingSolution<lno_t, gno_t> > solution_;
165 RCP<Comm<int> > problemComm_;
166 RCP<const Comm<int> > problemCommConst_;
171 template <
typename Adapter>
176 size_t nVtx = this->
baseModel_->getLocalNumObjects();
186 this->solution_->setHavePerm(
false);
187 this->solution_->setHaveInverse(
false);
193 std::string method = this->
params_->template get<std::string>(
"order_method",
"rcm");
198 if (method.compare(
"rcm") == 0)
202 alg.
order(this->solution_);
204 else if (method.compare(
"natural") == 0)
208 alg.
order(this->solution_);
210 else if (method.compare(
"random") == 0)
214 alg.
order(this->solution_);
216 else if (method.compare(
"sorted_degree") == 0)
220 alg.
order(this->solution_);
222 else if (method.compare(
"minimum_degree") == 0)
224 std::string pkg = this->
params_->template get<std::string>(
"order_package",
"amd");
225 if (pkg.compare(
"amd") == 0)
229 alg.
order(this->solution_);
233 #ifdef INCLUDE_ZOLTAN2_EXPERIMENTAL_WOLF 234 else if (method == std::string(
"nd"))
238 alg.
order(this->solution_);
259 template <
typename Adapter>
263 using Teuchos::ParameterList;
269 #ifdef HAVE_ZOLTAN2_OVIS 270 ovis_enabled(this->
comm_->getRank());
275 problemComm_ = this->
comm_->duplicate();
276 problemCommConst_ = rcp_const_cast<
const Comm<int> > (problemComm_);
284 std::string method = this->
params_->template get<std::string>(
"order_method",
"rcm");
286 if ((method == std::string(
"rcm")) ||
287 (method == std::string(
"sorted_degree")) ||
288 (method == std::string(
"minimum_degree"))) {
294 std::bitset<NUM_MODEL_FLAGS> graphFlags;
295 std::bitset<NUM_MODEL_FLAGS> idFlags;
320 this->
baseModel_ = rcp_implicit_cast<
const Model<base_adapter_t> >(
328 <<
" Model type " << modelType <<
" not yet supported." RCP< GraphModel< base_adapter_t > > graphModel_
OrderingSolution< lno_t, gno_t > * getSolution()
Get the solution to the problem.
RCP< const base_adapter_t > baseInputAdapter_
ModelType
An identifier for the general type of model.
virtual ~OrderingProblem()
Destructor.
#define Z2_FORWARD_EXCEPTIONS
Forward an exception back through call stack.
Defines the OrderingSolution class.
RCP< const Comm< int > > comm_
RCP< IdentifierModel< base_adapter_t > > identifierModel_
int order(const RCP< OrderingSolution< lno_t, gno_t > > &solution)
Ordering method.
OrderingProblem sets up ordering problems for the user.
algorithm requires no self edges
int order(const RCP< OrderingSolution< lno_t, gno_t > > &solution)
Ordering method.
OrderingProblem(Adapter *A, ParameterList *p)
Constructor that uses a default communicator.
Problem base class from which other classes (PartitioningProblem, ColoringProblem, OrderingProblem, MatchingProblem, etc.) derive.
void solve(bool updateInputData=true)
Direct the problem to create a solution.
Adapter::scalar_t scalar_t
Defines the Problem base class.
Adapter::base_adapter_t base_adapter_t
RCP< CoordinateModel< base_adapter_t > > coordinateModel_
int order(const RCP< OrderingSolution< typename Adapter::lno_t, typename Adapter::gno_t > > &solution)
Ordering method.
GraphModel defines the interface required for graph models.
The base class for all model classes.
RCP< ParameterList > params_
int order(const RCP< OrderingSolution< lno_t, gno_t > > &solution)
Ordering method.
IdentifierModel defines the interface for all identifier models.
Defines the GraphModel interface.
The class containing ordering solutions.
RCP< const Model< base_adapter_t > > baseModel_
model represents graph within only one rank
int order(const RCP< OrderingSolution< lno_t, gno_t > > &solution)
Ordering method.
RCP< const Environment > envConst_
#define __func__zoltan2__
int order(const RCP< OrderingSolution< lno_t, gno_t > > &solution_)
Ordering method.