Skip to content

Instantly share code, notes, and snippets.

View SteveBronder's full-sized avatar
⚔️
Chillin

Steve Bronder SteveBronder

⚔️
Chillin
View GitHub Profile
#include <stan/services/sample/hmc_nuts_diag_e_adapt.hpp>
#include <gtest/gtest.h>
#include <stan/io/empty_var_context.hpp>
#include <test/test-models/good/tester.hpp>
#include <test/unit/services/instrumented_callbacks.hpp>
#include <iostream>
class ServicesSampleHmcNutsDiagEAdapt : public testing::Test {
public:
ServicesSampleHmcNutsDiagEAdapt() : model(context, 0, &model_log) {}
#include <stdlib.h>
#include <iostream>
#include <type_traits>
#include <utility>
template <typename T>
struct circular_buffer {
using value_type = std::decay_t<T>;
using pointer = std::decay_t<T>*;
#include <Eigen/Dense>
#include <string_view>
#include <iostream>
template <typename T>
constexpr std::string_view
type_name()
{
std::string_view name, prefix, suffix;
#ifdef __clang__
let collect_decl_sizes (mir_section : 'b list) =
let get_decls Stmt.Fixed.({pattern;_}) = match pattern with
| Stmt.Fixed.Pattern.Decl({decl_id; decl_type=Type.Sized st; _}) -> Some (decl_id, SizedType.dims_of st)
| _ -> None
in
List.filter_map ~f:get_decls mir_section
(**
* Collapse statements in for loops to not depend on the loop.
functions {
vector SIR(real time, // Time
vector y, // System state of the ODE [susceptible, infected, recovered] at the time specified
real beta0,
vector beta_N,
real gamma,
// vector theta, // Parameter values used to evaluate the ODE system
vector left_t,
vector right_t,
#include <benchmark/benchmark.h>
#include <stan/math.hpp>
#include <utility>
static bool needs_done = true;
// Just to fill up the var stack allocator
template <int max_alloc_r, int max_alloc_c>
static void toss_me(benchmark::State& state) {
using stan::math::var;
if (needs_done) {
./runTests.py ./test/unit/math/mix/fun/toss_me_test.cpp
------------------------------------------------------------
make -j1 ./test/unit/math/mix/fun/toss_me_test
g++ -ftemplate-backtrace-limit=0 -std=c++1y -pthread -D_REENTRANT -Wno-sign-compare -Wno-ignored-attributes -I lib/tbb_2019_U8/include -O0 -I . -I lib/eigen_3.3.9 -I lib/boost_1.72.0 -I lib/sundials_5.5.0/include -I lib/benchmark_1.5.1/googletest/googletest/include -I lib/benchmark_1.5.1/googletest/googletest -DBOOST_DISABLE_ASSERTS -DGTEST_HAS_PTHREAD=0 -c -MT test/unit/math/mix/fun/toss_me_test.o -MM -E -MG -MP -MF test/unit/math/mix/fun/toss_me_test.d test/unit/math/mix/fun/toss_me_test.cpp
g++ -ftemplate-backtrace-limit=0 -std=c++1y -pthread -D_REENTRANT -Wno-sign-compare -Wno-ignored-attributes -I lib/tbb_2019_U8/include -O0 -I . -I lib/eigen_3.3.9 -I lib/boost_1.72.0 -I lib/sundials_5.5.0/include -I lib/benchmark_1.5.1/googletest/googletest/include -I lib/benchmark_1.5.1/googletest/googletest -I lib/benchmark_1.5.
// Code generated by stanc 81881366
#include <stan/model/model_header.hpp>
namespace bernoulli_model_namespace {
inline void validate_positive_index(const char* var_name, const char* expr,
int val) {
if (val < 1) {
std::stringstream msg;
functions {
/**
* Do a row-wise sum over a matrix
*/
vector rowwise_sum(matrix mat) {
int mat_rows = rows(mat);
vector[mat_rows] D;
for (i in 1:mat_rows) {
D[i] = sum(mat[i]);
}
#ifndef CALLBACK_TOSS_ME_HPP
#define CALLBACK_TOSS_ME_HPP
#include <benchmark/benchmark.h>
#include <stan/math.hpp>
#include <utility>
static bool needs_done = true;
// Just to fill up the stack allocator
template <int max_alloc>