Multivector static member str_rep(mv) called by __str__(self) did not 
complete string processing for grade 0 (scalar) multivectors.  Fixed 
problem and removed all spaces from output to reduce length of string.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy-patches" group.
To post to this group, send email to sympy-patches@googlegroups.com
To unsubscribe from this group, send email to 
sympy-patches+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sympy-patches?hl=en
-~----------~----~----~----~------~----~------~--~---

>From d3d790c71511df25e67e744ffebc9ca86f36ff44 Mon Sep 17 00:00:00 2001
From: Alan Bromborsky <bro...@ga.(none)>
Date: Sun, 31 May 2009 07:23:36 -0400
Subject: [PATCH] Fix special case in __str__.

---
 sympy/galgebra/GA.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/sympy/galgebra/GA.py b/sympy/galgebra/GA.py
index d3cc077..46375a8 100644
--- a/sympy/galgebra/GA.py
+++ b/sympy/galgebra/GA.py
@@ -751,6 +751,7 @@ class MV(object):
                 labels = MV.basislabel
             else:
                 labels = MV.bladelabel
+        mv.compact()
         if isinstance(mv.mv[0],types.IntType):
             value = ''
         else:
@@ -762,6 +763,7 @@ class MV(object):
                 for x in mv.mv[igrade]:
                     if x != ZERO:
                         xstr = (x*dummy).__str__()
+                        xstr = xstr.replace(' ','')
                         if xstr[0] != '-' and len(value) > 0:
                             xstr = '+'+xstr
                         if xstr.find('dummy') < 2 and xstr[-5:] != 'dummy':
@@ -776,7 +778,8 @@ class MV(object):
                     value += '\n'
         if value == '':
             value = '0'
-        value = value.replace(' ','')
+        #value = value.replace(' ','')
+        value = value.replace('dummy','1')
         return(value)

     @staticmethod
--
1.6.0.4

Reply via email to