From 734dc17f0f2ecd2503e98db1e60ad17db50f7abb Mon Sep 17 00:00:00 2001 From: ESeNonFossiIo Date: Wed, 3 Jun 2015 16:00:21 +0200 Subject: [PATCH] null_operator for rectangular and square matrices --- include/deal.II/lac/linear_operator.h | 43 ++++++++++++++++++++------- 1 file changed, 33 insertions(+), 10 deletions(-) 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 { -- 2.39.5