Karim BELABAS on Mon, 13 Jan 2003 12:54:20 +0100 (MET)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: the problem of inversing a big boolean matrix


On Sun, 12 Jan 2003, Ramón Casero Cañas wrote:
> I have found another function in the User's Guide, ginvmod().

The manual is too vague. ginvmod() does not apply to the situation,

  ginvmod(x, y) is mostly a shorthand for lift( ginv( gmod(x, y) ) )

and it only applies to y of type t_INT or t_POL, with x of the same type [ or
a scalar type if typ(y) == t_POL ].

> Does somebody know something about performance of
> ginv() and ginvmod()? What is better?
>
> a) matrix of t_INT[MOD] + ginv()
> b) matrix of t_INT[MOD] + ginvmod()

ginvmod is not an option.

> It has come to me as a surprise that in the User's Guide it advises not
> to use t_VEC nor t_MAT (see below 4.5.15 Type t_MAT of the User's Guide),
> and use instead C constructs.

Again, problem in the manual: it should have said the NEXT two ones, not the
LAST two (it referred to t_STR and t_LIST!)

> But in section 4.3.1 Creation of PARI objects,
> example 3) it shows:
>
> z = cgetg(4, t_MAT);
> for (i = 1; i < 4; i++) z[i] = lgetg(5, t_COL);
>
> (double loop to fill columns)
>
> What's the equivalent C constructs way? Do you have to manually make an
> array of longs? How do you set the information about the type, syze, etc.
> that is supposed to go in the z[0] of a GEN?

This is the correct way.

If you want to try the (much more efficient, undocumented) u_FpM_*
constructs, the columns are of type t_VECSMALL, and the entries are ordinary
C-longs, _assumed_ to be reduced mod p.

Hope this helps,

    Karim.

P.S: I have corrected the manual in CVS development version.
-- 
Karim Belabas                    Tel: (+33) (0)1 69 15 57 48
Dép. de Mathématiques, Bât. 425  Fax: (+33) (0)1 69 15 60 19
Université Paris-Sud             Email: Karim.Belabas@math.u-psud.fr
F-91405 Orsay (France)           http://www.math.u-psud.fr/~belabas/
--
PARI/GP Home Page: http://www.parigp-home.de/