コード例 #1
0
ファイル: test_convolve.py プロジェクト: zoccolan/eyetracker
def test_convolve1():
    """
    convolve(data, kernel, mode=FULL)
    Returns the discrete, linear convolution of 1-D
    sequences a and v; mode can be 0 (VALID), 1 (SAME), or 2 (FULL)
    to specify size of the resulting sequence.
    """
    result = convolve(np.arange(8), [1, 2], mode=VALID)
    test = np.array([1, 4, 7, 10, 13, 16, 19])
    assert_equal(result, test)
コード例 #2
0
ファイル: test_convolve.py プロジェクト: huard/scipy-work
def test_convolve1():
    """
    convolve(data, kernel, mode=FULL)
    Returns the discrete, linear convolution of 1-D
    sequences a and v; mode can be 0 (VALID), 1 (SAME), or 2 (FULL)
    to specify size of the resulting sequence.
    """
    result = convolve(np.arange(8), [1, 2], mode=VALID)
    test = np.array([1, 4, 7, 10, 13, 16, 19])
    assert_equal(result, test)
コード例 #3
0
ファイル: test_convolve.py プロジェクト: huard/scipy-work
def test_convolve9():
    result = convolve(np.arange(8), [1, 2, 3, 4, 5, 6], mode=FULL)
    test = np.array([0, 1, 4, 10, 20, 35, 56, 77, 90, 94, 88, 71, 42])
    assert_equal(result, test)
コード例 #4
0
ファイル: test_convolve.py プロジェクト: huard/scipy-work
def test_convolve8():
    result = convolve(np.arange(8), [1, 2, 3, 4, 5, 6], mode=SAME)
    test = np.array([4, 10, 20, 35, 56, 77, 90, 94])
    assert_equal(result, test)
コード例 #5
0
ファイル: test_convolve.py プロジェクト: huard/scipy-work
def test_convolve7():
    result = convolve(np.arange(8), [1, 2, 3, 4, 5, 6], mode=VALID)
    test = np.array([35, 56, 77])
    assert_equal(result, test)
コード例 #6
0
ファイル: test_convolve.py プロジェクト: huard/scipy-work
def test_convolve6():
    result = convolve(np.arange(8), [1, 2, 3], mode=FULL)
    test = np.array([0, 1, 4, 10, 16, 22, 28, 34, 32, 21])
    assert_equal(result, test)
コード例 #7
0
ファイル: test_convolve.py プロジェクト: huard/scipy-work
def test_convolve5():
    result = convolve(np.arange(8), [1, 2, 3], mode=SAME)
    test = np.array([1, 4, 10, 16, 22, 28, 34, 32])
    assert_equal(result, test)
コード例 #8
0
ファイル: test_convolve.py プロジェクト: zoccolan/eyetracker
def test_convolve5():
    result = convolve(np.arange(8), [1, 2, 3], mode=SAME)
    test = np.array([1, 4, 10, 16, 22, 28, 34, 32])
    assert_equal(result, test)
コード例 #9
0
ファイル: test_convolve.py プロジェクト: huard/scipy-work
def test_convolve2():
    result = convolve(np.arange(8), [1, 2], mode=SAME)
    test = np.array([0, 1, 4, 7, 10, 13, 16, 19])
    assert_equal(result, test)
コード例 #10
0
ファイル: test_convolve.py プロジェクト: zoccolan/eyetracker
def test_convolve2():
    result = convolve(np.arange(8), [1, 2], mode=SAME)
    test = np.array([0, 1, 4, 7, 10, 13, 16, 19])
    assert_equal(result, test)
コード例 #11
0
ファイル: test_convolve.py プロジェクト: zoccolan/eyetracker
def test_convolve10():
    result = convolve([1., 2.], np.arange(10.))
    test = np.array([0., 1., 4., 7., 10., 13., 16., 19., 22., 25., 18.])
    assert_equal(result, test)
コード例 #12
0
ファイル: test_convolve.py プロジェクト: zoccolan/eyetracker
def test_convolve9():
    result = convolve(np.arange(8), [1, 2, 3, 4, 5, 6], mode=FULL)
    test = np.array([0, 1, 4, 10, 20, 35, 56, 77, 90, 94, 88, 71, 42])
    assert_equal(result, test)
コード例 #13
0
ファイル: test_convolve.py プロジェクト: zoccolan/eyetracker
def test_convolve8():
    result = convolve(np.arange(8), [1, 2, 3, 4, 5, 6], mode=SAME)
    test = np.array([4, 10, 20, 35, 56, 77, 90, 94])
    assert_equal(result, test)
コード例 #14
0
ファイル: test_convolve.py プロジェクト: zoccolan/eyetracker
def test_convolve7():
    result = convolve(np.arange(8), [1, 2, 3, 4, 5, 6], mode=VALID)
    test = np.array([35, 56, 77])
    assert_equal(result, test)
コード例 #15
0
ファイル: test_convolve.py プロジェクト: zoccolan/eyetracker
def test_convolve6():
    result = convolve(np.arange(8), [1, 2, 3], mode=FULL)
    test = np.array([0, 1, 4, 10, 16, 22, 28, 34, 32, 21])
    assert_equal(result, test)
コード例 #16
0
ファイル: test_convolve.py プロジェクト: huard/scipy-work
def test_convolve10():
    result = convolve([1.0, 2.0], np.arange(10.0))
    test = np.array([0.0, 1.0, 4.0, 7.0, 10.0, 13.0, 16.0, 19.0, 22.0, 25.0, 18.0])
    assert_equal(result, test)
コード例 #17
0
ファイル: test_convolve.py プロジェクト: zoccolan/eyetracker
def test_convolve3():
    result = convolve(np.arange(8), [1, 2], mode=FULL)
    test = np.array([0, 1, 4, 7, 10, 13, 16, 19, 14])
    assert_equal(result, test)
コード例 #18
0
ファイル: test_convolve.py プロジェクト: huard/scipy-work
def test_convolve4():
    result = convolve(np.arange(8), [1, 2, 3], mode=VALID)
    test = np.array([4, 10, 16, 22, 28, 34])
    assert_equal(result, test)
コード例 #19
0
ファイル: test_convolve.py プロジェクト: huard/scipy-work
def test_convolve3():
    result = convolve(np.arange(8), [1, 2], mode=FULL)
    test = np.array([0, 1, 4, 7, 10, 13, 16, 19, 14])
    assert_equal(result, test)
コード例 #20
0
ファイル: test_convolve.py プロジェクト: zoccolan/eyetracker
def test_convolve4():
    result = convolve(np.arange(8), [1, 2, 3], mode=VALID)
    test = np.array([4, 10, 16, 22, 28, 34])
    assert_equal(result, test)