]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Restrict LAPACKFullMatrix::print_formatted to matrix states 4082/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Sat, 18 Mar 2017 16:50:32 +0000 (17:50 +0100)
committerDaniel Arndt <d.arndt@math.uni-goettingen.de>
Sun, 19 Mar 2017 15:57:14 +0000 (16:57 +0100)
doc/news/changes/incompatibilities/20170318DanielArndt [new file with mode: 0644]
include/deal.II/lac/lapack_full_matrix.h
include/deal.II/lac/lapack_support.h
source/lac/lapack_full_matrix.cc

diff --git a/doc/news/changes/incompatibilities/20170318DanielArndt b/doc/news/changes/incompatibilities/20170318DanielArndt
new file mode 100644 (file)
index 0000000..f344ef5
--- /dev/null
@@ -0,0 +1,4 @@
+Changed: LAPACKFullMatrix::print_formatted is only allowed
+if the state is 'matrix' or 'inverse_matrix'.
+<br>
+(Daniel Arndt, 2017/03/18)
index e31861687e80e28066aebb3cc1e2260e3112d385..24d80a09a92b7e657eefd9c2eff0c94f67877d51 100644 (file)
@@ -592,6 +592,10 @@ public:
    *
    * @arg <tt>threshold</tt>: all entries with absolute value smaller than
    * this are considered zero.
+   *
+   * @note The entries stored resemble a matrix only if the state is either
+   * LAPACKSupport::matrix or LAPACK::inverse_matrix. Otherwise, calling this
+   * function is not allowed.
    */
   void print_formatted (std::ostream       &out,
                         const unsigned int  precision   = 3,
index 193c63da1192e0ee24905681c5ba1900e2858129..a507df2c14b96f6fab73e20e316ceb1b234302e6 100644 (file)
@@ -26,9 +26,12 @@ DEAL_II_NAMESPACE_OPEN
 namespace LAPACKSupport
 {
   /**
-   * Most LAPACK functions change the contents of the matrix applied to to
-   * something which is not a matrix anymore. Therefore, LAPACK matrix classes
-   * in <tt>deal.II</tt> have a state flag indicating what happened to them.
+   * Most of the LAPACK functions one can apply to a matrix (e.g., by calling
+   * the member functions of this class) change its content in some ways. For
+   * example, they may invert the matrix, or may replace it by a matrix whose
+   * columns represent the eigenvectors of the original content of the matrix.
+   * The elements of this enumeration are therefore used to track what is
+   * currently being stored by this object.
    *
    * @author Guido Kanschat, 2005
    */
index ad272cc9aa966265444be84dd14dc126a72b7ab9..473167f90a23a0fbdae9efddb9473328cc0d8c31 100644 (file)
@@ -985,6 +985,9 @@ LAPACKFullMatrix<number>::print_formatted (
 
   Assert ((!this->empty()) || (this->n_cols()+this->n_rows()==0),
           ExcInternalError());
+  Assert (state == LAPACKSupport::matrix ||
+          state == LAPACKSupport::inverse_matrix,
+          ExcState(state));
 
   // set output format, but store old
   // state

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.