26 namespace MultiDimensional {
28 using VTensor = VectorContainer;
29 using STensor = SparseContainer;
31 using Base = IContainer;
35 Optimize::Optimize() {
42 return static_cast<Base*
>(&a);
49 return static_cast<Base*
>(&a);
56 return (*
this)(*sparse);
60 for (
auto elem : ptrs) {
62 auto sparse =
dynamic_cast<STensor*
>(elem);
64 if(sparse !=
nullptr) {
65 res = (*this)(*sparse);
68 auto vec =
dynamic_cast<VTensor*
>(elem);
73 if (res !=
nullptr && res != elem) {
77 return static_cast<Base*
>(&a);
void swapElement(IContainer *oldContainer, TensorData newContainer)
size_t entrySize() const override
bool shouldBeEvaluated() const
Tensor storage re-optimization algorithm.
Non-sparse tensor data container.
size_t dataSize() const override
size_t numValues() const override
std::unique_ptr< IContainer > TensorData
(Sum of) Outer product tensor data container
Hammer exception definitions.
size_t numValues() const override
Sparse tensor data container.
bool shouldBeSparse(size_t fill, size_t total)
size_t entrySize() const override
Generic tensor indexing iterator.
size_t dataSize() const override
Tensor storage type conversion algorithm.
std::set< IContainer * > getUniquePtrs(bool decoupleConjugates=false)