Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions src/core/matpack/matpack_mdspan_cdata_t.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
namespace matpack {
template <typename T, Size... dims>
struct [[nodiscard]] cdata_t {
constexpr static bool matpack_magic_cdata = true;

constexpr static Size N = sizeof...(dims);
constexpr static Size ndata = (dims * ...);

Expand Down Expand Up @@ -346,10 +344,10 @@ struct tuple_element<I, T> {
};
} // namespace std

using Vector2 = matpack::cdata_t<Numeric, 2>;
using Vector3 = matpack::cdata_t<Numeric, 3>;
using Vector4 = matpack::cdata_t<Numeric, 4>;
using Vector7 = matpack::cdata_t<Numeric, 7>;
using Matrix33 = matpack::cdata_t<Numeric, 3, 3>;
using Matrix44 = matpack::cdata_t<Numeric, 4, 4>;
using Vector2 = matpack::cdata_t<Numeric, 2>;
using Vector3 = matpack::cdata_t<Numeric, 3>;
using Vector4 = matpack::cdata_t<Numeric, 4>;
using Vector7 = matpack::cdata_t<Numeric, 7>;
using Matrix33 = matpack::cdata_t<Numeric, 3, 3>;
using Matrix44 = matpack::cdata_t<Numeric, 4, 4>;
using ComplexMatrix44 = matpack::cdata_t<Complex, 4, 4>;
8 changes: 7 additions & 1 deletion src/core/matpack/matpack_mdspan_common_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,13 @@ template <class T>
concept any_strided_view = any_strided_view_t<std::remove_cvref_t<T>>::value;

template <class T>
concept any_cdata = std::remove_cvref_t<T>::matpack_magic_cdata;
struct any_cdata_t : std::false_type {};

template <class T, Size... dims>
struct any_cdata_t<cdata_t<T, dims...>> : std::true_type {};

template <class T>
concept any_cdata = any_cdata_t<std::remove_cvref_t<T>>::value;

template <class T>
struct any_grid_t : std::false_type {};
Expand Down
21 changes: 21 additions & 0 deletions src/core/rtepack/rtepack_common.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#pragma once

#include <matpack.h>

namespace rtepack {
struct propmat;
struct muelmat;
struct specmat;
struct stokvec;
} // namespace rtepack

namespace matpack {
template <>
struct any_cdata_t<rtepack::propmat> : std::true_type {};
template <>
struct any_cdata_t<rtepack::muelmat> : std::true_type {};
template <>
struct any_cdata_t<rtepack::specmat> : std::true_type {};
template <>
struct any_cdata_t<rtepack::stokvec> : std::true_type {};
} // namespace matpack
2 changes: 2 additions & 0 deletions src/core/rtepack/rtepack_mueller_matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include <matpack.h>
#include <xml.h>

#include "rtepack_common.h"

namespace rtepack {

//! A 4x4 matrix of Numeric values to be used as a Mueller Matrix
Expand Down
2 changes: 2 additions & 0 deletions src/core/rtepack/rtepack_propagation_matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

#include <numeric>

#include "rtepack_common.h"

namespace rtepack {
struct propmat final : Vector7 {
constexpr propmat(Numeric a = 0.0,
Expand Down
2 changes: 2 additions & 0 deletions src/core/rtepack/rtepack_spectral_matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include <matpack.h>
#include <xml.h>

#include "rtepack_common.h"

namespace rtepack {

//! A 4x4 matrix of Complex values to be used as a Mueller Matrix
Expand Down
2 changes: 2 additions & 0 deletions src/core/rtepack/rtepack_stokes_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#include <utility>

#include "rtepack_common.h"

namespace rtepack {
struct stokvec final : Vector4 {
[[nodiscard]] constexpr stokvec(Numeric i = 0.0,
Expand Down
Loading