def mul(R, fact): for field_name, field in R.items(): numpy.multiply(field, fact, out=field)
def check_except_c128(R, expected): for field_name, field in R.items(): print(field_name, field) assert field[0] == expected
def inc(R, step): for field_name, field in R.items(): numpy.add(field, step, out=field)