You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-5Lines changed: 16 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,6 +63,18 @@ gradient!(g, itp, x, y, ...)
63
63
```
64
64
where `g` is a pre-allocated vector.
65
65
66
+
Some interpolation objects support computation of the hessian, which
67
+
can be obtained as
68
+
```jl
69
+
h =hessian(itp, x, y, ...)
70
+
```
71
+
or, if you're evaluating the hessian repeatedly, a somewhat more
72
+
efficient option is
73
+
```jl
74
+
hessian!(h, itp, x, y, ...)
75
+
```
76
+
where `h` is a pre-allocated matrix.
77
+
66
78
`A` may have any element type that supports the operations of addition
67
79
and multiplication. Examples include scalars like `Float64`, `Int`,
68
80
and `Rational`, but also multi-valued types like `RGB` color vectors.
@@ -91,7 +103,7 @@ fine = itp[linspace(1,10,1001), linspace(1,15,201)]
91
103
92
104
### BSplines
93
105
94
-
The interpolation type is described in terms of *degree*, *grid behavior* and, if necessary, *boundary conditions*. There are currently three degrees available: `Constant`, `Linear` and `Quadratic`, corresponding to B-splines of degree 0, 1 and 2, respectively.
106
+
The interpolation type is described in terms of *degree*, *grid behavior* and, if necessary, *boundary conditions*. There are currently three degrees available: `Constant`, `Linear`, `Quadratic`, and `Cubic`corresponding to B-splines of degree 0, 1, 2, and 3 respectively.
95
107
96
108
You also have to specify what *grid representation* you want. There are currently two choices: `OnGrid`, in which the supplied data points are assumed to lie *on* the boundaries of the interpolation interval, and `OnCell` in which the data points are assumed to lie on half-intervals between cell boundaries.
97
109
@@ -132,9 +144,9 @@ defining the knots of the array.
132
144
In 1D
133
145
```jl
134
146
A =rand(20)
135
-
A_x =collect(1.:40.)
136
-
knots = (a,)
137
-
itp =interpolate(knots,A, Gridded(Linear()))
147
+
A_x =collect(1.0:2.0:40.0)
148
+
knots = (A_x,)
149
+
itp =interpolate(knots,A, Gridded(Linear()))
138
150
itp[2.0]
139
151
```
140
152
@@ -157,7 +169,6 @@ One may also mix modes, by specifying a mode vector in the form of an explicit t
157
169
itp =interpolate(knots, A, (Gridded(Linear()),Gridded(Constant())))
0 commit comments