]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add two standard accessors, m() and n(), and do some cleaning.
authorToby D. Young <tyoung@ippt.pan.pl>
Thu, 3 Apr 2014 12:56:30 +0000 (12:56 +0000)
committerToby D. Young <tyoung@ippt.pan.pl>
Thu, 3 Apr 2014 12:56:30 +0000 (12:56 +0000)
git-svn-id: https://svn.dealii.org/trunk@32711 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/lac/constraint_matrix.templates.h
deal.II/include/deal.II/lac/lapack_full_matrix.h
deal.II/source/lac/lapack_full_matrix.cc

index 36c330466887a4ff15e75dc4c75a87e3b6a2be8d..2cf08a4f3d6ae53d3ae9336dad237707ad31edc4 100644 (file)
@@ -2798,7 +2798,7 @@ add_entries_local_to_global (const std::vector<size_type> &local_dof_indices,
         sparsity_pattern.add_entries(actual_dof_indices[i],
                                      actual_dof_indices.begin(),
                                      actual_dof_indices.end(),
-                                     true);
+                                   true);
 
       // need to add the whole row and column structure in case we keep
       // constrained entries. Unfortunately, we can't use the nice matrix
index ee8339ba60147e065532d2a3a82ecdbd347c35e7..ee4401d1a4ff8e8f8b615345f47142deb01a330b 100644 (file)
@@ -55,6 +55,7 @@ template <typename number>
 class LAPACKFullMatrix : public TransposeTable<number>
 {
 public:
+
   /**
    * Declare type for container size.
    */
@@ -130,6 +131,18 @@ public:
   template <class MATRIX>
   void copy_from (const MATRIX &);
 
+  /**
+   * Return the dimension of the range space. @note The matrix is of
+   * dimension \f$m \times n\f$.
+   */
+  unsigned int m () const;
+
+  /**
+   * Return the number of the range space. @note The matrix is of
+   * dimension \f$m \times n\f$.
+   */
+  unsigned int n () const;
+
   /**
    * Fill rectangular block.
    *
@@ -369,7 +382,7 @@ public:
    * system is to be performed.
    */
   void apply_lu_factorization (Vector<number> &v,
-                               const bool transposed) const;
+                               const bool      transposed) const;
 
   /**
    * Solve the linear system with multiple right hand sides (as many as there
@@ -381,7 +394,7 @@ public:
    * system is to be performed.
    */
   void apply_lu_factorization (LAPACKFullMatrix<number> &B,
-                               const bool transposed) const;
+                               const bool                transposed) const;
 
   /**
    * Compute eigenvalues of the matrix. After this routine has been called,
@@ -402,7 +415,7 @@ public:
    * @note Calls the LAPACK function Xgeev.
    */
   void compute_eigenvalues (const bool right_eigenvectors = false,
-                            const bool left_eigenvectors = false);
+                            const bool left_eigenvectors  = false);
 
   /**
    * Compute eigenvalues and eigenvectors of a real symmetric matrix. Only
@@ -422,12 +435,11 @@ public:
    * @note Calls the LAPACK function Xsyevx. For this to work, ./configure has
    * to be told to use LAPACK.
    */
-  void compute_eigenvalues_symmetric(
-    const number lower_bound,
-    const number upper_bound,
-    const number abs_accuracy,
-    Vector<number> &eigenvalues,
-    FullMatrix<number> &eigenvectors);
+  void compute_eigenvalues_symmetric (const number        lower_bound,
+                                     const number        upper_bound,
+                                     const number        abs_accuracy,
+                                     Vector<number>     &eigenvalues,
+                                     FullMatrix<number> &eigenvectors);
 
   /**
    * Compute generalized eigenvalues and eigenvectors of a real generalized
@@ -450,15 +462,14 @@ public:
    * @note Calls the LAPACK function Xsygvx. For this to work, ./configure has
    * to be told to use LAPACK.
    */
-  void compute_generalized_eigenvalues_symmetric(
-    LAPACKFullMatrix<number> &B,
-    const number lower_bound,
-    const number upper_bound,
-    const number abs_accuracy,
-    Vector<number> &eigenvalues,
-    std::vector<Vector<number> > &eigenvectors,
-    const int itype = 1);
-
+  void compute_generalized_eigenvalues_symmetric (LAPACKFullMatrix<number>     &B,
+                                                 const number                  lower_bound,
+                                                 const number                  upper_bound,
+                                                 const number                  abs_accuracy,
+                                                 Vector<number>               &eigenvalues,
+                                                 std::vector<Vector<number> > &eigenvectors,
+                                                 const int                     itype = 1);
+  
   /**
    * Same as the other compute_generalized_eigenvalues_symmetric function
    * except that all eigenvalues are computed and the tolerance is set
@@ -475,10 +486,9 @@ public:
    * @note Calls the LAPACK function Xsygv. For this to work, ./configure has
    * to be told to use LAPACK.
    */
-  void compute_generalized_eigenvalues_symmetric (
-    LAPACKFullMatrix<number> &B,
-    std::vector<Vector<number> > &eigenvectors,
-    const int itype = 1);
+  void compute_generalized_eigenvalues_symmetric (LAPACKFullMatrix<number>     &B,
+                                                 std::vector<Vector<number> > &eigenvectors,
+                                                 const int                     itype = 1);
 
   /**
    * Compute the singular value decomposition of the matrix using LAPACK
@@ -488,7 +498,7 @@ public:
    * #wr, #svd_u, and #svd_vt, and leaves the object in the #state
    * LAPACKSupport::svd.
    */
-  void compute_svd();
+  void compute_svd ();
 
   /**
    * Compute the inverse of the matrix by singular value decomposition.
@@ -555,9 +565,6 @@ public:
                         const double        threshold   = 0.) const;
 
 private:
-  /**
-   * n_rows
-   */
 
   /**
    * Since LAPACK operations notoriously change the meaning of the matrix
@@ -651,7 +658,23 @@ private:
   SmartPointer<VectorMemory<Vector<number> >,PreconditionLU<number> > mem;
 };
 
+/*---------------------- Inline functions -----------------------------------*/
+
+template <typename number>
+inline 
+unsigned int 
+LAPACKFullMatrix<number>::m () const
+{
+  return this->n_rows ();
+}
 
+template <typename number>
+inline 
+unsigned int 
+LAPACKFullMatrix<number>::n () const
+{
+  return this->n_cols ();
+}
 
 template <typename number>
 template <class MATRIX>
index 98aa0a1d52dcc967b83f113c6126f07b3b56eefb..d1080d946bbe5a8a6aa63683c19af620b5b7c01d 100644 (file)
@@ -744,7 +744,7 @@ LAPACKFullMatrix<number>::compute_eigenvalues_symmetric(const number        lowe
       size_type col_begin(i*nn);
       for (size_type j=0; j < static_cast<size_type> (nn); ++j)
         {
-          eigenvectors(j,i) = values_eigenvectors[col_begin+j];
+          eigenvectors(i,j) = values_eigenvectors[col_begin+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.