From cf48a7e18da0167dff67014efedb930024613791 Mon Sep 17 00:00:00 2001 From: Guido Kanschat Date: Mon, 22 Jan 2001 16:42:58 +0000 Subject: [PATCH] preparation for unit points git-svn-id: https://svn.dealii.org/trunk@3763 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/full_matrix.h | 9 +++++++++ deal.II/lac/include/lac/full_matrix.templates.h | 10 ++++++++++ deal.II/lac/source/full_matrix.double.cc | 2 ++ deal.II/lac/source/full_matrix.float.cc | 2 ++ 4 files changed, 23 insertions(+) diff --git a/deal.II/lac/include/lac/full_matrix.h b/deal.II/lac/include/lac/full_matrix.h index 9a035a2957..19c9b94fd6 100644 --- a/deal.II/lac/include/lac/full_matrix.h +++ b/deal.II/lac/include/lac/full_matrix.h @@ -156,6 +156,15 @@ class FullMatrix : public Subscriptor const unsigned int i=0, const unsigned int j=0); + + /** + * Fill matrix with an array of numbers. + * The array is arranged line by line. No + * range checking is performed. + */ + template + void fill (const number2* entries); + /** * Set dimension to $m\times n$ and * allocate memory if necessary. Forget diff --git a/deal.II/lac/include/lac/full_matrix.templates.h b/deal.II/lac/include/lac/full_matrix.templates.h index 477778d13b..0ab5ded09e 100644 --- a/deal.II/lac/include/lac/full_matrix.templates.h +++ b/deal.II/lac/include/lac/full_matrix.templates.h @@ -457,6 +457,16 @@ void FullMatrix::fill (const FullMatrix& src, } +template +template +void FullMatrix::fill (const number2* entries) +{ + if (dim_range*dim_image != 0) + std::copy (entries, entries+dim_image*dim_range, val); +} + + + template void FullMatrix::add_row (const unsigned int i, const number s, diff --git a/deal.II/lac/source/full_matrix.double.cc b/deal.II/lac/source/full_matrix.double.cc index af01bed87e..f7a2ff1dd1 100644 --- a/deal.II/lac/source/full_matrix.double.cc +++ b/deal.II/lac/source/full_matrix.double.cc @@ -34,6 +34,7 @@ template void FullMatrix::add_diag (const TYPEMAT, const FullMatrix::fill (const TYPEVEC*); template void FullMatrix::vmult(Vector&, const Vector&, const bool) const; template void FullMatrix::Tvmult(Vector&, const Vector&, const bool) const; template double FullMatrix::residual(Vector&, const Vector&, const Vector&) const; @@ -47,6 +48,7 @@ template double FullMatrix::least_squares(Vector&, Vector::fill (const TYPEVEC*); template void FullMatrix::vmult(Vector&, const Vector&, const bool) const; template void FullMatrix::Tvmult(Vector&, const Vector&, const bool) const; template double FullMatrix::residual(Vector&, const Vector&, const Vector&) const; diff --git a/deal.II/lac/source/full_matrix.float.cc b/deal.II/lac/source/full_matrix.float.cc index 3ad09c4b29..684ff616d7 100644 --- a/deal.II/lac/source/full_matrix.float.cc +++ b/deal.II/lac/source/full_matrix.float.cc @@ -33,6 +33,7 @@ template void FullMatrix::add_diag (const TYPEMAT, const FullMatrix::fill (const TYPEVEC*); template void FullMatrix::vmult(Vector&, const Vector&, const bool) const; template void FullMatrix::Tvmult(Vector&, const Vector&, const bool) const; template double FullMatrix::residual(Vector&, const Vector&, const Vector&) const; @@ -46,6 +47,7 @@ template double FullMatrix::least_squares(Vector&, Vector::fill (const TYPEVEC*); template void FullMatrix::vmult(Vector&, const Vector&, const bool) const; template void FullMatrix::Tvmult(Vector&, const Vector&, const bool) const; template double FullMatrix::residual(Vector&, const Vector&, const Vector&) const; -- 2.39.5