Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
MetisGraph.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* MetisGraph.h (C) 2000-2024 */
9/* */
10/* Management of a Metis graph. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_STD_METISGRAPH
13#define ARCANE_STD_METISGRAPH
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/Array.h"
18#include "arcane/utils/ArrayView.h"
19#include <parmetis.h>
20
21/*---------------------------------------------------------------------------*/
22/*---------------------------------------------------------------------------*/
23namespace Arcane
24{
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
30{
31 int nb_vertices = 0;
32 bool have_vsize = false;
33 bool have_adjwgt = false;
35 UniqueArray<idx_t> adjncy;
38 UniqueArray<idx_t> adjwgt;
40};
41
42/*---------------------------------------------------------------------------*/
43/*---------------------------------------------------------------------------*/
44
45class MetisGraphView
46{
47 public:
48
49 MetisGraphView() = default;
50
51 MetisGraphView(MetisGraph& graph)
52 : nb_vertices(graph.nb_vertices)
53 , have_vsize(graph.have_vsize)
54 , have_adjwgt(graph.have_adjwgt)
55 , xadj(graph.xadj)
56 , adjncy(graph.adjncy)
57 , vwgt(graph.vwgt)
58 , vsize(graph.vsize)
59 , adjwgt(graph.adjwgt)
60 , part(graph.part)
61 {}
62
63 public:
64
65 int nb_vertices = 0;
66 bool have_vsize = false;
67 bool have_adjwgt = false;
69 ArrayView<idx_t> adjncy;
71 ArrayView<idx_t> vsize;
72 ArrayView<idx_t> adjwgt;
74};
75
76/*---------------------------------------------------------------------------*/
77/*---------------------------------------------------------------------------*/
78
79} // End namespace Arcane
80
81/*---------------------------------------------------------------------------*/
82/*---------------------------------------------------------------------------*/
83
84#endif
Modifiable view of an array of type T.
1D data vector with value semantics (STL style).
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --