Tag Info

Hot answers tagged

7

Avoiding exact calculation by using approximated numerical value before calculation speeds things up. I'm also calculating only the first Eigenvectors as pointed pot by @Öskå. Now it takes only 15 milliseconds time AbsoluteTiming[Chop@Eigenvectors[N[m], 1, Quartics -> True]] {0.015600, {{-0.0725514, -0.106358, -0.0986766, -0.110735 [...] }}}


2

I would approach this specific straightforward example in a straightforward way. Eliminate your matrix using RowReduce[mm]; red=RowReduce[mm]]; red//MatrixForm $\begin{pmatrix} 1 & 0.&0.&0.&0.&0.&0.&0.&0.&0.&\\ 0 & 1 &0.&0.&0.&0.&0.&0.&0.&0.&\\ 0 & 0 &1 ...


1

The following gets the first two steps: m = {{1, 2}, {0, 2}, {3, 2}, {0, 2}, {0, 2}, {0, 2}, {4, 2}}; v = 1 - Unitize[m[[All, 1]]] (*{0,1,0,1,1,1,0} *) vv = Flatten@(Accumulate /@ Split@v) (* {0,1,0,1,2,3,0} *) Update: ... the last step ClearAll[ff]; ff[0] = 1; ff[n_] := Piecewise[{{ff[n-1] m[[n, 2]], vv[[n]] > 1}, {m[[n, 2]], vv[[n]] == 1}}, m[[n, ...



Only top voted, non community-wiki answers of a minimum length are eligible