Hammer  1.0.0
Helicity Amplitude Module for Matrix Element Reweighting
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Hammer::MultiDimensional::SparseContainer Class Referencefinal

#include <SparseContainer.hh>

+ Inheritance diagram for Hammer::MultiDimensional::SparseContainer:
+ Collaboration diagram for Hammer::MultiDimensional::SparseContainer:

Classes

class  ItAligned
 

Public Types

using iterator = DataType::iterator
 
using const_iterator = DataType::const_iterator
 
- Public Types inherited from Hammer::MultiDimensional::ISingleContainer
using NonZeroIt = std::unique_ptr< ItBase >
 
- Public Types inherited from Hammer::MultiDimensional::IContainer
using ElementType = std::complex< double >
 
using reference = ElementType &
 
using const_reference = const ElementType &
 
using SerialType = std::pair< flatbuffers::Offset< void >, Serial::FBTensorTypes >
 

Public Member Functions

 SparseContainer (const IndexList &dimensions, const LabelsList &labels)
 
 SparseContainer (LabeledIndexing< AlignedIndexing > indexing)
 
 SparseContainer (const Serial::FBSingleTensor *input)
 
ElementType value (const IndexList &indices) const
 
ElementType value (IndexList::const_iterator first, IndexList::const_iterator last) const
 
void setValue (const IndexList &indices, ElementType value=0.)
 
void setValue (IndexList::const_iterator first, IndexList::const_iterator last, ElementType value=0.)
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
reference operator[] (PositionType pos)
 
iterator erase (const_iterator first, const_iterator last)
 
size_t rank () const override
 
IndexList dims () const override
 
LabelsList labels () const override
 
size_t numValues () const override
 
size_t dataSize () const override
 
size_t entrySize () const override
 
IndexType labelToIndex (IndexLabel label) const override
 
IndexPairList getSameLabelPairs (const IContainer &other, const UniqueLabelsList &indices) const override
 
IndexPairList getSpinLabelPairs () const override
 
bool isSameShape (const IContainer &other) const override
 
bool canAddAt (const IContainer &subContainer, IndexLabel coord, IndexType position) const override
 
reference element (const IndexList &coords={}) override
 
ElementType element (const IndexList &coords={}) const override
 
reference element (IndexList::const_iterator start, IndexList::const_iterator end) override
 
ElementType element (IndexList::const_iterator start, IndexList::const_iterator end) const override
 
bool compare (const IContainer &other) const override
 
TensorData clone () const override
 
void clear () override
 
IContaineroperator*= (double value) override
 
IContaineroperator*= (const ElementType value) override
 
IContainerconjugate () override
 
SerialType write (flatbuffers::FlatBufferBuilder *msgwriter) const override
 
NonZeroIt firstNonZero () const override
 
NonZeroIt endNonZero () const override
 
- Public Member Functions inherited from Hammer::MultiDimensional::ISingleContainer
virtual ~ISingleContainer ()
 
 ISingleContainer ()
 
 ISingleContainer (const ISingleContainer &)=default
 
 ISingleContainer (ISingleContainer &&)=default
 
ISingleContaineroperator= (const ISingleContainer &)=default
 
ISingleContaineroperator= (ISingleContainer &&)=default
 
- Public Member Functions inherited from Hammer::MultiDimensional::IContainer
virtual ~IContainer ()
 
 IContainer ()
 
 IContainer (const IContainer &)=default
 
 IContainer (IContainer &&)=default
 
IContaineroperator= (const IContainer &)=default
 
IContaineroperator= (IContainer &&)=default
 

Protected Member Functions

LoggetLog () const
 logging facility More...
 

Private Types

using DataType = std::map< PositionType, ElementType >
 

Private Member Functions

const LabeledIndexing
< AlignedIndexing > & 
getIndexing () const
 

Private Attributes

DataType _data
 
LabeledIndexing< AlignedIndexing_indexing
 

Friends

class Ops::Sum
 
class Ops::Multiply
 
class Ops::Divide
 
class Ops::Trace
 
class Ops::Dot
 
class Ops::AddAt
 
class Ops::Convert
 

Detailed Description

Definition at line 51 of file SparseContainer.hh.

Member Typedef Documentation

Definition at line 66 of file SparseContainer.hh.

Definition at line 65 of file SparseContainer.hh.

Constructor & Destructor Documentation

Hammer::MultiDimensional::SparseContainer::SparseContainer ( const IndexList dimensions,
const LabelsList labels 
)

Definition at line 30 of file SparseContainer.cc.

Hammer::MultiDimensional::SparseContainer::SparseContainer ( LabeledIndexing< AlignedIndexing indexing)

Definition at line 34 of file SparseContainer.cc.

Hammer::MultiDimensional::SparseContainer::SparseContainer ( const Serial::FBSingleTensor *  input)

Definition at line 37 of file SparseContainer.cc.

Member Function Documentation

SparseContainer::iterator Hammer::MultiDimensional::SparseContainer::begin ( )

Definition at line 88 of file SparseContainer.cc.

SparseContainer::const_iterator Hammer::MultiDimensional::SparseContainer::begin ( ) const

Definition at line 92 of file SparseContainer.cc.

bool Hammer::MultiDimensional::SparseContainer::canAddAt ( const IContainer subContainer,
IndexLabel  coord,
IndexType  position 
) const
overridevirtual

Implements Hammer::MultiDimensional::IContainer.

Definition at line 155 of file SparseContainer.cc.

void Hammer::MultiDimensional::SparseContainer::clear ( )
overridevirtual

Implements Hammer::MultiDimensional::IContainer.

Definition at line 208 of file SparseContainer.cc.

TensorData Hammer::MultiDimensional::SparseContainer::clone ( ) const
overridevirtual

Implements Hammer::MultiDimensional::IContainer.

Definition at line 194 of file SparseContainer.cc.

bool Hammer::MultiDimensional::SparseContainer::compare ( const IContainer other) const
overridevirtual

Implements Hammer::MultiDimensional::IContainer.

Definition at line 180 of file SparseContainer.cc.

IContainer & Hammer::MultiDimensional::SparseContainer::conjugate ( )
overridevirtual

Implements Hammer::MultiDimensional::IContainer.

Definition at line 227 of file SparseContainer.cc.

size_t Hammer::MultiDimensional::SparseContainer::dataSize ( ) const
overridevirtual

Implements Hammer::MultiDimensional::IContainer.

Definition at line 129 of file SparseContainer.cc.

IndexList Hammer::MultiDimensional::SparseContainer::dims ( ) const
overridevirtual

Implements Hammer::MultiDimensional::IContainer.

Definition at line 117 of file SparseContainer.cc.

SparseContainer::reference Hammer::MultiDimensional::SparseContainer::element ( const IndexList coords = {})
overridevirtual

Implements Hammer::MultiDimensional::IContainer.

Definition at line 159 of file SparseContainer.cc.

SparseContainer::ElementType Hammer::MultiDimensional::SparseContainer::element ( const IndexList coords = {}) const
overridevirtual

Implements Hammer::MultiDimensional::IContainer.

Definition at line 165 of file SparseContainer.cc.

SparseContainer::reference Hammer::MultiDimensional::SparseContainer::element ( IndexList::const_iterator  start,
IndexList::const_iterator  end 
)
overridevirtual

Implements Hammer::MultiDimensional::IContainer.

Definition at line 170 of file SparseContainer.cc.

SparseContainer::ElementType Hammer::MultiDimensional::SparseContainer::element ( IndexList::const_iterator  start,
IndexList::const_iterator  end 
) const
overridevirtual

Implements Hammer::MultiDimensional::IContainer.

Definition at line 176 of file SparseContainer.cc.

SparseContainer::iterator Hammer::MultiDimensional::SparseContainer::end ( )

Definition at line 96 of file SparseContainer.cc.

SparseContainer::const_iterator Hammer::MultiDimensional::SparseContainer::end ( ) const

Definition at line 100 of file SparseContainer.cc.

ISingleContainer::NonZeroIt Hammer::MultiDimensional::SparseContainer::endNonZero ( ) const
overridevirtual

Implements Hammer::MultiDimensional::ISingleContainer.

Definition at line 204 of file SparseContainer.cc.

size_t Hammer::MultiDimensional::SparseContainer::entrySize ( ) const
overridevirtual

Implements Hammer::MultiDimensional::IContainer.

Definition at line 133 of file SparseContainer.cc.

SparseContainer::iterator Hammer::MultiDimensional::SparseContainer::erase ( SparseContainer::const_iterator  first,
SparseContainer::const_iterator  last 
)

Definition at line 104 of file SparseContainer.cc.

ISingleContainer::NonZeroIt Hammer::MultiDimensional::SparseContainer::firstNonZero ( ) const
overridevirtual

Implements Hammer::MultiDimensional::ISingleContainer.

Definition at line 200 of file SparseContainer.cc.

const LabeledIndexing< AlignedIndexing > & Hammer::MultiDimensional::SparseContainer::getIndexing ( ) const
private

Definition at line 283 of file SparseContainer.cc.

Log & Hammer::MultiDimensional::SparseContainer::getLog ( ) const
protected

logging facility

Returns
stream to be used for logging

Definition at line 279 of file SparseContainer.cc.

IndexPairList Hammer::MultiDimensional::SparseContainer::getSameLabelPairs ( const IContainer other,
const UniqueLabelsList indices 
) const
overridevirtual

Implements Hammer::MultiDimensional::IContainer.

Definition at line 142 of file SparseContainer.cc.

IndexPairList Hammer::MultiDimensional::SparseContainer::getSpinLabelPairs ( ) const
overridevirtual

Implements Hammer::MultiDimensional::IContainer.

Definition at line 147 of file SparseContainer.cc.

bool Hammer::MultiDimensional::SparseContainer::isSameShape ( const IContainer other) const
overridevirtual

Implements Hammer::MultiDimensional::IContainer.

Definition at line 151 of file SparseContainer.cc.

LabelsList Hammer::MultiDimensional::SparseContainer::labels ( ) const
overridevirtual

Implements Hammer::MultiDimensional::IContainer.

Definition at line 121 of file SparseContainer.cc.

IndexType Hammer::MultiDimensional::SparseContainer::labelToIndex ( IndexLabel  label) const
overridevirtual

Implements Hammer::MultiDimensional::IContainer.

Definition at line 137 of file SparseContainer.cc.

size_t Hammer::MultiDimensional::SparseContainer::numValues ( ) const
overridevirtual

Implements Hammer::MultiDimensional::IContainer.

Definition at line 125 of file SparseContainer.cc.

IContainer & Hammer::MultiDimensional::SparseContainer::operator*= ( double  value)
overridevirtual

Implements Hammer::MultiDimensional::IContainer.

Definition at line 212 of file SparseContainer.cc.

IContainer & Hammer::MultiDimensional::SparseContainer::operator*= ( const ElementType  value)
overridevirtual

Implements Hammer::MultiDimensional::IContainer.

Definition at line 219 of file SparseContainer.cc.

SparseContainer::reference Hammer::MultiDimensional::SparseContainer::operator[] ( PositionType  pos)

Definition at line 109 of file SparseContainer.cc.

size_t Hammer::MultiDimensional::SparseContainer::rank ( ) const
overridevirtual

Implements Hammer::MultiDimensional::IContainer.

Definition at line 113 of file SparseContainer.cc.

void Hammer::MultiDimensional::SparseContainer::setValue ( const IndexList indices,
ElementType  value = 0. 
)

Definition at line 74 of file SparseContainer.cc.

void Hammer::MultiDimensional::SparseContainer::setValue ( IndexList::const_iterator  first,
IndexList::const_iterator  last,
ElementType  value = 0. 
)

Definition at line 80 of file SparseContainer.cc.

SparseContainer::ElementType Hammer::MultiDimensional::SparseContainer::value ( const IndexList indices) const

Definition at line 62 of file SparseContainer.cc.

SparseContainer::ElementType Hammer::MultiDimensional::SparseContainer::value ( IndexList::const_iterator  first,
IndexList::const_iterator  last 
) const

Definition at line 68 of file SparseContainer.cc.

SparseContainer::SerialType Hammer::MultiDimensional::SparseContainer::write ( flatbuffers::FlatBufferBuilder *  msgwriter) const
overridevirtual

Implements Hammer::MultiDimensional::IContainer.

Definition at line 235 of file SparseContainer.cc.

Friends And Related Function Documentation

friend class Ops::AddAt
friend

Definition at line 144 of file SparseContainer.hh.

friend class Ops::Convert
friend

Definition at line 145 of file SparseContainer.hh.

friend class Ops::Divide
friend

Definition at line 141 of file SparseContainer.hh.

friend class Ops::Dot
friend

Definition at line 143 of file SparseContainer.hh.

friend class Ops::Multiply
friend

Definition at line 140 of file SparseContainer.hh.

friend class Ops::Sum
friend

Definition at line 139 of file SparseContainer.hh.

friend class Ops::Trace
friend

Definition at line 142 of file SparseContainer.hh.

Member Data Documentation

DataType Hammer::MultiDimensional::SparseContainer::_data
mutableprivate

Definition at line 151 of file SparseContainer.hh.

LabeledIndexing<AlignedIndexing> Hammer::MultiDimensional::SparseContainer::_indexing
private

Definition at line 152 of file SparseContainer.hh.


The documentation for this class was generated from the following files: