Skip to content

Commit

Permalink
Define alpha and cleanup tests
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelraz committed May 29, 2018
1 parent bca373e commit c32a971
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# OrthogonalPolynomials

[![Build Status](https://travis-ci.org/miguelraz/OrthogonalPolynomials.jl.svg?branch=master)](https://travis-ci.org/miguelraz/OrthogonalPolynomials.jl)

[![Coverage Status](https://coveralls.io/repos/miguelraz/OrthogonalPolynomials.jl/badge.svg?branch=master&service=github)](https://coveralls.io/github/miguelraz/OrthogonalPolynomials.jl?branch=master)

[![codecov.io](http://codecov.io/github/miguelraz/OrthogonalPolynomials.jl/coverage.svg?branch=master)](http://codecov.io/github/miguelraz/OrthogonalPolynomials.jl?branch=master)
[![Build Status](https://travis-ci.org/miguelraz/OrthogonalPolynomials.jl.svg?branch=master)](https://travis-ci.org/miguelraz/OrthogonalPolynomials.jl) [![Coverage Status](https://coveralls.io/repos/miguelraz/OrthogonalPolynomials.jl/badge.svg?branch=master&service=github)](https://coveralls.io/github/miguelraz/OrthogonalPolynomials.jl?branch=master) [![codecov.io](http://codecov.io/github/miguelraz/OrthogonalPolynomials.jl/coverage.svg?branch=master)](http://codecov.io/github/miguelraz/OrthogonalPolynomials.jl?branch=master) [![Build status](https://ci.appveyor.com/api/projects/status/tgs1489v06dlk3u1/branch/master?svg=true)](https://ci.appveyor.com/project/miguelraz/orthogonalpolynomials-jl/branch/master)

## Introduction

Expand Down
3 changes: 2 additions & 1 deletion src/OrthogonalPolynomials.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ b(n, m) = n-m+1
c(m, α) = m*+m)
k(n, α=0) = [-b(n,i)*inv(c(i, α)) * d(n, α) for i in 1:n]
f(x) = x
const α = 0

a(x, n, ks = k(n,α), i=0) = i == n ? :(1) : return :(muladd( $(ks[i+1]*f(x)), $((a)(x, n, ks, i+1)) , 1))

Expand All @@ -20,6 +21,6 @@ macro a(x,n,ks=k(n,α))
return :($ex)
end

export d,b,c,k,f,a
export d,b,c,k,f,a

end # module
6 changes: 1 addition & 5 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ function laguerre_corrected(n, x)
l1
end

goal12(x) = @evalpoly x 1.0 -12.0 33.0 -36.666666666666664 20.625 -6.6 1.2833333333333334 -0.15714285714285714 0.012276785714285714 -0.0006062610229276896 1.8187830687830687e-5 -3.0062530062530064e-7


# Abramowitz and Stegun pg. 799
LaguerreTable = [
1 1 1 2 6 24 120 720 5040 40320 362880 3628800 39916800 479001600;
Expand Down Expand Up @@ -95,9 +92,8 @@ TestLaguerreTable = [
@test all([laguerre_corrected(i-1, testvals[j]) TestLaguerreTable[i,j] for i in 1:13, j in 2:6])
end
@testset "Stubborn Way" begin
const α = 0
@test all(eval.(a(0,i)) .≈ 1 for i in 1:12)
@test all(eval.([a(testvals[j],i) for i in 0:12, j in 2:6]) .≈ TestLaguerreTable[:,2:6])
end
end

goal12(x) = @horner x 1.0 -12.0 33.0 -36.666666666666664 20.625 -6.6 1.2833333333333334 -0.15714285714285714 0.012276785714285714 -0.0006062610229276896 1.8187830687830687e-5 -3.0062530062530064e-7
2 changes: 2 additions & 0 deletions utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ function T(n,k)
0
end
end

goal12(x) = @evalpoly x 1.0 -12.0 33.0 -36.666666666666664 20.625 -6.6 1.2833333333333334 -0.15714285714285714 0.012276785714285714 -0.0006062610229276896 1.8187830687830687e-5 -3.0062530062530064e-7

0 comments on commit c32a971

Please sign in to comment.