Exemplo n.º 1
0
def ext_arr_to_ndarray_matrix(arr: ext_arr(), ndarray: any_arr(),
                              as_vector: template()):
    for I in grouped(ndarray):
        for p in static(range(ndarray[I].n)):
            for q in static(range(ndarray[I].m)):
                if static(as_vector):
                    ndarray[I][p] = arr[I, p]
                else:
                    ndarray[I][p, q] = arr[I, p, q]
Exemplo n.º 2
0
def ndarray_to_ext_arr(ndarray: any_arr(), arr: ext_arr()):
    for I in ti.grouped(ndarray):
        arr[I] = ndarray[I]
Exemplo n.º 3
0
def fill_ndarray_matrix(ndarray: any_arr(), val: template()):
    for I in ti.grouped(ndarray):
        ndarray[I].fill(val)
Exemplo n.º 4
0
def fill_ndarray(ndarray: any_arr(), val: template()):
    for I in ti.grouped(ndarray):
        ndarray[I] = val
Exemplo n.º 5
0
def ext_arr_to_ndarray(arr: ext_arr(), ndarray: any_arr()):
    for I in ti.grouped(ndarray):
        ndarray[I] = arr[I]
Exemplo n.º 6
0
def ndarray_to_ndarray(ndarray: any_arr(), other: any_arr()):
    for I in ti.grouped(ndarray):
        ndarray[I] = other[I]