Hi there I have 2 questions to the group,
Firstly
- is C++ 11 compilation flag allowed? I was getting errors saying
I get two warnings/errors that I think suggest we don't
"'auto' changes meaning in C++11; please remove it"
"range-based 'for' loops are not allowed in C++98 mode"
that was for a loop structured as
for(auto& val : vector_of_values
Secondly
I am doing inversions and determinants of large-ish matricies, the code I am bringing across used the eigen library like below,
Determinant
PartialPivLU<Matrix<double,Dynamic,Dynamic>> lu(M);
auto& LU = lu.matrixLU();
double c = lu.permutationP().determinant(); // -1 or 1
and for the inversion
V_invert = Vmat.llt().solve(MatrixXd::Identity(N_bins - 1, N_bins - 1));
I went down that road because in the eigen information it says "
If your matrix is of a very small fixed size (at most 4x4) this allows Eigen to avoid performing a LU decomposition, and instead use formulas that are more efficient on such small matrices." Which I took as if your matrix is bigger than 4x4 don't use the matrix.inverse() or matrix.determinant() and use the decomposition methods.
So my question is what is the most efficient/fastest method to calculate inverses and determinants of matrices larger than 4x4 <Type> in TMB?
Cheers,
Craig