Alien  1.3.0
User documentation
Loading...
Searching...
No Matches
IMatrixImpl.h
Go to the documentation of this file.
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/*!
9 * \file IMatrixImpl.h
10 * \brief IMatrixImpl.h
11 */
12
13#pragma once
14
15#include <arccore/base/String.h>
16
18#include <alien/utils/ObjectWithTrace.h>
19#include <alien/utils/Precomp.h>
20#include <alien/utils/time_stamp/Timestamp.h>
21
22/*---------------------------------------------------------------------------*/
23/*---------------------------------------------------------------------------*/
24
25namespace Alien
26{
27
28typedef String BackEndId;
29
30/*---------------------------------------------------------------------------*/
31/*---------------------------------------------------------------------------*/
32
33class MultiMatrixImpl;
34class ISpace;
35class Block;
36class VBlock;
37
38/*---------------------------------------------------------------------------*/
39/*---------------------------------------------------------------------------*/
40
41/*!
42 * \ingroup impl
43 * \brief Interface to handle abstract matrices implementation
44 */
45class ALIEN_EXPORT IMatrixImpl : public Timestamp
46, public ObjectWithTrace
47{
48 public:
49 //! Type of the values stored in the matrix
50 typedef Arccore::Real ValueType;
51
52 public:
53 /*!
54 * \brief Constructor
55 * \param[in] multi_impl Pointer to the multimatrix handler, null if not associated
56 * \param[in] backend Name of the underneath backend, empty string if not associated
57 */
58 explicit IMatrixImpl(const MultiMatrixImpl* multi_impl, BackEndId backend = "");
59
60 //! Free resources
61 virtual ~IMatrixImpl() override = default;
62
63 IMatrixImpl(const IMatrixImpl& src) = delete;
64 IMatrixImpl(IMatrixImpl&& src) = delete;
65 IMatrixImpl& operator=(const IMatrixImpl& src) = delete;
66 IMatrixImpl& operator=(IMatrixImpl&& src) = delete;
67
68 public:
69 //! Wipe out internal data.
70 virtual void clear() {}
71
72 /*!
73 * \brief Get the row space associated to the matrix
74 *\ returns The row space
75 */
76 virtual const ISpace& rowSpace() const;
77
78 /*!
79 * \brief Get the row space associated to the matrix
80 *\ returns The row space
81 */
82 virtual const ISpace& colSpace() const;
83
84 /*!
85 * \brief Get the distribution of the matrix
86 * \returns The matrix distribution
87 */
88 virtual const MatrixDistribution& distribution() const;
89
90 /*!
91 * Get the matrix backend id
92 * \returns The backend if associated to the matrix
93 */
94 virtual BackEndId backend() const { return m_backend; }
95
96 /*!
97 * \brief Get block datas of the matrix
98 *
99 * Get the block datas of the matrix. This method should be used only with uniform
100 * blocks matrices, otherwise il will return a nullptr
101 *
102 * \returns Block data for block matrices, nullptr for scalar and variable block
103 * matrices
104 */
105 virtual const Block* block() const;
106
107 /*!
108 * \brief Get block datas of the matrix
109 *
110 * Get the block datas of the matrix. This method should be used only with variable
111 * blocks matrices, otherwise il will return a nullptr
112 *
113 * \returns Block data for variable block matrices, nullptr for scalar and block
114 * matrices
115 */
116 virtual const VBlock* vblock() const;
117
118 /*!
119 * \brief Get row block datas of the matrix
120 *
121 * Get the row block datas of the matrix. This method should be used only with variable
122 * blocks matrices, otherwise il will return a nullptr
123 *
124 * \returns Rows block data for variable block matrices, nullptr for scalar and block
125 * matrices
126 */
127 virtual const VBlock* rowBlock() const;
128
129 /*!
130 * \brief Get col block datas of the matrix
131 *
132 * Get the col block datas of the matrix. This method should be used only with variable
133 * blocks matrices, otherwise il will return a nullptr
134 *
135 * \returns Cols block data for variable block matrices, nullptr for scalar and block
136 * matrices
137 */
138 virtual const VBlock* colBlock() const;
139
140 const MultiMatrixImpl* impls() const {
141 return m_multi_impl;
142 }
143 protected:
144 //! Pointer on matrices implementation
146 //! Backend id
147 BackEndId m_backend;
148};
149
150/*---------------------------------------------------------------------------*/
151/*---------------------------------------------------------------------------*/
152
153} // namespace Alien
154
155/*---------------------------------------------------------------------------*/
156/*---------------------------------------------------------------------------*/
MatrixDistribution.h.
Block elements for block matrices.
Definition Block.h:45
virtual void clear()
Wipe out internal data.
Definition IMatrixImpl.h:70
virtual BackEndId backend() const
Definition IMatrixImpl.h:94
BackEndId m_backend
Backend id.
Arccore::Real ValueType
Type of the values stored in the matrix.
Definition IMatrixImpl.h:50
const MultiMatrixImpl * m_multi_impl
Pointer on matrices implementation.
virtual ~IMatrixImpl() override=default
Free resources.
IMatrixImpl(const MultiMatrixImpl *multi_impl, BackEndId backend="")
Constructor.
Interface for algebraic space objects.
Definition ISpace.h:44
Computes a matrix distribution.
Multi matrices representation container.
Variable size block elements for block matrices.
Definition VBlock.h:46
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Definition BackEnd.h:17