Ask Your Question

rafarob32's profile - activity

2023-02-15 10:00:40 +0200 asked a question BUG: SageMath 9.6 for Ubuntu; inverse() with

BUG: SageMath 9.6 for Ubuntu; inverse() with BUG: SageMath 9.6 for Ubuntu; inverse() A = matrix(IntegerModRing(6), [[2,

2017-11-01 14:45:42 +0200 received badge  Famous Question (source)
2017-01-05 22:17:01 +0200 received badge  Notable Question (source)
2016-04-21 12:08:15 +0200 commented question rational numbers with cython

Sorry, I don't know how to use mpq_t attribute. Should I import some library for it? How do it? Thanks in advance.

2016-04-21 09:26:47 +0200 received badge  Scholar (source)
2016-04-21 09:26:41 +0200 received badge  Supporter (source)
2016-04-20 21:42:23 +0200 received badge  Editor (source)
2016-04-20 19:41:05 +0200 commented question rational numbers with cython

I re-edited with an example. Thanks.

2016-04-20 17:25:18 +0200 received badge  Popular Question (source)
2016-04-20 17:07:20 +0200 asked a question rational numbers with cython

I want to work efficiently with rational numbers under the context %cython but I don`t know how. Can anyone suggest any ideas? Thank you.

An example:

  %cython

    def rational_partitions(n):
        sol = [i/n for i in range(n)]
        for a in sol[0:-1]:
            for b in sol[1:]:
                k=2
                while abs(b-a)/k>1/n:
                    sol.append(abs(b-a)/k)
                    k += 1
        return sol

rational_partitions(10)
2015-05-04 17:05:17 +0200 received badge  Student (source)
2015-05-04 15:59:21 +0200 asked a question LU decomposition for a matrix

There is an inconsistency in the use of the LU decomposition of a matrix. If matrix A is declared in the RDF ring then P, L, U = A.LU () provides PA = LU but if A is declared in the RR ring (or QQ, ZZ,...) then A = PLU. Therefore in a case P is P.transpose () on the other.