Camiba – Linear Algebra¶
This module provides some routines, which are mostly related to concepts from linear algebra, since they produce or manipulate matrices.
Basic¶
This module aims at making work with some more specific and but still generally applicable stuff way easier.
-
camiba.linalg.basic.
hard_thrshld
(arr_x, num_k)[source]¶ - Hard Thresholding
Parameters: arr_x : ndarray
vector to threshold
num_k : int
thresholding parameter
Returns: ndarray
thresholded vector
-
camiba.linalg.basic.
khatri_rao
(X, Y)[source]¶ Calculate columnwise Kronecker Product
This is also known as the Khatri-Rao product.
-
camiba.linalg.basic.
proj_sphere
(X)[source]¶ - Project columns of X onto the unit sphere
This method takes a two-dimensional (real or complex) array X and projects the columns onto the unit sphere.
It is very useful, if multiple vectors of the same size have to be normalized.
Packings¶
implements an iterative algorithm for finding unstructured measurement matrices. works for complex and real valued matrices. Here we are minimizing a certain potential function induced by the points on the sphere, thus they repell each other
-
camiba.linalg.pack.
draw
(num_n, num_m, num_eps, num_h)[source]¶ applies the potential minimizing algorithm for given configuration size num_n x num_m. another stopping criterion has to be supplied together with a step length
-
camiba.linalg.pack.
drawBuffer
(num_n, num_m, num_eps, num_h, str_p)[source]¶ generate a matrix by minimizing a potential with dimension num_n x num_m and store it to str_path. it gets regenerated if specified dimensions changed
-
camiba.linalg.pack.
drawBufferComplex
(num_n, num_m, num_eps, num_h, str_p)[source]¶ generate a complex valued matrix by minimizing a potential with dimension num_n x num_m and store it to str_path. it gets regenerated if specified dimensions changed
-
camiba.linalg.pack.
drawComplex
(num_n, num_m, num_eps, num_h)[source]¶ applies the potential minimizing algorithm for given complex configuration size num_n x num_m. another stopping criterion has to be supplied together with a step length
-
camiba.linalg.pack.
drawComplexSeed
(mat_X, num_eps, num_h, steps=0)[source]¶ applies the potential minimizing algorithm for a given initial complex configuration mat_X a given amount of steps. another stopping criterion has to be supplied together with a step length
Vandermonde Matrices¶
-
camiba.linalg.vand.
build
(arr_z, num_n)[source]¶ build a vandermonde matrix with specified first row arr_z and height num_n
-
camiba.linalg.vand.
opt_c
(num_n, num_m, num_tries, num_samples, str_path)[source]¶ generate an approximately optimal parameter c for the pack routine for a vandermonde matrix of size num_n x num_m and store it into a table at location str_path. num_Tries and num_Samples specify how many samples we take for directional random search.
Multilevel Matrices¶
-
camiba.linalg.multilevel.
Toep
(tenU, verbose=False)[source]¶ - Construct a Hermitian Multilevel Toeplitz Matrix
Parameters: tenU : ndarray
The tensor, which describes the multilevel Toeplitz matrix
verbose :
Verbosity Flag
Returns: ndarray
The constructed matrix as 2D ndarray
-
camiba.linalg.multilevel.
ToepAdj
(arrD, mat_A, verbose=False)[source]¶ - Calculate the Adjoint Operator of <T,A>
Parameters: arrD : ndarray
The sizes of the levels in the current iteration
tenU : ndarray
The tensor, in the current iteration
verbose :
Verbosity Flag
Returns: ndarray
The constructed (sub)matrix as 2D ndarray