mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-09-10 00:03:17 +08:00
Mitigate setConstant regression with custom scalars
This commit is contained in:
parent
d2a70fe4e2
commit
38b51d5b7e
@ -78,8 +78,9 @@ template <typename Xpr>
|
||||
struct eigen_fill_impl<Xpr, /*use_fill*/ true> {
|
||||
using Scalar = typename Xpr::Scalar;
|
||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Xpr& dst, const Scalar& val) {
|
||||
const Scalar val_copy = val;
|
||||
using std::fill_n;
|
||||
fill_n(dst.data(), dst.size(), val);
|
||||
fill_n(dst.data(), dst.size(), val_copy);
|
||||
}
|
||||
template <typename SrcXpr>
|
||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(Xpr& dst, const SrcXpr& src) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user