From f8dfbd752bba158f2a8dc6765d096a96ec3aa44d Mon Sep 17 00:00:00 2001 From: bangerth Date: Tue, 6 Nov 2007 22:07:35 +0000 Subject: [PATCH] Fix some return types of functions. git-svn-id: https://svn.dealii.org/trunk@15457 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/full_matrix.h | 36 +++++++++---------- .../lac/include/lac/full_matrix.templates.h | 16 ++++----- deal.II/lac/source/full_matrix.float.cc | 10 +++--- 3 files changed, 29 insertions(+), 33 deletions(-) diff --git a/deal.II/lac/include/lac/full_matrix.h b/deal.II/lac/include/lac/full_matrix.h index 68af9cdd83..fc4a7064b1 100644 --- a/deal.II/lac/include/lac/full_matrix.h +++ b/deal.II/lac/include/lac/full_matrix.h @@ -40,20 +40,16 @@ template class Vector; * number. 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 float and double for matrices and - * vectors. If you need more data types, the implementation of - * non-inline functions is in fullmatrix.templates.h. 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 @ and - * @; others can be generated in application programs (see the - * section on @ref Instantiations in the manual). + * @note Instantiations for this template are provided for + * @, @, @, + * @@>, @@>, + * @@>; 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 & - 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 void add (const FullMatrix &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 void Tadd (const FullMatrix &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 - double residual (Vector &dst, + number residual (Vector &dst, const Vector &x, const Vector &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::n() const template FullMatrix & -FullMatrix::operator = (const double d) +FullMatrix::operator = (const number d) { Assert (d==0, ExcScalarAssignmentOnlyForZeroValue()); diff --git a/deal.II/lac/include/lac/full_matrix.templates.h b/deal.II/lac/include/lac/full_matrix.templates.h index 40ecf0624a..b96923779b 100644 --- a/deal.II/lac/include/lac/full_matrix.templates.h +++ b/deal.II/lac/include/lac/full_matrix.templates.h @@ -124,7 +124,7 @@ FullMatrix::all_zero () const template FullMatrix & -FullMatrix::operator *= (const double factor) +FullMatrix::operator *= (const number factor) { Assert (numbers::is_finite(factor), @@ -142,7 +142,7 @@ FullMatrix::operator *= (const double factor) template FullMatrix & -FullMatrix::operator /= (const double factor) +FullMatrix::operator /= (const number factor) { Assert (numbers::is_finite(factor), @@ -376,7 +376,7 @@ void FullMatrix::Tvmult (Vector &dst, template template -double FullMatrix::residual (Vector& dst, +number FullMatrix::residual (Vector& dst, const Vector& src, const Vector& right) const { @@ -1562,7 +1562,7 @@ FullMatrix::add (const number a, template template void FullMatrix::add (const FullMatrix &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::add (const FullMatrix &src, template template void FullMatrix::Tadd (const FullMatrix &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::operator == (const FullMatrix &M) const template -double +number FullMatrix::determinant () const { Assert (!this->empty(), ExcEmptyMatrix()); @@ -1911,7 +1911,7 @@ FullMatrix::determinant () const template -double +number FullMatrix::trace () const { Assert (!this->empty(), ExcEmptyMatrix()); @@ -1919,7 +1919,7 @@ FullMatrix::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; in_rows(); ++i) tr += this->el(i,i); diff --git a/deal.II/lac/source/full_matrix.float.cc b/deal.II/lac/source/full_matrix.float.cc index 12030d4481..2ad16b567d 100644 --- a/deal.II/lac/source/full_matrix.float.cc +++ b/deal.II/lac/source/full_matrix.float.cc @@ -41,10 +41,10 @@ template void FullMatrix::add (const TYPEMAT, const FullMatri const TYPEMAT, const FullMatrix&, const TYPEMAT, const FullMatrix&); template void FullMatrix::add ( - const FullMatrix&, double, unsigned, unsigned, unsigned, unsigned); + const FullMatrix&, TYPEMAT, unsigned, unsigned, unsigned, unsigned); template void FullMatrix::Tadd (const TYPEMAT, const FullMatrix&); template void FullMatrix::Tadd ( - const FullMatrix&, double, unsigned, unsigned, unsigned, unsigned); + const FullMatrix&, TYPEMAT, unsigned, unsigned, unsigned, unsigned); template void FullMatrix::equ (const TYPEMAT, const FullMatrix&); template void FullMatrix::equ (const TYPEMAT, const FullMatrix&, const TYPEMAT, const FullMatrix&); @@ -67,7 +67,7 @@ template void FullMatrix::vmult( Vector&, const Vector&, bool) const; template void FullMatrix::Tvmult( Vector&, const Vector&, bool) const; -template double FullMatrix::residual( +template TYPEMAT FullMatrix::residual( Vector&, const Vector&, const Vector&) const; template TYPEVEC FullMatrix::matrix_norm_square ( const Vector &) const; @@ -93,7 +93,7 @@ template void FullMatrix::vmult( Vector&, const Vector&, bool) const; template void FullMatrix::Tvmult( Vector&, const Vector&, bool) const; -template double FullMatrix::residual( +template TYPEMAT FullMatrix::residual( Vector&, const Vector&, const Vector&) const; template TYPEVEC FullMatrix::matrix_norm_square ( const Vector &) const; @@ -111,7 +111,7 @@ void FullMatrix::precondition_Jacobi ( #undef TYPERES #define TYPERES float -template double FullMatrix::residual( +template TYPEMAT FullMatrix::residual( Vector&, const Vector&, const Vector&) const; DEAL_II_NAMESPACE_CLOSE -- 2.39.5