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)

Contract any direction of a multidimensional array with a matrix.

add_sparse(A, B)

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