A similar optimization in vector.spad:

optimize 'same?' in DirectProduct


diff --git a/src/algebra/vector.spad b/src/algebra/vector.spad
index a166f394..a18de376 100644
--- a/src/algebra/vector.spad
+++ b/src/algebra/vector.spad
@@ -386,7 +386,7 @@

       if R has BasicType then
         same? : % -> Boolean
-        same? z == every?(x +-> x = z(minIndex z), z)
+        same? z == (z1 := z(minIndex z); every?(x +-> x = z1, z))

         if R is NonNegativeInteger or R is Integer or R is PositiveInteger then
           -- This is a hack to gain speed.  Direct product is used

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" 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/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to