nimble-dev / nimble

The base NIMBLE package for R
http://R-nimble.org
BSD 3-Clause "New" or "Revised" License
160 stars 24 forks source link

add `digits` argument to `nimPrint`? #1433

Closed paciorek closed 6 months ago

paciorek commented 7 months ago

In the course of looking at a Laplace/AGHQ question it was helpful to be able to print out more than the default number of digits that nimPrint/sstringstream prints.

The following modification to cppOutputCout and cppOutputCoutNoNewline could be a starting point:

    paste0('_nimble_global_output.precision(20); _nimble_global_output << fixed << ', paste0(unlist(lapply(code$args, nimGenerateCpp, symTab, asArg = TRUE) ), collapse = '<<'), '<<\"\\n\"; nimble_print_to_R(_nimble_global_output)')

@perrydv @danielturek does this seem like a useful tweak?

paciorek commented 6 months ago

Done in #1445