.ModelicaReference.Operators.'product()'

Information

Returns the scalar product

Syntax

product(A)
product(e(i, ..., j) for i in u, ..., j in v)

Description

The first form returns the scalar product of all the elements of array expression A:
A[1,...,1]*A[2,...,1]*....*A[end,...,1]*A[end,...,end]

The second form is a reduction expression and returns the product of the expression e(i, ..., j) evaluated for all combinations of i in u, ..., j in v:

e(u[1],...,v[1]) * e(u[2],...,v[1]) * ... *
e(u[end],...,v[1]) * ... * e(u[end],...,v[end])

The type of product(e(i, ..., j) for i in u, ..., j in v) is the same as the type of e(i,...j).

Examples

{product(j for j in 1:i) for i in 0:4} // = {1,1,2,6,24}

Generated at 2020-06-05T07:38:22Z by OpenModelica 1.16.0~dev-420-gc007a39