Documentation
template<typename T>
class TiledArray::SparseShape< T >
Frobenius-norm-based sparse shape.
Sparse shape uses a Tensor
of Frobenius norms to describe the magnitude of the data contained in tiles of an Array object. Because tiles may have an arbitrary size, screening of tiles uses scaled (per-element) Frobenius norms obtained by dividing the tile's Frobenius norm by the tile volume (=its number of elements):
where are tile indices, is norm of tile , and is the product of tile in each dimension. Note that such scaled Frobenius norms no longer have the properties of the Frobenius norms such as the submiltiplicativity.
All constructors will zero out tiles whose scaled norms are below the threshold. The screening threshold is accessed via SparseShape:::threshold() ; it is the global, but not immutable. Thus it is possible to screen each operation separately, by changing the screening threshold between each operation.
- Warning
- If tile's scaled norm is below threshold, its scaled norm is set to to zero and thus lost forever. E.g.
shape.scale
(1e-10).scale(1e10) does not in general equalshape
, whereasshape.scale(1e10)
.scale(1e-10) does.
Definition at line 74 of file sparse_shape.h.
Public Types | |
typedef SparseShape< T > | SparseShape_ |
This object type. More... | |
typedef T | value_type |
The norm value type. More... | |
using | index1_type = TA_1INDEX_TYPE |
typedef Tensor< value_type >::size_type | size_type |
Size type. More... | |
Public Member Functions | |
SparseShape () | |
Default constructor. More... | |
SparseShape (const value_type &tile_norm, const TiledRange &trange) | |
"Dense" Constructor More... | |
SparseShape (const Tensor< value_type > &tile_norms, const TiledRange &trange, bool do_not_scale=false) | |
"Dense" constructor More... | |
template<typename SparseNormSequence , typename = std::enable_if_t< TiledArray::detail::has_member_function_begin_anyreturn< std::decay_t<SparseNormSequence>>::value && TiledArray::detail::has_member_function_end_anyreturn< std::decay_t<SparseNormSequence>>::value>> | |
SparseShape (const SparseNormSequence &tile_norms, const TiledRange &trange, bool do_not_scale=false) | |
"Sparse" constructor More... | |
SparseShape (World &world, const Tensor< value_type > &tile_norms, const TiledRange &trange, bool do_not_scale=false) | |
Collective "dense" constructor. More... | |
template<typename SparseNormSequence > | |
SparseShape (World &world, const SparseNormSequence &tile_norms, const TiledRange &trange) | |
Collective "sparse" constructor. More... | |
SparseShape (const SparseShape< T > &other) | |
Copy constructor. More... | |
SparseShape< T > & | operator= (const SparseShape< T > &other) |
Copy assignment operator. More... | |
bool | validate (const Range &range) const |
Validate shape range. More... | |
template<typename Index > | |
bool | is_zero (const Index &i) const |
Check that a tile is zero. More... | |
float | sparsity () const |
Sparsity of the shape. More... | |
template<typename Index > | |
value_type | operator[] (const Index &index) const |
Tile norm accessor. More... | |
template<typename Op > | |
SparseShape_ | transform (Op &&op) const |
Transform the norm tensor with an operation. More... | |
const Tensor< value_type > & | data () const |
Data accessor. More... | |
const Tensor< value_type > & | tile_norms () const |
Data accessor. More... | |
bool | empty () const |
Initialization check. More... | |
SparseShape_ | mask (const SparseShape_ &mask_shape) const |
Compute union of two shapes. More... | |
template<typename Index1 , typename Index2 , typename = std::enable_if_t<detail::is_integral_range_v<Index1> && detail::is_integral_range_v<Index2>>> | |
SparseShape | update_block (const Index1 &lower_bound, const Index2 &upper_bound, const SparseShape &other) const |
Creates a copy of this with a sub-block updated with contents of another shape. More... | |
template<typename Index1 , typename Index2 , typename = std::enable_if_t<std::is_integral_v<Index1> && std::is_integral_v<Index2>>> | |
SparseShape | update_block (const std::initializer_list< Index1 > &lower_bound, const std::initializer_list< Index2 > &upper_bound, const SparseShape &other) const |
Creates a copy of this with a sub-block updated with contents of another shape. More... | |
template<typename PairRange , typename = std::enable_if_t<detail::is_gpair_range_v<PairRange>>> | |
SparseShape | update_block (const PairRange &bounds, const SparseShape &other) const |
Creates a copy of this with a sub-block updated with contents of another shape. More... | |
template<typename Index , typename = std::enable_if_t<std::is_integral_v<Index>>> | |
SparseShape | update_block (const std::initializer_list< std::initializer_list< Index >> &bounds, const SparseShape &other) const |
Creates a copy of this with a sub-block updated with contents of another shape. More... | |
bool | operator== (const SparseShape< T > &other) const |
Bitwise comparison. More... | |
template<typename Index1 , typename Index2 , typename = std::enable_if_t<detail::is_integral_range_v<Index1> && detail::is_integral_range_v<Index2>>> | |
SparseShape | block (const Index1 &lower_bound, const Index2 &upper_bound) const |
Create a copy of a sub-block of the shape. More... | |
template<typename Index1 , typename Index2 , typename = std::enable_if_t<std::is_integral_v<Index1> && std::is_integral_v<Index2>>> | |
SparseShape | block (const std::initializer_list< Index1 > &lower_bound, const std::initializer_list< Index2 > &upper_bound) const |
Create a copy of a sub-block of the shape. More... | |
template<typename PairRange , typename = std::enable_if_t<detail::is_gpair_range_v<PairRange>>> | |
SparseShape | block (const PairRange &bounds) const |
Create a copy of a sub-block of the shape. More... | |
template<typename Index , typename = std::enable_if_t<std::is_integral_v<Index>>> | |
SparseShape | block (const std::initializer_list< std::initializer_list< Index >> &bounds) const |
Create a copy of a sub-block of the shape. More... | |
template<typename Index1 , typename Index2 , typename Scalar , typename = std::enable_if_t<detail::is_integral_range_v<Index1> && detail::is_integral_range_v<Index2> && detail::is_numeric_v<Scalar>>> | |
SparseShape | block (const Index1 &lower_bound, const Index2 &upper_bound, const Scalar factor) const |
Create a scaled sub-block of the shape. More... | |
template<typename Index1 , typename Index2 , typename Scalar , typename = std::enable_if_t<std::is_integral_v<Index1> && std::is_integral_v<Index2> && detail::is_numeric_v<Scalar>>> | |
SparseShape | block (const std::initializer_list< Index1 > &lower_bound, const std::initializer_list< Index2 > &upper_bound, const Scalar factor) const |
Create a scaled sub-block of the shape. More... | |
template<typename PairRange , typename Scalar , typename = std::enable_if_t<detail::is_numeric_v<Scalar> && detail::is_gpair_range_v<PairRange>>> | |
SparseShape | block (const PairRange &bounds, const Scalar factor) const |
Create a scaled sub-block of the shape. More... | |
template<typename Index , typename Scalar , typename = std::enable_if_t<detail::is_numeric_v<Scalar> && std::is_integral_v<Index>>> | |
SparseShape | block (const std::initializer_list< std::initializer_list< Index >> &bounds, const Scalar factor) const |
Create a scaled sub-block of the shape. More... | |
template<typename Index1 , typename Index2 , typename = std::enable_if_t<detail::is_integral_range_v<Index1> && detail::is_integral_range_v<Index2>>> | |
SparseShape | block (const Index1 &lower_bound, const Index2 &upper_bound, const Permutation &perm) const |
Create a permuted sub-block of the shape. More... | |
template<typename Index1 , typename Index2 , typename = std::enable_if_t<std::is_integral_v<Index1> && std::is_integral_v<Index2>>> | |
SparseShape | block (const std::initializer_list< Index1 > &lower_bound, const std::initializer_list< Index2 > &upper_bound, const Permutation &perm) const |
Create a permuted sub-block of the shape. More... | |
template<typename PairRange , typename = std::enable_if_t<detail::is_gpair_range_v<PairRange>>> | |
SparseShape | block (const PairRange &bounds, const Permutation &perm) const |
Create a permuted sub-block of the shape. More... | |
template<typename Index , typename = std::enable_if_t<std::is_integral_v<Index>>> | |
SparseShape | block (const std::initializer_list< std::initializer_list< Index >> &bounds, const Permutation &perm) const |
Create a permuted sub-block of the shape. More... | |
template<typename Index1 , typename Index2 , typename Scalar , typename = std::enable_if_t<detail::is_integral_range_v<Index1> && detail::is_integral_range_v<Index2> && detail::is_numeric_v<Scalar>>> | |
SparseShape | block (const Index1 &lower_bound, const Index2 &upper_bound, const Scalar factor, const Permutation &perm) const |
Create a permuted scaled sub-block of the shape. More... | |
template<typename Index1 , typename Index2 , typename Scalar , typename = std::enable_if_t<std::is_integral_v<Index1> && std::is_integral_v<Index2> && detail::is_numeric_v<Scalar>>> | |
SparseShape | block (const std::initializer_list< Index1 > &lower_bound, const std::initializer_list< Index2 > &upper_bound, const Scalar factor, const Permutation &perm) const |
Create a permuted scaled sub-block of the shape. More... | |
template<typename PairRange , typename Scalar , typename = std::enable_if_t<detail::is_numeric_v<Scalar> && detail::is_gpair_range_v<PairRange>>> | |
SparseShape | block (const PairRange &bounds, const Scalar factor, const Permutation &perm) const |
Create a permuted scaled sub-block of the shape. More... | |
template<typename Index , typename Scalar , typename = std::enable_if_t<detail::is_numeric_v<Scalar> && std::is_integral_v<Index>>> | |
SparseShape | block (const std::initializer_list< std::initializer_list< Index >> &bounds, const Scalar factor, const Permutation &perm) const |
Create a permuted scaled sub-block of the shape. More... | |
SparseShape_ | perm (const Permutation &perm) const |
Create a permuted shape of this shape. More... | |
template<typename Scalar , typename = std::enable_if_t<detail::is_numeric_v<Scalar>>> | |
SparseShape_ | scale (const Scalar factor) const |
Scale shape. More... | |
template<typename Factor > | |
SparseShape_ | scale (const Factor factor, const Permutation &perm) const |
Scale and permute shape. More... | |
SparseShape_ | add (const SparseShape_ &other) const |
Add shapes. More... | |
SparseShape_ | add (const SparseShape_ &other, const Permutation &perm) const |
Add and permute shapes. More... | |
template<typename Factor > | |
SparseShape_ | add (const SparseShape_ &other, const Factor factor) const |
Add and scale shapes. More... | |
template<typename Factor > | |
SparseShape_ | add (const SparseShape_ &other, const Factor factor, const Permutation &perm) const |
Add, scale, and permute shapes. More... | |
SparseShape_ | add (value_type value) const |
SparseShape_ | add (const value_type value, const Permutation &perm) const |
SparseShape_ | subt (const SparseShape_ &other) const |
SparseShape_ | subt (const SparseShape_ &other, const Permutation &perm) const |
template<typename Factor > | |
SparseShape_ | subt (const SparseShape_ &other, const Factor factor) const |
template<typename Factor > | |
SparseShape_ | subt (const SparseShape_ &other, const Factor factor, const Permutation &perm) const |
SparseShape_ | subt (const value_type value) const |
SparseShape_ | subt (const value_type value, const Permutation &perm) const |
SparseShape_ | mult (const SparseShape_ &other) const |
SparseShape_ | mult (const SparseShape_ &other, const Permutation &perm) const |
template<typename Factor > | |
SparseShape_ | mult (const SparseShape_ &other, const Factor factor) const |
template<typename Factor > | |
SparseShape_ | mult (const SparseShape_ &other, const Factor factor, const Permutation &perm) const |
template<typename Factor > | |
SparseShape_ | gemm (const SparseShape_ &other, const Factor factor, const math::GemmHelper &gemm_helper) const |
template<typename Factor > | |
SparseShape_ | gemm (const SparseShape_ &other, const Factor factor, const math::GemmHelper &gemm_helper, const Permutation &perm) const |
template<typename Archive , typename std::enable_if< madness::archive::is_input_archive< Archive >::value >::type * = nullptr> | |
void | serialize (const Archive &ar) |
template<typename Archive , typename std::enable_if< madness::archive::is_output_archive< Archive >::value >::type * = nullptr> | |
void | serialize (const Archive &ar) const |
Static Public Member Functions | |
static constexpr bool | is_dense () |
Check density. More... | |
static value_type | threshold () |
Threshold accessor. More... | |
static void | threshold (const value_type thresh) |
Set threshold to thresh . More... | |
Member Typedef Documentation
◆ index1_type
using TiledArray::SparseShape< T >::index1_type = TA_1INDEX_TYPE |
Definition at line 78 of file sparse_shape.h.
◆ size_type
typedef Tensor<value_type>::size_type TiledArray::SparseShape< T >::size_type |
Size type.
Definition at line 81 of file sparse_shape.h.
◆ SparseShape_
typedef SparseShape<T> TiledArray::SparseShape< T >::SparseShape_ |
This object type.
Definition at line 76 of file sparse_shape.h.
◆ value_type
typedef T TiledArray::SparseShape< T >::value_type |
The norm value type.
Definition at line 77 of file sparse_shape.h.
Constructor & Destructor Documentation
◆ SparseShape() [1/7]
|
inline |
◆ SparseShape() [2/7]
|
inline |
"Dense" Constructor
This constructor set the tile norms to the same value.
- Parameters
-
tile_norm the value of the (per-element) norm for every tile trange The tiled range of the tensor
- Note
- this ctor does not scale tile norms
-
if
tile_norm
is less than the threshold then all tile norms are set to zero
Definition at line 284 of file sparse_shape.h.
◆ SparseShape() [3/7]
|
inline |
"Dense" constructor
This constructor will scale the tile norms, i.e. multiply each tile norm by the inverse of its volume.
- Parameters
-
tile_norms The Frobenius norm of tiles by default trange The tiled range of the tensor do_not_scale if true, assume that the tile norms in tile_norms
are already scaled
Definition at line 299 of file sparse_shape.h.
◆ SparseShape() [4/7]
|
inline |
"Sparse" constructor
This constructor uses tile norms given as a sparse tensor, represented as a sequence of {index,value_type} data. The tile norms are scaled by the inverse of the corresponding tile's volumes.
- Template Parameters
-
SparseNormSequence the sequence of std::pair<index,value_type>
objects, whereindex
is a directly-addressable sequence indices.
- Parameters
-
tile_norms The Frobenius norm of tiles trange The tiled range of the tensor do_not_scale if true, assume that the tile norms in tile_norms
are already scaled
Definition at line 333 of file sparse_shape.h.
◆ SparseShape() [5/7]
|
inline |
Collective "dense" constructor.
This constructor uses tile norms given as a dense tensor. The tile norms are max-reduced across all processes (via an all reduce). Next, the norms are scaled by the inverse of the corresponding tile's volumes.
- Parameters
-
world The world where the shape will live tile_norms The Frobenius norm of tiles by default; expected to contain nonzeros for this rank's subset of tiles, or be replicated. trange The tiled range of the tensor do_not_scale if true, assume that the tile norms in tile_norms
are already scaled
Definition at line 369 of file sparse_shape.h.
◆ SparseShape() [6/7]
|
inline |
Collective "sparse" constructor.
This constructor uses tile norms given as a sparse tensor, represented as a sequence of {index,value_type} data. The tile norms are scaled to per-element norms by dividing each norm by the tile's volume. Lastly, the norms are max-reduced across all processors.
- Template Parameters
-
SparseNormSequence the sequence of std::pair<index,value_type>
objects, whereindex
is a directly-addressable sequence of integers.
- Parameters
-
world The world where the shape will live tile_norms The Frobenius norm of tiles; expected to contain nonzeros for this rank's subset of tiles, or be replicated. trange The tiled range of the tensor
Definition at line 405 of file sparse_shape.h.
◆ SparseShape() [7/7]
|
inline |
Copy constructor.
Shallow copy of other
.
- Parameters
-
other The other shape object to be copied
Definition at line 416 of file sparse_shape.h.
Member Function Documentation
◆ add() [1/6]
|
inline |
Add shapes.
Construct a new sum of shapes as:
- Parameters
-
other The shape to be added to this shape
- Returns
- A sum of shapes
Definition at line 1179 of file sparse_shape.h.
◆ add() [2/6]
|
inline |
Add and scale shapes.
Construct a new sum of shapes as:
- Template Parameters
-
Factor The scaling factor type
- Note
- expression abs(Factor) must be well defined (by default, std::abs will be used)
- Parameters
-
other The shape to be added to this shape factor The scaling factor
- Returns
- A scaled sum of shapes
Definition at line 1240 of file sparse_shape.h.
◆ add() [3/6]
|
inline |
Add, scale, and permute shapes.
Construct a new sum of shapes as:
- Template Parameters
-
Factor The scaling factor type
- Note
- expression abs(Factor) must be well defined (by default, std::abs will be used)
- Parameters
-
other The shape to be added to this shape factor The scaling factor perm The permutation that is applied to the result
- Returns
- A scaled and permuted sum of shapes
Definition at line 1274 of file sparse_shape.h.
◆ add() [4/6]
|
inline |
Add and permute shapes.
Construct a new sum of shapes as:
- Parameters
-
other The shape to be added to this shape perm The permutation that is applied to the result
- Returns
- the new shape, equals
this
+other
Definition at line 1208 of file sparse_shape.h.
◆ add() [5/6]
|
inline |
◆ add() [6/6]
|
inline |
◆ block() [1/16]
|
inline |
Create a copy of a sub-block of the shape.
- Template Parameters
-
Index1 An integral range type Index2 An integral range type
- Parameters
-
lower_bound The lower bound of the sub-block upper_bound The upper bound of the sub-block
Definition at line 829 of file sparse_shape.h.
◆ block() [2/16]
|
inline |
Create a permuted sub-block of the shape.
- Template Parameters
-
Index1 An integral range type Index2 An integral range type
- Parameters
-
lower_bound The lower bound of the sub-block upper_bound The upper bound of the sub-block perm permutation to apply
- Note
- permutation is not fused into construction
Definition at line 965 of file sparse_shape.h.
◆ block() [3/16]
|
inline |
Create a scaled sub-block of the shape.
- Template Parameters
-
Index1 An integral range type Index2 An integral range type Scalar A numeric type
- Note
- expression abs(Scalar) must be well defined (by default, std::abs will be used)
- Parameters
-
lower_bound The lower bound of the sub-block upper_bound The upper bound of the sub-block factor the scaling factor
Definition at line 890 of file sparse_shape.h.
◆ block() [4/16]
|
inline |
Create a permuted scaled sub-block of the shape.
- Template Parameters
-
Index1 An integral range type Index2 An integral range type Scalar A numeric type
- Note
- expression abs(Scalar) must be well defined (by default, std::abs will be used)
- Parameters
-
lower_bound The lower bound of the sub-block upper_bound The upper bound of the sub-block factor the scaling factor perm permutation to apply
- Note
- permutation is not fused into construction
Definition at line 1029 of file sparse_shape.h.
◆ block() [5/16]
|
inline |
Create a copy of a sub-block of the shape.
- Template Parameters
-
PairRange Type representing a range of generalized pairs (see TiledArray::detail::is_gpair_v )
- Parameters
-
bounds The {lower,upper} bounds of the sub-block
Definition at line 859 of file sparse_shape.h.
◆ block() [6/16]
|
inline |
Create a permuted sub-block of the shape.
- Template Parameters
-
PairRange Type representing a range of generalized pairs (see TiledArray::detail::is_gpair_v )
- Parameters
-
bounds A range of {lower,upper} bounds for each dimension perm permutation to apply
- Note
- permutation is not fused into construction
Definition at line 995 of file sparse_shape.h.
◆ block() [7/16]
|
inline |
Create a scaled sub-block of the shape.
- Template Parameters
-
PairRange Type representing a range of generalized pairs (see TiledArray::detail::is_gpair_v ) Scalar A numeric type
- Note
- expression abs(Scalar) must be well defined (by default, std::abs will be used)
- Parameters
-
bounds A range of {lower,upper} bounds for each dimension factor the scaling factor
Definition at line 929 of file sparse_shape.h.
◆ block() [8/16]
|
inline |
Create a permuted scaled sub-block of the shape.
- Template Parameters
-
PairRange Type representing a range of generalized pairs (see TiledArray::detail::is_gpair_v ) Scalar A numeric type
- Note
- expression abs(Scalar) must be well defined (by default, std::abs will be used)
- Parameters
-
bounds A range of {lower,upper} bounds for each dimension factor the scaling factor perm permutation to apply
- Note
- permutation is not fused into construction
Definition at line 1068 of file sparse_shape.h.
◆ block() [9/16]
|
inline |
Create a copy of a sub-block of the shape.
- Template Parameters
-
Index1 An integral type Index2 An integral type
- Parameters
-
lower_bound The lower bound of the sub-block upper_bound The upper bound of the sub-block
Definition at line 845 of file sparse_shape.h.
◆ block() [10/16]
|
inline |
Create a permuted sub-block of the shape.
- Template Parameters
-
Index1 An integral type Index2 An integral type
- Parameters
-
lower_bound The lower bound of the sub-block upper_bound The upper bound of the sub-block perm permutation to apply
- Note
- permutation is not fused into construction
Definition at line 981 of file sparse_shape.h.
◆ block() [11/16]
|
inline |
Create a scaled sub-block of the shape.
- Template Parameters
-
Index1 An integral type Index2 An integral type Scalar A numeric type
- Note
- expression abs(Scalar) must be well defined (by default, std::abs will be used)
- Parameters
-
lower_bound The lower bound of the sub-block upper_bound The upper bound of the sub-block
Definition at line 911 of file sparse_shape.h.
◆ block() [12/16]
|
inline |
Create a permuted scaled sub-block of the shape.
- Template Parameters
-
Index1 An integral type Index2 An integral type Scalar A numeric type
- Note
- expression abs(Scalar) must be well defined (by default, std::abs will be used)
- Parameters
-
lower_bound The lower bound of the sub-block upper_bound The upper bound of the sub-block factor the scaling factor perm permutation to apply
- Note
- permutation is not fused into construction
Definition at line 1050 of file sparse_shape.h.
◆ block() [13/16]
|
inline |
Create a copy of a sub-block of the shape.
- Template Parameters
-
Index An integral type
- Parameters
-
bounds A range of {lower,upper} bounds for each dimension
Definition at line 870 of file sparse_shape.h.
◆ block() [14/16]
|
inline |
Create a permuted sub-block of the shape.
- Template Parameters
-
Index An integral type
- Parameters
-
bounds A range of {lower,upper} bounds for each dimension perm permutation to apply
- Note
- permutation is not fused into construction
Definition at line 1007 of file sparse_shape.h.
◆ block() [15/16]
|
inline |
Create a scaled sub-block of the shape.
- Template Parameters
-
Index An integral type Scalar A numeric type
- Note
- expression abs(Scalar) must be well defined (by default, std::abs will be used)
- Parameters
-
bounds A range of {lower,upper} bounds for each dimension factor the scaling factor
Definition at line 946 of file sparse_shape.h.
◆ block() [16/16]
|
inline |
Create a permuted scaled sub-block of the shape.
- Template Parameters
-
Index An integral type Scalar A numeric type
- Note
- expression abs(Scalar) must be well defined (by default, std::abs will be used)
- Parameters
-
bounds A range of {lower,upper} bounds for each dimension factor the scaling factor perm permutation to apply
- Note
- permutation is not fused into construction
Definition at line 1089 of file sparse_shape.h.
◆ data()
|
inline |
Data accessor.
- Returns
- A const reference to the
Tensor
object that stores the scaled (per-element) Frobenius norms of tiles
Definition at line 528 of file sparse_shape.h.
◆ empty()
|
inline |
Initialization check.
- Returns
true
when this shape has been initialized.
Definition at line 549 of file sparse_shape.h.
◆ gemm() [1/2]
|
inline |
- Template Parameters
-
Factor The scaling factor type
- Note
- expression abs(Factor) must be well defined (by default, std::abs will be used)
Definition at line 1459 of file sparse_shape.h.
◆ gemm() [2/2]
|
inline |
- Template Parameters
-
Factor The scaling factor type
- Note
- expression abs(Factor) must be well defined (by default, std::abs will be used)
Definition at line 1557 of file sparse_shape.h.
◆ is_dense()
|
inlinestaticconstexpr |
◆ is_zero()
|
inline |
Check that a tile is zero.
- Template Parameters
-
Index The type of the index
- Returns
- false
Definition at line 455 of file sparse_shape.h.
◆ mask()
|
inline |
Compute union of two shapes.
- Parameters
-
mask The input shape, hard zeros are used to mask the output.
- Returns
- A shape that is masked by the mask.
Definition at line 555 of file sparse_shape.h.
◆ mult() [1/4]
|
inline |
◆ mult() [2/4]
|
inline |
- Template Parameters
-
Factor The scaling factor type
- Note
- expression abs(Factor) must be well defined (by default, std::abs will be used)
Definition at line 1421 of file sparse_shape.h.
◆ mult() [3/4]
|
inline |
- Template Parameters
-
Factor The scaling factor type
- Note
- expression abs(Factor) must be well defined (by default, std::abs will be used)
Definition at line 1439 of file sparse_shape.h.
◆ mult() [4/4]
|
inline |
◆ operator=()
|
inline |
Copy assignment operator.
Shallow copy of other
.
- Parameters
-
other The other shape object to be copied
- Returns
- A reference to this object.
Definition at line 431 of file sparse_shape.h.
◆ operator==()
|
inline |
Bitwise comparison.
- Parameters
-
other a SparseShape object
- Returns
- true if this object and
other
object are bitwise identical
Definition at line 697 of file sparse_shape.h.
◆ operator[]()
|
inline |
Tile norm accessor.
- Template Parameters
-
Index The index type
- Parameters
-
index The index of the tile norm to retrieve
- Returns
- The (scaled) norm of the tile at
index
Definition at line 489 of file sparse_shape.h.
◆ perm()
|
inline |
Create a permuted shape of this shape.
- Parameters
-
perm The permutation to be applied
- Returns
- A new, permuted shape
Definition at line 1102 of file sparse_shape.h.
◆ scale() [1/2]
|
inline |
Scale and permute shape.
Compute a new scaled shape is computed as:
- Template Parameters
-
Factor The scaling factor type
- Note
- expression abs(Factor) must be well defined (by default, std::abs will be used)
- Parameters
-
factor The scaling factor perm The permutation that will be applied to this tensor.
- Returns
- A new, scaled-and-permuted shape
Definition at line 1150 of file sparse_shape.h.
◆ scale() [2/2]
|
inline |
Scale shape.
Construct a new scaled shape as:
- Template Parameters
-
Scalar A numeric type
- Note
- expression abs(Scalar) must be well defined (by default, std::abs will be used)
- Parameters
-
factor The scaling factor
- Returns
- A new, scaled shape
Definition at line 1120 of file sparse_shape.h.
◆ serialize() [1/2]
|
inline |
Definition at line 1566 of file sparse_shape.h.
◆ serialize() [2/2]
|
inline |
Definition at line 1579 of file sparse_shape.h.
◆ sparsity()
|
inline |
Sparsity of the shape.
- Returns
- The fraction of tiles that are zero.
Definition at line 468 of file sparse_shape.h.
◆ subt() [1/6]
|
inline |
◆ subt() [2/6]
|
inline |
◆ subt() [3/6]
|
inline |
◆ subt() [4/6]
|
inline |
◆ subt() [5/6]
|
inline |
◆ subt() [6/6]
|
inline |
◆ threshold() [1/2]
|
inlinestatic |
◆ threshold() [2/2]
|
inlinestatic |
Set threshold to thresh
.
- Parameters
-
thresh The new threshold
Definition at line 481 of file sparse_shape.h.
◆ tile_norms()
|
inline |
Data accessor.
- Returns
- A const reference to the
Tensor
object that stores the Frobenius norms of tiles
Definition at line 534 of file sparse_shape.h.
◆ transform()
|
inline |
Transform the norm tensor with an operation.
- Returns
- A deep copy of the norms of the object having performed the operation Op. Op should take a const ref to a Tensor<T> and return a Tensor<T> Since the input tile norms have already been scaled the output norms will be identically scaled, e.g. when Op is an identity operation the output SparseShape data will have the same values as this.
Definition at line 504 of file sparse_shape.h.
◆ update_block() [1/4]
|
inline |
Creates a copy of this with a sub-block updated with contents of another shape.
- Template Parameters
-
Index1 An integral range type Index2 An integral range type
- Parameters
-
lower_bound The lower bound of the sub-block to be updated upper_bound The upper bound of the sub-block to be updated other The shape that will be used to update the sub-block
- Returns
- A new sparse shape object where the sub-block defined by
lower_bound
andupper_bound
contains the data result_tile_norms ofother
.
Definition at line 593 of file sparse_shape.h.
◆ update_block() [2/4]
|
inline |
Creates a copy of this with a sub-block updated with contents of another shape.
- Template Parameters
-
PairRange Type representing a range of generalized pairs (see TiledArray::detail::is_gpair_v )
- Parameters
-
bounds The {lower,upper} bounds of the sub-block other The shape that will be used to update the sub-block
- Returns
- A new sparse shape object where the sub-block defined by
lower_bound
andupper_bound
contains the data result_tile_norms ofother
.
Definition at line 651 of file sparse_shape.h.
◆ update_block() [3/4]
|
inline |
Creates a copy of this with a sub-block updated with contents of another shape.
- Template Parameters
-
Index1 An integral type Index2 An integral type
- Parameters
-
lower_bound The lower bound of the sub-block to be updated upper_bound The upper bound of the sub-block to be updated other The shape that will be used to update the sub-block
- Returns
- A new sparse shape object where the sub-block defined by
lower_bound
andupper_bound
contains the data result_tile_norms ofother
.
Definition at line 632 of file sparse_shape.h.
◆ update_block() [4/4]
|
inline |
Creates a copy of this with a sub-block updated with contents of another shape.
- Template Parameters
-
Index An integral type
- Parameters
-
bounds The {lower,upper} bounds of the sub-block other The shape that will be used to update the sub-block
- Returns
- A new sparse shape object where the sub-block defined by
lower_bound
andupper_bound
contains the data result_tile_norms ofother
.
Definition at line 686 of file sparse_shape.h.
◆ validate()
|
inline |
Validate shape range.
- Returns
true
when range matches the range of this shape
Definition at line 445 of file sparse_shape.h.
The documentation for this class was generated from the following file:
- TiledArray/sparse_shape.h