diff options
author | Gael Guennebaud <g.gael@free.fr> | 2017-02-21 13:49:09 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2017-02-21 13:49:09 +0100 |
commit | b3fc0007ae15208b6cbf42b37a56c855e72bd712 (patch) | |
tree | 34cb5898aaa9283f22f749945e6fabe62a5bbd51 /Eigen | |
parent | 9081c8f6eaeb61a682950fac53af6b321667e355 (diff) |
Add support for mat(all) as an alias to mat.reshaped(mat.size(),fix<1>);
Diffstat (limited to 'Eigen')
-rw-r--r-- | Eigen/src/Core/util/Constants.h | 2 | ||||
-rw-r--r-- | Eigen/src/plugins/ReshapedMethods.h | 9 |
2 files changed, 11 insertions, 0 deletions
diff --git a/Eigen/src/Core/util/Constants.h b/Eigen/src/Core/util/Constants.h index 5d37e5d04..612dbf5e8 100644 --- a/Eigen/src/Core/util/Constants.h +++ b/Eigen/src/Core/util/Constants.h @@ -339,6 +339,8 @@ enum SideType { OnTheRight = 2 }; + + /* the following used to be written as: * * struct NoChange_t {}; diff --git a/Eigen/src/plugins/ReshapedMethods.h b/Eigen/src/plugins/ReshapedMethods.h index 7a11a4bcc..3a1b20301 100644 --- a/Eigen/src/plugins/ReshapedMethods.h +++ b/Eigen/src/plugins/ReshapedMethods.h @@ -70,4 +70,13 @@ reshaped(NRowsType nRows, NColsType nCols, OrderType) const derived(), internal::get_runtime_value(nRows), internal::get_runtime_value(nCols)); } +// Views as linear vectors + +EIGEN_DEVICE_FUNC +inline const Reshaped<const Derived,SizeAtCompileTime,1> +operator()(const Eigen::internal::all_t&) +{ + return Reshaped<const Derived,SizeAtCompileTime,1>(derived(),size(),1); +} + #endif // EIGEN_PARSED_BY_DOXYGEN |