Also class structure seems a little bit overengene...
# mathematics
a
Also class structure seems a little bit overengeneered. It is completely opaque to the user so it is not the problem, but still I am not completely happy with it.
😵 3
👍 1
t
I know very little about implementing the stuff, other than poking around existing libraries. Are you on par with existing jvm libraries? Or are you trying to exploit kotlin for something better? Just remember to not let perfect be the enemy of good.
a
😈 He-he, you scientific guys really need someone with developer experience to write these things for you.
🦄 1
In fact, there is nothing really hard here. If you forget about `AlgebraElement`s which complicate things you have basic Space <- Ring <- Field sequence repeated for nd-structures with small addition of general
NDAlgebra
as common ancestor. From the point of view of user You just use one of factories like
NDField.real(...)
and forget anything else. From the developer point of view (which is why I need all of this), to add new type of nd-algebra, you just inherit the type of algebra you want, say
NDRing
for short or byte and implement 5 methods.
The complication arises because element types which could work without a context for python-loving guys. I can significantly simplify everything if we forget about working with elements outside of context. For now any nd-element produced, remembers its context so you can write something like
NDField.real(10,10).run{one * 10.0} + 2.0
. It is free from the point of view of performance but complicated object structure.
@thomasnield I believe that common maths takes the same approach by abstracting away algebra. In java it looks much more ugly though.
t
When you "abstract away algebra", which level of abstraction are we talking? Like
NDField.real(...)
?
a
This is just a sugared function for the end user. I mean that instead of creating an implementation of everything for each type of elements, they (and myself) just define a mathematica abstraction.
They do not define Spaces and Rings though. Also Java does not have context functions, so it is not possible to write simple expressions with those constructs.