Ginkgo Generated from branch based on main. Ginkgo version 1.9.0
A numerical linear algebra library targeting many-core architectures
Loading...
Searching...
No Matches
hybrid.hpp
1// SPDX-FileCopyrightText: 2017 - 2024 The Ginkgo authors
2//
3// SPDX-License-Identifier: BSD-3-Clause
4
5#ifndef GKO_PUBLIC_CORE_MATRIX_HYBRID_HPP_
6#define GKO_PUBLIC_CORE_MATRIX_HYBRID_HPP_
7
8
9#include <algorithm>
10
11#include <ginkgo/core/base/array.hpp>
12#include <ginkgo/core/base/lin_op.hpp>
13#include <ginkgo/core/matrix/coo.hpp>
14#include <ginkgo/core/matrix/csr.hpp>
15#include <ginkgo/core/matrix/ell.hpp>
16
17
18namespace gko {
19namespace matrix {
20
21
22template <typename ValueType>
23class Dense;
24
25template <typename ValueType, typename IndexType>
26class Csr;
27
28
41template <typename ValueType = default_precision, typename IndexType = int32>
42class Hybrid
43 : public EnableLinOp<Hybrid<ValueType, IndexType>>,
44 public ConvertibleTo<Hybrid<next_precision<ValueType>, IndexType>>,
45#if GINKGO_ENABLE_HALF
46 public ConvertibleTo<
47 Hybrid<next_precision<next_precision<ValueType>>, IndexType>>,
48#endif
49 public ConvertibleTo<Dense<ValueType>>,
50 public ConvertibleTo<Csr<ValueType, IndexType>>,
51 public DiagonalExtractable<ValueType>,
52 public ReadableFromMatrixData<ValueType, IndexType>,
53 public WritableToMatrixData<ValueType, IndexType>,
55 remove_complex<Hybrid<ValueType, IndexType>>> {
57 friend class Dense<ValueType>;
58 friend class Csr<ValueType, IndexType>;
59 friend class Hybrid<to_complex<ValueType>, IndexType>;
60
61
62public:
63 using EnableLinOp<Hybrid>::convert_to;
64 using EnableLinOp<Hybrid>::move_to;
65 using ConvertibleTo<
66 Hybrid<next_precision<ValueType>, IndexType>>::convert_to;
67 using ConvertibleTo<Hybrid<next_precision<ValueType>, IndexType>>::move_to;
68 using ConvertibleTo<Dense<ValueType>>::convert_to;
69 using ConvertibleTo<Dense<ValueType>>::move_to;
72 using ReadableFromMatrixData<ValueType, IndexType>::read;
73
74 using value_type = ValueType;
75 using index_type = IndexType;
80 using absolute_type = remove_complex<Hybrid>;
81
82
93 public:
98 : ell_num_stored_elements_per_row_(zero<size_type>()),
99 coo_nnz_(zero<size_type>())
100 {}
101
115 size_type* ell_num_stored_elements_per_row,
116 size_type* coo_nnz)
117 {
118 array<size_type> ref_row_nnz(row_nnz.get_executor()->get_master(),
119 row_nnz.get_size());
120 ref_row_nnz = row_nnz;
121 ell_num_stored_elements_per_row_ =
122 this->compute_ell_num_stored_elements_per_row(&ref_row_nnz);
123 coo_nnz_ = this->compute_coo_nnz(ref_row_nnz);
124 *ell_num_stored_elements_per_row = ell_num_stored_elements_per_row_;
125 *coo_nnz = coo_nnz_;
126 }
127
134 {
135 return ell_num_stored_elements_per_row_;
136 }
137
143 size_type get_coo_nnz() const noexcept { return coo_nnz_; }
144
153 array<size_type>* row_nnz) const = 0;
154
155 protected:
164 size_type compute_coo_nnz(const array<size_type>& row_nnz) const
165 {
166 size_type coo_nnz = 0;
167 auto row_nnz_val = row_nnz.get_const_data();
168 for (size_type i = 0; i < row_nnz.get_size(); i++) {
169 if (row_nnz_val[i] > ell_num_stored_elements_per_row_) {
170 coo_nnz +=
171 row_nnz_val[i] - ell_num_stored_elements_per_row_;
172 }
173 }
174 return coo_nnz;
175 }
176
177 private:
178 size_type ell_num_stored_elements_per_row_;
179 size_type coo_nnz_;
180 };
181
187 public:
193 explicit column_limit(size_type num_column = 0)
194 : num_columns_(num_column)
195 {}
196
198 array<size_type>* row_nnz) const override
199 {
200 return num_columns_;
201 }
202
208 auto get_num_columns() const { return num_columns_; }
209
210 private:
211 size_type num_columns_;
212 };
213
222 public:
229 explicit imbalance_limit(double percent = 0.8) : percent_(percent)
230 {
231 percent_ = std::min(percent_, 1.0);
232 percent_ = std::max(percent_, 0.0);
233 }
234
236 array<size_type>* row_nnz) const override
237 {
238 auto row_nnz_val = row_nnz->get_data();
239 auto num_rows = row_nnz->get_size();
240 if (num_rows == 0) {
241 return 0;
242 }
243 std::sort(row_nnz_val, row_nnz_val + num_rows);
244 if (percent_ < 1) {
245 auto percent_pos = static_cast<size_type>(num_rows * percent_);
246 return row_nnz_val[percent_pos];
247 } else {
248 return row_nnz_val[num_rows - 1];
249 }
250 }
251
257 auto get_percentage() const { return percent_; }
258
259 private:
260 double percent_;
261 };
262
269 public:
273 imbalance_bounded_limit(double percent = 0.8, double ratio = 0.0001)
274 : strategy_(imbalance_limit(percent)), ratio_(ratio)
275 {}
276
278 array<size_type>* row_nnz) const override
279 {
280 auto num_rows = row_nnz->get_size();
281 auto ell_cols =
283 return std::min(ell_cols,
284 static_cast<size_type>(num_rows * ratio_));
285 }
286
292 auto get_percentage() const { return strategy_.get_percentage(); }
293
299 auto get_ratio() const { return ratio_; }
300
301 private:
302 imbalance_limit strategy_;
303 double ratio_;
304 };
305
306
313 public:
318 : strategy_(
319 imbalance_limit(static_cast<double>(sizeof(IndexType)) /
320 (sizeof(ValueType) + 2 * sizeof(IndexType))))
321 {}
322
324 array<size_type>* row_nnz) const override
325 {
326 return strategy_.compute_ell_num_stored_elements_per_row(row_nnz);
327 }
328
334 auto get_percentage() const { return strategy_.get_percentage(); }
335
336 private:
337 imbalance_limit strategy_;
338 };
339
340
345 class automatic : public strategy_type {
346 public:
350 automatic() : strategy_(imbalance_bounded_limit(1.0 / 3.0, 0.001)) {}
351
353 array<size_type>* row_nnz) const override
354 {
355 return strategy_.compute_ell_num_stored_elements_per_row(row_nnz);
356 }
357
358 private:
359 imbalance_bounded_limit strategy_;
360 };
361
362 friend class Hybrid<previous_precision<ValueType>, IndexType>;
363
364 void convert_to(
365 Hybrid<next_precision<ValueType>, IndexType>* result) const override;
366
367 void move_to(Hybrid<next_precision<ValueType>, IndexType>* result) override;
368
369#if GINKGO_ENABLE_HALF
370 friend class Hybrid<previous_precision<previous_precision<ValueType>>,
371 IndexType>;
373 IndexType>>::convert_to;
374 using ConvertibleTo<
376
378 IndexType>* result) const override;
379
380 void move_to(Hybrid<next_precision<next_precision<ValueType>>, IndexType>*
381 result) override;
382#endif
383
384 void convert_to(Dense<ValueType>* other) const override;
385
386 void move_to(Dense<ValueType>* other) override;
387
388 void convert_to(Csr<ValueType, IndexType>* other) const override;
389
390 void move_to(Csr<ValueType, IndexType>* other) override;
391
392 void read(const mat_data& data) override;
393
394 void read(const device_mat_data& data) override;
395
396 void read(device_mat_data&& data) override;
397
398 void write(mat_data& data) const override;
399
400 std::unique_ptr<Diagonal<ValueType>> extract_diagonal() const override;
401
402 std::unique_ptr<absolute_type> compute_absolute() const override;
403
405
411 value_type* get_ell_values() noexcept { return ell_->get_values(); }
412
420 const value_type* get_const_ell_values() const noexcept
421 {
422 return ell_->get_const_values();
423 }
424
430 index_type* get_ell_col_idxs() noexcept { return ell_->get_col_idxs(); }
431
439 const index_type* get_const_ell_col_idxs() const noexcept
440 {
441 return ell_->get_const_col_idxs();
442 }
443
450 {
451 return ell_->get_num_stored_elements_per_row();
452 }
453
459 size_type get_ell_stride() const noexcept { return ell_->get_stride(); }
460
467 {
468 return ell_->get_num_stored_elements();
469 }
470
482 value_type& ell_val_at(size_type row, size_type idx) noexcept
483 {
484 return ell_->val_at(row, idx);
485 }
486
490 value_type ell_val_at(size_type row, size_type idx) const noexcept
491 {
492 return ell_->val_at(row, idx);
493 }
494
505 index_type& ell_col_at(size_type row, size_type idx) noexcept
506 {
507 return ell_->col_at(row, idx);
508 }
509
513 index_type ell_col_at(size_type row, size_type idx) const noexcept
514 {
515 return ell_->col_at(row, idx);
516 }
517
523 const ell_type* get_ell() const noexcept { return ell_.get(); }
524
530 value_type* get_coo_values() noexcept { return coo_->get_values(); }
531
539 const value_type* get_const_coo_values() const noexcept
540 {
541 return coo_->get_const_values();
542 }
543
549 index_type* get_coo_col_idxs() noexcept { return coo_->get_col_idxs(); }
550
558 const index_type* get_const_coo_col_idxs() const noexcept
559 {
560 return coo_->get_const_col_idxs();
561 }
562
568 index_type* get_coo_row_idxs() noexcept { return coo_->get_row_idxs(); }
569
577 const index_type* get_const_coo_row_idxs() const noexcept
578 {
579 return coo_->get_const_row_idxs();
580 }
581
588 {
589 return coo_->get_num_stored_elements();
590 }
591
597 const coo_type* get_coo() const noexcept { return coo_.get(); }
598
605 {
606 return coo_->get_num_stored_elements() +
607 ell_->get_num_stored_elements();
608 }
609
615 std::shared_ptr<strategy_type> get_strategy() const noexcept
616 {
617 return strategy_;
618 }
619
627 template <typename HybType>
628 std::shared_ptr<typename HybType::strategy_type> get_strategy() const;
629
640 static std::unique_ptr<Hybrid> create(
641 std::shared_ptr<const Executor> exec,
642 std::shared_ptr<strategy_type> strategy =
643 std::make_shared<automatic>());
644
656 static std::unique_ptr<Hybrid> create(
657 std::shared_ptr<const Executor> exec, const dim<2>& size,
658 std::shared_ptr<strategy_type> strategy =
659 std::make_shared<automatic>());
660
673 static std::unique_ptr<Hybrid> create(
674 std::shared_ptr<const Executor> exec, const dim<2>& size,
675 size_type num_stored_elements_per_row,
676 std::shared_ptr<strategy_type> strategy =
677 std::make_shared<automatic>());
678
691 static std::unique_ptr<Hybrid> create(
692 std::shared_ptr<const Executor> exec, const dim<2>& size,
693 size_type num_stored_elements_per_row, size_type stride,
694 std::shared_ptr<strategy_type> strategy);
695
709 static std::unique_ptr<Hybrid> create(
710 std::shared_ptr<const Executor> exec, const dim<2>& size,
711 size_type num_stored_elements_per_row, size_type stride,
712 size_type num_nonzeros = {},
713 std::shared_ptr<strategy_type> strategy =
714 std::make_shared<automatic>());
715
721
728
733 Hybrid(const Hybrid&);
734
741
742protected:
743 Hybrid(std::shared_ptr<const Executor> exec, const dim<2>& size = {},
744 size_type num_stored_elements_per_row = 0, size_type stride = 0,
745 size_type num_nonzeros = 0,
746 std::shared_ptr<strategy_type> strategy =
747 std::make_shared<automatic>());
748
759 void resize(dim<2> new_size, size_type ell_row_nnz, size_type coo_nnz);
760
761 void apply_impl(const LinOp* b, LinOp* x) const override;
762
763 void apply_impl(const LinOp* alpha, const LinOp* b, const LinOp* beta,
764 LinOp* x) const override;
765
766private:
767 std::unique_ptr<ell_type> ell_;
768 std::unique_ptr<coo_type> coo_;
769 std::shared_ptr<strategy_type> strategy_;
770};
771
772
773template <typename ValueType, typename IndexType>
774template <typename HybType>
775std::shared_ptr<typename HybType::strategy_type>
777{
778 static_assert(
779 std::is_same<HybType, Hybrid<typename HybType::value_type,
780 typename HybType::index_type>>::value,
781 "The given `HybType` type must be of type `matrix::Hybrid`!");
782
783 std::shared_ptr<typename HybType::strategy_type> strategy;
784 if (std::dynamic_pointer_cast<automatic>(strategy_)) {
785 strategy = std::make_shared<typename HybType::automatic>();
786 } else if (auto temp = std::dynamic_pointer_cast<minimal_storage_limit>(
787 strategy_)) {
788 // minimal_storage_limit is related to ValueType and IndexType size.
789 if (sizeof(value_type) == sizeof(typename HybType::value_type) &&
790 sizeof(index_type) == sizeof(typename HybType::index_type)) {
791 strategy =
792 std::make_shared<typename HybType::minimal_storage_limit>();
793 } else {
794 strategy = std::make_shared<typename HybType::imbalance_limit>(
795 temp->get_percentage());
796 }
797 } else if (auto temp = std::dynamic_pointer_cast<imbalance_bounded_limit>(
798 strategy_)) {
799 strategy = std::make_shared<typename HybType::imbalance_bounded_limit>(
800 temp->get_percentage(), temp->get_ratio());
801 } else if (auto temp =
802 std::dynamic_pointer_cast<imbalance_limit>(strategy_)) {
803 strategy = std::make_shared<typename HybType::imbalance_limit>(
804 temp->get_percentage());
805 } else if (auto temp = std::dynamic_pointer_cast<column_limit>(strategy_)) {
806 strategy = std::make_shared<typename HybType::column_limit>(
807 temp->get_num_columns());
808 } else {
809 GKO_NOT_SUPPORTED(strategy_);
810 }
811 return strategy;
812}
813
814
815} // namespace matrix
816} // namespace gko
817
818
819#endif // GKO_PUBLIC_CORE_MATRIX_HYBRID_HPP_
ConvertibleTo interface is used to mark that the implementer can be converted to the object of Result...
Definition polymorphic_object.hpp:470
The diagonal of a LinOp implementing this interface can be extracted.
Definition lin_op.hpp:743
The EnableAbsoluteComputation mixin provides the default implementations of compute_absolute_linop an...
Definition lin_op.hpp:794
The EnableLinOp mixin can be used to provide sensible default implementations of the majority of the ...
Definition lin_op.hpp:879
This mixin inherits from (a subclass of) PolymorphicObject and provides a base implementation of a ne...
Definition polymorphic_object.hpp:662
Definition lin_op.hpp:117
A LinOp implementing this interface can read its data from a matrix_data structure.
Definition lin_op.hpp:605
A LinOp implementing this interface can write its data to a matrix_data structure.
Definition lin_op.hpp:660
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:673
std::shared_ptr< const Executor > get_executor() const noexcept
Returns the Executor associated with the array.
Definition array.hpp:689
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:682
size_type get_size() const noexcept
Returns the number of elements in the array.
Definition array.hpp:656
This type is a device-side equivalent to matrix_data.
Definition device_matrix_data.hpp:36
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:21
Dense is a matrix format which explicitly stores all values of the matrix.
Definition sparsity_csr.hpp:25
ELL is a matrix format where stride with explicit zeros is used such that all rows have the same numb...
Definition ell.hpp:64
automatic is a strategy_type which decides the number of stored elements per row of the ell part auto...
Definition hybrid.hpp:345
size_type compute_ell_num_stored_elements_per_row(array< size_type > *row_nnz) const override
Computes the number of stored elements per row of the ell part.
Definition hybrid.hpp:352
automatic()
Creates an automatic strategy.
Definition hybrid.hpp:350
column_limit is a strategy_type which decides the number of stored elements per row of the ell part b...
Definition hybrid.hpp:186
size_type compute_ell_num_stored_elements_per_row(array< size_type > *row_nnz) const override
Computes the number of stored elements per row of the ell part.
Definition hybrid.hpp:197
column_limit(size_type num_column=0)
Creates a column_limit strategy.
Definition hybrid.hpp:193
auto get_num_columns() const
Get the number of columns limit.
Definition hybrid.hpp:208
imbalance_bounded_limit is a strategy_type which decides the number of stored elements per row of the...
Definition hybrid.hpp:268
auto get_percentage() const
Get the percent setting.
Definition hybrid.hpp:292
size_type compute_ell_num_stored_elements_per_row(array< size_type > *row_nnz) const override
Computes the number of stored elements per row of the ell part.
Definition hybrid.hpp:277
imbalance_bounded_limit(double percent=0.8, double ratio=0.0001)
Creates a imbalance_bounded_limit strategy.
Definition hybrid.hpp:273
auto get_ratio() const
Get the ratio setting.
Definition hybrid.hpp:299
imbalance_limit is a strategy_type which decides the number of stored elements per row of the ell par...
Definition hybrid.hpp:221
size_type compute_ell_num_stored_elements_per_row(array< size_type > *row_nnz) const override
Computes the number of stored elements per row of the ell part.
Definition hybrid.hpp:235
auto get_percentage() const
Get the percent setting.
Definition hybrid.hpp:257
imbalance_limit(double percent=0.8)
Creates a imbalance_limit strategy.
Definition hybrid.hpp:229
minimal_storage_limit is a strategy_type which decides the number of stored elements per row of the e...
Definition hybrid.hpp:312
size_type compute_ell_num_stored_elements_per_row(array< size_type > *row_nnz) const override
Computes the number of stored elements per row of the ell part.
Definition hybrid.hpp:323
auto get_percentage() const
Get the percent setting.
Definition hybrid.hpp:334
minimal_storage_limit()
Creates a minimal_storage_limit strategy.
Definition hybrid.hpp:317
strategy_type is to decide how to set the hybrid config.
Definition hybrid.hpp:92
virtual size_type compute_ell_num_stored_elements_per_row(array< size_type > *row_nnz) const =0
Computes the number of stored elements per row of the ell part.
strategy_type()
Creates a strategy_type.
Definition hybrid.hpp:97
size_type get_ell_num_stored_elements_per_row() const noexcept
Returns the number of stored elements per row of the ell part.
Definition hybrid.hpp:133
void compute_hybrid_config(const array< size_type > &row_nnz, size_type *ell_num_stored_elements_per_row, size_type *coo_nnz)
Computes the config of the Hybrid matrix (ell_num_stored_elements_per_row and coo_nnz).
Definition hybrid.hpp:114
size_type get_coo_nnz() const noexcept
Returns the number of nonzeros of the coo part.
Definition hybrid.hpp:143
HYBRID is a matrix format which splits the matrix into ELLPACK and COO format.
Definition hybrid.hpp:55
size_type get_num_stored_elements() const noexcept
Returns the number of elements explicitly stored in the matrix.
Definition hybrid.hpp:604
static std::unique_ptr< Hybrid > create(std::shared_ptr< const Executor > exec, const dim< 2 > &size, size_type num_stored_elements_per_row, size_type stride, std::shared_ptr< strategy_type > strategy)
Creates an uninitialized Hybrid matrix of the specified size and method.
index_type * get_coo_row_idxs() noexcept
Returns the row indexes of the coo part.
Definition hybrid.hpp:568
value_type & ell_val_at(size_type row, size_type idx) noexcept
Returns the idx-th non-zero element of the row-th row in the ell part.
Definition hybrid.hpp:482
static std::unique_ptr< Hybrid > create(std::shared_ptr< const Executor > exec, const dim< 2 > &size, size_type num_stored_elements_per_row, std::shared_ptr< strategy_type > strategy=std::make_shared< automatic >())
Creates an uninitialized Hybrid matrix of the specified size and method.
size_type get_ell_stride() const noexcept
Returns the stride of the ell part.
Definition hybrid.hpp:459
size_type get_coo_num_stored_elements() const noexcept
Returns the number of elements explicitly stored in the coo part.
Definition hybrid.hpp:587
std::unique_ptr< absolute_type > compute_absolute() const override
Gets the AbsoluteLinOp.
index_type ell_col_at(size_type row, size_type idx) const noexcept
Returns the idx-th column index of the row-th row in the ell part.
Definition hybrid.hpp:513
index_type * get_coo_col_idxs() noexcept
Returns the column indexes of the coo part.
Definition hybrid.hpp:549
value_type ell_val_at(size_type row, size_type idx) const noexcept
Returns the idx-th non-zero element of the row-th row in the ell part.
Definition hybrid.hpp:490
const index_type * get_const_coo_row_idxs() const noexcept
Returns the row indexes of the coo part.
Definition hybrid.hpp:577
Hybrid(Hybrid &&)
Move-assigns a Hybrid matrix.
const value_type * get_const_ell_values() const noexcept
Returns the values of the ell part.
Definition hybrid.hpp:420
const ell_type * get_ell() const noexcept
Returns the matrix of the ell part.
Definition hybrid.hpp:523
std::unique_ptr< Diagonal< ValueType > > extract_diagonal() const override
Extracts the diagonal entries of the matrix into a vector.
value_type * get_ell_values() noexcept
Returns the values of the ell part.
Definition hybrid.hpp:411
static std::unique_ptr< Hybrid > create(std::shared_ptr< const Executor > exec, std::shared_ptr< strategy_type > strategy=std::make_shared< automatic >())
Creates an uninitialized Hybrid matrix of specified method.
size_type get_ell_num_stored_elements() const noexcept
Returns the number of elements explicitly stored in the ell part.
Definition hybrid.hpp:466
size_type get_ell_num_stored_elements_per_row() const noexcept
Returns the number of stored elements per row of ell part.
Definition hybrid.hpp:449
const index_type * get_const_coo_col_idxs() const noexcept
Returns the column indexes of the coo part.
Definition hybrid.hpp:558
Hybrid(const Hybrid &)
Copy-assigns a Hybrid matrix.
index_type * get_ell_col_idxs() noexcept
Returns the column indexes of the ell part.
Definition hybrid.hpp:430
void compute_absolute_inplace() override
Compute absolute inplace on each element.
const index_type * get_const_ell_col_idxs() const noexcept
Returns the column indexes of the ell part.
Definition hybrid.hpp:439
std::shared_ptr< strategy_type > get_strategy() const noexcept
Returns the strategy.
Definition hybrid.hpp:615
const coo_type * get_coo() const noexcept
Returns the matrix of the coo part.
Definition hybrid.hpp:597
static std::unique_ptr< Hybrid > create(std::shared_ptr< const Executor > exec, const dim< 2 > &size, size_type num_stored_elements_per_row, size_type stride, size_type num_nonzeros={}, std::shared_ptr< strategy_type > strategy=std::make_shared< automatic >())
Creates an uninitialized Hybrid matrix of the specified size and method.
value_type * get_coo_values() noexcept
Returns the values of the coo part.
Definition hybrid.hpp:530
static std::unique_ptr< Hybrid > create(std::shared_ptr< const Executor > exec, const dim< 2 > &size, std::shared_ptr< strategy_type > strategy=std::make_shared< automatic >())
Creates an uninitialized Hybrid matrix of the specified size and method.
Hybrid & operator=(const Hybrid &)
Copy-assigns a Hybrid matrix.
index_type & ell_col_at(size_type row, size_type idx) noexcept
Returns the idx-th column index of the row-th row in the ell part.
Definition hybrid.hpp:505
const value_type * get_const_coo_values() const noexcept
Returns the values of the coo part.
Definition hybrid.hpp:539
Hybrid & operator=(Hybrid &&)
Move-assigns a Hybrid matrix.
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:260
typename detail::next_precision_impl< T >::type next_precision
Obtains the next type in the singly-linked precision list with half.
Definition math.hpp:438
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:279
constexpr T zero()
Returns the additive identity for T.
Definition math.hpp:602
std::size_t size_type
Integral type used for allocation quantities.
Definition types.hpp:89
A type representing the dimensions of a multidimensional object.
Definition dim.hpp:26
This structure is used as an intermediate data type to store a sparse matrix.
Definition matrix_data.hpp:126