12 #ifndef HAMMER_MATH_MULTIDIM_VECTORCONTAINER
13 #define HAMMER_MATH_MULTIDIM_VECTORCONTAINER
19 #include <type_traits>
34 struct FBSingleTensor;
38 namespace MultiDimensional {
58 ElementType value(IndexList::const_iterator first, IndexList::const_iterator last)
const;
77 size_t rank()
const override;
100 void clear()
override;
107 SerialType write(flatbuffers::FlatBufferBuilder* msgwriter)
const override;
126 void next(
int n = 1)
override;
133 DataType::const_iterator
_it;
152 void swap(std::vector<std::complex<double>>& values);
std::pair< flatbuffers::Offset< void >, Serial::FBTensorTypes > SerialType
size_t rank() const override
friend TensorData makeVector(IndexList, LabelsList, std::vector< std::complex< double >>)
DataType::const_iterator const_iterator
LabeledIndexing< SequentialIndexing > _indexing
const LabeledIndexing< SequentialIndexing > & getIndexing() const
bool compare(const IContainer &other) const override
std::unique_ptr< ItBase > NonZeroIt
Log & getLog() const
logging facility
DataType::const_iterator _it
reference operator[](PositionType pos)
std::vector< IndexPair > IndexPairList
LabelsList labels() const override
TensorData clone() const override
ItSequential(DataType::const_iterator it, PositionType maxPosition, PositionType pos=0, PositionType nonZeroPos=0)
IContainer & operator*=(double value) override
DataType::iterator iterator
VectorContainer(const IndexList &dimensions, const LabelsList &labels)
size_t dataSize() const override
TensorData makeVector(IndexList dimensions, LabelsList labels, vector< complex< double >> values)
void swap(std::vector< std::complex< double >> &values)
Non-sparse tensor indexer.
std::complex< double > ElementType
PositionType position() const override
std::unique_ptr< IContainer > TensorData
bool isSame(const ItBase &other) const override
const ElementType & const_reference
void setValue(const IndexList &indices, ElementType value=0.)
Iterator to cycle over outer products of containers.
size_t numValues() const override
std::vector< IndexType > IndexList
SerialType write(flatbuffers::FlatBufferBuilder *msgwriter) const override
ptrdiff_t distanceFrom(const ItBase &other) const override
ElementType value(const IndexList &indices) const
IndexLabel
label identifiers of tensor indices they are used to determine which indices can be contracted togeth...
IContainer & conjugate() override
Interface class for single container data structure.
ElementType value() const override
std::vector< ElementType > DataType
void next(int n=1) override
bool isSameShape(const IContainer &other) const override
IndexPairList getSpinLabelPairs() const override
IndexType labelToIndex(IndexLabel label) const override
reference element(const IndexList &coords={}) override
bool canAddAt(const IContainer &subContainer, IndexLabel coord, IndexType position) const override
std::vector< IndexLabel > LabelsList
bool isAligned() const override
std::set< IndexLabel > UniqueLabelsList
TensorData makeEmptyVector(const IndexList &dimensions, const LabelsList &labels)
PositionType _maxPosition
IndexPairList getSameLabelPairs(const IContainer &other, const UniqueLabelsList &indices) const override
size_t entrySize() const override
NonZeroIt endNonZero() const override
NonZeroIt firstNonZero() const override
IndexList dims() const override