Package sfc :: Package common :: Module utilities
[hide private]
[frames] | no frames]

Module utilities

source code

This module contains utility functions for various stuff.

Functions [hide private]
 
printmem(msg) source code
 
dot_product(seq1, seq2) source code
 
make_name_valid(name)
Filter away .[] from indexed array names.
source code
 
index_string(i) source code
 
build_count_dict(entries) source code
 
fe_is_discontinuous(fe) source code
 
fe_is_signed(fe) source code
 
check_range(i, a, b, msg="Invalid range.")
Check that i is in [a,b), raise exception otherwise.
source code
 
unique(sequence) source code
 
indices_subset(indices, keep) source code
 
shape(dims) source code
 
permute(shape)
Returns a permutation of all multiindices within the range of a rank 0, 1, or 2 tensor shape.
source code
 
list_items(l) source code
 
as_list_with_len(x, wantlen)
If x is not a list type, it is repeated in a list wantlen times.
source code
 
matrix_to_list(m) source code
 
list_to_matrix(m, n, l) source code
 
list_to_vector(l) source code
 
is_function(f) source code
 
is_functor(f) source code
 
get_func_code(f)
Get the func_code object from a function or functor object.
source code
 
get_callable_name(f) source code
 
get_callable_num_args(f) source code
Variables [hide private]
  _last_m = None
hash(x)
Function Details [hide private]

as_list_with_len(x, wantlen)

source code 

If x is not a list type, it is repeated in a list wantlen times. Otherwise checks it x the correct length. Always returns a list with length wantlen or raises an exception.