12#define FSB_TOL (4.5e-15)
17#define FSB_CART_SIZE (6U)
92 Span(T* ptr,
size_t len) noexcept : m_ptr(ptr), m_len(len) {}
94 [[nodiscard]] T* data()
noexcept {
return m_ptr; }
95 [[nodiscard]]
const T* data()
const noexcept {
return m_ptr; }
96 [[nodiscard]]
size_t size()
const noexcept {
return m_len; }
97 [[nodiscard]]
bool empty()
const noexcept {
return m_len == 0U; }
99 T& operator[](
size_t ind)
noexcept {
return *(m_ptr + ind); }
100 const T& operator[](
size_t ind)
const noexcept {
return *(m_ptr + ind); }
102 [[nodiscard]] T* begin()
noexcept {
return m_ptr; }
103 [[nodiscard]] T* end()
noexcept {
return m_ptr + m_len; }
104 [[nodiscard]]
const T* begin()
const noexcept {
return m_ptr; }
105 [[nodiscard]]
const T* end()
const noexcept {
return m_ptr + m_len; }
107 [[nodiscard]]
Span<T> active(
size_t num,
size_t offset = 0U)
noexcept
109 const size_t off_clamped = (offset < m_len) ? offset : m_len;
110 const size_t remaining = m_len - off_clamped;
111 const size_t count = (num < remaining) ? num : remaining;
112 return Span<T>(m_ptr + off_clamped, count);
114 [[nodiscard]]
Span<const T> active(
size_t num,
size_t offset = 0U)
const noexcept
116 const size_t off_clamped = (offset < m_len) ? offset : m_len;
117 const size_t remaining = m_len - off_clamped;
118 const size_t count = (num < remaining) ? num : remaining;
127template<
size_t Size,
typename Type = Real>
128struct Array :
public std::array<Type, Size>
132 const size_t num_count = (num < Size) ? num : Size;
137 const size_t num_count = (num < Size) ? num : Size;
Non-owning view over a contiguous sequence of elements (C++17 substitute for std::span)
Definition fsb_types.h:89
Definition fsb_types.h:129
3x3 symmetric matrix
Definition fsb_types.h:44
Real m00
Element [0, 0] of matrix.
Definition fsb_types.h:46
Real m01
Element [0, 1] and [1, 0] of matrix.
Definition fsb_types.h:52
Real m11
Element [1, 1] of matrix.
Definition fsb_types.h:48
Real m22
Element [2, 2] of matrix.
Definition fsb_types.h:50
Real m12
Element [1, 2] and [2, 1] of matrix.
Definition fsb_types.h:56
Real m02
Element [0, 2] and [2, 0] of matrix.
Definition fsb_types.h:54
3x3 matrix
Definition fsb_types.h:63
Real m02
Element [0, 2] of matrix.
Definition fsb_types.h:77
Real m11
Element [1, 1] of matrix.
Definition fsb_types.h:73
Real m21
Element [2, 1] of matrix.
Definition fsb_types.h:75
Real m12
Element [1, 2] of matrix.
Definition fsb_types.h:79
Real m20
Element [2, 0] of matrix.
Definition fsb_types.h:69
Real m00
Element [0, 0] of matrix.
Definition fsb_types.h:65
Real m01
Element [0, 1] of matrix.
Definition fsb_types.h:71
Real m10
Element [1, 0] of matrix.
Definition fsb_types.h:67
Real m22
Element [2, 2] of matrix.
Definition fsb_types.h:81
3D vector
Definition fsb_types.h:31
Real y
Y component.
Definition fsb_types.h:35
Real z
Z component.
Definition fsb_types.h:37
Real x
X component.
Definition fsb_types.h:33