
arXiv: 1812.11668
This paper describes the design and implementation of a comprehensive OCaml interface to the Sundials library of numeric solvers for ordinary differential equations, differential algebraic equations, and non-linear equations. The interface provides a convenient and memory-safe alternative to using Sundials directly from C and facilitates application development by integrating with higher-level language features, like garbage-collected memory management, algebraic data types, and exceptions. Our benchmark results suggest that the interface overhead is acceptable: the standard examples are rarely twice as slow in OCaml than in C, and often less than 50% slower. The challenges in interfacing with Sundials are to efficiently and safely share data structures between OCaml and C, to support multiple implementations of vector operations and linear solvers through a common interface, and to manage calls and error signalling to and from OCaml. We explain how we overcame these difficulties using a combination of standard techniques such as phantom types and polymorphic variants, and carefully crafted data representations.
In Proceedings ML/OCAML 2016, arXiv:1812.10891
FOS: Computer and information sciences, Computer Science - Programming Languages, OCaml, QA75.5-76.95, Numeric simulation, [INFO.INFO-PL] Computer Science [cs]/Programming Languages [cs.PL], [INFO.INFO-MS] Computer Science [cs]/Mathematical Software [cs.MS], [INFO.INFO-NA] Computer Science [cs]/Numerical Analysis [cs.NA], Electronic computers. Computer science, QA1-939, Computer Science - Mathematical Software, Mathematical Software (cs.MS), Mathematics, Programming Languages (cs.PL)
FOS: Computer and information sciences, Computer Science - Programming Languages, OCaml, QA75.5-76.95, Numeric simulation, [INFO.INFO-PL] Computer Science [cs]/Programming Languages [cs.PL], [INFO.INFO-MS] Computer Science [cs]/Mathematical Software [cs.MS], [INFO.INFO-NA] Computer Science [cs]/Numerical Analysis [cs.NA], Electronic computers. Computer science, QA1-939, Computer Science - Mathematical Software, Mathematical Software (cs.MS), Mathematics, Programming Languages (cs.PL)
| selected citations These citations are derived from selected sources. This is an alternative to the "Influence" indicator, which also reflects the overall/total impact of an article in the research community at large, based on the underlying citation network (diachronically). | 1 | |
| popularity This indicator reflects the "current" impact/attention (the "hype") of an article in the research community at large, based on the underlying citation network. | Average | |
| influence This indicator reflects the overall/total impact of an article in the research community at large, based on the underlying citation network (diachronically). | Average | |
| impulse This indicator reflects the initial momentum of an article directly after its publication, based on the underlying citation network. | Average |
