Skip to content

Commit f377c15

Browse files
notZakidextorious
authored andcommitted
Clarify that Trapezoidal is default method (#21)
1 parent 5ad8423 commit f377c15

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Do note that while the code is trivial, it has not been extensively tested and d
1818
x = collect(-π : π/1000 : π)
1919
y = sin.(x)
2020

21-
# integrate using the default TrapezoidalFast method
21+
# integrate using the default Trapezoidal method
2222
integrate(x, y)
2323

2424
# integrate using a specific method
@@ -32,7 +32,7 @@ z = [sin.(x) cos.(x) exp.(x/pi)]
3232
Z = cumul_integrate(x, z)
3333

3434
# compute cumulative integral for each line of an array
35-
zp = permutedims(z)
35+
zp = permutedims(z)
3636
ZP = cumul_integrate(x, zp, dims=1)
3737

3838
```

src/NumericalIntegration.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ const HALF = 1//2
3232
"""
3333
integrate(x,y...)
3434
35-
Compute numerical integral of y(x) from x=x[1] to x=x[end]. Return a scalar of the same type as the input. If not method is supplied, use TrapezdoialFast.
35+
Compute numerical integral of y(x) from x=x[1] to x=x[end]. Return a scalar of the same type as the input. If no method is supplied, use Trapezdoial.
3636
"""
3737
function integrate(x,y...) end
3838

3939

4040
"""
4141
cumul_integrate(x,y...)
4242
43-
Compute cumulative numerical integral of y(x) from x=x[1] to x=x[end]. Return a vector with elements of the same type as the input. If not method is supplied, use TrapezdoialFast.
43+
Compute cumulative numerical integral of y(x) from x=x[1] to x=x[end]. Return a vector with elements of the same type as the input. If no method is supplied, use Trapezdoial.
4444
"""
4545
function cumul_integrate(x,y...) end
4646

@@ -57,7 +57,7 @@ end
5757
"""
5858
integrate(x::AbstractVector, y::AbstractVector, ::Trapezoidal)
5959
60-
Use Trapezoidal rule.
60+
Use Trapezoidal rule. This is the default when no method is supplied.
6161
"""
6262
function integrate(x::AbstractVector, y::AbstractVector, ::Trapezoidal)
6363
@assert length(x) == length(y) "x and y vectors must be of the same length!"
@@ -81,7 +81,7 @@ end
8181
"""
8282
integrate(x::AbstractVector, y::AbstractVector, ::TrapezoidalFast)
8383
84-
Use Trapezoidal rule. Unsafe method: no bound checking. This is the default when no method is supplied.
84+
Use Trapezoidal rule. Unsafe method: no bound checking.
8585
"""
8686
function integrate(x::AbstractVector, y::AbstractVector, ::TrapezoidalFast)
8787
retval = _zero(x,y)
@@ -253,7 +253,7 @@ end
253253
"""
254254
cumul_integrate(x::AbstractVector, y::AbstractVector, ::Trapezoidal)
255255
256-
Use Trapezoidal rule.
256+
Use Trapezoidal rule. This is the default when no method is supplied.
257257
"""
258258
function cumul_integrate(x::AbstractVector, y::AbstractVector, ::Trapezoidal)
259259
@assert length(x) == length(y) "x and y vectors must be of the same length!"
@@ -281,7 +281,7 @@ end
281281
"""
282282
cumul_integrate(x::AbstractVector, y::AbstractVector, ::TrapezoidalFast)
283283
284-
Use Trapezoidal rule. Unsafe method: no bound checking. This is the default when no method is supplied.
284+
Use Trapezoidal rule. Unsafe method: no bound checking.
285285
"""
286286
function cumul_integrate(x::AbstractVector, y::AbstractVector, ::TrapezoidalFast)
287287
retarr = _zeros(x,y)

0 commit comments

Comments
 (0)