Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change a+im*b to complex(a,b) #840

Merged
merged 4 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions examples/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,19 @@ SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
SuiteSparse = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9"
SumOfSquares = "4b9e565b-77fc-50a5-a571-1244f986bda1"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
CSV = "0.10"
Combinatorics = "1"
DataFrames = "1.6"
DataStructures = "0.18"
DelimitedFiles = "1.9"
Distributions = "0.25"
DynamicPolynomials = "0.5"
JuMP = "1.22"
MathOptInterface = "1"
PolyJuMP = "0.7"
SemialgebraicSets = "0.3"
SpecialFunctions = "2"
SumOfSquares = "0.7"
julia = "1.6"
4 changes: 2 additions & 2 deletions src/Cones/arrayutilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function vec_copyto!(
@assert length(rvec) == 2 * length(cvec)
k = 1
@inbounds for i in eachindex(cvec)
cvec[i] = Complex(rvec[k], rvec[k + 1])
cvec[i] = complex(rvec[k], rvec[k + 1])
k += 2
end
return cvec
Expand Down Expand Up @@ -272,7 +272,7 @@ function _svec_to_smat_complex!(mat, vec, rt2)
mat[i, j] = vec[k]
k += 1
else
mat[i, j] = (vec[k] - im * vec[k + 1]) / rt2
mat[i, j] = complex(vec[k], -vec[k + 1]) / rt2
k += 2
end
end
Expand Down
Loading