Stan
2.10.0
probability, sampling & optimization
Main Page
Namespaces
Classes
Files
File List
File Members
src
stan
interface_callbacks
var_context_factory
dump_factory.hpp
Go to the documentation of this file.
1
#ifndef STAN_INTERFACE_CALLBACKS_VAR_CONTEXT_FACTORY_DUMP_FACTORY_HPP
2
#define STAN_INTERFACE_CALLBACKS_VAR_CONTEXT_FACTORY_DUMP_FACTORY_HPP
3
4
#include <
stan/interface_callbacks/var_context_factory/var_context_factory.hpp
>
5
#include <
stan/io/dump.hpp
>
6
#include <fstream>
7
#include <string>
8
9
namespace
stan
{
10
namespace
interface_callbacks {
11
namespace
var_context_factory
{
12
13
// FIXME: Move to CmdStan
14
class
dump_factory
:
public
var_context_factory
<stan::io::dump> {
15
public
:
16
stan::io::dump
operator()
(
const
std::string source) {
17
std::fstream source_stream(source.c_str(),
18
std::fstream::in);
19
20
if
(source_stream.fail()) {
21
std::string message(
"dump_factory Error: the file "
22
+ source +
" does not exist."
);
23
throw
std::runtime_error(message);
24
}
25
26
stan::io::dump
dump(source_stream);
27
source_stream.close();
28
29
return
dump;
30
}
31
};
32
33
}
34
}
35
}
36
37
#endif
var_context_factory.hpp
stan::interface_callbacks::var_context_factory::dump_factory::operator()
stan::io::dump operator()(const std::string source)
Definition:
dump_factory.hpp:16
stan
Probability, optimization and sampling library.
Definition:
base_interrupt.hpp:4
stan::interface_callbacks::var_context_factory::var_context_factory
Definition:
var_context_factory.hpp:11
stan::interface_callbacks::var_context_factory::dump_factory
Definition:
dump_factory.hpp:14
dump.hpp
stan::io::dump
Represents named arrays with dimensions.
Definition:
dump.hpp:545
[
Stan Home Page
]
© 2011–2016, Stan Development Team.