From: Matthias Maier Date: Wed, 6 May 2015 13:34:47 +0000 (+0200) Subject: some takeouts X-Git-Tag: v8.3.0-rc1~179^2~6 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=89c0b2bf33f152abd8a5398f4fa57589155fd717;p=dealii.git some takeouts Those variants create LinearOperator or PackagedOperation by 'guessing' information - remove them. --- diff --git a/include/deal.II/lac/linear_operator.h b/include/deal.II/lac/linear_operator.h index 66f4e6d9e8..6996ab8986 100644 --- a/include/deal.II/lac/linear_operator.h +++ b/include/deal.II/lac/linear_operator.h @@ -724,34 +724,6 @@ namespace internal namespace { - // A trait class that determines whether type T provides public - // (templated or non-templated) vmult and Tvmult member functions - - template - class has_vmult - { - template - static std::false_type test(...); - - template - static std::true_type test(decltype(&C::vmult), - decltype(&C::Tvmult)); - - template - static std::true_type test(decltype(&C::template vmult), - decltype(&C::template Tvmult)); - - template - static std::true_type test(decltype(&C::template vmult), - decltype(&C::template Tvmult)); - - public: - // type is std::true_type if Matrix provides vmult and Tvmult, - // otherwise it is std::false_type - - typedef decltype(test(0, 0)) type; - }; - // A trait class that determines whether type T provides public // (templated or non-templated) vmult_add and Tvmult_add member functions @@ -1039,91 +1011,6 @@ linear_operator(const OperatorExemplar &operator_exemplar, const Matrix &matrix) return return_op; } - -/** - * @relates LinearOperator - * - * Create a LinearOperator by multiplying two matrix objects that are - * compatible with Vector. If other vector types are desired, - * explicitly wrap the matrices with linear_operator. - * - * The LinearOperator object that is created stores references to - * @p first_matrix and @p second_matrix. Thus, both objects must remain a valid - * reference for the whole lifetime of the LinearOperator object, see the - * documentation of linear_operator. - * - * @ingroup LAOperators - */ -template >, Matrix1>::value>::type, - typename = typename std::enable_if >, Matrix2>::value>::type, - typename = typename std::enable_if, Vector, Matrix1>::type::value>::type, - typename = typename std::enable_if, Vector, Matrix2>::type::value>::type> -LinearOperator, Vector > -operator*(const Matrix1 &first_matrix, - const Matrix2 &second_matrix) -{ - return linear_operator>(first_matrix) * - linear_operator>(second_matrix); -} - - -/** - * @relates LinearOperator - * - * Create a LinearOperator by multiplying a LinearOperator with a - * compatible matrix. The Domain type of the resulting LinearOperator is - * set to Vector. If other vector types are - * desired, explicitly wrap the matrix with linear_operator. - * - * The LinearOperator object that is created stores references to - * @p matrix. Thus, both @p matrix must remain a valid reference for the whole - * lifetime of the LinearOperator object, see the documentation of - * linear_operator. - * - * @ingroup LAOperators - */ -template >, Matrix>::value>::type, - typename = typename std::enable_if, Vector, Matrix>::type::value>::type> -LinearOperator > -operator*(const LinearOperator &op, - const Matrix &matrix) -{ - return op * linear_operator>(matrix); -} - - -/** - * @relates LinearOperator - * - * Create a LinearOperator by multiplying a compatible matrix with a - * LinearOperator. The Range type of the resulting LinearOperator is set to - * Vector. If other vector types are desired, explicitly wrap the - * matrix with linear_operator. - * - * The LinearOperator object that is created stores references to - * @p matrix. Thus, both @p matrix must remain a valid reference for the whole - * lifetime of the LinearOperator object, see the documentation of - * linear_operator. - * - * @ingroup LAOperators - */ -template >, Matrix>::value>::type, - typename = typename std::enable_if, Vector, Matrix>::type::value>::type> -LinearOperator, Domain> -operator*(const Matrix &matrix, - const LinearOperator &op) -{ - return linear_operator, Intermediate>(matrix) * op; -} - //@} @@ -2147,112 +2034,6 @@ operator*(const PackagedOperation &comp, return return_comp; } - -/** - * @relates PackagedOperation - * - * Create a PackagedOperation object from a reference to a matrix @p m and - * a reference to a vector @p u of the Domain space. The object stores the - * PackagedOperation $\text{m} \,u$ (in matrix notation). If a different - * result type than Domain is desired, the matrix should be - * explicitly wrapper with linear_operator instead. - * - * return (return_add) are implemented with - * vmult(_1,u) (vmult_add(_1,u)). - * - * The PackagedOperation object that is created stores references to @p u - * and @p m. Thus, both must remain valid references for the whole lifetime - * of the PackagedOperation object. All changes made on @p u or @p m after - * the creation of the PackagedOperation object are reflected by the - * operator object. - * - * @ingroup LAOperators - */ -template ::type::value>::type, - typename = typename std::enable_if, Matrix>::value>::type, - typename = typename std::enable_if::type::value>::type> -PackagedOperation -operator*(const Matrix &m, - const Domain &u) -{ - return linear_operator(m) * u; -} - - -/** - * @relates PackagedOperation - * - * Same as above, taking a packaged operation instead of a vector. - * - * @ingroup LAOperators - */ -template ::type::value>::type, - typename = typename std::enable_if, Matrix>::value>::type, - typename = typename std::enable_if::type::value>::type> -PackagedOperation -operator*(const Matrix &m, - const PackagedOperation &u) -{ - return linear_operator(m) * u; -} - - -/** - * @relates PackagedOperation - * - * Create a PackagedOperation object from a reference to a matrix @p m and - * a reference to a vector @p u of the Range space. The object stores the - * PackagedOperation $\text{m}^T \,u$ (in matrix notation). If a different - * result type than Range is desired, the matrix should be - * explicitly wrapper with linear_operator instead. - * - * return (return_add) are implemented with - * Tvmult(_1,u) (Tvmult_add(_1,u)). - * - * The PackagedOperation object that is created stores references to @p u - * and @p m. Thus, both must remain valid references for the whole lifetime - * of the PackagedOperation object. All changes made on @p u or @p m after - * the creation of the PackagedOperation object are reflected by the - * operator object. - * - * @ingroup LAOperators - */ -template ::type::value>::type, - typename = typename std::enable_if, Matrix>::value>::type, - typename = typename std::enable_if::type::value>::type> -PackagedOperation -operator*(const Range &u, - const Matrix &m) -{ - return u * linear_operator(m); -} - - -/** - * @relates PackagedOperation - * - * Same as above, taking a packaged operation instead of a vector. - * - * @ingroup LAOperators - */ -template ::type::value>::type, - typename = typename std::enable_if, Matrix>::value>::type, - typename = typename std::enable_if::type::value>::type> -PackagedOperation -operator*(const PackagedOperation &u, - const Matrix &m) -{ - return u * linear_operator(m); -} - //@} DEAL_II_NAMESPACE_CLOSE