File tree Expand file tree Collapse file tree 1 file changed +3
-38
lines changed Expand file tree Collapse file tree 1 file changed +3
-38
lines changed Original file line number Diff line number Diff line change @@ -2172,12 +2172,12 @@ def repr_lincomb(symbols, coeffs):
2172
2172
if c == 1 :
2173
2173
coeff = ""
2174
2174
elif c == - 1 :
2175
- coeff = "-"
2175
+ coeff = "-"
2176
2176
else :
2177
- coeff = coeff_repr (c )
2177
+ coeff = coeff_repr (c )
2178
2178
2179
2179
b = latex (sym )
2180
- # this is a hack: i want to say that if the symbol happens to
2180
+ # this is a hack: I want to say that if the symbol happens to
2181
2181
# be a number, then we should put a multiplication sign in
2182
2182
try :
2183
2183
if sym in CC and coeff not in ("" , "-" ):
@@ -2194,41 +2194,6 @@ def repr_lincomb(symbols, coeffs):
2194
2194
2195
2195
s = " + " .join (terms )
2196
2196
return s .replace ("+ -" , "- " )
2197
- s = ""
2198
- first = True
2199
-
2200
- for i , c in enumerate (coeffs ):
2201
- bv = symbols [i ]
2202
- b = latex (bv )
2203
- if c != 0 :
2204
- if c == 1 :
2205
- if first :
2206
- s += b
2207
- else :
2208
- s += " + %s" % b
2209
- else :
2210
- coeff = coeff_repr (c )
2211
- if coeff == "-1" :
2212
- coeff = "-"
2213
- if first :
2214
- coeff = str (coeff )
2215
- else :
2216
- coeff = " + %s" % coeff
2217
- # this is a hack: i want to say that if the symbol
2218
- # happens to be a number, then we should put a
2219
- # multiplication sign in
2220
- try :
2221
- if bv in CC :
2222
- s += r"%s\cdot %s" % (coeff , b )
2223
- else :
2224
- s += "%s%s" % (coeff , b )
2225
- except Exception :
2226
- s += "%s%s" % (coeff , b )
2227
- first = False
2228
- if first :
2229
- s = "0"
2230
- s = s .replace ("+ -" , "- " )
2231
- return s
2232
2197
2233
2198
2234
2199
common_varnames = ['alpha' ,
You can’t perform that action at this time.
0 commit comments