Skip to content
11 changes: 5 additions & 6 deletions flint-extras/src/nmod_mat_poly.h
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ nmod_mat_poly_set_from_poly_mat(nmod_mat_poly_t matp, const nmod_poly_mat_t pmat
* The functions here compute a `shift`-minimal ordered weak Popov approximant
* basis for `(pmat,orders)` in the case where `orders` is given by a single
* integer `orders = (order,...order)`. They iterate from `1` to `order`,
* computing at each step a basis at order `1` (see @ref mbasis1) and using it
* computing at each step a basis at order `1` and using it
* to update the output `appbas`, the so-called _residual matrix_, and the
* considered shift. At step `d`, we have `appbas*pmat = 0 mod x^{d-1}`, and we
* want to update `appbas` so that this becomes zero modulo `x^d`.
Expand All @@ -614,8 +614,8 @@ nmod_mat_poly_set_from_poly_mat(nmod_mat_poly_t matp, const nmod_poly_mat_t pmat
* \todo integrate
*/
// Complexity: pmat is m x n
// - 'order' calls to mbasis1 with dimension m x n, each one gives a
// constant matrix K which is generically m-n x m (may have more rows in
// - 'order' calls to constant nullspace with dimension m x n, each one gives
// a constant matrix K which is generically m-n x m (may have more rows in
// exceptional cases)
// - order products (X Id + K ) * appbas to update the approximant basis
// - order computations of "coeff k of appbas*pmat" to find residuals
Expand All @@ -639,8 +639,8 @@ nmod_mat_poly_set_from_poly_mat(nmod_mat_poly_t matp, const nmod_poly_mat_t pmat
// Residual (X^-d appbas*pmat mod X^(order-d)) is continuously updated along
// the iterations
// Complexity: pmat is m x n
// - 'order' calls to mbasis1 with dimension m x n, each one gives a
// constant matrix K which is generically m-n x m (may have more rows in
// - 'order' calls to constant nullspace with dimension m x n, each one gives
// a constant matrix K which is generically m-n x m (may have more rows in
// exceptional cases)
// - order products (X Id + K ) * appbas to update the approximant basis
// - order-1 products (X Id + K ) * (matrix of degree order-ord) to update
Expand Down Expand Up @@ -675,7 +675,6 @@ nmod_mat_poly_set_from_poly_mat(nmod_mat_poly_t matp, const nmod_poly_mat_t pmat
// // To understand the threshold (cdim > rdim/2 + 1), see the complexities
// // mentioned above for these two variants of mbasis
//}
// TODO DOC (see @ref mbasis1)
// TODO resupdate version
// TODO general version with choice
void nmod_mat_poly_mbasis(nmod_mat_poly_t appbas,
Expand Down
3 changes: 0 additions & 3 deletions flint-extras/src/nmod_mat_poly_extra/nmod_mat_poly_mbasis.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,3 @@ _PROFILER_REGION_STOP(t_others)
_MBASIS_PROFILER_OUTPUT
return;
}

/* -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
// vim:sts=4:sw=4:ts=4:et:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
81 changes: 3 additions & 78 deletions flint-extras/src/nmod_poly_mat_approximant.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,13 @@
* \param[in] order order
* \param[in] shift shift
* \param[in] form required form for `appbas` (see #poly_mat_form_t)
* \param[in] row_wise indicates whether to compute left approximants (working row-wise) or right approximants (working column-wise)
* \param[in] orient indicates the orientation (left/right approximants) and the definition of pivots
* \param[in] randomized if `true`, the algorithm may use a Monte Carlo or Las Vegas verification algorithm
*
* \return boolean, result of the verification
*
* \todo add parameter row_wise
* \todo update documentation
* \todo support all options, make doc more clear concerning Las Vegas / Monte Carlo
* \todo WARNING! for the moment, does not really check generation!
* \todo WARNING! for the moment, hardcoded to check for ordered weak Popov
*/
int nmod_poly_mat_is_approximant_basis(const nmod_poly_mat_t appbas,
Expand Down Expand Up @@ -243,82 +242,16 @@ int nmod_poly_mat_is_approximant_basis(const nmod_poly_mat_t appbas,


/** @name Approximant basis via linear algebra
* \anchor mbasis1
* \anchor approx_linalg
*
* These functions compute a shifted minimal or shifted Popov approximant
* basis using fast linear algebra on constant matrices.
*
* Currently, this is only implemented for the uniform order `(1,...,1)`, following
* the algorithm _mbasis_ described in
* - P. Giorgi, C.-P. Jeannerod, G. Villard. Proceeding ISSAC 2003,
* - P. Giorgi, R. Lebreton. Proceedings ISSAC 2014,
* - C.-P. Jeannerod, V. Neiger, G. Villard. Preprint 2018.
*
* The latter reference explicitly shows how to ensure that we obtain the
* canonical s-Popov approximant basis.
*
* \todo implement the general Krylov-based approach from JNSV17, which
* efficiently solves the problem when the sum of the orders is small
*/
//@{

/** Computes a shifted Popov approximant basis at order `(1,...,1)` using fast
* linear algebra on constant matrices. Thus, in this context, the input matrix
* `pmat` is a constant matrix. This approximant basis consists of two sets of
* rows:
* - rows forming a left kernel basis in reduced row echelon form of some
* row-permutation of `pmat` (the permutation depends on the shift)
* - the other rows are coordinate vectors multiplied by the variable `x`;
* there is one such row at each index `i` which is not among the pivot
* indices of the left kernel basis above.
*
* Here the whole approximant basis is stored in the OUT parameter `appbas`.
*
* \param[out] appbas polynomial matrix
* \param[in] pmat constant matrix
* \param[in] shift shift (vector of integers)
*
* \todo modify shift in place
* \todo does it return Popov? if yes name it popov_mbasis1 and write mbasis1
* if that makes sense; otherwise write other version popov_mbasis1
* \todo safety correctness checks
* \todo is output Popov by this method? check
* \todo seems that it does not return owP ? (see test_mbasis1.c)
*/
void mbasis1(nmod_poly_mat_t appbas,
slong * res_shift,
const nmod_mat_t mat,
const slong * shift);

/** Computes a shifted Popov approximant basis at order `(1,...,1)` using fast
* linear algebra on constant matrices. Thus, in this context, the input matrix
* `pmat` is a constant matrix. This approximant basis consists of two sets of
* rows:
* - rows forming a left kernel basis in reduced row echelon form of some
* row-permutation of `pmat` (the permutation depends on the shift)
* - the other rows are coordinate vectors multiplied by the variable `x`;
* there is one such row at each index `i` which is not among the pivot
* indices of the left kernel basis above.
*
* Here only the first set of rows is stored in the OUT parameter `kerbas`,
* along with permutation...
* \todo improve doc, to say exactly what this computes (and what is the return
* value?)
*
* \param[out] kerbas constant matrix
* \param[in] pmat constant matrix
* \param[in] shift shift (vector of integers)
*
* \todo modify shift in place
* \todo safety correctness checks
* \todo is output Popov by this method? check
*/
slong mbasis1_for_mbasis(nmod_mat_t kerbas,
slong * res_shift,
slong * res_perm,
const nmod_mat_t mat,
const slong * shift);

//@} // doxygen group: Approximant basis via linear algebra

/** @name M-Basis algorithm (uniform approximant order)
Expand Down Expand Up @@ -378,14 +311,6 @@ void nmod_poly_mat_mbasis(nmod_poly_mat_t appbas,
*/
//@{

/**
* TODO old doc, to be cleaned (new doc below, maybe not complete enough)
* F \in K[x]^{nxm} <-> F_prime K^{mxn}[x] FIX and
* Compute P_{k-1} \in K[x]^{mxm} with the list structured_multiplication_blocks
* Compute x^{-k} P_{k-1} F mod x iteratively with a naive polynomial multiplication
*
* Use naive polynomial multiplication and list_structured_multiplication_blocks
*/
/** Computes a `shift`-ordered weak Popov approximant basis for `(pmat,order)`
* using the algorithm PM-Basis (see @ref pmbasis) */

Expand Down
20 changes: 0 additions & 20 deletions flint-extras/src/nmod_poly_mat_extra.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,24 +86,4 @@ void nmod_poly_mat_det_iter(nmod_poly_t det, nmod_poly_mat_t mat);
*/


/*****************************
* Verification algorithms *
*****************************/

int nmod_poly_mat_is_approximant_basis(const nmod_poly_mat_t appbas,
const nmod_poly_mat_t pmat,
slong order,
const slong * shift,
orientation_t orient);

int nmod_poly_mat_is_kernel(const nmod_poly_mat_t ker,
const nmod_poly_mat_t pmat,
const slong * shift,
orientation_t orient);



#endif // NMOD_POLY_MAT_EXTRA_H

/* -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
// vim:sts=4:sw=4:ts=4:et:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s
Loading