mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
improve random
This commit is contained in:
@@ -28,6 +28,23 @@ struct MovableScalar : public Base {
|
||||
|
||||
template <>
|
||||
struct NumTraits<MovableScalar<float>> : GenericNumTraits<float> {};
|
||||
|
||||
namespace internal {
|
||||
template <typename T>
|
||||
struct random_impl<MovableScalar<T>> {
|
||||
using MoveableT = MovableScalar<T>;
|
||||
using Impl = random_impl<T>;
|
||||
static EIGEN_DEVICE_FUNC inline MoveableT run(const MoveableT& x, const MoveableT& y) {
|
||||
T result = Impl::run(x, y);
|
||||
return MoveableT(result);
|
||||
}
|
||||
static EIGEN_DEVICE_FUNC inline MoveableT run() {
|
||||
T result = Impl::run();
|
||||
return MoveableT(result);
|
||||
}
|
||||
};
|
||||
} // namespace internal
|
||||
|
||||
} // namespace Eigen
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user