RobinHankin / stokes

methods for exterior calculus
https://robinhankin.github.io/stokes/
3 stars 0 forks source link

print method #55

Closed RobinHankin closed 2 years ago

RobinHankin commented 2 years ago

The print method for symbolic form is bad:

> a
An alternating linear map from V^3 to R with V=R^7:
           val
 1 4 5  =    6
 3 4 7  =   -9
 2 3 5  =   -4
 1 3 4  =    2
 3 5 6  =  -13
 2 6 7  =   -3
 2 5 7  =   -6
> options(polyform=T)
> a
An alternating linear map from V^3 to R with V=R^7:
+6*x*y^4*z^5 -9*x^3*y^4*z^7 -4*x^2*y^3*z^5 +2*x*y^3*z^4 -13*x^3*y^5*z^6
-3*x^2*y^6*z^7 -6*x^2*y^5*z^7
> as.symbolic(a,d="d",symbols=as.character(1:50))
[1]  +6 d1^d4^d5 -9 d3^d4^d7 -4 d2^d3^d5 +2 d1^d3^d4 -13 d3^d5^d6 -3 d2^d6^d7 -6 d2^d5^d7
> 

The print method should use as.symbolic() if polyform is TRUE