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();
144 void solve(
bool updateInputData=
true);
152 return solution_.getRawPtr();
156 void createColoringProblem();
158 RCP<ColoringSolution<Adapter> > solution_;
160 RCP<Comm<int> > problemComm_;
161 RCP<const Comm<int> > problemCommConst_;
167 template <
typename Adapter>
172 size_t nVtx = this->
baseModel_->getLocalNumObjects();
183 std::string method = this->
params_->template get<std::string>(
"color_method",
"SerialGreedy");
188 if (method.compare(
"SerialGreedy") == 0)
191 this->
env_, problemComm_);
192 alg.
color(this->solution_);
195 else if (method.compare(
"speculative") == 0)
197 AlgGM<base_adapter_t> alg(this->
graphModel_, problemComm_);
198 alg.color(this->solution_, this->
params_);
218 template <
typename Adapter>
222 using Teuchos::ParameterList;
230 problemComm_ = this->
comm_->duplicate();
231 problemCommConst_ = rcp_const_cast<
const Comm<int> > (problemComm_);
240 std::bitset<NUM_MODEL_FLAGS> graphFlags;
241 std::bitset<NUM_MODEL_FLAGS> idFlags;
261 <<
" not yet supported." << std::endl;
RCP< GraphModel< base_adapter_t > > graphModel_
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
Problem base class from which other classes (PartitioningProblem, ColoringProblem, OrderingProblem, MatchingProblem, etc.) derive.
Defines the Problem base class.
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.