Method of CPNTensor.
Static factory that builds a CPNTensor from a signed
structure and/or parameter matrix.
Source: src/tensor/@CPNTensor/CPNTensor.m
obj = CPNTensor.fromRawMatrices(structureMatrix = S, parameterMatrix = P)
obj = CPNTensor.fromRawMatrices(structureMatrix = S)
obj = CPNTensor.fromRawMatrices(parameterMatrix = P)fromRawMatrices constructs a CPNTensor from
full signed matrices and splits them into the internal three-way
components. It applies trueFalseStructure
to the structure matrix and trueFalseParameter
to the parameter matrix, so a structure entry equal to
becomes structureMatrixTrue (all others go to
structureMatrixContinuous), and parameter entries equal to
/
become parameterMatrixOne /
parameterMatrixMinusOne (all others go to
parameterMatrixContinuous).
Both arguments default to [], so a matrix that is
omitted leaves the corresponding components empty. After the split the
tensor rank R is set from the structure matrix.
This is the name–value equivalent of the two-argument constructor
CPNTensor(structureMatrix, parameterMatrix).
| Argument | Description |
|---|---|
structureMatrix |
(name–value, default []) Signed structure
matrix, rows = signals, columns = monomials. |
parameterMatrix |
(name–value, default []) Signed parameter
matrix, rows = equations, columns = monomials. |
| Output | Description |
|---|---|
obj |
CPNTensor with the split structure and parameter
components and rank R. |
% xp1 xp2 xp3 x2x3 x1 x2 const x1x2
structureMatrix = [ 1 0 0 0 0 0 0 0 ;
0 1 0 0 0 0 0 0 ;
0 0 1 0 0 0 0 0 ;
0 0 0 0 1 0 0 1 ;
0 0 0 1 0 1 0 1 ;
0 0 0 1 0 0 0 0 ];
parameterMatrix = [-1 0 0 0.4 0 0 0 0 ;
0 -1 0 0 1 -1.2 0 0 ;
0 0 -1 0 0 0 1 -1 ];
T = CPNTensor.fromRawMatrices(structureMatrix = structureMatrix, ...
parameterMatrix = parameterMatrix);CPNTensor · fromSparseComponents
· trueFalseStructure
· trueFalseParameter
· mdss
MyToolbox Documentation | Generated automatically by CI/CD pipeline