# Matrix manipulation instead of loops

I have the following matrix form $[J]$:

$$\begin{bmatrix} \{ v[3],p + v[2]\}\\ \{v[3], p + v[2], 2 p + v[1]\} \\ \{v[3], p + v[2],2 p + v[1], 3 p + v[0]\}\\ \{v[3], p + v[2],2 p + v[1], 3 p + v[0]\} \\ \vdots \end{bmatrix}$$

I need to operate the list of each row by Max and Integrate and then add them all together like this:

$H=\int\limits_{0}^{\infty} \max \{ v[3],p + v[2]\}dF(p)+\int\limits_{0}^{\infty} \max \{v[3], p + v[2], 2 p + v[1]\}dF(p)+\dots$

I would like to use matrix operations to do it instead of loops, but I can't find a way to make it work.

Any help is appreciated. Thanks

• Do you know each v[i] values; Total[Integrate[Max[#], {p, 0, Infinity}] & /@ J] ? – Okkes Dulgerci Mar 25 '18 at 16:25
• all except the last one, from H I will solve the last value v[3] – Rodrigo Mar 25 '18 at 16:29
• I see. Can you post actual vector values if it is not too long. What is the length of J? – Okkes Dulgerci Mar 25 '18 at 16:34
• I couldn't by pass the code formatting thing here is a link with a picture of J with n=10, at some point I would want to go for n=100 Matrix – Rodrigo Mar 25 '18 at 16:51

Total[Integrate[Max[#], {p, 0, Infinity}] & /@ J]