Xped
Loading...
Searching...
No Matches
AdjointOp.hpp
Go to the documentation of this file.
1#ifndef ADJOINT_OP_H_
2#define ADJOINT_OP_H_
3
5
6#include "TensorBase.hpp"
7
8namespace Xped {
9
10template <typename XprType>
11class AdjointOp;
12
13template <typename XprType>
14struct TensorTraits<AdjointOp<XprType>>
15{
16 static constexpr std::size_t Rank = XprType::CoRank;
17 static constexpr std::size_t CoRank = XprType::Rank;
18 typedef typename XprType::Symmetry Symmetry;
19 using AllocationPolicy = typename XprType::AllocationPolicy;
20 typedef typename XprType::Scalar Scalar;
21};
22
23template <typename XprType>
24class AdjointOp : public TensorBase<AdjointOp<XprType>>
25{
26public:
27 static inline constexpr std::size_t Rank = XprType::CoRank;
28 static inline constexpr std::size_t CoRank = XprType::Rank;
29 typedef typename XprType::Scalar Scalar;
30 typedef typename XprType::Symmetry Symmetry;
31 using AllocationPolicy = typename XprType::AllocationPolicy;
32 typedef typename Symmetry::qType qType;
33
34 AdjointOp(XPED_CONST XprType& xpr)
35 : refxpr_(xpr)
36 {}
37
38 inline const std::string name() const { return "AdjointOp"; }
39 constexpr std::size_t rank() const { return refxpr_.corank(); }
40 constexpr std::size_t corank() const { return refxpr_.rank(); }
41
42 inline const auto sector() const { return refxpr_.sector(); }
43 inline const qType sector(std::size_t i) const { return refxpr_.sector(i); }
44
45 // const std::vector<MatrixType> block() const { return refxpr_block(); }
46 // const MatrixType block(std::size_t i) const { return Plain::template adjoint(refxpr_.block(i)); }
47 inline const auto block(std::size_t i) const { return PlainInterface::adjoint(refxpr_.block(i)); }
48 inline auto block(std::size_t i) { return PlainInterface::adjoint(refxpr_.block(i)); }
49
50 inline const auto dict() const { return refxpr_.dict(); }
51
52 inline const mpi::XpedWorld& world() const { return refxpr_.world(); }
53
54 // inline const std::array<Qbasis<Symmetry, 1, Allocator>, XprType::CoRank> uncoupledDomain() const { return refxpr_.uncoupledCodomain(); }
55 // inline const std::array<Qbasis<Symmetry, 1, Allocator>, XprType::Rank> uncoupledCodomain() const { return refxpr_.uncoupledDomain(); }
56 inline const auto uncoupledDomain() const { return refxpr_.uncoupledCodomain(); }
57 inline const auto uncoupledCodomain() const { return refxpr_.uncoupledDomain(); }
58
59 inline const auto coupledDomain() const { return refxpr_.coupledCodomain(); }
60 inline const auto coupledCodomain() const { return refxpr_.coupledDomain(); }
61
62 inline auto domainTrees(const qType& q) const { return refxpr_.codomainTrees(q); }
63 inline auto codomainTrees(const qType& q) const { return refxpr_.domainTrees(q); }
64
65protected:
66 XPED_CONST XprType& refxpr_;
67};
68
69} // namespace Xped
70#endif
Definition: AdjointOp.hpp:25
static constexpr std::size_t CoRank
Definition: AdjointOp.hpp:28
auto codomainTrees(const qType &q) const
Definition: AdjointOp.hpp:63
const mpi::XpedWorld & world() const
Definition: AdjointOp.hpp:52
typename XprType::AllocationPolicy AllocationPolicy
Definition: AdjointOp.hpp:31
const auto block(std::size_t i) const
Definition: AdjointOp.hpp:47
auto block(std::size_t i)
Definition: AdjointOp.hpp:48
static constexpr std::size_t Rank
Definition: AdjointOp.hpp:27
XprType::Symmetry Symmetry
Definition: AdjointOp.hpp:30
const auto uncoupledCodomain() const
Definition: AdjointOp.hpp:57
const qType sector(std::size_t i) const
Definition: AdjointOp.hpp:43
const auto sector() const
Definition: AdjointOp.hpp:42
constexpr std::size_t rank() const
Definition: AdjointOp.hpp:39
const auto dict() const
Definition: AdjointOp.hpp:50
auto domainTrees(const qType &q) const
Definition: AdjointOp.hpp:62
constexpr std::size_t corank() const
Definition: AdjointOp.hpp:40
XPED_CONST XprType & refxpr_
Definition: AdjointOp.hpp:66
const std::string name() const
Definition: AdjointOp.hpp:38
const auto coupledDomain() const
Definition: AdjointOp.hpp:59
const auto coupledCodomain() const
Definition: AdjointOp.hpp:60
Symmetry::qType qType
Definition: AdjointOp.hpp:32
AdjointOp(XPED_CONST XprType &xpr)
Definition: AdjointOp.hpp:34
XprType::Scalar Scalar
Definition: AdjointOp.hpp:29
const auto uncoupledDomain() const
Definition: AdjointOp.hpp:56
Definition: TensorBase.hpp:36
Definition: bench.cpp:62
static MType< typename ctf_traits< MT >::Scalar > adjoint(MT &&M)
Definition: MatrixInterface_Cyclops_impl.cpp:270
typename XprType::AllocationPolicy AllocationPolicy
Definition: AdjointOp.hpp:19
XprType::Symmetry Symmetry
Definition: AdjointOp.hpp:18
XprType::Scalar Scalar
Definition: AdjointOp.hpp:20
Definition: TensorBase.hpp:10
Definition: Mpi.hpp:34