// Generate a test matrix of factors
X = np.zeros((d, dm), dtype=np.float64)
x = np.linspace(0, 2 * np.pi, d)
np.random.seed(10)
for j in range(dm):
X[:, j] = np.sin(x * (j + 1)) + 1e-10 * np.random.randn(d)
// Get the correlation matrix
After Change
pytest.xfail("Known to randomly fail on Win32")
// Some debugging information for CI runs that randomly fail
locs = np.where(~np.isclose(mat_dense, mat_sparse, rtol=.25, atol=1e-3))
print(mat_sparse[locs])
print(mat_dense[locs])
raise err
// Test on a quadratic function.