12 #ifndef HAMMER_MATH_MULTIDIMS_OUTERCONTAINER
13 #define HAMMER_MATH_MULTIDIMS_OUTERCONTAINER
34 namespace MultiDimensional {
76 ElementType value(IndexList::const_iterator first, IndexList::const_iterator last)
const;
92 size_t rank()
const override;
110 reference element(IndexList::const_iterator start, IndexList::const_iterator
end)
override;
115 void clear()
override;
122 SerialType write(flatbuffers::FlatBufferBuilder* msgwriter)
const override;
132 std::set<IContainer*>
getUniquePtrs(
bool decoupleConjugates =
false);
133 std::set<IContainer*>
getUniquePtrs(
size_t pos,
bool decoupleConjugates =
false);
153 void addTerm(std::vector<std::pair<SharedTensorData, bool>> tensorsAndConjFlags);
162 std::vector<std::function<ElementType(const IndexList&, IContainer*)>>
_accessors;
size_t numAddends() const
void swapElement(IContainer *oldContainer, TensorData newContainer)
reference element(const IndexList &coords={}) override
bool canAddAt(const IContainer &subContainer, IndexLabel coord, IndexType position) const override
void swapIndexing(BlockIndexing values)
bool shouldBeEvaluated() const
std::pair< flatbuffers::Offset< void >, Serial::FBTensorTypes > SerialType
IndexType labelToIndex(IndexLabel label) const override
std::vector< IndexPair > IndexPairList
OuterContainer & operator=(const OuterContainer &other)
size_t entrySize() const override
Log & getLog() const
logging facility
OuterElemIterator::EntryType EntryType
bool compare(const IContainer &other) const override
std::vector< std::pair< SharedTensorData, bool >> EntryType
std::complex< double > ElementType
size_t rank() const override
DataType::iterator iterator
SerialType write(flatbuffers::FlatBufferBuilder *msgwriter) const override
bool isSameShape(const IContainer &other) const override
std::unique_ptr< IContainer > TensorData
std::shared_ptr< IContainer > SharedTensorData
void reserve(size_t numTerms)
TensorData clone() const override
TensorData combineTensors(const std::vector< TensorData > &base)
std::vector< EntryType > DataType
Interface class for tensor container data structure.
size_t dataSize() const override
DataType::const_iterator const_iterator
std::vector< IndexType > IndexList
TensorData makeOuterSquare(const TensorData &base)
bool isOuterSquare() const
void swap(DataType values)
~OuterContainer() override=default
IndexList dims() const override
IndexLabel
label identifiers of tensor indices they are used to determine which indices can be contracted togeth...
Outer product tensor indexer.
Interface class for single container data structure.
void addTerm(std::vector< std::pair< SharedTensorData, bool >> tensorsAndConjFlags)
const BlockIndexing & getIndexing() const
TensorData combineSharedTensors(std::vector< std::pair< SharedTensorData, bool >> &&data)
std::vector< IndexLabel > LabelsList
std::set< IndexLabel > UniqueLabelsList
IndexPairList getSameLabelPairs(const IContainer &other, const UniqueLabelsList &indices) const override
IContainer & operator*=(double value) override
size_t numValues() const override
bool isDataShared() const
LabelsList labels() const override
IContainer & conjugate() override
ElementType value(const IndexList &indices) const
IndexPairList getSpinLabelPairs() const override
std::vector< std::function< ElementType(const IndexList &, IContainer *)> > _accessors
std::set< IContainer * > getUniquePtrs(bool decoupleConjugates=false)