fromSparseComponents

Method of CPNTensor.

Static factory that builds a CPNTensor directly from its six split components.

Source: src/tensor/@CPNTensor/CPNTensor.m

Syntax

obj = CPNTensor.fromSparseComponents( ...
        structureMatrixTrue = ST, ...
        structureMatrixFalse = SF, ...
        structureMatrixContinuous = SC, ...
        parameterMatrixOne = PO, ...
        parameterMatrixMinusOne = PM, ...
        parameterMatrixContinuous = PC)

Description

fromSparseComponents assembles a CPNTensor from the six pre-split sparse components, without deriving them from a single signed matrix. It is the name–value equivalent of the six-argument constructor. Each component defaults to [], so any omitted part is empty.

The three structure components are stored as sparse matrices (True and False as logical masks, Continuous as numeric weights), and likewise the three parameter components (One and MinusOne logical, Continuous numeric). Their meanings are:

Component Factor / coefficient
structureMatrixTrue monomial factor vlv_l
structureMatrixFalse complemented factor 1vl1-v_l
structureMatrixContinuous general factor 1|s|+svl1-\lvert s\rvert + s\,v_l
parameterMatrixOne coefficient +1+1
parameterMatrixMinusOne coefficient 1-1
parameterMatrixContinuous any other coefficient value

After assembly, mustHaveDisjointStructure verifies that the three structure components have non-overlapping support (each entry sourced from at most one of True / False / Continuous); it errors with the offending (row, column) positions otherwise. The tensor rank R is then set from the structure matrix.

Use this factory when the components are already separated — for example, when a model needs a structureMatrixFalse (complemented factors 1vl1-v_l), which the signed-matrix routes never populate.

Input arguments

All are name–value arguments, each defaulting to [].

Argument Description
structureMatrixTrue Logical mask of factors vlv_l, signals by monomials.
structureMatrixFalse Logical mask of factors 1vl1-v_l, signals by monomials.
structureMatrixContinuous Numeric weights ss for general factors, signals by monomials.
parameterMatrixOne Logical mask of coefficient +1+1, equations by monomials.
parameterMatrixMinusOne Logical mask of coefficient 1-1, equations by monomials.
parameterMatrixContinuous Numeric remaining coefficients, equations by monomials.

Output arguments

Output Description
obj CPNTensor with the given components and rank R.

See also

CPNTensor · fromRawMatrices · trueFalseStructure · trueFalseParameter · mdss


MyToolbox Documentation | Generated automatically by CI/CD pipeline