Discussion: new operators for numerical computation

Jonathan Epstein Jonathan_Epstein at nih.gov
Thu Jul 20 15:11:54 EDT 2000


This looks very nice, although I like the second solution, i.e.
 A(*)B   # matouter
 A(.)B   # matinner (AKA dot, get it?)
much better.  It would be best to stay away from brackets and braces if
we can ... somebody else may want to use them someday, and this sort of
trickery looks too much like line noise to me.

The special constituencies can even be addressed using two-character
sequences within the parens if necessary.  E.g., for Kroneker use
 A(.K)B
I'm not actually proposing this specific syntax because it's so horrible
looking and potentially hard to parse, but some variant on this might do
the trick.

-Jonathan



Tim Hochberg wrote:
> 
> Gregory Lielens <gregory.lielens at fft.be> writes:
> 
> > Tim Hochberg wrote:
> [...]
> > I like the parethese a lot! except for ° which is probably out of
> > question,
> > this is the prettier way to do it, but (alwas a but :-( )
> >
> > - the solve operator indeed...The only thing i can come with is the ugly
> > (%)
> >   or the pretty but out-of-question (\)
> 
> My favorite right now is |. So one would have:
> 
> A[*]B    # matouter
> A(*)B    # matinner
> A(/)B    # matdiv
> A(|)B    # matsolve
> A(^)B    # matpower
> 
> Alternatively, one could use:
> 
> A(*)B   # matouter
> A(.)B   # matinner (AKA dot, get it?)
> 
> That would cut down on the available symbols, but might make parsing
> easier? It might also be easier to distinguish between the two
> products.
> 
> I've left out other potential outer operators (outer sum, etc) and
> alternate inner products (Lie, Kroneker, ?) pending finding a
> constituency for them.
> 
> [snip grammar issues and how to choose inner product axes]
> 
> -tim



More information about the Python-list mailing list