This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stan/math/rev/core.hpp> | |
#include <test/unit/math/rev/mat/util.hpp> | |
#include <gtest/gtest.h> | |
#include <algorithm> | |
#include <sstream> | |
#include <tuple> | |
#include <vector> | |
#include <chrono> | |
namespace stan { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stan/math/rev/core.hpp> | |
#include <test/unit/math/rev/mat/util.hpp> | |
#include <gtest/gtest.h> | |
#include <algorithm> | |
#include <random> | |
#include <sstream> | |
#include <tuple> | |
namespace stan { | |
namespace math { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include "stan/math.hpp" | |
#include "stan/math/fwd/mat.hpp" | |
using namespace stan::math; | |
template<typename T1, typename T2> | |
std::vector<typename stan::return_type<T1, T2>::type > ode(const double& t, | |
const std::vector<T1>& u, | |
const std::vector<T2>& D, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for(int i = 0; i < y.size(); i++) { | |
if(i > 0) | |
y_var[i - 1].d_ = 0.0; | |
y_var[i].d_ = 1.0; | |
vector<fvar<double> > dy_dt_var = f_(t, y_var, thetavar, x_, x_int_, msgs_); | |
if(i == 0) { | |
for(int j = 0; j < y.size(); j++) { | |
dy_dt(j) = dy_dt_var[j].val(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Build with: clang++ -Wall -I . -isystem lib/eigen_3.3.3 -isystem lib/boost_1.64.0 -isystem lib/cvodes_2.9.0/include -std=c++1y -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -Wno-unused-function -Wno-uninitialized -DNO_FPRINTF_OUTPUT -pipe test2.cpp -O3 -o test2 lib/cvodes_2.9.0/lib/libsundials_nvecserial.a lib/cvodes_2.9.0/lib/libsundials_cvodes.a | |
#include <iostream> | |
#include "stan/math.hpp" | |
using namespace stan::math; | |
// This is a 1D diffusion PDE with a spatially varying diffusion coefficient. | |
// So if the domain is like this: | |
// x--o--x--o--x--o--x | |
// Then diffusion coefficients are defined at the xs and the state is at the o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#%% | |
import matplotlib.pyplot as plt | |
import pystan | |
import numpy | |
model_code = """ | |
data { | |
int<lower=1> N; | |
vector[N] y; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#%% | |
import matplotlib.pyplot as plt | |
import pystan | |
import numpy | |
model_code = """ | |
data { | |
int<lower=1> N; // Number of single samples | |
vector[N] t; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bbales2@frog:~/smath$ make test/unit/math/mix/mat/prob/categorical_test | |
make: Warning: Archive 'test/libgtest.a' seems to have been created in deterministic mode. 'test/gtest.o' will always be updated. Please consider passing the U flag to ar to avoid the problem. | |
ar rv test/libgtest.a test/gtest.o | |
r - test/gtest.o | |
make: Warning: Archive 'test/libgtest.a' seems to have been created in deterministic mode. 'test/gtest.o' will always be updated. Please consider passing the U flag to ar to avoid the problem. | |
g++ -I . -isystem lib/eigen_3.2.9 -isystem lib/boost_1.62.0 -isystemlib/cvodes_2.9.0/include -Wall -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -DNO_FPRINTF_OUTPUT -pipe -fPIC -c -O3 -DGTEST_USE_OWN_TR1_TUPLE -DGTEST_HAS_PTHREAD=0 -isystem lib/gtest_1.7.0/include -isystem lib/gtest_1.7.0 test/unit/math/mix/mat/prob/categorical_test.cpp -o test/unit/math/mix/mat/prob/categorical_test.o | |
In file included from ./stan/math/fwd/core.hpp:4:0, | |
from ./stan/math/mix/mat/fun/t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bbales2@frog:~/stan3$ make test/unit/mcmc/hmc/integrators/impl_leapfrog2 | |
make: Warning: Archive 'test/libgtest.a' seems to have been created in deterministic mode. 'test/gtest.o' will always be updated. Please consider passing the U flag to ar to avoid the problem. | |
ar rv test/libgtest.a test/gtest.o | |
r - test/gtest.o | |
make: Warning: Archive 'test/libgtest.a' seems to have been created in deterministic mode. 'test/gtest.o' will always be updated. Please consider passing the U flag to ar to avoid the problem. | |
g++ -I src -isystem lib/stan_math/lib/eigen_3.2.9 -isystem lib/stan_math/lib/boost_1.62.0 -isystem lib/stan_math/lib/cvodes_2.9.0/include -isystem lib/stan_math/ -Wall -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -DFUSION_MAX_VECTOR_SIZE=12 -DNO_FPRINTF_OUTPUT -pipe -c -O3 -DGTEST_USE_OWN_TR1_TUPLE -DGTEST_HAS_PTHREAD=0 -isystem lib/stan_math/lib/gtest_1.7.0/include -isystem lib/stan_math/lib/gtest_1.7.0 src/test/unit/mcmc/hmc/integrators/impl_leapfrog2_test.cpp -o test/unit/mcmc/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Adjusted version of stan-generated cpp code for the calculate_r() function | |
inline Eigen::Matrix<var, Eigen::Dynamic,1> calculate_r( | |
const Eigen::Matrix<var, Eigen::Dynamic,1>& lambda, | |
const std::vector<std::vector<int> >& lambda_select, | |
const Eigen::Matrix<double, Eigen::Dynamic,Eigen::Dynamic>& M, | |
const std::vector<std::vector<std::vector<int> > >& ht_select, | |
const std::vector<std::vector<std::vector<std::vector<int> > > >& ht_gmap, | |
const std::vector<std::vector<int> >& Ht, | |
const Eigen::Matrix<double, Eigen::Dynamic,Eigen::Dynamic>& Z, | |
const std::vector<int>& Z_type, |