Serac  0.1
Serac is an implicit thermal strucural mechanics simulation code.
Classes | Namespaces | Typedefs | Functions
tensor.hpp File Reference

Implementation of the tensor class used by Functional. More...

#include <cmath>
#include "serac/infrastructure/accelerator.hpp"
#include "detail/metaprogramming.hpp"
#include "serac/numerics/functional/isotropic_tensor.hpp"
#include "serac/numerics/functional/tuple_tensor_dual_functions.hpp"
Include dependency graph for tensor.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  serac::zero
 A sentinel struct for eliding no-op tensor operations. More...
 
struct  serac::is_zero< T >
 checks if a type is zero More...
 
struct  serac::is_zero< zero >
 
struct  serac::LuFactorization< T, n >
 Representation of an LU factorization. More...
 

Namespaces

 serac
 Accelerator functionality.
 

Typedefs

using serac::vec2 = tensor< double, 2 >
 statically sized vector of 2 doubles
 
using serac::vec3 = tensor< double, 3 >
 statically sized vector of 3 doubles
 
using serac::mat2 = tensor< double, 2, 2 >
 statically sized 2x2 matrix of doubles
 
using serac::mat3 = tensor< double, 3, 3 >
 statically sized 3x3 matrix of doubles
 
template<typename T , int n1, int n2 = 1>
using serac::reduced_tensor = std::conditional_t<(n1==1 &&n2==1), double, std::conditional_t< n1==1, tensor< T, n2 >, std::conditional_t< n2==1, tensor< T, n1 >, tensor< T, n1, n2 > >> >
 Removes 1s from tensor dimensions For example, a tensor<T, 1, 10> is equivalent to a tensor<T, 10> More...
 
template<typename T1 , typename T2 >
using serac::outer_product_t = typename detail::outer_prod< T1, T2 >::type
 a type function that returns the tensor type of an outer product of two tensors More...
 

Functions

template<typename T , int n1>
 serac::tensor (const T(&data)[n1]) -> tensor< T, n1 >
 class template argument deduction guide for type tensor. More...
 
template<typename T , int n1, int n2>
 serac::tensor (const T(&data)[n1][n2]) -> tensor< T, n1, n2 >
 class template argument deduction guide for type tensor. More...
 
constexpr SERAC_HOST_DEVICE auto serac::operator+ (zero, zero)
 the sum of two zeros is zero
 
template<typename T >
constexpr SERAC_HOST_DEVICE auto serac::operator+ (zero, T other)
 the sum of zero with something non-zero just returns the other value
 
template<typename T >
constexpr SERAC_HOST_DEVICE auto serac::operator+ (T other, zero)
 the sum of zero with something non-zero just returns the other value
 
constexpr SERAC_HOST_DEVICE auto serac::operator- (zero)
 the unary negation of zero is zero
 
constexpr SERAC_HOST_DEVICE auto serac::operator- (zero, zero)
 the difference of two zeros is zero
 
template<typename T >
constexpr SERAC_HOST_DEVICE auto serac::operator- (zero, T other)
 the difference of zero with something else is the unary negation of the other thing
 
template<typename T >
constexpr SERAC_HOST_DEVICE auto serac::operator- (T other, zero)
 the difference of something else with zero is the other thing itself
 
constexpr SERAC_HOST_DEVICE auto serac::operator* (zero, zero)
 the product of two zeros is zero
 
template<typename T >
constexpr SERAC_HOST_DEVICE auto serac::operator* (zero, T)
 the product zero with something else is also zero
 
template<typename T >
constexpr SERAC_HOST_DEVICE auto serac::operator* (T, zero)
 the product zero with something else is also zero
 
template<typename T >
constexpr SERAC_HOST_DEVICE auto serac::operator/ (zero, T)
 zero divided by something is zero
 
template<typename T >
void serac::operator/ (T, zero)
 Get a human-readable compiler error when you try to divide by zero.
 
constexpr SERAC_HOST_DEVICE auto serac::operator+= (zero, zero)
 zero plus zero is zero
 
constexpr SERAC_HOST_DEVICE auto serac::operator-= (zero, zero)
 zero minus zero is zero
 
template<int i>
SERAC_HOST_DEVICE zero & serac::get (zero &x)
 let zero be accessed like a tuple
 
template<int i>
SERAC_HOST_DEVICE zero serac::get (const zero &)
 let zero be accessed like a tuple
 
template<typename T >
constexpr SERAC_HOST_DEVICE zero serac::dot (const T &, zero)
 the dot product of anything with zero is zero
 
template<typename T >
constexpr SERAC_HOST_DEVICE zero serac::dot (zero, const T &)
 the dot product of anything with zero is zero
 
template<typename T , int... n>
constexpr SERAC_HOST_DEVICE auto serac::tensor_with_shape (std::integer_sequence< int, n... >)
 Creates a tensor given the dimensions in a std::integer_sequence. More...
 
template<typename lambda_type >
SERAC_SUPPRESS_NVCC_HOSTDEVICE_WARNING constexpr SERAC_HOST_DEVICE auto serac::make_tensor (lambda_type f)
 Creates a tensor of requested dimension by subsequent calls to a functor Can be thought of as analogous to std::transform in that the set of possible indices for dimensions n are transformed into the values of the tensor by f. More...
 
template<int n1, typename lambda_type >
SERAC_SUPPRESS_NVCC_HOSTDEVICE_WARNING constexpr SERAC_HOST_DEVICE auto serac::make_tensor (lambda_type f)
 Creates a tensor of requested dimension by subsequent calls to a functor. More...
 
template<int n1, int n2, typename lambda_type >
SERAC_SUPPRESS_NVCC_HOSTDEVICE_WARNING constexpr SERAC_HOST_DEVICE auto serac::make_tensor (lambda_type f)
 Creates a tensor of requested dimension by subsequent calls to a functor. More...
 
template<int n1, int n2, int n3, typename lambda_type >
SERAC_SUPPRESS_NVCC_HOSTDEVICE_WARNING constexpr SERAC_HOST_DEVICE auto serac::make_tensor (lambda_type f)
 Creates a tensor of requested dimension by subsequent calls to a functor. More...
 
template<int n1, int n2, int n3, int n4, typename lambda_type >
SERAC_SUPPRESS_NVCC_HOSTDEVICE_WARNING constexpr SERAC_HOST_DEVICE auto serac::make_tensor (lambda_type f)
 Creates a tensor of requested dimension by subsequent calls to a functor. More...
 
template<typename S , typename T , int m, int... n>
constexpr SERAC_HOST_DEVICE auto serac::operator+ (const tensor< S, m, n... > &A, const tensor< T, m, n... > &B)
 return the sum of two tensors More...
 
template<typename T , int m, int... n>
constexpr SERAC_HOST_DEVICE auto serac::operator- (const tensor< T, m, n... > &A)
 return the unary negation of a tensor More...
 
template<typename S , typename T , int m, int... n>
constexpr SERAC_HOST_DEVICE auto serac::operator- (const tensor< S, m, n... > &A, const tensor< T, m, n... > &B)
 return the difference of two tensors More...
 
template<typename S , typename T , int m, int... n>
constexpr SERAC_HOST_DEVICE auto & serac::operator+= (tensor< S, m, n... > &A, const tensor< T, m, n... > &B)
 compound assignment (+) on tensors More...
 
template<typename T , int n>
constexpr SERAC_HOST_DEVICE auto & serac::operator+= (tensor< T, n, 1 > &A, const tensor< T, n > &B)
 compound assignment (+) on tensors More...
 
template<typename T , int n>
constexpr SERAC_HOST_DEVICE auto & serac::operator+= (tensor< T, 1, n > &A, const tensor< T, n > &B)
 compound assignment (+) on tensors More...
 
template<typename T >
constexpr SERAC_HOST_DEVICE auto & serac::operator+= (tensor< T, 1 > &A, const T &B)
 compound assignment (+) on tensors More...
 
template<typename T >
constexpr SERAC_HOST_DEVICE auto & serac::operator+= (tensor< T, 1, 1 > &A, const T &B)
 compound assignment (+) on tensors More...
 
template<typename T , int... n>
constexpr SERAC_HOST_DEVICE auto & serac::operator+= (tensor< T, n... > &A, zero)
 compound assignment (+) between a tensor and zero (no-op) More...
 
template<typename S , typename T , int m, int... n>
constexpr SERAC_HOST_DEVICE auto & serac::operator-= (tensor< S, m, n... > &A, const tensor< T, m, n... > &B)
 compound assignment (-) on tensors More...
 
template<typename T , int... n>
constexpr SERAC_HOST_DEVICE auto & serac::operator-= (tensor< T, n... > &A, zero)
 compound assignment (-) between a tensor and zero (no-op) More...
 
template<typename T , int n>
constexpr SERAC_HOST_DEVICE auto serac::outer (double A, tensor< T, n > B)
 
template<typename T , int m>
constexpr SERAC_HOST_DEVICE auto serac::outer (const tensor< T, m > &A, double B)
 
template<typename T , int n>
constexpr SERAC_HOST_DEVICE auto serac::outer (zero, const tensor< T, n > &)
 
template<typename T , int n>
constexpr SERAC_HOST_DEVICE auto serac::outer (const tensor< T, n > &, zero)
 
template<typename S , typename T , int m, int n>
constexpr SERAC_HOST_DEVICE auto serac::outer (const tensor< S, m > &A, const tensor< T, n > &B)
 
template<typename S , typename T , int m, int n>
constexpr SERAC_HOST_DEVICE auto serac::inner (const tensor< S, m, n > &A, const tensor< T, m, n > &B)
 this function contracts over all indices of the two tensor arguments More...
 
template<typename S , typename T , int m>
constexpr SERAC_HOST_DEVICE auto serac::inner (const tensor< S, m > &A, const tensor< T, m > &B)
 
constexpr SERAC_HOST_DEVICE auto serac::inner (double A, double B)
 
template<typename S , int m, int n>
constexpr SERAC_HOST_DEVICE auto serac::inner (const tensor< S, m, n > &, zero)
 this function contracts over all indices of the two tensor arguments More...
 
template<typename S , int m>
constexpr SERAC_HOST_DEVICE auto serac::inner (const tensor< S, m > &, zero)
 
constexpr SERAC_HOST_DEVICE auto serac::inner (double, zero)
 
template<typename T , int m, int n>
constexpr SERAC_HOST_DEVICE auto serac::inner (zero, const tensor< T, m, n > &)
 this function contracts over all indices of the two tensor arguments More...
 
template<typename T , int m>
constexpr SERAC_HOST_DEVICE auto serac::inner (zero, const tensor< T, m > &)
 
constexpr SERAC_HOST_DEVICE auto serac::inner (zero, double)
 
template<typename S , typename T , int m, int n, int p>
constexpr SERAC_HOST_DEVICE auto serac::dot (const tensor< S, m, n > &A, const tensor< T, n, p > &B)
 this function contracts over the "middle" index of the two tensor arguments More...
 
template<typename T , int m>
constexpr SERAC_HOST_DEVICE auto serac::dot (const tensor< T, m > &A, double B)
 
template<typename T , int m>
constexpr SERAC_HOST_DEVICE auto serac::dot (double B, const tensor< T, m > &A)
 
template<typename S , typename T , int m>
constexpr SERAC_HOST_DEVICE auto serac::dot (const tensor< S, m > &A, const tensor< T, m > &B)
 
template<typename S , typename T , int m, int n>
constexpr SERAC_HOST_DEVICE auto serac::dot (const tensor< S, m > &A, const tensor< T, m, n > &B)
 
template<typename S , typename T , int m, int n, int p>
constexpr SERAC_HOST_DEVICE auto serac::dot (const tensor< S, m > &A, const tensor< T, m, n, p > &B)
 
template<typename S , typename T , int m, int n, int p, int q>
constexpr SERAC_HOST_DEVICE auto serac::dot (const tensor< S, m > &A, const tensor< T, m, n, p, q > &B)
 
template<typename S , typename T , int m, int n>
constexpr SERAC_HOST_DEVICE auto serac::dot (const tensor< S, m, n > &A, const tensor< T, n > &B)
 
template<typename S , typename T , int m, int n, int p, int q, int r>
constexpr SERAC_HOST_DEVICE auto serac::dot (const tensor< S, m, n > &A, const tensor< T, n, p, q, r > &B)
 
template<typename S , typename T , int m, int n, int p, int q>
constexpr SERAC_HOST_DEVICE auto serac::dot (const tensor< S, m, n > &A, const tensor< T, n, p, q > &B)
 
template<typename S , typename T , int m, int n, int p>
constexpr SERAC_HOST_DEVICE auto serac::dot (const tensor< S, m, n, p > &A, const tensor< T, p > &B)
 
template<typename S , typename T , typename U , int m, int n>
constexpr SERAC_HOST_DEVICE auto serac::dot (const tensor< S, m > &u, const tensor< T, m, n > &A, const tensor< U, n > &v)
 
template<typename S , typename T , int m, int n, int p, int q>
constexpr SERAC_HOST_DEVICE auto serac::dot (const tensor< S, m, n, p, q > &A, const tensor< T, q > &B)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T >
auto serac::cross (const tensor< T, 3, 2 > &A)
 compute the cross product of the columns of A: A(:,1) x A(:,2)
 
template<typename T >
auto serac::cross (const tensor< T, 2, 1 > &v)
 return the in-plane components of the cross product of {v[0], v[1], 0} x {0, 0, 1}
 
template<typename T >
auto serac::cross (const tensor< T, 2 > &v)
 return the in-plane components of the cross product of {v[0], v[1], 0} x {0, 0, 1}
 
template<typename S , typename T >
auto serac::cross (const tensor< S, 3 > &u, const tensor< T, 3 > &v)
 compute the (right handed) cross product of two 3-vectors
 
template<typename S , typename T , int m, int n, int p, int q>
constexpr SERAC_HOST_DEVICE auto serac::double_dot (const tensor< S, m, n, p, q > &A, const tensor< T, p, q > &B)
 double dot product, contracting over the two "middle" indices More...
 
template<typename S , typename T , int m, int n, int p>
constexpr SERAC_HOST_DEVICE auto serac::double_dot (const tensor< S, m, n, p > &A, const tensor< T, n, p > &B)
 
template<typename S , typename T , int m, int n>
constexpr auto serac::double_dot (const tensor< S, m, n > &A, const tensor< T, m, n > &B)
 
template<typename S , typename T , int... m, int... n>
constexpr SERAC_HOST_DEVICE auto serac::operator* (const tensor< S, m... > &A, const tensor< T, n... > &B)
 this is a shorthand for dot(A, B)
 
template<typename T , int m>
constexpr SERAC_HOST_DEVICE auto serac::squared_norm (const tensor< T, m > &A)
 Returns the squared Frobenius norm of the tensor. More...
 
template<typename T , int m, int n>
constexpr SERAC_HOST_DEVICE auto serac::squared_norm (const tensor< T, m, n > &A)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T , int... n>
constexpr SERAC_HOST_DEVICE auto serac::squared_norm (const tensor< T, n... > &A)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T , int... n>
SERAC_HOST_DEVICE auto serac::norm (const tensor< T, n... > &A)
 Returns the Frobenius norm of the tensor. More...
 
constexpr SERAC_HOST_DEVICE auto serac::norm (zero)
 overload of Frobenius norm for zero type
 
template<typename T , int... n>
SERAC_HOST_DEVICE auto serac::normalize (const tensor< T, n... > &A)
 Normalizes the tensor Each element is divided by the Frobenius norm of the tensor,. More...
 
template<typename T >
SERAC_HOST_DEVICE tensor< T, 3, 3 > serac::to_3x3 (const tensor< T, 2, 2 > &A)
 promotes a 2x2 matrix to a 3x3 matrix, by populating the upper left block, leaving zeroes in the third row / column More...
 
template<typename T , int n>
constexpr SERAC_HOST_DEVICE auto serac::tr (const tensor< T, n, n > &A)
 Returns the trace of a square matrix. More...
 
template<typename T , int n>
constexpr SERAC_HOST_DEVICE auto serac::sym (const tensor< T, n, n > &A)
 Returns the symmetric part of a square matrix. More...
 
template<typename T , int n>
constexpr SERAC_HOST_DEVICE auto serac::antisym (const tensor< T, n, n > &A)
 Returns the antisymmetric part of a square matrix. More...
 
template<typename T , int n>
constexpr SERAC_HOST_DEVICE auto serac::dev (const tensor< T, n, n > &A)
 Calculates the deviator of a matrix (rank-2 tensor) More...
 
template<typename T , int n>
constexpr SERAC_HOST_DEVICE auto serac::diagonal_matrix (const tensor< T, n, n > &A)
 Returns a square matrix (rank-2 tensor) containing the diagonal entries of the input square matrix with zeros in the off-diagonal positions. More...
 
template<typename T , int n>
constexpr SERAC_HOST_DEVICE tensor< T, n, n > serac::diag (const tensor< T, n > &d)
 Returns a square diagonal matrix by specifying the diagonal entries. More...
 
template<typename T , int n>
constexpr SERAC_HOST_DEVICE tensor< T, n > serac::diag (const tensor< T, n, n > &D)
 Returns an array containing the diagonal entries of a square matrix. More...
 
template<int dim>
constexpr SERAC_HOST_DEVICE tensor< double, dim, dim > serac::DenseIdentity ()
 Obtains the identity matrix of the specified dimension. More...
 
template<typename T , int m, int n>
constexpr SERAC_HOST_DEVICE auto serac::transpose (const tensor< T, m, n > &A)
 Returns the transpose of the matrix. More...
 
template<typename T >
constexpr SERAC_HOST_DEVICE auto serac::I2 (const tensor< T, 3, 3 > &A)
 Returns the second invariant of a 3x3 matrix. More...
 
template<typename T >
constexpr SERAC_HOST_DEVICE auto serac::det (const tensor< T, 2, 2 > &A)
 Returns the determinant of a matrix. More...
 
template<typename T >
constexpr SERAC_HOST_DEVICE auto serac::det (const tensor< T, 3, 3 > &A)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T >
constexpr SERAC_HOST_DEVICE auto serac::detApIm1 (const tensor< T, 2, 2 > &A)
 computes det(A + I) - 1, where precision is not lost when the entries A_{ij} << 1 More...
 
template<typename T >
constexpr SERAC_HOST_DEVICE auto serac::detApIm1 (const tensor< T, 3, 3 > &A)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T , int dim>
auto serac::matrix_sqrt (const tensor< T, dim, dim > &A)
 compute the matrix square root of a square, real-valued, symmetric matrix i.e. given A, find B such that A = dot(B, B) More...
 
template<int i1, int i2, typename S , int m, int... n, typename T , int p, int q>
SERAC_HOST_DEVICE auto serac::contract (const tensor< S, m, n... > &A, const tensor< T, p, q > &B)
 a convenience function that computes a dot product between two tensor, but that allows the user to specify which indices should be summed over. For example: More...
 
template<int i1, int i2, typename T >
SERAC_HOST_DEVICE auto serac::contract (const zero &, const T &)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T , int... n>
double serac::relative_error (tensor< T, n... > A, tensor< T, n... > B)
 computes the relative error (in the frobenius norm) between two tensors of the same shape More...
 
template<int n>
SERAC_HOST_DEVICE bool serac::is_symmetric (tensor< double, n, n > A, double tolerance=1.0e-8)
 Return whether a square rank 2 tensor is symmetric. More...
 
SERAC_HOST_DEVICE bool serac::is_symmetric_and_positive_definite (tensor< double, 2, 2 > A)
 Return whether a matrix is symmetric and positive definite This check uses Sylvester's criterion, checking that each upper left subtensor has a determinant greater than zero. More...
 
SERAC_HOST_DEVICE bool serac::is_symmetric_and_positive_definite (tensor< double, 3, 3 > A)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T , int n, int... m>
constexpr SERAC_HOST_DEVICE auto serac::solve_lower_triangular (const tensor< T, n, n > &L, const tensor< T, n, m... > &b, const tensor< int, n > &P)
 Solves a lower triangular system Ly = b. More...
 
template<typename T , int n, int... m>
constexpr SERAC_HOST_DEVICE auto serac::solve_lower_triangular (const tensor< T, n, n > &L, const tensor< T, n, m... > &b)
 
template<typename T , int n, int... m>
constexpr SERAC_HOST_DEVICE auto serac::solve_upper_triangular (const tensor< T, n, n > &U, const tensor< T, n, m... > &y)
 Solves an upper triangular system Ux = y. More...
 
template<typename S , typename T , int n, int... m>
constexpr SERAC_HOST_DEVICE auto serac::linear_solve (const LuFactorization< S, n > &lu_factors, const tensor< T, n, m... > &b)
 
template<typename T , int n>
constexpr SERAC_HOST_DEVICE auto serac::linear_solve (const LuFactorization< T, n > &, const zero)
 
constexpr SERAC_HOST_DEVICE tensor< double, 2, 2 > serac::inv (const tensor< double, 2, 2 > &A)
 Inverts a matrix. More...
 
constexpr SERAC_HOST_DEVICE tensor< double, 3, 3 > serac::inv (const tensor< double, 3, 3 > &A)
 
template<typename T , int n>
constexpr SERAC_HOST_DEVICE auto serac::inv (const tensor< T, n, n > &A)
 
template<typename T , int m, int... n>
auto & serac::operator<< (std::ostream &out, const tensor< T, m, n... > &A)
 recursively serialize the entries in a tensor to an ostream. Output format uses braces and comma separators to mimic C syntax for multidimensional array initialization. More...
 
auto & serac::operator<< (std::ostream &out, zero)
 Write a zero out to an output stream. More...
 
SERAC_HOST_DEVICE void serac::print (double value)
 print a double using printf, so that it is suitable for use inside cuda kernels. (used in final recursion of printf(tensor<...>)) More...
 
template<int m, int... n>
SERAC_HOST_DEVICE void serac::print (const tensor< double, m, n... > &A)
 print a tensor using printf, so that it is suitable for use inside cuda kernels. More...
 
template<int n>
constexpr SERAC_HOST_DEVICE auto serac::chop (const tensor< double, n > &A)
 replace all entries in a tensor satisfying |x| < 1.0e-10 by literal zero More...
 
template<int m, int n>
constexpr SERAC_HOST_DEVICE auto serac::chop (const tensor< double, m, n > &A)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
SERAC_HOST_DEVICE auto serac::get_gradient (double)
 Retrieves the gradient component of a double (which is nothing) More...
 
template<int... n>
constexpr SERAC_HOST_DEVICE auto serac::get_gradient (const tensor< double, n... > &)
 get the gradient of type tensor (note: since its stored type is not a dual number, the derivative term is identically zero) More...
 
constexpr SERAC_HOST_DEVICE auto serac::chain_rule (const zero, const zero)
 evaluate the change (to first order) in a function, f, given a small change in the input argument, dx.
 
template<typename T >
constexpr SERAC_HOST_DEVICE auto serac::chain_rule (const zero, const T)
 
template<typename T >
constexpr SERAC_HOST_DEVICE auto serac::chain_rule (const T, const zero)
 
constexpr SERAC_HOST_DEVICE auto serac::chain_rule (const double df_dx, const double dx)
 
template<int... n>
constexpr SERAC_HOST_DEVICE auto serac::chain_rule (const tensor< double, n... > &df_dx, const double dx)
 
template<int... n>
constexpr SERAC_HOST_DEVICE auto serac::chain_rule (const tensor< double, n... > &df_dx, const tensor< double, n... > &dx)
 
template<int m, int... n>
constexpr SERAC_HOST_DEVICE auto serac::chain_rule (const tensor< double, m, n... > &df_dx, const tensor< double, n... > &dx)
 
template<int m, int n, int... p>
SERAC_HOST_DEVICE auto serac::chain_rule (const tensor< double, m, n, p... > &df_dx, const tensor< double, p... > &dx)
 
template<typename T , int... n>
constexpr SERAC_HOST_DEVICE int serac::size (const tensor< T, n... > &)
 returns the total number of stored values in a tensor More...
 
constexpr SERAC_HOST_DEVICE int serac::size (const double &)
 overload of size() for double, we say a double "stores" 1 value More...
 
constexpr SERAC_HOST_DEVICE int serac::size (zero)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<int i, typename T , int... n>
constexpr SERAC_HOST_DEVICE int serac::dimension (const tensor< T, n... > &)
 a function for querying the ith dimension of a tensor More...
 
template<typename T , int m, int... n>
constexpr SERAC_HOST_DEVICE int serac::leading_dimension (tensor< T, m, n... >)
 a function for querying the first dimension of a tensor More...
 
template<typename T , int... n>
bool serac::isnan (const tensor< T, n... > &A)
 returns true if any entry of a tensor is nan
 
bool serac::isnan (const zero &)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 

Detailed Description

Implementation of the tensor class used by Functional.

Definition in file tensor.hpp.