I recently had some hard time to find a function, **rows_dot_product**, to do a component wise product of two vectors:

A[ k ]=B[ k ]*C[ k ], k=1,…,N

and still do not know if a specialized function exists for:

A[ k ]=B[ k ]*B[ k ], k=1,…,N

Maybe I have missed something in the doc, but as a suggestion for future Stan language extensions I wanted to suggest a syntax like:

cwise_product(vector,vector)

cwise_product(matrix,matrix)

cwise_addition(vector,vector)

…

and, if useful, things like:

cwise_inverse(vector)

cwise_inverse(matrix)

…

IMHO this syntax (compared to a loop or row_dot_product)

- can be easier to learn and remember
- can be easily vectorized.

Vincent