LCOV - code coverage report
Current view: top level - src/operator - OperatorPair.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 7 8 87.5 %
Date: 2025-05-02 21:49:25 Functions: 2 4 50.0 %

          Line data    Source code
       1             : // SPDX-FileCopyrightText: 2024 Pairinteraction Developers
       2             : // SPDX-License-Identifier: LGPL-3.0-or-later
       3             : 
       4             : #include "pairinteraction/operator/OperatorPair.hpp"
       5             : 
       6             : #include "pairinteraction/basis/BasisPair.hpp"
       7             : #include "pairinteraction/enums/OperatorType.hpp"
       8             : 
       9             : namespace pairinteraction {
      10             : 
      11             : template <typename Scalar>
      12           9 : OperatorPair<Scalar>::OperatorPair(std::shared_ptr<const basis_t> basis)
      13           9 :     : Operator<OperatorPair<Scalar>>(std::move(basis)) {}
      14             : 
      15             : template <typename Scalar>
      16           9 : OperatorPair<Scalar>::OperatorPair(std::shared_ptr<const basis_t> basis, OperatorType type)
      17           9 :     : Operator<OperatorPair<Scalar>>(std::move(basis)) {
      18           9 :     if (type == OperatorType::ENERGY) {
      19           9 :         this->initialize_as_energy_operator();
      20             :     } else {
      21           0 :         throw std::invalid_argument("Only OperatorType::ENERGY is supported.");
      22             :     }
      23           9 : }
      24             : 
      25             : // Explicit instantiations
      26             : template class OperatorPair<double>;
      27             : template class OperatorPair<std::complex<double>>;
      28             : } // namespace pairinteraction

Generated by: LCOV version 1.16