Alien  1.3.0
Developer documentation
Loading...
Searching...
No Matches
data/CompositeMatrix.h
Go to the documentation of this file.
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
23
24#pragma once
25
26#include <alien/data/IMatrix.h>
27#include <alien/kernels/composite/CompositeMatrixElement.h>
28
29/*---------------------------------------------------------------------------*/
30/*---------------------------------------------------------------------------*/
31
32namespace Alien
33{
34
35/*---------------------------------------------------------------------------*/
36/*---------------------------------------------------------------------------*/
37
38namespace CompositeKernel
39{
40
41 /*---------------------------------------------------------------------------*/
42 /*---------------------------------------------------------------------------*/
43
44 class Matrix;
45 class MultiMatrixImpl;
46
47 /*---------------------------------------------------------------------------*/
48 /*---------------------------------------------------------------------------*/
49
50} // namespace CompositeKernel
51
52/*---------------------------------------------------------------------------*/
53/*---------------------------------------------------------------------------*/
54
64class ALIEN_EXPORT CompositeMatrix : public IMatrix
65{
66 public:
69
70 public:
73
78 CompositeMatrix(Arccore::Integer nc);
79
81 virtual ~CompositeMatrix() {}
82
87 void visit(ICopyOnWriteMatrix& visit) const;
88
93 void resize(Arccore::Integer nc);
94
99 Arccore::Integer size() const;
100
105 const ISpace& rowSpace() const;
106
111 const ISpace& colSpace() const;
112
119 Element composite(Arccore::Integer i, Arccore::Integer j);
120
127 IMatrix& operator()(Arccore::Integer i, Arccore::Integer j);
128
135 const IMatrix& operator()(Arccore::Integer i, Arccore::Integer j) const;
136
141 void setUserFeature(Arccore::String feature);
142
147 bool hasUserFeature(Arccore::String feature) const;
148
149 public:
155
160 const MultiMatrixImpl* impl() const;
161
163 void free();
164
166 void clear();
167
168 private:
170 std::shared_ptr<CompositeKernel::MultiMatrixImpl> m_impl;
173};
174
175/*---------------------------------------------------------------------------*/
176/*---------------------------------------------------------------------------*/
177
178extern ALIEN_EXPORT CompositeMatrix::Element CompositeElement(
179CompositeMatrix& m, Arccore::Integer i, Arccore::Integer j);
180
181/*---------------------------------------------------------------------------*/
182/*---------------------------------------------------------------------------*/
183
184} // namespace Alien
185
186/*---------------------------------------------------------------------------*/
187/*---------------------------------------------------------------------------*/
IMatrix.h.
Composite matrix for heterogenous matrices.
CompositeMatrix(Arccore::Integer nc)
Constructor.
MultiMatrixImpl * impl()
Get the multimatrix implementation.
CompositeKernel::Matrix & m_composite_matrix
The composite matrix.
void free()
Free the composite matrix.
void clear()
Clear the composite matrix.
void setUserFeature(Arccore::String feature)
Add a feature to the composite matrix.
CompositeKernel::MatrixElement Element
Type of submatrix element.
virtual ~CompositeMatrix()
Free resources.
std::shared_ptr< CompositeKernel::MultiMatrixImpl > m_impl
The multimatrix implementation.
const IMatrix & operator()(Arccore::Integer i, Arccore::Integer j) const
Get the (i,j) submatrix.
IMatrix & operator()(Arccore::Integer i, Arccore::Integer j)
Get the (i,j) submatrix.
bool hasUserFeature(Arccore::String feature) const
Check if the composite matrix has a feature.
IMatrix()
Constructor.
Definition IMatrix.h:54
Interface for algebraic space objects.
Definition ISpace.h:44
Multi matrices representation container.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Definition BackEnd.h:17