dedalus.tools.array

Tools for array manipulations.

Module Contents

interleaved_view(data)

View n-dim complex array as (n+1)-dim real array, where the last axis separates real and imaginary parts.

reshape_vector(data, dim=2, axis=- 1)

Reshape 1-dim array as a multidimensional vector.

axslice(axis, start, stop, step=None)

Slice array along a specified axis.

zeros_with_pattern(*args)

Create sparse matrix with the combined pattern of other sparse matrices.

expand_pattern(input, pattern)

Return copy of sparse matrix with extended pattern.

apply_matrix(matrix, array, axis, **kw)

Apply matrix along any axis of an array.

apply_dense(matrix, array, axis, out=None)

Apply dense matrix along any axis of an array.

move_single_axis(a, source, destination)

Similar to np.moveaxis but faster for just a single axis.

apply_sparse(matrix, array, axis, out=None)

Apply sparse matrix along any axis of an array.

add_sparse(A, B)

Add sparse matrices, promoting scalars to multiples of the identity.