Difference between revisions of "Ttclass/sum.m"

From Spinach Documentation Wiki
Jump to: navigation, search
m (Add missing Version/authors metadata and remove raw author emails)
m (Repair ttclass function page template)
Line 1: Line 1:
 
{{DISPLAYTITLE:ttclass/sum.m}} __NOTOC__
 
{{DISPLAYTITLE:ttclass/sum.m}} __NOTOC__
−
Sum of elements of a tensor train representation of a matrix. Syntax:
+
Sum of elements of a tensor train representation of
 +
a matrix.
 +
 
 +
==Syntax==
  
 
     answer=sum(ttrain,dim)
 
     answer=sum(ttrain,dim)
  
−
The sum is taken along the specified dimension (dim=1 or dim=2). If dim is omitted, the first non-singleton dimension is used, matching Matlab behaviour.
+
==Arguments==
 +
 
 +
    ttrain - tensor train object representing
 +
              a matrix
 +
 +
    dim   - summation dimension, 1 or 2
 +
 
 +
==Outputs==
 +
 
 +
    answer - tensor train or flat representation
 +
              of the summation result
  
 
==See also==
 
==See also==

Revision as of 17:04, 5 June 2026

Sum of elements of a tensor train representation of a matrix.

Syntax

    answer=sum(ttrain,dim)

Arguments

    ttrain - tensor train object representing
             a matrix

    dim    - summation dimension, 1 or 2

Outputs

    answer - tensor train or flat representation
             of the summation result

See also

ttclass.m, ttclass/mean.m, ttclass/trace.m, Tensor train functions

Version 2.1, authors: Dmitry Savostyanov, Ilya Kuprov