Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/eigen3/Eigen/src/plugins/ReshapedMethods.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 
0002 #ifdef EIGEN_PARSED_BY_DOXYGEN
0003 
0004 /// \returns an expression of \c *this with reshaped sizes.
0005 ///
0006 /// \param nRows the number of rows in the reshaped expression, specified at either run-time or compile-time, or AutoSize
0007 /// \param nCols the number of columns in the reshaped expression, specified at either run-time or compile-time, or AutoSize
0008 /// \tparam Order specifies whether the coefficients should be processed in column-major-order (ColMajor), in row-major-order (RowMajor),
0009 ///               or follows the \em natural order of the nested expression (AutoOrder). The default is ColMajor.
0010 /// \tparam NRowsType the type of the value handling the number of rows, typically Index.
0011 /// \tparam NColsType the type of the value handling the number of columns, typically Index.
0012 ///
0013 /// Dynamic size example: \include MatrixBase_reshaped_int_int.cpp
0014 /// Output: \verbinclude MatrixBase_reshaped_int_int.out
0015 ///
0016 /// The number of rows \a nRows and columns \a nCols can also be specified at compile-time by passing Eigen::fix<N>,
0017 /// or Eigen::fix<N>(n) as arguments. In the later case, \c n plays the role of a runtime fallback value in case \c N equals Eigen::Dynamic.
0018 /// Here is an example with a fixed number of rows and columns:
0019 /// \include MatrixBase_reshaped_fixed.cpp
0020 /// Output: \verbinclude MatrixBase_reshaped_fixed.out
0021 ///
0022 /// Finally, one of the sizes parameter can be automatically deduced from the other one by passing AutoSize as in the following example:
0023 /// \include MatrixBase_reshaped_auto.cpp
0024 /// Output: \verbinclude MatrixBase_reshaped_auto.out
0025 /// AutoSize does preserve compile-time sizes when possible, i.e., when the sizes of the input are known at compile time \b and
0026 /// that the other size is passed at compile-time using Eigen::fix<N> as above.
0027 ///
0028 /// \sa class Reshaped, fix, fix<N>(int)
0029 ///
0030 template<int Order = ColMajor, typename NRowsType, typename NColsType>
0031 EIGEN_DEVICE_FUNC
0032 inline Reshaped<Derived,...>
0033 reshaped(NRowsType nRows, NColsType nCols);
0034 
0035 /// This is the const version of reshaped(NRowsType,NColsType).
0036 template<int Order = ColMajor, typename NRowsType, typename NColsType>
0037 EIGEN_DEVICE_FUNC
0038 inline const Reshaped<const Derived,...>
0039 reshaped(NRowsType nRows, NColsType nCols) const;
0040 
0041 /// \returns an expression of \c *this with columns (or rows) stacked to a linear column vector
0042 ///
0043 /// \tparam Order specifies whether the coefficients should be processed in column-major-order (ColMajor), in row-major-order (RowMajor),
0044 ///               or follows the \em natural order of the nested expression (AutoOrder). The default is ColMajor.
0045 ///
0046 /// This overloads is essentially a shortcut for `A.reshaped<Order>(AutoSize,fix<1>)`.
0047 ///
0048 /// - If `Order==ColMajor` (the default), then it returns a column-vector from the stacked columns of \c *this.
0049 /// - If `Order==RowMajor`, then it returns a column-vector from the stacked rows of \c *this.
0050 /// - If `Order==AutoOrder`, then it returns a column-vector with elements stacked following the storage order of \c *this.
0051 ///   This mode is the recommended one when the particular ordering of the element is not relevant.
0052 ///
0053 /// Example:
0054 /// \include MatrixBase_reshaped_to_vector.cpp
0055 /// Output: \verbinclude MatrixBase_reshaped_to_vector.out
0056 ///
0057 /// If you want more control, you can still fall back to reshaped(NRowsType,NColsType).
0058 ///
0059 /// \sa reshaped(NRowsType,NColsType), class Reshaped
0060 ///
0061 template<int Order = ColMajor>
0062 EIGEN_DEVICE_FUNC
0063 inline Reshaped<Derived,...>
0064 reshaped();
0065 
0066 /// This is the const version of reshaped().
0067 template<int Order = ColMajor>
0068 EIGEN_DEVICE_FUNC
0069 inline const Reshaped<const Derived,...>
0070 reshaped() const;
0071 
0072 #else
0073 
0074 // This file is automatically included twice to generate const and non-const versions
0075 
0076 #ifndef EIGEN_RESHAPED_METHOD_2ND_PASS
0077 #define EIGEN_RESHAPED_METHOD_CONST const
0078 #else
0079 #define EIGEN_RESHAPED_METHOD_CONST
0080 #endif
0081 
0082 #ifndef EIGEN_RESHAPED_METHOD_2ND_PASS
0083 
0084 // This part is included once
0085 
0086 #endif
0087 
0088 template<typename NRowsType, typename NColsType>
0089 EIGEN_DEVICE_FUNC
0090 inline Reshaped<EIGEN_RESHAPED_METHOD_CONST Derived,
0091                 internal::get_compiletime_reshape_size<NRowsType,NColsType,SizeAtCompileTime>::value,
0092                 internal::get_compiletime_reshape_size<NColsType,NRowsType,SizeAtCompileTime>::value>
0093 reshaped(NRowsType nRows, NColsType nCols) EIGEN_RESHAPED_METHOD_CONST
0094 {
0095   return Reshaped<EIGEN_RESHAPED_METHOD_CONST Derived,
0096                   internal::get_compiletime_reshape_size<NRowsType,NColsType,SizeAtCompileTime>::value,
0097                   internal::get_compiletime_reshape_size<NColsType,NRowsType,SizeAtCompileTime>::value>
0098                 (derived(),
0099                  internal::get_runtime_reshape_size(nRows,internal::get_runtime_value(nCols),size()),
0100                  internal::get_runtime_reshape_size(nCols,internal::get_runtime_value(nRows),size()));
0101 }
0102 
0103 template<int Order, typename NRowsType, typename NColsType>
0104 EIGEN_DEVICE_FUNC
0105 inline Reshaped<EIGEN_RESHAPED_METHOD_CONST Derived,
0106                 internal::get_compiletime_reshape_size<NRowsType,NColsType,SizeAtCompileTime>::value,
0107                 internal::get_compiletime_reshape_size<NColsType,NRowsType,SizeAtCompileTime>::value,
0108                 internal::get_compiletime_reshape_order<Flags,Order>::value>
0109 reshaped(NRowsType nRows, NColsType nCols) EIGEN_RESHAPED_METHOD_CONST
0110 {
0111   return Reshaped<EIGEN_RESHAPED_METHOD_CONST Derived,
0112                   internal::get_compiletime_reshape_size<NRowsType,NColsType,SizeAtCompileTime>::value,
0113                   internal::get_compiletime_reshape_size<NColsType,NRowsType,SizeAtCompileTime>::value,
0114                   internal::get_compiletime_reshape_order<Flags,Order>::value>
0115                 (derived(),
0116                  internal::get_runtime_reshape_size(nRows,internal::get_runtime_value(nCols),size()),
0117                  internal::get_runtime_reshape_size(nCols,internal::get_runtime_value(nRows),size()));
0118 }
0119 
0120 // Views as linear vectors
0121 
0122 EIGEN_DEVICE_FUNC
0123 inline Reshaped<EIGEN_RESHAPED_METHOD_CONST Derived,SizeAtCompileTime,1>
0124 reshaped() EIGEN_RESHAPED_METHOD_CONST
0125 {
0126   return Reshaped<EIGEN_RESHAPED_METHOD_CONST Derived,SizeAtCompileTime,1>(derived(),size(),1);
0127 }
0128 
0129 template<int Order>
0130 EIGEN_DEVICE_FUNC
0131 inline Reshaped<EIGEN_RESHAPED_METHOD_CONST Derived, SizeAtCompileTime, 1,
0132                 internal::get_compiletime_reshape_order<Flags,Order>::value>
0133 reshaped() EIGEN_RESHAPED_METHOD_CONST
0134 {
0135   EIGEN_STATIC_ASSERT(Order==RowMajor || Order==ColMajor || Order==AutoOrder, INVALID_TEMPLATE_PARAMETER);
0136   return Reshaped<EIGEN_RESHAPED_METHOD_CONST Derived, SizeAtCompileTime, 1,
0137                   internal::get_compiletime_reshape_order<Flags,Order>::value>
0138                 (derived(), size(), 1);
0139 }
0140 
0141 #undef EIGEN_RESHAPED_METHOD_CONST
0142 
0143 #ifndef EIGEN_RESHAPED_METHOD_2ND_PASS
0144 #define EIGEN_RESHAPED_METHOD_2ND_PASS
0145 #include "ReshapedMethods.h"
0146 #undef EIGEN_RESHAPED_METHOD_2ND_PASS
0147 #endif
0148 
0149 #endif // EIGEN_PARSED_BY_DOXYGEN