You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: stan/math/rev/fun/csr_matrix_times_vector.hpp
+41-24Lines changed: 41 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -14,14 +14,18 @@ namespace math {
14
14
namespaceinternal {
15
15
/**
16
16
* `vari` for csr_matrix_times_vector
17
-
* @note `csr_matrix_times_vector` uses the old inheritance
18
-
* style to set up the reverse pass because of a linking
17
+
* @note `csr_matrix_times_vector` uses the old inheritance
18
+
* style to set up the reverse pass because of a linking
19
19
* issue on windows when using flto.
20
-
*
21
-
* @tparam Result_ Either a type inheriting from `Eigen::DenseBase` with scalar type `var` or a `var<T>` where `T` inherits from `Eigen::DenseBase`
22
-
* @tparam WMat_ Either a type inheriting from `Eigen::DenseBase` with scalar type `var` or `double`. Or a `var<T>` where `T` inherits from `Eigen::SparseBase`
23
-
* @tparam B_ Either a type inheriting from `Eigen::DenseBase` with scalar type `var` or `double`. Or a `var<T>` where `T` inherits from `Eigen::DenseBase`
24
-
*
20
+
*
21
+
* @tparam Result_ Either a type inheriting from `Eigen::DenseBase` with scalar
22
+
* type `var` or a `var<T>` where `T` inherits from `Eigen::DenseBase`
23
+
* @tparam WMat_ Either a type inheriting from `Eigen::DenseBase` with scalar
24
+
* type `var` or `double`. Or a `var<T>` where `T` inherits from
25
+
* `Eigen::SparseBase`
26
+
* @tparam B_ Either a type inheriting from `Eigen::DenseBase` with scalar type
27
+
* `var` or `double`. Or a `var<T>` where `T` inherits from `Eigen::DenseBase`
@@ -40,9 +44,12 @@ struct csr_adjoint : public vari {
40
44
41
45
/**
42
46
* Overload for calculating adjoints of `w_mat` and `b`
43
-
* @tparam Result Either a type inheriting from `Eigen::DenseBase` with scalar type `var` or a `var<T>` where `T` inherits from `Eigen::DenseBase`
44
-
* @tparam WMat Either a type inheriting from `Eigen::DenseBase` with scalar type `var`. Or a `var<T>` where `T` inherits from `Eigen::SparseBase`
45
-
* @tparam B Either a type inheriting from `Eigen::DenseBase` with scalar type `var`. Or a `var<T>` where `T` inherits from `Eigen::DenseBase`
47
+
* @tparam Result Either a type inheriting from `Eigen::DenseBase` with scalar
48
+
* type `var` or a `var<T>` where `T` inherits from `Eigen::DenseBase`
49
+
* @tparam WMat Either a type inheriting from `Eigen::DenseBase` with scalar
50
+
* type `var`. Or a `var<T>` where `T` inherits from `Eigen::SparseBase`
51
+
* @tparam B Either a type inheriting from `Eigen::DenseBase` with scalar type
52
+
* `var`. Or a `var<T>` where `T` inherits from `Eigen::DenseBase`
46
53
* @param res The vector result of the forward pass calculation
47
54
* @param w_mat A sparse matrix
48
55
* @param b A vector
@@ -57,9 +64,12 @@ struct csr_adjoint : public vari {
57
64
58
65
/**
59
66
* Overload for calculating adjoints of `w_mat`
60
-
* @tparam Result Either a type inheriting from `Eigen::DenseBase` with scalar type `var` or a `var<T>` where `T` inherits from `Eigen::DenseBase`
61
-
* @tparam WMat Either a type inheriting from `Eigen::DenseBase` with scalar type `var`. Or a `var<T>` where `T` inherits from `Eigen::SparseBase`
62
-
* @tparam B Either a type inheriting from `Eigen::DenseBase` with scalar type `double`
67
+
* @tparam Result Either a type inheriting from `Eigen::DenseBase` with scalar
68
+
* type `var` or a `var<T>` where `T` inherits from `Eigen::DenseBase`
69
+
* @tparam WMat Either a type inheriting from `Eigen::DenseBase` with scalar
70
+
* type `var`. Or a `var<T>` where `T` inherits from `Eigen::SparseBase`
71
+
* @tparam B Either a type inheriting from `Eigen::DenseBase` with scalar type
72
+
* `double`
63
73
* @param res The vector result of the forward pass calculation
64
74
* @param w_mat A sparse matrix
65
75
* @param b A vector
@@ -73,9 +83,12 @@ struct csr_adjoint : public vari {
73
83
74
84
/**
75
85
* Overload for calculating adjoints of `b`
76
-
* @tparam Result Either a type inheriting from `Eigen::DenseBase` with scalar type `var` or a `var<T>` where `T` inherits from `Eigen::DenseBase`
77
-
* @tparam WMat Either a type inheriting from `Eigen::DenseBase` with scalar type `double`
78
-
* @tparam B Either a type inheriting from `Eigen::DenseBase` with scalar type `var` or a `var<T>` where `T` inherits from `Eigen::DenseBase`
86
+
* @tparam Result Either a type inheriting from `Eigen::DenseBase` with scalar
87
+
* type `var` or a `var<T>` where `T` inherits from `Eigen::DenseBase`
88
+
* @tparam WMat Either a type inheriting from `Eigen::DenseBase` with scalar
89
+
* type `double`
90
+
* @tparam B Either a type inheriting from `Eigen::DenseBase` with scalar type
91
+
* `var` or a `var<T>` where `T` inherits from `Eigen::DenseBase`
79
92
* @param res The vector result of the forward pass calculation
80
93
* @param w_mat A sparse matrix
81
94
* @param b A vector
@@ -90,19 +103,23 @@ struct csr_adjoint : public vari {
90
103
91
104
/**
92
105
* Helper function to construct the csr_adjoint struct.
93
-
* @tparam Result_ Either a type inheriting from `Eigen::DenseBase` with scalar type `var` or a `var<T>` where `T` inherits from `Eigen::DenseBase`
94
-
* @tparam WMat_ Either a type inheriting from `Eigen::DenseBase` with scalar type `var` or `double`. Or a `var<T>` where `T` inherits from `Eigen::SparseBase`
95
-
* @tparam B_ Either a type inheriting from `Eigen::DenseBase` with scalar type `var` or `double`. Or a `var<T>` where `T` inherits from `Eigen::DenseBase`
96
-
*
106
+
* @tparam Result_ Either a type inheriting from `Eigen::DenseBase` with scalar
107
+
* type `var` or a `var<T>` where `T` inherits from `Eigen::DenseBase`
108
+
* @tparam WMat_ Either a type inheriting from `Eigen::DenseBase` with scalar
109
+
* type `var` or `double`. Or a `var<T>` where `T` inherits from
110
+
* `Eigen::SparseBase`
111
+
* @tparam B_ Either a type inheriting from `Eigen::DenseBase` with scalar type
112
+
* `var` or `double`. Or a `var<T>` where `T` inherits from `Eigen::DenseBase`
113
+
*
97
114
* @param res The vector result of the forward pass calculation
0 commit comments