MCPcopy Create free account
hub / github.com/FEniCS/dolfinx / create_test_sparsity

Function create_test_sparsity

python/test/unit/la/test_matrix_csr.py:22–32  ·  view source on GitHub ↗
(n, bs)

Source from the content-addressed store, hash-verified

20
21
22def create_test_sparsity(n, bs):
23 im = IndexMap(MPI.COMM_WORLD, n)
24 sp = SparsityPattern(MPI.COMM_WORLD, [im, im], [bs, bs])
25 if bs == 1:
26 for i in range(2):
27 for j in range(2):
28 sp.insert(2 + i, 4 + j)
29 elif bs == 2:
30 sp.insert(1, 2)
31 sp.finalize()
32 return sp
33
34
35@pytest.mark.parametrize("dtype", [np.float32, np.float64, np.complex64, np.complex128])

Callers 4

test_addFunction · 0.85
test_setFunction · 0.85
test_set_blockedFunction · 0.85
test_bad_entryFunction · 0.85

Calls 4

insertMethod · 0.95
finalizeMethod · 0.95
IndexMapClass · 0.90
SparsityPatternClass · 0.90

Tested by

no test coverage detected