mirror of
https://github.com/kalmarek/SmallHyperbolic
synced 2024-11-27 16:35:26 +01:00
julia formatter
This commit is contained in:
parent
d0d0d2ace4
commit
29244c5480
@ -1,25 +1,40 @@
|
|||||||
import Base.reim
|
import Base.reim
|
||||||
reim(x::Nemo.acb) = reim(convert(ComplexF64, x))
|
reim(x::Nemo.acb) = reim(convert(ComplexF64, x))
|
||||||
|
|
||||||
function root_of_unity(CC::AcbField, p, k=1)
|
function root_of_unity(CC::AcbField, p, k = 1)
|
||||||
@assert p > 0
|
@assert p > 0
|
||||||
res = zero(CC)
|
res = zero(CC)
|
||||||
ccall((:acb_unit_root, Nemo.libarb), Cvoid, (Ref{acb}, Culong, Clong), res, p, prec(CC))
|
ccall(
|
||||||
|
(:acb_unit_root, Nemo.libarb),
|
||||||
|
Cvoid,
|
||||||
|
(Ref{acb}, Culong, Clong),
|
||||||
|
res,
|
||||||
|
p,
|
||||||
|
prec(CC),
|
||||||
|
)
|
||||||
return res^k
|
return res^k
|
||||||
end
|
end
|
||||||
|
|
||||||
import Base.adjoint
|
import Base.adjoint
|
||||||
function Base.adjoint(m::acb_mat)
|
function Base.adjoint(m::acb_mat)
|
||||||
res = zero(m)
|
res = zero(m)
|
||||||
ccall((:acb_mat_conjugate_transpose, Nemo.libarb),
|
ccall(
|
||||||
Cvoid, (Ref{acb_mat}, Ref{acb_mat}), res, m)
|
(:acb_mat_conjugate_transpose, Nemo.libarb),
|
||||||
|
Cvoid,
|
||||||
|
(Ref{acb_mat}, Ref{acb_mat}),
|
||||||
|
res,
|
||||||
|
m,
|
||||||
|
)
|
||||||
return res
|
return res
|
||||||
end
|
end
|
||||||
|
|
||||||
using Random
|
using Random
|
||||||
import Base.rand
|
import Base.rand
|
||||||
|
|
||||||
rand(rng::AbstractRNG, rs::Random.SamplerTrivial{AcbField}) = (CC = rs[]; CC(rand(Float64), rand(Float64)))
|
rand(rng::AbstractRNG, rs::Random.SamplerTrivial{AcbField}) =
|
||||||
|
(CC = rs[]; CC(rand(Float64), rand(Float64)))
|
||||||
|
|
||||||
|
|
||||||
import Nemo.acb_struct
|
import Nemo.acb_struct
|
||||||
const libarb = Nemo.libarb
|
const libarb = Nemo.libarb
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user