<commit_before>#ifndef STAN_MATH_PRIM_MAT_PROB_MULTI_NORMAL_PREC_RNG_HPP
#define STAN_MATH_PRIM_MAT_PROB_MULTI_NORMAL_PREC_RNG_HPP

#include <boost/random/normal_distribution.hpp>
#include <boost/random/variate_generator.hpp>
#include <stan/math/prim/mat/err/check_pos_definite.hpp>
#include <stan/math/prim/mat/err/check_symmetric.hpp>
#include <stan/math/prim/mat/meta/vector_seq_view.hpp>
#include <stan/math/prim/scal/err/check_finite.hpp>
#include <stan/math/prim/scal/err/check_positive.hpp>
#include <stan/math/prim/scal/meta/StdVectorBuilder.hpp>

namespace stan {
namespace math {

/**
 * Return a multivariate normal random variate with the given location
 * and prescision using the specified random number generator.
 *
 * mu can be either an Eigen::VectorXd, an Eigen::RowVectorXd, or a
 * std::vector of either of those types.
 *
 * @tparam T_loc Type of location paramater
 * @tparam RNG Type of pseudo-random number generator
 * @param mu (Sequence of) location parameter(s)
 * @param S Precision matrix
 * @param rng random number generator
 * @throw std::domain_error if S is not positive definite, or
 * std::invalid_argument if the length of (each) mu is not equal to
 * the number of rows and columns in S
 */
template <typename T_loc, class RNG>
inline typename StdVectorBuilder<true, Eigen::VectorXd, T_loc>::type
multi_normal_prec_rng(const T_loc &mu, const Eigen::MatrixXd &S, RNG &rng) {
  using boost::normal_distribution;
  using boost::variate_generator;

  static const char *function = "multi_normal_prec_rng";

  check_positive(function, "Precision matrix rows", S.rows());
  check_finite(function, "Precision matrix", S);
  check_symmetric(function, "Precision matrix", S);

  Eigen::LLT<Eigen::MatrixXd> llt_of_S = S.llt();
  check_pos_definite(function, "precision matrix argument", llt_of_S);

  vector_seq_view<T_loc> mu_vec(mu);
  check_positive(function, "number of location parameter vectors",
		 mu_vec.size());
  size_t size_mu = mu_vec[0].size();
<commit_msg>[Jenkins] auto-formatting by clang-format version 5.0.0-3~16.04.1 (tags/RELEASE_500/final)<commit_after>#ifndef STAN_MATH_PRIM_MAT_PROB_MULTI_NORMAL_PREC_RNG_HPP
#define STAN_MATH_PRIM_MAT_PROB_MULTI_NORMAL_PREC_RNG_HPP

#include <boost/random/normal_distribution.hpp>
#include <boost/random/variate_generator.hpp>
#include <stan/math/prim/mat/err/check_pos_definite.hpp>
#include <stan/math/prim/mat/err/check_symmetric.hpp>
#include <stan/math/prim/mat/meta/vector_seq_view.hpp>
#include <stan/math/prim/scal/err/check_finite.hpp>
#include <stan/math/prim/scal/err/check_positive.hpp>
#include <stan/math/prim/scal/meta/StdVectorBuilder.hpp>

namespace stan {
namespace math {

/**
 * Return a multivariate normal random variate with the given location
 * and prescision using the specified random number generator.
 *
 * mu can be either an Eigen::VectorXd, an Eigen::RowVectorXd, or a
 * std::vector of either of those types.
 *
 * @tparam T_loc Type of location paramater
 * @tparam RNG Type of pseudo-random number generator
 * @param mu (Sequence of) location parameter(s)
 * @param S Precision matrix
 * @param rng random number generator
 * @throw std::domain_error if S is not positive definite, or
 * std::invalid_argument if the length of (each) mu is not equal to
 * the number of rows and columns in S
 */
template <typename T_loc, class RNG>
inline typename StdVectorBuilder<true, Eigen::VectorXd, T_loc>::type
multi_normal_prec_rng(const T_loc &mu, const Eigen::MatrixXd &S, RNG &rng) {
  using boost::normal_distribution;
  using boost::variate_generator;

  static const char *function = "multi_normal_prec_rng";

  check_positive(function, "Precision matrix rows", S.rows());
  check_finite(function, "Precision matrix", S);
  check_symmetric(function, "Precision matrix", S);

  Eigen::LLT<Eigen::MatrixXd> llt_of_S = S.llt();
  check_pos_definite(function, "precision matrix argument", llt_of_S);

  vector_seq_view<T_loc> mu_vec(mu);
  check_positive(function, "number of location parameter vectors",
                 mu_vec.size());
  size_t size_mu = mu_vec[0].size();

{'fraction_non_alphanumeric': 0.10891330891330891, 'fraction_numerical': 0.003418803418803419, 'mean_word_length': 5.627831715210356, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, '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': '4733650', 'n_tokens_mistral': 1422, 'n_tokens_neox': 1362, 'n_words': 354}