stan-dev / stan

Stan development repository. The master branch contains the current release. The develop branch contains the latest stable development. See the Developer Process Wiki for details.
https://mc-stan.org
BSD 3-Clause "New" or "Revised" License
2.61k stars 369 forks source link

add write_checked_* methods to stan::io::serializer #3116

Closed nhuurre closed 2 years ago

nhuurre commented 2 years ago

Submission Checklist

Summary

Add new methods to stan::io::serializer that validate the values being written and write NaNs instead if the output does not meet the expected constraints. This helps with stan-dev/stanc3#1163

Intended Effect

How to Verify

Side Effects

Documentation

Copyright and Licensing

Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company): Copyright holder: Niko Huurre

By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses:

nhuurre commented 2 years ago

Irrelevant after closing https://github.com/stan-dev/stanc3/pull/1163.