<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; x = [1,2]
2-element Array{Int64,1}:
 1
 2

julia&gt; A = [1 2; 3 4]
2x2 Array{Int64,2}:
 1  2
 3  4

julia&gt; x * A
ERROR: DimensionMismatch(&quot;*&quot;)
 in generic_matmatmul! at linalg/matmul.jl:369
 in * at linalg/matmul.jl:76

julia&gt; A * x
2-element Array{Int64,1}:
  5
 11"><pre class="notranslate">julia<span class="pl-k">&gt;</span> x <span class="pl-k">=</span> [<span class="pl-c1">1</span>,<span class="pl-c1">2</span>]
<span class="pl-c1">2</span><span class="pl-k">-</span>element Array{Int64,<span class="pl-c1">1</span>}<span class="pl-k">:</span>
 <span class="pl-c1">1</span>
 <span class="pl-c1">2</span>

julia<span class="pl-k">&gt;</span> A <span class="pl-k">=</span> [<span class="pl-c1">1</span> <span class="pl-c1">2</span>; <span class="pl-c1">3</span> <span class="pl-c1">4</span>]
<span class="pl-c1">2</span>x2 Array{Int64,<span class="pl-c1">2</span>}<span class="pl-k">:</span>
 <span class="pl-c1">1</span>  <span class="pl-c1">2</span>
 <span class="pl-c1">3</span>  <span class="pl-c1">4</span>

julia<span class="pl-k">&gt;</span> x <span class="pl-k">*</span> A
ERROR<span class="pl-k">:</span> <span class="pl-c1">DimensionMismatch</span>(<span class="pl-s"><span class="pl-pds">"</span>*<span class="pl-pds">"</span></span>)
 <span class="pl-k">in</span> generic_matmatmul! at linalg<span class="pl-k">/</span>matmul<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">369</span>
 <span class="pl-k">in</span> <span class="pl-k">*</span> at linalg<span class="pl-k">/</span>matmul<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">76</span>

julia<span class="pl-k">&gt;</span> A <span class="pl-k">*</span> x
<span class="pl-c1">2</span><span class="pl-k">-</span>element Array{Int64,<span class="pl-c1">1</span>}<span class="pl-k">:</span>
  <span class="pl-c1">5</span>
 <span class="pl-c1">11</span></pre></div>
<p dir="auto">The fix is trivial: at <code class="notranslate">linalg/matmul.jl:76</code>, put the 1 first:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia&gt; (*)(A::AbstractVector, B::AbstractMatrix) = reshape(A,1,length(A))*B
Warning: Method definition *(AbstractArray{T,1},AbstractArray{T,2}) in module LinAlg at linalg/matmul.jl:76 overwritten in module Main at none:1.
* (generic function with 143 methods)

julia&gt; x * A
1x2 Array{Int64,2}:
 7  10"><pre class="notranslate"><code class="notranslate">julia&gt; (*)(A::AbstractVector, B::AbstractMatrix) = reshape(A,1,length(A))*B
Warning: Method definition *(AbstractArray{T,1},AbstractArray{T,2}) in module LinAlg at linalg/matmul.jl:76 overwritten in module Main at none:1.
* (generic function with 143 methods)

julia&gt; x * A
1x2 Array{Int64,2}:
 7  10
</code></pre></div>
<p dir="auto">from <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/alanedelman/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/alanedelman">@alanedelman</a>:</p>
<p dir="auto">We really should think carefully about how the transpose of a vector should dispatch the various <code class="notranslate">A_*op*_B*</code> methods. It must be possible to avoid new types and ugly mathematics. For example, vector'vector yielding a vector (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="11667552" data-permission-text="Title is private" data-url="https://github.com/JuliaLang/julia/issues/2472" data-hovercard-type="issue" data-hovercard-url="/JuliaLang/julia/issues/2472/hovercard" href="https://github.com/JuliaLang/julia/issues/2472">#2472</a>, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="13646612" data-permission-text="Title is private" data-url="https://github.com/JuliaLang/julia/issues/2936" data-hovercard-type="issue" data-hovercard-url="/JuliaLang/julia/issues/2936/hovercard" href="https://github.com/JuliaLang/julia/issues/2936">#2936</a>), vector' yielding a matrix, and vector'' yielding a matrix (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="12457205" data-permission-text="Title is private" data-url="https://github.com/JuliaLang/julia/issues/2686" data-hovercard-type="issue" data-hovercard-url="/JuliaLang/julia/issues/2686/hovercard" href="https://github.com/JuliaLang/julia/issues/2686">#2686</a>) are all bad mathematics.</p>
<p dir="auto">What works for me mathematically (which avoids introducing a new type) is that for a 1-dimensional <code class="notranslate">Vector</code> <code class="notranslate">v</code>:</p>
<ul dir="auto">
<li><code class="notranslate">v'</code> is a no-op (i.e. just returns <code class="notranslate">v</code>),</li>
<li><code class="notranslate">v'v</code> or <code class="notranslate">v'*v</code> is a scalar,</li>
<li><code class="notranslate">v*v'</code> is a matrix, and</li>
<li><code class="notranslate">v'A</code> or <code class="notranslate">v'*A</code> (where <code class="notranslate">A</code> is an <code class="notranslate">AbstractMatrix</code>) is a vector</li>
</ul>
<p dir="auto">A general <em>N</em>-dimensional transpose reverses the order of indices. A vector, having one index, should be invariant under transposition.</p>
<p dir="auto">In practice <code class="notranslate">v'</code> is rarely used in isolation, and is usually encountered in matrix-vector products and matrix-matrix products. A common example would be to construct bilinear forms <code class="notranslate">v'A*w</code> and quadratic forms <code class="notranslate">v'A*v</code> which are used in conjugate gradients, Rayleigh quotients, etc.</p>
<p dir="auto">The only reason to introduce a new <code class="notranslate">Transpose{Vector}</code> type would be to represent the difference between contravariant and covariant vectors, and I don't find this compelling enough.</p>