autoppl  v0.8
A C++ template library for probabilistic programming
unary.hpp File Reference
#include <fastad_bits/reverse/core/unary.hpp>
#include <autoppl/util/traits/traits.hpp>

Go to the source code of this file.

Classes

struct  ppl::expr::var::UnaryNode< UnaryOp, VarExprType >
 

Namespaces

 ppl
 
 ppl::expr
 
 ppl::expr::var
 

Macros

#define PPL_UNARY_FUNC(name, strct)
 

Macro Definition Documentation

◆ PPL_UNARY_FUNC

#define PPL_UNARY_FUNC (   name,
  strct 
)
Value:
template <class ExprType \
, class = std::enable_if_t< \
util::is_valid_op_param_v<ExprType> && \
!std::is_arithmetic_v<ExprType> \
> > \
constexpr inline auto name(const ExprType& expr) \
{ \
using expr_t = util::convert_to_param_t<ExprType>; \
expr_t wrap_expr = expr; \
using unary_t = expr::var::UnaryNode<ad::core::strct, expr_t>; \
return unary_t(wrap_expr); \
}