14 {
a.nelem() } -> std::integral;
19 {
a.ncols() } -> std::integral;
24 {
a.nrows() } -> std::integral;
29 {
a.npages() } -> std::integral;
34 {
a.nbooks() } -> std::integral;
39 {
a.nshelves() } -> std::integral;
44 {
a.nvitrines() } -> std::integral;
49 {
a.nlibraries() } -> std::integral;
53namespace external_class {
57 {
a.cols() } -> std::integral;
63 {
a.rows() } -> std::integral;
69 {
a.size() } -> std::integral;
78 using internal_type =
decltype(x);
82 else return std::forward<internal_type>(x).ncols();
90 using internal_type =
decltype(x);
92 else return std::forward<internal_type>(x).nrows();
100 using internal_type =
decltype(x);
101 return std::forward<internal_type>(x).npages();
109 using internal_type =
decltype(x);
110 return std::forward<internal_type>(x).nbooks();
118 using internal_type =
decltype(x);
119 return std::forward<internal_type>(x).nshelves();
127 using internal_type =
decltype(x);
128 return std::forward<internal_type>(x).nvitrines();
136 using internal_type =
decltype(x);
137 return std::forward<internal_type>(x).nlibraries();
145template <std::
floating_po
int T>
151 std::floating_point<std::remove_cvref_t<T>> or
152 is_complex<std::remove_cvref_t<T>>::value;
164 {
a.nelem() } -> std::integral;
165 {
a.delem() } -> std::integral;
166 {
a.selem() } -> std::integral;
184 {
a.drows() } -> std::integral;
185 {
a.dcols() } -> std::integral;
186 {
a.selem() } -> std::integral;
258template <matpack_like T>
constexpr std::size_t
dim() {
264template <
class IndexType, std::
size_t N>
266 using T =
decltype(x);
267 static_assert(
N > 0 and
N < 8,
"Out of range");
269 static_assert((
N == 1 and dim<T>() == 2) or (
N == dim<T>()),
270 "Dimensions must agree, or a matrix-like that is runtime "
271 "defined as vector be used");
273 if constexpr (
N == 7)
274 return {
static_cast<IndexType
>(
library_size(std::forward<T>(x))),
275 static_cast<IndexType
>(
vitrine_size(std::forward<T>(x))),
276 static_cast<IndexType
>(
shelf_size(std::forward<T>(x))),
277 static_cast<IndexType
>(
book_size(std::forward<T>(x))),
278 static_cast<IndexType
>(
page_size(std::forward<T>(x))),
279 static_cast<IndexType
>(
row_size(std::forward<T>(x))),
280 static_cast<IndexType
>(
column_size(std::forward<T>(x)))};
281 else if constexpr (
N == 6)
282 return {
static_cast<IndexType
>(
vitrine_size(std::forward<T>(x))),
283 static_cast<IndexType
>(
shelf_size(std::forward<T>(x))),
284 static_cast<IndexType
>(
book_size(std::forward<T>(x))),
285 static_cast<IndexType
>(
page_size(std::forward<T>(x))),
286 static_cast<IndexType
>(
row_size(std::forward<T>(x))),
287 static_cast<IndexType
>(
column_size(std::forward<T>(x)))};
288 else if constexpr (
N == 5)
289 return {
static_cast<IndexType
>(
shelf_size(std::forward<T>(x))),
290 static_cast<IndexType
>(
book_size(std::forward<T>(x))),
291 static_cast<IndexType
>(
page_size(std::forward<T>(x))),
292 static_cast<IndexType
>(
row_size(std::forward<T>(x))),
293 static_cast<IndexType
>(
column_size(std::forward<T>(x)))};
294 else if constexpr (
N == 4)
295 return {
static_cast<IndexType
>(
book_size(std::forward<T>(x))),
296 static_cast<IndexType
>(
page_size(std::forward<T>(x))),
297 static_cast<IndexType
>(
row_size(std::forward<T>(x))),
298 static_cast<IndexType
>(
column_size(std::forward<T>(x)))};
299 else if constexpr (
N == 3)
300 return {
static_cast<IndexType
>(
page_size(std::forward<T>(x))),
301 static_cast<IndexType
>(
row_size(std::forward<T>(x))),
302 static_cast<IndexType
>(
column_size(std::forward<T>(x)))};
303 else if constexpr (
N == 2)
304 return {
static_cast<IndexType
>(
row_size(std::forward<T>(x))),
305 static_cast<IndexType
>(
column_size(std::forward<T>(x)))};
306 else if constexpr (
N == 1) {
307 if constexpr (dim<T>() == 2) {
309 static_cast<IndexType
>(std::min(
column_size(std::forward<T>(x)),
310 row_size(std::forward<T>(x)))) not_eq
311 static_cast<IndexType
>(1),
312 "Cannot perform vector conversion for matrix: ", x)
313 return {
static_cast<IndexType
>(std::max(
column_size(std::forward<T>(x)),
316 return {
static_cast<IndexType
>(
column_size(std::forward<T>(x)))};
Checks if the type has any accepted types of books as well as previous sizes.
Checks if the type has any accepted types of columns.
A concept to state if the type is a floating point or a floating point complex.
Eigen uses cols() for column index.
Eigen uses rows() for column index.
Checks if the type has any accepted types of libraries as well as previous sizes.
A concept precluding Arts matrix objects but allowing things similar to matrices.
A concept for an Arts matrix-like type with access operations.
A concept for any of the Arts matrix types.
Checks if the type has any accepted types of pages as well as previous sizes.
Checks if the type has any accepted types of rows as well as previous sizes.
Checks if the type has any accepted types of shelves as well as previous sizes.
A concept precluding Arts types but allowing the tensor-like object.
A concept for an Arts matrix-like type with access operations.
A concept precluding Arts types but allowing the tensor-like object.
A concept for an Arts matrix-like type with access operations.
A concept precluding Arts types but allowing the tensor-like object.
A concept for an Arts matrix-like type with access operations.
A concept precluding Arts types but allowing the tensor-like object.
A concept for an Arts matrix-like type with access operations.
A concept precluding Arts types but allowing the tensor-like object.
A concept for an Arts matrix-like type with access operations.
A concept precluding Arts vector objects but allowing things similar to vectors.
A concept for an Arts vector-like type with access operations.
A concept for any of the Arts vector types.
Checks if the type has any accepted types of vitrines as well as previous sizes.
Helper macros for debugging.
#define ARTS_USER_ERROR_IF(condition,...)
constexpr std::size_t dim()
constexpr auto vitrine_size(vitrine_keeper auto &&x)
Get a vitrine size from x.
constexpr auto column_size(column_keeper auto &&x)
Get a column size from x.
constexpr auto book_size(book_keeper auto &&x)
Get a book size from x.
constexpr std::array< IndexType, N > shape(matpack_like auto &&x)
Creates a shape array (note that this might create compile time errors if N is larger than x allows f...
constexpr auto shelf_size(shelf_keeper auto &&x)
Get a shelf size from x.
constexpr auto library_size(library_keeper auto &&x)
Get a library size from x.
constexpr auto row_size(row_keeper auto &&x)
Get a row size from x.
constexpr auto page_size(page_keeper auto &&x)
Get a page size from x.
A concept overload to remove non std::complex<> from list.