[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdesupport/eigen2/Eigen/src/Core
From:       BenoƮt Jacob <jacob () math ! jussieu ! fr>
Date:       2008-11-17 12:46:01
Message-ID: 1226925961.093141.2832.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 885517 by bjacob:

* add Gael a (c) line in IO.h
* let user change default format by defining EIGEN_DEFAULT_IO_FORMAT 
* improve docs a little



 M  +9 -5      IO.h  
 M  +4 -0      util/Macros.h  


--- trunk/kdesupport/eigen2/Eigen/src/Core/IO.h #885516:885517
@@ -2,6 +2,7 @@
 // for linear algebra. Eigen itself is part of the KDE project.
 //
 // Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr>
+// Copyright (C) 2008 Gael Guennebaud <g.gael@free.fr>
 //
 // Eigen is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -121,8 +122,7 @@
 /** \internal
   * print the matrix \a _m to the output stream \a s using the output format \a fmt \
*/  template<typename Derived>
-std::ostream & ei_print_matrix(std::ostream & s, const MatrixBase<Derived> & _m,
-                               const IOFormat& fmt = IOFormat())
+std::ostream & ei_print_matrix(std::ostream & s, const MatrixBase<Derived> & _m, \
const IOFormat& fmt)  {
   const typename Derived::Nested m = _m;
   int width = 0;
@@ -163,9 +163,13 @@
 
 /** \relates MatrixBase
   *
-  * Outputs the matrix, laid out as an array as usual, to the given stream.
-  * You can control the way the matrix is printed using MatrixBase::format().
+  * Outputs the matrix, to the given stream.
   *
+  * If you wish to print the matrix with a format different than the default, use \
MatrixBase::format(). +  *
+  * It is also possible to change the default format by defining \
EIGEN_DEFAULT_IO_FORMAT before including Eigen headers. +  * If not defined, this \
will automatically be defined to Eigen::IOFormat(), that is the Eigen::IOFormat with \
default parameters. +  *
   * \sa MatrixBase::format()
   */
 template<typename Derived>
@@ -173,7 +177,7 @@
 (std::ostream & s,
  const MatrixBase<Derived> & m)
 {
-  return ei_print_matrix(s, m.eval());
+  return ei_print_matrix(s, m.eval(), EIGEN_DEFAULT_IO_FORMAT);
 }
 
 #endif // EIGEN_IO_H
--- trunk/kdesupport/eigen2/Eigen/src/Core/util/Macros.h #885516:885517
@@ -111,6 +111,10 @@
 
 #define EIGEN_RESTRICT __restrict
 
+#ifndef EIGEN_DEFAULT_IO_FORMAT
+#define EIGEN_DEFAULT_IO_FORMAT Eigen::IOFormat()
+#endif
+
 #define EIGEN_INHERIT_ASSIGNMENT_OPERATOR(Derived, Op) \
 template<typename OtherDerived> \
 Derived& operator Op(const Eigen::MatrixBase<OtherDerived>& other) \


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic