Alien  1.3.0
Developer documentation
Loading...
Searching...
No Matches
RedistributedMatrix.cc
1/*
2 * Copyright 2020 IFPEN-CEA
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 * SPDX-License-Identifier: Apache-2.0
17 */
18
19#include <alien/ref/data/scalar/RedistributedMatrix.h>
20
22
23/*---------------------------------------------------------------------------*/
24/*---------------------------------------------------------------------------*/
25
26namespace Alien
27{
28
29using namespace Arccore;
30
31/*---------------------------------------------------------------------------*/
32/*---------------------------------------------------------------------------*/
33
34RedistributedMatrix::RedistributedMatrix(IMatrix& matrix, Redistributor& redist)
35: m_impl(redist.redistribute(matrix.impl()))
36{}
37
38RedistributedMatrix::~RedistributedMatrix() {}
39
40/*---------------------------------------------------------------------------*/
41
43{
44 v.accept(m_impl);
45}
46
47/*---------------------------------------------------------------------------*/
48
50RedistributedMatrix::distribution() const
51{
52 return m_impl->distribution();
53}
54
55/*---------------------------------------------------------------------------*/
56
57const ISpace&
59{
60 return m_impl->rowSpace();
61}
62
63/*---------------------------------------------------------------------------*/
64
65const ISpace&
67{
68 return m_impl->colSpace();
69}
70
71/*---------------------------------------------------------------------------*/
72
73void RedistributedMatrix::setUserFeature(String feature)
74{
75 m_impl->setFeature(feature);
76}
77
78/*---------------------------------------------------------------------------*/
79
80bool RedistributedMatrix::hasUserFeature(String feature) const
81{
82 return m_impl->hasFeature(feature);
83}
84
85/*---------------------------------------------------------------------------*/
86
87MultiMatrixImpl*
89{
90 if (!m_impl) {
91 m_impl.reset(new MultiMatrixImpl());
92 }
93 /* JMG ????
94 else if (!m_impl.unique()) { // Need to clone due to other references.
95 m_impl.reset(m_impl->clone());
96 } */
97 return m_impl.get();
98}
99
100/*---------------------------------------------------------------------------*/
101
102const MultiMatrixImpl*
104{
105 return m_impl.get();
106}
107
108/*---------------------------------------------------------------------------*/
109/*---------------------------------------------------------------------------*/
110
111} // namespace Alien
112
113/*---------------------------------------------------------------------------*/
114/*---------------------------------------------------------------------------*/
MultiMatrixImpl.h.
Interface for all matrices.
Definition IMatrix.h:51
Interface for algebraic space objects.
Definition ISpace.h:44
Computes a matrix distribution.
Multi matrices representation container.
void visit(ICopyOnWriteMatrix &) const
Visit method.
MultiMatrixImpl * impl()
Get the multimatrix implementation.
const ISpace & colSpace() const
Get col space associated to the matrix.
const ISpace & rowSpace() const
Get row space associated to the matrix.
Change MultiObj current representation to another communicator.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Definition BackEnd.h:17