nimble-dev / nimble

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

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

Closed paciorek closed 4 months ago

paciorek commented 5 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 4 months ago

Done in #1445