I keep running into situations, where I want to assign values to an array or vector in a convenient short-hand way. I somehow do not seem to find any description on how this can be done (if it is possible). There are at least two variants of this question.

For example, is there a more elegant way of assigning the following (the last line is only there to illustrate why I might do this)?

int tmpindx[4];

tmpindx[1] = 1;

tmpindx[2] = 2;

tmpindx[3] = 4;

tmpindx[4] = 5;

logp[3] = log1m_exp(log_sum_exp(logp[tmpindx]));

E.g. is there some syntax like

tmpindx = (1, 2, 4, 5);

?

I realized that I also keep running into situations, where I want to specify array or vector or matrix constants such as in:

Lambda ~ multi_normal_cholesky( (0 0 0), (1 0 0, 0 1 0, 0 0 1) );

or the like, where some kind of syntax that does not force me to first define a vector and a matrix in the transformed data block.