Alien  1.3.0
Developer documentation
Loading...
Searching...
No Matches
ExtractionIndices.cc
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#include "ExtractionIndices.h"
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
29namespace Alien
30{
31
32using namespace Arccore;
33
34/*---------------------------------------------------------------------------*/
35/*---------------------------------------------------------------------------*/
36
37ExtractionIndices::ExtractionIndices(const Integer rowStart, const Integer rowRange,
38 const Integer colStart, const Integer colRange)
39: m_starting_row(rowStart)
40, m_starting_col(colStart)
41, m_row_range(rowRange)
42, m_col_range(colRange)
43{}
44
45/*---------------------------------------------------------------------------*/
46/*---------------------------------------------------------------------------*/
47
49
50/*---------------------------------------------------------------------------*/
51/*---------------------------------------------------------------------------*/
52
53Integer
58
59/*---------------------------------------------------------------------------*/
60/*---------------------------------------------------------------------------*/
61
62Integer
64{
65 return m_row_range;
66}
67
68/*---------------------------------------------------------------------------*/
69/*---------------------------------------------------------------------------*/
70
71Integer
76
77/*---------------------------------------------------------------------------*/
78/*---------------------------------------------------------------------------*/
79
80Integer
82{
83 return m_col_range;
84}
85
86/*---------------------------------------------------------------------------*/
87/*---------------------------------------------------------------------------*/
88
89Integer
90ExtractionIndices::toLocalRow(const Integer uid) const
91{
92 return uid - m_starting_row;
93}
94
95/*---------------------------------------------------------------------------*/
96/*---------------------------------------------------------------------------*/
97
98Integer
99ExtractionIndices::toLocalCol(const Integer uid) const
100{
101 return uid - m_starting_col;
102}
103
104/*---------------------------------------------------------------------------*/
105/*---------------------------------------------------------------------------*/
106
107} // namespace Alien
108
109/*---------------------------------------------------------------------------*/
110/*---------------------------------------------------------------------------*/
ExtractionIndices.h.
Arccore::Integer m_starting_row
Index of the starting row.
Arccore::Integer rowStart() const
Get the index of the starting row.
Arccore::Integer rowRange() const
Get the length of the row.
~ExtractionIndices()
Free resources.
Arccore::Integer colStart() const
Get the index of the starting col.
Arccore::Integer m_col_range
Length of the col.
Arccore::Integer m_row_range
Length of the row.
Arccore::Integer m_starting_col
Index of the starting col.
Arccore::Integer toLocalCol(const Arccore::Integer uid) const
Get the local index of a col given a global index.
Arccore::Integer toLocalRow(const Arccore::Integer uid) const
Get the local index of a row given a global index.
Arccore::Integer colRange() const
Get the length of the col.
ExtractionIndices(const Arccore::Integer rowStart, const Arccore::Integer rowRange, const Arccore::Integer colStart=-1, const Arccore::Integer colRange=-1)
Constructor.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Definition BackEnd.h:17