]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix some return types of functions.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 6 Nov 2007 22:07:35 +0000 (22:07 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 6 Nov 2007 22:07:35 +0000 (22:07 +0000)
git-svn-id: https://svn.dealii.org/trunk@15457 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/full_matrix.h
deal.II/lac/include/lac/full_matrix.templates.h
deal.II/lac/source/full_matrix.float.cc

index 68af9cdd83a426438d74690af6c72ab8a2b81a3d..fc4a7064b1fd922ea78304a52d925fe1b0897165 100644 (file)
@@ -40,20 +40,16 @@ template<typename number> class Vector;
  * <tt>number</tt>.  The interface is quite fat and in fact has grown every
  * time a new feature was needed. So, a lot of functions are provided.
  *
- * Since the instantiation of this template is quite an effort,
- * standard versions are precompiled into the library. These include
- * all combinations of <tt>float</tt> and <tt>double</tt> for matrices and
- * vectors. If you need more data types, the implementation of
- * non-inline functions is in <tt>fullmatrix.templates.h</tt>. Driver files
- * are in the source tree.
- *
  * Internal calculations are usually done with the accuracy of the
  * vector argument to functions. If there is no argument with a number
  * type, the matrix number type is used.
  *
- * @note Instantiations for this template are provided for <tt>@<float@> and
- * @<double@></tt>; others can be generated in application programs (see the
- * section on @ref Instantiations in the manual).
+ * @note Instantiations for this template are provided for
+ * <tt>@<float@>, @<double@>, @<long double@>,
+ * @<std::complex@<float@>@>, @<std::complex@<double@>@>,
+ * @<std::complex@<long double@>@></tt>; others can be generated in
+ * application programs (see the section on @ref Instantiations in the
+ * manual).
  *
  * @author Guido Kanschat, Franz-Theo Suttmeier, Wolfgang Bangerth, 1993-2004
  */
@@ -294,7 +290,7 @@ class FullMatrix : public Table<2,number>
                                      * way.
                                      */
     FullMatrix<number> &
-    operator = (const double d);
+    operator = (const number d);
 
                                     /**
                                      * Copy operator to create a full
@@ -511,7 +507,7 @@ class FullMatrix : public Table<2,number>
                                       * Obviously, the matrix needs to
                                       * be quadratic for this function.
                                       */
-    double determinant () const;
+    number determinant () const;
 
                                     /**
                                      * Return the trace of the matrix,
@@ -521,7 +517,7 @@ class FullMatrix : public Table<2,number>
                                       * Obviously, the matrix needs to
                                       * be quadratic for this function.
                                       */
-    double trace () const;
+    number trace () const;
     
                                     /**
                                      * Output of the matrix in
@@ -622,13 +618,13 @@ class FullMatrix : public Table<2,number>
                                      * Scale the entire matrix by a
                                      * fixed factor.
                                      */
-    FullMatrix & operator *= (const double factor);
+    FullMatrix & operator *= (const number factor);
 
                                     /**
                                      * Scale the entire matrix by the
                                      * inverse of the given factor.
                                      */
-    FullMatrix & operator /= (const double factor);
+    FullMatrix & operator /= (const number factor);
     
                                      /**
                                      * Simple addition of a scaled
@@ -706,7 +702,7 @@ class FullMatrix : public Table<2,number>
                                      */
     template<typename number2>
     void add (const FullMatrix<number2> &src,
-             const double factor,
+             const number factor,
              const unsigned int dst_offset_i = 0,
              const unsigned int dst_offset_j = 0,
              const unsigned int src_offset_i = 0,
@@ -747,7 +743,7 @@ class FullMatrix : public Table<2,number>
                                      */
     template<typename number2>
     void Tadd (const FullMatrix<number2> &src,
-              const double factor,
+              const number               factor,
               const unsigned int dst_offset_i = 0,
               const unsigned int dst_offset_j = 0,
               const unsigned int src_offset_i = 0,
@@ -1041,7 +1037,7 @@ class FullMatrix : public Table<2,number>
                                       * vector.
                                      */
     template<typename number2, typename number3>
-    double residual (Vector<number2>       &dst,
+    number residual (Vector<number2>       &dst,
                     const Vector<number2> &x,
                     const Vector<number3> &b) const;
 
@@ -1094,7 +1090,7 @@ class FullMatrix : public Table<2,number>
                                      * Exception
                                      */
     DeclException1 (ExcNotRegular,
-                   double,
+                   number,
                    << "The maximal pivot is " << arg1
                    << ", which is below the threshold. The matrix may be singular.");
                                     /**
@@ -1144,7 +1140,7 @@ FullMatrix<number>::n() const
 
 template <typename number>
 FullMatrix<number> &
-FullMatrix<number>::operator = (const double d)
+FullMatrix<number>::operator = (const number d)
 {
   Assert (d==0, ExcScalarAssignmentOnlyForZeroValue());
 
index 40ecf0624a4e7f3f95c32fc3ffeea0a387b040ea..b96923779b42a8870d9e9b7d8b5fadde4343897c 100644 (file)
@@ -124,7 +124,7 @@ FullMatrix<number>::all_zero () const
 
 template <typename number>
 FullMatrix<number> &
-FullMatrix<number>::operator *= (const double factor)
+FullMatrix<number>::operator *= (const number factor)
 {
 
   Assert (numbers::is_finite(factor), 
@@ -142,7 +142,7 @@ FullMatrix<number>::operator *= (const double factor)
 
 template <typename number>
 FullMatrix<number> &
-FullMatrix<number>::operator /= (const double factor)
+FullMatrix<number>::operator /= (const number factor)
 {
 
   Assert (numbers::is_finite(factor), 
@@ -376,7 +376,7 @@ void FullMatrix<number>::Tvmult (Vector<number2>       &dst,
 
 template <typename number>
 template <typename number2, typename number3>
-double FullMatrix<number>::residual (Vector<number2>& dst,
+number FullMatrix<number>::residual (Vector<number2>& dst,
                                     const Vector<number2>& src,
                                     const Vector<number3>& right) const
 {
@@ -1562,7 +1562,7 @@ FullMatrix<number>::add (const number               a,
 template <typename number>
 template <typename number2>
 void FullMatrix<number>::add (const FullMatrix<number2> &src,
-                             const double factor,
+                             const number factor,
                              const unsigned int dst_offset_i,
                              const unsigned int dst_offset_j,
                              const unsigned int src_offset_i,
@@ -1587,7 +1587,7 @@ void FullMatrix<number>::add (const FullMatrix<number2> &src,
 template <typename number>
 template <typename number2>
 void FullMatrix<number>::Tadd (const FullMatrix<number2> &src,
-                             const double factor,
+                             const number factor,
                              const unsigned int dst_offset_i,
                              const unsigned int dst_offset_j,
                              const unsigned int src_offset_i,
@@ -1881,7 +1881,7 @@ FullMatrix<number>::operator == (const FullMatrix<number> &M) const
 
 
 template <typename number>
-double
+number
 FullMatrix<number>::determinant () const
 {
   Assert (!this->empty(), ExcEmptyMatrix());
@@ -1911,7 +1911,7 @@ FullMatrix<number>::determinant () const
 
 
 template <typename number>
-double
+number
 FullMatrix<number>::trace () const
 {
   Assert (!this->empty(), ExcEmptyMatrix());
@@ -1919,7 +1919,7 @@ FullMatrix<number>::trace () const
   Assert (this->n_cols() == this->n_rows(),
          ExcDimensionMismatch(this->n_cols(), this->n_rows()));
 
-  double tr = 0;
+  number tr = 0;
   for (unsigned int i=0; i<this->n_rows(); ++i)
     tr += this->el(i,i);
 
index 12030d44816a63dab5d5fb5b8435cd0b4f60b91d..2ad16b567d2d348cea04a03aef40363bf4a6719a 100644 (file)
@@ -41,10 +41,10 @@ template void FullMatrix<TYPEMAT>::add<TYPEMAT2> (const TYPEMAT, const FullMatri
                                                  const TYPEMAT, const FullMatrix<TYPEMAT2>&,
                                                  const TYPEMAT, const FullMatrix<TYPEMAT2>&);
 template void FullMatrix<TYPEMAT>::add<TYPEMAT2> (
-  const FullMatrix<TYPEMAT2>&, double, unsigned, unsigned, unsigned, unsigned);
+  const FullMatrix<TYPEMAT2>&, TYPEMAT, unsigned, unsigned, unsigned, unsigned);
 template void FullMatrix<TYPEMAT>::Tadd<TYPEMAT2> (const TYPEMAT, const FullMatrix<TYPEMAT2>&);
 template void FullMatrix<TYPEMAT>::Tadd<TYPEMAT2> (
-  const FullMatrix<TYPEMAT2>&, double, unsigned, unsigned, unsigned, unsigned);
+  const FullMatrix<TYPEMAT2>&, TYPEMAT, unsigned, unsigned, unsigned, unsigned);
 template void FullMatrix<TYPEMAT>::equ<TYPEMAT2> (const TYPEMAT, const FullMatrix<TYPEMAT2>&);
 template void FullMatrix<TYPEMAT>::equ<TYPEMAT2> (const TYPEMAT, const FullMatrix<TYPEMAT2>&,
                                                  const TYPEMAT, const FullMatrix<TYPEMAT2>&);
@@ -67,7 +67,7 @@ template void FullMatrix<TYPEMAT>::vmult<TYPEVEC>(
   Vector<TYPEVEC>&, const Vector<TYPEVEC>&, bool) const;
 template void FullMatrix<TYPEMAT>::Tvmult<TYPEVEC>(
   Vector<TYPEVEC>&, const Vector<TYPEVEC>&, bool) const;
-template double FullMatrix<TYPEMAT>::residual<TYPEVEC>(
+template TYPEMAT FullMatrix<TYPEMAT>::residual<TYPEVEC>(
   Vector<TYPEVEC>&, const Vector<TYPEVEC>&, const Vector<TYPERES>&) const;
 template TYPEVEC FullMatrix<TYPEMAT>::matrix_norm_square<TYPEVEC> (
   const Vector<TYPEVEC> &) const;
@@ -93,7 +93,7 @@ template void FullMatrix<TYPEMAT>::vmult<TYPEVEC>(
   Vector<TYPEVEC>&, const Vector<TYPEVEC>&, bool) const;
 template void FullMatrix<TYPEMAT>::Tvmult<TYPEVEC>(
   Vector<TYPEVEC>&, const Vector<TYPEVEC>&, bool) const;
-template double FullMatrix<TYPEMAT>::residual<TYPEVEC>(
+template TYPEMAT FullMatrix<TYPEMAT>::residual<TYPEVEC>(
   Vector<TYPEVEC>&, const Vector<TYPEVEC>&, const Vector<TYPERES>&) const;
 template TYPEVEC FullMatrix<TYPEMAT>::matrix_norm_square<TYPEVEC> (
   const Vector<TYPEVEC> &) const;
@@ -111,7 +111,7 @@ void FullMatrix<TYPEMAT>::precondition_Jacobi<TYPEVEC> (
 #undef TYPERES
 #define TYPERES float
 
-template double FullMatrix<TYPEMAT>::residual<TYPEVEC,TYPERES>(
+template TYPEMAT FullMatrix<TYPEMAT>::residual<TYPEVEC,TYPERES>(
   Vector<TYPEVEC>&, const Vector<TYPEVEC>&, const Vector<TYPERES>&) const;
 
 DEAL_II_NAMESPACE_CLOSE

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.