<commit_before>#ifndef __STAN__MCMC__CHAINS_HPP__
#define __STAN__MCMC__CHAINS_HPP__

#include <algorithm>
#include <iostream>
#include <map>
#include <stdexcept>
#include <string>
#include <sstream>
#include <vector>

#include <boost/random/uniform_int_distribution.hpp>

namespace stan {  

  namespace mcmc {

    /**
     * Validate the specified indexes with respect to the
     * specified dimensions.
     *
     * @param dims Dimensions of array.
     * @param idxs Indexes into array.
     * @throw std::invalid_argument If the two arrays are different
     * sizes.
     * @throw std::out_of_range If any of the indexes is greater than
     * or equal to its correpsonding dimension.
     */<commit_msg>resizing for chains structured output<commit_after>#ifndef __STAN__MCMC__CHAINS_HPP__
#define __STAN__MCMC__CHAINS_HPP__

#include <algorithm>
#include <iostream>
#include <map>
#include <stdexcept>
#include <string>
#include <sstream>
#include <vector>

#include <Eigen/Dense>

#include <boost/random/uniform_int_distribution.hpp>

namespace stan {  

  namespace mcmc {

    /*
    template <typename T>
    void resize(std::vector<T>& x, 
                const std::vector<size_t>& dims,
                size_t pos) {
      if (pos >= dims.size()) return;
      x.resize(dims[pos]);
      for (size_t i = 0; i < dims[pos]; ++i)
        resize(x,dims,pos+1);
    }

    template <typename T>
    void resize(Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>& x,
                const std::vector<size_t>& dims,
                size_t pos) {
      if ((dims.size() - pos) != 2U) {
        stringstream msg;
        msg << "attempt to resize matrix with wrong args."
            << "; pos=" << pos
            << "; dims.size()=" << dims.size()
            << "; but difference must be 2.";
        throw std::invalid_argument(msg.str());
      }
      x.resize(dims[pos],dims[pos+1]);
    }


    template <typename T>
    void resize(Eigen::Matrix<T,Eigen::Dynamic,1>& x,
                const std::vector<size_t>& dims,
                size_t pos) {
      if ((dims.size() - pos) != 1U) {
        stringstream msg;
        msg << "attempt to resize vector with wrong number of dims."
            << "; pos=" << pos
            << "; dims.size()=" << dims.size()
            << "; but difference must be 1.";
        throw std::invalid_argument(msg.str());
      }
      x.resize(dims[pos]);
    }

    template <typename T>
    void resize(Eigen::Matrix<T,1,Eigen::Dynamic>& x,
                const std::vector<size_t>& dims,
                size_t pos) {
      if ((dims.size() - pos) != 1U) {
        stringstream msg;
        msg << "attempt to resize row vector with wrong number of dims."
            << "; pos=" << pos
            << "; dims.size()=" << dims.size()
            << "; but difference must be 1.";
        throw std::invalid_argument(msg.str());
      }
      x.resize(dims[pos]);
    }


    template <typename T>
    inline void resize(T& t, 
                       const std::vector<size_t>& dims) {
      resize(t,dims,0);
    }
    */


    /**
     * Validate the specified indexes with respect to the
     * specified dimensions.
     *
     * @param dims Dimensions of array.
     * @param idxs Indexes into array.
     * @throw std::invalid_argument If the two arrays are different
     * sizes.
     * @throw std::out_of_range If any of the indexes is greater than
     * or equal to its correpsonding dimension.
     */
{'fraction_non_alphanumeric': 0.13019630484988454, 'fraction_numerical': 0.003464203233256351, 'mean_word_length': 2.3157894736842106, 'pattern_counts': {'":': 0, '<': 71, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5183590', 'n_tokens_mistral': 1122, 'n_tokens_neox': 1078, 'n_words': 295}