Zoltan2
Loading...
Searching...
No Matches
Zoltan2_MatchingSolution.hpp
Go to the documentation of this file.
1#if 0
2// @HEADER
3// *****************************************************************************
4// Zoltan2: A package of combinatorial algorithms for scientific computing
5//
6// Copyright 2012 NTESS and the Zoltan2 contributors.
7// SPDX-License-Identifier: BSD-3-Clause
8// *****************************************************************************
9// @HEADER
10
15#ifndef _ZOLTAN2_MATCHINGSOLUTION_HPP_
16#define _ZOLTAN2_MATCHINGSOLUTION_HPP_
17
18#include <Zoltan2_Standards.hpp>
19#include <Zoltan2_Solution.hpp>
20
21namespace Zoltan2 {
22
34template <typename Adapter>
35 class MatchingSolution : public Solution
36{
37private:
38 typedef typename Adapter::gno_t gno_t;
39 typedef typename Adapter::scalar_t scalar_t;
40 typedef typename Adapter::lno_t lno_t;
41
42public:
43
46 MatchingSolution(
47 size_t length // This should be equal to nlids. TODO: Optional?
48 )
49 {
50 HELLO;
51 length_ = length;
52 colors_ = ArrayRCP<int>(length_);
53 }
54
56 // Accessor functions, allowing algorithms to get ptrs to solution memory.
57 // Algorithms can then load the memory.
58 // Non-RCP versions are provided for applications to use.
59
62 inline size_t getMatchsSize() {return length_;}
63
66 inline ArrayRCP<int> &getMatchsRCP() {return colors_;}
67
70 inline int * getMatchs() {return &(*colors_);}
71
75 int getNumColors()
76 {
77 int maxColor = 0;
78 for (size_t i=0; i<length_; i++){
79 if (colors_[i] > maxColor)
80 maxColor = colors_[i];
81 }
82 return maxColor;
83 }
84
87 //int getGlobalNumColors(); // TODO
88
89protected:
90 // Matching solution consists of permutation vector(s).
91 size_t length_;
92 ArrayRCP<int> colors_; // zero-based local color array
93 //int numMatchs_; // Number of colors (local on this proc)
94 //int numMatchsGlobal_; // For future distributed coloring
95};
96
97}
98
99#endif
100#endif
Defines the Solution base class.
Gathering definitions used in software development.
#define HELLO
map_t::local_ordinal_type lno_t
map_t::global_ordinal_type gno_t
Created by mbenlioglu on Aug 31, 2020.