1
0
mirror of https://github.com/kalmarek/SmallHyperbolic synced 2024-11-12 20:55:29 +01:00

julia formatter

This commit is contained in:
kalmarek 2020-05-15 01:15:24 +02:00
parent d0d0d2ace4
commit 29244c5480
No known key found for this signature in database
GPG Key ID: 8BF1A3855328FC15

View File

@ -1,25 +1,40 @@
import Base.reim
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
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
end
import Base.adjoint
function Base.adjoint(m::acb_mat)
res = zero(m)
ccall((:acb_mat_conjugate_transpose, Nemo.libarb),
Cvoid, (Ref{acb_mat}, Ref{acb_mat}), res, m)
ccall(
(:acb_mat_conjugate_transpose, Nemo.libarb),
Cvoid,
(Ref{acb_mat}, Ref{acb_mat}),
res,
m,
)
return res
end
using Random
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
const libarb = Nemo.libarb