|
Smith
0.1
Smith is an implicit thermal structural mechanics simulation code.
|
Implementation of the tensor class used by Functional. More...
#include <cmath>#include "smith/infrastructure/accelerator.hpp"#include "detail/metaprogramming.hpp"#include "smith/numerics/functional/isotropic_tensor.hpp"#include "smith/numerics/functional/tuple_tensor_dual_functions.hpp"

Go to the source code of this file.
Classes | |
| struct | smith::zero |
| A sentinel struct for eliding no-op tensor operations. More... | |
| struct | smith::is_zero< T > |
checks if a type is zero More... | |
| struct | smith::is_zero< zero > |
| struct | smith::LuFactorization< T, n > |
| Representation of an LU factorization. More... | |
Namespaces | |
| smith | |
| Accelerator functionality. | |
Typedefs | |
| using | smith::vec2 = tensor< double, 2 > |
| statically sized vector of 2 doubles | |
| using | smith::vec3 = tensor< double, 3 > |
| statically sized vector of 3 doubles | |
| using | smith::mat2 = tensor< double, 2, 2 > |
| statically sized 2x2 matrix of doubles | |
| using | smith::mat3 = tensor< double, 3, 3 > |
| statically sized 3x3 matrix of doubles | |
| template<typename T , int n1, int n2 = 1> | |
| using | smith::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 | smith::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> | |
| smith::tensor (const T(&data)[n1]) -> tensor< T, n1 > | |
class template argument deduction guide for type tensor. More... | |
| template<typename T , int n1, int n2> | |
| smith::tensor (const T(&data)[n1][n2]) -> tensor< T, n1, n2 > | |
class template argument deduction guide for type tensor. More... | |
| constexpr SMITH_HOST_DEVICE auto | smith::operator+ (zero, zero) |
the sum of two zeros is zero | |
| template<typename T > | |
| constexpr SMITH_HOST_DEVICE auto | smith::operator+ (zero, T other) |
the sum of zero with something non-zero just returns the other value | |
| template<typename T > | |
| constexpr SMITH_HOST_DEVICE auto | smith::operator+ (T other, zero) |
the sum of zero with something non-zero just returns the other value | |
| constexpr SMITH_HOST_DEVICE auto | smith::operator- (zero) |
the unary negation of zero is zero | |
| constexpr SMITH_HOST_DEVICE auto | smith::operator- (zero, zero) |
the difference of two zeros is zero | |
| template<typename T > | |
| constexpr SMITH_HOST_DEVICE auto | smith::operator- (zero, T other) |
the difference of zero with something else is the unary negation of the other thing | |
| template<typename T > | |
| constexpr SMITH_HOST_DEVICE auto | smith::operator- (T other, zero) |
the difference of something else with zero is the other thing itself | |
| constexpr SMITH_HOST_DEVICE auto | smith::operator* (zero, zero) |
the product of two zeros is zero | |
| template<typename T > | |
| constexpr SMITH_HOST_DEVICE auto | smith::operator* (zero, T) |
the product zero with something else is also zero | |
| template<typename T > | |
| constexpr SMITH_HOST_DEVICE auto | smith::operator* (T, zero) |
the product zero with something else is also zero | |
| template<typename T > | |
| constexpr SMITH_HOST_DEVICE auto | smith::operator/ (zero, T) |
zero divided by something is zero | |
| template<typename T > | |
| void | smith::operator/ (T, zero) |
| Get a human-readable compiler error when you try to divide by zero. | |
| constexpr SMITH_HOST_DEVICE auto | smith::operator+= (zero, zero) |
zero plus zero is zero | |
| constexpr SMITH_HOST_DEVICE auto | smith::operator-= (zero, zero) |
zero minus zero is zero | |
| template<int i> | |
| SMITH_HOST_DEVICE zero & | smith::get (zero &x) |
let zero be accessed like a tuple | |
| template<int i> | |
| SMITH_HOST_DEVICE zero | smith::get (const zero &) |
let zero be accessed like a tuple | |
| template<typename T > | |
| constexpr SMITH_HOST_DEVICE zero | smith::dot (const T &, zero) |
the dot product of anything with zero is zero | |
| template<typename T > | |
| constexpr SMITH_HOST_DEVICE zero | smith::dot (zero, const T &) |
the dot product of anything with zero is zero | |
| template<typename T , int m, int... n> | |
| SMITH_HOST_DEVICE consteval int | smith::first_dim (const tensor< T, m, n... > &) |
| return the size of the leftmost tensor dimension | |
| template<typename T , int... n> | |
| constexpr SMITH_HOST_DEVICE auto | smith::tensor_with_shape (std::integer_sequence< int, n... >) |
Creates a tensor given the dimensions in a std::integer_sequence. More... | |
| template<typename lambda_type > | |
| SMITH_SUPPRESS_NVCC_HOSTDEVICE_WARNING constexpr SMITH_HOST_DEVICE auto | smith::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 > | |
| SMITH_SUPPRESS_NVCC_HOSTDEVICE_WARNING constexpr SMITH_HOST_DEVICE auto | smith::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 > | |
| SMITH_SUPPRESS_NVCC_HOSTDEVICE_WARNING constexpr SMITH_HOST_DEVICE auto | smith::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 > | |
| SMITH_SUPPRESS_NVCC_HOSTDEVICE_WARNING constexpr SMITH_HOST_DEVICE auto | smith::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 > | |
| SMITH_SUPPRESS_NVCC_HOSTDEVICE_WARNING constexpr SMITH_HOST_DEVICE auto | smith::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 SMITH_HOST_DEVICE auto | smith::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 SMITH_HOST_DEVICE auto | smith::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 SMITH_HOST_DEVICE auto | smith::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 SMITH_HOST_DEVICE auto & | smith::operator+= (tensor< S, m, n... > &A, const tensor< T, m, n... > &B) |
| compound assignment (+) on tensors More... | |
| template<typename T , int n> | |
| constexpr SMITH_HOST_DEVICE auto & | smith::operator+= (tensor< T, n, 1 > &A, const tensor< T, n > &B) |
| compound assignment (+) on tensors More... | |
| template<typename T , int n> | |
| constexpr SMITH_HOST_DEVICE auto & | smith::operator+= (tensor< T, 1, n > &A, const tensor< T, n > &B) |
| compound assignment (+) on tensors More... | |
| template<typename T > | |
| constexpr SMITH_HOST_DEVICE auto & | smith::operator+= (tensor< T, 1 > &A, const T &B) |
| compound assignment (+) on tensors More... | |
| template<typename T > | |
| constexpr SMITH_HOST_DEVICE auto & | smith::operator+= (tensor< T, 1, 1 > &A, const T &B) |
| compound assignment (+) on tensors More... | |
| template<typename T , int... n> | |
| constexpr SMITH_HOST_DEVICE auto & | smith::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 SMITH_HOST_DEVICE auto & | smith::operator-= (tensor< S, m, n... > &A, const tensor< T, m, n... > &B) |
| compound assignment (-) on tensors More... | |
| template<typename T , int... n> | |
| constexpr SMITH_HOST_DEVICE auto & | smith::operator-= (tensor< T, n... > &A, zero) |
| compound assignment (-) between a tensor and zero (no-op) More... | |
| template<typename T , int n> | |
| constexpr SMITH_HOST_DEVICE auto | smith::outer (double A, tensor< T, n > B) |
| template<typename T , int m> | |
| constexpr SMITH_HOST_DEVICE auto | smith::outer (const tensor< T, m > &A, double B) |
| template<typename T , int n> | |
| constexpr SMITH_HOST_DEVICE auto | smith::outer (zero, const tensor< T, n > &) |
| template<typename T , int n> | |
| constexpr SMITH_HOST_DEVICE auto | smith::outer (const tensor< T, n > &, zero) |
| template<typename S , typename T , int m, int n> | |
| constexpr SMITH_HOST_DEVICE auto | smith::outer (const tensor< S, m > &A, const tensor< T, n > &B) |
| template<typename S , typename T , int m, int n> | |
| constexpr SMITH_HOST_DEVICE auto | smith::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 SMITH_HOST_DEVICE auto | smith::inner (const tensor< S, m > &A, const tensor< T, m > &B) |
| constexpr SMITH_HOST_DEVICE auto | smith::inner (double A, double B) |
| template<typename S , int m, int n> | |
| constexpr SMITH_HOST_DEVICE auto | smith::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 SMITH_HOST_DEVICE auto | smith::inner (const tensor< S, m > &, zero) |
| constexpr SMITH_HOST_DEVICE auto | smith::inner (double, zero) |
| template<typename T , int m, int n> | |
| constexpr SMITH_HOST_DEVICE auto | smith::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 SMITH_HOST_DEVICE auto | smith::inner (zero, const tensor< T, m > &) |
| constexpr SMITH_HOST_DEVICE auto | smith::inner (zero, double) |
| template<typename S , typename T , int m, int n, int p> | |
| constexpr SMITH_HOST_DEVICE auto | smith::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 SMITH_HOST_DEVICE auto | smith::dot (const tensor< T, m > &A, double B) |
| template<typename T , int m> | |
| constexpr SMITH_HOST_DEVICE auto | smith::dot (double B, const tensor< T, m > &A) |
| template<typename S , typename T , int m> | |
| constexpr SMITH_HOST_DEVICE auto | smith::dot (const tensor< S, m > &A, const tensor< T, m > &B) |
| template<typename S , typename T , int m, int n> | |
| constexpr SMITH_HOST_DEVICE auto | smith::dot (const tensor< S, m > &A, const tensor< T, m, n > &B) |
| template<typename S , typename T , int m, int n, int p> | |
| constexpr SMITH_HOST_DEVICE auto | smith::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 SMITH_HOST_DEVICE auto | smith::dot (const tensor< S, m > &A, const tensor< T, m, n, p, q > &B) |
| template<typename S , typename T , int m, int n> | |
| constexpr SMITH_HOST_DEVICE auto | smith::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 SMITH_HOST_DEVICE auto | smith::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 SMITH_HOST_DEVICE auto | smith::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 SMITH_HOST_DEVICE auto | smith::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 SMITH_HOST_DEVICE auto | smith::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 SMITH_HOST_DEVICE auto | smith::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 > | |
| SMITH_HOST_DEVICE auto | smith::cross (const tensor< T, 3, 2 > &A) |
| compute the cross product of the columns of A: A(:,1) x A(:,2) | |
| template<typename T > | |
| SMITH_HOST_DEVICE auto | smith::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 > | |
| SMITH_HOST_DEVICE auto | smith::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 > | |
| SMITH_HOST_DEVICE auto | smith::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 SMITH_HOST_DEVICE auto | smith::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 SMITH_HOST_DEVICE auto | smith::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 | smith::double_dot (const tensor< S, m, n > &A, const tensor< T, m, n > &B) |
| template<typename S , typename T , int... m, int... n> | |
| constexpr SMITH_HOST_DEVICE auto | smith::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 SMITH_HOST_DEVICE auto | smith::squared_norm (const tensor< T, m > &A) |
| Returns the squared Frobenius norm of the tensor. More... | |
| template<typename T , int m, int n> | |
| constexpr SMITH_HOST_DEVICE auto | smith::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 SMITH_HOST_DEVICE auto | smith::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> | |
| SMITH_HOST_DEVICE auto | smith::norm (const tensor< T, n... > &A) |
| Returns the Frobenius norm of the tensor. More... | |
| constexpr SMITH_HOST_DEVICE auto | smith::norm (zero) |
| overload of Frobenius norm for zero type | |
| template<typename T , int... n> | |
| SMITH_HOST_DEVICE auto | smith::normalize (const tensor< T, n... > &A) |
| Normalizes the tensor Each element is divided by the Frobenius norm of the tensor,. More... | |
| template<typename T > | |
| SMITH_HOST_DEVICE tensor< T, 3, 3 > | smith::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 SMITH_HOST_DEVICE auto | smith::tr (const tensor< T, n, n > &A) |
| Returns the trace of a square matrix. More... | |
| template<typename T , int n> | |
| constexpr SMITH_HOST_DEVICE auto | smith::sym (const tensor< T, n, n > &A) |
| Returns the symmetric part of a square matrix. More... | |
| template<typename T , int n> | |
| constexpr SMITH_HOST_DEVICE auto | smith::antisym (const tensor< T, n, n > &A) |
| Returns the antisymmetric part of a square matrix. More... | |
| template<typename T , int n> | |
| constexpr SMITH_HOST_DEVICE auto | smith::dev (const tensor< T, n, n > &A) |
| Calculates the deviator of a matrix (rank-2 tensor) More... | |
| template<typename T , int n> | |
| constexpr SMITH_HOST_DEVICE auto | smith::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 SMITH_HOST_DEVICE tensor< T, n, n > | smith::diag (const tensor< T, n > &d) |
| Returns a square diagonal matrix by specifying the diagonal entries. More... | |
| template<typename T , int n> | |
| constexpr SMITH_HOST_DEVICE tensor< T, n > | smith::diag (const tensor< T, n, n > &D) |
| Returns an array containing the diagonal entries of a square matrix. More... | |
| template<int dim> | |
| constexpr SMITH_HOST_DEVICE tensor< double, dim, dim > | smith::DenseIdentity () |
| Obtains the identity matrix of the specified dimension. More... | |
| template<typename T , int m, int n> | |
| constexpr SMITH_HOST_DEVICE auto | smith::transpose (const tensor< T, m, n > &A) |
| Returns the transpose of the matrix. More... | |
| template<typename T > | |
| constexpr SMITH_HOST_DEVICE auto | smith::I2 (const tensor< T, 3, 3 > &A) |
| Returns the second invariant of a 3x3 matrix. More... | |
| template<typename T > | |
| constexpr SMITH_HOST_DEVICE auto | smith::det (const tensor< T, 2, 2 > &A) |
| Returns the determinant of a matrix. More... | |
| template<typename T > | |
| constexpr SMITH_HOST_DEVICE auto | smith::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 SMITH_HOST_DEVICE auto | smith::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 SMITH_HOST_DEVICE auto | smith::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 | smith::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> | |
| SMITH_HOST_DEVICE auto | smith::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 > | |
| SMITH_HOST_DEVICE auto | smith::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 | smith::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> | |
| SMITH_HOST_DEVICE bool | smith::is_symmetric (tensor< double, n, n > A, double tolerance=1.0e-8) |
| Return whether a square rank 2 tensor is symmetric. More... | |
| SMITH_HOST_DEVICE bool | smith::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... | |
| SMITH_HOST_DEVICE bool | smith::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 SMITH_HOST_DEVICE auto | smith::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 SMITH_HOST_DEVICE auto | smith::solve_lower_triangular (const tensor< T, n, n > &L, const tensor< T, n, m... > &b) |
| template<typename T , int n, int... m> | |
| constexpr SMITH_HOST_DEVICE auto | smith::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 SMITH_HOST_DEVICE auto | smith::linear_solve (const LuFactorization< S, n > &lu_factors, const tensor< T, n, m... > &b) |
| template<typename T , int n> | |
| constexpr SMITH_HOST_DEVICE auto | smith::linear_solve (const LuFactorization< T, n > &, const zero) |
| constexpr SMITH_HOST_DEVICE tensor< double, 2, 2 > | smith::inv (const tensor< double, 2, 2 > &A) |
| Inverts a matrix. More... | |
| constexpr SMITH_HOST_DEVICE tensor< double, 3, 3 > | smith::inv (const tensor< double, 3, 3 > &A) |
| template<typename T , int n> | |
| constexpr SMITH_HOST_DEVICE auto | smith::inv (const tensor< T, n, n > &A) |
| template<typename T , int m, int... n> | |
| auto & | smith::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 & | smith::operator<< (std::ostream &out, zero) |
| Write a zero out to an output stream. More... | |
| SMITH_HOST_DEVICE void | smith::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> | |
| SMITH_HOST_DEVICE void | smith::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 SMITH_HOST_DEVICE auto | smith::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 SMITH_HOST_DEVICE auto | smith::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. | |
| SMITH_HOST_DEVICE auto | smith::get_gradient (double) |
| Retrieves the gradient component of a double (which is nothing) More... | |
| template<int... n> | |
| constexpr SMITH_HOST_DEVICE auto | smith::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 SMITH_HOST_DEVICE auto | smith::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 SMITH_HOST_DEVICE auto | smith::chain_rule (const zero, const T) |
| template<typename T > | |
| constexpr SMITH_HOST_DEVICE auto | smith::chain_rule (const T, const zero) |
| constexpr SMITH_HOST_DEVICE auto | smith::chain_rule (const double df_dx, const double dx) |
| template<int... n> | |
| constexpr SMITH_HOST_DEVICE auto | smith::chain_rule (const tensor< double, n... > &df_dx, const double dx) |
| template<int... n> | |
| constexpr SMITH_HOST_DEVICE auto | smith::chain_rule (const tensor< double, n... > &df_dx, const tensor< double, n... > &dx) |
| template<int m, int... n> | |
| constexpr SMITH_HOST_DEVICE auto | smith::chain_rule (const tensor< double, m, n... > &df_dx, const tensor< double, n... > &dx) |
| template<int m, int n, int... p> | |
| SMITH_HOST_DEVICE auto | smith::chain_rule (const tensor< double, m, n, p... > &df_dx, const tensor< double, p... > &dx) |
| template<typename T , int... n> | |
| constexpr SMITH_HOST_DEVICE int | smith::size (const tensor< T, n... > &) |
| returns the total number of stored values in a tensor More... | |
| constexpr SMITH_HOST_DEVICE int | smith::size (const double &) |
overload of size() for double, we say a double "stores" 1 value More... | |
| constexpr SMITH_HOST_DEVICE int | smith::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 SMITH_HOST_DEVICE int | smith::dimension (const tensor< T, n... > &) |
| a function for querying the ith dimension of a tensor More... | |
| template<typename T , int m, int... n> | |
| constexpr SMITH_HOST_DEVICE int | smith::leading_dimension (tensor< T, m, n... >) |
| a function for querying the first dimension of a tensor More... | |
| template<typename T , int... n> | |
| bool | smith::isnan (const tensor< T, n... > &A) |
returns true if any entry of a tensor is nan | |
| bool | smith::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. | |
Implementation of the tensor class used by Functional.
Definition in file tensor.hpp.