From a4f285ea92f524852cd45a510590e19c1241fdc9 Mon Sep 17 00:00:00 2001 From: Caleb Schilly Date: Fri, 13 Dec 2024 11:55:42 -0500 Subject: [PATCH] #33: remove epetra from pressio-ops --- .github/workflows/ci-trilinos.yml | 4 - docs/source/components/ops.rst | 4 - docs/source/components/ops/abs.rst | 2 - docs/source/components/ops/clone.rst | 4 +- docs/source/components/ops/deep_copy.rst | 2 - docs/source/components/ops/dot.rst | 2 - .../components/ops/elementwise_multiply.rst | 2 - docs/source/components/ops/extent.rst | 2 - docs/source/components/ops/fill.rst | 2 - .../components/ops/matrix_matrix_product.rst | 2 - .../components/ops/matrix_vector_product.rst | 5 - docs/source/components/ops/scale.rst | 2 - docs/source/components/ops/set_zero.rst | 2 - docs/source/components/ops/update.rst | 2 - docs/source/components/type_traits.rst | 4 - include/pressio/ops.hpp | 21 - include/pressio/ops/epetra/ops_abs.hpp | 68 --- include/pressio/ops/epetra/ops_clone.hpp | 65 --- include/pressio/ops/epetra/ops_deep_copy.hpp | 66 --- include/pressio/ops/epetra/ops_dot.hpp | 98 ---- .../ops/epetra/ops_elementwise_multiply.hpp | 85 ---- include/pressio/ops/epetra/ops_extent.hpp | 79 ---- include/pressio/ops/epetra/ops_fill.hpp | 67 --- include/pressio/ops/epetra/ops_level2.hpp | 338 -------------- include/pressio/ops/epetra/ops_level3.hpp | 255 ----------- include/pressio/ops/epetra/ops_min_max.hpp | 107 ----- .../ops/epetra/ops_multi_vector_update.hpp | 110 ----- include/pressio/ops/epetra/ops_norms.hpp | 93 ---- include/pressio/ops/epetra/ops_pow.hpp | 117 ----- .../pressio/ops/epetra/ops_rank1_update.hpp | 280 ------------ include/pressio/ops/epetra/ops_scale.hpp | 81 ---- include/pressio/ops/epetra/ops_set_zero.hpp | 66 --- include/pressio/ops_macros.hpp | 6 - include/pressio/type_traits.hpp | 2 - .../native_epetra_multi_vector.hpp | 72 --- .../type_traits/native_epetra_vector.hpp | 73 --- include/pressio/type_traits/traits_tpl.hpp | 22 - tests/cmake/options.cmake | 6 - tests/ops/CMakeLists.txt | 14 - tests/ops/fixtures/epetra_only_fixtures.hpp | 123 ----- tests/ops/ops_epetra_level2.cc | 233 ---------- tests/ops/ops_epetra_level3.cc | 130 ------ tests/ops/ops_epetra_multi_vector.cc | 155 ------- tests/ops/ops_epetra_vector.cc | 431 ------------------ tests/type_traits/CMakeLists.txt | 5 - tests/type_traits/traits_eigen.cc | 1 - tests/type_traits/traits_epetra.cc | 57 --- tests/type_traits/traits_kokkos.cc | 1 - tests/type_traits/traits_shared.hpp | 10 - tests/type_traits/traits_teuchos.cc | 1 - tests/type_traits/traits_tpetra.cc | 1 - tests/type_traits/traits_tpetra_block.cc | 1 - 52 files changed, 1 insertion(+), 3380 deletions(-) delete mode 100644 include/pressio/ops/epetra/ops_abs.hpp delete mode 100644 include/pressio/ops/epetra/ops_clone.hpp delete mode 100644 include/pressio/ops/epetra/ops_deep_copy.hpp delete mode 100644 include/pressio/ops/epetra/ops_dot.hpp delete mode 100644 include/pressio/ops/epetra/ops_elementwise_multiply.hpp delete mode 100644 include/pressio/ops/epetra/ops_extent.hpp delete mode 100644 include/pressio/ops/epetra/ops_fill.hpp delete mode 100644 include/pressio/ops/epetra/ops_level2.hpp delete mode 100644 include/pressio/ops/epetra/ops_level3.hpp delete mode 100644 include/pressio/ops/epetra/ops_min_max.hpp delete mode 100644 include/pressio/ops/epetra/ops_multi_vector_update.hpp delete mode 100644 include/pressio/ops/epetra/ops_norms.hpp delete mode 100644 include/pressio/ops/epetra/ops_pow.hpp delete mode 100644 include/pressio/ops/epetra/ops_rank1_update.hpp delete mode 100644 include/pressio/ops/epetra/ops_scale.hpp delete mode 100644 include/pressio/ops/epetra/ops_set_zero.hpp delete mode 100644 include/pressio/type_traits/native_epetra_multi_vector.hpp delete mode 100644 include/pressio/type_traits/native_epetra_vector.hpp delete mode 100644 tests/ops/fixtures/epetra_only_fixtures.hpp delete mode 100644 tests/ops/ops_epetra_level2.cc delete mode 100644 tests/ops/ops_epetra_level3.cc delete mode 100644 tests/ops/ops_epetra_multi_vector.cc delete mode 100644 tests/ops/ops_epetra_vector.cc delete mode 100644 tests/type_traits/traits_epetra.cc diff --git a/.github/workflows/ci-trilinos.yml b/.github/workflows/ci-trilinos.yml index d862920..0e07b16 100644 --- a/.github/workflows/ci-trilinos.yml +++ b/.github/workflows/ci-trilinos.yml @@ -27,9 +27,6 @@ jobs: build_type: - Release - Debug - epetra_toggle: - - ON - - OFF runs-on: ubuntu-latest container: ghcr.io/pressio/${{ matrix.image }}:${{ matrix.tag }} @@ -61,7 +58,6 @@ jobs: -D PRESSIO_ENABLE_TPL_EIGEN:BOOL=ON \ -D PRESSIO_ENABLE_TPL_MPI:BOOL=ON \ -D PRESSIO_ENABLE_TPL_TRILINOS:BOOL=ON \ - -D PRESSIO_ENABLE_EPETRA:BOOL=${{ matrix.epetra_toggle }} \ -D PRESSIO_ENABLE_TPL_KOKKOS:BOOL=ON \ -D EIGEN_INCLUDE_DIR=/eigen/eigen-${{ env.eigen_version }} \ -D Trilinos_DIR=${{ env.trilinos_dir }}/lib/cmake/Trilinos \ diff --git a/docs/source/components/ops.rst b/docs/source/components/ops.rst index 841a88d..db17573 100644 --- a/docs/source/components/ops.rst +++ b/docs/source/components/ops.rst @@ -35,10 +35,6 @@ All expressions are within the ``pressio`` namespace. - ``is_vector_kokkos::value`` - ``is_dense_matrix_kokkos::value``, ``is_sparse_matrix_kokkos::value`` - * - Epetra - - ``is_vector_epetra::value`` - - ``is_multi_vector_epetra::value`` - * - Tpetra - ``is_vector_tpetra::value`` - ``is_multi_vector_tpetra::value`` diff --git a/docs/source/components/ops/abs.rst b/docs/source/components/ops/abs.rst index c7767ae..8476239 100644 --- a/docs/source/components/ops/abs.rst +++ b/docs/source/components/ops/abs.rst @@ -33,8 +33,6 @@ Description * a Tpetra block vector - * a Epetra vector - * a Pressio expression, i.e. ``pressio::diag``, ``pressio::span``, ``pressio::subspan``, based on Eigen or Kokkos container Notes diff --git a/docs/source/components/ops/clone.rst b/docs/source/components/ops/clone.rst index 5dcbd86..29fe288 100644 --- a/docs/source/components/ops/clone.rst +++ b/docs/source/components/ops/clone.rst @@ -36,8 +36,6 @@ Description * a Teuchos vector - * or an Epetra vector or multi-vector - * or a Tpetra vector or multi-vector * or a Tpetra block vector or multi-vector @@ -56,7 +54,7 @@ Notes And any operation applied to ``result`` will not have any impact on ``operand``. * For types that have value semantics, for example ``Eigen::Matrix<...>``, - Epetra vector or MV, this kernel can be implemented by calling the copy constructor + this kernel can be implemented by calling the copy constructor and returning the copy * For Kokkos, Tpetra, or TpetraBlock data types, which by default have view semantics diff --git a/docs/source/components/ops/deep_copy.rst b/docs/source/components/ops/deep_copy.rst index 40481b8..416c7a7 100644 --- a/docs/source/components/ops/deep_copy.rst +++ b/docs/source/components/ops/deep_copy.rst @@ -37,8 +37,6 @@ Description * a Tpetra block vector or multi-vector - * a Epetra vector or multi-vector - Notes ----- diff --git a/docs/source/components/ops/dot.rst b/docs/source/components/ops/dot.rst index d6902c6..3fe65c2 100644 --- a/docs/source/components/ops/dot.rst +++ b/docs/source/components/ops/dot.rst @@ -37,8 +37,6 @@ Description * a Tpetra block vector - * a Epetra vector - * a pressio expression, i.e. ``pressio::diag``, ``pressio::span``, ``pressio::subspan``, based on Eigen or Kokkos container Notes diff --git a/docs/source/components/ops/elementwise_multiply.rst b/docs/source/components/ops/elementwise_multiply.rst index 7c35179..9309369 100644 --- a/docs/source/components/ops/elementwise_multiply.rst +++ b/docs/source/components/ops/elementwise_multiply.rst @@ -38,8 +38,6 @@ Description * a Tpetra block vector - * a Epetra vector - * a pressio expression, i.e. ``pressio::diag``, ``pressio::span``, ``pressio::subspan``, based on Eigen or Kokkos container Notes diff --git a/docs/source/components/ops/extent.rst b/docs/source/components/ops/extent.rst index 3d65644..17e8862 100644 --- a/docs/source/components/ops/extent.rst +++ b/docs/source/components/ops/extent.rst @@ -34,8 +34,6 @@ Description * a Tpetra block vector or multi-vector - * a Epetra vector or multi-vector - * a pressio expression, i.e. ``pressio::diag``, ``pressio::span``, ``pressio::subspan``, based on an Eigen, Tpetra Block, or Kokkos container Notes diff --git a/docs/source/components/ops/fill.rst b/docs/source/components/ops/fill.rst index 79a17a9..b805da1 100644 --- a/docs/source/components/ops/fill.rst +++ b/docs/source/components/ops/fill.rst @@ -34,8 +34,6 @@ Description * a Tpetra block vector or multi-vector - * a Epetra vector or multi-vector - * a pressio expression, i.e. ``pressio::diag``, ``pressio::span``, ``pressio::subspan``, based on an Eigen or Kokkos container * ``ScalarType`` must be convertible to ``pressio::Traits::scalar_type`` diff --git a/docs/source/components/ops/matrix_matrix_product.rst b/docs/source/components/ops/matrix_matrix_product.rst index 96b7dcd..38b3c0b 100644 --- a/docs/source/components/ops/matrix_matrix_product.rst +++ b/docs/source/components/ops/matrix_matrix_product.rst @@ -74,8 +74,6 @@ The matrix-matrix product works for the following matrix types: * Eigen (all containers are rank-2 Eigen matrices) -* Epetra (``A`` and ``B`` are Epetra multi-vectors; ``C`` is a rank-2 Eigen matrix) - * Kokkos (all containers are rank-2 Kokkos views) * Tpetra (``A`` and ``B`` are Tpetra multi-vectors; ``C`` is either a rank-2 Eigen matrix or a rank-2 Kokkos view) diff --git a/docs/source/components/ops/matrix_vector_product.rst b/docs/source/components/ops/matrix_vector_product.rst index af8e344..61bbc28 100644 --- a/docs/source/components/ops/matrix_vector_product.rst +++ b/docs/source/components/ops/matrix_vector_product.rst @@ -71,11 +71,6 @@ Description * All container types are either Eigen containers or Pressio expressions of Eigen containers, - * Epetra - - * ``A_type`` is an Epetra rank-2 container - * Either ``x_type`` or ``y_type`` is a rank-1 Epetra container - * The other non-Epetra container is a rank-1 Teuchos or Eigen container * Kokkos diff --git a/docs/source/components/ops/scale.rst b/docs/source/components/ops/scale.rst index 9cf787a..bcafd8a 100644 --- a/docs/source/components/ops/scale.rst +++ b/docs/source/components/ops/scale.rst @@ -26,8 +26,6 @@ Description * Eigen (or a Pressio expression acting on an Eigen container) - * Epetra - * Kokkos (or a Pressio expression acting on a Kokkos container) * Teuchos diff --git a/docs/source/components/ops/set_zero.rst b/docs/source/components/ops/set_zero.rst index 50ab31d..18f58fc 100644 --- a/docs/source/components/ops/set_zero.rst +++ b/docs/source/components/ops/set_zero.rst @@ -26,8 +26,6 @@ Description * Eigen (or a Pressio expression acting on an Eigen container) - * Epetra (rank-1 only) - * Kokkos (or a Pressio expression acting on a Kokkos container) * Teuchos (rank-1 only) diff --git a/docs/source/components/ops/update.rst b/docs/source/components/ops/update.rst index 957b56d..023b72b 100644 --- a/docs/source/components/ops/update.rst +++ b/docs/source/components/ops/update.rst @@ -67,8 +67,6 @@ Description * Rank-1 or Rank-2 (see specific overload) Eigen containers or Pressio expressions of Eigen containers - * Rank-1 Epetra containers - * Rank-1 or Rank-2 (see specific overload) Kokkos containers or Pressio expressions of Kokkos containers * Rank-1 Tpetra containers or Pressio column expressions acting on Tpetra diff --git a/docs/source/components/type_traits.rst b/docs/source/components/type_traits.rst index 9c29d49..aa3213a 100644 --- a/docs/source/components/type_traits.rst +++ b/docs/source/components/type_traits.rst @@ -104,10 +104,6 @@ The following list is partial, and more will be added as we continue the develop - Provides static member constant ``value`` equal to ``true`` if ``T`` is a dense Teuchos vector. :raw-html-m2r:`
` Requires: ``PRESSIO_ENABLE_TPL_TRILINOS==On`` * - ``template`` :raw-html-m2r:`
` ``struct is_dense_matrix_teuchos;`` - Provides static member constant ``value`` equal to ``true`` if ``T`` is a dense Teuchos matrix. :raw-html-m2r:`
` Requires: ``PRESSIO_ENABLE_TPL_TRILINOS==On`` - * - ``template`` :raw-html-m2r:`
` ``struct is_vector_epetra;`` - - Provides static member constant ``value`` equal to ``true`` if ``T`` is Epetra vector. :raw-html-m2r:`
` Requires: ``PRESSIO_ENABLE_TPL_TRILINOS==On`` - * - ``template`` :raw-html-m2r:`
` ``struct is_multi_vector_epetra;`` - - Provides static member constant ``value`` equal to ``true`` if ``T`` is an Epetra multi vector. :raw-html-m2r:`
` Requires: ``PRESSIO_ENABLE_TPL_TRILINOS==On`` * - ``template`` :raw-html-m2r:`
` ``struct is_vector_tpetra;`` - Provides static member constant ``value`` equal to ``true`` if ``T`` is a Tpetra vector. :raw-html-m2r:`
` Requires: ``PRESSIO_ENABLE_TPL_TRILINOS==On`` * - ``template`` :raw-html-m2r:`
` ``struct is_multi_vector_tpetra;`` diff --git a/include/pressio/ops.hpp b/include/pressio/ops.hpp index 5613ba5..e33eb90 100644 --- a/include/pressio/ops.hpp +++ b/include/pressio/ops.hpp @@ -163,27 +163,6 @@ template struct matching_extents; #include "ops/tpetra_block/ops_multi_vector_update.hpp" #include "ops/tpetra_block/ops_level2.hpp" #include "ops/tpetra_block/ops_level3.hpp" - -#ifdef PRESSIO_ENABLE_EPETRA -// Epetra -#include "ops/epetra/ops_clone.hpp" -#include "ops/epetra/ops_extent.hpp" -#include "ops/epetra/ops_deep_copy.hpp" -#include "ops/epetra/ops_set_zero.hpp" -#include "ops/epetra/ops_scale.hpp" -#include "ops/epetra/ops_fill.hpp" -#include "ops/epetra/ops_abs.hpp" -#include "ops/epetra/ops_dot.hpp" -#include "ops/epetra/ops_min_max.hpp" -#include "ops/epetra/ops_norms.hpp" -#include "ops/epetra/ops_pow.hpp" -#include "ops/epetra/ops_rank1_update.hpp" -#include "ops/epetra/ops_elementwise_multiply.hpp" -#include "ops/epetra/ops_multi_vector_update.hpp" -#include "ops/epetra/ops_level2.hpp" -#include "ops/epetra/ops_level3.hpp" -#endif // PRESSIO_ENABLE_EPETRA - #endif //PRESSIO_ENABLE_TPL_TRILINOS // keep this last diff --git a/include/pressio/ops/epetra/ops_abs.hpp b/include/pressio/ops/epetra/ops_abs.hpp deleted file mode 100644 index 311ae76..0000000 --- a/include/pressio/ops/epetra/ops_abs.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/* -//@HEADER -// ************************************************************************ -// -// ops_abs.hpp -// Pressio -// Copyright 2019 -// National Technology & Engineering Solutions of Sandia, LLC (NTESS) -// -// Under the terms of Contract DE-NA0003525 with NTESS, the -// U.S. Government retains certain rights in this software. -// -// Pressio is licensed under BSD-3-Clause terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -// COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -// IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Francesco Rizzi (fnrizzi@sandia.gov) -// -// ************************************************************************ -//@HEADER -*/ - -#ifndef PRESSIOOPS_OPS_EPETRA_OPS_ABS_HPP_ -#define PRESSIOOPS_OPS_EPETRA_OPS_ABS_HPP_ - -namespace pressio{ namespace ops{ - -// y= abs(x) -template -std::enable_if_t< - ::pressio::is_vector_epetra::value - && ::pressio::is_vector_epetra::value - > -abs(T1 & y, const T2 & x) -{ - assert(::pressio::ops::extent(y, 0) == ::pressio::ops::extent(x, 0)); - - y.Abs(x); -} - -}}//end namespace pressio::ops -#endif // PRESSIOOPS_OPS_EPETRA_OPS_ABS_HPP_ diff --git a/include/pressio/ops/epetra/ops_clone.hpp b/include/pressio/ops/epetra/ops_clone.hpp deleted file mode 100644 index 84d3694..0000000 --- a/include/pressio/ops/epetra/ops_clone.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/* -//@HEADER -// ************************************************************************ -// -// ops_clone.hpp -// Pressio -// Copyright 2019 -// National Technology & Engineering Solutions of Sandia, LLC (NTESS) -// -// Under the terms of Contract DE-NA0003525 with NTESS, the -// U.S. Government retains certain rights in this software. -// -// Pressio is licensed under BSD-3-Clause terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -// COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -// IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Francesco Rizzi (fnrizzi@sandia.gov) -// -// ************************************************************************ -//@HEADER -*/ - -#ifndef PRESSIOOPS_OPS_EPETRA_OPS_CLONE_HPP_ -#define PRESSIOOPS_OPS_EPETRA_OPS_CLONE_HPP_ - -namespace pressio{ namespace ops{ - - -template -std::enable_if_t< - (::pressio::is_vector_epetra::value - || ::pressio::is_multi_vector_epetra::value), T> -clone(const T & clonable) -{ - return T(clonable); -} - -}} -#endif // PRESSIOOPS_OPS_EPETRA_OPS_CLONE_HPP_ diff --git a/include/pressio/ops/epetra/ops_deep_copy.hpp b/include/pressio/ops/epetra/ops_deep_copy.hpp deleted file mode 100644 index 4b4cddb..0000000 --- a/include/pressio/ops/epetra/ops_deep_copy.hpp +++ /dev/null @@ -1,66 +0,0 @@ -/* -//@HEADER -// ************************************************************************ -// -// ops_deep_copy.hpp -// Pressio -// Copyright 2019 -// National Technology & Engineering Solutions of Sandia, LLC (NTESS) -// -// Under the terms of Contract DE-NA0003525 with NTESS, the -// U.S. Government retains certain rights in this software. -// -// Pressio is licensed under BSD-3-Clause terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -// COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -// IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Francesco Rizzi (fnrizzi@sandia.gov) -// -// ************************************************************************ -//@HEADER -*/ - -#ifndef PRESSIOOPS_OPS_EPETRA_OPS_DEEP_COPY_HPP_ -#define PRESSIOOPS_OPS_EPETRA_OPS_DEEP_COPY_HPP_ - -namespace pressio{ namespace ops{ - -template -std::enable_if_t< - // TPL/container specific - ::pressio::is_vector_epetra::value or - ::pressio::is_multi_vector_epetra::value - > -deep_copy(T & dest, const T & src){ - assert((matching_extents::compare(dest, src))); - dest = src; -} - -}}//end namespace pressio::ops -#endif // PRESSIOOPS_OPS_EPETRA_OPS_DEEP_COPY_HPP_ diff --git a/include/pressio/ops/epetra/ops_dot.hpp b/include/pressio/ops/epetra/ops_dot.hpp deleted file mode 100644 index 6171953..0000000 --- a/include/pressio/ops/epetra/ops_dot.hpp +++ /dev/null @@ -1,98 +0,0 @@ -/* -//@HEADER -// ************************************************************************ -// -// ops_dot.hpp -// Pressio -// Copyright 2019 -// National Technology & Engineering Solutions of Sandia, LLC (NTESS) -// -// Under the terms of Contract DE-NA0003525 with NTESS, the -// U.S. Government retains certain rights in this software. -// -// Pressio is licensed under BSD-3-Clause terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -// COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -// IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Francesco Rizzi (fnrizzi@sandia.gov) -// -// ************************************************************************ -//@HEADER -*/ - -#ifndef PRESSIOOPS_OPS_EPETRA_OPS_DOT_HPP_ -#define PRESSIOOPS_OPS_EPETRA_OPS_DOT_HPP_ - -namespace pressio{ namespace ops{ - -template -std::enable_if_t< - // TPL/container specific - ::pressio::is_vector_epetra::value - && ::pressio::is_vector_epetra::value - // scalar compatibility - && ::pressio::all_have_traits_and_same_scalar::value - && (std::is_floating_point::scalar_type>::value - || std::is_integral::scalar_type>::value) - && std::is_convertible< - typename ::pressio::Traits::scalar_type, - DotResult>::value - > -dot(const T1 & a, - const T2 & b, - DotResult & result) -{ - assert(a.MyLength() == b.MyLength()); - using sc_t = typename ::pressio::Traits::scalar_type; - sc_t ret; - a.Dot(b, &ret); - result = static_cast(ret); -} - -template -std::enable_if_t< - // TPL/container specific - ::pressio::is_vector_epetra::value - && ::pressio::is_vector_epetra::value - // scalar compatibility - && ::pressio::all_have_traits_and_same_scalar::value - && (std::is_floating_point::scalar_type>::value - || std::is_integral::scalar_type>::value), - typename ::pressio::Traits::scalar_type - > -dot(const T1 & a, const T2 & b) -{ - using sc_t = typename ::pressio::Traits::scalar_type; - sc_t result = {}; - dot(a, b, result); - return result; -} - -}}//end namespace pressio::ops -#endif // PRESSIOOPS_OPS_EPETRA_OPS_DOT_HPP_ diff --git a/include/pressio/ops/epetra/ops_elementwise_multiply.hpp b/include/pressio/ops/epetra/ops_elementwise_multiply.hpp deleted file mode 100644 index e5eae78..0000000 --- a/include/pressio/ops/epetra/ops_elementwise_multiply.hpp +++ /dev/null @@ -1,85 +0,0 @@ -/* -//@HEADER -// ************************************************************************ -// -// ops_elementwise_multiply.hpp -// Pressio -// Copyright 2019 -// National Technology & Engineering Solutions of Sandia, LLC (NTESS) -// -// Under the terms of Contract DE-NA0003525 with NTESS, the -// U.S. Government retains certain rights in this software. -// -// Pressio is licensed under BSD-3-Clause terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -// COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -// IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Francesco Rizzi (fnrizzi@sandia.gov) -// -// ************************************************************************ -//@HEADER -*/ - -#ifndef PRESSIOOPS_OPS_EPETRA_OPS_ELEMENTWISE_MULTIPLY_HPP_ -#define PRESSIOOPS_OPS_EPETRA_OPS_ELEMENTWISE_MULTIPLY_HPP_ - -namespace pressio{ namespace ops{ - -//---------------------------------------------------------------------- -// computing elementwise: y = beta * y + alpha * x * z -//---------------------------------------------------------------------- -template -std::enable_if_t< - // common elementwise_multiply constraints - ::pressio::Traits::rank == 1 - && ::pressio::Traits::rank == 1 - && ::pressio::Traits::rank == 1 - // TPL/container specific - && ::pressio::is_vector_epetra::value - && ::pressio::is_vector_epetra::value - && ::pressio::is_vector_epetra::value - // scalar compatibility - && std::is_convertible::value - && std::is_convertible::value - > -elementwise_multiply(alpha_t alpha, const T & x, const T1 & z, beta_t beta, T2 & y) -{ - assert(x.MyLength()==z.MyLength()); - assert(z.MyLength()==y.MyLength()); - - const double alpha_(alpha); - const double beta_(beta); - const auto has_beta = beta_ != 0.0; - for (int i=0; i -std::enable_if_t< - ::pressio::is_vector_epetra::value, std::size_t> -extent(const T & oIn, const IndexType i) -{ - return (i == 0) ? std::size_t(oIn.GlobalLength()) : std::size_t(1); -} - -template -std::enable_if_t< - ::pressio::is_multi_vector_epetra::value, std::size_t > -extent(const T & oIn, const IndexType i) -{ - if (i == 0) { - return std::size_t(oIn.GlobalLength()); - } - else if (i == 1) { - return std::size_t(oIn.NumVectors()); - } - else { - return std::size_t(1); - } -} - -}} -#endif // PRESSIOOPS_OPS_EPETRA_OPS_EXTENT_HPP_ diff --git a/include/pressio/ops/epetra/ops_fill.hpp b/include/pressio/ops/epetra/ops_fill.hpp deleted file mode 100644 index 5529a59..0000000 --- a/include/pressio/ops/epetra/ops_fill.hpp +++ /dev/null @@ -1,67 +0,0 @@ -/* -//@HEADER -// ************************************************************************ -// -// ops_fill.hpp -// Pressio -// Copyright 2019 -// National Technology & Engineering Solutions of Sandia, LLC (NTESS) -// -// Under the terms of Contract DE-NA0003525 with NTESS, the -// U.S. Government retains certain rights in this software. -// -// Pressio is licensed under BSD-3-Clause terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -// COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -// IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Francesco Rizzi (fnrizzi@sandia.gov) -// -// ************************************************************************ -//@HEADER -*/ - -#ifndef PRESSIOOPS_OPS_EPETRA_OPS_FILL_HPP_ -#define PRESSIOOPS_OPS_EPETRA_OPS_FILL_HPP_ - -namespace pressio{ namespace ops{ - -template -std::enable_if_t< - (::pressio::is_vector_epetra::value || - ::pressio::is_multi_vector_epetra::value) - && std::is_convertible::scalar_type>::value - > -fill(T & o, const ScalarType & value) -{ - const typename ::pressio::Traits::scalar_type v(value); - impl::get_native(o).PutScalar(v); -} - -}}//end namespace pressio::ops -#endif // PRESSIOOPS_OPS_EPETRA_OPS_FILL_HPP_ diff --git a/include/pressio/ops/epetra/ops_level2.hpp b/include/pressio/ops/epetra/ops_level2.hpp deleted file mode 100644 index 438bbab..0000000 --- a/include/pressio/ops/epetra/ops_level2.hpp +++ /dev/null @@ -1,338 +0,0 @@ -/* -//@HEADER -// ************************************************************************ -// -// ops_level2.hpp -// Pressio -// Copyright 2019 -// National Technology & Engineering Solutions of Sandia, LLC (NTESS) -// -// Under the terms of Contract DE-NA0003525 with NTESS, the -// U.S. Government retains certain rights in this software. -// -// Pressio is licensed under BSD-3-Clause terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -// COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -// IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Francesco Rizzi (fnrizzi@sandia.gov) -// -// ************************************************************************ -//@HEADER -*/ - -#ifndef PRESSIOOPS_OPS_EPETRA_OPS_LEVEL2_HPP_ -#define PRESSIOOPS_OPS_EPETRA_OPS_LEVEL2_HPP_ - -namespace pressio{ namespace ops{ - -/* - * y = beta * y + alpha*op(A)*x -*/ - -// begin namespace pressio::ops::impl -namespace impl{ - -template -void _product_epetra_mv_sharedmem_vec(const scalar_type alpha, - const A_type & A, - const x_type & x, - const scalar_type beta, - Epetra_Vector & y) -{ - ::pressio::ops::scale(y, beta); - if (alpha == static_cast(0)) { - return; - } - - const int numVecs = A.NumVectors(); - for (int i=0; i< A.MyLength(); i++) - { - for (int j=0; j< (int)numVecs; j++){ - y[i] += alpha * A[j][i] * x(j); - } - } -} -}//end namespace pressio::ops::impl - -// ------------------------------- -// y = beta * y + alpha*A*x -// -// y : epetra vector -// A : epetra MultiVector -// x : Teuchos Vector -// ------------------------------- -template < - typename alpha_t, - typename A_type, - typename x_type, - typename y_type, - typename beta_t - > -std::enable_if_t< - // level2 common constraints - ::pressio::Traits::rank == 2 - && ::pressio::Traits::rank == 1 - && ::pressio::Traits::rank == 1 - // TPL/container specific - && ::pressio::is_multi_vector_epetra::value - && ::pressio::is_dense_vector_teuchos::value - && ::pressio::is_vector_epetra::value - // scalar compatibility - && ::pressio::all_have_traits_and_same_scalar::value - && std::is_convertible::scalar_type>::value - && std::is_convertible::scalar_type>::value - && (std::is_floating_point::scalar_type>::value - || std::is_integral::scalar_type>::value) - > -product(::pressio::nontranspose /*unused*/, - const alpha_t alpha, - const A_type & A, - const x_type & x, - const beta_t beta, - y_type & y) -{ - ::pressio::ops::impl::_product_epetra_mv_sharedmem_vec(alpha, A, x, beta, y); -} - -// ------------------------------- -// y = beta * y + alpha*A^T*x -// -// y : Teuchos vector -// A : epetra MultiVector -// x : epetra Vector -// ------------------------------- -template < - typename alpha_t, - typename A_type, - typename x_type, - typename y_type, - typename beta_t - > -std::enable_if_t< - // level2 common constraints - ::pressio::Traits::rank == 2 - && ::pressio::Traits::rank == 1 - && ::pressio::Traits::rank == 1 - // TPL/container specific - && ::pressio::is_multi_vector_epetra::value - && ::pressio::is_vector_epetra::value - && ::pressio::is_dense_vector_teuchos::value - // scalar compatibility - && ::pressio::all_have_traits_and_same_scalar::value - && std::is_convertible::scalar_type>::value - && std::is_convertible::scalar_type>::value - && (std::is_floating_point::scalar_type>::value - || std::is_integral::scalar_type>::value) - > -product(::pressio::transpose /*unused*/, - const alpha_t alpha, - const A_type & A, - const x_type & x, - const beta_t beta, - y_type & y) -{ - - const int numVecs = A.NumVectors(); - assert( (std::size_t)y.length() == (std::size_t)numVecs ); - - using sc_t = typename ::pressio::Traits::scalar_type; - const auto zero = static_cast(0); - auto tmp = zero; - for (int i=0; iDot(x, &tmp); - y(i) += alpha * tmp; - } - } -} - -#ifdef PRESSIO_ENABLE_TPL_EIGEN -// ------------------------------- -// y = beta * y + alpha*A*x -// -// y : epetra vector -// A : epetra MultiVector -// x : eigen Vector -// ------------------------------- -template < - typename alpha_t, - typename A_type, - typename x_type, - typename y_type, - typename beta_t - > -std::enable_if_t< - // level2 common constraints - ::pressio::Traits::rank == 2 - && ::pressio::Traits::rank == 1 - && ::pressio::Traits::rank == 1 - // TPL/container specific - && ::pressio::is_multi_vector_epetra::value - && (::pressio::is_vector_eigen::value - || ::pressio::is_expression_acting_on_eigen::value) - && ::pressio::is_vector_epetra::value - // scalar compatibility - && ::pressio::all_have_traits_and_same_scalar::value - && std::is_convertible::scalar_type>::value - && std::is_convertible::scalar_type>::value - && (std::is_floating_point::scalar_type>::value - || std::is_integral::scalar_type>::value) - > -product(::pressio::nontranspose /*unused*/, - const alpha_t alpha, - const A_type & A, - const x_type & x, - const beta_t beta, - y_type & y) -{ - ::pressio::ops::impl::_product_epetra_mv_sharedmem_vec(alpha, A, x, beta, y); -} - -// ------------------------------- -// y = beta * y + alpha*A^T*x -// -// y : eigen vector -// A : epetra MultiVector -// x : epetra Vector -// ------------------------------- -template < - typename alpha_t, - typename A_type, - typename x_type, - typename y_type, - typename beta_t - > -std::enable_if_t< - // level2 common constraints - ::pressio::Traits::rank == 2 - && ::pressio::Traits::rank == 1 - && ::pressio::Traits::rank == 1 - // TPL/container specific - && ::pressio::is_multi_vector_epetra::value - && ::pressio::is_vector_epetra::value - && (::pressio::is_vector_eigen::value - || ::pressio::is_expression_acting_on_eigen::value) - // scalar compatibility - && ::pressio::all_have_traits_and_same_scalar::value - && std::is_convertible::scalar_type>::value - && std::is_convertible::scalar_type>::value - && (std::is_floating_point::scalar_type>::value - || std::is_integral::scalar_type>::value) - > -product(::pressio::transpose /*unused*/, - const alpha_t alpha, - const A_type & A, - const x_type & x, - const beta_t beta, - y_type & y) -{ - - const int numVecs = A.NumVectors(); - assert( (std::size_t)::pressio::ops::extent(y, 0) == (std::size_t)numVecs ); - - using sc_t = typename ::pressio::Traits::scalar_type; - const auto zero = static_cast(0); - auto tmp = zero; - for (int i=0; iDot(x, &tmp); - y(i) += alpha * tmp; - } - } -} -#endif - - -// #ifdef PRESSIO_ENABLE_TPL_EIGEN -// /* ------------------------------------------------------------------- -// * y = beta * y + alpha*A*x -// * x is a eigen -// * A = Eigen::MultiVector -// * y = Epetra Vector -// * this covers the case where the matrix A acts locally to x -// while y is distributed, so A*x only fills the corresponding part of y -// *-------------------------------------------------------------------*/ -// template < typename A_type, typename x_type, typename scalar_type> -// std::enable_if_t< -// ::pressio::containers::predicates::is_multi_vector_wrapper_eigen::value and -// ::pressio::containers::predicates::is_vector_wrapper_eigen::value -// > -// product(::pressio::nontranspose mode, -// const scalar_type alpha, -// const A_type & A, -// const x_type & x, -// const scalar_type beta, -// ::pressio::containers::Vector & y) -// { -// static_assert -// (std::is_same< -// scalar_type, typename ::pressio::containers::details::traits::scalar_t>::value, -// "Scalar compatibility broken"); - -// using eig_mapping_t = Eigen::Map< Eigen::Matrix >; -// eig_mapping_t yMapped(y.data()->Values(), y.extentLocal(0), 1); -// const auto & AE = *A.data(); -// const auto & xE = *x.data(); -// yMapped = beta * yMapped + alpha * AE * xE; -// } -// #endif - -// #ifdef PRESSIO_ENABLE_TPL_EIGEN -// /* ------------------------------------------------------------------- -// * y = beta * y + alpha*A^T*x -// * x is a distributed Epetra vector wrapper -// * A is an Eigen MV -// * y is vector wrapper Eigen -// *-------------------------------------------------------------------*/ -// template -// std::enable_if_t< -// ::pressio::containers::predicates::is_multi_vector_wrapper_eigen::value and -// ::pressio::containers::predicates::is_vector_wrapper_eigen::value -// > -// product(::pressio::transpose mode, -// const scalar_type alpha, -// const A_type & A, -// const ::pressio::containers::Vector & x, -// const scalar_type beta, -// y_type & y) -// { -// using eig_mapping_t = const Eigen::Map< const Eigen::Matrix >; -// eig_mapping_t xMapped(x.data()->Values(), x.extentLocal(0), 1); -// const auto & AE = *A.data(); -// auto & yE = *y.data(); -// yE = beta * yE + alpha * AE.transpose() * xMapped; -// } -// #endif - -}}//end namespace pressio::ops -#endif // PRESSIOOPS_OPS_EPETRA_OPS_LEVEL2_HPP_ diff --git a/include/pressio/ops/epetra/ops_level3.hpp b/include/pressio/ops/epetra/ops_level3.hpp deleted file mode 100644 index 23b7cbd..0000000 --- a/include/pressio/ops/epetra/ops_level3.hpp +++ /dev/null @@ -1,255 +0,0 @@ -/* -//@HEADER -// ************************************************************************ -// -// ops_level3.hpp -// Pressio -// Copyright 2019 -// National Technology & Engineering Solutions of Sandia, LLC (NTESS) -// -// Under the terms of Contract DE-NA0003525 with NTESS, the -// U.S. Government retains certain rights in this software. -// -// Pressio is licensed under BSD-3-Clause terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -// COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -// IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Francesco Rizzi (fnrizzi@sandia.gov) -// -// ************************************************************************ -//@HEADER -*/ - -#ifndef PRESSIOOPS_OPS_EPETRA_OPS_LEVEL3_HPP_ -#define PRESSIOOPS_OPS_EPETRA_OPS_LEVEL3_HPP_ - -namespace pressio{ namespace ops{ - -/* - * C = beta * C + alpha*op(A)*op(B) -*/ - - -/* ------------------------------------------------------------------- -C = beta * C + alpha * A^T * B -A = epetra multivector -B = epetra multivector -C is an Eigen dense matrix -*-------------------------------------------------------------------*/ -template < - typename A_type, typename B_type, typename alpha_type, typename beta_type, typename C_type - > -std::enable_if_t< - // level3 common constraints - ::pressio::Traits::rank == 2 - && ::pressio::Traits::rank == 2 - && ::pressio::Traits::rank == 2 - // TPL/container specific - && ::pressio::is_multi_vector_epetra::value - && ::pressio::is_multi_vector_epetra::value - && ::pressio::is_dense_matrix_eigen::value - // scalar compatibility - && ::pressio::all_have_traits_and_same_scalar::value - && (std::is_floating_point::scalar_type>::value - || std::is_integral::scalar_type>::value) - && std::is_convertible::scalar_type>::value - && std::is_convertible::scalar_type>::value - > -product(::pressio::transpose /*unused*/, - ::pressio::nontranspose /*unused*/, - const alpha_type alpha, - const A_type & A, - const B_type & B, - const beta_type beta, - C_type & C) -{ - - const auto numVecsA = A.NumVectors(); - const auto numVecsB = B.NumVectors(); - assert( (std::size_t)::pressio::ops::extent(A,0) == (std::size_t)::pressio::ops::extent(B,0)); - assert( (std::size_t)::pressio::ops::extent(C,0) == (std::size_t)numVecsA ); - assert( (std::size_t)::pressio::ops::extent(C,1) == (std::size_t)numVecsB ); - - using sc_t = typename ::pressio::Traits::scalar_type; - const auto zero = static_cast(0); - const sc_t alpha_(alpha); - const sc_t beta_(beta); - auto tmp = zero; - // compute dot between every column of A with every col of B - for (std::size_t i=0; i<(std::size_t)numVecsA; i++) - { - for (std::size_t j=0; j<(std::size_t)numVecsB; j++) - { - A(i)->Dot( *(B(j)), &tmp ); - tmp *= alpha_; - C(i,j) = beta_ == zero ? zero : beta_ * C(i,j); - C(i,j) += tmp; - } - } -} - -/* ------------------------------------------------------------------- -C = beta * C + alpha * A^T * B -A = multivector -B = multivector -C is an Eigen dense matrix returned by the function -*-------------------------------------------------------------------*/ -template < - typename C_type, typename A_type, typename B_type, typename alpha_type - > -std::enable_if_t< - // level3 common constraints - ::pressio::Traits::rank == 2 - && ::pressio::Traits::rank == 2 - && ::pressio::Traits::rank == 2 - // TPL/container specific - && ::pressio::is_multi_vector_epetra::value - && ::pressio::is_multi_vector_epetra::value - && ::pressio::is_dynamic_dense_matrix_eigen::value - // scalar compatibility - && ::pressio::all_have_traits_and_same_scalar::value - && (std::is_floating_point::scalar_type>::value - || std::is_integral::scalar_type>::value) - && std::is_convertible::scalar_type>::value, - C_type - > -product(::pressio::transpose modeA, - ::pressio::nontranspose modeB, - const alpha_type alpha, - const A_type & A, - const B_type & B) -{ - using sc_t = typename ::pressio::Traits::scalar_type; - - const auto numVecsA = A.NumVectors(); - const auto numVecsB = B.NumVectors(); - C_type C(numVecsA, numVecsB); - product(modeA, modeB, alpha, A, B, static_cast(0), C); - return C; -} - - -/* ------------------------------------------------------------------- -special case A==B -C = beta * C + alpha * A^T * A -A = epetra multivector -C is an Eigen dense matrix -*-------------------------------------------------------------------*/ -template < - typename A_type, typename alpha_type, typename beta_type, typename C_type - > -std::enable_if_t< - // level3 common constraints - ::pressio::Traits::rank == 2 - && ::pressio::Traits::rank == 2 - // TPL/container specific - && ::pressio::is_multi_vector_epetra::value - && ::pressio::is_dense_matrix_eigen::value - // scalar compatibility - && ::pressio::all_have_traits_and_same_scalar::value - && (std::is_floating_point::scalar_type>::value - || std::is_integral::scalar_type>::value) - && std::is_convertible::scalar_type>::value - && std::is_convertible::scalar_type>::value - > -product(::pressio::transpose /*unused*/, - ::pressio::nontranspose /*unused*/, - const alpha_type alpha, - const A_type & A, - const beta_type beta, - C_type & C) -{ - - assert( ::pressio::ops::extent(C, 0) == ::pressio::ops::extent(A, 1) ); - assert( ::pressio::ops::extent(C, 1) == ::pressio::ops::extent(A, 1) ); - - // how many vectors are in A and B - const int numVecsA = A.NumVectors(); - assert(C.rows() == numVecsA); - assert(C.cols() == numVecsA); - - using sc_t = typename ::pressio::Traits::scalar_type; - constexpr auto zero = static_cast(0); - sc_t tmp = zero; - const sc_t alpha_(alpha); - const sc_t beta_(beta); - const auto apply_beta = [beta_](sc_t c) -> sc_t { - return beta_ == zero ? zero : beta_ * c; - }; - - // A dot A = A^T*A, which yields a symmetric matrix - // only need to compute half and fill remaining entries accordingly - for (int i=0; i< numVecsA; i++) - { - C(i,i) = apply_beta(C(i,i)); - A(i)->Dot( *(A(i)), &tmp ); - C(i,i) += alpha_*tmp; - - for (int j=i+1; jDot( *(A(j)), &tmp ); - C(i,j) += alpha_*tmp; - C(j,i) += alpha_*tmp; - } - } -} - -template < - typename C_type, typename A_type, typename alpha_type - > -std::enable_if_t< - // level3 common constraints - ::pressio::Traits::rank == 2 - && ::pressio::Traits::rank == 2 - // TPL/container specific - && ::pressio::is_multi_vector_epetra::value - && ::pressio::is_dynamic_dense_matrix_eigen::value - // scalar compatibility - && ::pressio::all_have_traits_and_same_scalar::value - && (std::is_floating_point::scalar_type>::value - || std::is_integral::scalar_type>::value) - && std::is_convertible::scalar_type>::value, - C_type - > -product(::pressio::transpose modeA, - ::pressio::nontranspose modeB, - const alpha_type alpha, - const A_type & A) -{ - using sc_t = typename ::pressio::Traits::scalar_type; - C_type C(A.NumVectors(), A.NumVectors()); - product(modeA, modeB, alpha, A, static_cast(0), C); - return C; -} - -}}//end namespace pressio::ops -#endif // PRESSIOOPS_OPS_EPETRA_OPS_LEVEL3_HPP_ diff --git a/include/pressio/ops/epetra/ops_min_max.hpp b/include/pressio/ops/epetra/ops_min_max.hpp deleted file mode 100644 index d716cc3..0000000 --- a/include/pressio/ops/epetra/ops_min_max.hpp +++ /dev/null @@ -1,107 +0,0 @@ -/* -//@HEADER -// ************************************************************************ -// -// ops_min_max.hpp -// Pressio -// Copyright 2019 -// National Technology & Engineering Solutions of Sandia, LLC (NTESS) -// -// Under the terms of Contract DE-NA0003525 with NTESS, the -// U.S. Government retains certain rights in this software. -// -// Pressio is licensed under BSD-3-Clause terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -// COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -// IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Francesco Rizzi (fnrizzi@sandia.gov) -// -// ************************************************************************ -//@HEADER -*/ - -#ifndef PRESSIOOPS_OPS_EPETRA_OPS_MIN_MAX_HPP_ -#define PRESSIOOPS_OPS_EPETRA_OPS_MIN_MAX_HPP_ - -namespace pressio{ namespace ops{ - -template -std::enable_if_t< - // TPL/container specific - (::pressio::is_vector_epetra::value - || ::pressio::is_multi_vector_epetra::value) - // scalar compatibility - && (std::is_floating_point::scalar_type>::value - || std::is_integral::scalar_type>::value), - typename ::pressio::Traits::scalar_type - > -max(T & obj) -{ - assert(::pressio::ops::extent(obj, 0) > 0); - assert(!::pressio::is_multi_vector_epetra::value - || ::pressio::ops::extent(obj, 1) > 0); - - using sc_t = typename ::pressio::Traits::scalar_type; - std::vector x(obj.NumVectors()); - obj.MaxValue(x.data()); - const auto i = std::max_element(x.begin(), x.end()); - if (i == x.end()) { - throw std::runtime_error("Can't take max() of no elements"); - } - return *i; -} - -template -std::enable_if_t< - // TPL/container specific - (::pressio::is_vector_epetra::value - || ::pressio::is_multi_vector_epetra::value) - // scalar compatibility - && (std::is_floating_point::scalar_type>::value - || std::is_integral::scalar_type>::value), - typename ::pressio::Traits::scalar_type - > -min(const T & obj) -{ - assert(::pressio::ops::extent(obj, 0) > 0); - assert(!::pressio::is_multi_vector_epetra::value - || ::pressio::ops::extent(obj, 1) > 0); - - using sc_t = typename ::pressio::Traits::scalar_type; - std::vector x(obj.NumVectors()); - obj.MinValue(x.data()); - const auto i = std::min_element(x.begin(), x.end()); - if (i == x.end()) { - throw std::runtime_error("Can't take min() of no elements"); - } - return *i; -} - -}}//end namespace pressio::ops -#endif // PRESSIOOPS_OPS_EPETRA_OPS_MIN_MAX_HPP_ diff --git a/include/pressio/ops/epetra/ops_multi_vector_update.hpp b/include/pressio/ops/epetra/ops_multi_vector_update.hpp deleted file mode 100644 index 41c288c..0000000 --- a/include/pressio/ops/epetra/ops_multi_vector_update.hpp +++ /dev/null @@ -1,110 +0,0 @@ -/* -//@HEADER -// ************************************************************************ -// -// ops_multi_vector_update.hpp -// Pressio -// Copyright 2019 -// National Technology & Engineering Solutions of Sandia, LLC (NTESS) -// -// Under the terms of Contract DE-NA0003525 with NTESS, the -// U.S. Government retains certain rights in this software. -// -// Pressio is licensed under BSD-3-Clause terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -// COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -// IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Francesco Rizzi (fnrizzi@sandia.gov) -// -// ************************************************************************ -//@HEADER -*/ - -#ifndef PRESSIOOPS_OPS_EPETRA_OPS_MULTI_VECTOR_UPDATE_HPP_ -#define PRESSIOOPS_OPS_EPETRA_OPS_MULTI_VECTOR_UPDATE_HPP_ - -namespace pressio{ namespace ops{ - -//---------------------------------------------------------------------- -// overloads for computing: MV = a * MV + b * MV1 -//---------------------------------------------------------------------- -template -std::enable_if_t< - // rank-1 update common constraints - ::pressio::Traits::rank == 2 - && ::pressio::Traits::rank == 2 - // TPL/container specific - && ::pressio::is_multi_vector_epetra::value - && ::pressio::is_multi_vector_epetra::value - // scalar compatibility - && ::pressio::all_have_traits_and_same_scalar::value - && (std::is_floating_point::scalar_type>::value - || std::is_integral::scalar_type>::value) - && std::is_convertible::scalar_type>::value - && std::is_convertible::scalar_type>::value - > -update(T & mv, const alpha_t &a, - const T1 & mv1, const beta_t &b) -{ - assert(::pressio::ops::extent(mv, 0) == ::pressio::ops::extent(mv1, 0)); - assert(::pressio::ops::extent(mv, 1) == ::pressio::ops::extent(mv1, 1)); - - using scalar_t = typename ::pressio::Traits::scalar_type; - const scalar_t a_(a); - const scalar_t b_(b); - - if (b_ == static_cast(0)) { - ::pressio::ops::scale(mv, a_); - } else { - mv.Update(b_, mv1, a_); - } -} - -template -std::enable_if_t< - // rank-1 update common constraints - ::pressio::Traits::rank == 2 - && ::pressio::Traits::rank == 2 - // TPL/container specific - && ::pressio::is_multi_vector_epetra::value - && ::pressio::is_multi_vector_epetra::value - // scalar compatibility - && ::pressio::all_have_traits_and_same_scalar::value - && (std::is_floating_point::scalar_type>::value - || std::is_integral::scalar_type>::value) - && std::is_convertible::scalar_type>::value - > -update(T & mv, const T1 & mv1, const beta_t & b) -{ - using scalar_t = typename ::pressio::Traits::scalar_type; - ::pressio::ops::update(mv, b, mv1, static_cast(0)); -} - -}}//end namespace ::pressio::ops -#endif // PRESSIOOPS_OPS_EPETRA_OPS_MULTI_VECTOR_UPDATE_HPP_ diff --git a/include/pressio/ops/epetra/ops_norms.hpp b/include/pressio/ops/epetra/ops_norms.hpp deleted file mode 100644 index dcebe9f..0000000 --- a/include/pressio/ops/epetra/ops_norms.hpp +++ /dev/null @@ -1,93 +0,0 @@ -/* -//@HEADER -// ************************************************************************ -// -// ops_norms.hpp -// Pressio -// Copyright 2019 -// National Technology & Engineering Solutions of Sandia, LLC (NTESS) -// -// Under the terms of Contract DE-NA0003525 with NTESS, the -// U.S. Government retains certain rights in this software. -// -// Pressio is licensed under BSD-3-Clause terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -// COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -// IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Francesco Rizzi (fnrizzi@sandia.gov) -// -// ************************************************************************ -//@HEADER -*/ - -#ifndef PRESSIOOPS_OPS_EPETRA_OPS_NORMS_HPP_ -#define PRESSIOOPS_OPS_EPETRA_OPS_NORMS_HPP_ - -namespace pressio{ namespace ops{ - -template -std::enable_if_t< - // norm-1 common constraints - ::pressio::Traits::rank == 1 - // TPL/container specific - && ::pressio::is_vector_epetra::value - // scalar compatibility - && (std::is_floating_point::scalar_type>::value - || std::is_integral::scalar_type>::value), - typename ::pressio::Traits::scalar_type - > -norm1(const T & a) -{ - using sc_t = typename ::pressio::Traits::scalar_type; - sc_t result = 0.0; - a.Norm1(&result); - return result; -} - -template -std::enable_if_t< - // norm-1 common constraints - ::pressio::Traits::rank == 1 - // TPL/container specific - && ::pressio::is_vector_epetra::value - // scalar compatibility - && (std::is_floating_point::scalar_type>::value - || std::is_integral::scalar_type>::value), - typename ::pressio::Traits::scalar_type - > -norm2(const T & a) -{ - using sc_t = typename ::pressio::Traits::scalar_type; - sc_t result = 0.0; - a.Norm2(&result); - return result; -} - -}}//end namespace pressio::ops -#endif // PRESSIOOPS_OPS_EPETRA_OPS_NORMS_HPP_ diff --git a/include/pressio/ops/epetra/ops_pow.hpp b/include/pressio/ops/epetra/ops_pow.hpp deleted file mode 100644 index b3641a8..0000000 --- a/include/pressio/ops/epetra/ops_pow.hpp +++ /dev/null @@ -1,117 +0,0 @@ -/* -//@HEADER -// ************************************************************************ -// -// ops_pow.hpp -// Pressio -// Copyright 2019 -// National Technology & Engineering Solutions of Sandia, LLC (NTESS) -// -// Under the terms of Contract DE-NA0003525 with NTESS, the -// U.S. Government retains certain rights in this software. -// -// Pressio is licensed under BSD-3-Clause terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -// COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -// IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Francesco Rizzi (fnrizzi@sandia.gov) -// -// ************************************************************************ -//@HEADER -*/ - -#ifndef PRESSIOOPS_OPS_EPETRA_OPS_POW_HPP_ -#define PRESSIOOPS_OPS_EPETRA_OPS_POW_HPP_ - -namespace pressio{ namespace ops{ - -// y = |x|^exponent, expo>0 -template -std::enable_if_t< - ::pressio::is_vector_epetra::value and - ::pressio::is_vector_epetra::value - > -abs_pow(T1 & y, - const T2 & x, - const typename ::pressio::Traits::scalar_type & exponent) -{ - using sc_t = typename ::pressio::Traits::scalar_type; - - assert(x.GlobalLength() == y.GlobalLength()); - assert(x.MyLength() == y.MyLength()); - - if (exponent <= static_cast(0)) - throw std::runtime_error("this overload is only for exponent > 0"); - - for (int i=0; i< x.MyLength(); ++i){ - y[i] = std::pow( std::abs(x[i]), exponent); - } -} - -// y = |x|^exponent, expo<0 -template -std::enable_if_t< - ::pressio::is_vector_epetra::value and - ::pressio::is_vector_epetra::value - > -abs_pow(T1 & y, - const T2 & x, - const typename ::pressio::Traits::scalar_type & exponent, - const typename ::pressio::Traits::scalar_type & eps) -{ - - using sc_t = typename ::pressio::Traits::scalar_type; - - assert(x.GlobalLength() == y.GlobalLength()); - assert(x.MyLength() == y.MyLength()); - - if (exponent >= static_cast(0)){ - throw std::runtime_error("this overload is only for exponent < 0"); - } - - const auto expo = -exponent; - for (int i=0; i(1) / std::max(eps, std::pow(std::abs(x[i]), expo)); - } -} - -template -std::enable_if_t< - ::pressio::is_vector_epetra::value - > -pow(T & x, - const typename ::pressio::Traits::scalar_type & exponent) -{ - for (int i=0; i -std::enable_if_t< - // rank-1 update common constraints - ::pressio::Traits::rank == 1 - && ::pressio::Traits::rank == 1 - // TPL/container specific - && ::pressio::is_vector_epetra::value - && ::pressio::is_vector_epetra::value - // scalar compatibility - && ::pressio::all_have_traits_and_same_scalar::value - && (std::is_floating_point::scalar_type>::value - || std::is_integral::scalar_type>::value) - && std::is_convertible::scalar_type>::value - && std::is_convertible::scalar_type>::value - > -update(T & v, const a_Type a, - const T1 & v1, const b_Type b) -{ - assert(::pressio::ops::extent(v, 0) == ::pressio::ops::extent(v1, 0)); - - using scalar_t = typename ::pressio::Traits::scalar_type; - const auto zero = static_cast(0); - const scalar_t a_(a); - const scalar_t b_(b); - - if (b_ == zero) { - ::pressio::ops::scale(v, a_); - return; - } - - for (int i=0; i -std::enable_if_t< - // rank-1 update common constraints - ::pressio::Traits::rank == 1 - && ::pressio::Traits::rank == 1 - && ::pressio::Traits::rank == 1 - // TPL/container specific - && ::pressio::is_vector_epetra::value - && ::pressio::is_vector_epetra::value - && ::pressio::is_vector_epetra::value - // scalar compatibility - && ::pressio::all_have_traits_and_same_scalar::value - && (std::is_floating_point::scalar_type>::value - || std::is_integral::scalar_type>::value) - && std::is_convertible::scalar_type>::value - && std::is_convertible::scalar_type>::value - && std::is_convertible::scalar_type>::value - > -update(T & v, const a_Type &a, - const T1 & v1, const b_Type &b, - const T2 & v2, const c_Type &c) -{ - assert(::pressio::ops::extent(v, 0) == ::pressio::ops::extent(v1, 0)); - assert(::pressio::ops::extent(v, 0) == ::pressio::ops::extent(v2, 0)); - - using scalar_t = typename ::pressio::Traits::scalar_type; - const auto zero = static_cast(0); - const scalar_t a_(a); - const scalar_t b_(b); - const scalar_t c_(c); - - if (b_ == zero) { - ::pressio::ops::update(v, a, v2, c); - } else if (c_ == zero) { - ::pressio::ops::update(v, a, v1, b); - } else { - for (int i=0; i -std::enable_if_t< - // rank-1 update common constraints - ::pressio::Traits::rank == 1 - && ::pressio::Traits::rank == 1 - && ::pressio::Traits::rank == 1 - && ::pressio::Traits::rank == 1 - // TPL/container specific - && ::pressio::is_vector_epetra::value - && ::pressio::is_vector_epetra::value - && ::pressio::is_vector_epetra::value - && ::pressio::is_vector_epetra::value - // scalar compatibility - && ::pressio::all_have_traits_and_same_scalar::value - && (std::is_floating_point::scalar_type>::value - || std::is_integral::scalar_type>::value) - && std::is_convertible::scalar_type>::value - && std::is_convertible::scalar_type>::value - && std::is_convertible::scalar_type>::value - && std::is_convertible::scalar_type>::value - > -update(T & v, const a_Type &a, - const T1 & v1, const b_Type &b, - const T2 & v2, const c_Type &c, - const T3 & v3, const d_Type &d) -{ - assert(::pressio::ops::extent(v, 0) == ::pressio::ops::extent(v1, 0)); - assert(::pressio::ops::extent(v, 0) == ::pressio::ops::extent(v2, 0)); - assert(::pressio::ops::extent(v, 0) == ::pressio::ops::extent(v3, 0)); - - using scalar_t = typename ::pressio::Traits::scalar_type; - const auto zero = static_cast(0); - const scalar_t a_(a); - const scalar_t b_(b); - const scalar_t c_(c); - const scalar_t d_(d); - - if (b_ == zero) { - ::pressio::ops::update(v, a, v2, c, v3, d); - } else if (c_ == zero) { - ::pressio::ops::update(v, a, v1, b, v3, d); - } else if (d_ == zero) { - ::pressio::ops::update(v, a, v1, b, v2, c); - } else { - for (int i=0; i -std::enable_if_t< - // rank-1 update common constraints - ::pressio::Traits::rank == 1 - && ::pressio::Traits::rank == 1 - && ::pressio::Traits::rank == 1 - && ::pressio::Traits::rank == 1 - && ::pressio::Traits::rank == 1 - // TPL/container specific - && ::pressio::is_vector_epetra::value - && ::pressio::is_vector_epetra::value - && ::pressio::is_vector_epetra::value - && ::pressio::is_vector_epetra::value - && ::pressio::is_vector_epetra::value - // scalar compatibility - && ::pressio::all_have_traits_and_same_scalar::value - && (std::is_floating_point::scalar_type>::value - || std::is_integral::scalar_type>::value) - && std::is_convertible::scalar_type>::value - && std::is_convertible::scalar_type>::value - && std::is_convertible::scalar_type>::value - && std::is_convertible::scalar_type>::value - && std::is_convertible::scalar_type>::value - > -update(T & v, const a_Type &a, - const T1 & v1, const b_Type &b, - const T2 & v2, const c_Type &c, - const T3 & v3, const d_Type &d, - const T4 & v4, const e_Type &e) -{ - assert(::pressio::ops::extent(v, 0) == ::pressio::ops::extent(v1, 0)); - assert(::pressio::ops::extent(v, 0) == ::pressio::ops::extent(v2, 0)); - assert(::pressio::ops::extent(v, 0) == ::pressio::ops::extent(v3, 0)); - assert(::pressio::ops::extent(v, 0) == ::pressio::ops::extent(v4, 0)); - - using scalar_t = typename ::pressio::Traits::scalar_type; - const auto zero = static_cast(0); - const scalar_t a_(a); - const scalar_t b_(b); - const scalar_t c_(c); - const scalar_t d_(d); - const scalar_t e_(e); - - if (b_ == zero) { - ::pressio::ops::update(v, a, v2, c, v3, d, v4, e); - } else if (c_ == zero) { - ::pressio::ops::update(v, a, v1, b, v3, d, v4, e); - } else if (d_ == zero) { - ::pressio::ops::update(v, a, v1, b, v2, c, v4, e); - } else if (e_ == zero) { - ::pressio::ops::update(v, a, v1, b, v2, c, v3, d); - } else { - for (int i = 0; i < v.MyLength(); ++i) { - if (a_ == zero) { - v[i] = b_*v1[i] + c_*v2[i] + d_*v3[i] + e_*v4[i]; - } else { - v[i] = a_*v[i] + b_*v1[i] + c_*v2[i] + d_*v3[i] + e_*v4[i]; - } - } - } -} - -}}//end namespace pressio::ops -#endif // PRESSIOOPS_OPS_EPETRA_OPS_RANK1_UPDATE_HPP_ diff --git a/include/pressio/ops/epetra/ops_scale.hpp b/include/pressio/ops/epetra/ops_scale.hpp deleted file mode 100644 index faf6b1f..0000000 --- a/include/pressio/ops/epetra/ops_scale.hpp +++ /dev/null @@ -1,81 +0,0 @@ -/* -//@HEADER -// ************************************************************************ -// -// ops_scale.hpp -// Pressio -// Copyright 2019 -// National Technology & Engineering Solutions of Sandia, LLC (NTESS) -// -// Under the terms of Contract DE-NA0003525 with NTESS, the -// U.S. Government retains certain rights in this software. -// -// Pressio is licensed under BSD-3-Clause terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -// COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -// IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Francesco Rizzi (fnrizzi@sandia.gov) -// -// ************************************************************************ -//@HEADER -*/ - -#ifndef PRESSIOOPS_OPS_EPETRA_OPS_SCALE_HPP_ -#define PRESSIOOPS_OPS_EPETRA_OPS_SCALE_HPP_ - -namespace pressio{ namespace ops{ - -template -std::enable_if_t< - // rank-1 update common constraints - (::pressio::Traits::rank == 1 - || ::pressio::Traits::rank == 2) - // TPL/container specific - && (::pressio::is_vector_epetra::value - || ::pressio::is_multi_vector_epetra::value) - // scalar compatibility - && (std::is_floating_point::scalar_type>::value - || std::is_integral::scalar_type>::value) - && std::is_convertible::scalar_type>::value - > -scale(T & objectIn, const ScalarType value) -{ - using sc_t = typename ::pressio::Traits::scalar_type; - const sc_t v(value); - if (v == static_cast(0)) { - ::pressio::ops::set_zero(objectIn); - } else { - if (0 != objectIn.Scale(v)) { - throw std::runtime_error("Epetra scaling failed"); - } - } -} - -}}//end namespace pressio::ops -#endif // PRESSIOOPS_OPS_EPETRA_OPS_SCALE_HPP_ diff --git a/include/pressio/ops/epetra/ops_set_zero.hpp b/include/pressio/ops/epetra/ops_set_zero.hpp deleted file mode 100644 index f5e1ada..0000000 --- a/include/pressio/ops/epetra/ops_set_zero.hpp +++ /dev/null @@ -1,66 +0,0 @@ -/* -//@HEADER -// ************************************************************************ -// -// ops_set_zero.hpp -// Pressio -// Copyright 2019 -// National Technology & Engineering Solutions of Sandia, LLC (NTESS) -// -// Under the terms of Contract DE-NA0003525 with NTESS, the -// U.S. Government retains certain rights in this software. -// -// Pressio is licensed under BSD-3-Clause terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -// COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -// IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Francesco Rizzi (fnrizzi@sandia.gov) -// -// ************************************************************************ -//@HEADER -*/ - -#ifndef PRESSIOOPS_OPS_EPETRA_OPS_SET_ZERO_HPP_ -#define PRESSIOOPS_OPS_EPETRA_OPS_SET_ZERO_HPP_ - -namespace pressio{ namespace ops{ - -template -std::enable_if_t< - ::pressio::is_vector_epetra::value or - ::pressio::is_multi_vector_epetra::value - > -set_zero(T & v) -{ - using value_t = typename ::pressio::Traits::scalar_type; - v.PutScalar( static_cast(0) ); -} - -}}//end namespace pressio::ops -#endif // PRESSIOOPS_OPS_EPETRA_OPS_SET_ZERO_HPP_ diff --git a/include/pressio/ops_macros.hpp b/include/pressio/ops_macros.hpp index 635fa97..007777c 100644 --- a/include/pressio/ops_macros.hpp +++ b/include/pressio/ops_macros.hpp @@ -69,12 +69,6 @@ static_assert(_PRESSIO_CPLUSPLUS >= PRESSIO_CXX_STD_17, "PRESSIO requires C++17 // ---------------------------------------- // TPL macros // ---------------------------------------- -#if defined PRESSIO_ENABLE_EPETRA -#if !defined PRESSIO_ENABLE_TPL_TRILINOS -#define PRESSIO_ENABLE_TPL_TRILINOS -#endif -#endif - #if defined PRESSIO_ENABLE_TPL_TRILINOS // if trilinos enabled, kokkos and MPI should be too #if !defined PRESSIO_ENABLE_TPL_KOKKOS diff --git a/include/pressio/type_traits.hpp b/include/pressio/type_traits.hpp index 3adda02..fa0843b 100644 --- a/include/pressio/type_traits.hpp +++ b/include/pressio/type_traits.hpp @@ -64,7 +64,6 @@ template struct Traits; #include "type_traits/native_teuchos_vector.hpp" #include "type_traits/native_tpetra_block_vector.hpp" #include "type_traits/native_tpetra_vector.hpp" -#include "type_traits/native_epetra_vector.hpp" //*** matrix **** #include "type_traits/native_kokkos_dense_matrix.hpp" @@ -75,7 +74,6 @@ template struct Traits; //*** multi vector **** #include "type_traits/native_tpetra_block_multi_vector.hpp" #include "type_traits/native_tpetra_multi_vector.hpp" -#include "type_traits/native_epetra_multi_vector.hpp" #include "type_traits/traits_tpl.hpp" diff --git a/include/pressio/type_traits/native_epetra_multi_vector.hpp b/include/pressio/type_traits/native_epetra_multi_vector.hpp deleted file mode 100644 index 79c79da..0000000 --- a/include/pressio/type_traits/native_epetra_multi_vector.hpp +++ /dev/null @@ -1,72 +0,0 @@ -/* -//@HEADER -// ************************************************************************ -// -// native_epetra_multi_vector.hpp -// Pressio -// Copyright 2019 -// National Technology & Engineering Solutions of Sandia, LLC (NTESS) -// -// Under the terms of Contract DE-NA0003525 with NTESS, the -// U.S. Government retains certain rights in this software. -// -// Pressio is licensed under BSD-3-Clause terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -// COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -// IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Francesco Rizzi (fnrizzi@sandia.gov) -// -// ************************************************************************ -//@HEADER -*/ - -#ifndef PRESSIOOPS_TYPE_TRAITS_NATIVE_EPETRA_MULTI_VECTOR_HPP_ -#define PRESSIOOPS_TYPE_TRAITS_NATIVE_EPETRA_MULTI_VECTOR_HPP_ - -#ifdef PRESSIO_ENABLE_EPETRA -#include "Epetra_MultiVector.h" -#endif - -namespace pressio{ - -template -struct is_multi_vector_epetra : std::false_type {}; - -#ifdef PRESSIO_ENABLE_EPETRA -template -struct is_multi_vector_epetra::value - >::type - > : std::true_type{}; -#endif - -}//end namespace -#endif // PRESSIOOPS_TYPE_TRAITS_NATIVE_EPETRA_MULTI_VECTOR_HPP_ diff --git a/include/pressio/type_traits/native_epetra_vector.hpp b/include/pressio/type_traits/native_epetra_vector.hpp deleted file mode 100644 index a25f88d..0000000 --- a/include/pressio/type_traits/native_epetra_vector.hpp +++ /dev/null @@ -1,73 +0,0 @@ -/* -//@HEADER -// ************************************************************************ -// -// native_epetra_vector.hpp -// Pressio -// Copyright 2019 -// National Technology & Engineering Solutions of Sandia, LLC (NTESS) -// -// Under the terms of Contract DE-NA0003525 with NTESS, the -// U.S. Government retains certain rights in this software. -// -// Pressio is licensed under BSD-3-Clause terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -// COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -// IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Francesco Rizzi (fnrizzi@sandia.gov) -// -// ************************************************************************ -//@HEADER -*/ - -#ifndef PRESSIOOPS_TYPE_TRAITS_NATIVE_EPETRA_VECTOR_HPP_ -#define PRESSIOOPS_TYPE_TRAITS_NATIVE_EPETRA_VECTOR_HPP_ - -#ifdef PRESSIO_ENABLE_EPETRA -#include "Epetra_Vector.h" -#include "Epetra_MultiVector.h" -#endif - -namespace pressio{ - -template -struct is_vector_epetra : std::false_type {}; - -#ifdef PRESSIO_ENABLE_EPETRA -template -struct is_vector_epetra::value - >::type - > : std::true_type{}; -#endif - -}//end namespace -#endif // PRESSIOOPS_TYPE_TRAITS_NATIVE_EPETRA_VECTOR_HPP_ diff --git a/include/pressio/type_traits/traits_tpl.hpp b/include/pressio/type_traits/traits_tpl.hpp index bc102a5..d66a9d9 100644 --- a/include/pressio/type_traits/traits_tpl.hpp +++ b/include/pressio/type_traits/traits_tpl.hpp @@ -89,16 +89,6 @@ struct Traits< T, #endif #ifdef PRESSIO_ENABLE_TPL_TRILINOS -#ifdef PRESSIO_ENABLE_EPETRA -template -struct Traits< T, - std::enable_if_t< is_vector_epetra::value > > -{ - static constexpr int rank = 1; - using scalar_type = double; -}; -#endif // PRESSIO_ENABLE_EPETRA - template struct Traits< T, std::enable_if_t< @@ -168,18 +158,6 @@ struct Traits< static constexpr int rank = 2; using scalar_type = typename T::impl_scalar_type; }; - -#ifdef PRESSIO_ENABLE_EPETRA -template -struct Traits< - T, std::enable_if_t< - is_multi_vector_epetra::value > - > -{ - static constexpr int rank = 2; - using scalar_type = double; -}; -#endif // PRESSIO_ENABLE_EPETRA #endif // PRESSIO_ENABLE_TPL_TRILINOS #ifdef PRESSIO_ENABLE_TPL_EIGEN diff --git a/tests/cmake/options.cmake b/tests/cmake/options.cmake index 97a1b19..e0112a0 100644 --- a/tests/cmake/options.cmake +++ b/tests/cmake/options.cmake @@ -5,7 +5,6 @@ add_definitions(-DPRESSIO_ENABLE_CXX17) option(PRESSIO_ENABLE_TPL_EIGEN "Enable Eigen TPL" OFF) option(PRESSIO_ENABLE_TPL_TRILINOS "Enable Trilinos TPL" OFF) -option(PRESSIO_ENABLE_EPETRA "Enable Epetra" OFF) option(PRESSIO_ENABLE_TPL_KOKKOS "Enable Kokkos TPL" OFF) option(PRESSIO_ENABLE_TPL_MPI "Enable MPI" OFF) @@ -34,11 +33,6 @@ if(PRESSIO_ENABLE_TPL_TRILINOS) message(">> PRESSIO_ENABLE_TPL_TRILINOS=ON ==> enabling also BLAS, LAPACK, MPI, KOKKOS") add_definitions(-DPRESSIO_ENABLE_TPL_TRILINOS) - if(PRESSIO_ENABLE_EPETRA) - message("Enabling Epetra since PRESSIO_ENABLE_TPL_TRILINOS=${PRESSIO_ENABLE_TPL_TRILINOS} and PRESSIO_ENABLE_EPETRA=${PRESSIO_ENABLE_EPETRA}.") - add_definitions(-DPRESSIO_ENABLE_EPETRA) - endif() - set(PRESSIO_ENABLE_TPL_KOKKOS ON) set(PRESSIO_ENABLE_TPL_MPI ON) diff --git a/tests/ops/CMakeLists.txt b/tests/ops/CMakeLists.txt index bb68fcc..29c132e 100644 --- a/tests/ops/CMakeLists.txt +++ b/tests/ops/CMakeLists.txt @@ -66,18 +66,4 @@ if(PRESSIO_ENABLE_TPL_TRILINOS) set(SRC1 ${CMAKE_CURRENT_SOURCE_DIR}/ops_teuchos_vector.cc) add_serial_utest(ops_vector_teuchos "${SRC1}") - # EPETRA - if(PRESSIO_ENABLE_EPETRA) - set(SRC1 ${CMAKE_CURRENT_SOURCE_DIR}/ops_epetra_vector.cc) - add_utest_mpi(ops_vector_epetra gTestMain_mpi 3 "${SRC1}") - - set(SRC1 ${CMAKE_CURRENT_SOURCE_DIR}/ops_epetra_multi_vector.cc) - add_utest_mpi(ops_multi_vector_epetra gTestMain_mpi 3 "${SRC1}") - - set(SRC1 ${CMAKE_CURRENT_SOURCE_DIR}/ops_epetra_level2.cc) - add_utest_mpi(ops_level2_epetra gTestMain_mpi 3 "${SRC1}") - - set(SRC1 ${CMAKE_CURRENT_SOURCE_DIR}/ops_epetra_level3.cc) - add_utest_mpi(ops_level3_epetra gTestMain_mpi 3 "${SRC1}") - endif() endif() diff --git a/tests/ops/fixtures/epetra_only_fixtures.hpp b/tests/ops/fixtures/epetra_only_fixtures.hpp deleted file mode 100644 index b83d228..0000000 --- a/tests/ops/fixtures/epetra_only_fixtures.hpp +++ /dev/null @@ -1,123 +0,0 @@ - -#ifndef CONTAINERS_FIXTURES_EPETRA_ONLY_FIXTURES_HPP_ -#define CONTAINERS_FIXTURES_EPETRA_ONLY_FIXTURES_HPP_ - -#include -#include "Epetra_MpiComm.h" -#include "Epetra_Vector.h" -#include "Epetra_MultiVector.h" -#include "Epetra_Import.h" - -struct epetraVectorGlobSize15Fixture - : public ::testing::Test{ - -public: - std::shared_ptr comm_; - int rank_; - int numProc_; - const int localSize_ = 5; - int numGlobalEntries_; - std::shared_ptr contigMap_; - std::shared_ptr myVector_; - - virtual void SetUp(){ - MPI_Comm_rank(MPI_COMM_WORLD, &rank_); - comm_ = std::make_shared(MPI_COMM_WORLD); - rank_ = comm_->MyPID(); - numProc_ = comm_->NumProc(); - EXPECT_EQ(numProc_,3); - - numGlobalEntries_ = numProc_ * localSize_; - contigMap_ = std::make_shared(numGlobalEntries_, 0, *comm_); - myVector_ = std::make_shared(*contigMap_); - } - - virtual void TearDown(){} -}; -//----------------------------------------------------------- - - -struct epetraMultiVectorGlobSize15Fixture - : public ::testing::Test{ - -public: - std::shared_ptr comm_; - int rank_; - int numProc_; - const int numVecs_ = 4; - const int localSize_ = 5; - int numGlobalEntries_; - std::shared_ptr contigMap_; - std::shared_ptr map_to_all_; - std::shared_ptr importer_; - std::shared_ptr myMv_; - std::shared_ptr x_epetra; - std::shared_ptr y_epetra; - - virtual void SetUp(){ - MPI_Comm_rank(MPI_COMM_WORLD, &rank_); - comm_ = std::make_shared(MPI_COMM_WORLD); - rank_ = comm_->MyPID(); - numProc_ = comm_->NumProc(); - EXPECT_EQ(numProc_,3); - - numGlobalEntries_ = numProc_ * localSize_; - contigMap_ = std::make_shared(numGlobalEntries_, 0, *comm_); - // Note: this importer sends whole object to all ranks - map_to_all_ = std::make_shared(numGlobalEntries_, numGlobalEntries_, 0, *comm_); - importer_ = std::make_shared(*map_to_all_, *contigMap_); - - myMv_ = std::make_shared(*contigMap_, numVecs_); - myMv_->PutScalar(1.); - for (int i = 0; i < localSize_; ++i) { - for (int j = 0; j < numVecs_; ++j) { - // generate rank-unique int values - (*myMv_)[j][i] = (double)((rank_ * localSize_ + i) * numVecs_ + j + 1.); - } - } - x_epetra = std::make_shared(*contigMap_); - for (int j = 0; j < localSize_; ++j) { - // generate rank-unique int values - (*x_epetra)[j] = (double)(rank_ * localSize_ + j + 1.); - } - y_epetra = std::make_shared(*contigMap_); - y_epetra->PutScalar(3.); - } - - virtual void TearDown(){} -}; -//----------------------------------------------------------- - - - -struct epetraMultiVectorR9C4VecS9Fixture - : public ::testing::Test{ - -public: - int rank_; - std::shared_ptr comm_; - int numProc_; - const int localSize_ = 3; - const int numVectors_ = 4; - int numGlobalEntries_; - std::shared_ptr dataMap_; - std::shared_ptr myMv_; - std::shared_ptr myVector_; - - virtual void SetUp(){ - MPI_Comm_rank(MPI_COMM_WORLD, &rank_); - comm_ = std::make_shared(MPI_COMM_WORLD); - rank_ = comm_->MyPID(); - numProc_ = comm_->NumProc(); - EXPECT_EQ(numProc_,3); - - numGlobalEntries_ = numProc_ * localSize_; - dataMap_ = std::make_shared(numGlobalEntries_, 0, *comm_); - myMv_ = std::make_shared(*dataMap_, numVectors_); - myVector_ = std::make_shared(*dataMap_); - } - - virtual void TearDown(){} -}; - -#endif /* CONTAINERS_FIXTURES_EPETRA_ONLY_FIXTURES_HPP_ */ diff --git a/tests/ops/ops_epetra_level2.cc b/tests/ops/ops_epetra_level2.cc deleted file mode 100644 index bdd36b5..0000000 --- a/tests/ops/ops_epetra_level2.cc +++ /dev/null @@ -1,233 +0,0 @@ - -#include "epetra_only_fixtures.hpp" -#include "pressio/ops.hpp" - -// convenient alias for nice test names -using ops_epetra = epetraMultiVectorGlobSize15Fixture; - -template -struct EpetraAdapter; - -template <> -struct EpetraAdapter> { - EpetraAdapter(const std::shared_ptr& v): ptr_(v) {} - auto& operator()(int i) { return (*ptr_)[i]; } - - std::shared_ptr ptr_; -}; - -template <> -struct EpetraAdapter> { - EpetraAdapter(const std::shared_ptr& v): ptr_(v) {} - auto& operator()(int i, int j) { return (*ptr_)[j][i]; } - - std::shared_ptr ptr_; -}; - -template -auto adapter(T &v) { - return v; -} - -template <> -auto adapter>(std::shared_ptr &v) { - return EpetraAdapter>(v); -} - -template <> -auto adapter>(std::shared_ptr &v) { - return EpetraAdapter>(v); -} - -template -auto get_global_host_view(T &view, const Epetra_Import& /* importer */) { - // deep copy is needed here, also for expressions - // Note: Kokkos may be not initialized and Eigen may not be in build - auto size = ::pressio::ops::extent(view, 0); - Teuchos::SerialDenseVector v_local(size); - for (decltype(size) i = 0; i < size; ++i) { - v_local(i) = view(i); - } - return v_local; -} - -template <> -auto get_global_host_view(Epetra_MultiVector &mv, const Epetra_Import &importer) { - auto mv_import = std::make_shared(importer.TargetMap(), mv.NumVectors()); - if (0 != mv_import->Import(mv, importer, Insert)) { - throw std::runtime_error("Epetra import failed"); - } - return adapter(mv_import); -} - -template <> -auto get_global_host_view(Epetra_Vector &v, const Epetra_Import &importer) { - auto v_import = std::make_shared(importer.TargetMap(), v.NumVectors()); - if (0 != v_import->Import(v, importer, Insert)) { - throw std::runtime_error("Epetra import failed"); - } - return adapter(v_import); -} - -// adapter proxy ops -namespace pressio{ namespace ops{ - -template size_t extent(const EpetraAdapter &v, int i) { return ::pressio::ops::extent(*v.ptr_, i); } -template void scale(EpetraAdapter &v, double a) { ::pressio::ops::scale(*v.ptr_, a); } -template void set_zero(EpetraAdapter &v) { ::pressio::ops::set_zero(*v.ptr_); } - -}} - -// Note: we need definitions of adapter ops, becuase there are no delcarations like -// void set_zero(T &v); -// which could be used by shared routines. -#include "ops_shared_level2.hpp" - -template < - typename FixtureType, - typename TransMode, - typename AType, - typename XType, - typename YType, - typename ScalarType - > -void test_impl(FixtureType &test, TransMode trans, ScalarType alpha, AType A, XType x, ScalarType beta, YType &y) { - // copy original values, fetch whole vector (from all ranks) to do the verification locally - auto y_ref_h = get_global_host_view(y, *test.importer_); - - // call tested routine on device - pressio::ops::product(trans, alpha, A, x, beta, y); - - // Note: fetch whole data (from all ranks) and run - // the simplified reference routine locally - auto A_h = get_global_host_view(A, *test.importer_); - auto x_h = get_global_host_view(x, *test.importer_); - auto y_h = get_global_host_view(y, *test.importer_); - - // Important: run vanilla_gemv() on all ranks, because it can execute - // cross-rank operations like scale() or set_zero() - vanilla_gemv(trans, alpha, A_h, x_h, beta, y_ref_h); - - if (test.rank_ == 0) { - const size_t y_size = ::pressio::ops::extent(y_h, 0); - for (size_t i = 0; i < y_size; ++i) { - EXPECT_DOUBLE_EQ(y_h(i), y_ref_h(i)); - } - } -} - -template < - typename FixtureType, - typename TransMode, - typename AType, - typename XType, - typename YType - > -void test_impl(FixtureType &test, TransMode trans, AType A, XType x, YType y) { - // non-zero alpha and beta - test_impl(test, trans, 2., A, x, -1., y); - // simulate beta=0 with uninitialized y containing NaN - const auto nan = std::nan("0"); - ::pressio::ops::fill(y, nan); - test_impl(test, trans, 2., A, x, 0., y); - // simulate alpha=0 with NaN in input matrix - auto a00 = A[0][0]; - A[0][0] = nan; - test_impl(test, trans, 0., A, x, 0., y); - // alpha=0, beta=1 - ::pressio::ops::fill(y, 2.); - test_impl(test, trans, 0., A, x, 1., y); - // restore original value - A[0][0] = a00; -} - -//------------------------------------------- -// Test Teuchos x -//------------------------------------------- - -TEST_F(ops_epetra, mv_prod_teuchos_vector) -{ - Teuchos::SerialDenseVector x_teuchos(numVecs_); - x_teuchos = 1.; - - test_impl(*this, ::pressio::nontranspose{}, *myMv_, x_teuchos, *y_epetra); -} - -//------------------------------------------- -// Test Teuchos y -//------------------------------------------- - -TEST_F(ops_epetra, mv_prod_storein_teuchos_vector) -{ - Teuchos::SerialDenseVector y_teuchos(numVecs_); - y_teuchos = 1.; - - test_impl(*this, ::pressio::transpose{}, *myMv_, *x_epetra, y_teuchos); -} - -#ifdef PRESSIO_ENABLE_TPL_EIGEN -//------------------------------------------- -// Test Eigen x -//------------------------------------------- - -TEST_F(ops_epetra, mv_prod_eigen_vector) -{ - Eigen::VectorXd x_eigen(numVecs_); - x_eigen.setConstant(1.); - - test_impl(*this, ::pressio::nontranspose{}, *myMv_, x_eigen, *y_epetra); -} - -TEST_F(ops_epetra, mv_prod_eigen_span) -{ - Eigen::VectorXd x0(numVecs_ + 3); - x0.setConstant(1.); - auto x_eigen_span = pressio::span(x0, 2, numVecs_); - - test_impl(*this, ::pressio::nontranspose{}, *myMv_, x_eigen_span, *y_epetra); -} - -TEST_F(ops_epetra, mv_prod_eigen_diag) -{ - Eigen::MatrixXd M0(numVecs_, numVecs_); - for (int i = 0; i < numVecs_; ++i) { - M0(i, i) = 1.; - } - auto x_eigen_diag = pressio::diagonal(M0); - - test_impl(*this, ::pressio::nontranspose{}, *myMv_, x_eigen_diag, *y_epetra); -} - -//------------------------------------------- -// Test Eigen y -//------------------------------------------- - -TEST_F(ops_epetra, mv_T_vector_storein_eigen_vector) -{ - Eigen::VectorXd y_eigen(numVecs_); - y_eigen.setConstant(1.); - - test_impl(*this, ::pressio::transpose{}, *myMv_, *x_epetra, y_eigen); -} - -TEST_F(ops_epetra, mv_T_vector_storein_eigen_span) -{ - Eigen::VectorXd y0(numVecs_ + 3); - y0.setConstant(1.); - auto y_eigen_span = pressio::span(y0, 2, numVecs_); - - test_impl(*this, ::pressio::transpose{}, *myMv_, *x_epetra, y_eigen_span); -} - -TEST_F(ops_epetra, mv_T_vector_storein_eigen_diag) -{ - Eigen::MatrixXd M0(numVecs_, numVecs_); - for (int i = 0; i < numVecs_; ++i) { - M0(i, i) = 1.; - } - auto y_eigen_diag = pressio::diagonal(M0); - - test_impl(*this, ::pressio::transpose{}, *myMv_, *x_epetra, y_eigen_diag); -} - -#endif diff --git a/tests/ops/ops_epetra_level3.cc b/tests/ops/ops_epetra_level3.cc deleted file mode 100644 index 1fc009e..0000000 --- a/tests/ops/ops_epetra_level3.cc +++ /dev/null @@ -1,130 +0,0 @@ - -#include "epetra_only_fixtures.hpp" -#include "pressio/ops.hpp" - -#ifdef PRESSIO_ENABLE_TPL_EIGEN -TEST_F(epetraMultiVectorGlobSize15Fixture, mv_T_mv_storein_eigen_C) -{ - auto A = pressio::ops::clone(*myMv_); - std::array ac{1.,2.,3.,4.}; - for (int i=0; iPutScalar(ac[i]); - } - - Epetra_MultiVector B(*contigMap_, 3); - std::array bc{1.2, 2.2, 3.2}; - for (int i=0; i<3; ++i) { - B(i)->PutScalar(bc[i]); - } - - Eigen::MatrixXd C(A.NumVectors(), B.NumVectors()); - C.setConstant(0.); - - // C = 1*C + 1.5 A^T B - pressio::ops::product(pressio::transpose(), pressio::nontranspose(), - 1.5, A, B, 1.0, C); - - auto C2 = pressio::ops::product(pressio::transpose(), pressio::nontranspose(), - 1.5, A, B); - - for (auto i=0; i ac{1.,2.,3.,4.}; - for (int i=0; iPutScalar(ac[i]); - } - - Epetra_MultiVector B(*contigMap_, 3); - std::array bc{1.2, 2.2, 3.2}; - for (int i=0; i<3; ++i) { - B(i)->PutScalar(bc[i]); - } - - Eigen::MatrixXd C(A.NumVectors(), B.NumVectors()); - C.setConstant(std::nan("0")); - - // C = 0*NAN + 1.5 A^T B - pressio::ops::product(pressio::transpose(), pressio::nontranspose(), - 1.5, A, B, 0.0, C); - - auto C2 = pressio::ops::product(pressio::transpose(), pressio::nontranspose(), - 1.5, A, B); - - for (auto i=0; i ac{1.,2.,3.,4.}; - for (int i=0; iPutScalar(ac[i]); - } - - Eigen::MatrixXd C(A.NumVectors(), A.NumVectors()); - C.setConstant(0.); - - // C = 1*C + 1.5 A^T A - pressio::ops::product(pressio::transpose(), pressio::nontranspose(), - 1.5, A, 1.0, C); - - auto C2 = pressio::ops::product(pressio::transpose(), pressio::nontranspose(), - 1.5, A); - - if(rank_==0){ - std::cout << C << std::endl; - std::cout << C2 << std::endl; - } - - for (auto i=0; i ac{1.,2.,3.,4.}; - for (int i=0; iPutScalar(ac[i]); - } - - Eigen::MatrixXd C(A.NumVectors(), A.NumVectors()); - C.setConstant(std::nan("0")); - - // C = 0*NAN + 1.5 A^T A - pressio::ops::product(pressio::transpose(), pressio::nontranspose(), - 1.5, A, 0.0, C); - - if(rank_==0){ - std::cout << C << std::endl; - } - - for (auto i=0; iValues()); - - for (int i=0; iPutScalar(82631.); - for (int i=0; iPutScalar(-5.); - auto a = ::pressio::ops::clone(*myMv_); - ::pressio::ops::deep_copy(a, *myMv_); - for (int i=0; iPutScalar(23.); - for (int i=0; iPutScalar(2.); - ::pressio::ops::scale(*myMv_, 3); - for (int i = 0; i < localSize_; ++i){ - for (int j = 0; j < numVecs_; ++j){ - EXPECT_DOUBLE_EQ((*myMv_)[j][i], 6.); - } - } -} - -TEST_F(epetraMultiVectorGlobSize15Fixture, multi_vector_fill) -{ - ::pressio::ops::fill(*myMv_, 55.); - auto & myMv_h = *myMv_; - for (int i=0; iValues()); - - for (int i=0; iPutScalar(23.); - for (int i=0; iPutScalar(-5.); - auto a = pressio::ops::clone(*myVector_); - pressio::ops::deep_copy(a, *myVector_); - - for (int i=0; iPutScalar(23.); - for (int i=0; iPutScalar(1.0); - auto mynorm = pressio::ops::norm2(*myVector_); - EXPECT_NEAR(mynorm, std::sqrt(numProc_ * 5.0), 1e-15); -} - -TEST_F(ops_epetra, vector_norm1) -{ - myVector_->PutScalar(1.0); - auto mynorm = pressio::ops::norm1(*myVector_); - EXPECT_DOUBLE_EQ(mynorm, numProc_ * 5.0); -} - -TEST_F(ops_epetra, vector_pow) -{ - auto & x = *myVector_; - x.PutScalar(2.); - pressio::ops::pow(x, 2.); - for (int i=0; i; -// using map_t = Tpetra::Map<>; -// using vec_t = Tpetra::Vector<>; -// using ST = typename vec_t::scalar_type; - -// Teuchos::RCP comm = -// Teuchos::rcp (new Teuchos::MpiComm(MPI_COMM_WORLD)); -// auto rank = comm->getRank(); -// auto numProc = comm->getSize(); -// EXPECT_EQ(numProc,3); - -// int numLocalEntries = 2; -// auto numGlobalEntries = numProc * numLocalEntries; -// Teuchos::RCP map = -// Teuchos::rcp(new map_t(numGlobalEntries, 0, comm)); - -// auto shift = rank*numLocalEntries; - -// // 1. create vector x and fill with data -// vec_t y(map); -// auto yh = y.getLocalViewHost(); -// vec_t x(map); -// auto xh = x.getLocalViewHost(); -// std::vector x0(numGlobalEntries); -// for (int i=0; i<6; ++i){ -// x0[i] = (double) i; -// x0[i] = -x0[i]; -// } -// for (int i=0; i(); - test_is_not_epetra_container(); test_is_not_tpetra_container(); test_is_not_tpetra_block_container(); test_is_not_kokkos_container(); diff --git a/tests/type_traits/traits_epetra.cc b/tests/type_traits/traits_epetra.cc deleted file mode 100644 index 206bcd9..0000000 --- a/tests/type_traits/traits_epetra.cc +++ /dev/null @@ -1,57 +0,0 @@ -#include -#include "pressio/type_traits.hpp" -#include "traits_shared.hpp" - -namespace pressio { namespace traits { namespace test { - -template < - typename T, - int rank, - typename traits = pressio::Traits -> -void test_epetra_container() -{ - // traits and shared predicates - test_container_traits< - T, - rank, - double /* scalar */ - >(); - - // negative checks (cross-package) - test_is_not_eigen_container(); - test_is_not_teuchos_container(); - test_is_not_tpetra_container(); - test_is_not_tpetra_block_container(); - test_is_not_kokkos_container(); -} - -TEST(epetra, VectorTraits) -{ - using T = Epetra_Vector; - - // traits and shared predicates - test_epetra_container(); - - // vector predicates - static_assert(pressio::is_vector_epetra::value,""); - - // negative checks (within Epetra) - static_assert(pressio::is_multi_vector_epetra::value == false, ""); -} - -TEST(eped_epetra, MVTraits) -{ - using T = Epetra_MultiVector; - - // traits and shared predicates - test_epetra_container(); - - // multi-vector predicates - static_assert(pressio::is_multi_vector_epetra::value,""); - - // negative checks (within Epetra) - static_assert(pressio::is_vector_epetra::value == false,""); -} - -}}} // pressio::traits::test diff --git a/tests/type_traits/traits_kokkos.cc b/tests/type_traits/traits_kokkos.cc index 322c259..5f94dba 100644 --- a/tests/type_traits/traits_kokkos.cc +++ b/tests/type_traits/traits_kokkos.cc @@ -71,7 +71,6 @@ void test_kokkos_container_traits() test_is_not_teuchos_container(); test_is_not_tpetra_container(); test_is_not_tpetra_block_container(); - test_is_not_epetra_container(); } //******************************* diff --git a/tests/type_traits/traits_shared.hpp b/tests/type_traits/traits_shared.hpp index 1df5c87..664ae2e 100644 --- a/tests/type_traits/traits_shared.hpp +++ b/tests/type_traits/traits_shared.hpp @@ -80,16 +80,6 @@ void test_is_not_teuchos_container() { #endif } -template -void test_is_not_epetra_container() { -#ifdef PRESSIO_ENABLE_TPL_TRILINOS -#ifdef PRESSIO_ENABLE_EPETRA - static_assert(pressio::is_vector_epetra::value == false, ""); - static_assert(pressio::is_multi_vector_epetra::value == false, ""); -#endif // PRESSIO_ENABLE_EPETRA -#endif // PRESSIO_ENABLE_TRILINOS -} - template void test_is_not_tpetra_container() { #ifdef PRESSIO_ENABLE_TPL_TRILINOS diff --git a/tests/type_traits/traits_teuchos.cc b/tests/type_traits/traits_teuchos.cc index 28fc2ad..771e621 100644 --- a/tests/type_traits/traits_teuchos.cc +++ b/tests/type_traits/traits_teuchos.cc @@ -19,7 +19,6 @@ void test_teuchos_container() test_is_not_kokkos_container(); test_is_not_tpetra_container(); test_is_not_tpetra_block_container(); - test_is_not_epetra_container(); } //******************************* diff --git a/tests/type_traits/traits_tpetra.cc b/tests/type_traits/traits_tpetra.cc index f1a0537..0ff1f8e 100644 --- a/tests/type_traits/traits_tpetra.cc +++ b/tests/type_traits/traits_tpetra.cc @@ -22,7 +22,6 @@ void test_tpetra_container() test_is_not_eigen_container(); test_is_not_kokkos_container(); test_is_not_teuchos_container(); - test_is_not_epetra_container(); } TEST(tpetra, MVTraits) diff --git a/tests/type_traits/traits_tpetra_block.cc b/tests/type_traits/traits_tpetra_block.cc index 7e6bb3f..62c15dc 100644 --- a/tests/type_traits/traits_tpetra_block.cc +++ b/tests/type_traits/traits_tpetra_block.cc @@ -22,7 +22,6 @@ void test_tpetra_block_container() test_is_not_eigen_container(); test_is_not_kokkos_container(); test_is_not_teuchos_container(); - test_is_not_epetra_container(); } TEST(tpetra_block, VectorTraits)