Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Francesco Brarda
stan-math-petsc
Commits
91ef54c3
Commit
91ef54c3
authored
7 years ago
by
Sean Talts
Browse files
Options
Download
Email Patches
Plain Diff
Revert the matrix autos from #801.
parent
93415475
stan-petsc
ChrisChiasson-feature/issue-123-complex-numbers-with-vars
bugfix/1063-std-lgamma
bugfix/1152-algebra_solver-lambdas
bugfix/issue-1250-lgamma
bugfix/issue-1270-add-check-for-meta-includes
bugfix/issue-2708-map-rect-fail
bugfix/issue-968-value-of-const-ref
bugfix/issue-995-fix-bernoulli-glm-test
bugfix/issues-935-933-integrate-1d
build/config-device-id
build/errwarns
cmake
code-cleanup/chain-final
code-cleanup/issue-937-flatten
develop
feature/1258-ad-test-core
feature/adjoint-ode
feature/automatic-autodiff-testing
feature/concept-chainable-allocator
feature/daniel-windows
feature/eigen-aligned-malloc
feature/faster-ad-tls
feature/faster-ad-tls-v2
feature/faster-ad-tls-v3
feature/faster-ad-tls-v4
feature/faster-ad-tls-v4-windows
feature/faster-ad-tls-v6
feature/github-doc-updates-aug-1-2018
feature/intel-tbb-lib
feature/issue-1012-binorm-copula-cdf
feature/issue-1022-integrate-1d-templating
feature/issue-1115-newton_solver
feature/issue-123-complex
feature/issue-1257-diff_algebra_solver
feature/issue-202-vectorize-all-binary
feature/issue-38-multi_normal_sufficient
feature/issue-565-vari-dealloc
feature/issue-755-laplace
feature/issue-838-linseq
feature/issue-876-adj-jac
feature/issue-876-ordered-constraints
feature/issue-888-quadratic_optimizer
feature/issue-937-flatten-meta-again
feature/issue-937-flatten-meta-the-third
feature/issue-937-flatten-meta-third
feature/issue-962-bivar-norm
feature/issue-989-rev-mat-eig
feature/lambertw
feature/map_rect-cpp17
feature/map_rect-fail-windows
feature/matrix_sqrt
feature/openMP
feature/operands_partials_less_copies
feature/parallel_for_each
feature/python-test-math-dependencies
feature/refactor-nested
feature/sparse-cholesky
gpu_matrix_multiply
gpu_performance_tests
integrate_1d-improvements
internal/no-assert
issue-static-init-order
kcl
master
mpi_errors
new-static-poc
new_complex_var
parallel-ad-tape-3
perf/operands_and_partials_deux
perf/runtime_matrix_check_flags
perf/static-stack
perf/threaded-ad2
release/v2.18.0
release/v2.18.1
release/v2.19.0
release/v2.19.1
release/v2.20.0
seantest/faster-ad-tls-v3
stancon/syclik
status-quo-multiple-tu
syclik/forward-mode
v2.20.0
v2.19.1
v2.19.0
v2.18.1
v2.18.0
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
stan/math/rev/mat/fun/multiply.hpp
+8
-4
stan/math/rev/mat/fun/multiply.hpp
with
8 additions
and
4 deletions
+8
-4
stan/math/rev/mat/fun/multiply.hpp
View file @
91ef54c3
...
...
@@ -98,11 +98,13 @@ class multiply_mat_vari : public vari {
using
Eigen
::
Map
;
using
Eigen
::
MatrixXd
;
MatrixXd
adjAB
(
A_rows_
,
B_cols_
);
MatrixXd
adjA
(
A_rows_
,
A_cols_
);
MatrixXd
adjB
(
A_cols_
,
B_cols_
);
for
(
size_type
i
=
0
;
i
<
adjAB
.
size
();
++
i
)
adjAB
(
i
)
=
variRefAB_
[
i
]
->
adj_
;
auto
adjA
=
adjAB
*
Map
<
MatrixXd
>
(
Bd_
,
A_cols_
,
B_cols_
).
transpose
();
auto
adjB
=
Map
<
MatrixXd
>
(
Ad_
,
A_rows_
,
A_cols_
).
transpose
()
*
adjAB
;
adjA
=
adjAB
*
Map
<
MatrixXd
>
(
Bd_
,
A_cols_
,
B_cols_
).
transpose
();
adjB
=
Map
<
MatrixXd
>
(
Ad_
,
A_rows_
,
A_cols_
).
transpose
()
*
adjAB
;
for
(
size_type
i
=
0
;
i
<
A_size_
;
++
i
)
variRefA_
[
i
]
->
adj_
+=
adjA
(
i
);
for
(
size_type
i
=
0
;
i
<
B_size_
;
++
i
)
...
...
@@ -266,10 +268,11 @@ class multiply_mat_vari<double, Ra, Ca, Tb, Cb> : public vari {
using
Eigen
::
Map
;
using
Eigen
::
MatrixXd
;
MatrixXd
adjAB
(
A_rows_
,
B_cols_
);
MatrixXd
adjB
(
A_cols_
,
B_cols_
);
for
(
size_type
i
=
0
;
i
<
adjAB
.
size
();
++
i
)
adjAB
(
i
)
=
variRefAB_
[
i
]
->
adj_
;
auto
adjB
=
Map
<
MatrixXd
>
(
Ad_
,
A_rows_
,
A_cols_
).
transpose
()
*
adjAB
;
adjB
=
Map
<
MatrixXd
>
(
Ad_
,
A_rows_
,
A_cols_
).
transpose
()
*
adjAB
;
for
(
size_type
i
=
0
;
i
<
B_size_
;
++
i
)
variRefB_
[
i
]
->
adj_
+=
adjB
(
i
);
}
...
...
@@ -426,10 +429,11 @@ class multiply_mat_vari<Ta, Ra, Ca, double, Cb> : public vari {
using
Eigen
::
Map
;
using
Eigen
::
MatrixXd
;
MatrixXd
adjAB
(
A_rows_
,
B_cols_
);
MatrixXd
adjA
(
A_rows_
,
A_cols_
);
for
(
size_type
i
=
0
;
i
<
adjAB
.
size
();
++
i
)
adjAB
(
i
)
=
variRefAB_
[
i
]
->
adj_
;
auto
adjA
=
adjAB
*
Map
<
MatrixXd
>
(
Bd_
,
A_cols_
,
B_cols_
).
transpose
();
adjA
=
adjAB
*
Map
<
MatrixXd
>
(
Bd_
,
A_cols_
,
B_cols_
).
transpose
();
for
(
size_type
i
=
0
;
i
<
A_size_
;
++
i
)
variRefA_
[
i
]
->
adj_
+=
adjA
(
i
);
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help