Skip to content

Commit

Permalink
final docs updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsignorelli committed Sep 15, 2024
1 parent 8873446 commit b976073
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/src/man/k_fastgtpsa.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ y = rand(3); # hide
@btime @FastGTPSA begin
out = @. $x^3*sin($y)/log(2+$x)-exp($x*$y)*im;
end;
out = zeros(ComplexTPS64, 3) # pre-allocate
out = zeros(ComplexTPS64, 3); # pre-allocate
@btime @FastGTPSA! begin
@. $out = $x^3*sin($y)/log(2+$x)-exp($x*$y)*im;
end;
Expand Down
16 changes: 15 additions & 1 deletion docs/src/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,21 @@ t3 = ComplexTPS64(); t4 = ComplexTPS64(); @gensym w;
```

The advantages of using the macro become especially apparent in more complicated systems, for example in [`benchmark/track.jl`](https://github.com/bmad-sim/GTPSA.jl/blob/main/benchmark/track.jl).
Both macros are also compatible with broadcasted, vectorized operators:

```@repl
using GTPSA, BenchmarkTools # hide
d = Descriptor(3, 7); x = vars(d); y = rand(3);
@btime @FastGTPSA begin
out = @. $x^3*sin($y)/log(2+$x)-exp($x*$y)*im;
end;
out = zeros(ComplexTPS64, 3); # pre-allocate
@btime @FastGTPSA! begin
@. $out = $x^3*sin($y)/log(2+$x)-exp($x*$y)*im;
end;
```

The advantages of using the macros become especially apparent in more complicated systems, for example in [`benchmark/track.jl`](https://github.com/bmad-sim/GTPSA.jl/blob/main/benchmark/track.jl).

## Promotion of `TPS64` to `ComplexTPS64`

Expand Down

0 comments on commit b976073

Please sign in to comment.