Last change
on this file since 979 was
825,
checked in by dubos, 5 years ago
|
devel/Python : moved Fortran bindings and *.pyx to dynamico/dev module + necessary changes to test/py/*.py
|
File size:
349 bytes
|
Line | |
---|
1 | "Helper function to manage mixed precision" |
---|
2 | import numpy as np |
---|
3 | from unstructured import np_num |
---|
4 | |
---|
5 | zero=np_num(0.) |
---|
6 | |
---|
7 | # cast array to float/double depending on CPP_MIXED_PREC |
---|
8 | def asnum(data): return [ x.astype(np_num) for x in data] if type(data) is list else data.astype(np_num) |
---|
9 | |
---|
10 | def zeros(dims): return np.zeros([n for n in dims if n>1], dtype=np_num) |
---|
Note: See
TracBrowser
for help on using the repository browser.