Creating sparce matrices of arbitrary length and width and setting random entries

15 views
Skip to first unread message

tom murtha

unread,
Mar 21, 2018, 5:40:57 PM3/21/18
to linbox-use
Hello,

I'm trying to make a program that creates a sparse matrix of some length and width and then sets a few random entries with setEntry.

I've copy and pasted the definition from the example solve driver, SparseMatrix<Givaro::ZRing<Integer>>, and following the tutorial it suggests it can be defined as SparseMatrix B(100, 200).

Putting the two together and trying SparseMatrix<Givaro::ZRing<Integer>> B(100, 200) gives the following error

"no matching function for call to ‘LinBox::SparseMatrix<Givaro::ZRing<Givaro::Integer> >::SparseMatrix(int, int)"

What is the proper way to do this?

Thanks,
-Tom

Jean-Guillaume Dumas

unread,
Mar 22, 2018, 4:17:47 AM3/22/18
to linbo...@googlegroups.com
Dear Tom,
you are missing a domain for the elements.
If they are integers, you can define "Givaro::ZRing<Integer> ZZ;"
Then "B(ZZ, 100, 200)" will work.
Regards,
--
Jean-Guillaume Dumas.
____________________________________________________________________
Jean-Guill...@univ-grenoble-alpes.fr Tél.: +33 457 421 732
Professeur, Université Grenoble Alpes. Fax.: +33 457 421 828
Laboratoire Jean Kuntzmann, Mathématiques Appliquées et Informatique
700 avenue centrale, IMAG - CS 40700, 38058 GRENOBLE cedex 9, FRANCE
http://ljk.imag.fr/membres/Jean-Guillaume.Dumas
____________________________________________________________________

tom murtha

unread,
Mar 24, 2018, 1:09:26 PM3/24/18
to linbox-use
Thank you for the quick reply!
Reply all
Reply to author
Forward
0 new messages