From 1b218aae0722a57f8ce50fcddf6e1cd7d8dd5b71 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Sun, 10 May 2015 13:00:58 +0200 Subject: [PATCH] add forgotten variant --- include/deal.II/lac/linear_operator.h | 47 +++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/include/deal.II/lac/linear_operator.h b/include/deal.II/lac/linear_operator.h index 6996ab8986..f3b1c69662 100644 --- a/include/deal.II/lac/linear_operator.h +++ b/include/deal.II/lac/linear_operator.h @@ -1762,6 +1762,7 @@ namespace }; } + /** * @relates PackagedOperation * @@ -1849,6 +1850,52 @@ PackagedOperation operator-(const Range &u, const Range &v) } +/** + * @relates PackagedOperation + * + * Create a PackagedOperation object that stores the scaling of a vector + * with a @p number. + * + * The PackagedOperation object that is created stores a reference to @p u. + * Thus, the vectors must remain valid references for the whole lifetime of + * the PackagedOperation object. All changes made on @p u or @p v after the + * creation of the PackagedOperation object are reflected by the operator + * object. + * + * @ingroup LAOperators + */ +template ::type::value>::type> +PackagedOperation operator*(const Range &u, + typename Range::value_type number) +{ + return PackagedOperation(u) * number; +} + + +/** + * @relates PackagedOperation + * + * Create a PackagedOperation object that stores the scaling of a vector + * with a @p number. + * + * The PackagedOperation object that is created stores a reference to @p u. + * Thus, the vectors must remain valid references for the whole lifetime of + * the PackagedOperation object. All changes made on @p u or @p v after the + * creation of the PackagedOperation object are reflected by the operator + * object. + * + * @ingroup LAOperators + */ +template ::type::value>::type> +PackagedOperation operator*(typename Range::value_type number, + const Range &u) +{ + return number * PackagedOperation(u); +} + + /** * @relates PackagedOperation * -- 2.39.5