working with matrix

Andreas Fabri andreas.fabri at
Wed Apr 3 08:47:34 CEST 2013

On 03/04/2013 00:23, David Gillies wrote:
> You'll have to write your own, unless someone's already done this and
> released code.

You might have a look at the Eigen library
(I am not affiliated with it)


> With the exception of matrix division, these are fairly
> simple to implement, although implementing them EFFICIENTLY is more
> problematical. Division is quite a bit harder because it requires an
> inversion (i.e. A/B = A B^(-1) or A\B = A^(-1) B)
> The canonical way to implement a matrix is as a pointer to pointer to
> element type, containing a vector of pointers to rows (or columns) of data.
> Matrices can be implemented quite efficiently with C++ STL types. For
> built-in types, there are subtleties to do with data locality and cache
> trashing but that's likely to be less of an issue with GMP.
> sketch code is something like for nxn matrix of T
> T **m;
> m=new T*[n];
> for(int i=0;i<n;i++)
>     m[i]=new T[n];
> On Tue, Apr 2, 2013 at 2:44 PM, Ramón T. B. <framontb at> wrote:
>> Hello,
>>     how could I do for working with matrix filled with mpz_t numbers? I
>> say, for doing (math) matrix multiplications for example. It is possible or
>> I need another library outside de gmp?
>>     I refer to those matrix operations like that (
>> in the gsl library.
>> Best regards and thanks in advance: framontb
>> _______________________________________________
>> gmp-discuss mailing list
>> gmp-discuss at

Andreas Fabri, PhD
Chief Officer, GeometryFactory
Editor, The CGAL Project

phone: +33.492.954.912    skype: andreas.fabri

More information about the gmp-discuss mailing list