]> https://gitweb.dealii.org/ - dealii.git/commitdiff
adjust LAPACKFullMatrix::print_formatted() to output lower triangular part for Cholesky
authorDenis Davydov <davydden@gmail.com>
Mon, 18 Dec 2017 14:19:34 +0000 (15:19 +0100)
committerDenis Davydov <davydden@gmail.com>
Tue, 19 Dec 2017 12:27:14 +0000 (13:27 +0100)
source/lac/lapack_full_matrix.cc

index bed672572a4cf73e5207c901afcc07a2a146c093..3e8246ce8a9a7f9b48491a224860c7b5928a50dc 100644 (file)
@@ -1440,7 +1440,9 @@ LAPACKFullMatrix<number>::print_formatted (
 
   for (size_type i=0; i<this->n_rows(); ++i)
     {
-      for (size_type j=0; j<this->n_cols(); ++j)
+      // Cholesky is stored in lower triangular, so just output this part:
+      const size_type nc = state == LAPACKSupport::cholesky ? i+1 : this->n_cols();
+      for (size_type j=0; j<nc; ++j)
         // we might have complex numbers, so use abs also to check for nan
         // since there is no isnan on complex numbers
         if (std::isnan(std::abs((*this)(i,j))))

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.