|
Smith
0.1
Smith is an implicit thermal structural mechanics simulation code.
|
This file contains the declaration of a dual number class. More...
#include <iostream>#include <cmath>#include "smith/infrastructure/accelerator.hpp"#include "smith/numerics/functional/tuple_tensor_dual_functions.hpp"

Go to the source code of this file.
Classes | |
| struct | smith::dual< gradient_type > |
| Dual number struct (value plus gradient) More... | |
| struct | smith::is_dual_number< T > |
| class for checking if a type is a dual number or not More... | |
| struct | smith::is_dual_number< dual< T > > |
| class for checking if a type is a dual number or not More... | |
Namespaces | |
| smith | |
| Accelerator functionality. | |
Macros | |
| #define | binary_comparator_overload(x) |
| Generates const + non-const overloads for a binary comparison operator Comparisons are conducted against the "value" part of the dual number. More... | |
Functions | |
| template<typename T > | |
| smith::dual (double, T) -> dual< T > | |
class template argument deduction guide for type dual. More... | |
| template<typename gradient_type > | |
| constexpr SMITH_HOST_DEVICE auto | smith::operator+ (dual< gradient_type > a, double b) |
| addition of a dual number and a non-dual number | |
| template<typename gradient_type > | |
| constexpr SMITH_HOST_DEVICE auto | smith::operator+ (double a, dual< gradient_type > b) |
| addition of a dual number and a non-dual number | |
| template<typename gradient_type_a , typename gradient_type_b > | |
| constexpr SMITH_HOST_DEVICE auto | smith::operator+ (dual< gradient_type_a > a, dual< gradient_type_b > b) |
| addition of two dual numbers | |
| template<typename gradient_type > | |
| constexpr auto | smith::operator- (dual< gradient_type > x) |
| unary negation of a dual number | |
| template<typename gradient_type > | |
| constexpr SMITH_HOST_DEVICE auto | smith::operator- (dual< gradient_type > a, double b) |
| subtraction of a non-dual number from a dual number | |
| template<typename gradient_type > | |
| constexpr SMITH_HOST_DEVICE auto | smith::operator- (double a, dual< gradient_type > b) |
| subtraction of a dual number from a non-dual number | |
| template<typename gradient_type_a , typename gradient_type_b > | |
| constexpr SMITH_HOST_DEVICE auto | smith::operator- (dual< gradient_type_a > a, dual< gradient_type_b > b) |
| subtraction of two dual numbers | |
| template<typename gradient_type > | |
| constexpr SMITH_HOST_DEVICE auto | smith::operator* (const dual< gradient_type > &a, double b) |
| multiplication of a dual number and a non-dual number | |
| template<typename gradient_type > | |
| constexpr SMITH_HOST_DEVICE auto | smith::operator* (double a, const dual< gradient_type > &b) |
| multiplication of a dual number and a non-dual number | |
| template<typename gradient_type_a , typename gradient_type_b > | |
| constexpr SMITH_HOST_DEVICE auto | smith::operator* (dual< gradient_type_a > a, dual< gradient_type_b > b) |
| multiplication of two dual numbers | |
| template<typename gradient_type > | |
| constexpr SMITH_HOST_DEVICE auto | smith::operator/ (const dual< gradient_type > &a, double b) |
| division of a dual number by a non-dual number | |
| template<typename gradient_type > | |
| constexpr SMITH_HOST_DEVICE auto | smith::operator/ (double a, const dual< gradient_type > &b) |
| division of a non-dual number by a dual number | |
| template<typename gradient_type_a , typename gradient_type_b > | |
| constexpr SMITH_HOST_DEVICE auto | smith::operator/ (dual< gradient_type_a > a, dual< gradient_type_b > b) |
| division of two dual numbers | |
| smith::binary_comparator_overload (<) | |
| implement operator< for dual numbers More... | |
| smith::binary_comparator_overload (<=) | |
| implement operator<= for dual numbers | |
| smith::binary_comparator_overload (>=) | |
| implement operator>= for dual numbers | |
| template<typename gradient_type > | |
| constexpr SMITH_HOST_DEVICE auto & | smith::operator+= (dual< gradient_type > &a, const dual< gradient_type > &b) |
| compound assignment (+) for dual numbers | |
| template<typename gradient_type > | |
| constexpr SMITH_HOST_DEVICE auto & | smith::operator-= (dual< gradient_type > &a, const dual< gradient_type > &b) |
| compound assignment (-) for dual numbers | |
| template<typename gradient_type > | |
| constexpr SMITH_HOST_DEVICE auto & | smith::operator+= (dual< gradient_type > &a, double b) |
compound assignment (+) for dual numbers with double righthand side | |
| template<typename gradient_type > | |
| constexpr SMITH_HOST_DEVICE auto & | smith::operator-= (dual< gradient_type > &a, double b) |
compound assignment (-) for dual numbers with double righthand side | |
| template<typename gradient_type > | |
| SMITH_HOST_DEVICE auto | smith::abs (dual< gradient_type > x) |
| Implementation of absolute value function for dual numbers. More... | |
| template<typename gradient_type > | |
| SMITH_HOST_DEVICE auto | smith::max (dual< gradient_type > a, double b) |
| Implementation of max for dual numbers. More... | |
| template<typename gradient_type > | |
| SMITH_HOST_DEVICE auto | smith::max (double a, dual< gradient_type > 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 gradient_type > | |
| SMITH_HOST_DEVICE auto | smith::max (dual< gradient_type > a, dual< gradient_type > 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 gradient_type > | |
| SMITH_HOST_DEVICE auto | smith::min (dual< gradient_type > a, double b) |
| Implementation of min for dual numbers. More... | |
| template<typename gradient_type > | |
| SMITH_HOST_DEVICE auto | smith::min (double a, dual< gradient_type > 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 gradient_type > | |
| SMITH_HOST_DEVICE auto | smith::min (dual< gradient_type > a, dual< gradient_type > 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 S , typename T > | |
| constexpr SMITH_HOST_DEVICE auto | smith::inner (const dual< S > &A, const dual< T > &B) |
| template<typename T > | |
| constexpr SMITH_HOST_DEVICE auto | smith::inner (double A, const dual< T > &B) |
| template<typename S > | |
| constexpr SMITH_HOST_DEVICE auto | smith::inner (const dual< S > &A, double B) |
| template<typename gradient_type > | |
| SMITH_HOST_DEVICE auto | smith::sqrt (dual< gradient_type > x) |
| implementation of square root for dual numbers | |
| template<typename gradient_type > | |
| SMITH_HOST_DEVICE auto | smith::cos (dual< gradient_type > a) |
| implementation of cosine for dual numbers | |
| template<typename gradient_type > | |
| SMITH_HOST_DEVICE auto | smith::sin (dual< gradient_type > a) |
| implementation of sine for dual numbers | |
| template<typename gradient_type > | |
| SMITH_HOST_DEVICE auto | smith::atan (dual< gradient_type > a) |
| implementation of atan for dual numbers | |
| template<typename gradient_type > | |
| SMITH_HOST_DEVICE auto | smith::atan2 (dual< gradient_type > y, dual< gradient_type > x) |
| implementation of atan2 for dual numbers | |
| template<typename gradient_type > | |
| SMITH_HOST_DEVICE auto | smith::atan2 (double y, dual< gradient_type > x) |
| implementation of atan2 for dual numbers | |
| template<typename gradient_type > | |
| SMITH_HOST_DEVICE auto | smith::atan2 (dual< gradient_type > y, double x) |
| implementation of atan2 for dual numbers | |
| template<typename gradient_type > | |
| SMITH_HOST_DEVICE auto | smith::asin (dual< gradient_type > a) |
| implementation of asin for dual numbers | |
| template<typename gradient_type > | |
| SMITH_HOST_DEVICE auto | smith::acos (dual< gradient_type > a) |
| implementation of acos for dual numbers | |
| template<typename gradient_type > | |
| SMITH_HOST_DEVICE auto | smith::exp (dual< gradient_type > a) |
| implementation of exponential function for dual numbers | |
| template<typename gradient_type > | |
| SMITH_HOST_DEVICE auto | smith::log (dual< gradient_type > a) |
| implementation of the natural logarithm function for dual numbers | |
| template<typename gradient_type > | |
| SMITH_HOST_DEVICE auto | smith::log1p (dual< gradient_type > a) |
| implementation of the natural logarithm of one plus the argument function for dual numbers | |
| template<typename gradient_type > | |
| SMITH_HOST_DEVICE auto | smith::pow (dual< gradient_type > a, dual< gradient_type > b) |
implementation of a (dual) raised to the b (dual) power | |
| template<typename gradient_type > | |
| SMITH_HOST_DEVICE auto | smith::pow (double a, dual< gradient_type > b) |
implementation of a (non-dual) raised to the b (dual) power | |
| template<typename gradient_type > | |
| SMITH_HOST_DEVICE auto | smith::pow (dual< gradient_type > a, double b) |
implementation of a (dual) raised to the b (non-dual) power | |
| template<typename T , int... n> | |
| auto & | smith::operator<< (std::ostream &out, dual< T > A) |
overload of operator<< for dual to work with std::cout and other std::ostreams | |
| constexpr SMITH_HOST_DEVICE auto | smith::make_dual (double x) |
| promote a value to a dual number of the appropriate type | |
| template<typename T > | |
| constexpr SMITH_HOST_DEVICE auto | smith::get_value (const T &arg) |
| return the "value" part from a given type. For non-dual types, this is just the identity function | |
| template<typename T > | |
| constexpr SMITH_HOST_DEVICE auto | smith::get_value (dual< T > arg) |
| return the "value" part from a dual number type | |
| template<typename gradient_type > | |
| constexpr SMITH_HOST_DEVICE auto | smith::get_gradient (dual< gradient_type > arg) |
| return the "gradient" part from a dual number type | |
This file contains the declaration of a dual number class.
Definition in file dual.hpp.
| #define binary_comparator_overload | ( | x | ) |
Generates const + non-const overloads for a binary comparison operator Comparisons are conducted against the "value" part of the dual number.
| [in] | x | The comparison operator to overload |