Timing things

The Mathematica command is Timing.  Here are some times for Mathematica doing svd's.  Warning you can easily make a run take longre than you think!  The log log plot is because you expect the behavior to be a power function!  Small problems will be dominated by noise and if the problem is big enough memory effects will ruin the straight line.

Data=Table[
m=Floor[(2^p)];
A= RandomReal[{-1,1},{m,m}];
{m, Timing[SingularValueList[A];][[1]]},
{p,6,11,0.5}
]
ListLogLogPlot[Data,
Frame->True,
GridLines->Automatic,
FrameLabel->{"m","sec"}]
ListPlot[Log[Data]]

It looks like a straight line.  The line is roughly.

Fit[Log[Data],{1,x},x]

This means that as a function of m the time is roughly (E^(-16.9))(m^2.67)=4.5753387694458114`*^-8 (m^2.67) Seconds.  The power is most important.

Data=Table[
m=Floor[(2^p)];
A= RandomReal[{-1,1},{m,m}];
{m, ByteCount[A]},
{p,6, 11,0.2}] ;
ListLogLogPlot[Data]
Fit[Log[Data],{1,t},t]

This means that an mxm matrix occupies 8*(m^2) bytes. Again the power is most important but the 8 has meaning here.

Projections and Rotations

q=RandomReal[{-1,1},3];
q=q/Norm[q]
Proj[p_,q_]:= p - (p.q) q;

v0={0.7,0.2, 0.3};
Graphics3D[{
Point[{0,0,0}],
Polygon[{
{0,0,0},
Proj[{1,1,1},q],
Proj[{-1,-1,1},q]
}],
{Opacity[0.3],Sphere[{0,0,0},1]},
Arrow[{{0,0,0},q}]
},
BoxRatios->Automatic,
Axes->True,
SphericalRegion->True,
AxesLabel->{"(Subscript[x, 1])","(Subscript[x, 2])","(Subscript[x, 3])"}
]

Pass by Reference vs Value

x={1,2,3};
y=F[x];
{x,y}

I was asked how to do pass by reference in Mathematica!

Clear[F]
SetAttributes[F, HoldFirst];
F[x_]:=x[[1]]=x[[1]]+1
x={1,2,3};
y=F[x];
{x,y}