mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-12 22:20:35 +05:00
make array name platform independent
This commit is contained in:
parent
5288af641c
commit
59087f5c2c
@ -50,7 +50,9 @@ namespace ngcore
|
||||
{
|
||||
using TFlat = FlatArray<T, TIND>;
|
||||
using TArray = Array<T, TIND>;
|
||||
std::string suffix = std::string(typeid(T).name()) + "_" + typeid(TIND).name();
|
||||
std::string suffix = std::string(Demangle(typeid(T).name())) + "_" + Demangle(typeid(TIND).name());
|
||||
std::replace(suffix.begin(), suffix.end(), ':', '_');
|
||||
std::replace(suffix.begin(), suffix.end(), ' ', '_');
|
||||
std::string fname = std::string("FlatArray_") + suffix;
|
||||
auto flatarray_class = py::class_<TFlat>(m, fname.c_str(),
|
||||
py::buffer_protocol())
|
||||
|
@ -2,7 +2,7 @@ from pyngcore import *
|
||||
from numpy import sort, array
|
||||
|
||||
def test_array_numpy():
|
||||
a = Array_i_m(5)
|
||||
a = Array_int_unsigned_long(5)
|
||||
a[:] = 0
|
||||
a[3:] = 2
|
||||
assert(sum(a) == 4)
|
||||
|
Loading…
Reference in New Issue
Block a user