~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

Viewing changes to extern/Eigen2/Eigen/src/Core/NestByValue.h

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2012-07-23 08:54:18 UTC
  • mfrom: (14.2.16 sid)
  • mto: (14.2.19 sid)
  • mto: This revision was merged to the branch mainline in revision 42.
  • Revision ID: package-import@ubuntu.com-20120723085418-9foz30v6afaf5ffs
Tags: 2.63a-2
* debian/: Cycles support added (Closes: #658075)
  For now, this top feature has been enabled only
  on [any-amd64 any-i386] architectures because
  of OpenImageIO failing on all others
* debian/: scripts installation path changed
  from /usr/lib to /usr/share:
  + debian/patches/: patchset re-worked for path changing
  + debian/control: "Breaks" field added on yafaray-exporter

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// This file is part of Eigen, a lightweight C++ template library
2
 
// for linear algebra. Eigen itself is part of the KDE project.
3
 
//
4
 
// Copyright (C) 2008 Gael Guennebaud <g.gael@free.fr>
5
 
// Copyright (C) 2006-2008 Benoit Jacob <jacob.benoit.1@gmail.com>
6
 
//
7
 
// Eigen is free software; you can redistribute it and/or
8
 
// modify it under the terms of the GNU Lesser General Public
9
 
// License as published by the Free Software Foundation; either
10
 
// version 3 of the License, or (at your option) any later version.
11
 
//
12
 
// Alternatively, you can redistribute it and/or
13
 
// modify it under the terms of the GNU General Public License as
14
 
// published by the Free Software Foundation; either version 2 of
15
 
// the License, or (at your option) any later version.
16
 
//
17
 
// Eigen is distributed in the hope that it will be useful, but WITHOUT ANY
18
 
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19
 
// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the
20
 
// GNU General Public License for more details.
21
 
//
22
 
// You should have received a copy of the GNU Lesser General Public
23
 
// License and a copy of the GNU General Public License along with
24
 
// Eigen. If not, see <http://www.gnu.org/licenses/>.
25
 
 
26
 
#ifndef EIGEN_NESTBYVALUE_H
27
 
#define EIGEN_NESTBYVALUE_H
28
 
 
29
 
/** \class NestByValue
30
 
  *
31
 
  * \brief Expression which must be nested by value
32
 
  *
33
 
  * \param ExpressionType the type of the object of which we are requiring nesting-by-value
34
 
  *
35
 
  * This class is the return type of MatrixBase::nestByValue()
36
 
  * and most of the time this is the only way it is used.
37
 
  *
38
 
  * \sa MatrixBase::nestByValue()
39
 
  */
40
 
template<typename ExpressionType>
41
 
struct ei_traits<NestByValue<ExpressionType> > : public ei_traits<ExpressionType>
42
 
{};
43
 
 
44
 
template<typename ExpressionType> class NestByValue
45
 
  : public MatrixBase<NestByValue<ExpressionType> >
46
 
{
47
 
  public:
48
 
 
49
 
    EIGEN_GENERIC_PUBLIC_INTERFACE(NestByValue)
50
 
 
51
 
    inline NestByValue(const ExpressionType& matrix) : m_expression(matrix) {}
52
 
 
53
 
    inline int rows() const { return m_expression.rows(); }
54
 
    inline int cols() const { return m_expression.cols(); }
55
 
    inline int stride() const { return m_expression.stride(); }
56
 
 
57
 
    inline const Scalar coeff(int row, int col) const
58
 
    {
59
 
      return m_expression.coeff(row, col);
60
 
    }
61
 
 
62
 
    inline Scalar& coeffRef(int row, int col)
63
 
    {
64
 
      return m_expression.const_cast_derived().coeffRef(row, col);
65
 
    }
66
 
 
67
 
    inline const Scalar coeff(int index) const
68
 
    {
69
 
      return m_expression.coeff(index);
70
 
    }
71
 
 
72
 
    inline Scalar& coeffRef(int index)
73
 
    {
74
 
      return m_expression.const_cast_derived().coeffRef(index);
75
 
    }
76
 
 
77
 
    template<int LoadMode>
78
 
    inline const PacketScalar packet(int row, int col) const
79
 
    {
80
 
      return m_expression.template packet<LoadMode>(row, col);
81
 
    }
82
 
 
83
 
    template<int LoadMode>
84
 
    inline void writePacket(int row, int col, const PacketScalar& x)
85
 
    {
86
 
      m_expression.const_cast_derived().template writePacket<LoadMode>(row, col, x);
87
 
    }
88
 
 
89
 
    template<int LoadMode>
90
 
    inline const PacketScalar packet(int index) const
91
 
    {
92
 
      return m_expression.template packet<LoadMode>(index);
93
 
    }
94
 
 
95
 
    template<int LoadMode>
96
 
    inline void writePacket(int index, const PacketScalar& x)
97
 
    {
98
 
      m_expression.const_cast_derived().template writePacket<LoadMode>(index, x);
99
 
    }
100
 
 
101
 
  protected:
102
 
    const ExpressionType m_expression;
103
 
 
104
 
  private:
105
 
    NestByValue& operator=(const NestByValue&);
106
 
};
107
 
 
108
 
/** \returns an expression of the temporary version of *this.
109
 
  */
110
 
template<typename Derived>
111
 
inline const NestByValue<Derived>
112
 
MatrixBase<Derived>::nestByValue() const
113
 
{
114
 
  return NestByValue<Derived>(derived());
115
 
}
116
 
 
117
 
#endif // EIGEN_NESTBYVALUE_H