laop
laop copied to clipboard
Alternative
This PR has type safe matrix construction primitives via linear maps semantics.
The new file called Alternative.hs
when ready will substitute the one called Internal.hs
.
I still need to refactor the other modules.
Now that the project compiles I ran the Benchmarks for the matrix composition and they are exactly the same. Since matrix composition does not use any of the Khatri-Rao and derivatives functions it doesn't suffer any performance impact!
However, just by running the Example.hs
it's a lot slower than the previous version :cry: Just doing kr die die
takes a lot of time to generate a Matrix of 36 rows...
Is there any way we can optimize the type safe matrix construction?
@bolt12 Yes, I suspected that this implementation would be slower.
One of the problems is that there is a lot of padding (padLeft
/padRight
) in the implementation of linearMap
. I suggest you try to get rid of it.