Skip to content

Commit 20d9b8c

Browse files
committed
update var operators
1 parent 1ee3f0c commit 20d9b8c

6 files changed

+7
-7
lines changed

stan/math/rev/core/matrix_vari.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class op_matrix_vari : public vari {
1717
vari** vis_;
1818

1919
public:
20-
template <typename T, require_eigen_vt<is_var, T>...>
20+
template <typename T, require_eigen_vt<is_var, T>* = nullptr>
2121
op_matrix_vari(double f, const T& vs) : vari(f), size_(vs.size()) {
2222
vis_ = ChainableStack::instance_->memalloc_.alloc_array<vari*>(size_);
2323
Eigen::Map<Eigen::Matrix<vari*, -1, -1>>(vis_, vs.rows(), vs.cols())

stan/math/rev/core/operator_divide_equal.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ inline var& var::operator/=(var b) {
1212
return *this;
1313
}
1414

15-
template <typename Arith, require_arithmetic_t<Arith>* = nullptr>
15+
template <typename Arith, require_arithmetic_t<Arith>*>
1616
inline var& var::operator/=(Arith b) {
1717
if (b == 1.0) {
1818
return *this;

stan/math/rev/core/operator_minus_equal.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ inline var& var::operator-=(var b) {
1313
return *this;
1414
}
1515

16-
template <typename Arith, require_arithmetic_t<Arith>* = nullptr>
16+
template <typename Arith, require_arithmetic_t<Arith>*>
1717
inline var& var::operator-=(Arith b) {
1818
if (b == 0.0) {
1919
return *this;

stan/math/rev/core/operator_multiply_equal.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ inline var& var::operator*=(var b) {
1313
return *this;
1414
}
1515

16-
template <typename Arith, require_arithmetic_t<Arith>* = nullptr>
16+
template <typename Arith, require_arithmetic_t<Arith>*>
1717
inline var& var::operator*=(Arith b) {
1818
if (b == 1.0) {
1919
return *this;

stan/math/rev/core/operator_plus_equal.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ inline var& var::operator+=(var b) {
1313
return *this;
1414
}
1515

16-
template <typename Arith, require_arithmetic_t<Arith>* = nullptr>
16+
template <typename Arith, require_arithmetic_t<Arith>*>
1717
inline var& var::operator+=(Arith b) {
1818
if (b == 0.0) {
1919
return *this;

stan/math/rev/core/vector_vari.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ class op_vector_vari : public vari {
1515
vari** vis_;
1616

1717
public:
18-
template <typename Arith, typename VecVar, require_arithmetic_t<Arith>...,
19-
require_vector_like_vt<is_var, VecVar>...>
18+
template <typename Arith, typename VecVar, require_arithmetic_t<Arith>* = nullptr,
19+
require_vector_like_vt<is_var, VecVar>* = nullptr>
2020
op_vector_vari(Arith f, VecVar&& vs) : vari(f), size_(vs.size()) {
2121
vis_ = reinterpret_cast<vari**>(operator new(sizeof(vari*) * vs.size()));
2222
for (size_t i = 0; i < vs.size(); ++i) {

0 commit comments

Comments
 (0)