aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h
diff options
context:
space:
mode:
authorGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2015-07-13 11:16:37 -0700
committerGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2015-07-13 11:16:37 -0700
commitb80036abec3c008306852334d7c8f057fee11d54 (patch)
treed66953452950cf8d4a6eccb9606f081a857f12ba /unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h
parent3912ca0d5388fc58853d2fd8f1773e920f55523b (diff)
Enabled the construction of a fixed sized tensor directly from an expression.
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h')
-rw-r--r--unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h b/unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h
index 76998b690..5e511dc4b 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h
@@ -197,6 +197,23 @@ class TensorFixedSize : public TensorBase<TensorFixedSize<Scalar_, Dimensions_,
}
#endif
+ template<typename OtherDerived>
+ EIGEN_DEVICE_FUNC
+ EIGEN_STRONG_INLINE TensorFixedSize(const TensorBase<OtherDerived, ReadOnlyAccessors>& other)
+ {
+ typedef TensorAssignOp<TensorFixedSize, const OtherDerived> Assign;
+ Assign assign(*this, other.derived());
+ internal::TensorExecutor<const Assign, DefaultDevice>::run(assign, DefaultDevice());
+ }
+ template<typename OtherDerived>
+ EIGEN_DEVICE_FUNC
+ EIGEN_STRONG_INLINE TensorFixedSize(const TensorBase<OtherDerived, WriteAccessors>& other)
+ {
+ typedef TensorAssignOp<TensorFixedSize, const OtherDerived> Assign;
+ Assign assign(*this, other.derived());
+ internal::TensorExecutor<const Assign, DefaultDevice>::run(assign, DefaultDevice());
+ }
+
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE TensorFixedSize& operator=(const TensorFixedSize& other)
{