Stan Math Library  2.20.0
reverse mode automatic differentiation
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
stan::math::internal::dot_product_vari< T1, T2 > Class Template Reference

#include <dot_product.hpp>

Inheritance diagram for stan::math::internal::dot_product_vari< T1, T2 >:
stan::math::vari

Public Member Functions

 dot_product_vari (typename dot_product_store_type< T1 >::type v1, typename dot_product_store_type< T2 >::type v2, size_t length)
 
 dot_product_vari (const T1 *v1, const T2 *v2, size_t length, dot_product_vari< T1, T2 > *shared_v1=NULL, dot_product_vari< T1, T2 > *shared_v2=NULL)
 
template<typename Derived1 , typename Derived2 >
 dot_product_vari (const Eigen::DenseBase< Derived1 > &v1, const Eigen::DenseBase< Derived2 > &v2, dot_product_vari< T1, T2 > *shared_v1=NULL, dot_product_vari< T1, T2 > *shared_v2=NULL)
 
template<int R1, int C1, int R2, int C2>
 dot_product_vari (const Eigen::Matrix< T1, R1, C1 > &v1, const Eigen::Matrix< T2, R2, C2 > &v2, dot_product_vari< T1, T2 > *shared_v1=NULL, dot_product_vari< T1, T2 > *shared_v2=NULL)
 
virtual void chain ()
 Apply the chain rule to this variable based on the variables on which it depends. More...
 
- Public Member Functions inherited from stan::math::vari
 vari (double x)
 Construct a variable implementation from a value. More...
 
 vari (double x, bool stacked)
 
virtual ~vari ()
 Throw an illegal argument exception. More...
 
void init_dependent ()
 Initialize the adjoint for this (dependent) variable to 1. More...
 
void set_zero_adjoint ()
 Set the adjoint value of this variable to 0. More...
 

Protected Member Functions

void chain (vari **v1, vari **v2)
 
void chain (double *v1, vari **v2)
 
void chain (vari **v1, double *v2)
 
void initialize (vari **&mem_v, const var *inv, vari **shared=nullptr)
 
template<typename Derived >
void initialize (vari **&mem_v, const Eigen::DenseBase< Derived > &inv, vari **shared=nullptr)
 
void initialize (double *&mem_d, const double *ind, double *shared=nullptr)
 
template<typename Derived >
void initialize (double *&mem_d, const Eigen::DenseBase< Derived > &ind, double *shared=nullptr)
 

Static Protected Member Functions

static double var_dot (vari **v1, vari **v2, size_t length)
 
static double var_dot (const T1 *v1, const T2 *v2, size_t length)
 
template<typename Derived1 , typename Derived2 >
static double var_dot (const Eigen::DenseBase< Derived1 > &v1, const Eigen::DenseBase< Derived2 > &v2)
 

Protected Attributes

dot_product_store_type< T1 >::type v1_
 
dot_product_store_type< T2 >::type v2_
 
size_t length_
 

Additional Inherited Members

- Static Public Member Functions inherited from stan::math::vari
static void * operator new (size_t nbytes)
 Allocate memory from the underlying memory pool. More...
 
static void operator delete (void *)
 Delete a pointer from the underlying memory pool. More...
 
- Public Attributes inherited from stan::math::vari
const double val_
 The value of this variable. More...
 
double adj_
 The adjoint of this variable, which is the partial derivative of this variable with respect to the root variable. More...
 

Detailed Description

template<typename T1, typename T2>
class stan::math::internal::dot_product_vari< T1, T2 >

Definition at line 32 of file dot_product.hpp.

Constructor & Destructor Documentation

◆ dot_product_vari() [1/4]

template<typename T1 , typename T2 >
stan::math::internal::dot_product_vari< T1, T2 >::dot_product_vari ( typename dot_product_store_type< T1 >::type  v1,
typename dot_product_store_type< T2 >::type  v2,
size_t  length 
)
inline

Definition at line 131 of file dot_product.hpp.

◆ dot_product_vari() [2/4]

template<typename T1 , typename T2 >
stan::math::internal::dot_product_vari< T1, T2 >::dot_product_vari ( const T1 *  v1,
const T2 *  v2,
size_t  length,
dot_product_vari< T1, T2 > *  shared_v1 = NULL,
dot_product_vari< T1, T2 > *  shared_v2 = NULL 
)
inline

Definition at line 135 of file dot_product.hpp.

◆ dot_product_vari() [3/4]

template<typename T1 , typename T2 >
template<typename Derived1 , typename Derived2 >
stan::math::internal::dot_product_vari< T1, T2 >::dot_product_vari ( const Eigen::DenseBase< Derived1 > &  v1,
const Eigen::DenseBase< Derived2 > &  v2,
dot_product_vari< T1, T2 > *  shared_v1 = NULL,
dot_product_vari< T1, T2 > *  shared_v2 = NULL 
)
inline

Definition at line 151 of file dot_product.hpp.

◆ dot_product_vari() [4/4]

template<typename T1 , typename T2 >
template<int R1, int C1, int R2, int C2>
stan::math::internal::dot_product_vari< T1, T2 >::dot_product_vari ( const Eigen::Matrix< T1, R1, C1 > &  v1,
const Eigen::Matrix< T2, R2, C2 > &  v2,
dot_product_vari< T1, T2 > *  shared_v1 = NULL,
dot_product_vari< T1, T2 > *  shared_v2 = NULL 
)
inline

Definition at line 168 of file dot_product.hpp.

Member Function Documentation

◆ chain() [1/4]

template<typename T1 , typename T2 >
void stan::math::internal::dot_product_vari< T1, T2 >::chain ( vari **  v1,
vari **  v2 
)
inlineprotected

Definition at line 66 of file dot_product.hpp.

◆ chain() [2/4]

template<typename T1 , typename T2 >
void stan::math::internal::dot_product_vari< T1, T2 >::chain ( double *  v1,
vari **  v2 
)
inlineprotected

Definition at line 72 of file dot_product.hpp.

◆ chain() [3/4]

template<typename T1 , typename T2 >
void stan::math::internal::dot_product_vari< T1, T2 >::chain ( vari **  v1,
double *  v2 
)
inlineprotected

Definition at line 77 of file dot_product.hpp.

◆ chain() [4/4]

template<typename T1 , typename T2 >
virtual void stan::math::internal::dot_product_vari< T1, T2 >::chain ( )
inlinevirtual

Apply the chain rule to this variable based on the variables on which it depends.

The base implementation in this class is a no-op.

Reimplemented from stan::math::vari.

Definition at line 184 of file dot_product.hpp.

◆ initialize() [1/4]

template<typename T1 , typename T2 >
void stan::math::internal::dot_product_vari< T1, T2 >::initialize ( vari **&  mem_v,
const var inv,
vari **  shared = nullptr 
)
inlineprotected

Definition at line 82 of file dot_product.hpp.

◆ initialize() [2/4]

template<typename T1 , typename T2 >
template<typename Derived >
void stan::math::internal::dot_product_vari< T1, T2 >::initialize ( vari **&  mem_v,
const Eigen::DenseBase< Derived > &  inv,
vari **  shared = nullptr 
)
inlineprotected

Definition at line 94 of file dot_product.hpp.

◆ initialize() [3/4]

template<typename T1 , typename T2 >
void stan::math::internal::dot_product_vari< T1, T2 >::initialize ( double *&  mem_d,
const double *  ind,
double *  shared = nullptr 
)
inlineprotected

Definition at line 106 of file dot_product.hpp.

◆ initialize() [4/4]

template<typename T1 , typename T2 >
template<typename Derived >
void stan::math::internal::dot_product_vari< T1, T2 >::initialize ( double *&  mem_d,
const Eigen::DenseBase< Derived > &  ind,
double *  shared = nullptr 
)
inlineprotected

Definition at line 118 of file dot_product.hpp.

◆ var_dot() [1/3]

template<typename T1 , typename T2 >
static double stan::math::internal::dot_product_vari< T1, T2 >::var_dot ( vari **  v1,
vari **  v2,
size_t  length 
)
inlinestaticprotected

Definition at line 38 of file dot_product.hpp.

◆ var_dot() [2/3]

template<typename T1 , typename T2 >
static double stan::math::internal::dot_product_vari< T1, T2 >::var_dot ( const T1 *  v1,
const T2 *  v2,
size_t  length 
)
inlinestaticprotected

Definition at line 47 of file dot_product.hpp.

◆ var_dot() [3/3]

template<typename T1 , typename T2 >
template<typename Derived1 , typename Derived2 >
static double stan::math::internal::dot_product_vari< T1, T2 >::var_dot ( const Eigen::DenseBase< Derived1 > &  v1,
const Eigen::DenseBase< Derived2 > &  v2 
)
inlinestaticprotected

Definition at line 57 of file dot_product.hpp.

Member Data Documentation

◆ length_

template<typename T1 , typename T2 >
size_t stan::math::internal::dot_product_vari< T1, T2 >::length_
protected

Definition at line 36 of file dot_product.hpp.

◆ v1_

template<typename T1 , typename T2 >
dot_product_store_type<T1>::type stan::math::internal::dot_product_vari< T1, T2 >::v1_
protected

Definition at line 34 of file dot_product.hpp.

◆ v2_

template<typename T1 , typename T2 >
dot_product_store_type<T2>::type stan::math::internal::dot_product_vari< T1, T2 >::v2_
protected

Definition at line 35 of file dot_product.hpp.


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

     [ Stan Home Page ] © 2011–2018, Stan Development Team.