We all agree that x*x should not be the dot product.
The question remains whether we can think of v'w and v'*w as the dot product --
I really really like this working that way.
@JeffBezanson and I were chatting
A proposal is the following:
v' is an error for vectors (This is what mathematica does)
v'w and v'*w is a dot product (result = scalar)
v*w is an outer product matrix (result = matrix)
There is no distinction between rows and column vectors. I liked this anyway
and was happy to see mathematica's precedent
From mathematica: http://reference.wolfram.com/mathematica/tutorial/VectorsAndMatrices.html
Because of the way Mathematica uses lists to represent vectors and matrices, you never have to distinguish between "row" and "column" vectors
Users have to be aware that there are no row vectors .... period.
Thus if M is a matrix
M[1,:]*v is an error ..... (assuming we go with M[1,:] is a scalar
The warning could suggest trying dot or '* or M[i:i,:]
M[[1],:]*v or M[1:1,:]*v is a vector of length 1 (This is julia's current behavior anyway)
Regarding the closely related issue in https://groups.google.com/forum/#!topic/julia-users/L3vPeZ7kews
Mathematica compresses scalar-like array sections:
m = Array[a, {2, 2, 2}]
Out[49]= {{{a[1, 1, 1], a[1, 1, 2]}, {a[1, 2, 1],
a[1, 2, 2]}}, {{a[2, 1, 1], a[2, 1, 2]}, {a[2, 2, 1], a[2, 2, 2]}}}
In[123]:= Dimensions[m]
Dimensions[m[[All, 1, All]]]
Dimensions[m[[2, 1, All]]]
Dimensions[m[[2, 1 ;; 1, All]]]
Out[123]= {2, 2, 2}
Out[124]= {2, 2}
Out[125]= {2}
Out[126]= {1, 2}
[Edit: code formatting – @StefanKarpinski]