Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
documentation:language_reference:objects:matrix:functions:flatten [2018/08/06 11:49] – created Simon Heinzedocumentation:language_reference:objects:matrix:functions:flatten [2024/12/12 17:45] (current) Maurits W. Haverkort
Line 1: Line 1:
 {{indexmenu_n>999}} {{indexmenu_n>999}}
 ====== Flatten ====== ====== Flatten ======
- 
 Matrix.Flatten($M$) takes an object $M$, which must be a matrix with matrix-valued entries, and returns the flattened version, which is a matrix with numbers as entries. This allows for working with block matrices, e.g. defining a matrix of the form Matrix.Flatten($M$) takes an object $M$, which must be a matrix with matrix-valued entries, and returns the flattened version, which is a matrix with numbers as entries. This allows for working with block matrices, e.g. defining a matrix of the form
 \begin{equation} \begin{equation}
Line 14: Line 13:
 where $A,B,C,D$ are all matrices. where $A,B,C,D$ are all matrices.
  
-If an entry of the input matrix $M$ is $0$ instead of a matrix, Quanty will interpret this as a zero-matrix of appropriate size. A complete line of zeros will be deleted.+If an entry of the input matrix $M$ is $0$ instead of a matrix, Quanty will interpret this as a zero-matrix of appropriate size, which makes creating sparse block-matrices especially easy in conjunction with //[[documentation:language_reference:objects:matrix:functions:zero|Matrix.Zero()]]//. A complete line or column of zeros will be deleted.
  
 ===== Example ===== ===== Example =====
Line 30: Line 29:
  
 print("\n\n\n") print("\n\n\n")
-M = Matrix.Zero(3)+M = Matrix.Zero(3,{{"userdata",false}})
 M[1][1] = A M[1][1] = A
 M[1][2] = B M[1][2] = B
Line 67: Line 66:
  
 ===== Table of contents ===== ===== Table of contents =====
-{{indexmenu>.#1|msort}}+{{indexmenu>..:#2|tsort}}
  
Print/export