SyTen

## ◆ reduce()

template<Rank rank>
 void syten::Tensor< rank >::reduce ( EliminateZeros const ezeros = EliminateZeros::Yes, bool const add_cgc = false, bool const no_para = false, bool const no_zero_check_dense = false )

Reduce the number of blocks in the tensor by adding parallel blocks together.

Discards zero-blocks (i.e. blocks where norm(reduced) or norm(cgc) is smaller than SYTEN_ZNORM_THRESHOLD).

When building a tensor from many blocks, first push_back() all blocks and then call reduce() to minimise the overhead from comparisons.

Parameters
 ezeros if EliminateZeros::Yes, small tensors arising from large tensors will be removed add_cgc if true, CGC spaces will be added together if the dense spaces are parallel no_para if true, tensor-level parallelisation will be disabled no_zero_check_dense if true, assumes that dense tensors are never zero unless isZero is set on the block (true e.g. for products)

Finally, in every bin, check all blocks left over. If they are sufficiently large, move them into *this, otherwise drop them.

Here is the caller graph for this function: