Stan Math Library
5.0.0
Automatic Differentiation
|
A class to store a sequence of values which can be deserialized back into structured objects such as scalars, vectors, and matrices.
T | type of scalars |
Definition at line 22 of file serializer.hpp.
#include <serializer.hpp>
Public Types | |
typedef T | scalar_t |
Type of scalars in all objects. | |
Public Member Functions | |
deserializer (const std::vector< T > &vals) | |
Construct a deserializer from the specified sequence of values. | |
deserializer (const Eigen::Matrix< T, -1, 1 > &v_vals) | |
Construct a deserializer from the specified sequence of values. | |
template<typename U , require_stan_scalar_t< U > * = nullptr, require_not_complex_t< U > * = nullptr> | |
T | read (const U &x) |
Read a scalar conforming to the shape of the specified argument, here a scalar. | |
template<typename U > | |
std::complex< T > | read (const std::complex< U > &x) |
Read a complex number conforming to the shape of the specified argument. | |
template<typename U , require_std_vector_t< U > * = nullptr, require_not_st_complex< U > * = nullptr> | |
promote_scalar_t< T, U > | read (const U &x) |
Read a standard vector conforming to the shape of the specified argument, here a standard vector. | |
template<typename U , require_std_vector_st< is_complex, U > * = nullptr> | |
promote_scalar_t< std::complex< T >, U > | read (const U &x) |
Read a standard vector of std::complex variables conforming to the shape of the specified argument, here a standard vector. | |
template<typename U , int R, int C> | |
Eigen::Matrix< T, R, C > | read (const Eigen::Matrix< U, R, C > &x) |
Read a standard vector conforming to the shape of the specified argument, here an Eigen matrix, vector, or row vector. | |
template<typename U , int R, int C> | |
Eigen::Matrix< std::complex< T >, R, C > | read (const Eigen::Matrix< std::complex< U >, R, C > &x) |
Read a standard vector of std::complex variables conforming to the shape of the specified argument, here an Eigen matrix, vector, or row vector. | |
Public Attributes | |
size_t | position_ |
Current read position. | |
const std::vector< T > | vals_ |
The sequence of values to deserialize. | |