I used the statement
phiReal = ( (C == 1)? m : (1 - m)) ;
where phiReal, C and m are all vector[N], and the compiler failed. Doesn’t the ternary operator recognize vector form?
Along the same line
for (k in 1:K){
m[k] = expTerm[k] / (1 + expTerm[k]);
} works
m = expTerm / (1 + expTerm); fails