Zoltan2
Toggle main menu visibility
Loading...
Searching...
No Matches
Zoltan2_AlgNatural.hpp
Go to the documentation of this file.
1
// @HEADER
2
// *****************************************************************************
3
// Zoltan2: A package of combinatorial algorithms for scientific computing
4
//
5
// Copyright 2012 NTESS and the Zoltan2 contributors.
6
// SPDX-License-Identifier: BSD-3-Clause
7
// *****************************************************************************
8
// @HEADER
9
10
#ifndef _ZOLTAN2_ALGNATURAL_HPP_
11
#define _ZOLTAN2_ALGNATURAL_HPP_
12
13
#include <
Zoltan2_Algorithm.hpp
>
14
#include <
Zoltan2_IdentifierModel.hpp
>
15
#include <
Zoltan2_OrderingSolution.hpp
>
16
17
18
namespace
Zoltan2
{
19
24
25
template
<
typename
Adapter>
26
class
AlgNatural
:
public
Algorithm
<Adapter>
27
{
28
private
:
29
30
const
RCP<const typename Adapter::base_adapter_t> adapter;
31
const
RCP<Teuchos::ParameterList> pl;
32
const
RCP<const Teuchos::Comm<int> > comm;
33
const
RCP<const Environment> env;
34
35
public
:
36
37
typedef
typename
Adapter::lno_t
lno_t
;
38
typedef
typename
Adapter::gno_t
gno_t
;
39
40
AlgNatural
(
41
const
RCP<const typename Adapter::base_adapter_t> &adapter__,
42
const
RCP<Teuchos::ParameterList> &pl__,
43
const
RCP<
const
Teuchos::Comm<int> > &comm__,
44
const
RCP<const Environment> &env__
45
) : adapter(adapter__), pl(pl__), comm(comm__), env(env__)
46
{
47
}
48
49
int
globalOrder
(
const
RCP<
GlobalOrderingSolution<gno_t>
> &
/* solution */
) {
50
throw
std::logic_error(
"AlgNatural does not yet support global ordering."
);
51
}
52
53
int
localOrder
(
const
RCP<
LocalOrderingSolution<lno_t>
> &solution)
54
{
55
56
int
ierr= 0;
57
58
HELLO
;
59
60
// Local permutation only for now.
61
62
// Set identity permutation.
63
modelFlag_t
modelFlags;
64
const
auto
model = rcp(
new
IdentifierModel<Adapter>
(adapter, env, comm, modelFlags));
65
const
size_t
n = model->getLocalNumIdentifiers();
66
lno_t
*perm = solution->getPermutationView();
67
if
(perm){
68
for
(
size_t
i=0; i<n; i++){
69
perm[i] = i;
70
}
71
}
72
else
73
// TODO: throw exception?
74
ierr = -1;
75
76
solution->setHavePerm(
true
);
77
return
ierr;
78
79
}
80
81
};
82
}
83
#endif
Zoltan2_Algorithm.hpp
Zoltan2_IdentifierModel.hpp
Defines the IdentifierModel interface.
Zoltan2_OrderingSolution.hpp
Defines the OrderingSolution class.
HELLO
#define HELLO
Definition
Zoltan2_Standards.hpp:96
Zoltan2::AlgNatural::localOrder
int localOrder(const RCP< LocalOrderingSolution< lno_t > > &solution)
Ordering method.
Definition
Zoltan2_AlgNatural.hpp:53
Zoltan2::AlgNatural::globalOrder
int globalOrder(const RCP< GlobalOrderingSolution< gno_t > > &)
Ordering method.
Definition
Zoltan2_AlgNatural.hpp:49
Zoltan2::AlgNatural::gno_t
Adapter::gno_t gno_t
Definition
Zoltan2_AlgNatural.hpp:38
Zoltan2::AlgNatural::lno_t
Adapter::lno_t lno_t
Definition
Zoltan2_AlgNatural.hpp:37
Zoltan2::AlgNatural::AlgNatural
AlgNatural(const RCP< const typename Adapter::base_adapter_t > &adapter__, const RCP< Teuchos::ParameterList > &pl__, const RCP< const Teuchos::Comm< int > > &comm__, const RCP< const Environment > &env__)
Definition
Zoltan2_AlgNatural.hpp:40
Zoltan2::Algorithm
Algorithm defines the base class for all algorithms.
Definition
Zoltan2_Algorithm.hpp:42
Zoltan2::GlobalOrderingSolution
Definition
Zoltan2_OrderingSolution.hpp:358
Zoltan2::IdentifierModel
IdentifierModel defines the interface for all identifier models.
Definition
Zoltan2_IdentifierModel.hpp:35
Zoltan2::LocalOrderingSolution
Definition
Zoltan2_OrderingSolution.hpp:351
Zoltan2
Created by mbenlioglu on Aug 31, 2020.
Definition
Zoltan2_AlgHybrid2GL.hpp:47
Zoltan2::modelFlag_t
std::bitset< NUM_MODEL_FLAGS > modelFlag_t
Definition
Zoltan2_Model.hpp:57
core
src
algorithms
order
Zoltan2_AlgNatural.hpp
Generated by
1.17.0