xoa.core.num

xoa.core.num#

Low level numeric utilities

The numerical inputs and outputs of all these routines are of scalar or numpy.ndarray type.

Functions

as_float_array(arr)

Convert input to at least 1D float array, useful for numba accelerated functions

broadcast_along_axis(*arrays[, axis])

Broadcast arrays against each other, except along an axis, and view them in 3D

coo_to_csr(row_indices, col_indices, ...)

Convert COO sparse triplets to a CsrMatrix.

csr_spmm_skipna_unified(indptr, indices, ...)

Unified skipna SpMM: out[i,k] = weighted sum of X[stencil, k] with NaN renorm.

get_iminmax(data1d)

The first and last non nan values for a 1d array

is_float(arr)

Tell if an array, or a dtype, is a single or double precision float

ravel_index(ii, shape)

sturm_count(d, e2, x)

Number of eigenvalues of a symmetric tridiagonal matrix below x, with a Sturm sequence

trideigh(d, e, nmax)

Lowest eigenpairs of a symmetric tridiagonal matrix

tridisolve(dl, d, du, b)

Solve a tridiagonal system in place, with partial pivoting, like LAPACK dgtsv

unravel_index(i, shape)

view_along_axis(arr, axis)

View an array as a 3D array (nouter, n, ninner) around an axis

Classes

CsrMatrix(indptr, indices, data, shape)

Minimal CSR sparse matrix — replaces scipy.sparse.csr_matrix for the regridder.