Stan  2.10.0
probability, sampling & optimization
Functions
stan::services::io Namespace Reference

Functions

bool do_print (const int n, const bool special, const int refresh)
 Indicates whether it should print on the current iteration. More...
 
bool do_print (const int n, const int refresh)
 Indicates whether it should print on the current iteration. More...
 
void write_error_msg (interface_callbacks::writer::base_writer &writer, const std::exception &e)
 Writes a Metropolis rejection message. More...
 
template<class Model , class RNG >
void write_iteration (Model &model, RNG &base_rng, double lp, std::vector< double > &cont_vector, std::vector< int > &disc_vector, interface_callbacks::writer::base_writer &message_writer, interface_callbacks::writer::base_writer &parameter_writer)
 
void write_model (interface_callbacks::writer::base_writer &writer, const std::string model_name)
 
void write_stan (interface_callbacks::writer::base_writer &writer)
 

Function Documentation

bool stan::services::io::do_print ( const int  n,
const bool  special,
const int  refresh 
)

Indicates whether it should print on the current iteration.

The function returns: true if refresh > 0 and (n == 0 or (n + 1) % refresh == 0 or special == true) false otherwise. Examples: if refresh = 0, always returns false. if refresh = 10 and special == false, returns true for n = {0, 9, 19, ...}, returns false for n = {1 - 8, 10 - 18, 20 - 28, ...}. if refresh = 10 and special == true, returns true for all n.

Parameters
nIteration number
specialWhen true, returns true
refreshNumber of iterations to refresh

Definition at line 25 of file do_print.hpp.

bool stan::services::io::do_print ( const int  n,
const int  refresh 
)

Indicates whether it should print on the current iteration.

The function returns: true if refresh > 0 and (n == 0 or (n + 1) % refresh == 0) false otherwise. Examples: if refresh = 0, always returns false. if refresh = 10, returns true for n = {0, 9, 19, ...}, returns false for n = {1 - 8, 10 - 18, 20 - 28, ...}.

Parameters
nIteration number
refreshNumber of iterations to refresh

Definition at line 43 of file do_print.hpp.

void stan::services::io::write_error_msg ( interface_callbacks::writer::base_writer writer,
const std::exception &  e 
)

Writes a Metropolis rejection message.

Parameters
writerWriter callback
eInput exception

Definition at line 18 of file write_error_msg.hpp.

template<class Model , class RNG >
void stan::services::io::write_iteration ( Model &  model,
RNG &  base_rng,
double  lp,
std::vector< double > &  cont_vector,
std::vector< int > &  disc_vector,
interface_callbacks::writer::base_writer message_writer,
interface_callbacks::writer::base_writer parameter_writer 
)

Definition at line 13 of file write_iteration.hpp.

void stan::services::io::write_model ( interface_callbacks::writer::base_writer writer,
const std::string  model_name 
)

Definition at line 11 of file write_model.hpp.

void stan::services::io::write_stan ( interface_callbacks::writer::base_writer writer)

Definition at line 12 of file write_stan.hpp.


     [ Stan Home Page ] © 2011–2016, Stan Development Team.