Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
L
librinterpolate
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Izzard, Robert Dr (Physics)
librinterpolate
Commits
bdc50da2
Commit
bdc50da2
authored
Jul 17, 2020
by
Izzard, Robert Dr (Physics)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update README.md
parent
04f42fdb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
README.md
README.md
+14
-14
No files found.
README.md
View file @
bdc50da2
...
...
@@ -18,7 +18,7 @@ so there are n parameters (p1, p2, p3...) and d data items
per data line (d1, d2, d3, d4 ...). There are l lines of data.
The parameters should be ordered from low to high values.
The parameters should be on aconstant
*
grid (which does NOT
The parameters should be on a
constant
*
grid (which does NOT
need to be regular).
What does this mean?
...
...
@@ -55,32 +55,32 @@ p2 : 10,25,30
The parameter "hypercube" then is the 3D-hypercube of
323 = 18 data lines.
Note that the points on the cube are
constant
* but notregular*
,
Note that the points on the cube are
constant but not regularly spaced
,
e.g. p0 has spacing (0.3-0.1)=0.2 and (0.9-0.3)=0.6, which are different,
BUT e.g. the spacing for p1 (-100 - -50 = -50) is the same, whatever the
value of p0. The same is true for p3 which always has spacings 15 and 5
from (25-10) and (30-25) respectively.
Note that the table is assumed to be sorted from SMALLEST
to LARGEST parameter values. It is also assumed to be regular and filled.
So no missing data please
, just put some dummy values in the table
.
to LARGEST parameter values. It is also assumed to be regular and f
ully f
illed.
So no missing data please.
In order t
o interpolate data, n parameters are passed into this
T
o interpolate data, n parameters are passed into this
routine in the array x. The result of the interpolation is put
into the array r (of size d).
If you enable RINTERPOLATE_CACHE (set on by default) then results are cached to
avoid
slowing the code too much. This means
If you enable RINTERPOLATE_CACHE (set on by default) then results are cached to
avoid
slowing the code too much. This means
that the interpolate routine checks your input parameters x against
the last few sets of parameters passed in. If you have used these x
recently, the result is simply returned. This saves extra interpolation
and is often faster. This is only true in some cases of course - if your
x are always different you waste time checking the cache. This is why
the cache_hint variable exists: if this is false then the cache is skipped.
Of course only
you
*
know if you are likely to call the interpolate routine
Of course only
you
know if you are likely to call the interpolate routine
repeated with the same values... I cannot possibly know this in advance!
The interpolation process involve
d
finding the lines of the data table
The interpolation process involve
s
finding the lines of the data table
which span each parameter x. This makes a hypercube of length 2^n (e.g.
in the above it is 8, for simple 1D linear interpolation it would be the
two spanning values). Linear interpolation is then done in the largest
...
...
@@ -89,11 +89,11 @@ and finally on the remaining variable (p0). This would reduce the table
from 2^3 lines to 2^2 to 2^1 to (finally) 2^0 i.e. one line which is the
interpolation result.
To find the spanning lines a binary search is performed. This code was
originally
donated by Evert Glebbeek. See e.g.
To find the spanning lines a binary search is performed. This code was
originally
donated by Evert Glebbeek. See e.g.
http://en.wikipedia.org/wiki/Binary_search_algorithm
and note the comment "Although the basic idea of binary search is comparatively
straightforward, the details can be surprisingly tricky... " haha!
:)
straightforward, the details can be surprisingly tricky... " haha!
Each table has its own unique table_id number. This is just to allow
us to set up caches (one per table) and save arrays such as varcount and
...
...
@@ -157,7 +157,7 @@ Example code is given in test_rinterpolate.c and reproduced here
/* free memory on exit */
rinterpolate_free_data(rinterpolate_data);
Safe_
free(rinterpolate_data);
free(rinterpolate_data);
```
...
...
@@ -168,4 +168,4 @@ you can squeeze any more speed out of the function.
I am sorry this has made most of the function unreadable! The
comments should help, but you will need to know some tricks...
(c) Robert Izzard, 2005-2019, please send bug fixes!
\ No newline at end of file
(c) Robert Izzard, 2005-2020, please send bug fixes!
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment