Tensorium
|
A 2D aligned matrix for numerical derivatives. More...
#include <Derivate.hpp>
Public Types | |
using | reg = typename Simd::reg |
using | reg = typename Simd::reg |
Public Member Functions | |
Derivate (size_t r, size_t c) | |
Constructor with explicit dimensions. | |
Derivate (const Matrix< K > &m) | |
Construct from an existing matrix. | |
K & | operator() (size_t i, size_t j) |
Mutable access to an element. | |
const K & | operator() (size_t i, size_t j) const |
Const access to an element. | |
size_t | size () const |
Total number of elements in the matrix. | |
__attribute__ ((always_inline, hot, flatten)) inline void centered_derivative(const Derivate< K > &input | |
Compute second-order centered derivative. | |
if (axis==1) | |
else | if (axis==0) |
__attribute__ ((always_inline, hot, flatten)) inline void centered_derivative_order4(const Derivate< K > &input | |
Compute fourth-order centered derivative. | |
if (axis==1) | |
else | if (axis==0) |
Public Attributes | |
size_t | rows |
size_t | cols |
aligned_vector< K > | data |
size_t | block_size |
Derivate< K > & | output |
Derivate< K > size_t | axis |
Derivate< K > size_t K dx | const |
const size_t | simd_width = Simd::width |
const K | inv_2dx = K(1) / (K(2) * dx) |
else | |
Derivate< K > size_t K | dx |
constexpr size_t | W = Simd::width |
const K | inv_12dx = K(1) / (K(12) * dx) |
const reg | inv = Simd::set1(inv_12dx) |
const reg | eight = Simd::set1(8.0f) |
A 2D aligned matrix for numerical derivatives.
K | Scalar type (e.g., float, double). |
Constructor with explicit dimensions.
r | Number of rows. |
c | Number of columns. |
References tensorium::Derivate< K >::block_size.
Construct from an existing matrix.
m | Input matrix. |
tensorium::Derivate< K >::__attribute__ | ( | (always_inline, hot, flatten) | ) | const & |
Compute second-order centered derivative.
input | Input matrix. |
output | Output matrix. |
axis | Differentiation axis (0 = rows, 1 = cols). |
dx | Grid spacing. |
tensorium::Derivate< K >::__attribute__ | ( | (always_inline, hot, flatten) | ) | const & |
Compute fourth-order centered derivative.
input | Input matrix. |
output | Output matrix. |
axis | Differentiation axis. |
dx | Grid spacing. |
References tensorium::Derivate< K >::inv_2dx, and tensorium::Derivate< K >::output.
|
inline |
|
inline |
Mutable access to an element.
i | Row index. |
j | Column index. |
References tensorium::Derivate< K >::cols, tensorium::Derivate< K >::data, and tensorium::Derivate< K >::rows.
Const access to an element.
i | Row index. |
j | Column index. |
References tensorium::Derivate< K >::cols, tensorium::Derivate< K >::data, and tensorium::Derivate< K >::rows.
|
inline |
Total number of elements in the matrix.
References tensorium::Derivate< K >::cols, and tensorium::Derivate< K >::rows.
size_t tensorium::Derivate< K >::block_size |
Referenced by tensorium::Derivate< K >::Derivate().
size_t tensorium::Derivate< K >::cols |
aligned_vector<K> tensorium::Derivate< K >::data |
Referenced by tensorium::Derivate< K >::operator()(), and tensorium::Derivate< K >::operator()().
Referenced by tensorium::Derivate< K >::if(), and tensorium::Derivate< K >::if().
tensorium::Derivate< K >::else |
Referenced by tensorium::Derivate< K >::if(), and tensorium::Derivate< K >::if().
Referenced by tensorium::Derivate< K >::if(), and tensorium::Derivate< K >::if().
Referenced by tensorium::Derivate< K >::if(), and tensorium::Derivate< K >::if().
Referenced by tensorium::Derivate< K >::if(), and tensorium::Derivate< K >::if().
size_t tensorium::Derivate< K >::rows |
Referenced by tensorium::Derivate< K >::if().
Referenced by tensorium::Derivate< K >::if(), and tensorium::Derivate< K >::if().