From: ESeNonFossiIo Date: Wed, 3 Jun 2015 14:00:21 +0000 (+0200) Subject: null_operator for rectangular and square matrices X-Git-Tag: v8.3.0-rc1~128^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=734dc17f0f2ecd2503e98db1e60ad17db50f7abb;p=dealii.git null_operator for rectangular and square matrices --- diff --git a/include/deal.II/lac/linear_operator.h b/include/deal.II/lac/linear_operator.h index 5992a91765..a30e1bda1d 100644 --- a/include/deal.II/lac/linear_operator.h +++ b/include/deal.II/lac/linear_operator.h @@ -685,24 +685,26 @@ identity_operator(const std::function &reinit_vector) /** * @relates LinearOperator * - * Returns a LinearOperator that is the null operator of the vector space - * @p Range. + * Returns a LinearOperator that is the null operator + * from the vector space @p Domain to the vector space @p Range. * - * The function takes an std::function object @ref - * reinit_vector as an argument to initialize the + * The function takes two std::function objects @ref + * reinit_range_vector and reinit_domain_vector as arguments to initialize the * reinit_range_vector and reinit_domain_vector * objects of the LinearOperator object. * * @ingroup LAOperators */ -template -LinearOperator -null_operator(const std::function &reinit_vector) +template +LinearOperator +null_operator(const std::function &reinit_domain_vector, + const std::function &reinit_range_vector) { - LinearOperator return_op; + LinearOperator return_op; - return_op.reinit_range_vector = reinit_vector; - return_op.reinit_domain_vector = reinit_vector; + return_op.reinit_domain_vector = reinit_domain_vector; + return_op.reinit_range_vector = reinit_range_vector; return_op.vmult = [](Range &v, const Range &u) { @@ -723,6 +725,27 @@ null_operator(const std::function &reinit_vector) return return_op; } +/** + * @relates LinearOperator + * + * Returns a LinearOperator that is the null operator + * of the vector space @p Range. (It is a specification of the previous + * function in the case of square matrices) + * + * The function takes an std::function object @ref + * reinit_vector as an argument to initialize the + * reinit_range_vector and reinit_domain_vector + * objects of the LinearOperator object. + * + * @ingroup LAOperators + */ +template +LinearOperator +null_operator(const std::function &reinit_vector) +{ + return null_operator(reinit_vector, reinit_vector); +} + namespace internal {