Skip to content

Commit bef8a3f

Browse files
committed
ups
1 parent 01fc421 commit bef8a3f

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

src/JTools.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export plotCorrelation, plotCorrelation!
4343
include("functions/makieTools.jl")
4444

4545
export crossmat, logrange, unwrap!, modd, isMultiple, signum
46-
export polyfit, polyval, interp1
46+
export polyfit, polyval, interp1, mul3x1!, mul3x3!
4747
include("functions/math.jl")
4848

4949
export lsq, lsqWeight

src/functions/math.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,18 @@ end
5656
id0 = searchsortedlast(x, xi)
5757
return y[id0] + (y[id0 + 1] - y[id0])/(x[id0 + 1] - x[id0])*(xi - x[id0])
5858
end
59+
60+
61+
@inline function mul3x1!(out, A, b)
62+
@inbounds @simd for i in 1:3
63+
out[i] = A[i, 1]*b[1] + A[i, 2]*b[2] + A[i, 3]*b[3]
64+
end
65+
return
66+
end
67+
68+
@inline function mul3x3!(out, A, B)
69+
@inbounds for i in 1:3, j in 1:3
70+
out[i, j] = A[i, 1]*B[1, j] + A[i, 2]*B[2, j] + A[i, 3]*B[3, j]
71+
end
72+
return
73+
end

0 commit comments

Comments
 (0)