NEML2 2.0.0
Loading...
Searching...
No Matches
VectorAssembler Class Reference

Helper to assemble a vector of tensors into a single tensor and also to split a tensor into a map of tensors. More...

Detailed Description

Helper to assemble a vector of tensors into a single tensor and also to split a tensor into a map of tensors.

#include <Assembler.h>

Public Member Functions

 VectorAssembler (const LabeledAxis &axis)
 
Tensor assemble_by_variable (const ValueMap &, bool assembly=true) const
 
ValueMap split_by_variable (const Tensor &, bool assembly=true) const
 
ValueMap split_by_subaxis (const Tensor &) const
 Split the vector (by subaxes)
 
const LabeledAxisaxis () const
 Get the axis used for assembly/splitting.
 

Constructor & Destructor Documentation

◆ VectorAssembler()

VectorAssembler ( const LabeledAxis & axis)
inline

Member Function Documentation

◆ assemble_by_variable()

Tensor assemble_by_variable ( const ValueMap & vals_dict,
bool assembly = true ) const

Assemble a vector of vectors (by variables) assembly indicates whether the variables are in assembly format

◆ axis()

const LabeledAxis & axis ( ) const
inline

Get the axis used for assembly/splitting.

◆ split_by_subaxis()

std::map< SubaxisName, Tensor > split_by_subaxis ( const Tensor & tensor) const

Split the vector (by subaxes)

◆ split_by_variable()

ValueMap split_by_variable ( const Tensor & tensor,
bool assembly = true ) const

Split the vector (by variables) assembly indicates whether the split variables are returned in assembly format