Difference between revisions of "Ttclass/diag.m"

From Spinach Documentation Wiki
Jump to: navigation, search
m (Kuprov moved page Diag.m to Ttclass/diag.m without leaving a redirect)
(Sync syntax/arguments/outputs with current Spinach source)
Line 1: Line 1:
 
Mimics the diag behavior for tensor train matrix. Syntax:
 
Mimics the diag behavior for tensor train matrix. Syntax:
  
−
                            tt=diag(tt)
+
 
 +
    tt=diag(tt)
  
 
If tt is a square matrix, return a vector by computing diag of every core.
 
If tt is a square matrix, return a vector by computing diag of every core.
 
If tt is a vector (one mode size is ones), return a diagonal matrix.
 
If tt is a vector (one mode size is ones), return a diagonal matrix.

Revision as of 15:04, 5 April 2026

Mimics the diag behavior for tensor train matrix. Syntax:


    tt=diag(tt)

If tt is a square matrix, return a vector by computing diag of every core. If tt is a vector (one mode size is ones), return a diagonal matrix.