Make weights optional (for HO basis)
This commit is contained in:
parent
4efd967589
commit
bed8619d9d
|
|
@ -51,7 +51,7 @@ end
|
||||||
|
|
||||||
"In-place c-orthogonalization via (modified) Gram-Schmidt. Only significant vectors are returned (c-normalized).
|
"In-place c-orthogonalization via (modified) Gram-Schmidt. Only significant vectors are returned (c-normalized).
|
||||||
The number of significant vectors to return are determined by the original singular values (compared to the threshold) "
|
The number of significant vectors to return are determined by the original singular values (compared to the threshold) "
|
||||||
function gram_schmidt!(vecs, ws, threshold=1e-5; verbose=false)
|
function gram_schmidt!(vecs, ws=ones(length(vecs[1])), threshold=1e-5; verbose=false)
|
||||||
c_product(i, j) = sum(vecs[i] .* ws .* vecs[j])
|
c_product(i, j) = sum(vecs[i] .* ws .* vecs[j])
|
||||||
norm(i) = c_product(i, i)
|
norm(i) = c_product(i, i)
|
||||||
proj(i, j) = (c_product(i, j) / norm(i)) .* vecs[i] # component of vec[i] in vec[j]
|
proj(i, j) = (c_product(i, j) / norm(i)) .* vecs[i] # component of vec[i] in vec[j]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue