Hammer  1.0.0
Helicity Amplitude Module for Matrix Element Reweighting
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ScalarContainer.hh
Go to the documentation of this file.
1 ///
2 /// @file ScalarContainer.hh
3 /// @brief Order-0 tensor data container
4 ///
5 
6 //**** This file is a part of the HAMMER library
7 //**** Copyright (C) 2016 - 2020 The HAMMER Collaboration
8 //**** HAMMER is licensed under version 3 of the GPL; see COPYING for details
9 //**** Please note the MCnet academic guidelines; see GUIDELINES for details
10 
11 // -*- C++ -*-
12 #ifndef HAMMER_MATH_MULTIDIM_SCALARCONTAINER
13 #define HAMMER_MATH_MULTIDIM_SCALARCONTAINER
14 
16 
17 namespace Hammer {
18 
19  class Log;
20 
21  namespace Serial {
22 
23  struct FBComplex;
24 
25  }
26 
27  namespace MultiDimensional {
28 
29  class ScalarContainer final : public IContainer {
30  public:
32  ScalarContainer(const Serial::FBComplex* input);
33 
34  size_t rank() const override;
35  IndexList dims() const override;
36  LabelsList labels() const override;
37  size_t numValues() const override;
38  size_t dataSize() const override;
39  size_t entrySize() const override;
40  IndexType labelToIndex(IndexLabel label) const override;
41 
43  const UniqueLabelsList& indices) const override;
44  IndexPairList getSpinLabelPairs() const override;
45 
46  bool isSameShape(const IContainer& other) const override;
47  bool canAddAt(const IContainer& subContainer, IndexLabel coord, IndexType position) const override;
48 
49  reference element(const IndexList& coords = {}) override;
50  ElementType element(const IndexList& coords = {}) const override;
51 
52  reference element(IndexList::const_iterator start, IndexList::const_iterator end) override;
53  ElementType element(IndexList::const_iterator start, IndexList::const_iterator end) const override;
54 
55  bool compare(const IContainer& other) const override;
56  TensorData clone() const override;
57  void clear() override;
58 
59  IContainer& operator*=(double value) override;
60  IContainer& operator*=(const ElementType value) override;
61 
62  IContainer& conjugate() override;
63 
64  SerialType write(flatbuffers::FlatBufferBuilder* msgwriter) const override;
65 
66  private:
67 
69 
70  };
71 
72 
74  TensorData makeScalar(std::complex<double> val);
75 
76  } // namespace MultiDimensional
77 
78 } // namespace Hammer
79 
80 
81 #endif
IContainer & operator*=(double value) override
IndexType labelToIndex(IndexLabel label) const override
bool isSameShape(const IContainer &other) const override
std::pair< flatbuffers::Offset< void >, Serial::FBTensorTypes > SerialType
Definition: IContainer.hh:68
std::vector< IndexPair > IndexPairList
reference element(const IndexList &coords={}) override
IndexPairList getSpinLabelPairs() const override
SerialType write(flatbuffers::FlatBufferBuilder *msgwriter) const override
std::complex< double > ElementType
Definition: IContainer.hh:34
uint16_t IndexType
IndexPairList getSameLabelPairs(const IContainer &other, const UniqueLabelsList &indices) const override
std::unique_ptr< IContainer > TensorData
bool canAddAt(const IContainer &subContainer, IndexLabel coord, IndexType position) const override
Interface class for tensor container data structure.
std::vector< IndexType > IndexList
IndexLabel
label identifiers of tensor indices they are used to determine which indices can be contracted togeth...
Definition: IndexLabels.hh:27
TensorData makeScalar(complex< double > value)
bool compare(const IContainer &other) const override
std::vector< IndexLabel > LabelsList
std::set< IndexLabel > UniqueLabelsList
auto end(reversion_wrapper< T > w)
Definition: Tools/Utils.hh:84