def _get_array(shape, dtype):
if len(shape) == <NUM_LIT:2> and shape[<NUM_LIT:0>] == <NUM_LIT:2>:<EOL><INDENT>x = np.zeros(shape, dtype=dtype)<EOL>x[<NUM_LIT:0>,<NUM_LIT:1>:] = -<NUM_LIT:1><EOL>x[<NUM_LIT:1>] = <NUM_LIT:2><EOL>return x<EOL><DEDENT>elif len(shape) == <NUM_LIT:2> and shape[<NUM_LIT:0>] == shape[<NUM_LIT:1>]:<EOL><INDENT>x = np.zeros(shape, dtype=dtype)<EOL>j = np.arange(shape[<NUM_LIT:0>])<EOL>x[j,j] = <NUM_LIT:2><EOL>x[j[:-<NUM_LIT:1>],j[:-<NUM_LIT:1>]+<NUM_LIT:1>] = -<NUM_LIT:1><EOL>x[j[:-<NUM_LIT:1>]+<NUM_LIT:1>,j[:-<NUM_LIT:1>]] = -<NUM_LIT:1><EOL>return x<EOL><DEDENT>else:<EOL><INDENT>np.random.seed(<NUM_LIT>)<EOL>return np.random.randn(*shape).astype(dtype)<EOL><DEDENT>
Get a test array of given shape and data type.
Returned NxN matrices are posdef, and 2xN are banded-posdef.