Alien  1.3.0
User documentation
Loading...
Searching...
No Matches
kernels/composite/CompositeMatrix.h
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#pragma once
20
21#include <vector>
22
24#include <alien/data/IMatrix.h>
25#include <alien/data/Space.h>
26#include <alien/kernels/composite/CompositeBackEnd.h>
27#include <alien/kernels/composite/CompositeMatrixElement.h>
28#include <alien/kernels/composite/CompositeSpace.h>
29
30/*---------------------------------------------------------------------------*/
31/*---------------------------------------------------------------------------*/
32
33namespace Alien
34{
35
36/*---------------------------------------------------------------------------*/
37/*---------------------------------------------------------------------------*/
38
39namespace CompositeKernel
40{
41
42 class MultiMatrixImpl;
43
44 /*---------------------------------------------------------------------------*/
45 /*---------------------------------------------------------------------------*/
46
47 class ALIEN_EXPORT Matrix : public IMatrixImpl
48 {
49 public:
50 //! Constructor from a composite
51 Matrix(MultiMatrixImpl* multi_impl);
52
53 //! Constructor, converting data
54 //! @throw Not implemented yet
55 Matrix(const Alien::MultiMatrixImpl* multi_impl);
56
57 void clear();
58
59 void free();
60
61 void resize(Integer nc);
62
63 Integer size() const;
64
65 MatrixElement element(Integer i, Integer j);
66
67 IMatrix& operator()(Integer i, Integer j);
68
69 const IMatrix& operator()(Integer i, Integer j) const;
70
71 void setComposite(Integer i, Integer j, IMatrix* m);
72
73 private:
74 Integer m_nb_composite;
75
76 std::vector<std::shared_ptr<IMatrix>> m_matrices;
77
78 CompositeKernel::Space m_row_space;
79 CompositeKernel::Space m_col_space;
80 };
81
82 /*---------------------------------------------------------------------------*/
83 /*---------------------------------------------------------------------------*/
84
85} // namespace CompositeKernel
86
87/*---------------------------------------------------------------------------*/
88/*---------------------------------------------------------------------------*/
89
90} // namespace Alien
91
92/*---------------------------------------------------------------------------*/
93/*---------------------------------------------------------------------------*/
IMatrixImpl.h.
IMatrix.h.
Space.h.
Matrix(MultiMatrixImpl *multi_impl)
Constructor from a composite.
IMatrixImpl(const MultiMatrixImpl *multi_impl, BackEndId backend="")
Constructor.
Interface for all matrices.
Definition IMatrix.h:51
Multi matrices representation container.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Definition BackEnd.h:17