Module matrix

Module matrix 

Source
Expand description

Utility functions for working with matrices.

Functionsยง

enumerate_index_union_indices
See enumerate_indices. This function zips the two given lists of index domains, performs a union on each pair, and returns an enumerating iterator over the new list of domains.
enumerate_indices
For some index domains, returns a list containing each of the possible indices.
flat_index_to_full_index
flatten
Flattens a multi-dimensional matrix literal into a one-dimensional slice of its elements.
flatten_enumerate
Flattens a multi-dimensional matrix literal into an iterator over (indices,element).
index_domains
Gets the index domains for a matrix literal.
num_elements
Returns the number of possible elements indexable by the given index domains.