12#ifndef _FLAMES_TENSOR_HPP_
13#define _FLAMES_TENSOR_HPP_
15#ifndef _FLAMES_CORE_HPP_
19#ifndef FLAMES_TENSOR_PARTITION_COMPLETE
20# ifdef FLAMES_MAT_PARTITION_COMPLETE
21# define FLAMES_TENSOR_PARTITION_COMPLETE
26template <
typename T,
size_t n_rows,
size_t n_cols,
size_t n_slices, MatType type>
34#ifdef FLAMES_TENSOR_PARTITION_COMPLETE
41 inline static constexpr size_t matSize() noexcept {
48 : (1 + n_rows) * n_rows / 2;
51 inline static constexpr size_t size() noexcept {
return n_slices *
size(); }
54 assert(index < n_slices &&
"Index should be within in range for MatView::slice(index).");
59 assert(index < n_slices &&
"Index should be within in range for MatView::slice(index).");
72 : type ==
MatType::
SLOWER ? n_slices * (n_rows - 1) * n_rows / 2
73 : type ==
MatType::
ASYM ? n_slices * (n_rows - 1) * n_rows / 2
74 : n_slices * (1 + n_rows) * n_rows / 2];
Read only view version of a matrix.
Definition core.hpp:7057
Tensor.
Definition tensor.hpp:27
T element_type
Definition tensor.hpp:29
Tensor()
Definition tensor.hpp:33
View operator[](size_t index)
Definition tensor.hpp:65
View operator[](size_t index) const
Definition tensor.hpp:63
View slice(size_t index) const
Definition tensor.hpp:53
static constexpr size_t size() noexcept
Definition tensor.hpp:51
static constexpr size_t matSize() noexcept
Definition tensor.hpp:41
View slice(size_t index)
Definition tensor.hpp:58
T _data[type==MatType::NORMAL ? n_slices *n_rows *n_cols :type==MatType::DIAGONAL ? n_slices *n_rows :type==MatType::SCALAR ? n_slices *1 :type==MatType::SUPPER ? n_slices *(n_rows - 1) *n_rows/2 :type==MatType::SLOWER ? n_slices *(n_rows - 1) *n_rows/2 :type==MatType::ASYM ? n_slices *(n_rows - 1) *n_rows/2 :n_slices *(1+n_rows) *n_rows/2]
Definition tensor.hpp:74
T value_type
Definition tensor.hpp:30
Core Utilities for FLAMES.
#define FLAMES_PRAGMA(x)
Definition core.hpp:50
#define FLAMES_MAT_PARTITION_FACTOR
Definition core.hpp:143
Namespace for the FLAMES library.
Definition core.hpp:166
MatType
Matrix type for storage.
Definition core.hpp:172
@ SCALAR
Definition core.hpp:175
@ SLOWER
Definition core.hpp:179
@ DIAGONAL
Definition core.hpp:174
@ NORMAL
Definition core.hpp:173
@ ASYM
Definition core.hpp:181
@ SUPPER
Definition core.hpp:178