Skip to content

Commit

Permalink
fix typo in performance tips (thanks to Comer Duncan on the mailing l…
Browse files Browse the repository at this point in the history
…ist)
  • Loading branch information
stevengj committed Jul 17, 2014
1 parent a327b47 commit c4547e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/manual/performance-tips.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ written as multiple definitions::

function norm(A)
if isa(A, Vector)
return sqrt(real(dot(x,x)))
return sqrt(real(dot(A,A)))
elseif isa(A, Matrix)
return max(svd(A)[2])
else
Expand All @@ -144,7 +144,7 @@ written as multiple definitions::

This can be written more concisely and efficiently as::

norm(A::Vector) = sqrt(real(dot(x,x)))
norm(x::Vector) = sqrt(real(dot(x,x)))
norm(A::Matrix) = max(svd(A)[2])

Write "type-stable" functions
Expand Down

0 comments on commit c4547e6

Please sign in to comment.