This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
View | Details | Raw Unified | Return to bug 89 | Differences between
and this patch

Collapse All | Expand All

(-)a/Eigen/src/Core/BooleanRedux.h (+8 lines)
Lines 87-106 struct any_unroller<Derived, Dynamic> Link Here
87
  * Output: \verbinclude MatrixBase_all.out
87
  * Output: \verbinclude MatrixBase_all.out
88
  *
88
  *
89
  * \sa any(), Cwise::operator<()
89
  * \sa any(), Cwise::operator<()
90
  */
90
  */
91
template<typename Derived>
91
template<typename Derived>
92
inline bool DenseBase<Derived>::all() const
92
inline bool DenseBase<Derived>::all() const
93
{
93
{
94
  enum {
94
  enum {
95
#if __GNUC__==4 && __GNUC_MINOR__==3
96
    unroll = 0
97
#else
95
    unroll = SizeAtCompileTime != Dynamic
98
    unroll = SizeAtCompileTime != Dynamic
96
          && CoeffReadCost != Dynamic
99
          && CoeffReadCost != Dynamic
97
          && NumTraits<Scalar>::AddCost != Dynamic
100
          && NumTraits<Scalar>::AddCost != Dynamic
98
          && SizeAtCompileTime * (CoeffReadCost + NumTraits<Scalar>::AddCost) <= EIGEN_UNROLLING_LIMIT
101
          && SizeAtCompileTime * (CoeffReadCost + NumTraits<Scalar>::AddCost) <= EIGEN_UNROLLING_LIMIT
102
#endif
99
  };
103
  };
100
  if(unroll)
104
  if(unroll)
101
    return internal::all_unroller<Derived,
105
    return internal::all_unroller<Derived,
102
                           unroll ? int(SizeAtCompileTime) : Dynamic
106
                           unroll ? int(SizeAtCompileTime) : Dynamic
103
     >::run(derived());
107
     >::run(derived());
104
  else
108
  else
105
  {
109
  {
106
    for(Index j = 0; j < cols(); ++j)
110
    for(Index j = 0; j < cols(); ++j)
Lines 113-132 inline bool DenseBase<Derived>::all() co Link Here
113
/** \returns true if at least one coefficient is true
117
/** \returns true if at least one coefficient is true
114
  *
118
  *
115
  * \sa all()
119
  * \sa all()
116
  */
120
  */
117
template<typename Derived>
121
template<typename Derived>
118
inline bool DenseBase<Derived>::any() const
122
inline bool DenseBase<Derived>::any() const
119
{
123
{
120
  enum {
124
  enum {
125
#if __GNUC__==4 && __GNUC_MINOR__==3
126
    unroll = 0
127
#else
121
    unroll = SizeAtCompileTime != Dynamic
128
    unroll = SizeAtCompileTime != Dynamic
122
          && CoeffReadCost != Dynamic
129
          && CoeffReadCost != Dynamic
123
          && NumTraits<Scalar>::AddCost != Dynamic
130
          && NumTraits<Scalar>::AddCost != Dynamic
124
          && SizeAtCompileTime * (CoeffReadCost + NumTraits<Scalar>::AddCost) <= EIGEN_UNROLLING_LIMIT
131
          && SizeAtCompileTime * (CoeffReadCost + NumTraits<Scalar>::AddCost) <= EIGEN_UNROLLING_LIMIT
132
#endif
125
  };
133
  };
126
  if(unroll)
134
  if(unroll)
127
    return internal::any_unroller<Derived,
135
    return internal::any_unroller<Derived,
128
                           unroll ? int(SizeAtCompileTime) : Dynamic
136
                           unroll ? int(SizeAtCompileTime) : Dynamic
129
           >::run(derived());
137
           >::run(derived());
130
  else
138
  else
131
  {
139
  {
132
    for(Index j = 0; j < cols(); ++j)
140
    for(Index j = 0; j < cols(); ++j)

Return to bug 89