Main MRPT website > C++ reference
MRPT logo

DenseBase.h

Go to the documentation of this file.
00001 // This file is part of Eigen, a lightweight C++ template library
00002 // for linear algebra.
00003 //
00004 // Copyright (C) 2007-2010 Benoit Jacob <jacob.benoit.1@gmail.com>
00005 // Copyright (C) 2008-2010 Gael Guennebaud <gael.guennebaud@inria.fr>
00006 //
00007 // Eigen is free software; you can redistribute it and/or
00008 // modify it under the terms of the GNU Lesser General Public
00009 // License as published by the Free Software Foundation; either
00010 // version 3 of the License, or (at your option) any later version.
00011 //
00012 // Alternatively, you can redistribute it and/or
00013 // modify it under the terms of the GNU General Public License as
00014 // published by the Free Software Foundation; either version 2 of
00015 // the License, or (at your option) any later version.
00016 //
00017 // Eigen is distributed in the hope that it will be useful, but WITHOUT ANY
00018 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00019 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the
00020 // GNU General Public License for more details.
00021 //
00022 // You should have received a copy of the GNU Lesser General Public
00023 // License and a copy of the GNU General Public License along with
00024 // Eigen. If not, see <http://www.gnu.org/licenses/>.
00025 
00026 #ifndef EIGEN_DENSEBASE_H
00027 #define EIGEN_DENSEBASE_H
00028 
00029 /** \class DenseBase
00030   * \ingroup Core_Module
00031   *
00032   * \brief Base class for all dense matrices, vectors, and arrays
00033   *
00034   * This class is the base that is inherited by all dense objects (matrix, vector, arrays,
00035   * and related expression types). The common Eigen API for dense objects is contained in this class.
00036   *
00037   * \param Derived is the derived type, e.g., a matrix type or an expression.
00038   *
00039   * \sa \ref TopicClassHierarchy
00040   */
00041 template<typename Derived> class DenseBase
00042 #ifndef EIGEN_PARSED_BY_DOXYGEN
00043   : public internal::special_scalar_op_base<Derived,typename internal::traits<Derived>::Scalar,
00044                                      typename NumTraits<typename internal::traits<Derived>::Scalar>::Real>
00045 #else
00046   : public DenseCoeffsBase<Derived>
00047 #endif // not EIGEN_PARSED_BY_DOXYGEN
00048 {
00049   public:
00050     using internal::special_scalar_op_base<Derived,typename internal::traits<Derived>::Scalar,
00051                 typename NumTraits<typename internal::traits<Derived>::Scalar>::Real>::operator*;
00052 
00053     class InnerIterator;
00054 
00055     typedef typename internal::traits<Derived>::StorageKind StorageKind;
00056     typedef typename internal::traits<Derived>::Index Index; /**< The type of indices */
00057     typedef typename internal::traits<Derived>::Scalar Scalar;
00058     typedef typename internal::packet_traits<Scalar>::type PacketScalar;
00059     typedef typename NumTraits<Scalar>::Real RealScalar;
00060 
00061     typedef DenseCoeffsBase<Derived> Base;
00062     using Base::derived;
00063     using Base::const_cast_derived;
00064     using Base::rows;
00065     using Base::cols;
00066     using Base::size;
00067     using Base::rowIndexByOuterInner;
00068     using Base::colIndexByOuterInner;
00069     using Base::coeff;
00070     using Base::coeffByOuterInner;
00071     using Base::packet;
00072     using Base::packetByOuterInner;
00073     using Base::writePacket;
00074     using Base::writePacketByOuterInner;
00075     using Base::coeffRef;
00076     using Base::coeffRefByOuterInner;
00077     using Base::copyCoeff;
00078     using Base::copyCoeffByOuterInner;
00079     using Base::copyPacket;
00080     using Base::copyPacketByOuterInner;
00081     using Base::operator();
00082     using Base::operator[];
00083     using Base::x;
00084     using Base::y;
00085     using Base::z;
00086     using Base::w;
00087     using Base::stride;
00088     using Base::innerStride;
00089     using Base::outerStride;
00090     using Base::rowStride;
00091     using Base::colStride;
00092     typedef typename Base::CoeffReturnType CoeffReturnType;
00093 
00094     enum {
00095 
00096       RowsAtCompileTime = internal::traits<Derived>::RowsAtCompileTime,
00097         /**< The number of rows at compile-time. This is just a copy of the value provided
00098           * by the \a Derived type. If a value is not known at compile-time,
00099           * it is set to the \a Dynamic constant.
00100           * \sa MatrixBase::rows(), MatrixBase::cols(), ColsAtCompileTime, SizeAtCompileTime */
00101 
00102       ColsAtCompileTime = internal::traits<Derived>::ColsAtCompileTime,
00103         /**< The number of columns at compile-time. This is just a copy of the value provided
00104           * by the \a Derived type. If a value is not known at compile-time,
00105           * it is set to the \a Dynamic constant.
00106           * \sa MatrixBase::rows(), MatrixBase::cols(), RowsAtCompileTime, SizeAtCompileTime */
00107 
00108 
00109       SizeAtCompileTime = (internal::size_at_compile_time<internal::traits<Derived>::RowsAtCompileTime,
00110                                                    internal::traits<Derived>::ColsAtCompileTime>::ret),
00111         /**< This is equal to the number of coefficients, i.e. the number of
00112           * rows times the number of columns, or to \a Dynamic if this is not
00113           * known at compile-time. \sa RowsAtCompileTime, ColsAtCompileTime */
00114 
00115       MaxRowsAtCompileTime = internal::traits<Derived>::MaxRowsAtCompileTime,
00116         /**< This value is equal to the maximum possible number of rows that this expression
00117           * might have. If this expression might have an arbitrarily high number of rows,
00118           * this value is set to \a Dynamic.
00119           *
00120           * This value is useful to know when evaluating an expression, in order to determine
00121           * whether it is possible to avoid doing a dynamic memory allocation.
00122           *
00123           * \sa RowsAtCompileTime, MaxColsAtCompileTime, MaxSizeAtCompileTime
00124           */
00125 
00126       MaxColsAtCompileTime = internal::traits<Derived>::MaxColsAtCompileTime,
00127         /**< This value is equal to the maximum possible number of columns that this expression
00128           * might have. If this expression might have an arbitrarily high number of columns,
00129           * this value is set to \a Dynamic.
00130           *
00131           * This value is useful to know when evaluating an expression, in order to determine
00132           * whether it is possible to avoid doing a dynamic memory allocation.
00133           *
00134           * \sa ColsAtCompileTime, MaxRowsAtCompileTime, MaxSizeAtCompileTime
00135           */
00136 
00137       MaxSizeAtCompileTime = (internal::size_at_compile_time<internal::traits<Derived>::MaxRowsAtCompileTime,
00138                                                       internal::traits<Derived>::MaxColsAtCompileTime>::ret),
00139         /**< This value is equal to the maximum possible number of coefficients that this expression
00140           * might have. If this expression might have an arbitrarily high number of coefficients,
00141           * this value is set to \a Dynamic.
00142           *
00143           * This value is useful to know when evaluating an expression, in order to determine
00144           * whether it is possible to avoid doing a dynamic memory allocation.
00145           *
00146           * \sa SizeAtCompileTime, MaxRowsAtCompileTime, MaxColsAtCompileTime
00147           */
00148 
00149       IsVectorAtCompileTime = internal::traits<Derived>::MaxRowsAtCompileTime == 1
00150                            || internal::traits<Derived>::MaxColsAtCompileTime == 1,
00151         /**< This is set to true if either the number of rows or the number of
00152           * columns is known at compile-time to be equal to 1. Indeed, in that case,
00153           * we are dealing with a column-vector (if there is only one column) or with
00154           * a row-vector (if there is only one row). */
00155 
00156       Flags = internal::traits<Derived>::Flags,
00157         /**< This stores expression \ref flags flags which may or may not be inherited by new expressions
00158           * constructed from this one. See the \ref flags "list of flags".
00159           */
00160 
00161       IsRowMajor = int(Flags) & RowMajorBit, /**< True if this expression has row-major storage order. */
00162 
00163       InnerSizeAtCompileTime = int(IsVectorAtCompileTime) ? SizeAtCompileTime
00164                              : int(IsRowMajor) ? ColsAtCompileTime : RowsAtCompileTime,
00165 
00166       CoeffReadCost = internal::traits<Derived>::CoeffReadCost,
00167         /**< This is a rough measure of how expensive it is to read one coefficient from
00168           * this expression.
00169           */
00170 
00171       InnerStrideAtCompileTime = internal::inner_stride_at_compile_time<Derived>::ret,
00172       OuterStrideAtCompileTime = internal::outer_stride_at_compile_time<Derived>::ret
00173     };
00174 
00175     enum { ThisConstantIsPrivateInPlainObjectBase };
00176 
00177     /** \returns the number of nonzero coefficients which is in practice the number
00178       * of stored coefficients. */
00179     inline Index nonZeros() const { return size(); }
00180     /** \returns true if either the number of rows or the number of columns is equal to 1.
00181       * In other words, this function returns
00182       * \code rows()==1 || cols()==1 \endcode
00183       * \sa rows(), cols(), IsVectorAtCompileTime. */
00184 
00185     /** \returns the outer size.
00186       *
00187       * \note For a vector, this returns just 1. For a matrix (non-vector), this is the major dimension
00188       * with respect to the storage order, i.e., the number of columns for a column-major matrix,
00189       * and the number of rows for a row-major matrix. */
00190     Index outerSize() const
00191     {
00192       return IsVectorAtCompileTime ? 1
00193            : int(IsRowMajor) ? this->rows() : this->cols();
00194     }
00195 
00196     /** \returns the inner size.
00197       *
00198       * \note For a vector, this is just the size. For a matrix (non-vector), this is the minor dimension
00199       * with respect to the storage order, i.e., the number of rows for a column-major matrix,
00200       * and the number of columns for a row-major matrix. */
00201     Index innerSize() const
00202     {
00203       return IsVectorAtCompileTime ? this->size()
00204            : int(IsRowMajor) ? this->cols() : this->rows();
00205     }
00206 
00207     /** Only plain matrices/arrays, not expressions, may be resized; therefore the only useful resize methods are
00208       * Matrix::resize() and Array::resize(). The present method only asserts that the new size equals the old size, and does
00209       * nothing else.
00210       */
00211     void resize(Index size)
00212     {
00213       EIGEN_ONLY_USED_FOR_DEBUG(size);
00214       eigen_assert(size == this->size()
00215                 && "DenseBase::resize() does not actually allow to resize.");
00216     }
00217     /** Only plain matrices/arrays, not expressions, may be resized; therefore the only useful resize methods are
00218       * Matrix::resize() and Array::resize(). The present method only asserts that the new size equals the old size, and does
00219       * nothing else.
00220       */
00221     void resize(Index rows, Index cols)
00222     {
00223       EIGEN_ONLY_USED_FOR_DEBUG(rows);
00224       EIGEN_ONLY_USED_FOR_DEBUG(cols);
00225       eigen_assert(rows == this->rows() && cols == this->cols()
00226                 && "DenseBase::resize() does not actually allow to resize.");
00227     }
00228 
00229 #ifndef EIGEN_PARSED_BY_DOXYGEN
00230 
00231     /** \internal Represents a matrix with all coefficients equal to one another*/
00232     typedef CwiseNullaryOp<internal::scalar_constant_op<Scalar>,Derived> ConstantReturnType;
00233     /** \internal Represents a vector with linearly spaced coefficients that allows sequential access only. */
00234     typedef CwiseNullaryOp<internal::linspaced_op<Scalar,false>,Derived> SequentialLinSpacedReturnType;
00235     /** \internal Represents a vector with linearly spaced coefficients that allows random access. */
00236     typedef CwiseNullaryOp<internal::linspaced_op<Scalar,true>,Derived> RandomAccessLinSpacedReturnType;
00237     /** \internal the return type of MatrixBase::eigenvalues() */
00238     typedef Matrix<typename NumTraits<typename internal::traits<Derived>::Scalar>::Real, internal::traits<Derived>::ColsAtCompileTime, 1> EigenvaluesReturnType;
00239 
00240 #endif // not EIGEN_PARSED_BY_DOXYGEN
00241 
00242     /** Copies \a other into *this. \returns a reference to *this. */
00243     template<typename OtherDerived>
00244     Derived& operator=(const DenseBase<OtherDerived>& other);
00245 
00246     /** Special case of the template operator=, in order to prevent the compiler
00247       * from generating a default operator= (issue hit with g++ 4.1)
00248       */
00249     Derived& operator=(const DenseBase& other);
00250 
00251     template<typename OtherDerived>
00252     Derived& operator=(const EigenBase<OtherDerived> &other);
00253 
00254     template<typename OtherDerived>
00255     Derived& operator+=(const EigenBase<OtherDerived> &other);
00256 
00257     template<typename OtherDerived>
00258     Derived& operator-=(const EigenBase<OtherDerived> &other);
00259 
00260     template<typename OtherDerived>
00261     Derived& operator=(const ReturnByValue<OtherDerived>& func);
00262 
00263 #ifndef EIGEN_PARSED_BY_DOXYGEN
00264     /** Copies \a other into *this without evaluating other. \returns a reference to *this. */
00265     template<typename OtherDerived>
00266     Derived& lazyAssign(const DenseBase<OtherDerived>& other);
00267 #endif // not EIGEN_PARSED_BY_DOXYGEN
00268 
00269     CommaInitializer<Derived> operator<< (const Scalar& s);
00270 
00271     template<unsigned int Added,unsigned int Removed>
00272     const Flagged<Derived, Added, Removed> flagged() const;
00273 
00274     template<typename OtherDerived>
00275     CommaInitializer<Derived> operator<< (const DenseBase<OtherDerived>& other);
00276 
00277     Eigen::Transpose<Derived> transpose();
00278     typedef const Transpose<const Derived> ConstTransposeReturnType;
00279     ConstTransposeReturnType transpose() const;
00280     void transposeInPlace();
00281 #ifndef EIGEN_NO_DEBUG
00282   protected:
00283     template<typename OtherDerived>
00284     void checkTransposeAliasing(const OtherDerived& other) const;
00285   public:
00286 #endif
00287 
00288     typedef VectorBlock<Derived> SegmentReturnType;
00289     typedef const VectorBlock<const Derived> ConstSegmentReturnType;
00290     template<int Size> struct FixedSegmentReturnType { typedef VectorBlock<Derived, Size> Type; };
00291     template<int Size> struct ConstFixedSegmentReturnType { typedef const VectorBlock<const Derived, Size> Type; };
00292     
00293     // Note: The "DenseBase::" prefixes are added to help MSVC9 to match these declarations with the later implementations.
00294     SegmentReturnType segment(Index start, Index size);
00295     typename DenseBase::ConstSegmentReturnType segment(Index start, Index size) const;
00296 
00297     SegmentReturnType head(Index size);
00298     typename DenseBase::ConstSegmentReturnType head(Index size) const;
00299 
00300     SegmentReturnType tail(Index size);
00301     typename DenseBase::ConstSegmentReturnType tail(Index size) const;
00302 
00303     template<int Size> typename FixedSegmentReturnType<Size>::Type head();
00304     template<int Size> typename ConstFixedSegmentReturnType<Size>::Type head() const;
00305 
00306     template<int Size> typename FixedSegmentReturnType<Size>::Type tail();
00307     template<int Size> typename ConstFixedSegmentReturnType<Size>::Type tail() const;
00308 
00309     template<int Size> typename FixedSegmentReturnType<Size>::Type segment(Index start);
00310     template<int Size> typename ConstFixedSegmentReturnType<Size>::Type segment(Index start) const;
00311 
00312     static const ConstantReturnType
00313     Constant(Index rows, Index cols, const Scalar& value);
00314     static const ConstantReturnType
00315     Constant(Index size, const Scalar& value);
00316     static const ConstantReturnType
00317     Constant(const Scalar& value);
00318 
00319     static const SequentialLinSpacedReturnType
00320     LinSpaced(Sequential_t, Index size, const Scalar& low, const Scalar& high);
00321     static const RandomAccessLinSpacedReturnType
00322     LinSpaced(Index size, const Scalar& low, const Scalar& high);
00323     static const SequentialLinSpacedReturnType
00324     LinSpaced(Sequential_t, const Scalar& low, const Scalar& high);
00325     static const RandomAccessLinSpacedReturnType
00326     LinSpaced(const Scalar& low, const Scalar& high);
00327 
00328     template<typename CustomNullaryOp>
00329     static const CwiseNullaryOp<CustomNullaryOp, Derived>
00330     NullaryExpr(Index rows, Index cols, const CustomNullaryOp& func);
00331     template<typename CustomNullaryOp>
00332     static const CwiseNullaryOp<CustomNullaryOp, Derived>
00333     NullaryExpr(Index size, const CustomNullaryOp& func);
00334     template<typename CustomNullaryOp>
00335     static const CwiseNullaryOp<CustomNullaryOp, Derived>
00336     NullaryExpr(const CustomNullaryOp& func);
00337 
00338     static const ConstantReturnType Zero(Index rows, Index cols);
00339     static const ConstantReturnType Zero(Index size);
00340     static const ConstantReturnType Zero();
00341     static const ConstantReturnType Ones(Index rows, Index cols);
00342     static const ConstantReturnType Ones(Index size);
00343     static const ConstantReturnType Ones();
00344 
00345     void fill(const Scalar& value);
00346     Derived& setConstant(const Scalar& value);
00347     Derived& setLinSpaced(Index size, const Scalar& low, const Scalar& high);
00348     Derived& setLinSpaced(const Scalar& low, const Scalar& high);
00349     Derived& setZero();
00350     Derived& setOnes();
00351     Derived& setRandom();
00352 
00353     template<typename OtherDerived>
00354     bool isApprox(const DenseBase<OtherDerived>& other,
00355                   RealScalar prec = NumTraits<Scalar>::dummy_precision()) const;
00356     bool isMuchSmallerThan(const RealScalar& other,
00357                            RealScalar prec = NumTraits<Scalar>::dummy_precision()) const;
00358     template<typename OtherDerived>
00359     bool isMuchSmallerThan(const DenseBase<OtherDerived>& other,
00360                            RealScalar prec = NumTraits<Scalar>::dummy_precision()) const;
00361 
00362     bool isApproxToConstant(const Scalar& value, RealScalar prec = NumTraits<Scalar>::dummy_precision()) const;
00363     bool isConstant(const Scalar& value, RealScalar prec = NumTraits<Scalar>::dummy_precision()) const;
00364     bool isZero(RealScalar prec = NumTraits<Scalar>::dummy_precision()) const;
00365     bool isOnes(RealScalar prec = NumTraits<Scalar>::dummy_precision()) const;
00366 
00367     inline Derived& operator*=(const Scalar& other);
00368     inline Derived& operator/=(const Scalar& other);
00369 
00370     /** \returns the matrix or vector obtained by evaluating this expression.
00371       *
00372       * Notice that in the case of a plain matrix or vector (not an expression) this function just returns
00373       * a const reference, in order to avoid a useless copy.
00374       */
00375     EIGEN_STRONG_INLINE const typename internal::eval<Derived>::type eval() const
00376     {
00377       // Even though MSVC does not honor strong inlining when the return type
00378       // is a dynamic matrix, we desperately need strong inlining for fixed
00379       // size types on MSVC.
00380       return typename internal::eval<Derived>::type(derived());
00381     }
00382 
00383     /** swaps *this with the expression \a other.
00384       *
00385       */
00386     template<typename OtherDerived>
00387     void swap(const DenseBase<OtherDerived>& other,
00388               int = OtherDerived::ThisConstantIsPrivateInPlainObjectBase)
00389     {
00390       SwapWrapper<Derived>(derived()).lazyAssign(other.derived());
00391     }
00392 
00393     /** swaps *this with the matrix or array \a other.
00394       *
00395       */
00396     template<typename OtherDerived>
00397     void swap(PlainObjectBase<OtherDerived>& other)
00398     {
00399       SwapWrapper<Derived>(derived()).lazyAssign(other.derived());
00400     }
00401 
00402 
00403     inline const NestByValue<Derived> nestByValue() const;
00404     inline const ForceAlignedAccess<Derived> forceAlignedAccess() const;
00405     inline ForceAlignedAccess<Derived> forceAlignedAccess();
00406     template<bool Enable> inline const typename internal::conditional<Enable,ForceAlignedAccess<Derived>,Derived&>::type forceAlignedAccessIf() const;
00407     template<bool Enable> inline typename internal::conditional<Enable,ForceAlignedAccess<Derived>,Derived&>::type forceAlignedAccessIf();
00408 
00409     Scalar sum() const;
00410     Scalar mean() const;
00411     Scalar trace() const;
00412 
00413     Scalar prod() const;
00414 
00415     typename internal::traits<Derived>::Scalar minCoeff() const;
00416     typename internal::traits<Derived>::Scalar maxCoeff() const;
00417 
00418     typename internal::traits<Derived>::Scalar minCoeff(Index* row, Index* col) const;
00419     typename internal::traits<Derived>::Scalar maxCoeff(Index* row, Index* col) const;
00420 
00421     typename internal::traits<Derived>::Scalar minCoeff(Index* index) const;
00422     typename internal::traits<Derived>::Scalar maxCoeff(Index* index) const;
00423 
00424     template<typename BinaryOp>
00425     typename internal::result_of<BinaryOp(typename internal::traits<Derived>::Scalar)>::type
00426     redux(const BinaryOp& func) const;
00427 
00428     template<typename Visitor>
00429     void visit(Visitor& func) const;
00430 
00431     inline const WithFormat<Derived> format(const IOFormat& fmt) const;
00432 
00433     /** \returns the unique coefficient of a 1x1 expression */
00434     CoeffReturnType value() const
00435     {
00436       EIGEN_STATIC_ASSERT_SIZE_1x1(Derived)
00437       eigen_assert(this->rows() == 1 && this->cols() == 1);
00438       return derived().coeff(0,0);
00439     }
00440 
00441 /////////// Array module ///////////
00442 
00443     bool all(void) const;
00444     bool any(void) const;
00445     Index count() const;
00446 
00447     typedef VectorwiseOp<Derived, Horizontal> RowwiseReturnType;
00448     typedef const VectorwiseOp<const Derived, Horizontal> ConstRowwiseReturnType;
00449     typedef VectorwiseOp<Derived, Vertical> ColwiseReturnType;
00450     typedef const VectorwiseOp<const Derived, Vertical> ConstColwiseReturnType;
00451 
00452     ConstRowwiseReturnType rowwise() const;
00453     RowwiseReturnType rowwise();
00454     ConstColwiseReturnType colwise() const;
00455     ColwiseReturnType colwise();
00456 
00457     static const CwiseNullaryOp<internal::scalar_random_op<Scalar>,Derived> Random(Index rows, Index cols);
00458     static const CwiseNullaryOp<internal::scalar_random_op<Scalar>,Derived> Random(Index size);
00459     static const CwiseNullaryOp<internal::scalar_random_op<Scalar>,Derived> Random();
00460 
00461     template<typename ThenDerived,typename ElseDerived>
00462     const Select<Derived,ThenDerived,ElseDerived>
00463     select(const DenseBase<ThenDerived>& thenMatrix,
00464            const DenseBase<ElseDerived>& elseMatrix) const;
00465 
00466     template<typename ThenDerived>
00467     inline const Select<Derived,ThenDerived, typename ThenDerived::ConstantReturnType>
00468     select(const DenseBase<ThenDerived>& thenMatrix, typename ThenDerived::Scalar elseScalar) const;
00469 
00470     template<typename ElseDerived>
00471     inline const Select<Derived, typename ElseDerived::ConstantReturnType, ElseDerived >
00472     select(typename ElseDerived::Scalar thenScalar, const DenseBase<ElseDerived>& elseMatrix) const;
00473 
00474     template<int p> RealScalar lpNorm() const;
00475 
00476     template<int RowFactor, int ColFactor>
00477     const Replicate<Derived,RowFactor,ColFactor> replicate() const;
00478     const Replicate<Derived,Dynamic,Dynamic> replicate(Index rowFacor,Index colFactor) const;
00479 
00480     typedef Reverse<Derived, BothDirections> ReverseReturnType;
00481     typedef const Reverse<const Derived, BothDirections> ConstReverseReturnType;
00482     ReverseReturnType reverse();
00483     ConstReverseReturnType reverse() const;
00484     void reverseInPlace();
00485 
00486 #define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::DenseBase
00487 #   include "../plugins/BlockMethods.h"
00488 #   ifdef EIGEN_DENSEBASE_PLUGIN
00489 #     include EIGEN_DENSEBASE_PLUGIN
00490 #   endif
00491 #undef EIGEN_CURRENT_STORAGE_BASE_CLASS
00492 
00493 #ifdef EIGEN2_SUPPORT
00494 
00495     Block<Derived> corner(CornerType type, Index cRows, Index cCols);
00496     const Block<Derived> corner(CornerType type, Index cRows, Index cCols) const;
00497     template<int CRows, int CCols>
00498     Block<Derived, CRows, CCols> corner(CornerType type);
00499     template<int CRows, int CCols>
00500     const Block<Derived, CRows, CCols> corner(CornerType type) const;
00501 
00502 #endif // EIGEN2_SUPPORT
00503 
00504 
00505     // disable the use of evalTo for dense objects with a nice compilation error
00506     template<typename Dest> inline void evalTo(Dest& ) const
00507     {
00508       EIGEN_STATIC_ASSERT((internal::is_same<Dest,void>::value),THE_EVAL_EVALTO_FUNCTION_SHOULD_NEVER_BE_CALLED_FOR_DENSE_OBJECTS);
00509     }
00510 
00511   protected:
00512     /** Default constructor. Do nothing. */
00513     DenseBase()
00514     {
00515       /* Just checks for self-consistency of the flags.
00516        * Only do it when debugging Eigen, as this borders on paranoiac and could slow compilation down
00517        */
00518 #ifdef EIGEN_INTERNAL_DEBUGGING
00519       EIGEN_STATIC_ASSERT((EIGEN_IMPLIES(MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1, int(IsRowMajor))
00520                         && EIGEN_IMPLIES(MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1, int(!IsRowMajor))),
00521                           INVALID_STORAGE_ORDER_FOR_THIS_VECTOR_EXPRESSION)
00522 #endif
00523     }
00524 
00525   private:
00526     explicit DenseBase(int);
00527     DenseBase(int,int);
00528     template<typename OtherDerived> explicit DenseBase(const DenseBase<OtherDerived>&);
00529 };
00530 
00531 #endif // EIGEN_DENSEBASE_H



Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN:exported at Tue Jan 25 21:56:31 UTC 2011