def matrix_pair(self, rng, size, request): lower = request.param array = rng.standard_normal((size, size)) inv_tri_array = np.tril(array) if lower else np.triu(array) return ( matrices.InverseTriangularMatrix(inv_tri_array, lower), nla.inv(inv_tri_array), )
def __init__(self): super().__init__() for sz in SIZES: for lower in [True, False]: array = self.rng.standard_normal((sz, sz)) inv_tri_array = np.tril(array) if lower else np.triu(array) self.matrices[sz] = matrices.InverseTriangularMatrix( inv_tri_array, lower) self.np_matrices[sz] = nla.inv(inv_tri_array)
def __init__(self): matrix_pairs = {} rng = np.random.RandomState(SEED) for sz in SIZES: for lower in [True, False]: array = rng.standard_normal((sz, sz)) inv_tri_array = np.tril(array) if lower else np.triu(array) matrix_pairs[(sz, lower)] = (matrices.InverseTriangularMatrix( inv_tri_array, lower), nla.inv(inv_tri_array)) super().__init__(matrix_pairs, rng)