Hello everyone
I tested the code below and noticed that the code done in python proved faster. 
does anyone know why?

Sagemath code:

A = random_matrix(RDF,5000,5000)
B = random_vector(RDF,5000)

%time
x =A\B

CPU time: 11.11 s,  Wall time: 11.10 s


or

%time
x = A.solve_right(B)

CPU time: 11.43 s,  Wall time: 11.44 s

Python(jupyter) code

import numpy as np
import time

A = np.random.rand(5000,5000)
B = np.random.rand(5000,1)

Aa = np.matrix(A)
Bb = np.matrix(B)

start = time.time()

x = np.linalg.solve(A,B)

end = time.time()

print(end - start)

..............2.51481699944s


-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to