Esempio n. 1
0
def test_high_accuracy_nonneg():
    [x, status, hist] = l1ls_nonneg(A, y, lmbda, tar_gap=rel_tol / 10)
    assert_allclose(x, answer_high_accuracy_nonneg, atol=1e-5)
    expect(hist.shape).to_equal((15, 5))
    expect(status).to_equal('Solved')
Esempio n. 2
0
def test_small_example_sparse_nonneg():
    [x, status, hist] = l1ls_nonneg(S.csr_matrix(A), y, lmbda, tar_gap=rel_tol)
    assert_allclose(x, answer_nonneg, atol=1e-5)
    expect(hist.shape).to_equal((12, 5))
    expect(status).to_equal('Solved')
Esempio n. 3
0
def test_small_example_nonneg_zero():
    [x, status, hist] = l1ls_nonneg(A,
                                    np.zeros_like(y),
                                    lmbda,
                                    tar_gap=rel_tol)
    expect(status).to_equal('Failed')
Esempio n. 4
0
def test_high_accuracy_nonneg():
    [x, status, hist] = l1ls_nonneg(A, y, lmbda, tar_gap=rel_tol / 10)
    assert_allclose(x, answer_high_accuracy_nonneg, atol=1e-5)
    expect(hist.shape).to_equal((15, 5))
    expect(status).to_equal("Solved")
Esempio n. 5
0
def test_small_example_sparse_nonneg():
    [x, status, hist] = l1ls_nonneg(S.csr_matrix(A), y, lmbda, tar_gap=rel_tol)
    assert_allclose(x, answer_nonneg, atol=1e-5)
    expect(hist.shape).to_equal((12, 5))
    expect(status).to_equal("Solved")
Esempio n. 6
0
def test_small_example_nonneg_zero():
    [x, status, hist] = l1ls_nonneg(A, np.zeros_like(y), lmbda, tar_gap=rel_tol)
    expect(status).to_equal("Failed")