Rational Numbers in String

Open discussion for MAGMA library (Matrix Algebra on GPU and Multicore Architectures)
Post Reply
mv3
Posts: 2
Joined: Mon Feb 16, 2015 5:57 pm

Rational Numbers in String

Post by mv3 » Mon Feb 16, 2015 6:11 pm

Is it possible to store a sting with rational numbers that come from variables. For instance, if x = 4/3 I would like something like

Code: Select all

s:= "this string contains the rational number" x;
I am working with n-tuples for large n where many of the entries are 0. I just want to create a string that tells me the non-zero entries and which position they are in for example:

(0 0 0 0 4/3 0 0 0 0 0 1/2 )

would be converted to "4/3 e_5 + 1/2 e_11" or something similar. For large n-tuples it is very tedious to count the number of zeros between nonzero entries. Can this be accomplished? I have a function that will do all the work but I can't get it to store the string with rational numbers in it.

Best,
Mike

mgates3
Posts: 918
Joined: Fri Jan 06, 2012 2:13 pm

Re: Rational Numbers in String

Post by mgates3 » Tue Feb 17, 2015 2:39 pm

You probably want the other MAGMA, http://magma.maths.usyd.edu.au/magma/

This forum is for MAGMA the GPU linear algebra library, http://icl.cs.utk.edu/magma/

-mark

mv3
Posts: 2
Joined: Mon Feb 16, 2015 5:57 pm

Re: Rational Numbers in String

Post by mv3 » Tue Feb 17, 2015 3:26 pm

My mistake! Thanks for pointing me in the right direction.

Post Reply