[
https://issues.apache.org/jira/browse/MATH-1464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16536125#comment-16536125
]
Erik Erlandson commented on MATH-1464:
--------------------------------------
Aha, I see, the goal is dependency injection for linear algebra. If this was
Scala, the idioms would be less controversial (some variety of implicit
typeclass-based API). In java, the options seem more limited.
It looked like you were referring to a JIRA above, but there is no link. It
sounds like I am wandering in on a long-standing community debate.
For APIs that are based on {{OptimizationData}}, I can imagine an optional
parameter that is of {{interface}} {{LinearAlgebra}}, which would behave as a
kind of (pseudo)implicit typeclass, and it would contain all the linear algebra
operations, and could be backed by various underlying linear algebra packages.
However, there is a lot of territory that doesn't cover, since only a subset of
commons-math operates on {{OptimizationData}}. Also, this would require quite
a large number of methods.
In the java universe an api based on {{interface}} seems like the most
idiomatic approach to dep-injection. IMO the current {{o.a.c.mathX.linear}}
doesn't take full advantage here. For example {{RealMatrix}} is an
{{interface}} and {{RealVector}} is not (but should be).
My preferred direction would be to put all of commons math (that uses linear
algebra) on a footing of using {{interface}} for matrix and vector objects, and
having better (and more consistently named) support for both in-place and
non-destructive variations of operations.
Another thing I found myself wishing for was a distinction between mutable and
immutable matrix & vector. These things are never totally clean in a classic
object-oriented hierarchy, but I'd imagine mutable {{interface}} as a
sub-interface of immutable, since mutable supports strictly(?) superset of
operations.
> convex optimization with constraints, barrier method
> ----------------------------------------------------
>
> Key: MATH-1464
> URL: https://issues.apache.org/jira/browse/MATH-1464
> Project: Commons Math
> Issue Type: New Feature
> Reporter: Erik Erlandson
> Priority: Major
> Labels: math, optimization
>
> Commons math supports SimplexOptimizer for linear programming. I created a
> somewhat similar package for convex optimization with constraints, which is
> here:
> [https://github.com/erikerlandson/gibbous]
> I designed it to work in the style of commons-math optimizers, so I thought I
> would propose it for inclusion with commons math optimization, to see if
> there is any community interest.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)