mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-29 07:14:12 +08:00
oops.. use the template paramater instead of hard coding 'double'
This commit is contained in:
parent
ceeb023ff2
commit
5e4cf6cae1
@ -30,13 +30,13 @@
|
||||
template<typename Functor, typename Scalar>
|
||||
// TODO : fixe Scalar here
|
||||
int ei_hybrd1(
|
||||
Eigen::Matrix< double, Eigen::Dynamic, 1 > &x,
|
||||
Eigen::Matrix< double, Eigen::Dynamic, 1 > &fvec,
|
||||
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > &x,
|
||||
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > &fvec,
|
||||
Scalar tol = Eigen::ei_sqrt(Eigen::machine_epsilon<Scalar>())
|
||||
)
|
||||
{
|
||||
int lwa = (x.size()*(3*x.size()+13))/2;
|
||||
Eigen::Matrix< double, Eigen::Dynamic, 1 > wa(lwa);
|
||||
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > wa(lwa);
|
||||
fvec.resize(x.size());
|
||||
return hybrd1(Functor::f, 0, x.size(), x.data(), fvec.data(), tol, wa.data(), lwa);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user