Skip to content

Commit 3827867

Browse files
facusapienza21tansongchen
authored andcommitted
Pass order of derivative as Val()
1 parent 555210e commit 3827867

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ TaylorDiff.jl is fast! See our dedicated [benchmarks](https://benchmark.tansongc
4545
using TaylorDiff
4646

4747
x = 0.1
48-
derivative(sin, x, 10) # scalar derivative
48+
derivative(sin, x, Val(10)) # scalar derivative
4949
v, direction = [3.0, 4.0], [1.0, 0.0]
50-
derivative(x -> sum(exp.(x)), v, direction, 2) # directional derivative
50+
derivative(x -> sum(exp.(x)), v, direction, Val(2)) # directional derivative
5151
```
5252

5353
Please see our [documentation](https://juliadiff.org/TaylorDiff.jl) for more details.

docs/src/index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ TaylorDiff.jl is fast! See our dedicated [benchmarks](https://benchmark.tansongc
3131
using TaylorDiff
3232

3333
x = 0.1
34-
derivative(sin, x, 10) # scalar derivative
34+
derivative(sin, x, Val(10)) # scalar derivative
3535
v, direction = [3.0, 4.0], [1.0, 0.0]
36-
derivative(x -> sum(exp.(x)), v, direction, 2) # directional derivative
36+
derivative(x -> sum(exp.(x)), v, direction, Val(2)) # directional derivative
3737
```
3838

3939
Please see our [documentation](https://juliadiff.org/TaylorDiff.jl) for more details.

examples/ode.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ display(different_time(ic, p_true, 2e-5))
3737
display(just_t(0.5))
3838

3939
#display(ForwardDiff.derivative(just_t,1.0))
40-
display(TaylorDiff.derivative(just_t, 1.0, 1)) #isnan error
40+
display(TaylorDiff.derivative(just_t, 1.0, Val(1))) #isnan error
4141
#display(value_and_gradient(just_t, AutoForwardDiff(), 1.0))
4242
#display(value_and_gradient(just_t, AutoReverseDiff(), 1.0))
4343
#display(value_and_gradient(just_t, AutoEnzyme(Enzyme.Reverse), 1.0))

0 commit comments

Comments
 (0)