epinowcast
Loading...
Searching...
No Matches
utils.stan
Go to the documentation of this file.
1
26
real
log_dot_product
(vector x, vector y) {
27
return
(log_sum_exp(x + y));
28
}
29
44
int
num_nonzero
(matrix x) {
45
int
i = rows(x);
46
int
j = cols(x);
47
int
n = 0;
48
for
(k in 1:i) {
49
for
(l in 1:j) {
50
if
(x[k, l] != 0) {
51
n = n + 1;
52
}
53
}
54
}
55
return
(n);
56
}
num_nonzero
int num_nonzero(matrix x)
Definition
utils.stan:44
log_dot_product
real log_dot_product(vector x, vector y)
Definition
utils.stan:26
functions
utils.stan
Generated by
1.9.8