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
math
matrix
mdivide_right_spd.hpp
Go to the documentation of this file.
1
#ifndef __STAN__MATH__MATRIX__MDIVIDE_RIGHT_SPD_HPP__
2
#define __STAN__MATH__MATRIX__MDIVIDE_RIGHT_SPD_HPP__
3
4
#include <boost/math/tools/promotion.hpp>
5
#include <
stan/math/matrix/Eigen.hpp
>
6
#include <
stan/math/matrix/mdivide_left_spd.hpp
>
7
#include <
stan/math/matrix/transpose.hpp
>
8
#include <
stan/math/matrix/validate_multiplicable.hpp
>
9
#include <
stan/math/matrix/validate_square.hpp
>
10
11
namespace
stan {
12
namespace
math {
13
23
template
<
typename
T1,
typename
T2,
int
R1,
int
C1,
int
R2,
int
C2>
24
inline
25
Eigen::Matrix<typename boost::math::tools::promote_args<T1,T2>::type,R1,C2>
26
mdivide_right_spd
(
const
Eigen::Matrix<T1,R1,C1> &b,
27
const
Eigen::Matrix<T2,R2,C2> &A) {
28
stan::math::validate_square
(A,
"mdivide_right_spd"
);
29
stan::math::validate_multiplicable
(b,A,
"mdivide_right_spd"
);
30
// FIXME: This is nice and general but likely slow.
31
return
transpose
(
mdivide_left_spd
(A,
transpose
(b)));
32
// return promote_common<Eigen::Matrix<T1,R2,C2>,
33
// Eigen::Matrix<T2,R2,C2> >(A)
34
// .transpose()
35
// .lu()
36
// .solve(promote_common<Eigen::Matrix<T1,R1,C1>,
37
// Eigen::Matrix<T2,R1,C1> >(b)
38
// .transpose())
39
// .transpose();
40
}
41
42
}
43
}
44
#endif
[
Stan Home Page
]
© 2011–2013, Stan Development Team.