Zoltan2
Toggle main menu visibility
Loading...
Searching...
No Matches
Zoltan2_AlgSpectral.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_ALGSPECTRAL_HPP_
11
#define _ZOLTAN2_ALGSPECTRAL_HPP_
12
13
#include <
Zoltan2_Algorithm.hpp
>
14
#include <
Zoltan2_GraphModel.hpp
>
15
#include <
Zoltan2_OrderingSolution.hpp
>
16
17
22
23
24
namespace
Zoltan2
{
25
26
template
<
typename
Adapter>
27
int
AlgSpectral
(
28
const
RCP<
GraphModel<Adapter>
> &model,
29
//const RCP<Adapter> &matrixadapter, // Hack: Use matrix adapter directly
30
31
// TO DO - update this algorithm to have the proper formatting like
32
// the others.
33
const
RCP<
LocalOrderingSolution<typename Adapter::lno_t>
>
34
&solution,
35
const
RCP<Teuchos::ParameterList> &pl,
36
const
RCP<
const
Teuchos::Comm<int> > &comm
37
)
38
{
39
#ifndef INCLUDE_ZOLTAN2_EXPERIMENTAL
40
41
Z2_THROW_EXPERIMENTAL
(
"Zoltan2 Spectral ordering is strictly "
42
"experimental software "
43
"while it is being developed and tested."
)
44
45
#else
//INCLUDE_ZOLTAN2_EXPERIMENTAL
46
47
typedef
typename
Adapter::lno_t
lno_t
;
48
typedef
typename
Adapter::gno_t
gno_t
;
49
typedef
typename
Adapter::offset_t
offset_t
;
50
typedef
typename
Adapter::scalar_t
scalar_t
;
51
52
int
ierr= 0;
53
54
HELLO
;
55
56
// TODO: Check params to do local or global ordering.
57
bool
localOrder =
true
;
58
59
const
size_t
nVtx = model->getLocalNumVertices();
60
lno_t
*perm = solution->getPermutationView();
61
for
(
lno_t
i=0; i<nVtx; i++){
62
perm[i] = -1;
63
}
64
65
// Get local graph.
66
ArrayView<const gno_t> edgeIds;
67
ArrayView<const offset_t> offsets;
68
ArrayView<StridedData<lno_t, scalar_t> > wgts;
69
70
model->getEdgeList(edgeIds, offsets, wgts);
71
72
//cout << "Debug: Local graph from getLocalEdgeList" << endl;
73
//cout << "edgeIds: " << edgeIds << endl;
74
//cout << "offsets: " << offsets << endl;
75
76
// Form the graph Laplacian: L = D-A
77
// Create a new Tpetra matrix, but use views of existing data when possible.
78
// TODO
79
80
// TODO: Find smallest eigenvalues using Anasazi
81
82
// TODO: Sort Fiedler vector.
83
84
solution->setHavePerm(
true
);
85
return
ierr;
86
#endif
// INCLUDE_ZOLTAN2_EXPERIMENTAL
87
}
88
89
}
90
#endif
Zoltan2_Algorithm.hpp
Z2_THROW_EXPERIMENTAL
#define Z2_THROW_EXPERIMENTAL(mystr)
Throw an error when experimental code is requested but not compiled.
Definition
Zoltan2_Exceptions.hpp:85
Zoltan2_GraphModel.hpp
Defines the GraphModel interface.
Zoltan2_OrderingSolution.hpp
Defines the OrderingSolution class.
HELLO
#define HELLO
Definition
Zoltan2_Standards.hpp:96
Zoltan2::GraphModel
GraphModel defines the interface required for graph models.
Definition
Zoltan2_GraphModel.hpp:45
Zoltan2::LocalOrderingSolution
Definition
Zoltan2_OrderingSolution.hpp:351
Zoltan2
Created by mbenlioglu on Aug 31, 2020.
Definition
Zoltan2_AlgHybrid2GL.hpp:47
Zoltan2::AlgSpectral
int AlgSpectral(const RCP< GraphModel< Adapter > > &model, const RCP< LocalOrderingSolution< typename Adapter::lno_t > > &solution, const RCP< Teuchos::ParameterList > &pl, const RCP< const Teuchos::Comm< int > > &comm)
Definition
Zoltan2_AlgSpectral.hpp:27
Zoltan2::lno_t
core
src
algorithms
order
Zoltan2_AlgSpectral.hpp
Generated by
1.17.0