All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CompactListListI.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "CompactListList.H"
27 #include "ListOps.H"
28 
29 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
30 
31 template<class T>
33 :
35  offsets_(label(1), label(0)),
36  m_()
37 {
39 }
40 
41 
42 template<class T>
44 (
45  const UList<label>& offsets,
46  const UList<T>& m
47 )
48 :
49  UCompactListList<T>(offsets, m),
50  offsets_(offsets),
51  m_(m)
52 {}
53 
54 
55 template<class T>
57 :
59  offsets_(lst.offsets_, reuse),
60  m_(lst.m_, reuse)
61 {
63 }
64 
65 
66 template<class T>
68 {
69  transfer(lst);
70 }
71 
72 
73 template<class T>
75 (
76  const label mRows,
77  const label nData,
78  const T& t
79 )
80 :
82  offsets_(mRows + 1, 0),
83  m_(nData, t)
84 {
86 }
87 
88 
89 template<class T>
92 {
94  (
95  new CompactListList<T>(*this)
96  );
97 }
98 
99 
100 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
101 
102 template<class T>
103 inline const Foam::CompactListList<T>&
105 {
106  return NullObjectRef<CompactListList<T>>();
107 }
108 
109 
110 template<class T>
111 inline void Foam::CompactListList<T>::resize(const label mRows)
112 {
113  this->setSize(mRows);
114 }
115 
116 
117 template<class T>
119 (
120  const label mRows,
121  const label nData
122 )
123 {
124  this->setSize(mRows, nData);
125 }
126 
127 
128 template<class T>
130 (
131  const label mRows,
132  const label nData,
133  const T& t
134 )
135 {
136  this->setSize(mRows, nData, t);
137 }
138 
139 
140 template<class T>
142 (
143  const labelUList& rowSizes
144 )
145 {
146  this->setSize(rowSizes);
147 }
148 
149 
150 template<class T>
151 template<class T2>
153 {
154  this->setSize(ll);
155 }
156 
157 
158 template<class T>
159 template<class T2>
161 {
162  this->setSize(ll);
163 }
164 
165 
166 // ************************************************************************* //
Various functions to operate on Lists.
A packed storage unstructured matrix of objects of type <T> using an offset table for access.
CompactListList()
Null constructor.
static const CompactListList< T > & null()
Return a null CompactListList.
void resize(const label mRows)
Reset size of CompactListList.
autoPtr< CompactListList< T > > clone() const
Clone.
Unallocated base class of CompactListList.
void shallowCopy(const UCompactListList< T > &)
Copy the ULists, but not the underlying data.
A List with indirect addressing.
Definition: UIndirectList.H:60
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
points setSize(newPointi)