50 #ifndef _ZOLTAN2_COLORINGPROBLEM_HPP_ 51 #define _ZOLTAN2_COLORINGPROBLEM_HPP_ 64 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 createColoringProblem();
125 createColoringProblem();
132 RCP<Teuchos::StringValidator> color_method_Validator = Teuchos::rcp(
133 new Teuchos::StringValidator(
134 Teuchos::tuple<std::string>(
"SerialGreedy" )));
135 pl.set(
"color_method",
"SerialGreedy",
"coloring algorithm",
136 color_method_Validator);
155 void solve(
bool updateInputData=
true);
163 return solution_.getRawPtr();
167 void createColoringProblem();
169 RCP<ColoringSolution<Adapter> > solution_;
174 template <
typename Adapter>
179 size_t nVtx = this->baseModel_->getLocalNumObjects();
190 std::string method = this->params_->template get<std::string>(
"color_method",
"SerialGreedy");
195 if (method.compare(
"SerialGreedy") == 0)
198 this->env_, this->comm_);
199 alg.
color(this->solution_);
202 else if (method.compare(
"speculative") == 0)
204 AlgGM<base_adapter_t> alg(this->graphModel_, this->comm_);
205 alg.color(this->solution_, this->params_);
225 template <
typename Adapter>
229 using Teuchos::ParameterList;
244 std::bitset<NUM_MODEL_FLAGS> graphFlags;
245 std::bitset<NUM_MODEL_FLAGS> idFlags;
253 this->baseInputAdapter_, this->envConst_, this->comm_, graphFlags));
265 <<
" not yet supported." << std::endl;
Zoltan2::BaseAdapter< userTypes_t > base_adapter_t
ColoringProblem sets up coloring problems for the user.
Adapter::scalar_t scalar_t
ModelType
An identifier for the general type of model.
#define Z2_FORWARD_EXCEPTIONS
Forward an exception back through call stack.
void solve(bool updateInputData=true)
Direct the problem to create a solution.
ColoringSolution< Adapter > * getSolution()
Get the solution to the problem.
Adapter::base_adapter_t base_adapter_t
void color(const RCP< ColoringSolution< Adapter > > &solution)
Coloring method.
algorithm requires no self edges
Problem base class from which other classes (PartitioningProblem, ColoringProblem, OrderingProblem, MatchingProblem, etc.) derive.
Defines the Problem base class.
static void getValidParameters(ParameterList &pl)
Set up validators specific to this Problem.
GraphModel defines the interface required for graph models.
Gathering definitions used in software development.
The base class for all model classes.
Defines the ColoringSolution class.
ColoringProblem(Adapter *A, ParameterList *p)
Constructor that uses a default communicator.
Defines the GraphModel interface.
model represents graph within only one rank
#define __func__zoltan2__
virtual ~ColoringProblem()
Destructor.
The class containing coloring solution.