Skip to content

Commit ff1f680

Browse files
lbenetLuis Benet
and
Luis Benet
authored
Export norm (#332)
* Export norm * Remove unnecesary using LinearAlgebra * Bump patch version --------- Co-authored-by: Luis Benet <[email protected]>
1 parent 4f9d799 commit ff1f680

File tree

6 files changed

+44
-8
lines changed

6 files changed

+44
-8
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "TaylorSeries"
22
uuid = "6aa5eb33-94cf-58f4-a9d0-e4b2c4fc25ea"
33
repo = "https://github.com/JuliaDiff/TaylorSeries.jl.git"
4-
version = "0.15.1"
4+
version = "0.15.2"
55

66
[deps]
77
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

src/TaylorSeries.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export getcoeff, derivative, integrate, differentiate,
6060
# jacobian, hessian, jacobian!, hessian!,
6161
∇, taylor_expand, update!,
6262
constant_term, linear_polynomial, nonlinear_polynomial,
63-
normalize_taylor
63+
normalize_taylor, norm
6464

6565
const TS = TaylorSeries
6666

src/precompile.jl

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This file is part of the TaylorSeries.jl Julia package, MIT license
2+
#
3+
# Luis Benet & David P. Sanders
4+
# UNAM
5+
#
6+
# MIT Expat license
7+
#
8+
9+
using PrecompileTools
10+
11+
@setup_workload begin
12+
# Putting some things in `@setup_workload` instead of `@compile_workload` can reduce the size of the
13+
# precompile file and potentially make loading faster.
14+
t = Taylor1(20)
15+
δ = set_variables("δ", order=6, numvars=2)
16+
tN = one(δ[1]) + Taylor1(typeof(δ[1]), 20)
17+
# tb = Taylor1(Float128, 20)
18+
# δb = zero(Float128) .+ δ
19+
# tbN = one(δb[1]) + Taylor1(typeof(δb[1]), 20)
20+
#
21+
@compile_workload begin
22+
# all calls in this block will be precompiled, regardless of whether
23+
# they belong to your package or not (on Julia 1.8 and higher)
24+
for x in (:t, :tN)
25+
@eval begin
26+
T = numtype($x)
27+
zero($x)
28+
sin($x)
29+
cos($x)
30+
$x/sqrt($x^2+(2*$x)^2)
31+
evaluate(($x)^3, 0.125)
32+
($x)[2]
33+
end
34+
end
35+
end
36+
end

test/manyvariables.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using TaylorSeries
44

55
using Test
6-
using LinearAlgebra
6+
# using LinearAlgebra
77

88
@testset "Test hash tables" begin
99
# Issue #85 is solved!

test/mixtures.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using TaylorSeries
55

66
using Test
7-
using LinearAlgebra
7+
# using LinearAlgebra
88

99
@testset "Tests with mixtures of Taylor1 and TaylorN" begin
1010
@test TaylorSeries.NumberNotSeries == Union{Real,Complex}
@@ -231,7 +231,7 @@ using LinearAlgebra
231231
F(x) = [sin(sin(x[4]+x[3])), sin(cos(x[3]-x[2])), cos(sin(x[1]^2+x[2]^2)), cos(cos(x[2]*x[3]))]
232232
Q = F(v+dx)
233233
diff_evals = cos(sin(dx[1]))-p(P[1])
234-
@test norm( norm.(map(x->x.coeffs, diff_evals.coeffs),Inf) , Inf) < 1e-15
234+
@test norm(diff_evals, Inf) < 1e-15
235235
#evaluate a Taylor1 at a TaylorN
236236
@test p(P) == evaluate(p, P)
237237
@test q(Q) == evaluate(q, Q)
@@ -279,7 +279,7 @@ using LinearAlgebra
279279
a11 = Taylor1([t,t^2,exp(-t),sin(t),cos(t)])
280280
b11 = t+t*(t^2)+(t^2)*(exp(-t))+(t^3)*sin(t)+(t^4)*cos(t)
281281
diff_a11b11 = a11(t)-b11
282-
@test norm(diff_a11b11.coeffs,Inf) < 1E-19
282+
@test norm(diff_a11b11.coeffs, Inf) < 1E-19
283283

284284
X, Y = set_variables(Taylor1{Float64}, "x y")
285285
@test typeof( norm(X) ) == Float64

test/onevariable.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,8 +558,8 @@ Base.iszero(::SymbNumber) = false
558558
@test typeof( norm(Taylor1(rnd)) ) == Float64
559559
@test norm(Taylor1(rnd)) > 0
560560
@test norm(t_a) == norm(a)
561-
@test norm(Taylor1(a,15),3) == sum((a.^3))^(1/3)
562-
@test norm(t_a,Inf) == 12
561+
@test norm(Taylor1(a,15), 3) == sum((a.^3))^(1/3)
562+
@test norm(t_a, Inf) == 12
563563
@test norm(t_C) == norm(complex(3.0,4.0)*a)
564564

565565
@test TaylorSeries.rtoldefault(Taylor1{Int}) == 0

0 commit comments

Comments
 (0)