include/vinecopulib/vinecop/implementation/class.ipp
//! Checks if dimension d of the data matches the dimension of the vine.
Checks if dimension d of the data matches the dimension of the vine.
Checks if dimension d of the data matches the dimension of the vine .
inline void
Vinecop::check_data_dim(const Eigen::MatrixXd& data) const
{
  size_t d_data = data.cols();
  auto n_disc = get_n_discrete();
  size_t d_exp = d_ + n_disc;
  if ((d_data != d_exp) & (d_data != 2 * d_)) {
    std::stringstream msg;
    msg << "data has wrong number of columns; "
        << "expected: " << d_exp << " or " << 2 * d_ << ", actual: " << d_data
        << " (model contains ";
    if (n_disc == 0) {
      msg << "no discrete variables)." << std::endl;
    } else if (n_disc == 1) {
      msg << "1 discrete variable)." << std::endl;
    } else {
      msg << get_n_discrete() << " discrete variables)." << std::endl;
    }
    throw std::runtime_error(msg.str());
  }
}
inline void Vinecop :: check_data_dim ( const Eigen :: MatrixXd & data ) const { size_t d_data = data . cols ( ) ; auto n_disc = get_n_discrete ( ) ; size_t d_exp = d_ + n_disc ; if ( ( d_data != d_exp ) & ( d_data != 2 * d_ ) ) { std :: stringstream msg ; msg << " " << " " << d_exp << " " << 2 * d_ << " " << d_data << " " ; if ( n_disc == 0 ) { msg << " " << std :: endl ; } else if ( n_disc == 1 ) { msg << " " << std :: endl ; } else { msg << get_n_discrete ( ) << " " << std :: endl ; } throw std :: runtime_error ( msg . str ( ) ) ; } }
Checks if dimension d of the data matches the dimension of the vine.
Checks if dimension d of the data matches the dimension of the vine .