| Stan Math Library 2.12.0 reverse mode automatic differentiation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Public Attributes | List of all members
stan::math::multiply_mat_vari< TA, 1, CA, double, 1 > Class Template Reference

This is a subclass of the vari class for matrix multiplication A * B where A is a row vector of length M and B is a vector of length M of doubles. More...

`#include <multiply.hpp>`

Inheritance diagram for stan::math::multiply_mat_vari< TA, 1, CA, double, 1 >:

## Public Member Functions
| multiply_mat_vari (const Eigen::Matrix< TA, 1, CA > &A, const Eigen::Matrix< double, CA, 1 > &B)
| Constructor for multiply_mat_vari. More...
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 (const double x)
| Construct a variable implementation from a value. More...
| vari (const 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...

## Public Attributes
int | size_
double * | Ad_
double * | Bd_
vari ** | variRefA_
vari * | variRefAB_
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...

## 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...

## Detailed Description

### template<typename TA, int CA>
class stan::math::multiply_mat_vari< TA, 1, CA, double, 1 >

This is a subclass of the vari class for matrix multiplication A * B where A is a row vector of length M and B is a vector of length M of doubles.

The class stores the structure of each matrix, the double values of A and B, and pointers to the varis for A and B if A or B is a var. It also instantiates and stores pointers to varis for all elements of A * B.

Template Parameters

  TA | Scalar type for matrix A
  RA | Rows for matrix A
  CA | Columns for matrix A, Rows for matrix B
  TB | Scalar type for matrix B
  CB | Columns for matrix B

Definition at line 454 of file multiply.hpp.

## Constructor & Destructor Documentation

template<typename TA , int CA>

stan::math::multiply_mat_vari< TA, 1, CA, double, 1 >::multiply_mat_vari | ( | const Eigen::Matrix< TA, 1, CA > & | A,
|  | const Eigen::Matrix< double, CA, 1 > & | B
| ) |  |
| inline

Constructor for multiply_mat_vari.

All memory allocated in ChainableStack's stack_alloc arena.

It is critical for the efficiency of this object that the constructor create new varis that aren't popped onto the var_stack_, but rather are popped onto the var_nochain_stack_. This is controlled to the second argument to vari's constructor.

Parameters

  A | row vector
  B | vector

Definition at line 478 of file multiply.hpp.

## Member Function Documentation

template<typename TA , int CA>

virtual void stan::math::multiply_mat_vari< TA, 1, CA, double, 1 >::chain | ( |  | ) |
| inline virtual

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 500 of file multiply.hpp.

## Member Data Documentation

template<typename TA , int CA>

double* stan::math::multiply_mat_vari< TA, 1, CA, double, 1 >::Ad_

Definition at line 457 of file multiply.hpp.

template<typename TA , int CA>

double* stan::math::multiply_mat_vari< TA, 1, CA, double, 1 >::Bd_

Definition at line 458 of file multiply.hpp.

template<typename TA , int CA>

int stan::math::multiply_mat_vari< TA, 1, CA, double, 1 >::size_

Definition at line 456 of file multiply.hpp.

template<typename TA , int CA>

vari** stan::math::multiply_mat_vari< TA, 1, CA, double, 1 >::variRefA_

Definition at line 459 of file multiply.hpp.

template<typename TA , int CA>

vari* stan::math::multiply_mat_vari< TA, 1, CA, double, 1 >::variRefAB_

Definition at line 460 of file multiply.hpp.

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

- stan/math/rev/mat/fun/multiply.hpp

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