This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
View | Details | Raw Unified | Return to bug 1391
Collapse All | Expand All

(-)a/Eigen/Core (-1 / +2 lines)
Lines 430-435 using std::ptrdiff_t; Link Here
430
// on CUDA devices
430
// on CUDA devices
431
#include "src/Core/arch/CUDA/Complex.h"
431
#include "src/Core/arch/CUDA/Complex.h"
432
432
433
#include "src/Core/IO.h"
434
433
#include "src/Core/util/IndexedViewHelper.h"
435
#include "src/Core/util/IndexedViewHelper.h"
434
#include "src/Core/ArithmeticSequence.h"
436
#include "src/Core/ArithmeticSequence.h"
435
#include "src/Core/DenseCoeffsBase.h"
437
#include "src/Core/DenseCoeffsBase.h"
Lines 480-486 using std::ptrdiff_t; Link Here
480
#include "src/Core/Redux.h"
482
#include "src/Core/Redux.h"
481
#include "src/Core/Visitor.h"
483
#include "src/Core/Visitor.h"
482
#include "src/Core/Fuzzy.h"
484
#include "src/Core/Fuzzy.h"
483
#include "src/Core/IO.h"
484
#include "src/Core/Swap.h"
485
#include "src/Core/Swap.h"
485
#include "src/Core/CommaInitializer.h"
486
#include "src/Core/CommaInitializer.h"
486
#include "src/Core/GeneralProduct.h"
487
#include "src/Core/GeneralProduct.h"
(-)a/Eigen/src/Core/DenseBase.h (-13 / +46 lines)
Lines 14-28 Link Here
14
namespace Eigen {
14
namespace Eigen {
15
15
16
namespace internal {
16
namespace internal {
17
  
17
18
// The index type defined by EIGEN_DEFAULT_DENSE_INDEX_TYPE must be a signed type.
18
// The index type defined by EIGEN_DEFAULT_DENSE_INDEX_TYPE must be a signed type.
19
// This dummy function simply aims at checking that at compile time.
19
// This dummy function simply aims at checking that at compile time.
20
static inline void check_DenseIndex_is_signed() {
20
static inline void check_DenseIndex_is_signed() {
21
  EIGEN_STATIC_ASSERT(NumTraits<DenseIndex>::IsSigned,THE_INDEX_TYPE_MUST_BE_A_SIGNED_TYPE); 
21
  EIGEN_STATIC_ASSERT(NumTraits<DenseIndex>::IsSigned,THE_INDEX_TYPE_MUST_BE_A_SIGNED_TYPE);
22
}
22
}
23
23
24
} // end namespace internal
24
} // end namespace internal
25
  
25
26
/** \class DenseBase
26
/** \class DenseBase
27
  * \ingroup Core_Module
27
  * \ingroup Core_Module
28
  *
28
  *
Lines 64-75 template<typename Derived> class DenseBa Link Here
64
64
65
    /** The numeric type of the expression' coefficients, e.g. float, double, int or std::complex<float>, etc. */
65
    /** The numeric type of the expression' coefficients, e.g. float, double, int or std::complex<float>, etc. */
66
    typedef typename internal::traits<Derived>::Scalar Scalar;
66
    typedef typename internal::traits<Derived>::Scalar Scalar;
67
    
67
68
    /** The numeric type of the expression' coefficients, e.g. float, double, int or std::complex<float>, etc.
68
    /** The numeric type of the expression' coefficients, e.g. float, double, int or std::complex<float>, etc.
69
      *
69
      *
70
      * It is an alias for the Scalar type */
70
      * It is an alias for the Scalar type */
71
    typedef Scalar value_type;
71
    typedef Scalar value_type;
72
    
72
73
    typedef typename NumTraits<Scalar>::Real RealScalar;
73
    typedef typename NumTraits<Scalar>::Real RealScalar;
74
    typedef DenseCoeffsBase<Derived> Base;
74
    typedef DenseCoeffsBase<Derived> Base;
75
75
Lines 170-180 template<typename Derived> class DenseBa Link Here
170
      InnerStrideAtCompileTime = internal::inner_stride_at_compile_time<Derived>::ret,
170
      InnerStrideAtCompileTime = internal::inner_stride_at_compile_time<Derived>::ret,
171
      OuterStrideAtCompileTime = internal::outer_stride_at_compile_time<Derived>::ret
171
      OuterStrideAtCompileTime = internal::outer_stride_at_compile_time<Derived>::ret
172
    };
172
    };
173
    
173
174
    typedef typename internal::find_best_packet<Scalar,SizeAtCompileTime>::type PacketScalar;
174
    typedef typename internal::find_best_packet<Scalar,SizeAtCompileTime>::type PacketScalar;
175
175
176
    enum { IsPlainObjectBase = 0 };
176
    enum { IsPlainObjectBase = 0 };
177
    
177
178
    /** The plain matrix type corresponding to this expression.
178
    /** The plain matrix type corresponding to this expression.
179
      * \sa PlainObject */
179
      * \sa PlainObject */
180
    typedef Matrix<typename internal::traits<Derived>::Scalar,
180
    typedef Matrix<typename internal::traits<Derived>::Scalar,
Lines 184-190 template<typename Derived> class DenseBa Link Here
184
                internal::traits<Derived>::MaxRowsAtCompileTime,
184
                internal::traits<Derived>::MaxRowsAtCompileTime,
185
                internal::traits<Derived>::MaxColsAtCompileTime
185
                internal::traits<Derived>::MaxColsAtCompileTime
186
          > PlainMatrix;
186
          > PlainMatrix;
187
    
187
188
    /** The plain array type corresponding to this expression.
188
    /** The plain array type corresponding to this expression.
189
      * \sa PlainObject */
189
      * \sa PlainObject */
190
    typedef Array<typename internal::traits<Derived>::Scalar,
190
    typedef Array<typename internal::traits<Derived>::Scalar,
Lines 224-230 template<typename Derived> class DenseBa Link Here
224
    /** \returns the inner size.
224
    /** \returns the inner size.
225
      *
225
      *
226
      * \note For a vector, this is just the size. For a matrix (non-vector), this is the minor dimension
226
      * \note For a vector, this is just the size. For a matrix (non-vector), this is the minor dimension
227
      * with respect to the \ref TopicStorageOrders "storage order", i.e., the number of rows for a 
227
      * with respect to the \ref TopicStorageOrders "storage order", i.e., the number of rows for a
228
      * column-major matrix, and the number of columns for a row-major matrix. */
228
      * column-major matrix, and the number of columns for a row-major matrix. */
229
    EIGEN_DEVICE_FUNC
229
    EIGEN_DEVICE_FUNC
230
    Index innerSize() const
230
    Index innerSize() const
Lines 369-375 template<typename Derived> class DenseBa Link Here
369
    template<typename OtherDerived> EIGEN_DEVICE_FUNC
369
    template<typename OtherDerived> EIGEN_DEVICE_FUNC
370
    bool isApprox(const DenseBase<OtherDerived>& other,
370
    bool isApprox(const DenseBase<OtherDerived>& other,
371
                  const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
371
                  const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
372
    EIGEN_DEVICE_FUNC 
372
    EIGEN_DEVICE_FUNC
373
    bool isMuchSmallerThan(const RealScalar& other,
373
    bool isMuchSmallerThan(const RealScalar& other,
374
                           const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
374
                           const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
375
    template<typename OtherDerived> EIGEN_DEVICE_FUNC
375
    template<typename OtherDerived> EIGEN_DEVICE_FUNC
Lines 380-386 template<typename Derived> class DenseBa Link Here
380
    EIGEN_DEVICE_FUNC bool isConstant(const Scalar& value, const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
380
    EIGEN_DEVICE_FUNC bool isConstant(const Scalar& value, const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
381
    EIGEN_DEVICE_FUNC bool isZero(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
381
    EIGEN_DEVICE_FUNC bool isZero(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
382
    EIGEN_DEVICE_FUNC bool isOnes(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
382
    EIGEN_DEVICE_FUNC bool isOnes(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
383
    
383
384
    inline bool hasNaN() const;
384
    inline bool hasNaN() const;
385
    inline bool allFinite() const;
385
    inline bool allFinite() const;
386
386
Lines 394-400 template<typename Derived> class DenseBa Link Here
394
      *
394
      *
395
      * Notice that in the case of a plain matrix or vector (not an expression) this function just returns
395
      * Notice that in the case of a plain matrix or vector (not an expression) this function just returns
396
      * a const reference, in order to avoid a useless copy.
396
      * a const reference, in order to avoid a useless copy.
397
      * 
397
      *
398
      * \warning Be carefull with eval() and the auto C++ keyword, as detailed in this \link TopicPitfalls_auto_keyword page \endlink.
398
      * \warning Be carefull with eval() and the auto C++ keyword, as detailed in this \link TopicPitfalls_auto_keyword page \endlink.
399
      */
399
      */
400
    EIGEN_DEVICE_FUNC
400
    EIGEN_DEVICE_FUNC
Lines 405-411 template<typename Derived> class DenseBa Link Here
405
      // size types on MSVC.
405
      // size types on MSVC.
406
      return typename internal::eval<Derived>::type(derived());
406
      return typename internal::eval<Derived>::type(derived());
407
    }
407
    }
408
    
408
409
    /** swaps *this with the expression \a other.
409
    /** swaps *this with the expression \a other.
410
      *
410
      *
411
      */
411
      */
Lines 600-605 template<typename Derived> class DenseBa Link Here
600
    template<typename OtherDerived> EIGEN_DEVICE_FUNC explicit DenseBase(const DenseBase<OtherDerived>&);
600
    template<typename OtherDerived> EIGEN_DEVICE_FUNC explicit DenseBase(const DenseBase<OtherDerived>&);
601
};
601
};
602
602
603
/** \returns a WithFormat proxy object allowing to print a matrix the with given
604
  * format \a fmt.
605
  *
606
  * See class IOFormat for some examples.
607
  *
608
  * \sa class IOFormat, class WithFormat
609
  */
610
template<typename Derived>
611
inline const WithFormat<Derived>
612
DenseBase<Derived>::format(const IOFormat& fmt) const
613
{
614
  return WithFormat<Derived>(derived(), fmt);
615
}
616
617
/** \relates DenseBase
618
  *
619
  * Outputs the matrix, to the given stream.
620
  *
621
  * If you wish to print the matrix with a format different than the default, use DenseBase::format().
622
  *
623
  * It is also possible to change the default format by defining EIGEN_DEFAULT_IO_FORMAT before including Eigen headers.
624
  * If not defined, this will automatically be defined to Eigen::IOFormat(), that is the Eigen::IOFormat with default parameters.
625
  *
626
  * \sa DenseBase::format()
627
  */
628
template<typename Derived>
629
std::ostream & operator <<
630
(std::ostream & s,
631
 const DenseBase<Derived> & m)
632
{
633
  return internal::print_matrix(s, m.eval(), EIGEN_DEFAULT_IO_FORMAT);
634
}
635
603
} // end namespace Eigen
636
} // end namespace Eigen
604
637
605
#endif // EIGEN_DENSEBASE_H
638
#endif // EIGEN_DENSEBASE_H
(-)a/Eigen/src/Core/IO.h (-36 / +2 lines)
Lines 11-17 Link Here
11
#ifndef EIGEN_IO_H
11
#ifndef EIGEN_IO_H
12
#define EIGEN_IO_H
12
#define EIGEN_IO_H
13
13
14
namespace Eigen { 
14
namespace Eigen {
15
15
16
enum { DontAlignCols = 1 };
16
enum { DontAlignCols = 1 };
17
enum { StreamPrecision = -1,
17
enum { StreamPrecision = -1,
Lines 109-128 class WithFormat Link Here
109
    IOFormat m_format;
109
    IOFormat m_format;
110
};
110
};
111
111
112
/** \returns a WithFormat proxy object allowing to print a matrix the with given
113
  * format \a fmt.
114
  *
115
  * See class IOFormat for some examples.
116
  *
117
  * \sa class IOFormat, class WithFormat
118
  */
119
template<typename Derived>
120
inline const WithFormat<Derived>
121
DenseBase<Derived>::format(const IOFormat& fmt) const
122
{
123
  return WithFormat<Derived>(derived(), fmt);
124
}
125
126
namespace internal {
112
namespace internal {
127
113
128
// NOTE: This helper is kept for backward compatibility with previous code specializing
114
// NOTE: This helper is kept for backward compatibility with previous code specializing
Lines 147-153 std::ostream & print_matrix(std::ostream Link Here
147
    s << fmt.matPrefix << fmt.matSuffix;
133
    s << fmt.matPrefix << fmt.matSuffix;
148
    return s;
134
    return s;
149
  }
135
  }
150
  
136
151
  typename Derived::Nested m = _m;
137
  typename Derived::Nested m = _m;
152
  typedef typename Derived::Scalar Scalar;
138
  typedef typename Derived::Scalar Scalar;
153
139
Lines 212-239 std::ostream & print_matrix(std::ostream Link Here
212
  if(explicit_precision) s.precision(old_precision);
198
  if(explicit_precision) s.precision(old_precision);
213
  return s;
199
  return s;
214
}
200
}
215
216
} // end namespace internal
201
} // end namespace internal
217
202
218
/** \relates DenseBase
219
  *
220
  * Outputs the matrix, to the given stream.
221
  *
222
  * If you wish to print the matrix with a format different than the default, use DenseBase::format().
223
  *
224
  * It is also possible to change the default format by defining EIGEN_DEFAULT_IO_FORMAT before including Eigen headers.
225
  * If not defined, this will automatically be defined to Eigen::IOFormat(), that is the Eigen::IOFormat with default parameters.
226
  *
227
  * \sa DenseBase::format()
228
  */
229
template<typename Derived>
230
std::ostream & operator <<
231
(std::ostream & s,
232
 const DenseBase<Derived> & m)
233
{
234
  return internal::print_matrix(s, m.eval(), EIGEN_DEFAULT_IO_FORMAT);
235
}
236
237
} // end namespace Eigen
203
} // end namespace Eigen
238
204
239
#endif // EIGEN_IO_H
205
#endif // EIGEN_IO_H

Return to bug 1391