autoppl  v0.8
A C++ template library for probabilistic programming
ppl::expr::var::BinaryNode< BinaryOp, LHSVarExprType, RHSVarExprType > Struct Template Reference

#include <binary.hpp>

Inheritance diagram for ppl::expr::var::BinaryNode< BinaryOp, LHSVarExprType, RHSVarExprType >:
ppl::util::VarExprBase< BinaryNode< BinaryOp, LHSVarExprType, RHSVarExprType > > ppl::util::BaseCRTP< BinaryNode< BinaryOp, LHSVarExprType, RHSVarExprType > >

Public Types

using value_t = std::common_type_t< typename util::var_expr_traits< lhs_t >::value_t, typename util::var_expr_traits< rhs_t >::value_t >
 
using shape_t = ad::util::max_shape_t< typename util::shape_traits< lhs_t >::shape_t, typename util::shape_traits< rhs_t >::shape_t >
 

Public Member Functions

 BinaryNode (const lhs_t &lhs, const rhs_t &rhs)
 
template<class Func >
void traverse (Func &&) const
 
auto get () const
 
auto eval ()
 
size_t size () const
 
size_t rows () const
 
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< BinaryNode< BinaryOp, LHSVarExprType, RHSVarExprType > >
BinaryNode< BinaryOp, LHSVarExprType, RHSVarExprType > & self ()
 
const BinaryNode< BinaryOp, LHSVarExprType, RHSVarExprType > & self () const
 

Static Public Attributes

static constexpr bool has_param
 

Detailed Description

template<class BinaryOp, class LHSVarExprType, class RHSVarExprType>
struct ppl::expr::var::BinaryNode< BinaryOp, LHSVarExprType, RHSVarExprType >

BinaryNode is a generic object representing some binary operation between two variable expressions. For example, +,-,*,/ are four common binary operations.

If both variable expressions are of fixed size, then it may choose to perform some optimization, in which case, the size, i.e. number of elements, has to be equal.

Template Parameters
BinaryOpbinary operation policy containing a static member function "fmap(T x, U y)" that evaluates the corresponding binary operation on the parameters.
LHSVarExprTypelhs variable expression type
RHSVarExprTyperhs variable expression type

Member Typedef Documentation

◆ shape_t

template<class BinaryOp , class LHSVarExprType , class RHSVarExprType >
using ppl::expr::var::BinaryNode< BinaryOp, LHSVarExprType, RHSVarExprType >::shape_t = ad::util::max_shape_t< typename util::shape_traits<lhs_t>::shape_t, typename util::shape_traits<rhs_t>::shape_t >

◆ value_t

template<class BinaryOp , class LHSVarExprType , class RHSVarExprType >
using ppl::expr::var::BinaryNode< BinaryOp, LHSVarExprType, RHSVarExprType >::value_t = std::common_type_t< typename util::var_expr_traits<lhs_t>::value_t, typename util::var_expr_traits<rhs_t>::value_t >

Constructor & Destructor Documentation

◆ BinaryNode()

template<class BinaryOp , class LHSVarExprType , class RHSVarExprType >
ppl::expr::var::BinaryNode< BinaryOp, LHSVarExprType, RHSVarExprType >::BinaryNode ( const lhs_t &  lhs,
const rhs_t &  rhs 
)
inline

Member Function Documentation

◆ activate_refcnt()

template<class BinaryOp , class LHSVarExprType , class RHSVarExprType >
void ppl::expr::var::BinaryNode< BinaryOp, LHSVarExprType, RHSVarExprType >::activate_refcnt ( ) const
inline

◆ ad()

template<class BinaryOp , class LHSVarExprType , class RHSVarExprType >
template<class PtrPackType >
auto ppl::expr::var::BinaryNode< BinaryOp, LHSVarExprType, RHSVarExprType >::ad ( const PtrPackType &  pack) const
inline

◆ bind()

template<class BinaryOp , class LHSVarExprType , class RHSVarExprType >
template<class PtrPackType >
void ppl::expr::var::BinaryNode< BinaryOp, LHSVarExprType, RHSVarExprType >::bind ( const PtrPackType &  pack)
inline

◆ cols()

template<class BinaryOp , class LHSVarExprType , class RHSVarExprType >
size_t ppl::expr::var::BinaryNode< BinaryOp, LHSVarExprType, RHSVarExprType >::cols ( ) const
inline

◆ eval()

template<class BinaryOp , class LHSVarExprType , class RHSVarExprType >
auto ppl::expr::var::BinaryNode< BinaryOp, LHSVarExprType, RHSVarExprType >::eval ( )
inline

◆ get()

template<class BinaryOp , class LHSVarExprType , class RHSVarExprType >
auto ppl::expr::var::BinaryNode< BinaryOp, LHSVarExprType, RHSVarExprType >::get ( ) const
inline

◆ rows()

template<class BinaryOp , class LHSVarExprType , class RHSVarExprType >
size_t ppl::expr::var::BinaryNode< BinaryOp, LHSVarExprType, RHSVarExprType >::rows ( ) const
inline

◆ size()

template<class BinaryOp , class LHSVarExprType , class RHSVarExprType >
size_t ppl::expr::var::BinaryNode< BinaryOp, LHSVarExprType, RHSVarExprType >::size ( ) const
inline

◆ traverse()

template<class BinaryOp , class LHSVarExprType , class RHSVarExprType >
template<class Func >
void ppl::expr::var::BinaryNode< BinaryOp, LHSVarExprType, RHSVarExprType >::traverse ( Func &&  ) const
inline

Member Data Documentation

◆ has_param

template<class BinaryOp , class LHSVarExprType , class RHSVarExprType >
constexpr bool ppl::expr::var::BinaryNode< BinaryOp, LHSVarExprType, RHSVarExprType >::has_param
staticconstexpr
Initial value:
=
lhs_t::has_param || rhs_t::has_param

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