epinowcast
Loading...
Searching...
No Matches
utils.stan
Go to the documentation of this file.
1
26real log_dot_product(vector x, vector y) {
27 return(log_sum_exp(x + y));
28}
29
44int 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}
int num_nonzero(matrix x)
Definition utils.stan:44
real log_dot_product(vector x, vector y)
Definition utils.stan:26