Skip to content

Instantly share code, notes, and snippets.

@davidavdav
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidavdav/e04f7f34b78c22dbe1cc to your computer and use it in GitHub Desktop.
Save davidavdav/e04f7f34b78c22dbe1cc to your computer and use it in GitHub Desktop.
## make matrix symmetric by copying the upper triangle into the lower
## this should exist somewhere...
function symm!(m::Matrix)
for i=1:size(m,1)
for j=i+1:size(m,2)
m[j,i] = m[i,j]
end
end
m
end
## y = x[i,:]'
function rvec!(y::Array, x::Matrix, i::Int)
for j=1:size(x,2)
y[j] = x[i,j]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment