mirror of
https://github.com/kalmarek/SmallHyperbolic
synced 2024-11-23 23:40:28 +01:00
julia formatter
This commit is contained in:
parent
d0d0d2ace4
commit
29244c5480
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user