@@ -573,35 +573,13 @@ mutable struct zzModPolyRingElem <: PolyRingElem{zzModRingElem}
573
573
return zzModPolyRingElem (n, mod (a, n) % UInt)
574
574
end
575
575
576
- function zzModPolyRingElem (n:: UInt , arr :: Vector{ZZRingElem} )
576
+ function zzModPolyRingElem (n:: UInt , a :: Vector{<:Union{Integer, ZZRingElem,zzModRingElem} } )
577
577
z = new ()
578
578
ccall ((:nmod_poly_init2 , libflint), Nothing,
579
- (Ref{zzModPolyRingElem}, UInt, Int), z, n, length (arr ))
579
+ (Ref{zzModPolyRingElem}, UInt, Int), z, n, length (a ))
580
580
finalizer (_nmod_poly_clear_fn, z)
581
- for i in 1 : length (arr)
582
- setcoeff! (z, i - 1 , arr[i])
583
- end
584
- return z
585
- end
586
-
587
- function zzModPolyRingElem (n:: UInt , arr:: Vector{UInt} )
588
- z = new ()
589
- ccall ((:nmod_poly_init2 , libflint), Nothing,
590
- (Ref{zzModPolyRingElem}, UInt, Int), z, n, length (arr))
591
- finalizer (_nmod_poly_clear_fn, z)
592
- for i in 1 : length (arr)
593
- setcoeff! (z, i - 1 , arr[i])
594
- end
595
- return z
596
- end
597
-
598
- function zzModPolyRingElem (n:: UInt , arr:: Vector{zzModRingElem} )
599
- z = new ()
600
- ccall ((:nmod_poly_init2 , libflint), Nothing,
601
- (Ref{zzModPolyRingElem}, UInt, Int), z, n, length (arr))
602
- finalizer (_nmod_poly_clear_fn, z)
603
- for i in 1 : length (arr)
604
- setcoeff! (z, i- 1 , arr[i]. data)
581
+ for i in 1 : length (a)
582
+ setcoeff! (z, i - 1 , a[i])
605
583
end
606
584
return z
607
585
end
@@ -700,18 +678,7 @@ mutable struct fpPolyRingElem <: PolyRingElem{fpFieldElem}
700
678
return fpPolyRingElem (n, mod (a, n) % UInt)
701
679
end
702
680
703
- function fpPolyRingElem (n:: UInt , arr:: Vector{ZZRingElem} )
704
- z = new ()
705
- ccall ((:nmod_poly_init2 , libflint), Nothing,
706
- (Ref{fpPolyRingElem}, UInt, Int), z, n, length (arr))
707
- finalizer (_gfp_poly_clear_fn, z)
708
- for i in 1 : length (arr)
709
- setcoeff! (z, i - 1 , arr[i])
710
- end
711
- return z
712
- end
713
-
714
- function fpPolyRingElem (n:: UInt , arr:: Vector{UInt} )
681
+ function fpPolyRingElem (n:: UInt , arr:: Vector{<:Union{Integer,ZZRingElem,fpFieldElem}} )
715
682
z = new ()
716
683
ccall ((:nmod_poly_init2 , libflint), Nothing,
717
684
(Ref{fpPolyRingElem}, UInt, Int), z, n, length (arr))
@@ -722,17 +689,6 @@ mutable struct fpPolyRingElem <: PolyRingElem{fpFieldElem}
722
689
return z
723
690
end
724
691
725
- function fpPolyRingElem (n:: UInt , arr:: Vector{fpFieldElem} )
726
- z = new ()
727
- ccall ((:nmod_poly_init2 , libflint), Nothing,
728
- (Ref{fpPolyRingElem}, UInt, Int), z, n, length (arr))
729
- finalizer (_gfp_poly_clear_fn, z)
730
- for i in 1 : length (arr)
731
- setcoeff! (z, i- 1 , arr[i]. data)
732
- end
733
- return z
734
- end
735
-
736
692
function fpPolyRingElem (n:: UInt , f:: ZZPolyRingElem )
737
693
z = new ()
738
694
ccall ((:nmod_poly_init2 , libflint), Nothing,
@@ -3282,43 +3238,12 @@ mutable struct fpRelPowerSeriesRingElem <: RelPowerSeriesRingElem{fpFieldElem}
3282
3238
return z
3283
3239
end
3284
3240
3285
- function fpRelPowerSeriesRingElem (p:: UInt , a:: Vector{ZZRingElem} , len:: Int , prec:: Int , val:: Int )
3286
- z = new ()
3287
- ccall ((:nmod_poly_init2 , libflint), Nothing,
3288
- (Ref{fpRelPowerSeriesRingElem}, UInt, Int), z, p, len)
3289
- for i = 1 : len
3290
- tt = ccall ((:fmpz_fdiv_ui , libflint), UInt,
3291
- (Ref{ZZRingElem}, UInt), a[i], p)
3292
- ccall ((:nmod_poly_set_coeff_ui , libflint), Nothing,
3293
- (Ref{fpRelPowerSeriesRingElem}, Int, UInt), z, i - 1 , tt)
3294
- end
3295
- z. prec = prec
3296
- z. val = val
3297
- finalizer (_gfp_rel_series_clear_fn, z)
3298
- return z
3299
- end
3300
-
3301
- function fpRelPowerSeriesRingElem (p:: UInt , a:: Vector{UInt} , len:: Int , prec:: Int , val:: Int )
3302
- z = new ()
3303
- ccall ((:nmod_poly_init2 , libflint), Nothing,
3304
- (Ref{fpRelPowerSeriesRingElem}, UInt, Int), z, p, len)
3305
- for i = 1 : len
3306
- ccall ((:nmod_poly_set_coeff_ui , libflint), Nothing,
3307
- (Ref{fpRelPowerSeriesRingElem}, Int, UInt), z, i - 1 , a[i])
3308
- end
3309
- z. prec = prec
3310
- z. val = val
3311
- finalizer (_gfp_rel_series_clear_fn, z)
3312
- return z
3313
- end
3314
-
3315
- function fpRelPowerSeriesRingElem (p:: UInt , a:: Vector{fpFieldElem} , len:: Int , prec:: Int , val:: Int )
3241
+ function fpRelPowerSeriesRingElem (p:: UInt , a:: Vector{<:Union{Integer,ZZRingElem,fpFieldElem}} , len:: Int , prec:: Int , val:: Int )
3316
3242
z = new ()
3317
3243
ccall ((:nmod_poly_init2 , libflint), Nothing,
3318
3244
(Ref{fpRelPowerSeriesRingElem}, UInt, Int), z, p, len)
3319
- for i = 1 : len
3320
- ccall ((:nmod_poly_set_coeff_ui , libflint), Nothing,
3321
- (Ref{fpRelPowerSeriesRingElem}, Int, UInt), z, i - 1 , data (a[i]))
3245
+ for i in 1 : len
3246
+ setcoeff! (z, i- 1 , a[i])
3322
3247
end
3323
3248
z. prec = prec
3324
3249
z. val = val
@@ -3383,42 +3308,12 @@ mutable struct zzModRelPowerSeriesRingElem <: RelPowerSeriesRingElem{zzModRingEl
3383
3308
return z
3384
3309
end
3385
3310
3386
- function zzModRelPowerSeriesRingElem (p:: UInt , a:: Vector{ZZRingElem} , len:: Int , prec:: Int , val:: Int )
3387
- z = new ()
3388
- ccall ((:nmod_poly_init2 , libflint), Nothing,
3389
- (Ref{zzModRelPowerSeriesRingElem}, UInt, Int), z, p, len)
3390
- for i = 1 : len
3391
- tt = ccall ((:fmpz_fdiv_ui , libflint), UInt, (Ref{ZZRingElem}, UInt), a[i], p)
3392
- ccall ((:nmod_poly_set_coeff_ui , libflint), Nothing,
3393
- (Ref{zzModRelPowerSeriesRingElem}, Int, UInt), z, i - 1 , tt)
3394
- end
3395
- z. prec = prec
3396
- z. val = val
3397
- finalizer (_nmod_rel_series_clear_fn, z)
3398
- return z
3399
- end
3400
-
3401
- function zzModRelPowerSeriesRingElem (p:: UInt , a:: Vector{UInt} , len:: Int , prec:: Int , val:: Int )
3311
+ function zzModRelPowerSeriesRingElem (p:: UInt , a:: Vector{<:Union{Integer,ZZRingElem,zzModRingElem}} , len:: Int , prec:: Int , val:: Int )
3402
3312
z = new ()
3403
3313
ccall ((:nmod_poly_init2 , libflint), Nothing,
3404
3314
(Ref{zzModRelPowerSeriesRingElem}, UInt, Int), z, p, len)
3405
- for i = 1 : len
3406
- ccall ((:nmod_poly_set_coeff_ui , libflint), Nothing,
3407
- (Ref{zzModRelPowerSeriesRingElem}, Int, UInt), z, i - 1 , a[i])
3408
- end
3409
- z. prec = prec
3410
- z. val = val
3411
- finalizer (_nmod_rel_series_clear_fn, z)
3412
- return z
3413
- end
3414
-
3415
- function zzModRelPowerSeriesRingElem (p:: UInt , a:: Vector{zzModRingElem} , len:: Int , prec:: Int , val:: Int )
3416
- z = new ()
3417
- ccall ((:nmod_poly_init2 , libflint), Nothing,
3418
- (Ref{zzModRelPowerSeriesRingElem}, UInt, Int), z, p, len)
3419
- for i = 1 : len
3420
- ccall ((:nmod_poly_set_coeff_ui , libflint), Nothing,
3421
- (Ref{zzModRelPowerSeriesRingElem}, Int, UInt), z, i - 1 , data (a[i]))
3315
+ for i in 1 : len
3316
+ setcoeff! (z, i- 1 , a[i])
3422
3317
end
3423
3318
z. prec = prec
3424
3319
z. val = val
@@ -3822,40 +3717,12 @@ mutable struct zzModAbsPowerSeriesRingElem <: AbsPowerSeriesRingElem{zzModRingEl
3822
3717
return z
3823
3718
end
3824
3719
3825
- function zzModAbsPowerSeriesRingElem (n:: UInt , arr:: Vector{ZZRingElem} , len:: Int , prec:: Int )
3826
- z = new ()
3827
- ccall ((:nmod_poly_init2 , libflint), Nothing,
3828
- (Ref{zzModAbsPowerSeriesRingElem}, UInt, Int), z, n, length (arr))
3829
- for i in 1 : len
3830
- tt = ccall ((:fmpz_fdiv_ui , libflint), UInt, (Ref{ZZRingElem}, UInt), arr[i], n)
3831
- ccall ((:nmod_poly_set_coeff_ui , libflint), Nothing,
3832
- (Ref{zzModAbsPowerSeriesRingElem}, Int, UInt), z, i - 1 , tt)
3833
- end
3834
- z. prec = prec
3835
- finalizer (_nmod_abs_series_clear_fn, z)
3836
- return z
3837
- end
3838
-
3839
- function zzModAbsPowerSeriesRingElem (n:: UInt , arr:: Vector{UInt} , len:: Int , prec:: Int )
3840
- z = new ()
3841
- ccall ((:nmod_poly_init2 , libflint), Nothing,
3842
- (Ref{zzModAbsPowerSeriesRingElem}, UInt, Int), z, n, length (arr))
3843
- for i in 1 : len
3844
- ccall ((:nmod_poly_set_coeff_ui , libflint), Nothing,
3845
- (Ref{zzModAbsPowerSeriesRingElem}, Int, UInt), z, i - 1 , arr[i])
3846
- end
3847
- z. prec = prec
3848
- finalizer (_nmod_abs_series_clear_fn, z)
3849
- return z
3850
- end
3851
-
3852
- function zzModAbsPowerSeriesRingElem (n:: UInt , arr:: Vector{zzModRingElem} , len:: Int , prec:: Int )
3720
+ function zzModAbsPowerSeriesRingElem (n:: UInt , a:: Vector{<:Union{Integer,ZZRingElem,zzModRingElem}} , len:: Int , prec:: Int )
3853
3721
z = new ()
3854
3722
ccall ((:nmod_poly_init2 , libflint), Nothing,
3855
- (Ref{zzModAbsPowerSeriesRingElem}, UInt, Int), z, n, length (arr ))
3723
+ (Ref{zzModAbsPowerSeriesRingElem}, UInt, Int), z, n, length (a ))
3856
3724
for i in 1 : len
3857
- ccall ((:nmod_poly_set_coeff_ui , libflint), Nothing,
3858
- (Ref{zzModAbsPowerSeriesRingElem}, Int, UInt), z, i- 1 , arr[i]. data)
3725
+ setcoeff! (z, i- 1 , a[i])
3859
3726
end
3860
3727
z. prec = prec
3861
3728
finalizer (_nmod_abs_series_clear_fn, z)
@@ -3923,40 +3790,12 @@ mutable struct fpAbsPowerSeriesRingElem <: AbsPowerSeriesRingElem{fpFieldElem}
3923
3790
return z
3924
3791
end
3925
3792
3926
- function fpAbsPowerSeriesRingElem (n:: UInt , arr:: Vector{ZZRingElem} , len:: Int , prec:: Int )
3927
- z = new ()
3928
- ccall ((:nmod_poly_init2 , libflint), Nothing,
3929
- (Ref{fpAbsPowerSeriesRingElem}, UInt, Int), z, n, length (arr))
3930
- for i in 1 : len
3931
- tt = ccall ((:fmpz_fdiv_ui , libflint), UInt, (Ref{ZZRingElem}, UInt), arr[i], n)
3932
- ccall ((:nmod_poly_set_coeff_ui , libflint), Nothing,
3933
- (Ref{fpAbsPowerSeriesRingElem}, Int, UInt), z, i - 1 , tt)
3934
- end
3935
- z. prec = prec
3936
- finalizer (_gfp_abs_series_clear_fn, z)
3937
- return z
3938
- end
3939
-
3940
- function fpAbsPowerSeriesRingElem (n:: UInt , arr:: Vector{UInt} , len:: Int , prec:: Int )
3941
- z = new ()
3942
- ccall ((:nmod_poly_init2 , libflint), Nothing,
3943
- (Ref{fpAbsPowerSeriesRingElem}, UInt, Int), z, n, length (arr))
3944
- for i in 1 : len
3945
- ccall ((:nmod_poly_series_set_coeff_ui , libflint), Nothing,
3946
- (Ref{fpAbsPowerSeriesRingElem}, Int, UInt), z, i - 1 , arr[i])
3947
- end
3948
- z. prec = prec
3949
- finalizer (_gfp_abs_series_clear_fn, z)
3950
- return z
3951
- end
3952
-
3953
- function fpAbsPowerSeriesRingElem (n:: UInt , arr:: Vector{fpFieldElem} , len:: Int , prec:: Int )
3793
+ function fpAbsPowerSeriesRingElem (n:: UInt , a:: Vector{<:Union{Integer,ZZRingElem,fpFieldElem}} , len:: Int , prec:: Int )
3954
3794
z = new ()
3955
3795
ccall ((:nmod_poly_init2 , libflint), Nothing,
3956
- (Ref{fpAbsPowerSeriesRingElem}, UInt, Int), z, n, length (arr ))
3796
+ (Ref{fpAbsPowerSeriesRingElem}, UInt, Int), z, n, length (a ))
3957
3797
for i in 1 : len
3958
- ccall ((:nmod_poly_set_coeff_ui , libflint), Nothing,
3959
- (Ref{fpAbsPowerSeriesRingElem}, Int, UInt), z, i- 1 , arr[i]. data)
3798
+ setcoeff! (z, i- 1 , a[i])
3960
3799
end
3961
3800
z. prec = prec
3962
3801
finalizer (_gfp_abs_series_clear_fn, z)
0 commit comments