Commit 1faa9b2
Use cubic spline interpolation to speed up volmap (#869)
* SPAM shouldn't be hidden.
* Skip peaks where the bin calculation would potentially overflow
* Avoid using zero bandwidth for KDE histogram when only 1 value available
* Start adding dataset that can be used to hold vectors and an associated scalar value.
* Add Sync()
* Update dependencies
* Add VECTOR_SCALAR set
* Add DataIO class for writing peaks.
* Enable peaks file output
* Use vector scalar data to store peaks, write to data file.
* Make the vector scalar set 0 dimension so it is forced to use the DataIO_Peaks format. May want to do this in a less hacky way in the future.
* Re-organize branches in volmap loop to avoid some unnecessary calculation. Slightly more efficient (1-2%) and avoids using a 'continue'.
* A line with no elements cannot be a Tinker atom line
* Start adding code to read the peaks file.
* Remove some debug info
* Add peaks read.
* Rewrite peaks read to make it more strict. Must conform to what ID_DataFormat expects.
* Use DataSet/DataFile framework for peaks in SPAM
* Ensure that the GetNextString for output file is the last possible thing parsed from the argument list
* Fix class const variable name
* Make it so that you can calculate peaks without having to write them to a file.
* Fix code comment
* Fix up dependencies
* Add class for approximating functions with splines
* Ensure table is cleared when fill is called.
* Use the splines. 36% speed increase!
* Disable some debug checking
* Woops, bring back return statement
* Remove some debug info. Add scaling factor argument.
* Add splinedx keyword
* Add code note about function calls in openmp parallel regions
* Fix up help.
* Warn if extra arguments remain after 'purewater' specified for SPAM
* Fix up SPAM documentation.
* Update the volmap manual entry.
* More manual updates for volmap. Fix up help.
* Fix up some dependencies
* Add /= operator
* Add IncrementElement() function
* Add SetGrid function
* Change SetGrid to accept index instead
* Enable DIV and MULT for grids
* Add option to read grids in as double precision
* Add function to return format type
* Add == operator for TextFormat
* Fix the operator
* Ensure debug level is set for files being written
* When writing opendx files, if the format is still the default for grids, use general format (matches previous behavior). However, if another format has been set use that instead.
* Add check for out of range value in Yval(). Save input X values for use in a more accurate function, Yval_accurate().
* Add another way of filling the table; can give better results with Yvals_accurate()
* DRR - Omit out of bounds check, rely on args being reasonable. Results in minor speedup (e.g. 5.4 fps to 6.4 fps).
* Put the range check behind a define.
* Allow volmap to be compiled for either single or double precision grid
* Add ability to compile and use exponential function.
* Add define for using the more accurate but slower table lookup
* Add some debug
* Add some debug info and a new function that uses the internal X table.
* Add spline function table check for Yval_xtable
* Add VOLMAP_USEXTABLE
* Ensure the xvalues used in the mesh are generated in the same way as during the Y eval step. Round-off makes the addition method prone to errors for small table spacings
* When enabled, make sure the out of range check happens before dx calculation so it actually takes effect
* Add splinescale arg, improve output
* Add back the ReadHelp function.
* Remove scaling argument from spline table setup. Instead, have volmap add 1.0 to the max expected value to avoid Runges phenomenon.
* Add fast exponential from N. N. Schraudolph, Neural Computation 11, 853–862 (1999)
* Add define for using fast exp from Schraudolph
* Add 64 bit version and header protection
* Fix the always inline attribute; add volmap define for using 64 bit fast exps
* Add library from https://github.com/simonpf/fastexp for testing
* Add ability to test the fast exp code from https://github.com/simonpf/fastexp
* Remove the "fast" exponential code. Was only for testing. Leave the hooks in, just in case we ever need to test it again. Fast exponential code will be kept in a separate repository.
* Remove obsolete splinescale argument
* Clean up output
* Remove old code, improve code documentation.
* Put spline info print into separate functions.
* Add debug info. Do not set up spline table if using system exp()
* Add a warning if any grid spacings are smaller than 0.4
* Use SplineFxnTable for erfc
* Make erfc things private
* Make function private
* Rename function to avoid confusion
* Make function private. Add some code docs
* Make more vars private
* Remove obsolete code
* Make more variables private
* Minor version bump for using splines to speed up volmap. In principle the defaults chosen should make it so that the results are exactly the same as with system exp(); however there is the potential for some differences, so bump the minor version instead of revision.
* Add 'splinedx' to volmap help
Co-authored-by: Daniel R. Roe <daniel.roe@nih.gov>1 parent d3f4ea1 commit 1faa9b2
File tree
12 files changed
+420
-85
lines changed- doc
- src
12 files changed
+420
-85
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35435 | 35435 | | |
35436 | 35436 | | |
35437 | 35437 | | |
35438 | | - | |
| 35438 | + | |
35439 | 35439 | | |
35440 | 35440 | | |
35441 | 35441 | | |
| |||
35528 | 35528 | | |
35529 | 35529 | | |
35530 | 35530 | | |
| 35531 | + | |
| 35532 | + | |
| 35533 | + | |
| 35534 | + | |
| 35535 | + | |
| 35536 | + | |
| 35537 | + | |
| 35538 | + | |
35531 | 35539 | | |
35532 | 35540 | | |
35533 | 35541 | | |
| |||
35737 | 35745 | | |
35738 | 35746 | | |
35739 | 35747 | | |
| 35748 | + | |
| 35749 | + | |
| 35750 | + | |
| 35751 | + | |
| 35752 | + | |
| 35753 | + | |
| 35754 | + | |
| 35755 | + | |
| 35756 | + | |
| 35757 | + | |
| 35758 | + | |
| 35759 | + | |
| 35760 | + | |
| 35761 | + | |
| 35762 | + | |
| 35763 | + | |
| 35764 | + | |
| 35765 | + | |
| 35766 | + | |
35740 | 35767 | | |
35741 | 35768 | | |
35742 | 35769 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
18 | 23 | | |
19 | 24 | | |
20 | 25 | | |
| |||
39 | 44 | | |
40 | 45 | | |
41 | 46 | | |
42 | | - | |
| 47 | + | |
| 48 | + | |
43 | 49 | | |
44 | 50 | | |
45 | 51 | | |
| |||
55 | 61 | | |
56 | 62 | | |
57 | 63 | | |
58 | | - | |
| 64 | + | |
59 | 65 | | |
60 | 66 | | |
61 | 67 | | |
| |||
82 | 88 | | |
83 | 89 | | |
84 | 90 | | |
| 91 | + | |
| 92 | + | |
85 | 93 | | |
86 | 94 | | |
87 | 95 | | |
| |||
214 | 222 | | |
215 | 223 | | |
216 | 224 | | |
217 | | - | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
218 | 230 | | |
219 | 231 | | |
220 | 232 | | |
| |||
295 | 307 | | |
296 | 308 | | |
297 | 309 | | |
298 | | - | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
299 | 330 | | |
300 | 331 | | |
301 | 332 | | |
| |||
381 | 412 | | |
382 | 413 | | |
383 | 414 | | |
384 | | - | |
385 | | - | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
386 | 423 | | |
387 | 424 | | |
388 | 425 | | |
| |||
511 | 548 | | |
512 | 549 | | |
513 | 550 | | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
514 | 554 | | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
515 | 568 | | |
| 569 | + | |
516 | 570 | | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
517 | 584 | | |
518 | 585 | | |
519 | 586 | | |
| |||
531 | 598 | | |
532 | 599 | | |
533 | 600 | | |
| 601 | + | |
534 | 602 | | |
535 | 603 | | |
536 | 604 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
13 | 22 | | |
14 | 23 | | |
15 | 24 | | |
| |||
51 | 60 | | |
52 | 61 | | |
53 | 62 | | |
| 63 | + | |
| 64 | + | |
54 | 65 | | |
55 | 66 | | |
56 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
18 | 16 | | |
19 | 17 | | |
20 | 18 | | |
21 | 19 | | |
22 | 20 | | |
23 | 21 | | |
24 | 22 | | |
25 | | - | |
26 | | - | |
27 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
| |||
91 | 90 | | |
92 | 91 | | |
93 | 92 | | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | 93 | | |
126 | 94 | | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
| 95 | + | |
132 | 96 | | |
133 | 97 | | |
134 | 98 | | |
| |||
200 | 164 | | |
201 | 165 | | |
202 | 166 | | |
203 | | - | |
| 167 | + | |
204 | 168 | | |
205 | 169 | | |
206 | 170 | | |
| |||
223 | 187 | | |
224 | 188 | | |
225 | 189 | | |
226 | | - | |
| 190 | + | |
227 | 191 | | |
228 | 192 | | |
229 | 193 | | |
| |||
252 | 216 | | |
253 | 217 | | |
254 | 218 | | |
255 | | - | |
| 219 | + | |
256 | 220 | | |
257 | | - | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
258 | 227 | | |
259 | 228 | | |
260 | 229 | | |
| |||
0 commit comments