]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Rename print_numpy_array functions to print_as_numpy_array and 8299/head
authorBruno Turcksin <bruno.turcksin@gmail.com>
Wed, 26 Jun 2019 21:21:56 +0000 (17:21 -0400)
committerBruno Turcksin <bruno.turcksin@gmail.com>
Wed, 26 Jun 2019 21:21:56 +0000 (17:21 -0400)
print_as_numpy_array

doc/news/changes/minor/20180602BrunoTurcksin
include/deal.II/lac/la_vector.h
include/deal.II/lac/la_vector.templates.h
include/deal.II/lac/sparse_matrix.h
include/deal.II/lac/sparse_matrix.templates.h
tests/lac/la_vector_print.cc
tests/lac/sparse_matrix_print.cc

index 718facd291703e5d21a6b5b8e2df845c0a9816da..ea8c412056bf04947ee0f302852b962e35538d55 100644 (file)
@@ -1,4 +1,5 @@
-New: Add function print_numpy_array to SparseMatrix and LinearAlgebra::Vector to
-output the object in a format readable with numpy.loadtxt.
+New: Add functions SparseMatrix::print_as_numpy_arrays() and
+LinearAlgebra::Vector::print_as_numpy_array() to output the 
+object in a format readable with numpy.loadtxt.
 <br>
 (Bruno Turcksin, 2019/06/02)
index 3002f7d5a790281f835ac48391be27806f83d0d7..a4e8da0a5c8570ddc3c96e0d7583415dbc8e0512 100644 (file)
@@ -361,8 +361,8 @@ namespace LinearAlgebra
      * </code>
      */
     void
-    print_numpy_array(std::ostream &     out,
-                      const unsigned int precision = 9) const;
+    print_as_numpy_array(std::ostream &     out,
+                         const unsigned int precision = 9) const;
 
     /**
      * Write the vector en bloc to a file. This is done in a binary mode, so
index 71149db40a0ceaa0f4ee08aa1424f4169bb9f976..c2fd83948a8711a71fa306b4cf55a3d4a87b9b26 100644 (file)
@@ -564,8 +564,8 @@ namespace LinearAlgebra
 
   template <typename Number>
   void
-  Vector<Number>::print_numpy_array(std::ostream &     out,
-                                    const unsigned int precision) const
+  Vector<Number>::print_as_numpy_array(std::ostream &     out,
+                                       const unsigned int precision) const
   {
     AssertThrow(out, ExcIO());
     boost::io::ios_flags_saver restore_flags(out);
index b7e6a9b34fe189217c14ab096cb9fb34c9887a45..e1797cd7bbb271ecac2f4d040166422adcdfcba6 100644 (file)
@@ -1584,7 +1584,7 @@ public:
   print_pattern(std::ostream &out, const double threshold = 0.) const;
 
   /**
-   * Print the vector to the output stream @p out in a format that can be
+   * Print the matrix to the output stream @p out in a format that can be
    * read by numpy::readtxt(). To load the matrix in python just do
    * <code>
    *  [data, row, column] = numpy.loadtxt('my_matrix.txt')
@@ -1592,7 +1592,8 @@ public:
    * </code>
    */
   void
-  print_numpy_array(std::ostream &out, const unsigned int precision = 9) const;
+  print_as_numpy_arrays(std::ostream &     out,
+                        const unsigned int precision = 9) const;
 
   /**
    * Write the data of this object en bloc to a file. This is done in a binary
index 5af8e7e07ff6a75c81d69529042d63c446b250fb..f14692be46e7e96fa34b4a27c44ea7995d4dd0da 100644 (file)
@@ -1968,8 +1968,8 @@ SparseMatrix<number>::print_pattern(std::ostream &out,
 
 template <typename number>
 void
-SparseMatrix<number>::print_numpy_array(std::ostream &     out,
-                                        const unsigned int precision) const
+SparseMatrix<number>::print_as_numpy_arrays(std::ostream &     out,
+                                            const unsigned int precision) const
 {
   AssertThrow(out, ExcIO());
   boost::io::ios_flags_saver restore_flags(out);
index c7f23177301707bc4d93501aeaf68aac1070c37a..0062327f3a8858d2c0f2836faa7235275877758b 100644 (file)
@@ -14,7 +14,7 @@
 // ---------------------------------------------------------------------
 
 
-// Check that print_numpy_array works
+// Check that print_as_numpy_array works
 
 #include <deal.II/lac/la_vector.h>
 
@@ -30,7 +30,7 @@ print_vector()
   for (unsigned int i = 0; i < size; ++i)
     vec(i) = static_cast<number>(i);
 
-  vec.print_numpy_array(deallog.get_file_stream());
+  vec.print_as_numpy_array(deallog.get_file_stream());
 }
 
 
index 143a8fcefc029968d551d4f64a020b715e777c49..8ed3ed71ee98412a899b8a86f5b81a7b3662ad04 100644 (file)
@@ -14,7 +14,7 @@
 // ---------------------------------------------------------------------
 
 
-// Check that print_numpy_array works
+// Check that print_as_numpy_arrays works
 
 #include <deal.II/lac/sparse_matrix.h>
 #include <deal.II/lac/sparsity_pattern.h>
@@ -39,7 +39,7 @@ print_sparse_matrix()
   for (unsigned int i = 0; i < n; ++i)
     for (unsigned int j = 0; j < n; ++j)
       A.set(i, j, static_cast<number>(i + j));
-  A.print_numpy_array(deallog.get_file_stream());
+  A.print_as_numpy_arrays(deallog.get_file_stream());
 }
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.