Automatic Differentiation
 
Loading...
Searching...
No Matches
stan::math::adjoint_results_cl< T_results > Class Template Reference

Detailed Description

template<typename... T_results>
class stan::math::adjoint_results_cl< T_results >

Represents results that are adjoints of vars in kernel generrator expressions.

Definition at line 19 of file adjoint_results.hpp.

#include <adjoint_results.hpp>

+ Inheritance diagram for stan::math::adjoint_results_cl< T_results >:

Public Member Functions

 adjoint_results_cl (T_results &&... results)
 Constructor.
 
template<typename... T_expressions, typename = std::enable_if_t<sizeof...(T_results) == sizeof...(T_expressions)>>
void operator+= (const expressions_cl< T_expressions... > &exprs)
 Incrementing adjoint_results_cl object by expressions_cl object executes one or two kernels that evaluate expressions and increments results' adjoints by those expressions.
 

Protected Member Functions

void compound_assignment_impl (const expressions_cl< T_expressions... > &exprs)
 Incrementing results_ object by expressions_cl object executes the kernel that evaluates expressions and increments results by those expressions.
 
void operator-= (const expressions_cl< T_expressions... > &exprs)
 Decrement results_ object by expressions_cl object executes the kernel that evaluates expressions and increments results by those expressions.
 
void operator/= (const expressions_cl< T_expressions... > &exprs)
 Elementwise divide results_ object by expressions_cl object executes the kernel that evaluates expressions and increments results by those expressions.
 
void operator*= (const expressions_cl< T_expressions... > &exprs)
 Elementwise multiply results_ object by expressions_cl object executes the kernel that evaluates expressions and increments results by those expressions.
 
std::string get_kernel_source_for_evaluating (const expressions_cl< T_expressions... > &exprs)
 Generates kernel source for evaluating given expressions into results held by this.
 

Static Protected Member Functions

static std::string get_kernel_source_impl (const std::tuple< std::pair< T_res, T_expressions >... > &assignment_pairs)
 Implementation of kernel source generation.
 
static void assignment_impl (const std::tuple< std::pair< T_res, T_expressions >... > &assignment_pairs)
 Implementation of assignments of expressions to results.
 
static void assignment_impl (const std::tuple<> &)
 Implementation of assignments of no expressions to no results.
 
static auto make_assignment_pair (T_result &&result, T_expression &&expression)
 Makes a std::pair of one result and one expression and wraps it into a tuple.
 
static auto make_assignment_pair (T_result &&result, T_expression &&expression)
 If an expression does not need to be calculated this returns an empty tuple.
 
static std::tuple make_assignment_pair (T_check &&result, T_pass &&pass)
 Checks on scalars are done separately in this overload instead of in kernel.
 

Protected Attributes

std::tuple< T_results... > results_
 

Private Member Functions

template<typename T_expression >
auto select_scalar_assignments (const var &result, T_expression &&expression)
 Selects assignments that have scalar var results.
 
template<typename T_result , typename T_expression , require_all_not_same_t< T_result, var > * = nullptr>
auto select_scalar_assignments (T_result &&result, T_expression &&expression)
 Selects assignments that have scalar var results.
 
template<assign_op_cl AssignOp, typename T_result , typename T_expression , require_not_stan_scalar_t< T_result > * = nullptr, require_st_var< T_result > * = nullptr>
auto select_nonscalar_assignments (T_result &&result, T_expression &&expression)
 Selects assignments that have non-scalar var results.
 
template<assign_op_cl AssignOp, typename T_result , typename T_expression , std::enable_if_t< is_stan_scalar< T_result >::value||!is_var< scalar_type_t< T_result > >::value > * = nullptr>
auto select_nonscalar_assignments (T_result &&result, T_expression &&expression)
 Selects assignments that have non-scalar var results.
 

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