Alien  1.3.0
User documentation
Loading...
Searching...
No Matches
VBlock.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
19/*!
20 * \file VBlock.h
21 * \brief VBlock.h
22 */
23
24#pragma once
25
27#include <alien/utils/Precomp.h>
28#include <alien/utils/VMap.h>
29
30/*---------------------------------------------------------------------------*/
31/*---------------------------------------------------------------------------*/
32
33namespace Alien
34{
35
36/*---------------------------------------------------------------------------*/
37/*---------------------------------------------------------------------------*/
38
39/*!
40 * \ingroup block
41 * \brief Variable size block elements for block matrices
42 *
43 * Defines blocks parameters that may be different for each block
44 */
45class ALIEN_EXPORT VBlock final
46{
47 public:
48 //! Type of the size of each block
50
51 public:
52 /*!
53 * \brief Rvalue constructor
54 * \param[in] all_blocks_sizes Block size for all blocks
55 */
56 VBlock(ValuePerBlock&& all_blocks_sizes);
57
58 /*!
59 * \brief Ref constructor
60 * \param[in] all_blocks_sizes Block size for all blocks
61 */
62 VBlock(const ValuePerBlock& all_blocks_sizes);
63
64 //! Free resources
66
67 /*!
68 * \brief Copy constructor
69 * \param[in] block The block to copy
70 */
71 VBlock(const VBlock& block);
72
73 private:
74 VBlock(VBlock&& block) = delete;
75 VBlock& operator=(const VBlock& block) = delete;
76
77 public:
78 /*!
79 * \brief Get the size of a block
80 * \param[in] index The index of the block the size is requested
81 * \returns The size of the block
82 */
83 Arccore::Integer size(Arccore::Integer index) const;
84
85 /*!
86 * \brief Get the max size of all block size
87 * \returns The max block size
88 */
89 Arccore::Integer maxBlockSize() const;
90
91 /*!
92 * \brief Get the size of all blocks
93 * \returns All blocks size information
94 */
95 const ValuePerBlock& blockSizes() const;
96
97 /*!
98 * \brief Copy this object
99 * \returns A copy of this object
100 */
101 std::shared_ptr<VBlock> clone() const;
102
103 private:
104 struct Internal;
105 //! Actual implementation of variable blocks size
106 std::shared_ptr<Internal> m_internal;
107};
108
109/*---------------------------------------------------------------------------*/
110/*---------------------------------------------------------------------------*/
111
112} // namespace Alien
113
114/*---------------------------------------------------------------------------*/
115/*---------------------------------------------------------------------------*/
MatrixDistribution.h.
Variable size block elements for block matrices.
Definition VBlock.h:46
~VBlock()
Free resources.
Definition VBlock.h:65
VBlock(ValuePerBlock &&all_blocks_sizes)
Rvalue constructor.
Definition VBlock.cc:98
VMap< Arccore::Integer, Arccore::Integer > ValuePerBlock
Type of the size of each block.
Definition VBlock.h:49
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Definition BackEnd.h:17