1 #ifndef STAN_MATH_REV_MAT_FUN_DETERMINANT_HPP 2 #define STAN_MATH_REV_MAT_FUN_DETERMINANT_HPP 14 template <
int R,
int C>
26 A_(reinterpret_cast<double*>(
ChainableStack::instance_->memalloc_.alloc(
27 sizeof(double) * A.
rows() * A.
cols()))),
31 Eigen::Map<Eigen::MatrixXd>(A_, rows_, cols_) = A.val();
32 Eigen::Map<matrix_vi>(adjARef_, rows_, cols_) = A.vi();
35 return A.val().determinant();
38 Eigen::Map<matrix_vi>(adjARef_, rows_, cols_).adj()
40 * Eigen::Map<Eigen::MatrixXd>(A_, rows_, cols_)
47 template <
int R,
int C>
int rows(const Eigen::Matrix< T, R, C > &m)
Return the number of rows in the specified matrix, vector, or row vector.
void check_square(const char *function, const char *name, const matrix_cl &y)
Check if the matrix_cl is square.
The variable implementation base class.
Independent (input) and dependent (output) variables for gradients.
const double val_
The value of this variable.
fvar< T > determinant(const Eigen::Matrix< fvar< T >, R, C > &m)
virtual void chain()
Apply the chain rule to this variable based on the variables on which it depends. ...
int cols(const Eigen::Matrix< T, R, C > &m)
Return the number of columns in the specified matrix, vector, or row vector.
determinant_vari(const Eigen::Matrix< var, R, C > &A)
static double determinant_vari_calc(const Eigen::Matrix< var, R, C > &A)
double adj_
The adjoint of this variable, which is the partial derivative of this variable with respect to the ro...
This struct always provides access to the autodiff stack using the singleton pattern.