taichi._funcs
¶
Module Contents¶
Functions¶
|
Generates a random number from standard normal distribution. |
|
Perform polar decomposition (A=UP) for arbitrary size matrix. |
|
Perform singular value decomposition (A=USV^T) for arbitrary size matrix. |
|
Compute the eigenvalues and right eigenvectors of a real matrix. |
|
Compute the eigenvalues and right eigenvectors of a real symmetric matrix. |
- taichi._funcs.randn(dt=None)¶
Generates a random number from standard normal distribution.
Implementation refers to
taichi.lang.random.randn()
.- Parameters
dt (DataType) – The datatype for the generated random number.
- Returns
The generated random number.
- taichi._funcs.polar_decompose(A, dt=None)¶
Perform polar decomposition (A=UP) for arbitrary size matrix.
Mathematical concept refers to https://en.wikipedia.org/wiki/Polar_decomposition. This is only a wrapper for
taichi.polar_decompose()
.- Parameters
A (ti.Matrix(n, n)) – input nxn matrix A.
dt (DataType) – date type of elements in matrix A, typically accepts ti.f32 or ti.f64.
- Returns
Decomposed nxn matrices U and P.
- taichi._funcs.svd(A, dt=None)¶
Perform singular value decomposition (A=USV^T) for arbitrary size matrix.
Mathematical concept refers to https://en.wikipedia.org/wiki/Singular_value_decomposition. This is only a wrappers for
taichi.svd()
.- Parameters
A (ti.Matrix(n, n)) – input nxn matrix A.
dt (DataType) – date type of elements in matrix A, typically accepts ti.f32 or ti.f64.
- Returns
Decomposed nxn matrices U, ‘S’ and V.
- taichi._funcs.eig(A, dt=None)¶
Compute the eigenvalues and right eigenvectors of a real matrix.
Mathematical concept refers to https://en.wikipedia.org/wiki/Eigendecomposition_of_a_matrix. 2D implementation refers to
taichi.eig2x2()
.- Parameters
A (ti.Matrix(n, n)) – 2D Matrix for which the eigenvalues and right eigenvectors will be computed.
dt (DataType) – The datatype for the eigenvalues and right eigenvectors.
- Returns
The eigenvalues in complex form. Each row stores one eigenvalue. The first number of the eigenvalue represents the real part and the second number represents the imaginary part. eigenvectors (ti.Matrix(n*2, n)): The eigenvectors in complex form. Each column stores one eigenvector. Each eigenvector consists of n entries, each of which is represented by two numbers for its real part and imaginary part.
- Return type
eigenvalues (ti.Matrix(n, 2))
- taichi._funcs.sym_eig(A, dt=None)¶
Compute the eigenvalues and right eigenvectors of a real symmetric matrix.
Mathematical concept refers to https://en.wikipedia.org/wiki/Eigendecomposition_of_a_matrix. 2D implementation refers to
taichi.sym_eig2x2()
.- Parameters
A (ti.Matrix(n, n)) – Symmetric Matrix for which the eigenvalues and right eigenvectors will be computed.
dt (DataType) – The datatype for the eigenvalues and right eigenvectors.
- Returns
The eigenvalues. Each entry store one eigen value. eigenvectors (ti.Matrix(n, n)): The eigenvectors. Each column stores one eigenvector.
- Return type
eigenvalues (ti.Vector(n))