Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
stan::io::reader< T > Class Template Reference

#include "stan/io/reader.hpp"

Public Types

typedef Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > matrix_t
 
typedef Eigen::Matrix< T, Eigen::Dynamic, 1 > vector_t
 
typedef Eigen::Matrix< T, 1, Eigen::Dynamic > row_vector_t
 
typedef Eigen::Map< matrix_tmap_matrix_t
 
typedef Eigen::Map< vector_tmap_vector_t
 
typedef Eigen::Map< row_vector_tmap_row_vector_t
 

Public Member Functions

 reader (std::vector< T > &data_r, std::vector< int > &data_i)
 
 ~reader ()
 
size_t available ()
 
size_t available_i ()
 
int integer ()
 
int integer_constrain ()
 
int integer_constrain (T &)
 
T scalar ()
 
T scalar_constrain ()
 
T scalar_constrain (T &)
 
std::vector< Tstd_vector (size_t m)
 
vector_t vector (size_t m)
 
vector_t vector_constrain (size_t m)
 
vector_t vector_constrain (size_t m, T &)
 
row_vector_t row_vector (size_t m)
 
row_vector_t row_vector_constrain (size_t m)
 
row_vector_t row_vector_constrain (size_t m, T &)
 
matrix_t matrix (size_t m, size_t n)
 
matrix_t matrix_constrain (size_t m, size_t n)
 
matrix_t matrix_constrain (size_t m, size_t n, T &)
 
int integer_lb (int lb)
 
int integer_lb_constrain (int lb)
 
int integer_lb_constrain (int lb, T &)
 
int integer_ub (int ub)
 
int integer_ub_constrain (int ub)
 
int integer_ub_constrain (int ub, T &)
 
int integer_lub (int lb, int ub)
 
int integer_lub_constrain (int lb, int ub)
 
int integer_lub_constrain (int lb, int ub, T &)
 
T scalar_pos ()
 
T scalar_pos_constrain ()
 
T scalar_pos_constrain (T &lp)
 
template<typename TL >
T scalar_lb (const TL lb)
 
template<typename TL >
T scalar_lb_constrain (const TL lb)
 
template<typename TL >
T scalar_lb_constrain (const TL lb, T &lp)
 
template<typename TU >
T scalar_ub (TU ub)
 
template<typename TU >
T scalar_ub_constrain (const TU ub)
 
template<typename TU >
T scalar_ub_constrain (const TU ub, T &lp)
 
template<typename TL , typename TU >
T scalar_lub (const TL lb, const TU ub)
 
template<typename TL , typename TU >
T scalar_lub_constrain (const TL lb, const TU ub)
 
template<typename TL , typename TU >
T scalar_lub_constrain (TL lb, TU ub, T &lp)
 
T prob ()
 
T prob_constrain ()
 
T prob_constrain (T &lp)
 
T corr ()
 
T corr_constrain ()
 
T corr_constrain (T &lp)
 
vector_t unit_vector (size_t k)
 
Eigen::Matrix< T, Eigen::Dynamic, 1 > unit_vector_constrain (size_t k)
 
vector_t unit_vector_constrain (size_t k, T &lp)
 
vector_t simplex (size_t k)
 
Eigen::Matrix< T, Eigen::Dynamic, 1 > simplex_constrain (size_t k)
 
vector_t simplex_constrain (size_t k, T &lp)
 
vector_t ordered (size_t k)
 
vector_t ordered_constrain (size_t k)
 
vector_t ordered_constrain (size_t k, T &lp)
 
vector_t positive_ordered (size_t k)
 
vector_t positive_ordered_constrain (size_t k)
 
vector_t positive_ordered_constrain (size_t k, T &lp)
 
matrix_t cholesky_factor (size_t M, size_t N)
 
matrix_t cholesky_factor_constrain (size_t M, size_t N)
 
matrix_t cholesky_factor_constrain (size_t M, size_t N, T &lp)
 
matrix_t cholesky_corr (size_t K)
 
matrix_t cholesky_corr_constrain (size_t K)
 
matrix_t cholesky_corr_constrain (size_t K, T &lp)
 
matrix_t cov_matrix (size_t k)
 
matrix_t cov_matrix_constrain (size_t k)
 
matrix_t cov_matrix_constrain (size_t k, T &lp)
 
matrix_t corr_matrix (size_t k)
 
matrix_t corr_matrix_constrain (size_t k)
 
matrix_t corr_matrix_constrain (size_t k, T &lp)
 
template<typename TL >
vector_t vector_lb (const TL lb, size_t m)
 
template<typename TL >
vector_t vector_lb_constrain (const TL lb, size_t m)
 
template<typename TL >
vector_t vector_lb_constrain (const TL lb, size_t m, T &lp)
 
template<typename TL >
row_vector_t row_vector_lb (const TL lb, size_t m)
 
template<typename TL >
row_vector_t row_vector_lb_constrain (const TL lb, size_t m)
 
template<typename TL >
row_vector_t row_vector_lb_constrain (const TL lb, size_t m, T &lp)
 
template<typename TL >
matrix_t matrix_lb (const TL lb, size_t m, size_t n)
 
template<typename TL >
matrix_t matrix_lb_constrain (const TL lb, size_t m, size_t n)
 
template<typename TL >
matrix_t matrix_lb_constrain (const TL lb, size_t m, size_t n, T &lp)
 
template<typename TU >
vector_t vector_ub (const TU ub, size_t m)
 
template<typename TU >
vector_t vector_ub_constrain (const TU ub, size_t m)
 
template<typename TU >
vector_t vector_ub_constrain (const TU ub, size_t m, T &lp)
 
template<typename TU >
row_vector_t row_vector_ub (const TU ub, size_t m)
 
template<typename TU >
row_vector_t row_vector_ub_constrain (const TU ub, size_t m)
 
template<typename TU >
row_vector_t row_vector_ub_constrain (const TU ub, size_t m, T &lp)
 
template<typename TU >
matrix_t matrix_ub (const TU ub, size_t m, size_t n)
 
template<typename TU >
matrix_t matrix_ub_constrain (const TU ub, size_t m, size_t n)
 
template<typename TU >
matrix_t matrix_ub_constrain (const TU ub, size_t m, size_t n, T &lp)
 
template<typename TL , typename TU >
vector_t vector_lub (const TL lb, const TU ub, size_t m)
 
template<typename TL , typename TU >
vector_t vector_lub_constrain (const TL lb, const TU ub, size_t m)
 
template<typename TL , typename TU >
vector_t vector_lub_constrain (const TL lb, const TU ub, size_t m, T &lp)
 
template<typename TL , typename TU >
row_vector_t row_vector_lub (const TL lb, const TU ub, size_t m)
 
template<typename TL , typename TU >
row_vector_t row_vector_lub_constrain (const TL lb, const TU ub, size_t m)
 
template<typename TL , typename TU >
row_vector_t row_vector_lub_constrain (const TL lb, const TU ub, size_t m, T &lp)
 
template<typename TL , typename TU >
matrix_t matrix_lub (const TL lb, const TU ub, size_t m, size_t n)
 
template<typename TL , typename TU >
matrix_t matrix_lub_constrain (const TL lb, const TU ub, size_t m, size_t n)
 
template<typename TL , typename TU >
matrix_t matrix_lub_constrain (const TL lb, const TU ub, size_t m, size_t n, T &lp)
 

Private Member Functions

Tscalar_ptr ()
 
Tscalar_ptr_increment (size_t m)
 
intint_ptr ()
 
intint_ptr_increment (size_t m)
 

Private Attributes

std::vector< T > & data_r_
 
std::vector< int > & data_i_
 
size_t pos_
 
size_t int_pos_
 

Detailed Description

template<typename T>
class stan::io::reader< T >

A stream-based reader for integer, scalar, vector, matrix and array data types, with Jacobian calculations.

The template parameter T represents the type of scalars and the values in vectors and matrices. The only requirement on the template type T is that a double can be copied into it, as in

T t = 0.0;

This includes double itself and the reverse-mode algorithmic differentiation class stan::math::var.

For transformed values, the scalar type parameter T must support the transforming operations, such as exp(x) for positive-bounded variables. It must also support equality and inequality tests with double values.

Template Parameters
TBasic scalar type.

Definition at line 35 of file reader.hpp.

Member Typedef Documentation

template<typename T>
typedef Eigen::Map<matrix_t> stan::io::reader< T >::map_matrix_t

Definition at line 65 of file reader.hpp.

template<typename T>
typedef Eigen::Map<row_vector_t> stan::io::reader< T >::map_row_vector_t

Definition at line 67 of file reader.hpp.

template<typename T>
typedef Eigen::Map<vector_t> stan::io::reader< T >::map_vector_t

Definition at line 66 of file reader.hpp.

template<typename T>
typedef Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> stan::io::reader< T >::matrix_t

Definition at line 61 of file reader.hpp.

template<typename T>
typedef Eigen::Matrix<T, 1, Eigen::Dynamic> stan::io::reader< T >::row_vector_t

Definition at line 63 of file reader.hpp.

template<typename T>
typedef Eigen::Matrix<T, Eigen::Dynamic, 1> stan::io::reader< T >::vector_t

Definition at line 62 of file reader.hpp.

Constructor & Destructor Documentation

template<typename T>
stan::io::reader< T >::reader ( std::vector< T > &  data_r,
std::vector< int > &  data_i 
)
inline

Construct a variable reader using the specified vectors as the source of scalar and integer values for data. This class holds a reference to the specified data vectors.

Attempting to read beyond the end of the data or integer value sequences raises a runtime exception.

Parameters
data_rSequence of scalar values.
data_iSequence of integer values.

Definition at line 81 of file reader.hpp.

83  : data_r_(data_r),
84  data_i_(data_i),
85  pos_(0),
86  int_pos_(0) {
87  }
std::vector< T > & data_r_
Definition: reader.hpp:37
size_t int_pos_
Definition: reader.hpp:40
std::vector< int > & data_i_
Definition: reader.hpp:38
template<typename T>
stan::io::reader< T >::~reader ( )
inline

Destroy this variable reader.

Definition at line 92 of file reader.hpp.

92 { }

Member Function Documentation

template<typename T>
size_t stan::io::reader< T >::available ( )
inline

Return the number of scalars remaining to be read.

Returns
Number of scalars left to read.

Definition at line 99 of file reader.hpp.

References stan::io::reader< T >::pos_.

Referenced by TEST().

99  {
100  return data_r_.size() - pos_;
101  }
std::vector< T > & data_r_
Definition: reader.hpp:37
template<typename T>
size_t stan::io::reader< T >::available_i ( )
inline

Return the number of integers remaining to be read.

Returns
Number of integers left to read.

Definition at line 108 of file reader.hpp.

References stan::io::reader< T >::int_pos_.

Referenced by TEST().

108  {
109  return data_i_.size() - int_pos_;
110  }
size_t int_pos_
Definition: reader.hpp:40
std::vector< int > & data_i_
Definition: reader.hpp:38
template<typename T>
matrix_t stan::io::reader< T >::cholesky_corr ( size_t  K)
inline

Return the next Cholesky factor for a correlation matrix with the specified dimensionality, reading it directly without transforms.

Parameters
KRows and columns of Cholesky factor
Returns
Next Cholesky factor for a correlation matrix.
Exceptions
std::domain_errorif the matrix is not a valid Cholesky factor for a correlation matrix.

Definition at line 1018 of file reader.hpp.

References stan::math::check_cholesky_factor_corr(), stan::io::reader< T >::matrix(), and submit_syst::y.

Referenced by TEST().

1018  {
1020  matrix_t y(matrix(K, K));
1021  check_cholesky_factor_corr("stan::io::cholesky_factor_corr",
1022  "Constrained matrix", y);
1023  return y;
1024  }
void check_cholesky_factor_corr(const char *function, const char *name, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y)
Double_t K
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > matrix_t
Definition: reader.hpp:61
matrix_t matrix(size_t m, size_t n)
Definition: reader.hpp:292
template<typename T>
matrix_t stan::io::reader< T >::cholesky_corr_constrain ( size_t  K)
inline

Return the next Cholesky factor for a correlation matrix with the specified dimensionality, reading from an unconstrained vector of the appropriate size.

Parameters
KRows and columns of Cholesky factor.
Returns
Next Cholesky factor for a correlation matrix.
Exceptions
std::domain_errorif the matrix is not a valid Cholesky factor for a correlation matrix.

Definition at line 1036 of file reader.hpp.

References stan::math::cholesky_corr_constrain(), and stan::io::reader< T >::vector().

1036  {
1037  return stan::math::cholesky_corr_constrain(vector((K * (K - 1)) / 2),
1038  K);
1039  }
vector_t vector(size_t m)
Definition: reader.hpp:207
Double_t K
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > cholesky_corr_constrain(const Eigen::Matrix< T, Eigen::Dynamic, 1 > &y, int K)
template<typename T>
matrix_t stan::io::reader< T >::cholesky_corr_constrain ( size_t  K,
T lp 
)
inline

Return the next Cholesky factor for a correlation matrix with the specified dimensionality, reading from an unconstrained vector of the appropriate size, and increment the log probability reference with the log Jacobian adjustment for the transform.

Parameters
KRows and columns of Cholesky factor
lpLog probability reference to increment.
Returns
Next Cholesky factor for a correlation matrix.
Exceptions
std::domain_errorif the matrix is not a valid Cholesky factor for a correlation matrix.

Definition at line 1054 of file reader.hpp.

References stan::math::cholesky_corr_constrain(), and stan::io::reader< T >::vector().

1054  {
1055  return stan::math::cholesky_corr_constrain(vector((K * (K - 1)) / 2),
1056  K, lp);
1057  }
vector_t vector(size_t m)
Definition: reader.hpp:207
Double_t K
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > cholesky_corr_constrain(const Eigen::Matrix< T, Eigen::Dynamic, 1 > &y, int K)
template<typename T>
matrix_t stan::io::reader< T >::cholesky_factor ( size_t  M,
size_t  N 
)
inline

Return the next Cholesky factor with the specified dimensionality, reading it directly without transforms.

Parameters
MRows of Cholesky factor
NColumns of Cholesky factor
Returns
Next Cholesky factor.
Exceptions
std::domain_errorif the matrix is not a valid Cholesky factor.

Definition at line 965 of file reader.hpp.

References stan::math::check_cholesky_factor(), stan::io::reader< T >::matrix(), and submit_syst::y.

Referenced by TEST().

965  {
966  matrix_t y(matrix(M, N));
967  stan::math::check_cholesky_factor("stan::io::cholesky_factor",
968  "Constrained matrix", y);
969  return y;
970  }
void check_cholesky_factor(const char *function, const char *name, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y)
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > matrix_t
Definition: reader.hpp:61
matrix_t matrix(size_t m, size_t n)
Definition: reader.hpp:292
template<typename T>
matrix_t stan::io::reader< T >::cholesky_factor_constrain ( size_t  M,
size_t  N 
)
inline

Return the next Cholesky factor with the specified dimensionality, reading from an unconstrained vector of the appropriate size.

Parameters
MRows of Cholesky factor
NColumns of Cholesky factor
Returns
Next Cholesky factor.
Exceptions
std::domain_errorif the matrix is not a valid Cholesky factor.

Definition at line 983 of file reader.hpp.

References stan::math::cholesky_factor_constrain(), and stan::io::reader< T >::vector().

Referenced by TEST().

983  {
985  (vector((N * (N + 1)) / 2 + (M - N) * N), M, N);
986  }
vector_t vector(size_t m)
Definition: reader.hpp:207
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > cholesky_factor_constrain(const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x, int M, int N)
template<typename T>
matrix_t stan::io::reader< T >::cholesky_factor_constrain ( size_t  M,
size_t  N,
T lp 
)
inline

Return the next Cholesky factor with the specified dimensionality, reading from an unconstrained vector of the appropriate size, and increment the log probability reference with the log Jacobian adjustment for the transform.

Parameters
MRows of Cholesky factor
NColumns of Cholesky factor
[in,out]lplog probability
Returns
Next Cholesky factor.
Exceptions
std::domain_errorif the matrix is not a valid Cholesky factor.

Definition at line 1001 of file reader.hpp.

References stan::math::cholesky_factor_constrain(), and stan::io::reader< T >::vector().

1001  {
1003  (vector((N * (N + 1)) / 2 + (M - N) * N), M, N, lp);
1004  }
vector_t vector(size_t m)
Definition: reader.hpp:207
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > cholesky_factor_constrain(const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x, int M, int N)
template<typename T>
T stan::io::reader< T >::corr ( )
inline

Return the next scalar, checking that it is a valid value for a correlation, between -1 (inclusive) and 1 (inclusive).

See stan::math::check_bounded(T).

Returns
Next correlation value.
Exceptions
std::runtime_errorif the value is not valid for a correlation

Definition at line 734 of file reader.hpp.

References stan::io::reader< T >::scalar(), T, and submit_syst::x.

Referenced by TEST().

734  {
735  T x(scalar());
736  stan::math::check_bounded<T, double, double>
737  ("stan::io::corr", "Correlation value", x, -1, 1);
738  return x;
739  }
double T
Definition: Xdiff_gwt.C:5
template<typename T>
T stan::io::reader< T >::corr_constrain ( )
inline

Return the next scalar transformed to be a correlation between -1 and 1.

See stan::math::corr_constrain(T).

Returns
The next scalar transformed to a correlation.

Definition at line 749 of file reader.hpp.

References stan::math::corr_constrain(), and stan::io::reader< T >::scalar().

Referenced by TEST().

749  {
751  }
T corr_constrain(const T &x)
template<typename T>
T stan::io::reader< T >::corr_constrain ( T lp)
inline

Return the next scalar transformed to be a (partial) correlation between -1 and 1, incrementing the specified reference with the log of the absolute Jacobian determinant.

See stan::math::corr_constrain(T,T&).

Parameters
lpThe reference to the variable holding the log probability to increment.
Returns
The next scalar transformed to a correlation.

Definition at line 764 of file reader.hpp.

References stan::math::corr_constrain(), and stan::io::reader< T >::scalar().

764  {
765  return stan::math::corr_constrain(scalar(), lp);
766  }
T corr_constrain(const T &x)
template<typename T>
matrix_t stan::io::reader< T >::corr_matrix ( size_t  k)
inline

Returns the next correlation matrix of the specified dimensionality.

See stan::math::check_corr_matrix(Matrix).

Parameters
kDimensionality of correlation matrix.
Returns
Next correlation matrix of the specified dimensionality.
Exceptions
std::runtime_errorif the matrix is not a correlation matrix

Definition at line 1118 of file reader.hpp.

References stan::math::check_corr_matrix(), stan::io::reader< T >::matrix(), and submit_syst::x.

Referenced by TEST().

1118  {
1119  matrix_t x(matrix(k, k));
1120  stan::math::check_corr_matrix("stan::math::corr_matrix",
1121  "Constrained matrix", x);
1122  return x;
1123  }
void check_corr_matrix(const char *function, const char *name, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y)
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > matrix_t
Definition: reader.hpp:61
matrix_t matrix(size_t m, size_t n)
Definition: reader.hpp:292
template<typename T>
matrix_t stan::io::reader< T >::corr_matrix_constrain ( size_t  k)
inline

Return the next correlation matrix of the specified dimensionality.

See stan::math::corr_matrix_constrain(Matrix).

Parameters
kDimensionality of correlation matrix.
Returns
Next correlation matrix of the specified dimensionality.

Definition at line 1133 of file reader.hpp.

References stan::math::corr_matrix_constrain(), and stan::io::reader< T >::vector().

Referenced by TEST().

1133  {
1134  return stan::math::corr_matrix_constrain(vector((k * (k - 1)) / 2), k);
1135  }
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > corr_matrix_constrain(const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x, typename math::index_type< Eigen::Matrix< T, Eigen::Dynamic, 1 > >::type k)
vector_t vector(size_t m)
Definition: reader.hpp:207
template<typename T>
matrix_t stan::io::reader< T >::corr_matrix_constrain ( size_t  k,
T lp 
)
inline

Return the next correlation matrix of the specified dimensionality, incrementing the specified reference with the log absolute Jacobian determinant.

See stan::math::corr_matrix_constrain(Matrix,T&).

Parameters
kDimensionality of the (square) correlation matrix.
lpLog probability reference to increment.
Returns
The next correlation matrix of the specified dimensionality.

Definition at line 1148 of file reader.hpp.

References stan::math::corr_matrix_constrain(), and stan::io::reader< T >::vector().

1148  {
1149  return stan::math::corr_matrix_constrain(vector((k * (k - 1)) / 2),
1150  k, lp);
1151  }
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > corr_matrix_constrain(const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x, typename math::index_type< Eigen::Matrix< T, Eigen::Dynamic, 1 > >::type k)
vector_t vector(size_t m)
Definition: reader.hpp:207
template<typename T>
matrix_t stan::io::reader< T >::cov_matrix ( size_t  k)
inline

Return the next covariance matrix with the specified dimensionality.

See stan::math::check_cov_matrix(Matrix).

Parameters
kDimensionality of covariance matrix.
Returns
Next covariance matrix of the specified dimensionality.
Exceptions
std::runtime_errorif the matrix is not a valid covariance matrix

Definition at line 1072 of file reader.hpp.

References stan::math::check_cov_matrix(), stan::io::reader< T >::matrix(), and submit_syst::y.

Referenced by TEST().

1072  {
1073  matrix_t y(matrix(k, k));
1074  stan::math::check_cov_matrix("stan::io::cov_matrix",
1075  "Constrained matrix", y);
1076  return y;
1077  }
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > matrix_t
Definition: reader.hpp:61
matrix_t matrix(size_t m, size_t n)
Definition: reader.hpp:292
void check_cov_matrix(const char *function, const char *name, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y)
template<typename T>
matrix_t stan::io::reader< T >::cov_matrix_constrain ( size_t  k)
inline

Return the next covariance matrix of the specified dimensionality.

See stan::math::cov_matrix_constrain(Matrix).

Parameters
kDimensionality of covariance matrix.
Returns
Next covariance matrix of the specified dimensionality.

Definition at line 1087 of file reader.hpp.

References stan::math::cov_matrix_constrain(), and stan::io::reader< T >::vector().

Referenced by TEST().

1087  {
1088  return stan::math::cov_matrix_constrain(vector(k + (k * (k - 1)) / 2),
1089  k);
1090  }
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > cov_matrix_constrain(const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x, typename math::index_type< Eigen::Matrix< T, Eigen::Dynamic, 1 > >::type K)
vector_t vector(size_t m)
Definition: reader.hpp:207
template<typename T>
matrix_t stan::io::reader< T >::cov_matrix_constrain ( size_t  k,
T lp 
)
inline

Return the next covariance matrix of the specified dimensionality, incrementing the specified reference with the log absolute Jacobian determinant.

See stan::math::cov_matrix_constrain(Matrix,T&).

Parameters
kDimensionality of the (square) covariance matrix.
lpLog probability reference to increment.
Returns
The next covariance matrix of the specified dimensionality.

Definition at line 1103 of file reader.hpp.

References stan::math::cov_matrix_constrain(), and stan::io::reader< T >::vector().

1103  {
1104  return stan::math::cov_matrix_constrain(vector(k + (k * (k - 1)) / 2),
1105  k, lp);
1106  }
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > cov_matrix_constrain(const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x, typename math::index_type< Eigen::Matrix< T, Eigen::Dynamic, 1 > >::type K)
vector_t vector(size_t m)
Definition: reader.hpp:207
template<typename T>
int& stan::io::reader< T >::int_ptr ( )
inlineprivate

Definition at line 51 of file reader.hpp.

51  {
52  return data_i_.at(int_pos_);
53  }
size_t int_pos_
Definition: reader.hpp:40
std::vector< int > & data_i_
Definition: reader.hpp:38
template<typename T>
int& stan::io::reader< T >::int_ptr_increment ( size_t  m)
inlineprivate

Definition at line 55 of file reader.hpp.

References m.

55  {
56  int_pos_ += m;
57  return data_i_.at(int_pos_ - m);
58  }
size_t int_pos_
Definition: reader.hpp:40
std::vector< int > & data_i_
Definition: reader.hpp:38
template<typename T>
int stan::io::reader< T >::integer ( )
inline

Return the next integer in the integer sequence.

Returns
Next integer value.

Definition at line 117 of file reader.hpp.

Referenced by stan::io::reader< T >::integer_constrain(), stan::io::reader< T >::integer_lb(), stan::io::reader< T >::integer_lub(), stan::io::reader< T >::integer_ub(), and TEST().

117  {
118  if (int_pos_ >= data_i_.size())
119  BOOST_THROW_EXCEPTION(
120  std::runtime_error("no more integers to read."));
121  return data_i_[int_pos_++];
122  }
size_t int_pos_
Definition: reader.hpp:40
std::vector< int > & data_i_
Definition: reader.hpp:38
template<typename T>
int stan::io::reader< T >::integer_constrain ( )
inline

Return the next integer in the integer sequence. This form is a convenience method to make compiling easier; its behavior is the same as int()

Returns
Next integer value.

Definition at line 131 of file reader.hpp.

References stan::io::reader< T >::integer().

131  {
132  return integer();
133  }
template<typename T>
int stan::io::reader< T >::integer_constrain ( T )
inline

Return the next integer in the integer sequence. This form is a convenience method to make compiling easier; its behavior is the same as integer()

Returns
Next integer value.

Definition at line 142 of file reader.hpp.

References stan::io::reader< T >::integer().

142  {
143  return integer();
144  }
template<typename T>
int stan::io::reader< T >::integer_lb ( int  lb)
inline

Return the next integer, checking that it is greater than or equal to the specified lower bound.

Parameters
lbLower bound.
Returns
Next integer read.
Exceptions
std::runtime_errorIf the next integer read is not greater than or equal to the lower bound.

Definition at line 342 of file reader.hpp.

References MECModelEnuComparisons::i, and stan::io::reader< T >::integer().

Referenced by stan::io::reader< T >::integer_lb_constrain(), and TEST().

342  {
343  int i = integer();
344  if (!(i >= lb))
345  BOOST_THROW_EXCEPTION(
346  std::runtime_error("required value greater than or equal to lb"));
347  return i;
348  }
template<typename T>
int stan::io::reader< T >::integer_lb_constrain ( int  lb)
inline

Return the next integer, checking that it is greater than or equal to the specified lower bound.

Parameters
lbLower bound.
Returns
Next integer read.
Exceptions
std::runtime_errorIf the next integer read is not greater than or equal to the lower bound.

Definition at line 358 of file reader.hpp.

References stan::io::reader< T >::integer_lb().

358  {
359  return integer_lb(lb);
360  }
int integer_lb(int lb)
Definition: reader.hpp:342
template<typename T>
int stan::io::reader< T >::integer_lb_constrain ( int  lb,
T  
)
inline

Return the next integer, checking that it is greater than or equal to the specified lower bound.

Parameters
lbLower bound. lp Log probability (ignored because no Jacobian)
Returns
Next integer read.
Exceptions
std::runtime_errorIf the next integer read is not greater than or equal to the lower bound.

Definition at line 371 of file reader.hpp.

References stan::io::reader< T >::integer_lb().

371  {
372  return integer_lb(lb);
373  }
int integer_lb(int lb)
Definition: reader.hpp:342
template<typename T>
int stan::io::reader< T >::integer_lub ( int  lb,
int  ub 
)
inline

Return the next integer, checking that it is less than or equal to the specified upper bound. Even if the upper bounds and lower bounds are not consistent, the next integer value will be consumed.

Parameters
lbLower bound.
ubUpper bound.
Returns
Next integer read.
Exceptions
std::runtime_errorIf the next integer read is not less than or equal to the upper bound.

Definition at line 430 of file reader.hpp.

References MECModelEnuComparisons::i, and stan::io::reader< T >::integer().

Referenced by stan::io::reader< T >::integer_lub_constrain(), and TEST().

430  {
431  // read first to make position deterministic [arbitrary choice]
432  int i = integer();
433  if (lb > ub)
434  BOOST_THROW_EXCEPTION(
435  std::runtime_error("lower bound must be less than or equal to ub"));
436  if (!(i >= lb))
437  BOOST_THROW_EXCEPTION(
438  std::runtime_error("required value greater than or equal to lb"));
439  if (!(i <= ub))
440  BOOST_THROW_EXCEPTION(
441  std::runtime_error("required value less than or equal to ub"));
442  return i;
443  }
static const double ub
Definition: Units.h:88
template<typename T>
int stan::io::reader< T >::integer_lub_constrain ( int  lb,
int  ub 
)
inline

Return the next integer, checking that it is less than or equal to the specified upper bound.

Parameters
lbLower bound.
ubUpper bound.
Returns
Next integer read.
Exceptions
std::runtime_errorIf the next integer read is not less than or equal to the upper bound.

Definition at line 454 of file reader.hpp.

References stan::io::reader< T >::integer_lub().

454  {
455  return integer_lub(lb, ub);
456  }
int integer_lub(int lb, int ub)
Definition: reader.hpp:430
static const double ub
Definition: Units.h:88
template<typename T>
int stan::io::reader< T >::integer_lub_constrain ( int  lb,
int  ub,
T  
)
inline

Return the next integer, checking that it is less than or equal to the specified upper bound.

Parameters
lbLower bound.
ubUpper bound. lp Log probability (ignored because no Jacobian)
Returns
Next integer read.
Exceptions
std::runtime_errorIf the next integer read is not less than or equal to the upper bound.

Definition at line 468 of file reader.hpp.

References stan::io::reader< T >::integer_lub().

468  {
469  return integer_lub(lb, ub);
470  }
int integer_lub(int lb, int ub)
Definition: reader.hpp:430
static const double ub
Definition: Units.h:88
template<typename T>
int stan::io::reader< T >::integer_ub ( int  ub)
inline

Return the next integer, checking that it is less than or equal to the specified upper bound.

Parameters
ubUpper bound.
Returns
Next integer read.
Exceptions
std::runtime_errorIf the next integer read is not less than or equal to the upper bound.

Definition at line 385 of file reader.hpp.

References MECModelEnuComparisons::i, and stan::io::reader< T >::integer().

Referenced by stan::io::reader< T >::integer_ub_constrain(), and TEST().

385  {
386  int i = integer();
387  if (!(i <= ub))
388  BOOST_THROW_EXCEPTION(
389  std::runtime_error("required value less than or equal to ub"));
390  return i;
391  }
static const double ub
Definition: Units.h:88
template<typename T>
int stan::io::reader< T >::integer_ub_constrain ( int  ub)
inline

Return the next integer, checking that it is less than or equal to the specified upper bound.

Parameters
ubUpper bound.
Returns
Next integer read.
Exceptions
std::runtime_errorIf the next integer read is not less than or equal to the upper bound.

Definition at line 401 of file reader.hpp.

References stan::io::reader< T >::integer_ub().

401  {
402  return integer_ub(ub);
403  }
int integer_ub(int ub)
Definition: reader.hpp:385
static const double ub
Definition: Units.h:88
template<typename T>
int stan::io::reader< T >::integer_ub_constrain ( int  ub,
T  
)
inline

Return the next integer, checking that it is less than or equal to the specified upper bound.

Parameters
ubUpper bound. lp Log probability (ignored because no Jacobian)
Returns
Next integer read.
Exceptions
std::runtime_errorIf the next integer read is not less than or equal to the upper bound.

Definition at line 414 of file reader.hpp.

References stan::io::reader< T >::integer_ub().

414  {
415  return integer_ub(ub);
416  }
int integer_ub(int ub)
Definition: reader.hpp:385
static const double ub
Definition: Units.h:88
template<typename T>
matrix_t stan::io::reader< T >::matrix ( size_t  m,
size_t  n 
)
inline

Return a matrix of the specified dimensionality made up of the next scalars arranged in column-major order.

Row-major reading means that if a matrix of m=2 rows and n=3 columns is reada and the next scalar values are 1,2,3,4,5,6, the result is

a = 1 4
    2 5
    3 6
Parameters
mNumber of rows.
nNumber of columns.
Returns
Eigen::Matrix made up of the next scalars.

Definition at line 292 of file reader.hpp.

References stan::io::reader< T >::scalar_ptr_increment().

Referenced by stan::io::reader< T >::cholesky_corr(), stan::io::reader< T >::cholesky_factor(), stan::io::reader< T >::corr_matrix(), stan::io::reader< T >::cov_matrix(), and TEST().

292  {
293  if (m == 0 || n == 0)
294  return matrix_t(m, n);
295  return map_matrix_t(&scalar_ptr_increment(m*n), m, n);
296  }
T & scalar_ptr_increment(size_t m)
Definition: reader.hpp:46
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > matrix_t
Definition: reader.hpp:61
Eigen::Map< matrix_t > map_matrix_t
Definition: reader.hpp:65
template<typename T>
matrix_t stan::io::reader< T >::matrix_constrain ( size_t  m,
size_t  n 
)
inline

Return a matrix of the specified dimensionality made up of the next scalars arranged in column-major order. The constraint is a no-op. See matrix(size_t, size_t) for more information.

Parameters
mNumber of rows.
nNumber of columns.
Returns
Matrix made up of the next scalars.

Definition at line 308 of file reader.hpp.

References stan::io::reader< T >::scalar_ptr_increment().

Referenced by TEST().

308  {
309  if (m == 0 || n == 0)
310  return matrix_t(m, n);
311  return map_matrix_t(&scalar_ptr_increment(m*n), m, n);
312  }
T & scalar_ptr_increment(size_t m)
Definition: reader.hpp:46
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > matrix_t
Definition: reader.hpp:61
Eigen::Map< matrix_t > map_matrix_t
Definition: reader.hpp:65
template<typename T>
matrix_t stan::io::reader< T >::matrix_constrain ( size_t  m,
size_t  n,
T  
)
inline

Return a matrix of the specified dimensionality made up of the next scalars arranged in column-major order. The constraint is a no-op, hence the log probability is not incremented. See matrix(size_t, size_t) for more information.

Parameters
mNumber of rows.
nNumber of columns. lp Log probability to increment.
Returns
Matrix made up of the next scalars.

Definition at line 326 of file reader.hpp.

References stan::io::reader< T >::scalar_ptr_increment().

326  {
327  if (m == 0 || n == 0)
328  return matrix_t(m, n);
329  return map_matrix_t(&scalar_ptr_increment(m*n), m, n);
330  }
T & scalar_ptr_increment(size_t m)
Definition: reader.hpp:46
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > matrix_t
Definition: reader.hpp:61
Eigen::Map< matrix_t > map_matrix_t
Definition: reader.hpp:65
template<typename T>
template<typename TL >
matrix_t stan::io::reader< T >::matrix_lb ( const TL  lb,
size_t  m,
size_t  n 
)
inline

Definition at line 1203 of file reader.hpp.

References MECModelEnuComparisons::i, calib::j, m, getGoodRuns4SAM::n, stan::io::reader< T >::scalar_lb(), and registry_explorer::v.

Referenced by TEST().

1203  {
1204  matrix_t v(m, n);
1205  for (size_t j = 0; j < n; ++j)
1206  for (size_t i = 0; i < m; ++i)
1207  v(i, j) = scalar_lb(lb);
1208  return v;
1209  }
T scalar_lb(const TL lb)
Definition: reader.hpp:528
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > matrix_t
Definition: reader.hpp:61
const double j
Definition: BetheBloch.cxx:29
template<typename T>
template<typename TL >
matrix_t stan::io::reader< T >::matrix_lb_constrain ( const TL  lb,
size_t  m,
size_t  n 
)
inline

Definition at line 1212 of file reader.hpp.

References MECModelEnuComparisons::i, calib::j, m, getGoodRuns4SAM::n, stan::io::reader< T >::scalar_lb_constrain(), and registry_explorer::v.

Referenced by TEST().

1212  {
1213  matrix_t v(m, n);
1214  for (size_t j = 0; j < n; ++j)
1215  for (size_t i = 0; i < m; ++i)
1216  v(i, j) = scalar_lb_constrain(lb);
1217  return v;
1218  }
T scalar_lb_constrain(const TL lb)
Definition: reader.hpp:547
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > matrix_t
Definition: reader.hpp:61
const double j
Definition: BetheBloch.cxx:29
template<typename T>
template<typename TL >
matrix_t stan::io::reader< T >::matrix_lb_constrain ( const TL  lb,
size_t  m,
size_t  n,
T lp 
)
inline

Definition at line 1222 of file reader.hpp.

References MECModelEnuComparisons::i, calib::j, m, getGoodRuns4SAM::n, stan::io::reader< T >::scalar_lb_constrain(), and registry_explorer::v.

1222  {
1223  matrix_t v(m, n);
1224  for (size_t j = 0; j < n; ++j)
1225  for (size_t i = 0; i < m; ++i)
1226  v(i, j) = scalar_lb_constrain(lb, lp);
1227  return v;
1228  }
T scalar_lb_constrain(const TL lb)
Definition: reader.hpp:547
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > matrix_t
Definition: reader.hpp:61
const double j
Definition: BetheBloch.cxx:29
template<typename T>
template<typename TL , typename TU >
matrix_t stan::io::reader< T >::matrix_lub ( const TL  lb,
const TU  ub,
size_t  m,
size_t  n 
)
inline

Definition at line 1359 of file reader.hpp.

References MECModelEnuComparisons::i, calib::j, m, getGoodRuns4SAM::n, stan::io::reader< T >::scalar_lub(), and registry_explorer::v.

Referenced by TEST().

1359  {
1360  matrix_t v(m, n);
1361  for (size_t j = 0; j < n; ++j)
1362  for (size_t i = 0; i < m; ++i)
1363  v(i, j) = scalar_lub(lb, ub);
1364  return v;
1365  }
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > matrix_t
Definition: reader.hpp:61
const double j
Definition: BetheBloch.cxx:29
static const double ub
Definition: Units.h:88
T scalar_lub(const TL lb, const TU ub)
Definition: reader.hpp:636
template<typename T>
template<typename TL , typename TU >
matrix_t stan::io::reader< T >::matrix_lub_constrain ( const TL  lb,
const TU  ub,
size_t  m,
size_t  n 
)
inline

Definition at line 1369 of file reader.hpp.

References MECModelEnuComparisons::i, calib::j, m, getGoodRuns4SAM::n, stan::io::reader< T >::scalar_lub_constrain(), and registry_explorer::v.

Referenced by TEST().

1369  {
1370  matrix_t v(m, n);
1371  for (size_t j = 0; j < n; ++j)
1372  for (size_t i = 0; i < m; ++i)
1373  v(i, j) = scalar_lub_constrain(lb, ub);
1374  return v;
1375  }
T scalar_lub_constrain(const TL lb, const TU ub)
Definition: reader.hpp:657
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > matrix_t
Definition: reader.hpp:61
const double j
Definition: BetheBloch.cxx:29
static const double ub
Definition: Units.h:88
template<typename T>
template<typename TL , typename TU >
matrix_t stan::io::reader< T >::matrix_lub_constrain ( const TL  lb,
const TU  ub,
size_t  m,
size_t  n,
T lp 
)
inline

Definition at line 1379 of file reader.hpp.

References MECModelEnuComparisons::i, calib::j, m, getGoodRuns4SAM::n, stan::io::reader< T >::scalar_lub_constrain(), and registry_explorer::v.

1380  {
1381  matrix_t v(m, n);
1382  for (size_t j = 0; j < n; ++j)
1383  for (size_t i = 0; i < m; ++i)
1384  v(i, j) = scalar_lub_constrain(lb, ub, lp);
1385  return v;
1386  }
T scalar_lub_constrain(const TL lb, const TU ub)
Definition: reader.hpp:657
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > matrix_t
Definition: reader.hpp:61
const double j
Definition: BetheBloch.cxx:29
static const double ub
Definition: Units.h:88
template<typename T>
template<typename TU >
matrix_t stan::io::reader< T >::matrix_ub ( const TU  ub,
size_t  m,
size_t  n 
)
inline

Definition at line 1280 of file reader.hpp.

References MECModelEnuComparisons::i, calib::j, m, getGoodRuns4SAM::n, stan::io::reader< T >::scalar_ub(), and registry_explorer::v.

Referenced by TEST().

1280  {
1281  matrix_t v(m, n);
1282  for (size_t j = 0; j < n; ++j)
1283  for (size_t i = 0; i < m; ++i)
1284  v(i, j) = scalar_ub(ub);
1285  return v;
1286  }
T scalar_ub(TU ub)
Definition: reader.hpp:582
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > matrix_t
Definition: reader.hpp:61
const double j
Definition: BetheBloch.cxx:29
static const double ub
Definition: Units.h:88
template<typename T>
template<typename TU >
matrix_t stan::io::reader< T >::matrix_ub_constrain ( const TU  ub,
size_t  m,
size_t  n 
)
inline

Definition at line 1289 of file reader.hpp.

References MECModelEnuComparisons::i, calib::j, m, getGoodRuns4SAM::n, stan::io::reader< T >::scalar_ub_constrain(), and registry_explorer::v.

Referenced by TEST().

1289  {
1290  matrix_t v(m, n);
1291  for (size_t j = 0; j < n; ++j)
1292  for (size_t i = 0; i < m; ++i)
1293  v(i, j) = scalar_ub_constrain(ub);
1294  return v;
1295  }
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > matrix_t
Definition: reader.hpp:61
T scalar_ub_constrain(const TU ub)
Definition: reader.hpp:601
const double j
Definition: BetheBloch.cxx:29
static const double ub
Definition: Units.h:88
template<typename T>
template<typename TU >
matrix_t stan::io::reader< T >::matrix_ub_constrain ( const TU  ub,
size_t  m,
size_t  n,
T lp 
)
inline

Definition at line 1299 of file reader.hpp.

References MECModelEnuComparisons::i, calib::j, m, getGoodRuns4SAM::n, stan::io::reader< T >::scalar_ub_constrain(), and registry_explorer::v.

1299  {
1300  matrix_t v(m, n);
1301  for (size_t j = 0; j < n; ++j)
1302  for (size_t i = 0; i < m; ++i)
1303  v(i, j) = scalar_ub_constrain(ub, lp);
1304  return v;
1305  }
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > matrix_t
Definition: reader.hpp:61
T scalar_ub_constrain(const TU ub)
Definition: reader.hpp:601
const double j
Definition: BetheBloch.cxx:29
static const double ub
Definition: Units.h:88
template<typename T>
vector_t stan::io::reader< T >::ordered ( size_t  k)
inline

Return the next vector of specified size containing values in ascending order.

See stan::math::check_ordered(T) for behavior on failure.

Parameters
kSize of returned vector.
Returns
Vector of positive values in ascending order.

Definition at line 874 of file reader.hpp.

References stan::math::check_ordered(), stan::io::reader< T >::vector(), and submit_syst::x.

Referenced by TEST().

874  {
875  vector_t x(vector(k));
876  stan::math::check_ordered("stan::io::ordered", "Constrained vector", x);
877  return x;
878  }
Eigen::Matrix< T, Eigen::Dynamic, 1 > vector_t
Definition: reader.hpp:62
void check_ordered(const char *function, const char *name, const std::vector< T_y > &y)
vector_t vector(size_t m)
Definition: reader.hpp:207
template<typename T>
vector_t stan::io::reader< T >::ordered_constrain ( size_t  k)
inline

Return the next ordered vector of the specified length.

See stan::math::ordered_constrain(Matrix).

Parameters
kLength of returned vector.
Returns
Next ordered vector of the specified length.

Definition at line 889 of file reader.hpp.

References stan::math::ordered_constrain(), and stan::io::reader< T >::vector().

Referenced by TEST().

889  {
891  }
Eigen::Matrix< T, Eigen::Dynamic, 1 > ordered_constrain(const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x)
vector_t vector(size_t m)
Definition: reader.hpp:207
template<typename T>
vector_t stan::io::reader< T >::ordered_constrain ( size_t  k,
T lp 
)
inline

Return the next ordered vector of the specified size, incrementing the specified reference with the log absolute Jacobian of the determinant.

See stan::math::ordered_constrain(Matrix,T&).

Parameters
kSize of vector.
lpLog probability reference to increment.
Returns
Next ordered vector of the specified size.

Definition at line 904 of file reader.hpp.

References stan::math::ordered_constrain(), and stan::io::reader< T >::vector().

904  {
905  return stan::math::ordered_constrain(vector(k), lp);
906  }
Eigen::Matrix< T, Eigen::Dynamic, 1 > ordered_constrain(const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x)
vector_t vector(size_t m)
Definition: reader.hpp:207
template<typename T>
vector_t stan::io::reader< T >::positive_ordered ( size_t  k)
inline

Return the next vector of specified size containing positive values in ascending order.

See stan::math::check_positive_ordered(T) for behavior on failure.

Parameters
kSize of returned vector.
Returns
Vector of positive values in ascending order.

Definition at line 918 of file reader.hpp.

References stan::math::check_positive_ordered(), stan::io::reader< T >::vector(), and submit_syst::x.

Referenced by TEST().

918  {
919  vector_t x(vector(k));
920  stan::math::check_positive_ordered("stan::io::positive_ordered",
921  "Constrained vector", x);
922  return x;
923  }
Eigen::Matrix< T, Eigen::Dynamic, 1 > vector_t
Definition: reader.hpp:62
void check_positive_ordered(const char *function, const char *name, const Eigen::Matrix< T_y, Eigen::Dynamic, 1 > &y)
vector_t vector(size_t m)
Definition: reader.hpp:207
template<typename T>
vector_t stan::io::reader< T >::positive_ordered_constrain ( size_t  k)
inline

Return the next positive ordered vector of the specified length.

See stan::math::positive_ordered_constrain(Matrix).

Parameters
kLength of returned vector.
Returns
Next positive_ordered vector of the specified length.

Definition at line 934 of file reader.hpp.

References stan::math::positive_ordered_constrain(), and stan::io::reader< T >::vector().

Referenced by TEST().

934  {
936  }
vector_t vector(size_t m)
Definition: reader.hpp:207
Eigen::Matrix< T, Eigen::Dynamic, 1 > positive_ordered_constrain(const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x)
template<typename T>
vector_t stan::io::reader< T >::positive_ordered_constrain ( size_t  k,
T lp 
)
inline

Return the next positive_ordered vector of the specified size, incrementing the specified reference with the log absolute Jacobian of the determinant.

See stan::math::positive_ordered_constrain(Matrix,T&).

Parameters
kSize of vector.
lpLog probability reference to increment.
Returns
Next positive_ordered vector of the specified size.

Definition at line 949 of file reader.hpp.

References stan::math::positive_ordered_constrain(), and stan::io::reader< T >::vector().

949  {
951  }
vector_t vector(size_t m)
Definition: reader.hpp:207
Eigen::Matrix< T, Eigen::Dynamic, 1 > positive_ordered_constrain(const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x)
template<typename T>
T stan::io::reader< T >::prob ( )
inline

Return the next scalar, checking that it is a valid value for a probability, between 0 (inclusive) and 1 (inclusive).

See stan::math::check_bounded(T).

Returns
Next probability value.

Definition at line 687 of file reader.hpp.

References stan::io::reader< T >::scalar(), T, and submit_syst::x.

Referenced by TEST().

687  {
688  T x(scalar());
689  stan::math::check_bounded<T, double, double>
690  ("stan::io::prob", "Constrained probability", x, 0, 1);
691  return x;
692  }
double T
Definition: Xdiff_gwt.C:5
template<typename T>
T stan::io::reader< T >::prob_constrain ( )
inline

Return the next scalar transformed to be a probability between 0 and 1.

See stan::math::prob_constrain(T).

Returns
The next scalar transformed to a probability.

Definition at line 702 of file reader.hpp.

References stan::math::prob_constrain(), and stan::io::reader< T >::scalar().

Referenced by TEST().

702  {
704  }
T prob_constrain(const T &x)
template<typename T>
T stan::io::reader< T >::prob_constrain ( T lp)
inline

Return the next scalar transformed to be a probability between 0 and 1, incrementing the specified reference with the log of the absolute Jacobian determinant.

See stan::math::prob_constrain(T).

Parameters
lpReference to log probability variable to increment.
Returns
The next scalar transformed to a probability.

Definition at line 716 of file reader.hpp.

References stan::math::prob_constrain(), and stan::io::reader< T >::scalar().

716  {
717  return stan::math::prob_constrain(scalar(), lp);
718  }
T prob_constrain(const T &x)
template<typename T>
row_vector_t stan::io::reader< T >::row_vector ( size_t  m)
inline

Return a row vector of specified dimensionality made up of the next scalars.

Parameters
mNumber of rows in the vector to read.
Returns
Column vector made up of the next scalars.

Definition at line 244 of file reader.hpp.

References stan::io::reader< T >::scalar_ptr_increment().

Referenced by TEST().

244  {
245  if (m == 0) return row_vector_t();
247  }
T & scalar_ptr_increment(size_t m)
Definition: reader.hpp:46
Eigen::Map< row_vector_t > map_row_vector_t
Definition: reader.hpp:67
Eigen::Matrix< T, 1, Eigen::Dynamic > row_vector_t
Definition: reader.hpp:63
template<typename T>
row_vector_t stan::io::reader< T >::row_vector_constrain ( size_t  m)
inline

Return a row vector of specified dimensionality made up of the next scalars. The constraint is a no-op.

Parameters
mNumber of rows in the vector to read.
Returns
Column vector made up of the next scalars.

Definition at line 256 of file reader.hpp.

References stan::io::reader< T >::scalar_ptr_increment().

256  {
257  if (m == 0) return row_vector_t();
259  }
T & scalar_ptr_increment(size_t m)
Definition: reader.hpp:46
Eigen::Map< row_vector_t > map_row_vector_t
Definition: reader.hpp:67
Eigen::Matrix< T, 1, Eigen::Dynamic > row_vector_t
Definition: reader.hpp:63
template<typename T>
row_vector_t stan::io::reader< T >::row_vector_constrain ( size_t  m,
T  
)
inline

Return a row vector of specified dimensionality made up of the next scalars. The constraint is a no-op, so the log probability is not incremented.

Parameters
mNumber of rows in the vector to read. lp Log probability to increment.
Returns
Column vector made up of the next scalars.

Definition at line 270 of file reader.hpp.

References stan::io::reader< T >::scalar_ptr_increment().

270  {
271  if (m == 0) return row_vector_t();
273  }
T & scalar_ptr_increment(size_t m)
Definition: reader.hpp:46
Eigen::Map< row_vector_t > map_row_vector_t
Definition: reader.hpp:67
Eigen::Matrix< T, 1, Eigen::Dynamic > row_vector_t
Definition: reader.hpp:63
template<typename T>
template<typename TL >
row_vector_t stan::io::reader< T >::row_vector_lb ( const TL  lb,
size_t  m 
)
inline

Definition at line 1178 of file reader.hpp.

References MECModelEnuComparisons::i, m, stan::io::reader< T >::scalar_lb(), and registry_explorer::v.

1178  {
1179  row_vector_t v(m);
1180  for (size_t i = 0; i < m; ++i)
1181  v(i) = scalar_lb(lb);
1182  return v;
1183  }
T scalar_lb(const TL lb)
Definition: reader.hpp:528
Eigen::Matrix< T, 1, Eigen::Dynamic > row_vector_t
Definition: reader.hpp:63
template<typename T>
template<typename TL >
row_vector_t stan::io::reader< T >::row_vector_lb_constrain ( const TL  lb,
size_t  m 
)
inline

Definition at line 1186 of file reader.hpp.

References MECModelEnuComparisons::i, m, stan::io::reader< T >::scalar_lb_constrain(), and registry_explorer::v.

1186  {
1187  row_vector_t v(m);
1188  for (size_t i = 0; i < m; ++i)
1189  v(i) = scalar_lb_constrain(lb);
1190  return v;
1191  }
T scalar_lb_constrain(const TL lb)
Definition: reader.hpp:547
Eigen::Matrix< T, 1, Eigen::Dynamic > row_vector_t
Definition: reader.hpp:63
template<typename T>
template<typename TL >
row_vector_t stan::io::reader< T >::row_vector_lb_constrain ( const TL  lb,
size_t  m,
T lp 
)
inline

Definition at line 1195 of file reader.hpp.

References MECModelEnuComparisons::i, m, stan::io::reader< T >::scalar_lb_constrain(), and registry_explorer::v.

1195  {
1196  row_vector_t v(m);
1197  for (size_t i = 0; i < m; ++i)
1198  v(i) = scalar_lb_constrain(lb, lp);
1199  return v;
1200  }
T scalar_lb_constrain(const TL lb)
Definition: reader.hpp:547
Eigen::Matrix< T, 1, Eigen::Dynamic > row_vector_t
Definition: reader.hpp:63
template<typename T>
template<typename TL , typename TU >
row_vector_t stan::io::reader< T >::row_vector_lub ( const TL  lb,
const TU  ub,
size_t  m 
)
inline

Definition at line 1334 of file reader.hpp.

References MECModelEnuComparisons::i, m, stan::io::reader< T >::scalar_lub(), and registry_explorer::v.

1334  {
1335  row_vector_t v(m);
1336  for (size_t i = 0; i < m; ++i)
1337  v(i) = scalar_lub(lb, ub);
1338  return v;
1339  }
Eigen::Matrix< T, 1, Eigen::Dynamic > row_vector_t
Definition: reader.hpp:63
static const double ub
Definition: Units.h:88
T scalar_lub(const TL lb, const TU ub)
Definition: reader.hpp:636
template<typename T>
template<typename TL , typename TU >
row_vector_t stan::io::reader< T >::row_vector_lub_constrain ( const TL  lb,
const TU  ub,
size_t  m 
)
inline

Definition at line 1342 of file reader.hpp.

References MECModelEnuComparisons::i, m, stan::io::reader< T >::scalar_lub_constrain(), and registry_explorer::v.

1342  {
1343  row_vector_t v(m);
1344  for (size_t i = 0; i < m; ++i)
1345  v(i) = scalar_lub_constrain(lb, ub);
1346  return v;
1347  }
T scalar_lub_constrain(const TL lb, const TU ub)
Definition: reader.hpp:657
Eigen::Matrix< T, 1, Eigen::Dynamic > row_vector_t
Definition: reader.hpp:63
static const double ub
Definition: Units.h:88
template<typename T>
template<typename TL , typename TU >
row_vector_t stan::io::reader< T >::row_vector_lub_constrain ( const TL  lb,
const TU  ub,
size_t  m,
T lp 
)
inline

Definition at line 1351 of file reader.hpp.

References MECModelEnuComparisons::i, m, stan::io::reader< T >::scalar_lub_constrain(), and registry_explorer::v.

1351  {
1352  row_vector_t v(m);
1353  for (size_t i = 0; i < m; ++i)
1354  v(i) = scalar_lub_constrain(lb, ub, lp);
1355  return v;
1356  }
T scalar_lub_constrain(const TL lb, const TU ub)
Definition: reader.hpp:657
Eigen::Matrix< T, 1, Eigen::Dynamic > row_vector_t
Definition: reader.hpp:63
static const double ub
Definition: Units.h:88
template<typename T>
template<typename TU >
row_vector_t stan::io::reader< T >::row_vector_ub ( const TU  ub,
size_t  m 
)
inline

Definition at line 1255 of file reader.hpp.

References MECModelEnuComparisons::i, m, stan::io::reader< T >::scalar_ub(), and registry_explorer::v.

1255  {
1256  row_vector_t v(m);
1257  for (size_t i = 0; i < m; ++i)
1258  v(i) = scalar_ub(ub);
1259  return v;
1260  }
T scalar_ub(TU ub)
Definition: reader.hpp:582
Eigen::Matrix< T, 1, Eigen::Dynamic > row_vector_t
Definition: reader.hpp:63
static const double ub
Definition: Units.h:88
template<typename T>
template<typename TU >
row_vector_t stan::io::reader< T >::row_vector_ub_constrain ( const TU  ub,
size_t  m 
)
inline

Definition at line 1263 of file reader.hpp.

References MECModelEnuComparisons::i, m, stan::io::reader< T >::scalar_ub_constrain(), and registry_explorer::v.

1263  {
1264  row_vector_t v(m);
1265  for (size_t i = 0; i < m; ++i)
1266  v(i) = scalar_ub_constrain(ub);
1267  return v;
1268  }
Eigen::Matrix< T, 1, Eigen::Dynamic > row_vector_t
Definition: reader.hpp:63
T scalar_ub_constrain(const TU ub)
Definition: reader.hpp:601
static const double ub
Definition: Units.h:88
template<typename T>
template<typename TU >
row_vector_t stan::io::reader< T >::row_vector_ub_constrain ( const TU  ub,
size_t  m,
T lp 
)
inline

Definition at line 1272 of file reader.hpp.

References MECModelEnuComparisons::i, m, stan::io::reader< T >::scalar_ub_constrain(), and registry_explorer::v.

1272  {
1273  row_vector_t v(m);
1274  for (size_t i = 0; i < m; ++i)
1275  v(i) = scalar_ub_constrain(ub, lp);
1276  return v;
1277  }
Eigen::Matrix< T, 1, Eigen::Dynamic > row_vector_t
Definition: reader.hpp:63
T scalar_ub_constrain(const TU ub)
Definition: reader.hpp:601
static const double ub
Definition: Units.h:88
template<typename T>
T stan::io::reader< T >::scalar ( )
inline
template<typename T>
T stan::io::reader< T >::scalar_constrain ( )
inline

Return the next scalar. For arbitrary scalars, constraint is a no-op.

Returns
Next scalar.

Definition at line 165 of file reader.hpp.

References stan::io::reader< T >::scalar().

Referenced by ana::StanFitter::log_prob(), TEST(), and ana::StanFitter::write_array().

165  {
166  return scalar();
167  }
template<typename T>
T stan::io::reader< T >::scalar_constrain ( T )
inline

Return the next scalar in the sequence, incrementing the specified reference with the log absolute Jacobian determinant.

With no transformation, the Jacobian increment is a no-op.

See scalar_constrain().

log_prob Reference to log probability variable to increment.

Returns
Next scalar.

Definition at line 180 of file reader.hpp.

References stan::io::reader< T >::scalar().

180  {
181  return scalar();
182  }
template<typename T>
template<typename TL >
T stan::io::reader< T >::scalar_lb ( const TL  lb)
inline

Return the next scalar, checking that it is greater than or equal to the specified lower bound.

See stan::math::check_greater_or_equal(T,double).

Parameters
lbLower bound.
Returns
Next scalar value.
Template Parameters
TLType of lower bound.
Exceptions
std::runtime_errorif the scalar is less than the specified lower bound

Definition at line 528 of file reader.hpp.

References stan::math::check_greater_or_equal(), stan::io::reader< T >::scalar(), T, and submit_syst::x.

Referenced by stan::io::reader< T >::matrix_lb(), stan::io::reader< T >::row_vector_lb(), TEST(), and stan::io::reader< T >::vector_lb().

528  {
529  T x(scalar());
530  stan::math::check_greater_or_equal("stan::io::scalar_lb",
531  "Constrained scalar", x, lb);
532  return x;
533  }
void check_greater_or_equal(const char *function, const char *name, const T_y &y, const T_low &low)
double T
Definition: Xdiff_gwt.C:5
template<typename T>
template<typename TL >
T stan::io::reader< T >::scalar_lb_constrain ( const TL  lb)
inline

Return the next scalar transformed to have the specified lower bound.

See stan::math::lb_constrain(T,double).

Template Parameters
TLType of lower bound.
Parameters
lbLower bound on values.
Returns
Next scalar transformed to have the specified lower bound.

Definition at line 547 of file reader.hpp.

References stan::math::lb_constrain(), and stan::io::reader< T >::scalar().

Referenced by stan::io::reader< T >::matrix_lb_constrain(), stan::io::reader< T >::row_vector_lb_constrain(), TEST(), and stan::io::reader< T >::vector_lb_constrain().

547  {
548  return stan::math::lb_constrain(scalar(), lb);
549  }
T lb_constrain(const T &x, const L &lb)
template<typename T>
template<typename TL >
T stan::io::reader< T >::scalar_lb_constrain ( const TL  lb,
T lp 
)
inline

Return the next scalar transformed to have the specified lower bound, incrementing the specified reference with the log of the absolute Jacobian determinant of the transform.

See stan::math::lb_constrain(T,double,T&).

Template Parameters
TLType of lower bound.
Parameters
lbLower bound on result.
lpReference to log probability variable to increment.

Definition at line 563 of file reader.hpp.

References stan::math::lb_constrain(), and stan::io::reader< T >::scalar().

563  {
564  return stan::math::lb_constrain(scalar(), lb, lp);
565  }
T lb_constrain(const T &x, const L &lb)
template<typename T>
template<typename TL , typename TU >
T stan::io::reader< T >::scalar_lub ( const TL  lb,
const TU  ub 
)
inline

Return the next scalar, checking that it is between the specified lower and upper bound.

See stan::math::check_bounded(T, double, double).

Template Parameters
TLType of lower bound.
TUType of upper bound.
Parameters
lbLower bound.
ubUpper bound.
Returns
Next scalar value.
Exceptions
std::runtime_errorif the scalar is not between the specified lower and upper bounds.

Definition at line 636 of file reader.hpp.

References stan::io::reader< T >::scalar(), T, genie::units::ub, and submit_syst::x.

Referenced by stan::io::reader< T >::matrix_lub(), stan::io::reader< T >::row_vector_lub(), TEST(), and stan::io::reader< T >::vector_lub().

636  {
637  T x(scalar());
638  stan::math::check_bounded<T, TL, TU>
639  ("stan::io::scalar_lub", "Constrained scalar", x, lb, ub);
640  return x;
641  }
static const double ub
Definition: Units.h:88
double T
Definition: Xdiff_gwt.C:5
template<typename T>
template<typename TL , typename TU >
T stan::io::reader< T >::scalar_lub_constrain ( const TL  lb,
const TU  ub 
)
inline

Return the next scalar transformed to be between the specified lower and upper bounds.

See stan::math::lub_constrain(T, double, double).

Template Parameters
TLType of lower bound.
TUType of upper bound.
Parameters
lbLower bound.
ubUpper bound.
Returns
Next scalar transformed to fall between the specified bounds.

Definition at line 657 of file reader.hpp.

References stan::math::lub_constrain(), and stan::io::reader< T >::scalar().

Referenced by TestModel_uniform_01::log_prob(), ana::StanFitter::log_prob(), stan::io::reader< T >::matrix_lub_constrain(), stan::io::reader< T >::row_vector_lub_constrain(), TEST(), stan::io::reader< T >::vector_lub_constrain(), and ana::StanFitter::write_array().

657  {
658  return stan::math::lub_constrain(scalar(), lb, ub);
659  }
boost::math::tools::promote_args< T, L, U >::type lub_constrain(const T &x, const L &lb, const U &ub)
static const double ub
Definition: Units.h:88
template<typename T>
template<typename TL , typename TU >
T stan::io::reader< T >::scalar_lub_constrain ( TL  lb,
TU  ub,
T lp 
)
inline

Return the next scalar transformed to be between the the specified lower and upper bounds.

See stan::math::lub_constrain(T, double, double, T&).

Parameters
lbLower bound.
ubUpper bound.
lpReference to log probability variable to increment.
Template Parameters
TType of scalar.
TLType of lower bound.
TUType of upper bound.

Definition at line 675 of file reader.hpp.

References stan::math::lub_constrain(), and stan::io::reader< T >::scalar().

675  {
676  return stan::math::lub_constrain(scalar(), lb, ub, lp);
677  }
boost::math::tools::promote_args< T, L, U >::type lub_constrain(const T &x, const L &lb, const U &ub)
static const double ub
Definition: Units.h:88
template<typename T>
T stan::io::reader< T >::scalar_pos ( )
inline

Return the next scalar, checking that it is positive.

See stan::math::check_positive(T).

Returns
Next positive scalar.
Exceptions
std::runtime_errorif x is not positive

Definition at line 483 of file reader.hpp.

References stan::math::check_positive(), stan::io::reader< T >::scalar(), T, and submit_syst::x.

Referenced by TEST().

483  {
484  T x(scalar());
485  stan::math::check_positive("stan::io::scalar_pos",
486  "Constrained scalar", x);
487  return x;
488  }
void check_positive(const char *function, const char *name, const T_y &y)
double T
Definition: Xdiff_gwt.C:5
template<typename T>
T stan::io::reader< T >::scalar_pos_constrain ( )
inline

Return the next scalar, transformed to be positive.

See stan::math::positive_constrain(T).

Returns
The next scalar transformed to be positive.

Definition at line 497 of file reader.hpp.

References stan::math::positive_constrain(), and stan::io::reader< T >::scalar().

Referenced by TEST().

497  {
499  }
T positive_constrain(const T &x)
template<typename T>
T stan::io::reader< T >::scalar_pos_constrain ( T lp)
inline

Return the next scalar transformed to be positive, incrementing the specified reference with the log absolute determinant of the Jacobian.

See stan::math::positive_constrain(T,T&).

Parameters
lpReference to log probability variable to increment.
Returns
The next scalar transformed to be positive.

Definition at line 511 of file reader.hpp.

References stan::math::positive_constrain(), and stan::io::reader< T >::scalar().

511  {
513  }
T positive_constrain(const T &x)
template<typename T>
T& stan::io::reader< T >::scalar_ptr ( )
inlineprivate

Definition at line 42 of file reader.hpp.

Referenced by stan::io::reader< T >::std_vector().

42  {
43  return data_r_.at(pos_);
44  }
std::vector< T > & data_r_
Definition: reader.hpp:37
template<typename T>
T& stan::io::reader< T >::scalar_ptr_increment ( size_t  m)
inlineprivate
template<typename T>
template<typename TU >
T stan::io::reader< T >::scalar_ub ( TU  ub)
inline

Return the next scalar, checking that it is less than or equal to the specified upper bound.

See stan::math::check_less_or_equal(T,double).

Template Parameters
TUType of upper bound.
Parameters
ubUpper bound.
Returns
Next scalar value.
Exceptions
std::runtime_errorif the scalar is greater than the specified upper bound

Definition at line 582 of file reader.hpp.

References stan::math::check_less_or_equal(), stan::io::reader< T >::scalar(), T, and submit_syst::x.

Referenced by stan::io::reader< T >::matrix_ub(), stan::io::reader< T >::row_vector_ub(), TEST(), and stan::io::reader< T >::vector_ub().

582  {
583  T x(scalar());
584  stan::math::check_less_or_equal("stan::io::scalar_ub",
585  "Constrained scalar", x, ub);
586  return x;
587  }
void check_less_or_equal(const char *function, const char *name, const T_y &y, const T_high &high)
static const double ub
Definition: Units.h:88
double T
Definition: Xdiff_gwt.C:5
template<typename T>
template<typename TU >
T stan::io::reader< T >::scalar_ub_constrain ( const TU  ub)
inline

Return the next scalar transformed to have the specified upper bound.

See stan::math::ub_constrain(T,double).

Template Parameters
TUType of upper bound.
Parameters
ubUpper bound on values.
Returns
Next scalar transformed to have the specified upper bound.

Definition at line 601 of file reader.hpp.

References stan::io::reader< T >::scalar(), and stan::math::ub_constrain().

Referenced by stan::io::reader< T >::matrix_ub_constrain(), stan::io::reader< T >::row_vector_ub_constrain(), TEST(), and stan::io::reader< T >::vector_ub_constrain().

601  {
603  }
boost::math::tools::promote_args< T, U >::type ub_constrain(const T &x, const U &ub)
static const double ub
Definition: Units.h:88
template<typename T>
template<typename TU >
T stan::io::reader< T >::scalar_ub_constrain ( const TU  ub,
T lp 
)
inline

Return the next scalar transformed to have the specified upper bound, incrementing the specified reference with the log of the absolute Jacobian determinant of the transform.

See stan::math::ub_constrain(T,double,T&).

Template Parameters
TUType of upper bound.
Parameters
ubUpper bound on result.
lpReference to log probability variable to increment.

Definition at line 617 of file reader.hpp.

References stan::io::reader< T >::scalar(), and stan::math::ub_constrain().

617  {
618  return stan::math::ub_constrain(scalar(), ub, lp);
619  }
boost::math::tools::promote_args< T, U >::type ub_constrain(const T &x, const U &ub)
static const double ub
Definition: Units.h:88
template<typename T>
vector_t stan::io::reader< T >::simplex ( size_t  k)
inline

Return a simplex of the specified size made up of the next scalars.

See stan::math::check_simplex.

Parameters
kSize of returned simplex.
Returns
Simplex read from the specified size number of scalars.
Exceptions
std::runtime_errorif the k values is not a simplex.

Definition at line 826 of file reader.hpp.

References stan::math::check_simplex(), chisquared::theta, and stan::io::reader< T >::vector().

Referenced by TEST().

826  {
827  vector_t theta(vector(k));
828  stan::math::check_simplex("stan::io::simplex",
829  "Constrained vector", theta);
830  return theta;
831  }
void check_simplex(const char *function, const char *name, const Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > &theta)
Eigen::Matrix< T, Eigen::Dynamic, 1 > vector_t
Definition: reader.hpp:62
vector_t vector(size_t m)
Definition: reader.hpp:207
template<typename T>
Eigen::Matrix<T, Eigen::Dynamic, 1> stan::io::reader< T >::simplex_constrain ( size_t  k)
inline

Return the next simplex transformed vector of the specified length. This operation consumes one less than the specified length number of scalars.

See stan::math::simplex_constrain(Eigen::Matrix).

Parameters
kNumber of dimensions in resulting simplex.
Returns
Simplex derived from next k-1 scalars.

Definition at line 844 of file reader.hpp.

References stan::math::simplex_constrain(), and stan::io::reader< T >::vector().

844  {
846  }
vector_t vector(size_t m)
Definition: reader.hpp:207
Eigen::Matrix< T, Eigen::Dynamic, 1 > simplex_constrain(const Eigen::Matrix< T, Eigen::Dynamic, 1 > &y)
template<typename T>
vector_t stan::io::reader< T >::simplex_constrain ( size_t  k,
T lp 
)
inline

Return the next simplex of the specified size (using one fewer unconstrained scalars), incrementing the specified reference with the log absolute Jacobian determinant.

See stan::math::simplex_constrain(Eigen::Matrix,T&).

Parameters
kSize of simplex.
lpLog probability to increment with log absolute Jacobian determinant.
Returns
The next simplex of the specified size.

Definition at line 860 of file reader.hpp.

References stan::math::simplex_constrain(), and stan::io::reader< T >::vector().

860  {
861  return stan::math::simplex_constrain(vector(k-1), lp);
862  }
vector_t vector(size_t m)
Definition: reader.hpp:207
Eigen::Matrix< T, Eigen::Dynamic, 1 > simplex_constrain(const Eigen::Matrix< T, Eigen::Dynamic, 1 > &y)
template<typename T>
std::vector<T> stan::io::reader< T >::std_vector ( size_t  m)
inline

Return a standard library vector of the specified dimensionality made up of the next scalars.

Parameters
mSize of vector.
Returns
Vector made up of the next scalars.

Definition at line 192 of file reader.hpp.

References stan::io::reader< T >::scalar_ptr(), stan::io::reader< T >::scalar_ptr_increment(), febshutoff_auto::start, and T.

Referenced by TEST().

192  {
193  if (m == 0) return std::vector<T>();
194  std::vector<T> vec;
196  vec.insert(vec.begin(), &start, &scalar_ptr());
197  return vec;
198  }
T & scalar_ptr_increment(size_t m)
Definition: reader.hpp:46
T & scalar_ptr()
Definition: reader.hpp:42
Eigen::VectorXd vec
double T
Definition: Xdiff_gwt.C:5
template<typename T>
vector_t stan::io::reader< T >::unit_vector ( size_t  k)
inline

Return a unit_vector of the specified size made up of the next scalars.

See stan::math::check_unit_vector.

Parameters
kSize of returned unit_vector.
Returns
unit_vector read from the specified size number of scalars.
Exceptions
std::runtime_errorif the k values is not a unit_vector.

Definition at line 778 of file reader.hpp.

References stan::math::check_unit_vector(), chisquared::theta, and stan::io::reader< T >::vector().

Referenced by TEST().

778  {
779  vector_t theta(vector(k));
780  stan::math::check_unit_vector("stan::io::unit_vector",
781  "Constrained vector", theta);
782  return theta;
783  }
Eigen::Matrix< T, Eigen::Dynamic, 1 > vector_t
Definition: reader.hpp:62
void check_unit_vector(const char *function, const char *name, const Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > &theta)
vector_t vector(size_t m)
Definition: reader.hpp:207
template<typename T>
Eigen::Matrix<T, Eigen::Dynamic, 1> stan::io::reader< T >::unit_vector_constrain ( size_t  k)
inline

Return the next unit_vector transformed vector of the specified length. This operation consumes one less than the specified length number of scalars.

See stan::math::unit_vector_constrain(Eigen::Matrix).

Parameters
kNumber of dimensions in resulting unit_vector.
Returns
unit_vector derived from next k scalars.

Definition at line 796 of file reader.hpp.

References stan::math::unit_vector_constrain(), and stan::io::reader< T >::vector().

796  {
798  }
vector_t vector(size_t m)
Definition: reader.hpp:207
Eigen::Matrix< fvar< T >, R, C > unit_vector_constrain(const Eigen::Matrix< fvar< T >, R, C > &y)
template<typename T>
vector_t stan::io::reader< T >::unit_vector_constrain ( size_t  k,
T lp 
)
inline

Return the next unit_vector of the specified size (using one fewer unconstrained scalars), incrementing the specified reference with the log absolute Jacobian determinant.

See stan::math::unit_vector_constrain(Eigen::Matrix,T&).

Parameters
kSize of unit_vector.
lpLog probability to increment with log absolute Jacobian determinant.
Returns
The next unit_vector of the specified size.

Definition at line 812 of file reader.hpp.

References stan::math::unit_vector_constrain(), and stan::io::reader< T >::vector().

812  {
814  }
vector_t vector(size_t m)
Definition: reader.hpp:207
Eigen::Matrix< fvar< T >, R, C > unit_vector_constrain(const Eigen::Matrix< fvar< T >, R, C > &y)
template<typename T>
vector_t stan::io::reader< T >::vector ( size_t  m)
inline
template<typename T>
vector_t stan::io::reader< T >::vector_constrain ( size_t  m)
inline

Return a column vector of specified dimensionality made up of the next scalars. The constraint is a no-op.

Parameters
mNumber of rows in the vector to read.
Returns
Column vector made up of the next scalars.

Definition at line 218 of file reader.hpp.

References stan::io::reader< T >::scalar_ptr_increment().

218  {
219  if (m == 0) return vector_t();
221  }
T & scalar_ptr_increment(size_t m)
Definition: reader.hpp:46
Eigen::Matrix< T, Eigen::Dynamic, 1 > vector_t
Definition: reader.hpp:62
Eigen::Map< vector_t > map_vector_t
Definition: reader.hpp:66
template<typename T>
vector_t stan::io::reader< T >::vector_constrain ( size_t  m,
T  
)
inline

Return a column vector of specified dimensionality made up of the next scalars. The constraint and hence Jacobian are no-ops.

Parameters
mNumber of rows in the vector to read. lp Log probability to increment.
Returns
Column vector made up of the next scalars.

Definition at line 230 of file reader.hpp.

References stan::io::reader< T >::scalar_ptr_increment().

230  {
231  if (m == 0) return vector_t();
233  }
T & scalar_ptr_increment(size_t m)
Definition: reader.hpp:46
Eigen::Matrix< T, Eigen::Dynamic, 1 > vector_t
Definition: reader.hpp:62
Eigen::Map< vector_t > map_vector_t
Definition: reader.hpp:66
template<typename T>
template<typename TL >
vector_t stan::io::reader< T >::vector_lb ( const TL  lb,
size_t  m 
)
inline

Definition at line 1154 of file reader.hpp.

References MECModelEnuComparisons::i, m, stan::io::reader< T >::scalar_lb(), and registry_explorer::v.

1154  {
1155  vector_t v(m);
1156  for (size_t i = 0; i < m; ++i)
1157  v(i) = scalar_lb(lb);
1158  return v;
1159  }
T scalar_lb(const TL lb)
Definition: reader.hpp:528
Eigen::Matrix< T, Eigen::Dynamic, 1 > vector_t
Definition: reader.hpp:62
template<typename T>
template<typename TL >
vector_t stan::io::reader< T >::vector_lb_constrain ( const TL  lb,
size_t  m 
)
inline

Definition at line 1162 of file reader.hpp.

References MECModelEnuComparisons::i, m, stan::io::reader< T >::scalar_lb_constrain(), and registry_explorer::v.

1162  {
1163  vector_t v(m);
1164  for (size_t i = 0; i < m; ++i)
1165  v(i) = scalar_lb_constrain(lb);
1166  return v;
1167  }
Eigen::Matrix< T, Eigen::Dynamic, 1 > vector_t
Definition: reader.hpp:62
T scalar_lb_constrain(const TL lb)
Definition: reader.hpp:547
template<typename T>
template<typename TL >
vector_t stan::io::reader< T >::vector_lb_constrain ( const TL  lb,
size_t  m,
T lp 
)
inline

Definition at line 1170 of file reader.hpp.

References MECModelEnuComparisons::i, m, stan::io::reader< T >::scalar_lb_constrain(), and registry_explorer::v.

1170  {
1171  vector_t v(m);
1172  for (size_t i = 0; i < m; ++i)
1173  v(i) = scalar_lb_constrain(lb, lp);
1174  return v;
1175  }
Eigen::Matrix< T, Eigen::Dynamic, 1 > vector_t
Definition: reader.hpp:62
T scalar_lb_constrain(const TL lb)
Definition: reader.hpp:547
template<typename T>
template<typename TL , typename TU >
vector_t stan::io::reader< T >::vector_lub ( const TL  lb,
const TU  ub,
size_t  m 
)
inline

Definition at line 1308 of file reader.hpp.

References MECModelEnuComparisons::i, m, stan::io::reader< T >::scalar_lub(), and registry_explorer::v.

1308  {
1309  vector_t v(m);
1310  for (size_t i = 0; i < m; ++i)
1311  v(i) = scalar_lub(lb, ub);
1312  return v;
1313  }
Eigen::Matrix< T, Eigen::Dynamic, 1 > vector_t
Definition: reader.hpp:62
static const double ub
Definition: Units.h:88
T scalar_lub(const TL lb, const TU ub)
Definition: reader.hpp:636
template<typename T>
template<typename TL , typename TU >
vector_t stan::io::reader< T >::vector_lub_constrain ( const TL  lb,
const TU  ub,
size_t  m 
)
inline

Definition at line 1317 of file reader.hpp.

References MECModelEnuComparisons::i, m, stan::io::reader< T >::scalar_lub_constrain(), and registry_explorer::v.

1317  {
1318  vector_t v(m);
1319  for (size_t i = 0; i < m; ++i)
1320  v(i) = scalar_lub_constrain(lb, ub);
1321  return v;
1322  }
T scalar_lub_constrain(const TL lb, const TU ub)
Definition: reader.hpp:657
Eigen::Matrix< T, Eigen::Dynamic, 1 > vector_t
Definition: reader.hpp:62
static const double ub
Definition: Units.h:88
template<typename T>
template<typename TL , typename TU >
vector_t stan::io::reader< T >::vector_lub_constrain ( const TL  lb,
const TU  ub,
size_t  m,
T lp 
)
inline

Definition at line 1326 of file reader.hpp.

References MECModelEnuComparisons::i, m, stan::io::reader< T >::scalar_lub_constrain(), and registry_explorer::v.

1326  {
1327  vector_t v(m);
1328  for (size_t i = 0; i < m; ++i)
1329  v(i) = scalar_lub_constrain(lb, ub, lp);
1330  return v;
1331  }
T scalar_lub_constrain(const TL lb, const TU ub)
Definition: reader.hpp:657
Eigen::Matrix< T, Eigen::Dynamic, 1 > vector_t
Definition: reader.hpp:62
static const double ub
Definition: Units.h:88
template<typename T>
template<typename TU >
vector_t stan::io::reader< T >::vector_ub ( const TU  ub,
size_t  m 
)
inline

Definition at line 1231 of file reader.hpp.

References MECModelEnuComparisons::i, m, stan::io::reader< T >::scalar_ub(), and registry_explorer::v.

1231  {
1232  vector_t v(m);
1233  for (size_t i = 0; i < m; ++i)
1234  v(i) = scalar_ub(ub);
1235  return v;
1236  }
T scalar_ub(TU ub)
Definition: reader.hpp:582
Eigen::Matrix< T, Eigen::Dynamic, 1 > vector_t
Definition: reader.hpp:62
static const double ub
Definition: Units.h:88
template<typename T>
template<typename TU >
vector_t stan::io::reader< T >::vector_ub_constrain ( const TU  ub,
size_t  m 
)
inline

Definition at line 1239 of file reader.hpp.

References MECModelEnuComparisons::i, m, stan::io::reader< T >::scalar_ub_constrain(), and registry_explorer::v.

1239  {
1240  vector_t v(m);
1241  for (size_t i = 0; i < m; ++i)
1242  v(i) = scalar_ub_constrain(ub);
1243  return v;
1244  }
Eigen::Matrix< T, Eigen::Dynamic, 1 > vector_t
Definition: reader.hpp:62
T scalar_ub_constrain(const TU ub)
Definition: reader.hpp:601
static const double ub
Definition: Units.h:88
template<typename T>
template<typename TU >
vector_t stan::io::reader< T >::vector_ub_constrain ( const TU  ub,
size_t  m,
T lp 
)
inline

Definition at line 1247 of file reader.hpp.

References MECModelEnuComparisons::i, m, stan::io::reader< T >::scalar_ub_constrain(), and registry_explorer::v.

1247  {
1248  vector_t v(m);
1249  for (size_t i = 0; i < m; ++i)
1250  v(i) = scalar_ub_constrain(ub, lp);
1251  return v;
1252  }
Eigen::Matrix< T, Eigen::Dynamic, 1 > vector_t
Definition: reader.hpp:62
T scalar_ub_constrain(const TU ub)
Definition: reader.hpp:601
static const double ub
Definition: Units.h:88

Member Data Documentation

template<typename T>
std::vector<int>& stan::io::reader< T >::data_i_
private

Definition at line 38 of file reader.hpp.

template<typename T>
std::vector<T>& stan::io::reader< T >::data_r_
private

Definition at line 37 of file reader.hpp.

template<typename T>
size_t stan::io::reader< T >::int_pos_
private

Definition at line 40 of file reader.hpp.

Referenced by stan::io::reader< T >::available_i().

template<typename T>
size_t stan::io::reader< T >::pos_
private

Definition at line 39 of file reader.hpp.

Referenced by stan::io::reader< T >::available().


The documentation for this class was generated from the following file: