Ginkgo Generated from branch based on master. Ginkgo version 1.8.0
A numerical linear algebra library targeting many-core architectures
Loading...
Searching...
No Matches
dense.hpp
1// SPDX-FileCopyrightText: 2017 - 2024 The Ginkgo authors
2//
3// SPDX-License-Identifier: BSD-3-Clause
4
5#ifndef GKO_PUBLIC_CORE_MATRIX_DENSE_HPP_
6#define GKO_PUBLIC_CORE_MATRIX_DENSE_HPP_
7
8
9#include <initializer_list>
10#include <type_traits>
11
12
13#include <ginkgo/core/base/array.hpp>
14#include <ginkgo/core/base/exception_helpers.hpp>
15#include <ginkgo/core/base/executor.hpp>
16#include <ginkgo/core/base/lin_op.hpp>
17#include <ginkgo/core/base/range_accessors.hpp>
18#include <ginkgo/core/base/types.hpp>
19#include <ginkgo/core/base/utils.hpp>
20#include <ginkgo/core/matrix/permutation.hpp>
21#include <ginkgo/core/matrix/scaled_permutation.hpp>
22
23
24namespace gko {
25namespace experimental {
26namespace distributed {
27
28
29template <typename ValueType>
30class Vector;
31
32
33}
34} // namespace experimental
35
36
37namespace matrix {
38
39
40template <typename ValueType, typename IndexType>
41class Coo;
42
43template <typename ValueType, typename IndexType>
44class Csr;
45
46template <typename ValueType>
47class Diagonal;
48
49template <typename ValueType, typename IndexType>
50class Ell;
51
52template <typename ValueType, typename IndexType>
53class Fbcsr;
54
55template <typename ValueType, typename IndexType>
56class Hybrid;
57
58template <typename ValueType, typename IndexType>
59class Sellp;
60
61template <typename ValueType, typename IndexType>
62class SparsityCsr;
63
64
80template <typename ValueType = default_precision>
81class Dense
82 : public EnableLinOp<Dense<ValueType>>,
83 public ConvertibleTo<Dense<next_precision<ValueType>>>,
84 public ConvertibleTo<Coo<ValueType, int32>>,
85 public ConvertibleTo<Coo<ValueType, int64>>,
86 public ConvertibleTo<Csr<ValueType, int32>>,
87 public ConvertibleTo<Csr<ValueType, int64>>,
88 public ConvertibleTo<Ell<ValueType, int32>>,
89 public ConvertibleTo<Ell<ValueType, int64>>,
90 public ConvertibleTo<Fbcsr<ValueType, int32>>,
91 public ConvertibleTo<Fbcsr<ValueType, int64>>,
92 public ConvertibleTo<Hybrid<ValueType, int32>>,
93 public ConvertibleTo<Hybrid<ValueType, int64>>,
94 public ConvertibleTo<Sellp<ValueType, int32>>,
95 public ConvertibleTo<Sellp<ValueType, int64>>,
96 public ConvertibleTo<SparsityCsr<ValueType, int32>>,
97 public ConvertibleTo<SparsityCsr<ValueType, int64>>,
98 public DiagonalExtractable<ValueType>,
99 public ReadableFromMatrixData<ValueType, int32>,
100 public ReadableFromMatrixData<ValueType, int64>,
101 public WritableToMatrixData<ValueType, int32>,
102 public WritableToMatrixData<ValueType, int64>,
103 public Transposable,
104 public Permutable<int32>,
105 public Permutable<int64>,
106 public EnableAbsoluteComputation<remove_complex<Dense<ValueType>>>,
107 public ScaledIdentityAddable {
108 friend class EnablePolymorphicObject<Dense, LinOp>;
109 friend class Coo<ValueType, int32>;
110 friend class Coo<ValueType, int64>;
111 friend class Csr<ValueType, int32>;
112 friend class Csr<ValueType, int64>;
113 friend class Diagonal<ValueType>;
114 friend class Ell<ValueType, int32>;
115 friend class Ell<ValueType, int64>;
116 friend class Fbcsr<ValueType, int32>;
117 friend class Fbcsr<ValueType, int64>;
118 friend class Hybrid<ValueType, int32>;
119 friend class Hybrid<ValueType, int64>;
120 friend class Sellp<ValueType, int32>;
121 friend class Sellp<ValueType, int64>;
122 friend class SparsityCsr<ValueType, int32>;
123 friend class SparsityCsr<ValueType, int64>;
124 friend class Dense<to_complex<ValueType>>;
125 friend class experimental::distributed::Vector<ValueType>;
126
127public:
128 using EnableLinOp<Dense>::convert_to;
129 using EnableLinOp<Dense>::move_to;
132 using ConvertibleTo<Coo<ValueType, int32>>::convert_to;
133 using ConvertibleTo<Coo<ValueType, int32>>::move_to;
134 using ConvertibleTo<Coo<ValueType, int64>>::convert_to;
135 using ConvertibleTo<Coo<ValueType, int64>>::move_to;
136 using ConvertibleTo<Csr<ValueType, int32>>::convert_to;
137 using ConvertibleTo<Csr<ValueType, int32>>::move_to;
138 using ConvertibleTo<Csr<ValueType, int64>>::convert_to;
139 using ConvertibleTo<Csr<ValueType, int64>>::move_to;
140 using ConvertibleTo<Ell<ValueType, int32>>::convert_to;
141 using ConvertibleTo<Ell<ValueType, int32>>::move_to;
142 using ConvertibleTo<Ell<ValueType, int64>>::convert_to;
143 using ConvertibleTo<Ell<ValueType, int64>>::move_to;
144 using ConvertibleTo<Fbcsr<ValueType, int32>>::convert_to;
145 using ConvertibleTo<Fbcsr<ValueType, int32>>::move_to;
146 using ConvertibleTo<Fbcsr<ValueType, int64>>::convert_to;
147 using ConvertibleTo<Fbcsr<ValueType, int64>>::move_to;
148 using ConvertibleTo<Hybrid<ValueType, int32>>::convert_to;
149 using ConvertibleTo<Hybrid<ValueType, int32>>::move_to;
150 using ConvertibleTo<Hybrid<ValueType, int64>>::convert_to;
151 using ConvertibleTo<Hybrid<ValueType, int64>>::move_to;
152 using ConvertibleTo<Sellp<ValueType, int32>>::convert_to;
153 using ConvertibleTo<Sellp<ValueType, int32>>::move_to;
154 using ConvertibleTo<Sellp<ValueType, int64>>::convert_to;
155 using ConvertibleTo<Sellp<ValueType, int64>>::move_to;
156 using ConvertibleTo<SparsityCsr<ValueType, int32>>::convert_to;
157 using ConvertibleTo<SparsityCsr<ValueType, int32>>::move_to;
158 using ConvertibleTo<SparsityCsr<ValueType, int64>>::convert_to;
159 using ConvertibleTo<SparsityCsr<ValueType, int64>>::move_to;
160 using ReadableFromMatrixData<ValueType, int32>::read;
161 using ReadableFromMatrixData<ValueType, int64>::read;
162
163 using value_type = ValueType;
164 using index_type = int64;
165 using transposed_type = Dense<ValueType>;
166 using mat_data = matrix_data<ValueType, int64>;
167 using mat_data32 = matrix_data<ValueType, int32>;
168 using device_mat_data = device_matrix_data<ValueType, int64>;
169 using device_mat_data32 = device_matrix_data<ValueType, int32>;
170 using absolute_type = remove_complex<Dense>;
171 using real_type = absolute_type;
172 using complex_type = to_complex<Dense>;
173
175
182 static std::unique_ptr<Dense> create_with_config_of(
184 {
185 // De-referencing `other` before calling the functions (instead of
186 // using operator `->`) is currently required to be compatible with
187 // CUDA 10.1.
188 // Otherwise, it results in a compile error.
189 return (*other).create_with_same_config();
190 }
191
203 static std::unique_ptr<Dense> create_with_type_of(
204 ptr_param<const Dense> other, std::shared_ptr<const Executor> exec,
205 const dim<2>& size = dim<2>{})
206 {
207 // See create_with_config_of()
208 return (*other).create_with_type_of_impl(exec, size, size[1]);
209 }
210
219 static std::unique_ptr<Dense> create_with_type_of(
220 ptr_param<const Dense> other, std::shared_ptr<const Executor> exec,
221 const dim<2>& size, size_type stride)
222 {
223 // See create_with_config_of()
224 return (*other).create_with_type_of_impl(exec, size, stride);
225 }
226
237 static std::unique_ptr<Dense> create_with_type_of(
238 ptr_param<const Dense> other, std::shared_ptr<const Executor> exec,
239 const dim<2>& size, const dim<2>& local_size, size_type stride)
240 {
241 // See create_with_config_of()
242 return (*other).create_with_type_of_impl(exec, size, stride);
243 }
244
253 static std::unique_ptr<Dense> create_view_of(ptr_param<Dense> other)
254 {
255 return other->create_view_of_impl();
256 }
257
265 static std::unique_ptr<const Dense> create_const_view_of(
267 {
268 return other->create_const_view_of_impl();
269 }
270
271 friend class Dense<next_precision<ValueType>>;
272
273 void convert_to(Dense<next_precision<ValueType>>* result) const override;
274
275 void move_to(Dense<next_precision<ValueType>>* result) override;
276
277 void convert_to(Coo<ValueType, int32>* result) const override;
278
279 void move_to(Coo<ValueType, int32>* result) override;
280
281 void convert_to(Coo<ValueType, int64>* result) const override;
282
283 void move_to(Coo<ValueType, int64>* result) override;
284
285 void convert_to(Csr<ValueType, int32>* result) const override;
286
287 void move_to(Csr<ValueType, int32>* result) override;
288
289 void convert_to(Csr<ValueType, int64>* result) const override;
290
291 void move_to(Csr<ValueType, int64>* result) override;
292
293 void convert_to(Ell<ValueType, int32>* result) const override;
294
295 void move_to(Ell<ValueType, int32>* result) override;
296
297 void convert_to(Ell<ValueType, int64>* result) const override;
298
299 void move_to(Ell<ValueType, int64>* result) override;
300
301 void convert_to(Fbcsr<ValueType, int32>* result) const override;
302
303 void move_to(Fbcsr<ValueType, int32>* result) override;
304
305 void convert_to(Fbcsr<ValueType, int64>* result) const override;
306
307 void move_to(Fbcsr<ValueType, int64>* result) override;
308
309 void convert_to(Hybrid<ValueType, int32>* result) const override;
310
311 void move_to(Hybrid<ValueType, int32>* result) override;
312
313 void convert_to(Hybrid<ValueType, int64>* result) const override;
314
315 void move_to(Hybrid<ValueType, int64>* result) override;
316
317 void convert_to(Sellp<ValueType, int32>* result) const override;
318
319 void move_to(Sellp<ValueType, int32>* result) override;
320
321 void convert_to(Sellp<ValueType, int64>* result) const override;
322
323 void move_to(Sellp<ValueType, int64>* result) override;
324
325 void convert_to(SparsityCsr<ValueType, int32>* result) const override;
326
327 void move_to(SparsityCsr<ValueType, int32>* result) override;
328
329 void convert_to(SparsityCsr<ValueType, int64>* result) const override;
330
331 void move_to(SparsityCsr<ValueType, int64>* result) override;
332
333 void read(const mat_data& data) override;
334
335 void read(const mat_data32& data) override;
336
337 void read(const device_mat_data& data) override;
338
339 void read(const device_mat_data32& data) override;
340
341 void read(device_mat_data&& data) override;
342
343 void read(device_mat_data32&& data) override;
344
345 void write(mat_data& data) const override;
346
347 void write(mat_data32& data) const override;
348
349 std::unique_ptr<LinOp> transpose() const override;
350
351 std::unique_ptr<LinOp> conj_transpose() const override;
352
359 void transpose(ptr_param<Dense> output) const;
360
368
374 void fill(const ValueType value);
375
390 std::unique_ptr<Dense> permute(
391 ptr_param<const Permutation<int32>> permutation,
393
397 std::unique_ptr<Dense> permute(
398 ptr_param<const Permutation<int64>> permutation,
400
406 void permute(ptr_param<const Permutation<int32>> permutation,
407 ptr_param<Dense> output, permute_mode mode) const;
408
413 void permute(ptr_param<const Permutation<int64>> permutation,
414 ptr_param<Dense> output, permute_mode mode) const;
415
429 std::unique_ptr<Dense> permute(
430 ptr_param<const Permutation<int32>> row_permutation,
431 ptr_param<const Permutation<int32>> column_permutation,
432 bool invert = false) const;
433
438 std::unique_ptr<Dense> permute(
439 ptr_param<const Permutation<int64>> row_permutation,
440 ptr_param<const Permutation<int64>> column_permutation,
441 bool invert = false) const;
442
449 void permute(ptr_param<const Permutation<int32>> row_permutation,
450 ptr_param<const Permutation<int32>> column_permutation,
451 ptr_param<Dense> output, bool invert = false) const;
452
457 void permute(ptr_param<const Permutation<int64>> row_permutation,
458 ptr_param<const Permutation<int64>> column_permutation,
459 ptr_param<Dense> output, bool invert = false) const;
460
470 std::unique_ptr<Dense> scale_permute(
473
478 std::unique_ptr<Dense> scale_permute(
481
490 ptr_param<Dense> output, permute_mode mode) const;
491
498 ptr_param<Dense> output, permute_mode mode) const;
499
512 std::unique_ptr<Dense> scale_permute(
513 ptr_param<const ScaledPermutation<value_type, int32>> row_permutation,
515 column_permutation,
516 bool invert = false) const;
517
522 std::unique_ptr<Dense> scale_permute(
523 ptr_param<const ScaledPermutation<value_type, int64>> row_permutation,
525 column_permutation,
526 bool invert = false) const;
527
535 ptr_param<const ScaledPermutation<value_type, int32>> row_permutation,
537 column_permutation,
538 ptr_param<Dense> output, bool invert = false) const;
539
546 ptr_param<const ScaledPermutation<value_type, int64>> row_permutation,
548 column_permutation,
549 ptr_param<Dense> output, bool invert = false) const;
550
551 std::unique_ptr<LinOp> permute(
552 const array<int32>* permutation_indices) const override;
553
554 std::unique_ptr<LinOp> permute(
555 const array<int64>* permutation_indices) const override;
556
566 void permute(const array<int32>* permutation_indices,
567 ptr_param<Dense> output) const;
568
572 void permute(const array<int64>* permutation_indices,
573 ptr_param<Dense> output) const;
574
575 std::unique_ptr<LinOp> inverse_permute(
576 const array<int32>* permutation_indices) const override;
577
578 std::unique_ptr<LinOp> inverse_permute(
579 const array<int64>* permutation_indices) const override;
580
591 void inverse_permute(const array<int32>* permutation_indices,
592 ptr_param<Dense> output) const;
593
597 void inverse_permute(const array<int64>* permutation_indices,
598 ptr_param<Dense> output) const;
599
600 std::unique_ptr<LinOp> row_permute(
601 const array<int32>* permutation_indices) const override;
602
603 std::unique_ptr<LinOp> row_permute(
604 const array<int64>* permutation_indices) const override;
605
615 void row_permute(const array<int32>* permutation_indices,
616 ptr_param<Dense> output) const;
617
621 void row_permute(const array<int64>* permutation_indices,
622 ptr_param<Dense> output) const;
623
634 std::unique_ptr<Dense> row_gather(const array<int32>* gather_indices) const;
635
639 std::unique_ptr<Dense> row_gather(const array<int64>* gather_indices) const;
640
653 void row_gather(const array<int32>* gather_indices,
654 ptr_param<LinOp> row_collection) const;
655
659 void row_gather(const array<int64>* gather_indices,
660 ptr_param<LinOp> row_collection) const;
661
676 const array<int32>* gather_indices,
678 ptr_param<LinOp> row_collection) const;
679
685 const array<int64>* gather_indices,
687 ptr_param<LinOp> row_collection) const;
688
689 std::unique_ptr<LinOp> column_permute(
690 const array<int32>* permutation_indices) const override;
691
692 std::unique_ptr<LinOp> column_permute(
693 const array<int64>* permutation_indices) const override;
694
704 void column_permute(const array<int32>* permutation_indices,
705 ptr_param<Dense> output) const;
706
710 void column_permute(const array<int64>* permutation_indices,
711 ptr_param<Dense> output) const;
712
713 std::unique_ptr<LinOp> inverse_row_permute(
714 const array<int32>* permutation_indices) const override;
715
716 std::unique_ptr<LinOp> inverse_row_permute(
717 const array<int64>* permutation_indices) const override;
718
728 void inverse_row_permute(const array<int32>* permutation_indices,
729 ptr_param<Dense> output) const;
730
734 void inverse_row_permute(const array<int64>* permutation_indices,
735 ptr_param<Dense> output) const;
736
737 std::unique_ptr<LinOp> inverse_column_permute(
738 const array<int32>* permutation_indices) const override;
739
740 std::unique_ptr<LinOp> inverse_column_permute(
741 const array<int64>* permutation_indices) const override;
742
752 void inverse_column_permute(const array<int32>* permutation_indices,
753 ptr_param<Dense> output) const;
754
758 void inverse_column_permute(const array<int64>* permutation_indices,
759 ptr_param<Dense> output) const;
760
761 std::unique_ptr<Diagonal<ValueType>> extract_diagonal() const override;
762
771
772 std::unique_ptr<absolute_type> compute_absolute() const override;
773
782
784
789 std::unique_ptr<complex_type> make_complex() const;
790
797
802 std::unique_ptr<real_type> get_real() const;
803
807 void get_real(ptr_param<real_type> result) const;
808
813 std::unique_ptr<real_type> get_imag() const;
814
819 void get_imag(ptr_param<real_type> result) const;
820
826 value_type* get_values() noexcept { return values_.get_data(); }
827
835 const value_type* get_const_values() const noexcept
836 {
837 return values_.get_const_data();
838 }
839
845 size_type get_stride() const noexcept { return stride_; }
846
853 {
854 return values_.get_size();
855 }
856
867 value_type& at(size_type row, size_type col) noexcept
868 {
869 return values_.get_data()[linearize_index(row, col)];
870 }
871
875 value_type at(size_type row, size_type col) const noexcept
876 {
877 return values_.get_const_data()[linearize_index(row, col)];
878 }
879
894 ValueType& at(size_type idx) noexcept
895 {
896 return values_.get_data()[linearize_index(idx)];
897 }
898
902 ValueType at(size_type idx) const noexcept
903 {
904 return values_.get_const_data()[linearize_index(idx)];
905 }
906
917
928
940
952
962
975 array<char>& tmp) const;
976
986 ptr_param<LinOp> result) const;
987
1000 array<char>& tmp) const;
1001
1010
1022
1031
1043
1053
1066
1074 void compute_mean(ptr_param<LinOp> result) const;
1075
1087
1098 std::unique_ptr<Dense> create_submatrix(const span& rows,
1099 const span& columns,
1100 const size_type stride)
1101 {
1102 return this->create_submatrix_impl(rows, columns, stride);
1103 }
1104
1111 std::unique_ptr<Dense> create_submatrix(const span& rows,
1112 const span& columns)
1113 {
1114 return create_submatrix(rows, columns, this->get_stride());
1115 }
1116
1124 std::unique_ptr<real_type> create_real_view();
1125
1129 std::unique_ptr<const real_type> create_real_view() const;
1130
1143 static std::unique_ptr<Dense> create(std::shared_ptr<const Executor> exec,
1144 const dim<2>& size = {},
1145 size_type stride = 0);
1146
1163 static std::unique_ptr<Dense> create(std::shared_ptr<const Executor> exec,
1164 const dim<2>& size,
1165 array<value_type> values,
1166 size_type stride);
1167
1172 template <typename InputValueType>
1173 GKO_DEPRECATED(
1174 "explicitly construct the gko::array argument instead of passing an"
1175 "initializer list")
1176 static std::unique_ptr<Dense> create(
1177 std::shared_ptr<const Executor> exec, const dim<2>& size,
1178 std::initializer_list<InputValueType> values, size_type stride)
1179 {
1180 return create(exec, size, array<value_type>{exec, std::move(values)},
1181 stride);
1182 }
1183
1195 static std::unique_ptr<const Dense> create_const(
1196 std::shared_ptr<const Executor> exec, const dim<2>& size,
1197 gko::detail::const_array_view<ValueType>&& values, size_type stride);
1198
1205
1212
1217 Dense(const Dense&);
1218
1224
1225protected:
1226 Dense(std::shared_ptr<const Executor> exec, const dim<2>& size = {},
1227 size_type stride = 0);
1228
1229 Dense(std::shared_ptr<const Executor> exec, const dim<2>& size,
1230 array<value_type> values, size_type stride);
1231
1238 virtual std::unique_ptr<Dense> create_with_same_config() const
1239 {
1240 return Dense::create(this->get_executor(), this->get_size(),
1241 this->get_stride());
1242 }
1243
1251 virtual std::unique_ptr<Dense> create_with_type_of_impl(
1252 std::shared_ptr<const Executor> exec, const dim<2>& size,
1253 size_type stride) const
1254 {
1255 return Dense::create(exec, size, stride);
1256 }
1257
1264 virtual std::unique_ptr<Dense> create_view_of_impl()
1265 {
1266 auto exec = this->get_executor();
1267 return Dense::create(
1268 exec, this->get_size(),
1270 this->get_values()),
1271 this->get_stride());
1272 }
1273
1280 virtual std::unique_ptr<const Dense> create_const_view_of_impl() const
1281 {
1282 auto exec = this->get_executor();
1283 return Dense::create_const(
1284 exec, this->get_size(),
1286 this->get_const_values()),
1287 this->get_stride());
1288 }
1289
1290 template <typename IndexType>
1291 void convert_impl(Coo<ValueType, IndexType>* result) const;
1292
1293 template <typename IndexType>
1294 void convert_impl(Csr<ValueType, IndexType>* result) const;
1295
1296 template <typename IndexType>
1297 void convert_impl(Ell<ValueType, IndexType>* result) const;
1298
1299 template <typename IndexType>
1300 void convert_impl(Fbcsr<ValueType, IndexType>* result) const;
1301
1302 template <typename IndexType>
1303 void convert_impl(Hybrid<ValueType, IndexType>* result) const;
1304
1305 template <typename IndexType>
1306 void convert_impl(Sellp<ValueType, IndexType>* result) const;
1307
1308 template <typename IndexType>
1309 void convert_impl(SparsityCsr<ValueType, IndexType>* result) const;
1310
1317 virtual void scale_impl(const LinOp* alpha);
1318
1325 virtual void inv_scale_impl(const LinOp* alpha);
1326
1333 virtual void add_scaled_impl(const LinOp* alpha, const LinOp* b);
1334
1341 virtual void sub_scaled_impl(const LinOp* alpha, const LinOp* b);
1342
1349 virtual void compute_dot_impl(const LinOp* b, LinOp* result) const;
1350
1357 virtual void compute_conj_dot_impl(const LinOp* b, LinOp* result) const;
1358
1365 virtual void compute_norm2_impl(LinOp* result) const;
1366
1373 virtual void compute_norm1_impl(LinOp* result) const;
1374
1381 virtual void compute_squared_norm2_impl(LinOp* result) const;
1382
1386 virtual void compute_mean_impl(LinOp* result) const;
1387
1396 void resize(gko::dim<2> new_size);
1397
1405 virtual std::unique_ptr<Dense> create_submatrix_impl(
1406 const span& rows, const span& columns, const size_type stride);
1407
1408 void apply_impl(const LinOp* b, LinOp* x) const override;
1409
1410 void apply_impl(const LinOp* alpha, const LinOp* b, const LinOp* beta,
1411 LinOp* x) const override;
1412
1413 size_type linearize_index(size_type row, size_type col) const noexcept
1414 {
1415 return row * stride_ + col;
1416 }
1417
1418 size_type linearize_index(size_type idx) const noexcept
1419 {
1420 return linearize_index(idx / this->get_size()[1],
1421 idx % this->get_size()[1]);
1422 }
1423
1424 template <typename IndexType>
1425 void permute_impl(const Permutation<IndexType>* permutation,
1426 permute_mode mode, Dense* output) const;
1427
1428 template <typename IndexType>
1429 void permute_impl(const Permutation<IndexType>* row_permutation,
1430 const Permutation<IndexType>* col_permutation,
1431 bool invert, Dense* output) const;
1432
1433 template <typename IndexType>
1434 void scale_permute_impl(
1435 const ScaledPermutation<ValueType, IndexType>* permutation,
1436 permute_mode mode, Dense* output) const;
1437
1438 template <typename IndexType>
1439 void scale_permute_impl(
1440 const ScaledPermutation<ValueType, IndexType>* row_permutation,
1441 const ScaledPermutation<ValueType, IndexType>* column_permutation,
1442 bool invert, Dense* output) const;
1443
1444 template <typename OutputType, typename IndexType>
1445 void row_gather_impl(const array<IndexType>* row_idxs,
1446 Dense<OutputType>* row_collection) const;
1447
1448 template <typename OutputType, typename IndexType>
1449 void row_gather_impl(const Dense<ValueType>* alpha,
1450 const array<IndexType>* row_idxs,
1451 const Dense<ValueType>* beta,
1452 Dense<OutputType>* row_collection) const;
1453
1454private:
1455 size_type stride_;
1456 array<value_type> values_;
1457
1458 void add_scaled_identity_impl(const LinOp* a, const LinOp* b) override;
1459};
1460
1461
1462} // namespace matrix
1463
1464
1465namespace detail {
1466
1467
1468template <typename ValueType>
1469struct temporary_clone_helper<matrix::Dense<ValueType>> {
1470 static std::unique_ptr<matrix::Dense<ValueType>> create(
1471 std::shared_ptr<const Executor> exec, matrix::Dense<ValueType>* ptr,
1472 bool copy_data)
1473 {
1474 if (copy_data) {
1475 return gko::clone(std::move(exec), ptr);
1476 } else {
1477 return matrix::Dense<ValueType>::create(exec, ptr->get_size());
1478 }
1479 }
1480};
1481
1482
1483} // namespace detail
1484
1485
1493template <typename VecPtr>
1494std::unique_ptr<matrix::Dense<typename detail::pointee<VecPtr>::value_type>>
1495make_dense_view(VecPtr&& vector)
1496{
1497 using value_type = typename detail::pointee<VecPtr>::value_type;
1499}
1500
1501
1509template <typename VecPtr>
1510std::unique_ptr<
1511 const matrix::Dense<typename detail::pointee<VecPtr>::value_type>>
1513{
1514 using value_type = typename detail::pointee<VecPtr>::value_type;
1516}
1517
1518
1539template <typename Matrix, typename... TArgs>
1540std::unique_ptr<Matrix> initialize(
1541 size_type stride, std::initializer_list<typename Matrix::value_type> vals,
1542 std::shared_ptr<const Executor> exec, TArgs&&... create_args)
1543{
1545 size_type num_rows = vals.size();
1546 auto tmp = dense::create(exec->get_master(), dim<2>{num_rows, 1}, stride);
1547 size_type idx = 0;
1548 for (const auto& elem : vals) {
1549 tmp->at(idx) = elem;
1550 ++idx;
1551 }
1552 auto mtx = Matrix::create(exec, std::forward<TArgs>(create_args)...);
1553 tmp->move_to(mtx);
1554 return mtx;
1555}
1556
1577template <typename Matrix, typename... TArgs>
1578std::unique_ptr<Matrix> initialize(
1579 std::initializer_list<typename Matrix::value_type> vals,
1580 std::shared_ptr<const Executor> exec, TArgs&&... create_args)
1581{
1582 return initialize<Matrix>(1, vals, std::move(exec),
1583 std::forward<TArgs>(create_args)...);
1584}
1585
1586
1607template <typename Matrix, typename... TArgs>
1608std::unique_ptr<Matrix> initialize(
1609 size_type stride,
1610 std::initializer_list<std::initializer_list<typename Matrix::value_type>>
1611 vals,
1612 std::shared_ptr<const Executor> exec, TArgs&&... create_args)
1613{
1615 size_type num_rows = vals.size();
1616 size_type num_cols = num_rows > 0 ? begin(vals)->size() : 1;
1617 auto tmp =
1618 dense::create(exec->get_master(), dim<2>{num_rows, num_cols}, stride);
1619 size_type ridx = 0;
1620 for (const auto& row : vals) {
1621 size_type cidx = 0;
1622 for (const auto& elem : row) {
1623 tmp->at(ridx, cidx) = elem;
1624 ++cidx;
1625 }
1626 ++ridx;
1627 }
1628 auto mtx = Matrix::create(exec, std::forward<TArgs>(create_args)...);
1629 tmp->move_to(mtx);
1630 return mtx;
1631}
1632
1633
1655template <typename Matrix, typename... TArgs>
1656std::unique_ptr<Matrix> initialize(
1657 std::initializer_list<std::initializer_list<typename Matrix::value_type>>
1658 vals,
1659 std::shared_ptr<const Executor> exec, TArgs&&... create_args)
1660{
1661 return initialize<Matrix>(vals.size() > 0 ? begin(vals)->size() : 0, vals,
1662 std::move(exec),
1663 std::forward<TArgs>(create_args)...);
1664}
1665
1666
1667} // namespace gko
1668
1669
1670#endif // GKO_PUBLIC_CORE_MATRIX_DENSE_HPP_
ConvertibleTo interface is used to mark that the implementer can be converted to the object of Result...
Definition polymorphic_object.hpp:471
The diagonal of a LinOp implementing this interface can be extracted.
Definition lin_op.hpp:744
The EnableAbsoluteComputation mixin provides the default implementations of compute_absolute_linop an...
Definition lin_op.hpp:795
The EnableLinOp mixin can be used to provide sensible default implementations of the majority of the ...
Definition lin_op.hpp:880
This mixin inherits from (a subclass of) PolymorphicObject and provides a base implementation of a ne...
Definition polymorphic_object.hpp:663
The first step in using the Ginkgo library consists of creating an executor.
Definition executor.hpp:616
Definition lin_op.hpp:118
LinOp(const LinOp &)=default
Copy-constructs a LinOp.
const dim< 2 > & get_size() const noexcept
Returns the size of the operator.
Definition lin_op.hpp:211
Linear operators which support permutation should implement the Permutable interface.
Definition lin_op.hpp:485
std::shared_ptr< const Executor > get_executor() const noexcept
Returns the Executor of the object.
Definition polymorphic_object.hpp:235
A LinOp implementing this interface can read its data from a matrix_data structure.
Definition lin_op.hpp:606
Adds the operation M <- a I + b M for matrix M, identity operator I and scalars a and b,...
Definition lin_op.hpp:819
Linear operators which support transposition should implement the Transposable interface.
Definition lin_op.hpp:434
A LinOp implementing this interface can write its data to a matrix_data structure.
Definition lin_op.hpp:661
An array is a container which encapsulates fixed-sized arrays, stored on the Executor tied to the arr...
Definition logger.hpp:25
value_type * get_data() noexcept
Returns a pointer to the block of memory used to store the elements of the array.
Definition array.hpp:674
const value_type * get_const_data() const noexcept
Returns a constant pointer to the block of memory used to store the elements of the array.
Definition array.hpp:683
size_type get_size() const noexcept
Returns the number of elements in the array.
Definition array.hpp:657
This type is a device-side equivalent to matrix_data.
Definition device_matrix_data.hpp:36
Vector is a format which explicitly stores (multiple) distributed column vectors in a dense storage f...
Definition dense.hpp:30
COO stores a matrix in the coordinate matrix format.
Definition ell.hpp:21
CSR is a matrix format which stores only the nonzero coefficients by compressing each row of the matr...
Definition sparsity_csr.hpp:22
Dense is a matrix format which explicitly stores all values of the matrix.
Definition sparsity_csr.hpp:26
std::unique_ptr< Dense > scale_permute(ptr_param< const ScaledPermutation< value_type, int64 > > row_permutation, ptr_param< const ScaledPermutation< value_type, int64 > > column_permutation, bool invert=false) const
value_type & at(size_type row, size_type col) noexcept
Returns a single element of the matrix.
Definition dense.hpp:867
void compute_norm1(ptr_param< LinOp > result) const
Computes the column-wise (L^1) norm of this matrix.
void compute_absolute(ptr_param< absolute_type > output) const
Writes the absolute values of this matrix into an existing matrix.
void compute_norm2(ptr_param< LinOp > result, array< char > &tmp) const
Computes the column-wise Euclidean (L^2) norm of this matrix.
std::unique_ptr< LinOp > row_permute(const array< int64 > *permutation_indices) const override
Returns a LinOp representing the row permutation of the Permutable object.
static std::unique_ptr< Dense > create_with_config_of(ptr_param< const Dense > other)
Creates a Dense matrix with the same size and stride as another Dense matrix.
Definition dense.hpp:182
std::unique_ptr< Dense > permute(ptr_param< const Permutation< int64 > > row_permutation, ptr_param< const Permutation< int64 > > column_permutation, bool invert=false) const
Dense & operator=(const Dense &)
Copy-assigns a Dense matrix.
void get_imag(ptr_param< real_type > result) const
Extracts the imaginary part of the original matrix into a given real matrix.
void row_permute(const array< int32 > *permutation_indices, ptr_param< Dense > output) const
Writes the row-permuted matrix into the given output matrix.
void get_real(ptr_param< real_type > result) const
Extracts the real part of the original matrix into a given real matrix.
std::unique_ptr< LinOp > column_permute(const array< int64 > *permutation_indices) const override
Returns a LinOp representing the column permutation of the Permutable object.
static std::unique_ptr< Dense > create_with_type_of(ptr_param< const Dense > other, std::shared_ptr< const Executor > exec, const dim< 2 > &size, const dim< 2 > &local_size, size_type stride)
Definition dense.hpp:237
void compute_dot(ptr_param< const LinOp > b, ptr_param< LinOp > result) const
Computes the column-wise dot product of this matrix and b.
void sub_scaled(ptr_param< const LinOp > alpha, ptr_param< const LinOp > b)
Subtracts b scaled by alpha from the matrix (aka: BLAS axpy).
std::unique_ptr< Dense > permute(ptr_param< const Permutation< int64 > > permutation, permute_mode mode=permute_mode::symmetric) const
std::unique_ptr< LinOp > permute(const array< int64 > *permutation_indices) const override
Returns a LinOp representing the symmetric row and column permutation of the Permutable object.
ValueType at(size_type idx) const noexcept
Returns a single element of the matrix.
Definition dense.hpp:902
std::unique_ptr< Dense > row_gather(const array< int64 > *gather_indices) const
Create a Dense matrix consisting of the given rows from this matrix.
std::unique_ptr< LinOp > inverse_permute(const array< int64 > *permutation_indices) const override
Returns a LinOp representing the symmetric inverse row and column permutation of the Permutable objec...
std::unique_ptr< Dense > permute(ptr_param< const Permutation< int32 > > row_permutation, ptr_param< const Permutation< int32 > > column_permutation, bool invert=false) const
Creates a non-symmetrically permuted copy of this matrix with the given row and column permutations...
void row_gather(const array< int32 > *gather_indices, ptr_param< LinOp > row_collection) const
Copies the given rows from this matrix into row_collection
void column_permute(const array< int32 > *permutation_indices, ptr_param< Dense > output) const
Writes the column-permuted matrix into the given output matrix.
std::unique_ptr< LinOp > inverse_row_permute(const array< int32 > *permutation_indices) const override
Returns a LinOp representing the row permutation of the inverse permuted object.
Dense(const Dense &)
Copy-constructs a Dense matrix.
std::unique_ptr< Dense > permute(ptr_param< const Permutation< int32 > > permutation, permute_mode mode=permute_mode::symmetric) const
Creates a permuted copy of this matrix with the given permutation .
void inverse_permute(const array< int64 > *permutation_indices, ptr_param< Dense > output) const
void compute_squared_norm2(ptr_param< LinOp > result, array< char > &tmp) const
Computes the square of the column-wise Euclidean (L^2) norm of this matrix.
static std::unique_ptr< Dense > create_with_type_of(ptr_param< const Dense > other, std::shared_ptr< const Executor > exec, const dim< 2 > &size=dim< 2 >{})
Creates a Dense matrix with the same type as another Dense matrix but on a different executor and wit...
Definition dense.hpp:203
void permute(const array< int64 > *permutation_indices, ptr_param< Dense > output) const
void scale(ptr_param< const LinOp > alpha)
Scales the matrix with a scalar (aka: BLAS scal).
std::unique_ptr< LinOp > inverse_column_permute(const array< int32 > *permutation_indices) const override
Returns a LinOp representing the row permutation of the inverse permuted object.
void conj_transpose(ptr_param< Dense > output) const
Writes the conjugate-transposed matrix into the given output matrix.
std::unique_ptr< Dense > create_submatrix(const span &rows, const span &columns)
Create a submatrix from the original matrix.
Definition dense.hpp:1111
void row_permute(const array< int64 > *permutation_indices, ptr_param< Dense > output) const
std::unique_ptr< LinOp > permute(const array< int32 > *permutation_indices) const override
Returns a LinOp representing the symmetric row and column permutation of the Permutable object.
std::unique_ptr< Dense > create_submatrix(const span &rows, const span &columns, const size_type stride)
Create a submatrix from the original matrix.
Definition dense.hpp:1098
void compute_squared_norm2(ptr_param< LinOp > result) const
Computes the square of the column-wise Euclidean (L^2) norm of this matrix.
std::unique_ptr< LinOp > row_permute(const array< int32 > *permutation_indices) const override
Returns a LinOp representing the row permutation of the Permutable object.
void permute(ptr_param< const Permutation< int64 > > permutation, ptr_param< Dense > output, permute_mode mode) const
void inverse_permute(const array< int32 > *permutation_indices, ptr_param< Dense > output) const
Writes the inverse symmetrically permuted matrix into the given output matrix.
std::unique_ptr< Dense > row_gather(const array< int32 > *gather_indices) const
Create a Dense matrix consisting of the given rows from this matrix.
void extract_diagonal(ptr_param< Diagonal< ValueType > > output) const
Writes the diagonal of this matrix into an existing diagonal matrix.
void make_complex(ptr_param< complex_type > result) const
Writes a complex copy of the original matrix to a given complex matrix.
std::unique_ptr< absolute_type > compute_absolute() const override
Gets the AbsoluteLinOp.
void scale_permute(ptr_param< const ScaledPermutation< value_type, int32 > > row_permutation, ptr_param< const ScaledPermutation< value_type, int32 > > column_permutation, ptr_param< Dense > output, bool invert=false) const
Overload of scale_permute(ptr_param<const ScaledPermutation<value_type,int32>>, ptr_param<const Scale...
void permute(ptr_param< const Permutation< int32 > > permutation, ptr_param< Dense > output, permute_mode mode) const
Overload of permute(ptr_param<const Permutation<int32>>, permute_mode) that writes the permuted copy ...
void row_gather(ptr_param< const LinOp > alpha, const array< int32 > *gather_indices, ptr_param< const LinOp > beta, ptr_param< LinOp > row_collection) const
Copies the given rows from this matrix into row_collection with scaling.
const value_type * get_const_values() const noexcept
Returns a pointer to the array of values of the matrix.
Definition dense.hpp:835
size_type get_num_stored_elements() const noexcept
Returns the number of elements explicitly stored in the matrix.
Definition dense.hpp:852
void compute_mean(ptr_param< LinOp > result, array< char > &tmp) const
Computes the column-wise arithmetic mean of this matrix.
ValueType & at(size_type idx) noexcept
Returns a single element of the matrix.
Definition dense.hpp:894
std::unique_ptr< Dense > scale_permute(ptr_param< const ScaledPermutation< value_type, int32 > > row_permutation, ptr_param< const ScaledPermutation< value_type, int32 > > column_permutation, bool invert=false) const
Creates a scaled and permuted copy of this matrix.
void scale_permute(ptr_param< const ScaledPermutation< value_type, int64 > > row_permutation, ptr_param< const ScaledPermutation< value_type, int64 > > column_permutation, ptr_param< Dense > output, bool invert=false) const
void compute_conj_dot(ptr_param< const LinOp > b, ptr_param< LinOp > result, array< char > &tmp) const
Computes the column-wise dot product of conj(this matrix) and b.
void compute_mean(ptr_param< LinOp > result) const
Computes the column-wise arithmetic mean of this matrix.
static std::unique_ptr< Dense > create(std::shared_ptr< const Executor > exec, const dim< 2 > &size, array< value_type > values, size_type stride)
Creates a Dense matrix from an already allocated (and initialized) array.
size_type get_stride() const noexcept
Returns the stride of the matrix.
Definition dense.hpp:845
std::unique_ptr< LinOp > inverse_permute(const array< int32 > *permutation_indices) const override
Returns a LinOp representing the symmetric inverse row and column permutation of the Permutable objec...
void permute(const array< int32 > *permutation_indices, ptr_param< Dense > output) const
Writes the symmetrically permuted matrix into the given output matrix.
void scale_permute(ptr_param< const ScaledPermutation< value_type, int64 > > permutation, ptr_param< Dense > output, permute_mode mode) const
void inverse_row_permute(const array< int32 > *permutation_indices, ptr_param< Dense > output) const
Writes the inverse row-permuted matrix into the given output matrix.
void inverse_column_permute(const array< int32 > *permutation_indices, ptr_param< Dense > output) const
Writes the inverse column-permuted matrix into the given output matrix.
void add_scaled(ptr_param< const LinOp > alpha, ptr_param< const LinOp > b)
Adds b scaled by alpha to the matrix (aka: BLAS axpy).
std::unique_ptr< LinOp > inverse_column_permute(const array< int64 > *permutation_indices) const override
Returns a LinOp representing the row permutation of the inverse permuted object.
static std::unique_ptr< Dense > create_view_of(ptr_param< Dense > other)
Creates a Dense matrix, where the underlying array is a view of another Dense matrix' array.
Definition dense.hpp:253
void permute(ptr_param< const Permutation< int32 > > row_permutation, ptr_param< const Permutation< int32 > > column_permutation, ptr_param< Dense > output, bool invert=false) const
Overload of permute(ptr_param<const Permutation<int32>>, ptr_param<constPermutation<int32>>,...
void compute_norm1(ptr_param< LinOp > result, array< char > &tmp) const
Computes the column-wise (L^1) norm of this matrix.
std::unique_ptr< LinOp > inverse_row_permute(const array< int64 > *permutation_indices) const override
Returns a LinOp representing the row permutation of the inverse permuted object.
std::unique_ptr< Dense > scale_permute(ptr_param< const ScaledPermutation< value_type, int32 > > permutation, permute_mode mode=permute_mode::symmetric) const
Creates a scaled and permuted copy of this matrix.
void transpose(ptr_param< Dense > output) const
Writes the transposed matrix into the given output matrix.
void compute_conj_dot(ptr_param< const LinOp > b, ptr_param< LinOp > result) const
Computes the column-wise dot product of conj(this matrix) and b.
std::unique_ptr< real_type > get_real() const
Creates a new real matrix and extracts the real part of the original matrix into that.
std::unique_ptr< Dense > scale_permute(ptr_param< const ScaledPermutation< value_type, int64 > > permutation, permute_mode mode=permute_mode::symmetric) const
static std::unique_ptr< const Dense > create_const_view_of(ptr_param< const Dense > other)
Creates a immutable Dense matrix, where the underlying array is a view of another Dense matrix' array...
Definition dense.hpp:265
std::unique_ptr< LinOp > conj_transpose() const override
Returns a LinOp representing the conjugate transpose of the Transposable object.
std::unique_ptr< LinOp > column_permute(const array< int32 > *permutation_indices) const override
Returns a LinOp representing the column permutation of the Permutable object.
std::unique_ptr< LinOp > transpose() const override
Returns a LinOp representing the transpose of the Transposable object.
void scale_permute(ptr_param< const ScaledPermutation< value_type, int32 > > permutation, ptr_param< Dense > output, permute_mode mode) const
Overload of scale_permute(ptr_param<const ScaledPermutation<value_type,int32>>, permute_mode) that wr...
void compute_absolute_inplace() override
Compute absolute inplace on each element.
std::unique_ptr< complex_type > make_complex() const
Creates a complex copy of the original matrix.
std::unique_ptr< const real_type > create_real_view() const
Create a real view of the (potentially) complex original matrix.
void column_permute(const array< int64 > *permutation_indices, ptr_param< Dense > output) const
Dense(Dense &&)
Move-constructs a Dense matrix.
void inverse_row_permute(const array< int64 > *permutation_indices, ptr_param< Dense > output) const
value_type at(size_type row, size_type col) const noexcept
Returns a single element of the matrix.
Definition dense.hpp:875
static std::unique_ptr< Dense > create(std::shared_ptr< const Executor > exec, const dim< 2 > &size={}, size_type stride=0)
Creates an uninitialized Dense matrix of the specified size.
static std::unique_ptr< const Dense > create_const(std::shared_ptr< const Executor > exec, const dim< 2 > &size, gko::detail::const_array_view< ValueType > &&values, size_type stride)
Creates a constant (immutable) Dense matrix from a constant array.
void permute(ptr_param< const Permutation< int64 > > row_permutation, ptr_param< const Permutation< int64 > > column_permutation, ptr_param< Dense > output, bool invert=false) const
void inv_scale(ptr_param< const LinOp > alpha)
Scales the matrix with the inverse of a scalar.
Dense & operator=(Dense &&)
Move-assigns a Dense matrix.
value_type * get_values() noexcept
Returns a pointer to the array of values of the matrix.
Definition dense.hpp:826
void inverse_column_permute(const array< int64 > *permutation_indices, ptr_param< Dense > output) const
void compute_norm2(ptr_param< LinOp > result) const
Computes the column-wise Euclidean (L^2) norm of this matrix.
void row_gather(const array< int64 > *gather_indices, ptr_param< LinOp > row_collection) const
std::unique_ptr< real_type > get_imag() const
Creates a new real matrix and extracts the imaginary part of the original matrix into that.
static std::unique_ptr< Dense > create_with_type_of(ptr_param< const Dense > other, std::shared_ptr< const Executor > exec, const dim< 2 > &size, size_type stride)
Definition dense.hpp:219
std::unique_ptr< real_type > create_real_view()
Create a real view of the (potentially) complex original matrix.
std::unique_ptr< Diagonal< ValueType > > extract_diagonal() const override
Extracts the diagonal entries of the matrix into a vector.
void fill(const ValueType value)
Fill the dense matrix with a given value.
void compute_dot(ptr_param< const LinOp > b, ptr_param< LinOp > result, array< char > &tmp) const
Computes the column-wise dot product of this matrix and b.
void row_gather(ptr_param< const LinOp > alpha, const array< int64 > *gather_indices, ptr_param< const LinOp > beta, ptr_param< LinOp > row_collection) const
This class is a utility which efficiently implements the diagonal matrix (a linear operator which sca...
Definition diagonal.hpp:50
ELL is a matrix format where stride with explicit zeros is used such that all rows have the same numb...
Definition ell.hpp:60
Fixed-block compressed sparse row storage matrix format.
Definition sparsity_csr.hpp:30
HYBRID is a matrix format which splits the matrix into ELLPACK and COO format.
Definition hybrid.hpp:52
Permutation is a matrix format that represents a permutation matrix, i.e.
Definition permutation.hpp:113
ScaledPermutation is a matrix combining a permutation with scaling factors.
Definition scaled_permutation.hpp:39
SELL-P is a matrix format similar to ELL format.
Definition sellp.hpp:51
SparsityCsr is a matrix format which stores only the sparsity pattern of a sparse matrix by compressi...
Definition sparsity_csr.hpp:57
This class is used for function parameters in the place of raw pointers.
Definition utils_helper.hpp:43
A range is a multidimensional view of the memory.
Definition range.hpp:298
std::unique_ptr< Matrix > initialize(size_type stride, std::initializer_list< typename Matrix::value_type > vals, std::shared_ptr< const Executor > exec, TArgs &&... create_args)
Creates and initializes a column-vector.
Definition dense.hpp:1540
permute_mode
Specifies how a permutation will be applied to a matrix.
Definition permutation.hpp:43
@ columns
The columns will be permuted.
@ rows
The rows will be permuted.
@ symmetric
The rows and columns will be permuted.
The Ginkgo namespace.
Definition abstract_factory.hpp:20
typename detail::remove_complex_s< T >::type remove_complex
Obtain the type which removed the complex of complex/scalar type or the template parameter of class b...
Definition math.hpp:326
std::int32_t int32
32-bit signed integral type.
Definition types.hpp:103
std::unique_ptr< const matrix::Dense< typename detail::pointee< VecPtr >::value_type > > make_const_dense_view(VecPtr &&vector)
Creates a view of a given Dense vector.
Definition dense.hpp:1512
typename detail::next_precision_impl< T >::type next_precision
Obtains the next type in the singly-linked precision list.
Definition math.hpp:462
typename detail::to_complex_s< T >::type to_complex
Obtain the type which adds the complex of complex/scalar type or the template parameter of class by a...
Definition math.hpp:345
detail::const_array_view< ValueType > make_const_array_view(std::shared_ptr< const Executor > exec, size_type size, const ValueType *data)
Helper function to create a const array view deducing the value type.
Definition array.hpp:807
std::unique_ptr< matrix::Dense< typename detail::pointee< VecPtr >::value_type > > make_dense_view(VecPtr &&vector)
Creates a view of a given Dense vector.
Definition dense.hpp:1495
array< ValueType > make_array_view(std::shared_ptr< const Executor > exec, size_type size, ValueType *data)
Helper function to create an array view deducing the value type.
Definition array.hpp:788
std::int64_t int64
64-bit signed integral type.
Definition types.hpp:109
std::size_t size_type
Integral type used for allocation quantities.
Definition types.hpp:86
detail::cloned_type< Pointer > clone(const Pointer &p)
Creates a unique clone of the object pointed to by p.
Definition utils_helper.hpp:175
A type representing the dimensions of a multidimensional object.
Definition dim.hpp:27
This structure is used as an intermediate data type to store a sparse matrix.
Definition matrix_data.hpp:127
A span is a lightweight structure used to create sub-ranges from other ranges.
Definition range.hpp:47