~ubuntu-branches/ubuntu/trusty/blender/trusty

« back to all changes in this revision

Viewing changes to extern/Eigen3/Eigen/src/Core/BooleanRedux.h

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
//
4
4
// Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr>
5
5
//
6
 
// Eigen is free software; you can redistribute it and/or
7
 
// modify it under the terms of the GNU Lesser General Public
8
 
// License as published by the Free Software Foundation; either
9
 
// version 3 of the License, or (at your option) any later version.
10
 
//
11
 
// Alternatively, you can redistribute it and/or
12
 
// modify it under the terms of the GNU General Public License as
13
 
// published by the Free Software Foundation; either version 2 of
14
 
// the License, or (at your option) any later version.
15
 
//
16
 
// Eigen is distributed in the hope that it will be useful, but WITHOUT ANY
17
 
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18
 
// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the
19
 
// GNU General Public License for more details.
20
 
//
21
 
// You should have received a copy of the GNU Lesser General Public
22
 
// License and a copy of the GNU General Public License along with
23
 
// Eigen. If not, see <http://www.gnu.org/licenses/>.
 
6
// This Source Code Form is subject to the terms of the Mozilla
 
7
// Public License v. 2.0. If a copy of the MPL was not distributed
 
8
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
24
9
 
25
10
#ifndef EIGEN_ALLANDANY_H
26
11
#define EIGEN_ALLANDANY_H
27
12
 
 
13
namespace Eigen { 
 
14
 
28
15
namespace internal {
29
16
 
30
17
template<typename Derived, int UnrollCount>
35
22
    row = (UnrollCount-1) % Derived::RowsAtCompileTime
36
23
  };
37
24
 
38
 
  inline static bool run(const Derived &mat)
 
25
  static inline bool run(const Derived &mat)
39
26
  {
40
27
    return all_unroller<Derived, UnrollCount-1>::run(mat) && mat.coeff(row, col);
41
28
  }
44
31
template<typename Derived>
45
32
struct all_unroller<Derived, 1>
46
33
{
47
 
  inline static bool run(const Derived &mat) { return mat.coeff(0, 0); }
 
34
  static inline bool run(const Derived &mat) { return mat.coeff(0, 0); }
48
35
};
49
36
 
50
37
template<typename Derived>
51
38
struct all_unroller<Derived, Dynamic>
52
39
{
53
 
  inline static bool run(const Derived &) { return false; }
 
40
  static inline bool run(const Derived &) { return false; }
54
41
};
55
42
 
56
43
template<typename Derived, int UnrollCount>
61
48
    row = (UnrollCount-1) % Derived::RowsAtCompileTime
62
49
  };
63
50
 
64
 
  inline static bool run(const Derived &mat)
 
51
  static inline bool run(const Derived &mat)
65
52
  {
66
53
    return any_unroller<Derived, UnrollCount-1>::run(mat) || mat.coeff(row, col);
67
54
  }
70
57
template<typename Derived>
71
58
struct any_unroller<Derived, 1>
72
59
{
73
 
  inline static bool run(const Derived &mat) { return mat.coeff(0, 0); }
 
60
  static inline bool run(const Derived &mat) { return mat.coeff(0, 0); }
74
61
};
75
62
 
76
63
template<typename Derived>
77
64
struct any_unroller<Derived, Dynamic>
78
65
{
79
 
  inline static bool run(const Derived &) { return false; }
 
66
  static inline bool run(const Derived &) { return false; }
80
67
};
81
68
 
82
69
} // end namespace internal
146
133
  return derived().template cast<bool>().template cast<Index>().sum();
147
134
}
148
135
 
 
136
} // end namespace Eigen
 
137
 
149
138
#endif // EIGEN_ALLANDANY_H