diff --git a/.github/workflows/ci-trilinos.yml b/.github/workflows/ci-trilinos.yml index 70fa63e97..db9935d36 100644 --- a/.github/workflows/ci-trilinos.yml +++ b/.github/workflows/ci-trilinos.yml @@ -37,9 +37,6 @@ jobs: build_type: - Release - Debug - epetra_toggle: - - ON - - OFF runs-on: ubuntu-latest container: ghcr.io/pressio/${{ matrix.image }}:${{ matrix.tag }} @@ -86,7 +83,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 PRESSIO_ENABLE_TPL_BLAS:BOOL=ON \ -D PRESSIO_ENABLE_TPL_LAPACK:BOOL=ON \ diff --git a/docs/source/components/rom_trial_column_subspace.rst b/docs/source/components/rom_trial_column_subspace.rst index f303db1fd..27502037b 100644 --- a/docs/source/components/rom_trial_column_subspace.rst +++ b/docs/source/components/rom_trial_column_subspace.rst @@ -42,10 +42,10 @@ then all of the following must hold: - ``basis_matrix_type`` is a rank-2 matrix data type already supported in pressio, i.e. an Eigen Matrix, a Kokkos rank-2 View, a Trilinos Tpetra multivector, - Tpetra block multivector, or Epetra multivector + or a Tpetra block multivector - ``full_state_type`` is an Eigen vector, a Kokkos rank-1 View, a Trilinos Tpetra vector, - Tpetra block vector, or Epetra vector + or a Tpetra block vector .. - :cpp:`std::is_class::value == true && diff --git a/include/pressio/rom/rom_lspg_unsteady_hypred_updater_trilinos.hpp b/include/pressio/rom/rom_lspg_unsteady_hypred_updater_trilinos.hpp index e5210897f..19a428663 100644 --- a/include/pressio/rom/rom_lspg_unsteady_hypred_updater_trilinos.hpp +++ b/include/pressio/rom/rom_lspg_unsteady_hypred_updater_trilinos.hpp @@ -55,65 +55,6 @@ namespace pressio{ namespace rom{ namespace lspg{ struct HypRedUpdaterTrilinos { -#ifdef PRESSIO_ENABLE_EPETRA - // ----------------- - // EPETRA - // ----------------- - void updateSampleMeshOperandWithStencilMeshOne - (Epetra_Vector & sample_operand, const double alpha, - const Epetra_Vector & stencil_operand, const double beta) const - { - - const auto sample_map = sample_operand.Map(); - std::vector sample_gIDs(sample_operand.MyLength() ); - sample_map.MyGlobalElements( sample_gIDs.data() ); - - const auto stencil_map = stencil_operand.Map(); - std::vector stencil_gIDs(stencil_operand.MyLength() ); - stencil_map.MyGlobalElements( stencil_gIDs.data() ); - - //loop over LOCAL elements of the sample_operand - for (int i=0; i sample_gIDs(sample_operand.MyLength() ); - sample_map.MyGlobalElements( sample_gIDs.data() ); - - const auto stencil_map = stencil_operand.Map(); - std::vector stencil_gIDs(stencil_operand.MyLength() ); - stencil_map.MyGlobalElements( stencil_gIDs.data() ); - - - for (int j=0; j::value and ::pressio::is_multi_vector_tpetra::value) or (::pressio::is_vector_tpetra_block::value and ::pressio::is_multi_vector_tpetra_block::value) -#ifdef PRESSIO_ENABLE_EPETRA - or (::pressio::is_vector_epetra::value and ::pressio::is_multi_vector_epetra::value) -#endif // PRESSIO_ENABLE_EPETRA #endif ) > > : std::true_type{}; -// #if defined PRESSIO_ENABLE_TPL_TRILINOS -// #ifdef PRESSIO_ENABLE_EPETRA -// template -// struct is_legitimate_algo_for_epetra_mv : std::false_type {}; - -// template -// struct is_legitimate_algo_for_epetra_mv::value -// or std::is_same::value -// > -// > : std::true_type{}; -// #endif - -// #if defined PRESSIO_ENABLE_TPL_TRILINOS -// template -// struct is_legitimate_algo_for_tpetra_mv : std::false_type {}; - -// template -// struct is_legitimate_algo_for_tpetra_mv::value -// or std::is_same::value -// > -// > : std::true_type{}; -// #endif // PRESSIO_ENABLE_EPETRA -// #endif // PRESSIO_ENABLE_TPL_TRILINOS - template class QRInPlaceBase { diff --git a/include/pressio/solvers_nonlinear/impl/qr/qr_epetra_multi_vector_modified_gram_schmidt_impl.hpp b/include/pressio/solvers_nonlinear/impl/qr/qr_epetra_multi_vector_modified_gram_schmidt_impl.hpp deleted file mode 100644 index f20f036f4..000000000 --- a/include/pressio/solvers_nonlinear/impl/qr/qr_epetra_multi_vector_modified_gram_schmidt_impl.hpp +++ /dev/null @@ -1,140 +0,0 @@ -/* -//@HEADER -// ************************************************************************ -// -// qr_epetra_multi_vector_modified_gram_schmidt_impl.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 PRESSIO_SOLVERS_NONLINEAR_IMPL_QR_QR_EPETRA_MULTI_VECTOR_MODIFIED_GRAM_SCHMIDT_IMPL_HPP_ -#define PRESSIO_SOLVERS_NONLINEAR_IMPL_QR_QR_EPETRA_MULTI_VECTOR_MODIFIED_GRAM_SCHMIDT_IMPL_HPP_ - -namespace pressio{ namespace qr{ namespace impl{ - -template -class ModGramSchmidtMVEpetra -{ - -public: - using int_t = int; - using sc_t = typename ::pressio::Traits::scalar_type; - using R_nat_t = Eigen::Matrix; - using Q_type = Epetra_MultiVector; - static constexpr sc_t one_ = static_cast(1); - static constexpr sc_t zero_ = static_cast(0); - -public: - ModGramSchmidtMVEpetra() = default; - ~ModGramSchmidtMVEpetra() = default; - - void computeThinOutOfPlace(const MatrixType & Ain) - { - auto & A = const_cast(Ain); - - std::size_t nVecs = ::pressio::ops::extent(A,1); - auto & ArowMap = A.Map(); - createQIfNeeded(ArowMap, nVecs); - createLocalRIfNeeded(nVecs); - - sc_t rkkInv = zero_; - for (std::size_t k=0; kNorm2(&localR_(k,k)); - rkkInv = one_/localR_(k,k); - - auto & qk = (*Qmat_)(k); - qk->Update( rkkInv, *ak, zero_ ); - - for (std::size_t j=k+1; jDot(*aj, &localR_(k,j)); - aj->Update(-localR_(k,j), *qk, one_); - } - } - } - - template - void doLinSolve(const VectorType & rhs, VectorType & y)const { - auto & Rm = localR_.template triangularView(); - y = Rm.solve(rhs); - } - - template < typename VectorInType, typename VectorOutType> - void applyQTranspose(const VectorInType & vecIn, VectorOutType & vecOut) const - { - constexpr auto beta = static_cast(0); - constexpr auto alpha = static_cast(1); - ::pressio::ops::product(::pressio::transpose(), alpha, *this->Qmat_, vecIn, beta, vecOut); - } - - const Q_type & QFactor() const { - return *this->Qmat_; - } - -private: - void createLocalRIfNeeded(size_t newsize){ - const std::size_t locRext0 = ::pressio::ops::extent(localR_, 0); - const std::size_t locRext1 = ::pressio::ops::extent(localR_, 1); - if (locRext0!=newsize or locRext1!=newsize){ - localR_ = R_nat_t(newsize, newsize); - ::pressio::ops::set_zero(localR_); - } - } - - template - void createQIfNeeded(const map_t & map, int cols){ - if (!Qmat_ or !Qmat_->Map().SameAs(map)) - Qmat_ = std::make_shared(map, cols); - } - -private: - R_nat_t localR_ = {}; - - // todo: these must be moved somewhere else - mutable std::shared_ptr Qmat_ = nullptr; - mutable std::shared_ptr Rmat_ = nullptr; -}; - -}}} // end namespace pressio::qr::impl -#endif // PRESSIO_SOLVERS_NONLINEAR_IMPL_QR_QR_EPETRA_MULTI_VECTOR_MODIFIED_GRAM_SCHMIDT_IMPL_HPP_ diff --git a/include/pressio/solvers_nonlinear/impl/qr/qr_epetra_multi_vector_tsqr_impl.hpp b/include/pressio/solvers_nonlinear/impl/qr/qr_epetra_multi_vector_tsqr_impl.hpp deleted file mode 100644 index a7d294179..000000000 --- a/include/pressio/solvers_nonlinear/impl/qr/qr_epetra_multi_vector_tsqr_impl.hpp +++ /dev/null @@ -1,151 +0,0 @@ -/* -//@HEADER -// ************************************************************************ -// -// qr_epetra_multi_vector_tsqr_impl.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 PRESSIO_SOLVERS_NONLINEAR_IMPL_QR_QR_EPETRA_MULTI_VECTOR_TSQR_IMPL_HPP_ -#define PRESSIO_SOLVERS_NONLINEAR_IMPL_QR_QR_EPETRA_MULTI_VECTOR_TSQR_IMPL_HPP_ - -#include "Epetra_TsqrAdaptor.hpp" - -namespace pressio{ namespace qr{ namespace impl{ - -template -class EpetraMVTSQR -{ - -public: - using Q_type = Epetra_MultiVector; - using int_t = int; - using sc_t = typename ::pressio::Traits::scalar_type; - using serden_mat_t = Teuchos::SerialDenseMatrix; - using trcp_mat = Teuchos::RCP; - using tsqr_adaptor_type = Epetra::TsqrAdaptor; - -public: - EpetraMVTSQR() = default; - ~EpetraMVTSQR() = default; - - void computeThinOutOfPlace(const MatrixType & A) - { - auto nVecs = ::pressio::ops::extent(A,1); - auto & ArowMap = A.Map(); - createQIfNeeded(ArowMap, nVecs); - createLocalRIfNeeded(nVecs); - tsqrAdaptor_.factorExplicit(const_cast(A), - *Qmat_, *localR_.get(), false); - } - - template - void doLinSolve(const VectorType & rhs, VectorType & y)const { - qr::impl::solve(rhs, this->localR_, y); - } - - - template < typename VectorInType, typename VectorOutType> - void applyQTranspose(const VectorInType & vecIn, VectorOutType & vecOut) const - { - constexpr auto beta = static_cast(0); - constexpr auto alpha = static_cast(1); - ::pressio::ops::product(::pressio::transpose(), alpha, *this->Qmat_, vecIn, beta, vecOut); - } - - template < typename VectorInType, typename VectorOutType> - void applyRTranspose(const VectorInType & vecIn, VectorOutType & y) const - { - constexpr auto beta = static_cast(0); - constexpr auto alpha = static_cast(1); - ::pressio::ops::product(::pressio::transpose(), alpha, *this->localR_, vecIn, beta, y); - } - - template - std::enable_if_t< - !is_dense_matrix_teuchos::value and !std::is_void::value, - const T & - > - RFactor() const { - this->Rmat_ = std::make_shared(this->localR_->values()); - return *this->Rmat_; - } - - template - std::enable_if_t< - is_dense_matrix_teuchos::value and !std::is_void::value, - const T & - > - RFactor() const { - this->Rmat_ = std::make_shared(*this->localR_, Teuchos::View); - return *this->Rmat_; - } - - const Q_type & QFactor() const { - return *this->Qmat_; - } - -private: - void createLocalRIfNeeded(int newsize){ - if (localR_.is_null() or - (localR_->numRows()!=newsize and localR_->numCols()!=newsize)){ - localR_ = Teuchos::rcp(new serden_mat_t(newsize, newsize) ); - } - } - - template - void createQIfNeeded(const map_t & map, int cols){ - if (!Qmat_ or !Qmat_->Map().SameAs(map)) - Qmat_ = std::make_shared(map, cols); - } - -private: - tsqr_adaptor_type tsqrAdaptor_; - trcp_mat localR_ = {}; - int computedRank_ = {}; - mutable std::shared_ptr Qmat_ = nullptr; - mutable std::shared_ptr Rmat_ = nullptr; -}; - -}}} // end namespace pressio::qr::impl -#endif // PRESSIO_SOLVERS_NONLINEAR_IMPL_QR_QR_EPETRA_MULTI_VECTOR_TSQR_IMPL_HPP_ diff --git a/include/pressio/solvers_nonlinear/impl/qr/qr_epetra_mv_householder_using_eigen_impl.hpp b/include/pressio/solvers_nonlinear/impl/qr/qr_epetra_mv_householder_using_eigen_impl.hpp deleted file mode 100644 index 8b47fe171..000000000 --- a/include/pressio/solvers_nonlinear/impl/qr/qr_epetra_mv_householder_using_eigen_impl.hpp +++ /dev/null @@ -1,145 +0,0 @@ -/* -//@HEADER -// ************************************************************************ -// -// qr_epetra_mv_householder_using_eigen_impl.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 PRESSIO_SOLVERS_NONLINEAR_IMPL_QR_QR_EPETRA_MV_HOUSEHOLDER_USING_EIGEN_IMPL_HPP_ -#define PRESSIO_SOLVERS_NONLINEAR_IMPL_QR_QR_EPETRA_MV_HOUSEHOLDER_USING_EIGEN_IMPL_HPP_ - -#include -#include -#include -#include -#include - -namespace pressio{ namespace qr{ namespace impl{ - -template -class EpetraMVHouseholderUsingEigen -{ - -public: - using sc_t = typename ::pressio::Traits::scalar_type; - using Q_type = Epetra_MultiVector; - using eig_dyn_mat = Eigen::MatrixXd; - using help_impl_t = QRHouseholderDenseEigenMatrix; - -private: - help_impl_t myImpl_ = {}; - -public: - EpetraMVHouseholderUsingEigen() = default; - ~EpetraMVHouseholderUsingEigen() = default; - - template < typename VectorInType, typename VectorOutType> - void applyQTranspose(const VectorInType & vecIn, VectorOutType & vecOut) const - { - constexpr auto beta = static_cast(0); - constexpr auto alpha = static_cast(1); - ::pressio::ops::product(::pressio::transpose(), alpha, *this->Qmat_, vecIn, beta, vecOut); - } - - template - void doLinSolve(const VectorType & rhs, VectorType & y)const - { - myImpl_.template doLinSolve(rhs, y); - } - - const Q_type & QFactor() const - { - return *this->Qmat_; - } - - template < typename VectorInType, typename VectorOutType> - void applyRTranspose(const VectorInType & vecIn, VectorOutType & y) const - { - myImpl_.applyRTranspose(vecIn, y); - } - - void computeThinOutOfPlace(const MatrixType & A) - { - std::size_t rows = ::pressio::ops::extent(A,0); - std::size_t cols = ::pressio::ops::extent(A,1); - auto & ArowMap = A.Map(); - - // convert it to replicated eptra matrix - Epetra_LocalMap locMap((int)rows, (int)0, A.Comm()); - Epetra_Import importer(locMap, ArowMap); - MatrixType A2(locMap, cols); - A2.Import(A, importer, Insert); - - // store it into an Eigen matrix - eig_dyn_mat eA2W(rows,cols); - for (int i=0;i<(int)rows;i++){ - for (int j=0;j<(int)cols;j++){ - eA2W(i,j) = A2[j][i]; - } - } - - myImpl_.computeThinOutOfPlace(eA2W); - - // store Q into replicated Epetra_Multivector - const auto & Q2 = myImpl_.QFactor(); - Q_type locQ(locMap,Q2.cols()); - for (int i=0;i<(int)Q2.rows();i++){ - for (int j=0;j<(int)Q2.cols();j++){ - locQ[j][i] = Q2(i,j); - } - } - - // import from local to distributed - Qmat_ = std::make_shared(ArowMap, Q2.cols()); - Epetra_Import importer2(ArowMap, locMap); - Qmat_->Import(locQ, importer2, Insert); - } - -private: - mutable std::shared_ptr Qmat_ = nullptr; - mutable std::shared_ptr Rmat_ = nullptr; -}; - -}}} // end namespace pressio::qr::impl -#endif // PRESSIO_SOLVERS_NONLINEAR_IMPL_QR_QR_EPETRA_MV_HOUSEHOLDER_USING_EIGEN_IMPL_HPP_ diff --git a/include/pressio/solvers_nonlinear/impl/qr/qr_fwd.hpp b/include/pressio/solvers_nonlinear/impl/qr/qr_fwd.hpp index d8f769d85..82d85dff0 100644 --- a/include/pressio/solvers_nonlinear/impl/qr/qr_fwd.hpp +++ b/include/pressio/solvers_nonlinear/impl/qr/qr_fwd.hpp @@ -60,17 +60,9 @@ namespace impl{ #if defined PRESSIO_ENABLE_TPL_TRILINOS #ifdef PRESSIO_ENABLE_TPL_EIGEN -#ifdef PRESSIO_ENABLE_EPETRA -template class EpetraMVHouseholderUsingEigen; -#endif // PRESSIO_ENABLE_EPETRA template class TpetraMVHouseholderUsingEigen; #endif // PRESSIO_ENABLE_TPL_EIGEN -#ifdef PRESSIO_ENABLE_EPETRA -template class EpetraMVTSQR; -template class ModGramSchmidtMVEpetra; -#endif // PRESSIO_ENABLE_EPETRA - template class TpetraMVTSQR; template class ModGramSchmidtMVTpetra; template class TpetraBlockMVTSQR; diff --git a/include/pressio/solvers_nonlinear/impl/qr/qr_traits.hpp b/include/pressio/solvers_nonlinear/impl/qr/qr_traits.hpp index c2aac801b..d9f9da08b 100644 --- a/include/pressio/solvers_nonlinear/impl/qr/qr_traits.hpp +++ b/include/pressio/solvers_nonlinear/impl/qr/qr_traits.hpp @@ -101,23 +101,6 @@ struct Traits< template struct impl_class_helper{}; -#ifdef PRESSIO_ENABLE_EPETRA -template -struct impl_class_helper{ - using impl_t = qr::impl::EpetraMVHouseholderUsingEigen; -}; - -template -struct impl_class_helper{ - using impl_t = qr::impl::EpetraMVTSQR; -}; - -template -struct impl_class_helper{ - using impl_t = qr::impl::ModGramSchmidtMVEpetra; -}; -#endif // PRESSIO_ENABLE_EPETRA - template struct impl_class_helper< matrix_t, qr::TSQR, R_t, @@ -161,39 +144,6 @@ struct impl_class_helper< using impl_t = qr::impl::TpetraMVHouseholderUsingEigen; }; -#ifdef PRESSIO_ENABLE_EPETRA -/* - * specialize for Epetra::MultiVector, R_type = void - */ -template -struct Traits< - qr::impl::QRSolver - > : qr_traits_shared_all -{ - - static_assert( - std::is_same::value or - std::is_same::value or - std::is_same::value, - "Currently, only TSQR, ModifiedGramSchmidt and Householder are available for \ - Epetra dense matrices. Use TSQR because it is fast and accurate. ModifiedGramSchmidt \ - and Householder are just here for testing purposes. "); - - using traits_all_t = qr_traits_shared_all; - using typename traits_all_t::matrix_t; - using typename traits_all_t::sc_t; - - using impl_t = typename impl_class_helper::impl_t; - using Q_type = typename impl_t::Q_type; - - using concrete_t = qr::impl::QRSolver; - using inplace_base_t = qr::QRInPlaceBase; - using outplace_base_t = qr::QROutOfPlaceBase; - using base_compute_t = typename std::conditional::type; - using base_solve_t = qr::QRSolveBase; -}; -#endif // PRESSIO_ENABLE_EPETRA - /* * specialize for Tpetra::MultiVector, R_type = void */ diff --git a/tests/cmake/options.cmake b/tests/cmake/options.cmake index 31a06218b..d327d0fa8 100644 --- a/tests/cmake/options.cmake +++ b/tests/cmake/options.cmake @@ -17,7 +17,6 @@ endif() option(PRESSIO_ENABLE_TPL_EIGEN "Enable Eigen TPL" ON) 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) @@ -46,11 +45,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) set(PRESSIO_ENABLE_TPL_BLAS ON) diff --git a/tests/functional_small/solvers_nonlinear/problems/LISTOFPROBLEMS.md b/tests/functional_small/solvers_nonlinear/problems/LISTOFPROBLEMS.md index d3c1fc158..1c4fff805 100644 --- a/tests/functional_small/solvers_nonlinear/problems/LISTOFPROBLEMS.md +++ b/tests/functional_small/solvers_nonlinear/problems/LISTOFPROBLEMS.md @@ -103,7 +103,7 @@ why it is included, where it was found ======================================================== - datafit with 5 vars and 33 equations (overdetermined) - [header](./problem6.hpp) -- Epetra +- Eigen - RealSystemWithResidualAndJacobian - minpack problem - links: @@ -113,15 +113,15 @@ why it is included, where it was found ======================================================== # problem 7 ======================================================== -- datafit with 11 vars and 65 equations (overdetermined) -- [header](./problem7.hpp) -- Epetra +- datafit with 5 vars and 33 equations (overdetermined) +- [header](./problem6.hpp) +- Tpetra - RealSystemWithResidualAndJacobian - minpack problem - links: - - sec 3.5 http://ftp.mcs.anl.gov/pub/tech_reports/reports/P153.pdf - (note that there is a typo: n=9 is wrong, should be n=11 - - data from http://ftp.mcs.anl.gov/pub/MINPACK-2/tprobs/dgdffj.f + - sec 3.4 http://ftp.mcs.anl.gov/pub/tech_reports/reports/P153.pdf + - data from http://ftp.mcs.anl.gov/pub/MINPACK-2/tprobs/dedffj.f + ======================================================== # problem 8 diff --git a/tests/functional_small/solvers_nonlinear/problems/problem6.hpp b/tests/functional_small/solvers_nonlinear/problems/problem6.hpp index 269330484..62233b758 100644 --- a/tests/functional_small/solvers_nonlinear/problems/problem6.hpp +++ b/tests/functional_small/solvers_nonlinear/problems/problem6.hpp @@ -7,108 +7,70 @@ namespace pressio{ namespace solvers{ namespace test{ template struct Problem6 { - const int numEq_ = 33; - const int numUn_ = 5; - template - using shptr = std::shared_ptr; - using scalar_type = double; using state_type = Eigen::VectorXd; - using residual_type = Epetra_Vector; - using vec_type = Epetra_Vector; - using jacobian_type = Epetra_MultiVector; - - shptr comm_ = {}; - int rank_ = {}; - int numProc_ = {}; - - shptr rowMap_ = {}; - int NumMyElem_ = {}; // num of my elements - std::vector myGel_ = {}; // my global elements - - shptr R_ = {}; - shptr J_ = {}; - shptr tt_ = {}; // store the t value for the data - shptr yy_ = {}; // store the y values - - const std::vector trueS = {0.37541005210628, - 1.9358469126255, - -1.4646871365262, - 0.012867534639885, - 0.022122699662032}; - - void storeTimes(){ - int i=0; - for (auto const & it : myGel_){ - (*tt_)[i] = 10. * static_cast(it); - i++; + using residual_type = state_type; + using jacobian_type = Eigen::MatrixXd; + + const int m = 33; + const int n = 5; + + std::vector times_; + const std::vector y_ = + {8.44e-1, 9.08e-1, 9.32e-1, + 9.36e-1, 9.25e-1, 9.08e-1, + 8.81e-1, 8.5e-1, 8.18e-1, + 7.84e-1, 7.51e-1, 7.18e-1, + 6.85e-1, 6.58e-1, 6.28e-1, + 6.03e-1, 5.8e-1, 5.58e-1, + 5.38e-1, 5.22e-1, 5.06e-1, + 4.9e-1, 4.78e-1, 4.67e-1, + 4.57e-1, 4.48e-1, 4.38e-1, + 4.31e-1, 4.24e-1, 4.2e-1, + 4.14e-1, 4.11e-1, 4.06e-1}; + + Problem9() : times_(m){ + for (int i=0; i allYs = {8.44e-1, 9.08e-1, 9.32e-1, - 9.36e-1, 9.25e-1, 9.08e-1, - 8.81e-1, 8.5e-1, 8.18e-1, - 7.84e-1, 7.51e-1, 7.18e-1, - 6.85e-1, 6.58e-1, 6.28e-1, - 6.03e-1, 5.8e-1, 5.58e-1, - 5.38e-1, 5.22e-1, 5.06e-1, - 4.9e-1, 4.78e-1, 4.67e-1, - 4.57e-1, 4.48e-1, 4.38e-1, - 4.31e-1, 4.24e-1, 4.2e-1, - 4.14e-1, 4.11e-1, 4.06e-1}; - - int i=0; - for (auto const & it : myGel_){ - (*yy_)[i] = allYs[it]; - i++; - }; + state_type createState() const { + state_type a(n); + a.setZero(); + return a; } - Problem6(){ - MPI_Comm_rank(MPI_COMM_WORLD, &rank_); - comm_ = std::make_shared(MPI_COMM_WORLD); - rank_ = comm_->MyPID(); - numProc_ = comm_->NumProc(); - assert(numProc_==2 or numProc_==3); - - // create map - rowMap_ = std::make_shared(numEq_, 0, *comm_); - // store my elements - NumMyElem_ = rowMap_->NumMyElements(); - myGel_.resize(NumMyElem_); - rowMap_->MyGlobalElements(myGel_.data()); + residual_type createResidual() const { + residual_type a(m); + a.setZero(); + return a; + } - R_ = std::make_shared(*rowMap_); - J_ = std::make_shared(*rowMap_, numUn_); - tt_ = std::make_shared(*rowMap_); - yy_ = std::make_shared(*rowMap_); - storeTimes(); - storeYValues(); + jacobian_type createJacobian() const { + jacobian_type a(m, n); + a.setZero(); + return a; } inline scalar_type model(const state_type & x, scalar_type t)const{ return x(0) + x(1) * exp(-t*x(3)) + x(2)*exp(-t*x(4)); } - state_type createState() const{ return state_type(numUn_); } - residual_type createResidual() const{ return *R_; } - jacobian_type createJacobian() const{ return *J_; } - void residualAndJacobian(const state_type& x, residual_type& res, std::optional Jin) const { auto * jac = Jin.value_or(nullptr); for (int i=0; imodel(x, t); + const scalar_type t = times_[i]; + r[i] = y_[i] - this->model(x, t); if (jac){ - (*jac)[0][i] = -1.0; - (*jac)[1][i] = -exp(-t*x(3)); - (*jac)[2][i] = -exp(-t*x(4)); - (*jac)[3][i] = x(1)*exp(-t*x(3))*t; - (*jac)[4][i] = x(2)*exp(-t*x(4))*t; + (*jac)(i,0) = -1.0; + (*jac)(i,1) = -exp(-t*x(3)); + (*jac)(i,2) = -exp(-t*x(4)); + (*jac)(i,3) = x(1)*exp(-t*x(3))*t; + (*jac)(i,4) = x(2)*exp(-t*x(4))*t; } } } diff --git a/tests/functional_small/solvers_nonlinear/problems/problem7.hpp b/tests/functional_small/solvers_nonlinear/problems/problem7.hpp index d838c2121..047439f48 100644 --- a/tests/functional_small/solvers_nonlinear/problems/problem7.hpp +++ b/tests/functional_small/solvers_nonlinear/problems/problem7.hpp @@ -7,135 +7,70 @@ namespace pressio{ namespace solvers{ namespace test{ template struct Problem7 { - const int numEq_ = 65; - const int numUn_ = 11; - - template - using shptr = std::shared_ptr; - - using state_type = Eigen::VectorXd; - using residual_type = Epetra_Vector; - using vec_type = Epetra_Vector; - using jacobian_type = Epetra_MultiVector; using scalar_type = double; - - shptr comm_ = {}; - int rank_ = {}; - int numProc_ = {}; - - shptr rowMap_ = {}; - int NumMyElem_ = {}; // num of my elements - std::vector myGel_ = {}; // my global elements - - shptr R_ = {}; - shptr J_ = {}; - shptr tt_ = {}; // store the t value for the data - shptr yy_ = {}; // store the y values - - const std::vector trueS = - {1.3099771546537, 0.43155379466611, - 0.63366169898352, 0.59943053483825, - 0.75418322650124, 0.90428857933176, - 1.3658118355256, 4.82369881684, - 2.3986848661039, 4.5688745976743, - 5.67534147057}; - - void storeTimes(){ - int i=0; - for (auto const & it : myGel_){ - (*tt_)[i] = static_cast(it)/10.; - i++; + using state_type = Tpetra::Vector<>; + using residual_type = state_type; + using jacobian_type = Tpetra::MultiVector<>; + + const int m = 33; + const int n = 5; + + std::vector times_; + const std::vector y_ = + {8.44e-1, 9.08e-1, 9.32e-1, + 9.36e-1, 9.25e-1, 9.08e-1, + 8.81e-1, 8.5e-1, 8.18e-1, + 7.84e-1, 7.51e-1, 7.18e-1, + 6.85e-1, 6.58e-1, 6.28e-1, + 6.03e-1, 5.8e-1, 5.58e-1, + 5.38e-1, 5.22e-1, 5.06e-1, + 4.9e-1, 4.78e-1, 4.67e-1, + 4.57e-1, 4.48e-1, 4.38e-1, + 4.31e-1, 4.24e-1, 4.2e-1, + 4.14e-1, 4.11e-1, 4.06e-1}; + + Problem9() : times_(m){ + for (int i=0; i allYs = - {1.366, 1.191, 1.112, 1.013, - 9.91e-1, 8.85e-1, 8.31e-1, 8.47e-1, - 7.86e-1, 7.25e-1, 7.46e-1, 6.79e-1, - 6.08e-1, 6.55e-1, 6.16e-1, 6.06e-1, - 6.02e-1, 6.26e-1, 6.51e-1, 7.24e-1, - 6.49e-1, 6.49e-1, 6.94e-1, 6.44e-1, - 6.24e-1, 6.61e-1, 6.12e-1, 5.58e-1, - 5.33e-1, 4.95e-1, 5.0e-1, 4.23e-1, - 3.95e-1, 3.75e-1, 3.72e-1, 3.91e-1, - 3.96e-1, 4.05e-1, 4.28e-1, 4.29e-1, - 5.23e-1, 5.62e-1, 6.07e-1, 6.53e-1, - 6.72e-1, 7.08e-1, 6.33e-1, 6.68e-1, - 6.45e-1, 6.32e-1, 5.91e-1, 5.59e-1, - 5.97e-1, 6.25e-1, 7.39e-1, 7.1e-1, - 7.29e-1, 7.2e-1, 6.36e-1, 5.81e-1, - 4.28e-1, 2.92e-1, 1.62e-1, 9.8e-2, 5.4e-2}; - - int i=0; - for (auto const & it : myGel_){ - (*yy_)[i] = allYs[it]; - i++; - }; + state_type createState() const { + state_type a(n); + a.setZero(); + return a; } - Problem7(){ - MPI_Comm_rank(MPI_COMM_WORLD, &rank_); - comm_ = std::make_shared(MPI_COMM_WORLD); - rank_ = comm_->MyPID(); - numProc_ = comm_->NumProc(); - assert(numProc_==2 or numProc_==3); - - // create map - rowMap_ = std::make_shared(numEq_, 0, *comm_); - // store my elements - NumMyElem_ = rowMap_->NumMyElements(); - myGel_.resize(NumMyElem_); - rowMap_->MyGlobalElements(myGel_.data()); + residual_type createResidual() const { + residual_type a(m); + a.setZero(); + return a; + } - R_ = std::make_shared(*rowMap_); - J_ = std::make_shared(*rowMap_, numUn_); - tt_ = std::make_shared(*rowMap_); - yy_ = std::make_shared(*rowMap_); - storeTimes(); - storeYValues(); - std::cout << std::endl; - }//setUp + jacobian_type createJacobian() const { + jacobian_type a(m, n); + a.setZero(); + return a; + } inline scalar_type model(const state_type & x, scalar_type t)const{ - auto temp1 = exp(-x(4)*t); - auto temp2 = exp(-x(5) * (t-x(8)) * (t-x(8)) ); - auto temp3 = exp(-x(6) * (t-x(9)) * (t-x(9)) ); - auto temp4 = exp(-x(7) * (t-x(10)) * (t-x(10)) ); - return x(0)*temp1 + x(1)*temp2 + x(2)*temp3 + x(3)*temp4; + return x(0) + x(1) * exp(-t*x(3)) + x(2)*exp(-t*x(4)); } - state_type createState() const{ return state_type(numUn_); } - residual_type createResidual() const{ return *R_; } - jacobian_type createJacobian() const{ return *J_; } - void residualAndJacobian(const state_type& x, residual_type& res, std::optional Jin) const { auto * jac = Jin.value_or(nullptr); - for (int i=0; imodel(x, t); - - auto temp1 = exp(-x(4)*t); - auto temp2 = exp(-x(5) * (t-x(8)) * (t-x(8)) ); - auto temp3 = exp(-x(6) * (t-x(9)) * (t-x(9)) ); - auto temp4 = exp(-x(7) * (t-x(10)) * (t-x(10)) ); + const scalar_type t = times_[i]; + r[i] = y_[i] - this->model(x, t); if (jac){ - (*jac)[0][i] = -temp1; - (*jac)[1][i] = -temp2; - (*jac)[2][i] = -temp3; - (*jac)[3][i] = -temp4; - (*jac)[4][i] = x(0)*temp1*t; - (*jac)[5][i] = x(1) * (t-x(8)) * (t-x(8)) * temp2; - (*jac)[6][i] = x(2) * (t-x(9)) * (t-x(9)) * temp3; - (*jac)[7][i] = x(3) * (t-x(10)) * (t-x(10)) * temp4; - (*jac)[8][i] = -2.*x(1)*x(5)*(t-x(8))*temp2; - (*jac)[9][i] = -2.*x(2)*x(6)*(t-x(9))*temp3; - (*jac)[10][i] = -2.*x(3)*x(7)*(t-x(10))*temp4; + (*jac)(i,0) = -1.0; + (*jac)(i,1) = -exp(-t*x(3)); + (*jac)(i,2) = -exp(-t*x(4)); + (*jac)(i,3) = x(1)*exp(-t*x(3))*t; + (*jac)(i,4) = x(2)*exp(-t*x(4))*t; } } } diff --git a/tests/functional_small/solvers_nonlinear/qr/CMakeLists.txt b/tests/functional_small/solvers_nonlinear/qr/CMakeLists.txt index 24a7158b2..6ef5aa452 100644 --- a/tests/functional_small/solvers_nonlinear/qr/CMakeLists.txt +++ b/tests/functional_small/solvers_nonlinear/qr/CMakeLists.txt @@ -5,7 +5,4 @@ endif() if(PRESSIO_ENABLE_TPL_TRILINOS) add_utest_mpi(${TESTING_LEVEL}_qr_tpetra gTestMain_tpetra 2 qr_tpetra.cc) - if(PRESSIO_ENABLE_EPETRA) - add_utest_mpi(${TESTING_LEVEL}_qr_epetra gTestMain_mpi 2 qr_epetra.cc) - endif() endif() diff --git a/tests/functional_small/solvers_nonlinear/qr/fixtures.hpp b/tests/functional_small/solvers_nonlinear/qr/fixtures.hpp index f5246075e..fb657a875 100644 --- a/tests/functional_small/solvers_nonlinear/qr/fixtures.hpp +++ b/tests/functional_small/solvers_nonlinear/qr/fixtures.hpp @@ -7,10 +7,6 @@ #include "qr_r9c4_gold.hpp" #include -#ifdef PRESSIO_ENABLE_EPETRA -#include "Epetra_MpiComm.h" -#endif // PRESSIO_ENABLE_EPETRA - #ifdef PRESSIO_ENABLE_TPL_EIGEN #include "Eigen/Dense" #endif @@ -82,83 +78,6 @@ struct eigenDenseR9Fixture #ifdef PRESSIO_ENABLE_TPL_TRILINOS -#ifdef PRESSIO_ENABLE_EPETRA -struct epetraR9Fixture - : public ::testing::Test{ - - using this_t = epetraR9Fixture; - using mymvec_t = Epetra_MultiVector; - using myvec_t = Epetra_Vector; - - // gold solution - pressio::qr::test::qrGoldr9c4Sol gold_; - - std::shared_ptr comm_; - std::shared_ptr rowMap_; - std::shared_ptr A_; - std::shared_ptr v_; - - const int numVectors_ = pressio::qr::test::numVectors_; - int rank_ = {}; - int numProc_ = {}; - int numGlobalEntries_ = {}; - int localSize_ = {}; - int shift_ = {}; - - virtual void SetUp(){ - MPI_Comm_rank(MPI_COMM_WORLD, &rank_); - comm_ = std::make_shared(MPI_COMM_WORLD); - rank_ = comm_->MyPID(); - numProc_ = comm_->NumProc(); - localSize_ = (rank_==0) ? 5 : 4; - shift_ = (rank_==0) ? 0 : 5; - assert(numProc_ == 2); - numGlobalEntries_ = pressio::qr::test::numRows_; - - rowMap_ = std::make_shared(numGlobalEntries_, 0, *comm_); - A_ = std::make_shared(*rowMap_, numVectors_); - v_ = std::make_shared(*rowMap_); - A_->PutScalar(0); - v_->PutScalar(0); - - fillVector(); - fillMatrix(); - } - - void fillMatrix() - { - if(rank_==0){ - (*A_)[0][0] = 3.2; (*A_)[1][0] = 1.2; (*A_)[2][0] = 1.; - (*A_)[0][1] = 1.2; (*A_)[2][1] = -2.2; - (*A_)[1][2] = 4.0; (*A_)[3][2] = -2.; - (*A_)[1][3] = 4.; - (*A_)[2][4] = -1.; (*A_)[3][4] = -4.; - } - if(rank_==1){ - (*A_)[0][0] = 0.2; (*A_)[1][0] = 5.; (*A_)[2][0] = 1.; - (*A_)[0][1] = 1.; (*A_)[1][1] = 1.1; (*A_)[2][1] = 1.25; (*A_)[3][1] = -3.; - (*A_)[2][2] = 1.; (*A_)[1][2] = 0.1111; (*A_)[3][2] = 6.; - } - // A_->Print(std::cout); - } - - void fillVector(){ - pressio::ops::fill(*v_.get(), 1.); - } - - void checkQFactor(const mymvec_t & Q){ - EXPECT_EQ( Q.GlobalLength(), ::pressio::qr::test::numRows_); - EXPECT_EQ( Q.NumVectors(), ::pressio::qr::test::numVectors_); - - for (auto i=0; i qrObj; - qrObj.computeThin( *A_ ); - const auto & Q = qrObj.cRefQFactor(); - Q.Print(std::cout); - checkQFactor(Q); -} - -TEST_F(epetraR9Fixture, TSQRepetraMultiVectorOutOfPlace) -{ - using namespace pressio; - - // default: R_type == void, in_place = false - using qr_algo = qr::TSQR; - qr::QRSolver qrObj; - qrObj.computeThin( *A_ ); - const auto & Q = qrObj.cRefQFactor(); - Q.Print(std::cout); - checkQFactor(Q); -} - -TEST_F(epetraR9Fixture, - ModGrShEpetraMultiVectorOutOfPlace) -{ - using namespace pressio; - - // default: R_type == void, in_place = false - using qr_algo = qr::ModifiedGramSchmidt; - qr::QRSolver qrObj; - qrObj.computeThin( *A_ ); - const auto & Q = qrObj.cRefQFactor(); - Q.Print(std::cout); - checkQFactor(Q); -} - -TEST_F(epetraR9Fixture, - TSQREpetraMVOutOfPlaceAndSolveTeuchosVector) -{ - using namespace pressio; - - //default: R_type == void, in_place = false - using qr_algo = qr::TSQR; - qr::QRSolver qrObj; - qrObj.computeThin( *A_ ); - - // do Q^T * v_ - Teuchos::SerialDenseVector rhs(pressio::qr::test::numVectors_); - qrObj.applyQTranspose(*v_, rhs); - - // solve - Teuchos::SerialDenseVector y; - y.resize(pressio::qr::test::numVectors_); - qrObj.solve(rhs, y); - - EXPECT_EQ(y.length(), 4); - gold_.checkYForRsolve(y); -} - -#ifdef PRESSIO_ENABLE_TPL_EIGEN -TEST_F(epetraR9Fixture, - TSQREpetraMVOutOfPlaceAndSolveEigenVecDynamic) -{ - using namespace pressio; - - // default: R_type == void, in_place = false - using qr_algo = qr::TSQR; - qr::QRSolver qrObj; - qrObj.computeThin(*A_); - - // do Q^T * v_ - Eigen::VectorXd rhs(pressio::qr::test::numVectors_); - qrObj.applyQTranspose(*v_, rhs); - if (rank_==0) - std::cout << " RHS" << std::setprecision(14) << rhs << std::endl; - - // solve - Eigen::VectorXd y(pressio::qr::test::numVectors_); - qrObj.solve(rhs, y); - if (rank_==0) - std::cout << std::setprecision(14) << " Y: " << y << std::endl; - - EXPECT_EQ(y.size(), 4); - gold_.checkYForRsolve(y); -} - -TEST_F(epetraR9Fixture, - TSQREpetraMVOutOfPlaceAndSolveEigenVecStatic) -{ - using namespace pressio; - - using myv_t = Eigen::Matrix; - - // default: R_type == void, in_place = false - using qr_algo = qr::TSQR; - qr::QRSolver qrObj; - qrObj.computeThin( *A_ ); - - // do Q^T * v_ - myv_t rhs; - qrObj.applyQTranspose(*v_, rhs); - if (rank_==0) - std::cout << " RHS" << std::setprecision(14) - << *rhs.data() << std::endl; - - // solve - myv_t y; - qrObj.solve(rhs, y); - if (rank_==0) - std::cout << std::setprecision(14) - << " Y: " - << *y.data() << std::endl; - - gold_.checkYForRsolve(y); -} -#endif