Engine prototype #13
@ -254,6 +254,11 @@ end
|
|||||||
LinearAlgebra.eigen!(A::Symmetric{BigFloat, Matrix{BigFloat}}; sortby::Nothing) =
|
LinearAlgebra.eigen!(A::Symmetric{BigFloat, Matrix{BigFloat}}; sortby::Nothing) =
|
||||||
eigen!(Hermitian(A))
|
eigen!(Hermitian(A))
|
||||||
|
|
||||||
|
function convertnz(type, mat)
|
||||||
|
J, K, values = findnz(mat)
|
||||||
|
sparse(J, K, type.(values))
|
||||||
|
end
|
||||||
|
|
||||||
function realize_gram_optim(
|
function realize_gram_optim(
|
||||||
gram::SparseMatrixCSC{T, <:Any},
|
gram::SparseMatrixCSC{T, <:Any},
|
||||||
guess::Matrix{T}
|
guess::Matrix{T}
|
||||||
|
@ -86,7 +86,7 @@ L, history = Engine.realize_gram_gradient(gram, guess, scaled_tol = 0.01)
|
|||||||
L_pol, history_pol = Engine.realize_gram_newton(gram, L, rate = 0.3, scaled_tol = 1e-9)
|
L_pol, history_pol = Engine.realize_gram_newton(gram, L, rate = 0.3, scaled_tol = 1e-9)
|
||||||
L_pol2, history_pol2 = Engine.realize_gram_newton(gram, L_pol)
|
L_pol2, history_pol2 = Engine.realize_gram_newton(gram, L_pol)
|
||||||
=#
|
=#
|
||||||
L, success, history = Engine.realize_gram(Float64.(gram), Float64.(guess))
|
L, success, history = Engine.realize_gram(Engine.convertnz(Float64, gram), Float64.(guess))
|
||||||
completed_gram = L'*Engine.Q*L
|
completed_gram = L'*Engine.Q*L
|
||||||
println("Completed Gram matrix:\n")
|
println("Completed Gram matrix:\n")
|
||||||
display(completed_gram)
|
display(completed_gram)
|
||||||
|
Loading…
Reference in New Issue
Block a user