aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/IO.h
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-11-17 12:45:57 +0000
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-11-17 12:45:57 +0000
commit3614321401680d7313406abe53a1b2208d62a6a5 (patch)
treecde2d5961002448d1eb30811ed72965b56a8a086 /Eigen/src/Core/IO.h
parent139529e97b76c250c13474a1ebc9f6dbf27b6115 (diff)
* add Gael a (c) line in IO.h
* let user change default format by defining EIGEN_DEFAULT_IO_FORMAT * improve docs a little
Diffstat (limited to 'Eigen/src/Core/IO.h')
-rw-r--r--Eigen/src/Core/IO.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/Eigen/src/Core/IO.h b/Eigen/src/Core/IO.h
index e997ed205..fe5af260f 100644
--- a/Eigen/src/Core/IO.h
+++ b/Eigen/src/Core/IO.h
@@ -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 @@ MatrixBase<Derived>::format(const IOFormat& fmt) const
/** \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,8 +163,12 @@ std::ostream & ei_print_matrix(std::ostream & s, const MatrixBase<Derived> & _m,
/** \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()
*/
@@ -173,7 +177,7 @@ std::ostream & operator <<
(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