![]() |
Prev | Next | double_det_lu.cpp |
# include <cppad/vector.hpp>
# include <cppad/speed/det_by_lu.hpp>
# include <cppad/speed/uniform_01.hpp>
void compute_det_lu(
size_t size ,
size_t repeat ,
CppAD::vector<double> &matrix ,
CppAD::vector<double> &det )
{
// -----------------------------------------------------
// setup
CppAD::det_by_lu<double> Det(size);
size_t n = size * size; // number of independent variables
// ------------------------------------------------------
while(repeat--)
{ // get the next matrix
CppAD::uniform_01(n, matrix);
// computation of the determinant
det[0] = Det(matrix);
}
return;
}