Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply changes from issue #51 for precompilations and warnings
This commit applies the updates from issue #51 provided by @yuyichao for enabling pre-compilation and removing warnings for method redefinition, but makes all code changes to non-underscored files. The original order of loading files within __FILELIST.jl and GSL.jl is maintained by making edits to the include commands within __FILELIST.jl and removing entries from GSL.jl. Tests of pre-compilation and execution of runtests.jl were performed for Julia 0.4.3 and the current Julia 0.5.0-dev nightly build.
- Loading branch information
1 parent
a0bcbe8
commit e4c7431
Showing
19 changed files
with
1,049 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/usr/bin/env julia | ||
#GSL Julia wrapper | ||
#(c) 2013 Jiahao Chen <jiahao@mit.edu> | ||
################################################# | ||
# 41.1 Representation of floating point numbers # | ||
################################################# | ||
export ieee_fprintf_float, ieee_fprintf_double, | ||
ieee_printf_float, ieee_printf_double | ||
|
||
# These functions output a formatted version of the IEEE floating-point number | ||
# pointed to by x to the stream stream. A pointer is used to pass the number | ||
# indirectly, to avoid any undesired promotion from float to double. The | ||
# output takes one of the following forms, NaNthe Not-a-Number | ||
# symbol Inf, -Infpositive or negative infinity | ||
# 1.fffff...*2^E, -1.fffff...*2^Ea normalized floating point number | ||
# 0.fffff...*2^E, -0.fffff...*2^Ea denormalized floating point number | ||
# 0, -0positive or negative zero The output can be used directly | ||
# in GNU Emacs Calc mode by preceding it with 2# to indicate binary. | ||
# | ||
# Returns: Void | ||
function ieee_fprintf_float{tA<:Real}(stream::Ref{Void}, x_in::AbstractVector{tA}) | ||
x = convert(Vector{Cfloat}, x_in) | ||
ccall( (:gsl_ieee_fprintf_float, libgsl), Void, (Ref{Void}, | ||
Ref{Cfloat}), stream, x ) | ||
end | ||
|
||
|
||
# These functions output a formatted version of the IEEE floating-point number | ||
# pointed to by x to the stream stream. A pointer is used to pass the number | ||
# indirectly, to avoid any undesired promotion from float to double. The | ||
# output takes one of the following forms, NaNthe Not-a-Number | ||
# symbol Inf, -Infpositive or negative infinity | ||
# 1.fffff...*2^E, -1.fffff...*2^Ea normalized floating point number | ||
# 0.fffff...*2^E, -0.fffff...*2^Ea denormalized floating point number | ||
# 0, -0positive or negative zero The output can be used directly | ||
# in GNU Emacs Calc mode by preceding it with 2# to indicate binary. | ||
# | ||
# Returns: Void | ||
function ieee_fprintf_double{tA<:Real}(stream::Ref{Void}, x_in::AbstractVector{tA}) | ||
x = convert(Vector{Cdouble}, x_in) | ||
ccall( (:gsl_ieee_fprintf_double, libgsl), Void, (Ref{Void}, | ||
Ref{Cdouble}), stream, x ) | ||
end | ||
|
||
|
||
# These functions output a formatted version of the IEEE floating-point number | ||
# pointed to by x to the stream stdout. | ||
# | ||
# Returns: Void | ||
function ieee_printf_float{tA<:Real}(x_in::AbstractVector{tA}) | ||
x = convert(Vector{Cfloat}, x_in) | ||
ccall( (:gsl_ieee_printf_float, libgsl), Void, (Ref{Cfloat}, ), x ) | ||
end | ||
|
||
|
||
# These functions output a formatted version of the IEEE floating-point number | ||
# pointed to by x to the stream stdout. | ||
# | ||
# Returns: Void | ||
function ieee_printf_double{tA<:Real}(x_in::AbstractVector{tA}) | ||
x = convert(Vector{Cdouble}, x_in) | ||
ccall( (:gsl_ieee_printf_double, libgsl), Void, (Ref{Cdouble}, ), x ) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
#!/usr/bin/env julia | ||
#GSL Julia wrapper | ||
#(c) 2013 Jiahao Chen <jiahao@mit.edu> | ||
############################################## | ||
# 7.5.1 Regular Cylindrical Bessel Functions # | ||
############################################## | ||
export sf_bessel_J0, sf_bessel_J0_e, sf_bessel_J1, sf_bessel_J1_e, | ||
sf_bessel_Jn, sf_bessel_Jn_e | ||
|
||
|
||
# These routines compute the regular cylindrical Bessel function of zeroth | ||
# order, J_0(x). | ||
# | ||
# Returns: Cdouble | ||
function sf_bessel_J0(x::Real) | ||
ccall( (:gsl_sf_bessel_J0, libgsl), Cdouble, (Cdouble, ), x ) | ||
end | ||
@vectorize_1arg Number sf_bessel_J0 | ||
|
||
|
||
# These routines compute the regular cylindrical Bessel function of zeroth | ||
# order, J_0(x). | ||
# | ||
# Returns: Cint | ||
function sf_bessel_J0_e(x::Real) | ||
result = Ref{gsl_sf_result}() | ||
errno = ccall( (:gsl_sf_bessel_J0_e, libgsl), Cint, (Cdouble, | ||
Ref{gsl_sf_result}), x, result ) | ||
if errno!= 0 throw(GSL_ERROR(errno)) end | ||
return result[] | ||
end | ||
@vectorize_1arg Number sf_bessel_J0_e | ||
|
||
|
||
# These routines compute the regular cylindrical Bessel function of first | ||
# order, J_1(x). | ||
# | ||
# Returns: Cdouble | ||
function sf_bessel_J1(x::Real) | ||
ccall( (:gsl_sf_bessel_J1, libgsl), Cdouble, (Cdouble, ), x ) | ||
end | ||
@vectorize_1arg Number sf_bessel_J1 | ||
|
||
|
||
# These routines compute the regular cylindrical Bessel function of first | ||
# order, J_1(x). | ||
# | ||
# Returns: Cint | ||
function sf_bessel_J1_e(x::Real) | ||
result = Ref{gsl_sf_result}() | ||
errno = ccall( (:gsl_sf_bessel_J1_e, libgsl), Cint, (Cdouble, | ||
Ref{gsl_sf_result}), x, result ) | ||
if errno!= 0 throw(GSL_ERROR(errno)) end | ||
return result[] | ||
end | ||
@vectorize_1arg Number sf_bessel_J1_e | ||
|
||
|
||
# These routines compute the regular cylindrical Bessel function of order n, | ||
# J_n(x). | ||
# | ||
# Returns: Cdouble | ||
function sf_bessel_Jn(n::Integer, x::Real) | ||
ccall( (:gsl_sf_bessel_Jn, libgsl), Cdouble, (Cint, Cdouble), n, x ) | ||
end | ||
@vectorize_2arg Number sf_bessel_Jn | ||
|
||
|
||
# These routines compute the regular cylindrical Bessel function of order n, | ||
# J_n(x). | ||
# | ||
# Returns: Cint | ||
function sf_bessel_Jn_e(n::Integer, x::Real) | ||
result = Ref{gsl_sf_result}() | ||
errno = ccall( (:gsl_sf_bessel_Jn_e, libgsl), Cint, (Cint, Cdouble, | ||
Ref{gsl_sf_result}), n, x, result ) | ||
if errno!= 0 throw(GSL_ERROR(errno)) end | ||
return result[] | ||
end | ||
@vectorize_2arg Number sf_bessel_Jn_e |
Oops, something went wrong.