From: Matthias Maier Date: Sun, 10 May 2015 11:00:58 +0000 (+0200) Subject: add forgotten variant X-Git-Tag: v8.3.0-rc1~179^2~5 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1b218aae0722a57f8ce50fcddf6e1cd7d8dd5b71;p=dealii.git add forgotten variant --- 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 *