![]() |
Documentation 6b54b78464
|
Expression templates for vector types with coefficient-wise operations. More...
#include "../basic_types/datatype_structure.hpp"#include "../code_config.hpp"#include <type_traits>#include <algorithm>#include <cassert>#include <cstdlib>#include <cmath>#include <cstdint>Go to the source code of this file.
Namespaces | |
| namespace | VecExpr |
Macros | |
| #define | RETURNS(...) ->decltype(__VA_ARGS__) { return __VA_ARGS__; } |
| #define | MAKE_UNARY_FUN(FUN, EXPR, IMPL) |
| #define | sign_impl(x) Scalar(1 - 2 * (x < 0)) |
| #define | MAKE_BINARY_FUN(FUN, EXPR, IMPL) |
| #define | MAKE_FMINMAX_OVERLOADS(TYPE) |
| #define | add_impl(a, b) a + b |
| #define | sub_impl(a, b) a - b |
| #define | mul_impl(a, b) a* b |
| #define | div_impl(a, b) a / b |
| #define | TO_PASSIVE(IMPL) SU2_TYPE::Passive<Scalar>::Value(IMPL) |
| #define | le_impl(a, b) TO_PASSIVE(a <= b) |
| #define | ge_impl(a, b) TO_PASSIVE(a >= b) |
| #define | eq_impl(a, b) TO_PASSIVE(a == b) |
| #define | ne_impl(a, b) TO_PASSIVE(a != b) |
| #define | lt_impl(a, b) TO_PASSIVE(a < b) |
| #define | gt_impl(a, b) TO_PASSIVE(a > b) |
Typedefs | |
| template<class T > | |
| using | VecExpr::decay_t = typename std::decay< T >::type |
| std::decay_t from C++14, used to allow implicit conversions between scalar types, e.g. "CVecExpr<U,double>" + "int/double/etc.". | |
| template<class T > | |
| using | VecExpr::remove_reference_t = typename std::remove_reference< T >::type |
| std::remove_reference_t from C++14, removes references from some type. | |
| template<class T > | |
| using | VecExpr::store_t = typename store_type< T >::type |
Functions | |
| template<class U , class S > | |
| auto | VecExpr::operator- (const CVecExpr< U, S > &u) -> decltype(minus_< U, S >(u.derived())) |
| template<class U , class S > | |
| auto | VecExpr::abs (const CVecExpr< U, S > &u) -> decltype(abs_< U, S >(u.derived())) |
| template<class U , class S > | |
| auto | VecExpr::exp (const CVecExpr< U, S > &u) -> decltype(exp_< U, S >(u.derived())) |
| template<class U , class S > | |
| auto | VecExpr::sqrt (const CVecExpr< U, S > &u) -> decltype(sqrt_< U, S >(u.derived())) |
| template<class U , class S > | |
| auto | VecExpr::sign (const CVecExpr< U, S > &u) -> decltype(sign_< U, S >(u.derived())) |
| int32_t | VecExpr::fmax (int32_t a, int32_t b) |
| int32_t | VecExpr::fmin (int32_t a, int32_t b) |
| int64_t | VecExpr::fmax (int64_t a, int64_t b) |
| int64_t | VecExpr::fmin (int64_t a, int64_t b) |
| uint32_t | VecExpr::fmax (uint32_t a, uint32_t b) |
| uint32_t | VecExpr::fmin (uint32_t a, uint32_t b) |
| uint64_t | VecExpr::fmax (uint64_t a, uint64_t b) |
| uint64_t | VecExpr::fmin (uint64_t a, uint64_t b) |
| template<class U , class V , class S > | |
| auto | VecExpr::fmax (const CVecExpr< U, S > &u, const CVecExpr< V, S > &v) -> decltype(max_< U, V, S >(u.derived(), v.derived())) |
| template<class U , class S > | |
| auto | VecExpr::fmax (const CVecExpr< U, S > &u, decay_t< S > v) -> decltype(max_< U, Bcast< S >, S >(u.derived(), Bcast< S >(v))) |
| template<class S , class V > | |
| auto | VecExpr::fmax (decay_t< S > u, const CVecExpr< V, S > &v) -> decltype(max_< Bcast< S >, V, S >(Bcast< S >(u), v.derived())) |
| template<class U , class V , class S > | |
| auto | VecExpr::fmin (const CVecExpr< U, S > &u, const CVecExpr< V, S > &v) -> decltype(min_< U, V, S >(u.derived(), v.derived())) |
| template<class U , class S > | |
| auto | VecExpr::fmin (const CVecExpr< U, S > &u, decay_t< S > v) -> decltype(min_< U, Bcast< S >, S >(u.derived(), Bcast< S >(v))) |
| template<class S , class V > | |
| auto | VecExpr::fmin (decay_t< S > u, const CVecExpr< V, S > &v) -> decltype(min_< Bcast< S >, V, S >(Bcast< S >(u), v.derived())) |
| template<class U , class V , class S > | |
| auto | VecExpr::pow (const CVecExpr< U, S > &u, const CVecExpr< V, S > &v) -> decltype(pow_< U, V, S >(u.derived(), v.derived())) |
| template<class U , class S > | |
| auto | VecExpr::pow (const CVecExpr< U, S > &u, decay_t< S > v) -> decltype(pow_< U, Bcast< S >, S >(u.derived(), Bcast< S >(v))) |
| template<class S , class V > | |
| auto | VecExpr::pow (decay_t< S > u, const CVecExpr< V, S > &v) -> decltype(pow_< Bcast< S >, V, S >(Bcast< S >(u), v.derived())) |
| template<class U , class V , class S > | |
| auto | VecExpr::operator+ (const CVecExpr< U, S > &u, const CVecExpr< V, S > &v) -> decltype(add_< U, V, S >(u.derived(), v.derived())) |
| template<class U , class S > | |
| auto | VecExpr::operator+ (const CVecExpr< U, S > &u, decay_t< S > v) -> decltype(add_< U, Bcast< S >, S >(u.derived(), Bcast< S >(v))) |
| template<class S , class V > | |
| auto | VecExpr::operator+ (decay_t< S > u, const CVecExpr< V, S > &v) -> decltype(add_< Bcast< S >, V, S >(Bcast< S >(u), v.derived())) |
| template<class U , class V , class S > | |
| auto | VecExpr::operator- (const CVecExpr< U, S > &u, const CVecExpr< V, S > &v) -> decltype(sub_< U, V, S >(u.derived(), v.derived())) |
| template<class U , class S > | |
| auto | VecExpr::operator- (const CVecExpr< U, S > &u, decay_t< S > v) -> decltype(sub_< U, Bcast< S >, S >(u.derived(), Bcast< S >(v))) |
| template<class S , class V > | |
| auto | VecExpr::operator- (decay_t< S > u, const CVecExpr< V, S > &v) -> decltype(sub_< Bcast< S >, V, S >(Bcast< S >(u), v.derived())) |
| template<class U , class V , class S > | |
| auto | VecExpr::operator* (const CVecExpr< U, S > &u, const CVecExpr< V, S > &v) -> decltype(mul_< U, V, S >(u.derived(), v.derived())) |
| template<class U , class S > | |
| auto | VecExpr::operator* (const CVecExpr< U, S > &u, decay_t< S > v) -> decltype(mul_< U, Bcast< S >, S >(u.derived(), Bcast< S >(v))) |
| template<class S , class V > | |
| auto | VecExpr::operator* (decay_t< S > u, const CVecExpr< V, S > &v) -> decltype(mul_< Bcast< S >, V, S >(Bcast< S >(u), v.derived())) |
| template<class U , class V , class S > | |
| auto | VecExpr::operator/ (const CVecExpr< U, S > &u, const CVecExpr< V, S > &v) -> decltype(div_< U, V, S >(u.derived(), v.derived())) |
| template<class U , class S > | |
| auto | VecExpr::operator/ (const CVecExpr< U, S > &u, decay_t< S > v) -> decltype(div_< U, Bcast< S >, S >(u.derived(), Bcast< S >(v))) |
| template<class S , class V > | |
| auto | VecExpr::operator/ (decay_t< S > u, const CVecExpr< V, S > &v) -> decltype(div_< Bcast< S >, V, S >(Bcast< S >(u), v.derived())) |
| template<class U , class V , class S > | |
| auto | VecExpr::operator<= (const CVecExpr< U, S > &u, const CVecExpr< V, S > &v) -> decltype(le_< U, V, S >(u.derived(), v.derived())) |
| template<class U , class S > | |
| auto | VecExpr::operator<= (const CVecExpr< U, S > &u, decay_t< S > v) -> decltype(le_< U, Bcast< S >, S >(u.derived(), Bcast< S >(v))) |
| template<class S , class V > | |
| auto | VecExpr::operator<= (decay_t< S > u, const CVecExpr< V, S > &v) -> decltype(le_< Bcast< S >, V, S >(Bcast< S >(u), v.derived())) |
| template<class U , class V , class S > | |
| auto | VecExpr::operator>= (const CVecExpr< U, S > &u, const CVecExpr< V, S > &v) -> decltype(ge_< U, V, S >(u.derived(), v.derived())) |
| template<class U , class S > | |
| auto | VecExpr::operator>= (const CVecExpr< U, S > &u, decay_t< S > v) -> decltype(ge_< U, Bcast< S >, S >(u.derived(), Bcast< S >(v))) |
| template<class S , class V > | |
| auto | VecExpr::operator>= (decay_t< S > u, const CVecExpr< V, S > &v) -> decltype(ge_< Bcast< S >, V, S >(Bcast< S >(u), v.derived())) |
| template<class U , class V , class S > | |
| auto | VecExpr::operator== (const CVecExpr< U, S > &u, const CVecExpr< V, S > &v) -> decltype(eq_< U, V, S >(u.derived(), v.derived())) |
| template<class U , class S > | |
| auto | VecExpr::operator== (const CVecExpr< U, S > &u, decay_t< S > v) -> decltype(eq_< U, Bcast< S >, S >(u.derived(), Bcast< S >(v))) |
| template<class S , class V > | |
| auto | VecExpr::operator== (decay_t< S > u, const CVecExpr< V, S > &v) -> decltype(eq_< Bcast< S >, V, S >(Bcast< S >(u), v.derived())) |
| template<class U , class V , class S > | |
| auto | VecExpr::operator!= (const CVecExpr< U, S > &u, const CVecExpr< V, S > &v) -> decltype(ne_< U, V, S >(u.derived(), v.derived())) |
| template<class U , class S > | |
| auto | VecExpr::operator!= (const CVecExpr< U, S > &u, decay_t< S > v) -> decltype(ne_< U, Bcast< S >, S >(u.derived(), Bcast< S >(v))) |
| template<class S , class V > | |
| auto | VecExpr::operator!= (decay_t< S > u, const CVecExpr< V, S > &v) -> decltype(ne_< Bcast< S >, V, S >(Bcast< S >(u), v.derived())) |
| template<class U , class V , class S > | |
| auto | VecExpr::operator< (const CVecExpr< U, S > &u, const CVecExpr< V, S > &v) -> decltype(lt_< U, V, S >(u.derived(), v.derived())) |
| template<class U , class S > | |
| auto | VecExpr::operator< (const CVecExpr< U, S > &u, decay_t< S > v) -> decltype(lt_< U, Bcast< S >, S >(u.derived(), Bcast< S >(v))) |
| template<class S , class V > | |
| auto | VecExpr::operator< (decay_t< S > u, const CVecExpr< V, S > &v) -> decltype(lt_< Bcast< S >, V, S >(Bcast< S >(u), v.derived())) |
| template<class U , class V , class S > | |
| auto | VecExpr::operator> (const CVecExpr< U, S > &u, const CVecExpr< V, S > &v) -> decltype(gt_< U, V, S >(u.derived(), v.derived())) |
| template<class U , class S > | |
| auto | VecExpr::operator> (const CVecExpr< U, S > &u, decay_t< S > v) -> decltype(gt_< U, Bcast< S >, S >(u.derived(), Bcast< S >(v))) |
| template<class S , class V > | |
| auto | VecExpr::operator> (decay_t< S > u, const CVecExpr< V, S > &v) -> decltype(gt_< Bcast< S >, V, S >(Bcast< S >(u), v.derived())) |
Expression templates for vector types with coefficient-wise operations.
SU2 Project Website: https://su2code.github.io
The SU2 Project is maintained by the SU2 Foundation (http://su2foundation.org)
Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md)
SU2 is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
SU2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with SU2. If not, see http://www.gnu.org/licenses/.