Stan
1.3
probability, sampling & optimization
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerator
Friends
Macros
Pages
src
stan
agrad
rev
operator_plus_equal.hpp
Go to the documentation of this file.
1
#ifndef __STAN__AGRAD__REV__OPERATOR_PLUS_EQUAL_HPP__
2
#define __STAN__AGRAD__REV__OPERATOR_PLUS_EQUAL_HPP__
3
4
#include <
stan/agrad/rev/var.hpp
>
5
#include <
stan/agrad/rev/operator_addition.hpp
>
6
7
namespace
stan {
8
namespace
agrad {
9
10
inline
var&
var::operator+=
(
const
var& b) {
11
vi_
=
new
add_vv_vari(
vi_
,b.vi_);
12
return
*
this
;
13
}
14
15
inline
var
&
var::operator+=
(
const
double
b) {
16
if
(b == 0.0)
17
return
*
this
;
18
vi_
=
new
add_vd_vari(
vi_
,b);
19
return
*
this
;
20
}
21
22
}
23
}
24
#endif
[
Stan Home Page
]
© 2011–2013, Stan Development Team.