2008-01-11 15:16:18 +08:00
|
|
|
// This file is part of Eigen, a lightweight C++ template library
|
|
|
|
|
// for linear algebra. Eigen itself is part of the KDE project.
|
|
|
|
|
//
|
|
|
|
|
// Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr>
|
|
|
|
|
//
|
2008-02-28 23:44:45 +08:00
|
|
|
// Eigen is free software; you can redistribute it and/or
|
|
|
|
|
// modify it under the terms of the GNU Lesser General Public
|
2008-03-03 19:02:52 +08:00
|
|
|
// License as published by the Free Software Foundation; either
|
2008-02-28 23:44:45 +08:00
|
|
|
// version 3 of the License, or (at your option) any later version.
|
|
|
|
|
//
|
|
|
|
|
// Alternatively, you can redistribute it and/or
|
|
|
|
|
// modify it under the terms of the GNU General Public License as
|
2008-03-03 19:02:52 +08:00
|
|
|
// published by the Free Software Foundation; either version 2 of
|
2008-02-28 23:44:45 +08:00
|
|
|
// the License, or (at your option) any later version.
|
2008-01-11 15:16:18 +08:00
|
|
|
//
|
|
|
|
|
// Eigen is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
2008-02-28 23:44:45 +08:00
|
|
|
// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the
|
|
|
|
|
// GNU General Public License for more details.
|
2008-01-11 15:16:18 +08:00
|
|
|
//
|
2008-03-03 19:02:52 +08:00
|
|
|
// You should have received a copy of the GNU Lesser General Public
|
2008-02-28 23:44:45 +08:00
|
|
|
// License and a copy of the GNU General Public License along with
|
|
|
|
|
// Eigen. If not, see <http://www.gnu.org/licenses/>.
|
2008-01-11 15:16:18 +08:00
|
|
|
|
|
|
|
|
#ifndef EIGEN_FORWARDDECLARATIONS_H
|
|
|
|
|
#define EIGEN_FORWARDDECLARATIONS_H
|
|
|
|
|
|
2008-03-13 01:17:36 +08:00
|
|
|
template<typename T> struct ei_traits;
|
2008-03-22 04:26:14 +08:00
|
|
|
template<typename Lhs, typename Rhs> struct ei_product_eval_mode;
|
2008-04-03 22:17:56 +08:00
|
|
|
template<typename T> struct NumTraits;
|
2008-03-11 01:23:11 +08:00
|
|
|
|
2008-03-31 02:43:22 +08:00
|
|
|
template<typename _Scalar, int _Rows, int _Cols, unsigned int _Flags, int _MaxRows, int _MaxCols> class Matrix;
|
2008-04-01 00:20:06 +08:00
|
|
|
template<typename ExpressionType> class Lazy;
|
2008-01-11 15:16:18 +08:00
|
|
|
template<typename MatrixType> class Minor;
|
2008-02-29 21:56:40 +08:00
|
|
|
template<typename MatrixType, int BlockRows=Dynamic, int BlockCols=Dynamic> class Block;
|
2008-01-11 15:16:18 +08:00
|
|
|
template<typename MatrixType> class Transpose;
|
|
|
|
|
template<typename MatrixType> class Conjugate;
|
2008-03-03 18:52:44 +08:00
|
|
|
template<typename BinaryOp, typename Lhs, typename Rhs> class CwiseBinaryOp;
|
|
|
|
|
template<typename UnaryOp, typename MatrixType> class CwiseUnaryOp;
|
2008-04-03 19:10:17 +08:00
|
|
|
template<typename Lhs, typename Rhs, int EvalMode=ei_product_eval_mode<Lhs,Rhs>::value> class Product;
|
2008-01-11 15:16:18 +08:00
|
|
|
template<typename MatrixType> class Random;
|
|
|
|
|
template<typename MatrixType> class Zero;
|
|
|
|
|
template<typename MatrixType> class Ones;
|
|
|
|
|
template<typename CoeffsVectorType> class DiagonalMatrix;
|
|
|
|
|
template<typename MatrixType> class DiagonalCoeffs;
|
|
|
|
|
template<typename MatrixType> class Identity;
|
|
|
|
|
template<typename MatrixType> class Map;
|
2008-01-15 21:55:47 +08:00
|
|
|
template<typename Derived> class Eval;
|
2008-03-10 00:13:47 +08:00
|
|
|
template<typename Derived> class EvalOMP;
|
2008-03-16 22:36:25 +08:00
|
|
|
template<int Direction, typename UnaryOp, typename MatrixType> class PartialRedux;
|
2008-01-11 15:16:18 +08:00
|
|
|
|
2008-04-03 19:10:17 +08:00
|
|
|
template<typename Scalar> struct ei_scalar_sum_op;
|
|
|
|
|
template<typename Scalar> struct ei_scalar_difference_op;
|
|
|
|
|
template<typename Scalar> struct ei_scalar_product_op;
|
|
|
|
|
template<typename Scalar> struct ei_scalar_quotient_op;
|
|
|
|
|
template<typename Scalar> struct ei_scalar_opposite_op;
|
|
|
|
|
template<typename Scalar> struct ei_scalar_conjugate_op;
|
|
|
|
|
template<typename Scalar> struct ei_scalar_abs_op;
|
|
|
|
|
template<typename Scalar> struct ei_scalar_abs2_op;
|
|
|
|
|
template<typename Scalar> struct ei_scalar_sqrt_op;
|
|
|
|
|
template<typename Scalar> struct ei_scalar_exp_op;
|
|
|
|
|
template<typename Scalar> struct ei_scalar_log_op;
|
|
|
|
|
template<typename Scalar> struct ei_scalar_cos_op;
|
|
|
|
|
template<typename Scalar> struct ei_scalar_sin_op;
|
|
|
|
|
template<typename Scalar> struct ei_scalar_pow_op;
|
|
|
|
|
template<typename Scalar, typename NewType> struct ei_scalar_cast_op;
|
|
|
|
|
template<typename Scalar> struct ei_scalar_multiple_op;
|
|
|
|
|
template<typename Scalar> struct ei_scalar_quotient1_op;
|
|
|
|
|
template<typename Scalar> struct ei_scalar_min_op;
|
|
|
|
|
template<typename Scalar> struct ei_scalar_max_op;
|
2008-03-04 20:34:58 +08:00
|
|
|
|
2008-04-04 00:54:19 +08:00
|
|
|
template<typename T> struct ei_copy_unless_matrix
|
2008-01-11 15:16:18 +08:00
|
|
|
{
|
2008-04-03 19:10:17 +08:00
|
|
|
typedef T type;
|
2008-01-11 15:16:18 +08:00
|
|
|
};
|
|
|
|
|
|
2008-03-31 02:43:22 +08:00
|
|
|
template<typename _Scalar, int _Rows, int _Cols, unsigned int _Flags, int _MaxRows, int _MaxCols>
|
2008-04-04 00:54:19 +08:00
|
|
|
struct ei_copy_unless_matrix<Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows, _MaxCols> >
|
2008-01-11 15:16:18 +08:00
|
|
|
{
|
2008-04-03 19:10:17 +08:00
|
|
|
typedef const Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows, _MaxCols> & type;
|
2008-01-11 15:16:18 +08:00
|
|
|
};
|
|
|
|
|
|
2008-04-04 00:54:19 +08:00
|
|
|
template<typename T> struct ei_xpr_copy
|
|
|
|
|
{
|
2008-04-04 02:13:27 +08:00
|
|
|
typedef typename ei_meta_if<T::Flags & TemporaryBit,
|
2008-04-04 00:54:19 +08:00
|
|
|
T,
|
|
|
|
|
typename ei_copy_unless_matrix<T>::type
|
|
|
|
|
>::ret type;
|
|
|
|
|
};
|
|
|
|
|
|
2008-04-03 19:10:17 +08:00
|
|
|
template<typename T> struct ei_eval
|
2008-04-01 00:20:06 +08:00
|
|
|
{
|
2008-04-01 01:24:09 +08:00
|
|
|
typedef Matrix<typename ei_traits<T>::Scalar,
|
|
|
|
|
ei_traits<T>::RowsAtCompileTime,
|
|
|
|
|
ei_traits<T>::ColsAtCompileTime,
|
2008-04-04 00:54:19 +08:00
|
|
|
ei_traits<T>::Flags & ~(EvalBeforeNestingBit | EvalBeforeAssigningBit),
|
2008-04-01 01:24:09 +08:00
|
|
|
ei_traits<T>::MaxRowsAtCompileTime,
|
2008-04-03 19:10:17 +08:00
|
|
|
ei_traits<T>::MaxColsAtCompileTime> type;
|
2008-04-01 00:20:06 +08:00
|
|
|
};
|
|
|
|
|
|
2008-04-04 00:54:19 +08:00
|
|
|
template<typename T> struct ei_eval_temporary
|
2008-04-03 22:17:56 +08:00
|
|
|
{
|
2008-04-04 00:54:19 +08:00
|
|
|
typedef Matrix<typename ei_traits<T>::Scalar,
|
|
|
|
|
ei_traits<T>::RowsAtCompileTime,
|
|
|
|
|
ei_traits<T>::ColsAtCompileTime,
|
|
|
|
|
(ei_traits<T>::Flags | TemporaryBit) & ~(EvalBeforeNestingBit | EvalBeforeAssigningBit),
|
|
|
|
|
ei_traits<T>::MaxRowsAtCompileTime,
|
|
|
|
|
ei_traits<T>::MaxColsAtCompileTime> type;
|
2008-04-03 22:17:56 +08:00
|
|
|
};
|
|
|
|
|
|
2008-04-04 00:54:19 +08:00
|
|
|
template<typename T, int n=1> struct ei_eval_if_needed_before_nesting
|
2008-04-01 00:20:06 +08:00
|
|
|
{
|
2008-04-04 00:54:19 +08:00
|
|
|
enum { eval = T::Flags & EvalBeforeNestingBit
|
|
|
|
|
|| n * NumTraits<typename T::Scalar>::ReadCost < (n-1) * T::CoeffReadCost };
|
|
|
|
|
typedef typename ei_meta_if<eval, typename ei_eval_temporary<T>::type, T>::ret type;
|
2008-04-01 00:20:06 +08:00
|
|
|
};
|
2008-04-01 01:24:09 +08:00
|
|
|
|
2008-04-04 02:13:27 +08:00
|
|
|
|
|
|
|
|
template<typename T> struct ei_functor_traits
|
|
|
|
|
{
|
|
|
|
|
enum { Cost = T::Cost };
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2008-01-11 15:16:18 +08:00
|
|
|
#endif // EIGEN_FORWARDDECLARATIONS_H
|