Utilities in cr.sparse module¶
Array data type utilities¶
|
Promotes args to a common inexact type. |
|
Raise an error if the shapes of the two arrays do not match. |
Utilities for vectors¶
|
Returns if x is a scalar |
|
Returns if x is a line vector or row vector or column vector |
|
Returns if x is a line vector |
|
Returns if x is a row vector |
|
Returns if x is a column vector |
|
Converts a line vector to a row vector |
|
Converts a line vector to a column vector |
|
Returns a unit vector in i-th dimension for the standard coordinate system |
Right shift the contents of the vector |
|
Circular right shift the contents of the vector |
|
Left shift the contents of the vector |
|
Circular left shift the contents of the vector |
|
|
Right shift the contents of the vector by n places |
|
Circular right shift the contents of the vector by n places |
|
Left shift the contents of the vector by n places |
|
Circular left shift the contents of the vector by n places |
|
Extends a vector by repeating it at the end (periodic extension) |
|
Extends a vector by repeating it at the start (periodic extension) |
|
Returns the central part of a vector of a specified length |
|
Returns a unit vector in i-th dimension for the standard coordinate system |
|
Extends a vector by repeating it at the end (periodic extension) |
|
Extends a vector by repeating it at the start (periodic extension) |
|
Returns the central part of a vector of a specified length |
Metrics for measuring signal and error levels¶
These functions are available under cr.sparse.metrics
.
|
Returns the mean squared value of an array |
|
Returns the mean square error between two arrays |
|
Returns the root mean squared value of an array |
|
Returns the root mean square error between two arrays |
|
Returns the normalized root mean square error between two arrays |
|
Returns the Peak Signal to Noie Ratio between two arrays |
|
Returns the signal to noise ratio between a reference array and a test array |
Some checks and utilities for matrices (2D arrays)¶
|
Returns the transpose of an array |
|
Returns the conjugate transpose of an array |
|
Checks if an array is a matrix |
|
Checks if an array is a square matrix |
|
Checks if an array is a symmetric matrix |
|
Checks if an array is a Hermitian matrix |
Checks if an array is a symmetric positive definite matrix |
|
|
Checks if a matrix has orthogonal columns |
|
Checks if a matrix has orthogonal rows |
Checks if a matrix has unitary columns |
|
Checks if a matrix has unitary rows |
|
Returns the off diagonal elements of a matrix A |
|
Returns the minimum of the off diagonal elements |
|
Returns the maximum of the off diagonal elements |
|
Returns the maximum of the off diagonal elements |
Row wise and column wise norms for signal/representation matrices¶
|
Computes the l_1 norm of each column of a matrix |
|
Computes the l_1 norm of each row of a matrix |
|
Computes the l_2 norm of each column of a matrix |
|
Computes the l_2 norm of each row of a matrix |
Computes the l_inf norm of each column of a matrix |
|
Computes the l_inf norm of each row of a matrix |
|
Computes the squared l_2 norm of each column of a matrix |
|
Computes the l_2 norm of each row of a matrix |
|
Normalize each column of X per l_1-norm |
|
Normalize each row of X per l_1-norm |
|
Normalize each column of X per l_2-norm |
|
Normalize each row of X per l_2-norm |
Pairwise Distances¶
Computes the pairwise squared distances between points in A and points in B where each point is a row vector |
|
Computes the pairwise squared distances between points in A and points in B where each point is a column vector |
|
|
Computes the pairwise distances between points in A and points in B where each point is a row vector |
|
Computes the pairwise distances between points in A and points in B where each point is a column vector |
Computes the pairwise squared distances between points in A where each point is a row vector |
|
Computes the pairwise squared distances between points in A where each point is a column vector |
|
|
Computes the pairwise distances between points in A where ach point is a row vector |
|
Computes the pairwise distances between points in A where each point is a column vector |
|
Computes the pairwise city-block distances between points in A and points in B where each point is a row vector |
|
Computes the pairwise city-block distances between points in A and points in B where each point is a column vector |
|
Computes the pairwise city-block distances between points in A where each point is a row vector |
|
Computes the pairwise city-block distances between points in A where each point is a column vector |
Computes the pairwise Chebyshev distances between points in A and points in B where each point is a row vector |
|
Computes the pairwise Chebyshev distances between points in A and points in B where each point is a column vector |
|
Computes the pairwise Chebyshev distances between points in A where each point is a row vector |
|
Computes the pairwise Chebyshev distances between points in A where each point is a column vector |
Sparse representations¶
Following functions analyze or construct representation vectors which are known to be sparse.
Returns the values of non-zero entries in x |
|
Returns the indices of non-zero entries in x |
|
|
Randomizes the rows in X |
|
Randomizes the columns in X |
|
Returns the indices of K largest entries in x by magnitude |
|
Returns the indices and corresponding values of largest K non-zero entries in a vector x |
|
Returns the sorted indices and corresponding values of largest K non-zero entries in a vector x |
|
Keeps only largest K non-zero entries by magnitude in a vector x |
|
Builds a sparse signal from its non-zero entries (specified by their indices and values) |
Returns the ratio of largest and smallest values (by magnitude) in x (dB) |
|
Returns the ratio of largest and smallest non-zero values (by magnitude) in x (dB) |
Sparse representation matrices (row-wise)
|
Returns the indices of K largest entries by magnitude in each row of X |
|
Picks K entries from each row of X specified by indices matrix |
|
Keeps only largest K non-zero entries by magnitude in each row of X |
Sparse representation matrices (column-wise)
|
Returns the indices of K largest entries by magnitude in each column of X |
|
Picks K entries from each column of X specified by indices matrix |
|
Keeps only largest K non-zero entries by magnitude in each column of X |
Utilities for ND-Arrays¶
Returns the unraveled index of the largest entry (by magnitude) in an n-d array |