autoppl  v0.8
A C++ template library for probabilistic programming
ppl::expr::var::UnaryNode< UnaryOp, VarExprType > Struct Template Reference

#include <unary.hpp>

Inheritance diagram for ppl::expr::var::UnaryNode< UnaryOp, VarExprType >:
ppl::util::VarExprBase< UnaryNode< UnaryOp, VarExprType > > ppl::util::BaseCRTP< UnaryNode< UnaryOp, VarExprType > >

Public Types

using value_t = typename util::var_expr_traits< expr_t >::value_t
 
using shape_t = typename util::shape_traits< expr_t >::shape_t
 

Public Member Functions

 UnaryNode (const expr_t &expr)
 
template<class Func >
void traverse (Func &&) const
 
auto get () const
 
auto eval ()
 
constexpr size_t size () const
 
constexpr size_t rows () const
 
constexpr size_t cols () const
 
template<class PtrPackType >
auto ad (const PtrPackType &pack) const
 
template<class PtrPackType >
void bind (const PtrPackType &pack)
 
void activate_refcnt () const
 
- Public Member Functions inherited from ppl::util::BaseCRTP< UnaryNode< UnaryOp, VarExprType > >
UnaryNode< UnaryOp, VarExprType > & self ()
 
const UnaryNode< UnaryOp, VarExprType > & self () const
 

Static Public Attributes

static constexpr bool has_param = expr_t::has_param
 

Detailed Description

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

UnaryNode is a generic object representing some unary operation on a variable expression. For example, log, exp, sin, cos, tan are common unary operations.

Template Parameters
UnaryOpunary operation policy containing a static member function "fmap(T x)" that evaluates the corresponding unary operation on the underlying expression.
VarExprTypevariable expression type

Member Typedef Documentation

◆ shape_t

template<class UnaryOp , class VarExprType >
using ppl::expr::var::UnaryNode< UnaryOp, VarExprType >::shape_t = typename util::shape_traits<expr_t>::shape_t

◆ value_t

template<class UnaryOp , class VarExprType >
using ppl::expr::var::UnaryNode< UnaryOp, VarExprType >::value_t = typename util::var_expr_traits<expr_t>::value_t

Constructor & Destructor Documentation

◆ UnaryNode()

template<class UnaryOp , class VarExprType >
ppl::expr::var::UnaryNode< UnaryOp, VarExprType >::UnaryNode ( const expr_t &  expr)
inline

Member Function Documentation

◆ activate_refcnt()

template<class UnaryOp , class VarExprType >
void ppl::expr::var::UnaryNode< UnaryOp, VarExprType >::activate_refcnt ( ) const
inline

◆ ad()

template<class UnaryOp , class VarExprType >
template<class PtrPackType >
auto ppl::expr::var::UnaryNode< UnaryOp, VarExprType >::ad ( const PtrPackType &  pack) const
inline

◆ bind()

template<class UnaryOp , class VarExprType >
template<class PtrPackType >
void ppl::expr::var::UnaryNode< UnaryOp, VarExprType >::bind ( const PtrPackType &  pack)
inline

◆ cols()

template<class UnaryOp , class VarExprType >
constexpr size_t ppl::expr::var::UnaryNode< UnaryOp, VarExprType >::cols ( ) const
inlineconstexpr

◆ eval()

template<class UnaryOp , class VarExprType >
auto ppl::expr::var::UnaryNode< UnaryOp, VarExprType >::eval ( )
inline

◆ get()

template<class UnaryOp , class VarExprType >
auto ppl::expr::var::UnaryNode< UnaryOp, VarExprType >::get ( ) const
inline

◆ rows()

template<class UnaryOp , class VarExprType >
constexpr size_t ppl::expr::var::UnaryNode< UnaryOp, VarExprType >::rows ( ) const
inlineconstexpr

◆ size()

template<class UnaryOp , class VarExprType >
constexpr size_t ppl::expr::var::UnaryNode< UnaryOp, VarExprType >::size ( ) const
inlineconstexpr

◆ traverse()

template<class UnaryOp , class VarExprType >
template<class Func >
void ppl::expr::var::UnaryNode< UnaryOp, VarExprType >::traverse ( Func &&  ) const
inline

Member Data Documentation

◆ has_param

template<class UnaryOp , class VarExprType >
constexpr bool ppl::expr::var::UnaryNode< UnaryOp, VarExprType >::has_param = expr_t::has_param
staticconstexpr

The documentation for this struct was generated from the following file: