use crate::deps::*;
use crate::d_mat::*;
use crate::flint::*;
use crate::fmpz_types::*;
use crate::gr_types::*;
#[repr(C)]
pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
impl<T> __BindgenUnionField<T> {
#[inline]
pub const fn new() -> Self {
__BindgenUnionField(::std::marker::PhantomData)
}
#[inline]
pub unsafe fn as_ref(&self) -> &T {
::std::mem::transmute(self)
}
#[inline]
pub unsafe fn as_mut(&mut self) -> &mut T {
::std::mem::transmute(self)
}
}
impl<T> ::std::default::Default for __BindgenUnionField<T> {
#[inline]
fn default() -> Self {
Self::new()
}
}
impl<T> ::std::clone::Clone for __BindgenUnionField<T> {
#[inline]
fn clone(&self) -> Self {
*self
}
}
impl<T> ::std::marker::Copy for __BindgenUnionField<T> {}
impl<T> ::std::fmt::Debug for __BindgenUnionField<T> {
fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
fmt.write_str("__BindgenUnionField")
}
}
impl<T> ::std::hash::Hash for __BindgenUnionField<T> {
fn hash<H: ::std::hash::Hasher>(&self, _state: &mut H) {}
}
impl<T> ::std::cmp::PartialEq for __BindgenUnionField<T> {
fn eq(&self, _other: &__BindgenUnionField<T>) -> bool {
true
}
}
impl<T> ::std::cmp::Eq for __BindgenUnionField<T> {}
pub const CPU_SIZE_1: u32 = 53;
pub const SIZE_RED_FAILURE_THRESH: u32 = 5;
pub const rep_type_GRAM: rep_type = 0;
pub const rep_type_Z_BASIS: rep_type = 1;
pub type rep_type = libc::c_uint;
pub const gram_type_APPROX: gram_type = 0;
pub const gram_type_EXACT: gram_type = 1;
pub type gram_type = libc::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct fmpz_lll_struct {
pub delta: f64,
pub eta: f64,
pub rt: rep_type,
pub gt: gram_type,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of fmpz_lll_struct"][::std::mem::size_of::<fmpz_lll_struct>() - 24usize];
["Alignment of fmpz_lll_struct"][::std::mem::align_of::<fmpz_lll_struct>() - 8usize];
["Offset of field: fmpz_lll_struct::delta"]
[::std::mem::offset_of!(fmpz_lll_struct, delta) - 0usize];
["Offset of field: fmpz_lll_struct::eta"]
[::std::mem::offset_of!(fmpz_lll_struct, eta) - 8usize];
["Offset of field: fmpz_lll_struct::rt"][::std::mem::offset_of!(fmpz_lll_struct, rt) - 16usize];
["Offset of field: fmpz_lll_struct::gt"][::std::mem::offset_of!(fmpz_lll_struct, gt) - 20usize];
};
impl Default for fmpz_lll_struct {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub type fmpz_lll_t = [fmpz_lll_struct; 1usize];
#[repr(C)]
pub struct fmpz_gram_union {
pub appSP: __BindgenUnionField<d_mat_t>,
pub appSP2: __BindgenUnionField<gr_mat_t>,
pub exactSP: __BindgenUnionField<fmpz_mat_t>,
pub bindgen_union_field: [u64; 4usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of fmpz_gram_union"][::std::mem::size_of::<fmpz_gram_union>() - 32usize];
["Alignment of fmpz_gram_union"][::std::mem::align_of::<fmpz_gram_union>() - 8usize];
["Offset of field: fmpz_gram_union::appSP"]
[::std::mem::offset_of!(fmpz_gram_union, appSP) - 0usize];
["Offset of field: fmpz_gram_union::appSP2"]
[::std::mem::offset_of!(fmpz_gram_union, appSP2) - 0usize];
["Offset of field: fmpz_gram_union::exactSP"]
[::std::mem::offset_of!(fmpz_gram_union, exactSP) - 0usize];
};
impl Default for fmpz_gram_union {
fn default() -> Self {
let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
unsafe {
::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub type fmpz_gram_t = [fmpz_gram_union; 1usize];
extern "C" {
pub fn fmpz_lll_context_init_default(fl: *mut fmpz_lll_struct);
pub fn fmpz_lll_context_init(
fl: *mut fmpz_lll_struct,
delta: f64,
eta: f64,
rt: rep_type,
gt: gram_type,
);
pub fn fmpz_lll_randtest(fl: *mut fmpz_lll_struct, state: *mut flint_rand_struct);
pub fn fmpz_lll_heuristic_dot(
vec1: *const f64,
vec2: *const f64,
len2: slong,
B: *const fmpz_mat_struct,
k: slong,
j: slong,
exp_adj: slong,
) -> f64;
pub fn fmpz_lll_check_babai(
kappa: libc::c_int,
B: *mut fmpz_mat_struct,
U: *mut fmpz_mat_struct,
mu: *mut d_mat_struct,
r: *mut d_mat_struct,
s: *mut f64,
appB: *mut d_mat_struct,
expo: *mut libc::c_int,
A: *mut fmpz_gram_union,
a: libc::c_int,
zeros: libc::c_int,
kappamax: libc::c_int,
n: libc::c_int,
fl: *const fmpz_lll_struct,
) -> libc::c_int;
pub fn fmpz_lll_check_babai_heuristic_d(
kappa: libc::c_int,
B: *mut fmpz_mat_struct,
U: *mut fmpz_mat_struct,
mu: *mut d_mat_struct,
r: *mut d_mat_struct,
s: *mut f64,
appB: *mut d_mat_struct,
expo: *mut libc::c_int,
A: *mut fmpz_gram_union,
a: libc::c_int,
zeros: libc::c_int,
kappamax: libc::c_int,
n: libc::c_int,
fl: *const fmpz_lll_struct,
) -> libc::c_int;
pub fn fmpz_lll_shift(B: *const fmpz_mat_struct) -> libc::c_int;
pub fn fmpz_lll_d(
B: *mut fmpz_mat_struct,
U: *mut fmpz_mat_struct,
fl: *const fmpz_lll_struct,
) -> libc::c_int;
pub fn fmpz_lll_d_heuristic(
B: *mut fmpz_mat_struct,
U: *mut fmpz_mat_struct,
fl: *const fmpz_lll_struct,
) -> libc::c_int;
pub fn fmpz_lll_check_babai_heuristic(
kappa: libc::c_int,
B: *mut fmpz_mat_struct,
U: *mut fmpz_mat_struct,
mu: *mut gr_mat_struct,
r: *mut gr_mat_struct,
s: gr_ptr,
appB: *mut gr_mat_struct,
A: *mut fmpz_gram_union,
a: libc::c_int,
zeros: libc::c_int,
kappamax: libc::c_int,
n: libc::c_int,
tmp: gr_ptr,
rtmp: gr_ptr,
ctx: *mut gr_ctx_struct,
fl: *const fmpz_lll_struct,
) -> libc::c_int;
pub fn fmpz_lll_mpf2(
B: *mut fmpz_mat_struct,
U: *mut fmpz_mat_struct,
prec: flint_bitcnt_t,
fl: *const fmpz_lll_struct,
) -> libc::c_int;
pub fn fmpz_lll_mpf(
B: *mut fmpz_mat_struct,
U: *mut fmpz_mat_struct,
fl: *const fmpz_lll_struct,
) -> libc::c_int;
pub fn fmpz_lll_wrapper(
B: *mut fmpz_mat_struct,
U: *mut fmpz_mat_struct,
fl: *const fmpz_lll_struct,
) -> libc::c_int;
pub fn fmpz_lll_advance_check_babai(
cur_kappa: libc::c_int,
kappa: libc::c_int,
B: *mut fmpz_mat_struct,
U: *mut fmpz_mat_struct,
mu: *mut d_mat_struct,
r: *mut d_mat_struct,
s: *mut f64,
appB: *mut d_mat_struct,
expo: *mut libc::c_int,
A: *mut fmpz_gram_union,
a: libc::c_int,
zeros: libc::c_int,
kappamax: libc::c_int,
n: libc::c_int,
fl: *const fmpz_lll_struct,
) -> libc::c_int;
pub fn fmpz_lll_advance_check_babai_heuristic_d(
cur_kappa: libc::c_int,
kappa: libc::c_int,
B: *mut fmpz_mat_struct,
U: *mut fmpz_mat_struct,
mu: *mut d_mat_struct,
r: *mut d_mat_struct,
s: *mut f64,
appB: *mut d_mat_struct,
expo: *mut libc::c_int,
A: *mut fmpz_gram_union,
a: libc::c_int,
zeros: libc::c_int,
kappamax: libc::c_int,
n: libc::c_int,
fl: *const fmpz_lll_struct,
) -> libc::c_int;
pub fn fmpz_lll_d_with_removal(
B: *mut fmpz_mat_struct,
U: *mut fmpz_mat_struct,
gs_B: *const fmpz,
fl: *const fmpz_lll_struct,
) -> libc::c_int;
pub fn fmpz_lll_d_heuristic_with_removal(
B: *mut fmpz_mat_struct,
U: *mut fmpz_mat_struct,
gs_B: *const fmpz,
fl: *const fmpz_lll_struct,
) -> libc::c_int;
pub fn fmpz_lll_mpf2_with_removal(
B: *mut fmpz_mat_struct,
U: *mut fmpz_mat_struct,
prec: flint_bitcnt_t,
gs_B: *const fmpz,
fl: *const fmpz_lll_struct,
) -> libc::c_int;
pub fn fmpz_lll_mpf_with_removal(
B: *mut fmpz_mat_struct,
U: *mut fmpz_mat_struct,
gs_B: *const fmpz,
fl: *const fmpz_lll_struct,
) -> libc::c_int;
pub fn fmpz_lll_wrapper_with_removal(
B: *mut fmpz_mat_struct,
U: *mut fmpz_mat_struct,
gs_B: *const fmpz,
fl: *const fmpz_lll_struct,
) -> libc::c_int;
pub fn fmpz_lll_d_with_removal_knapsack(
B: *mut fmpz_mat_struct,
U: *mut fmpz_mat_struct,
gs_B: *const fmpz,
fl: *const fmpz_lll_struct,
) -> libc::c_int;
pub fn fmpz_lll_wrapper_with_removal_knapsack(
B: *mut fmpz_mat_struct,
U: *mut fmpz_mat_struct,
gs_B: *const fmpz,
fl: *const fmpz_lll_struct,
) -> libc::c_int;
pub fn fmpz_lll_with_removal_ulll(
FM: *mut fmpz_mat_struct,
UM: *mut fmpz_mat_struct,
new_size: slong,
gs_B: *const fmpz,
fl: *const fmpz_lll_struct,
) -> libc::c_int;
pub fn fmpz_lll_is_reduced_d(
B: *const fmpz_mat_struct,
fl: *const fmpz_lll_struct,
) -> libc::c_int;
pub fn fmpz_lll_is_reduced_mpfr(
B: *const fmpz_mat_struct,
fl: *const fmpz_lll_struct,
prec: flint_bitcnt_t,
) -> libc::c_int;
pub fn fmpz_lll_is_reduced(
B: *const fmpz_mat_struct,
fl: *const fmpz_lll_struct,
prec: flint_bitcnt_t,
) -> libc::c_int;
pub fn fmpz_lll_is_reduced_d_with_removal(
B: *const fmpz_mat_struct,
fl: *const fmpz_lll_struct,
gs_B: *const fmpz,
newd: libc::c_int,
) -> libc::c_int;
pub fn fmpz_lll_is_reduced_mpfr_with_removal(
B: *const fmpz_mat_struct,
fl: *const fmpz_lll_struct,
gs_B: *const fmpz,
newd: libc::c_int,
prec: flint_bitcnt_t,
) -> libc::c_int;
pub fn fmpz_lll_is_reduced_with_removal(
B: *const fmpz_mat_struct,
fl: *const fmpz_lll_struct,
gs_B: *const fmpz,
newd: libc::c_int,
prec: flint_bitcnt_t,
) -> libc::c_int;
pub fn fmpz_lll(B: *mut fmpz_mat_struct, U: *mut fmpz_mat_struct, fl: *const fmpz_lll_struct);
pub fn fmpz_lll_with_removal(
B: *mut fmpz_mat_struct,
U: *mut fmpz_mat_struct,
gs_B: *const fmpz,
fl: *const fmpz_lll_struct,
) -> libc::c_int;
pub fn fmpz_lll_storjohann_ulll(
FM: *mut fmpz_mat_struct,
new_size: slong,
fl: *const fmpz_lll_struct,
);
}