# MSD allCalcCompile

Apr 17th, 2016
60
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. allCalcCompile = Compile[
2. {{data, _Real, 2}, {dn, _Integer, 0}},
3. Module[{diff, x2, y2, x2m, y2m, x2s, y2s, disp, std},
4. diff = (Differences[data, 1, dn]^2);
5. {x2, y2} = Transpose@diff;
6. {{x2m, x2s}, {y2m,
7. y2s}} = {Mean[#], StandardDeviation[#]} & /@ {x2, y2};
8. std = StandardDeviation[x2 + y2];
9. disp = x2m + y2m;
10. {disp, std, x2m, x2s, y2m, y2s}];
11. , RuntimeOptions -> "Speed"
12. ];
13.
14.
15. {t, newCompile} =
16. AbsoluteTiming[
17. Transpose@
18. Table[allCalcCompile[data, dn], {dn, 1, Length@data - 2}]];
19.
20. Transpose::nmtx: The first two levels of {Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,Null,<<2674>>} cannot be transposed. >>
RAW Paste Data