50 #ifndef _ZOLTAN2_COLORINGPROBLEM_HPP_ 51 #define _ZOLTAN2_COLORINGPROBLEM_HPP_ 87 template<
typename Adapter>
93 typedef typename Adapter::gno_t
gno_t;
94 typedef typename Adapter::lno_t
lno_t;
95 typedef typename Adapter::user_t
user_t;
98 #ifdef HAVE_ZOLTAN2_MPI 99 typedef Teuchos::OpaqueWrapper<MPI_Comm> mpiWrapper_t;
109 const Teuchos::RCP<
const Teuchos::Comm<int> > &comm) :
113 createColoringProblem();
116 #ifdef HAVE_ZOLTAN2_MPI 121 rcp<
const Comm<int> >(
new Teuchos::MpiComm<int>(
122 Teuchos::opaqueWrapper(mpicomm))))
136 RCP<Teuchos::StringValidator> color_method_Validator = Teuchos::rcp(
137 new Teuchos::StringValidator(
138 Teuchos::tuple<std::string>(
"SerialGreedy" )));
139 pl.set(
"color_method",
"SerialGreedy",
"coloring algorithm",
140 color_method_Validator);
159 void solve(
bool updateInputData=
true);
167 return solution_.getRawPtr();
171 void createColoringProblem();
173 RCP<ColoringSolution<Adapter> > solution_;
178 template <
typename Adapter>
183 size_t nVtx = this->
baseModel_->getLocalNumObjects();
194 std::string method = this->
params_->template get<std::string>(
"color_method",
"SerialGreedy");
199 if (method.compare(
"SerialGreedy") == 0)
203 alg.
color(this->solution_);
206 else if (method.compare(
"speculative") == 0)
209 alg.color(this->solution_, this->
params_);
229 template <
typename Adapter>
233 using Teuchos::ParameterList;
248 std::bitset<NUM_MODEL_FLAGS> graphFlags;
249 std::bitset<NUM_MODEL_FLAGS> idFlags;
269 <<
" not yet supported." << std::endl;
RCP< GraphModel< base_adapter_t > > graphModel_
Zoltan2::BaseAdapter< userTypes_t > base_adapter_t
ColoringProblem(Adapter *A, ParameterList *p, const Teuchos::RCP< const Teuchos::Comm< int > > &comm)
Constructor that uses a Teuchos::Comm.
RCP< const base_adapter_t > baseInputAdapter_
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
RCP< const Comm< int > > comm_
void color(const RCP< ColoringSolution< Adapter > > &solution)
Coloring method.
algorithm requires no self edges
RCP< const Comm< int > > getComm()
Return the communicator used by the problem.
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.
RCP< ParameterList > params_
Defines the ColoringSolution class.
ColoringProblem(Adapter *A, ParameterList *p)
Constructor that uses a default communicator.
Defines the GraphModel interface.
RCP< const Model< base_adapter_t > > baseModel_
model represents graph within only one rank
RCP< const Environment > envConst_
#define __func__zoltan2__
virtual ~ColoringProblem()
Destructor.
The class containing coloring solution.