NEML2 2.1.0
Loading...
Searching...
No Matches

Sparse representation of a matrix consisting of a 2D-list of tensors and their layout. More...

Detailed Description

Sparse representation of a matrix consisting of a 2D-list of tensors and their layout.

#include <SparseMatrix.h>

Public Member Functions

 SparseMatrix ()=default
 SparseMatrix (AxisLayout, AxisLayout)
 SparseMatrix (AxisLayout, AxisLayout, std::vector< std::vector< Tensor > >)
TensorOptions options () const
 Tensor options.
SparseMatrix group (std::size_t, std::size_t) const
 Semi-contiguous view of a block of the sparse matrix.
AssembledMatrix assemble () const
 Assemble into a Tensor with two base dimensions.

Public Attributes

std::vector< std::vector< Tensor > > tensors
 2D-list of tensors
AxisLayout row_layout
 Row layout of the tensors.
AxisLayout col_layout
 Column layout of the tensors.

Constructor & Destructor Documentation

◆ SparseMatrix() [1/3]

SparseMatrix ( )
default

◆ SparseMatrix() [2/3]

SparseMatrix ( AxisLayout ,
AxisLayout  )

◆ SparseMatrix() [3/3]

SparseMatrix ( AxisLayout ,
AxisLayout ,
std::vector< std::vector< Tensor > >  )

Member Function Documentation

◆ assemble()

AssembledMatrix assemble ( ) const

Assemble into a Tensor with two base dimensions.

◆ group()

SparseMatrix group ( std::size_t ,
std::size_t  ) const

Semi-contiguous view of a block of the sparse matrix.

◆ options()

TensorOptions options ( ) const

Tensor options.

Member Data Documentation

◆ col_layout

AxisLayout col_layout

Column layout of the tensors.

◆ row_layout

AxisLayout row_layout

Row layout of the tensors.

◆ tensors

std::vector<std::vector<Tensor> > tensors

2D-list of tensors