You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Dimitrios Efthymiou <ef...@gmail.com> on 2023/07/16 23:54:43 UTC
Move math algorithms from all projects to math libraries
Hello everyone.
One thing i would love to do is to go through the apache projects, see
which ones already depend on the math library, and see if they implement
some math stuff that could be replaced by a call to commons math or move
that function to the math library. Would such cases be considered valid for
implementing new math algorithms inside the math libraries? I don't think i
have seen any ticket that wants to implement new math algorithms.
Thank you
Re: Move math algorithms from all projects to math libraries
Posted by Gilles Sadowski <gi...@gmail.com>.
Hi.
Le lun. 17 juil. 2023 à 02:08, Gary Gregory <ga...@gmail.com> a écrit :
>
> At one point, I had proposed to deprecate Commons Lang' math package in
> favor of something else in Commons Math or elsewhere. Commons Lang would
> NOT depend on Commons Math/Other, we would just deprecate with a forwarding
> link.
>
> This idea was rejected IIRC because I do not think there was agreement on
> where to put what.
I don't recall any outright rejection, and I don't remember a
conversation about code "location".
String parsing in "NumberUtils" do not belong in [Numbers] but
would belong to [Text] (or it would be quite fine to keep in [Lang],
just weird that it is in a package called "math"...).
The weirdly named "IEEE754rUtils" class contains utilities that
could be moved to [Math] (or some to [Numbers] if not covered
already).
The third and last class is "Fraction"...
> I think the Lang Fraction class for example
IIRC, we indeed *agreed* to not recommend its use (cf. below).
> is not a
> match for the one in Math or Numbers or wherever it is.
Not sure what you mean by "is not a match"; meaning "less safe"
would concur with the Javadoc:
---CUT---
* <p>Note that this class is intended for common use cases, it is <i>int</i>
* based and thus suffers from various overflow issues. For a BigInteger based
* equivalent, please see the Commons Math BigFraction class.</p>
---CUT---
[Note: "BigFraction" is in the "commons-numbers-fraction" module
in "Commons Numbers", not "Commons Math".]
>
> One thing to keep in mind it's OK to fill in the gaps in one component
> (Math, Numbers, and so on) but that does not automatically mean that a
> dependency will be introduced. For example, it would be odd for Lang or IO
> to depend on Math.
I totally agree with the last sentence.
Inter-dependencies within "Commons" would be an interesting
conversation (that has always been killed off as if "no dependency"
was a virtue by itself).
Within what we like to call low-level components developed here,
a hierarchy could be envisioned (with a number of "steps", TBD).
At the bottom, no dependency would be allowed, while at the top,
dependencies towards libraries that have a strict no JAR hell policy
would be allowed (e.g. Log4J2 API ?).
A "Commons" component at an intermediate "step" could only
depend on another "Commons" component at a lower "step" (i.e.
forbidding circular dependencies).
[Lang], [IO], [Numbers], [RNG] are instances that sit at the bottom.
[Math] would now be at the top (several users need logging!)
[Geometry] and [Statistics] depend on [Numbers] and/or [RNG] so
are at a higher "step".
[Imaging] would also be at an intermediate "step".
Regards,
Gilles
>
> Gary
>
> On Sun, Jul 16, 2023, 19:55 Dimitrios Efthymiou <
> efthymiou.dimitrios1@gmail.com> wrote:
>
> > Hello everyone.
> > One thing i would love to do is to go through the apache projects, see
> > which ones already depend on the math library, and see if they implement
> > some math stuff that could be replaced by a call to commons math or move
> > that function to the math library. Would such cases be considered valid for
> > implementing new math algorithms inside the math libraries? I don't think i
> > have seen any ticket that wants to implement new math algorithms.
> >
> > Thank you
> >
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: Move math algorithms from all projects to math libraries
Posted by Gilles Sadowski <gi...@gmail.com>.
Hello.
Le mar. 18 juil. 2023 à 15:25, Dimitrios Efthymiou
<ef...@gmail.com> a écrit :
>
> Hi Gilles. Question about the clustering package What should happen?
> Create a new module commons-math-clustering and then
> literally move the code from legacy to commons-math-clustering?
> Are there tickets or should I create one that explains that
> we are moving the legacy clustering package to a new module?
> Where is the document with the precise requirements and instructions?
Let's not continue this thread with many different topics.
Please post a new message for the new subject.
Thanks,
Gilles
> > > > >> [...]
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: Move math algorithms from all projects to math libraries
Posted by Dimitrios Efthymiou <ef...@gmail.com>.
Hi Gilles. Question about the clustering package What should happen?
Create a new module commons-math-clustering and then
literally move the code from legacy to commons-math-clustering?
Are there tickets or should I create one that explains that
we are moving the legacy clustering package to a new module?
Where is the document with the precise requirements and instructions?
On Mon, 17 Jul 2023 at 18:39, Gilles Sadowski <gi...@gmail.com> wrote:
> Le lun. 17 juil. 2023 à 15:19, Dimitrios Efthymiou
> <ef...@gmail.com> a écrit :
> >
> > I don't have specific functionality in mind.
>
> You mentioned ASF projects which, IIUC, you said depend on
> "Commons Math". So I asked: On which "Commons Math"
> utilities do they depend? [Last time I checked (I don't remember
> where or how), most were from the "stat" package).]
>
> > I just had an idea
> > to do a search for dependencies on java.lang.Math or BigInteger
> > or BigDecimal and if I find any, I would see if these dependencies
> > exist because the project has its own custom math algorithms.
> > If yes then, there you go. We have something to replace by
> > utilising the commons math libraries. I haven't done a
> > search yet. I wanted to see if the community would be OK
> > with new tickets (if any) for new functionality to be implemented
> > in the math libraries, GIVEN that there will automatically be
> > use-cases i.e. apache already uses those algorithms.
> > When I suggest new math functionality, I am always asked
> > what the use-cases are and I don't have any, because I just
> > want to implement unimplemented math algorithms. So, I thought
> > that this way (if I find any) there will be use-cases
>
> Yes, but if those projects don't want to depend on the new
> functionality, your time would be better used elsewhere.
> As you could read today[1], it's difficult to even share code
> inside the "Commons" project. For another project to
> delegate some functionality is much more to ask. What
> usually happens is the other way around; some functionality
> already exists somewhere, and is taken advantage of right
> away.
> For better or (and?) worse, most use-cases came from
> people who were using CM and needed something more,
> which they contributed back.
> Since it's "there" already, better improve it than find more
> things to add (if you don't have use-cases for them).
> Did I mention "clustering" and "genetic algorithm"?
>
> Regards,
> Gilles
>
> [1] https://issues.apache.org/jira/browse/IMAGING-358
>
> >
> > On Mon, 17 Jul 2023 at 11:43, Gilles Sadowski <gi...@gmail.com>
> wrote:
> >
> > > Le lun. 17 juil. 2023 à 02:34, Dimitrios Efthymiou
> > > <ef...@gmail.com> a écrit :
> > > >
> > > > I didn't say to introduce a dependency on math. I said that libraries
> > > that
> > > > already depend on math, may have math algorithms implemented that we
> > > could
> > > > replace with a call to the appropriate commons math methods
> > >
> > > Sounds nice.
> > > If we could already do that just within "Commons"... (see other post).
> > >
> > > > or if math
> > > > doesn't have those math algorithms, we can move them to math. Flink
> and
> > > > HBase for example depend on math
> > >
> > > For which functionality?
> > >
> > > Regards,
> > > Gilles
> > >
> > > >> [...]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>
Re: Move math algorithms from all projects to math libraries
Posted by Alex Herbert <al...@gmail.com>.
On Tue, 18 Jul 2023 at 09:43, Gilles Sadowski <gi...@gmail.com> wrote:
>
> Hello.
>
> Le mar. 18 juil. 2023 à 02:48, Dimitrios Efthymiou
> <ef...@gmail.com> a écrit :
> >
> > Thanks Gilles. I checked NUMBERS-193 and i have an implementation of DD and
> > i will put it in *.ext package (TBD) along with some tests. Do i have to
> > look at Dfd.java or something, because these dfd classes in math legacy
> > core have lots of hard-coded decimals in there.
>
> Yes, we need to sort out what to with with the "Dfp" classes: I don't
> know how useful they will be once the DD implementation is available.
> We'll perhaps need benchmarks to assess speed vs precision among
> all extended precision implementations:
> * DD in [Numbers],
> * Dfp in [Math]
> * BigDecimal in the JDK
>
> If "Dfp" is somehow (TBD) useful, it should be moved to a module of
> its own, perhaps in [Numbers].
Note: Dfp is not in the same category as a double-double number as it
is an "unlimited" precision number. It has a configurable decimal
precision and a larger exponent range than a double. It also has
support for various elementary functions (exp, exp1p, log, log1p, sin,
cos, etc). As such it is very valuable to fill a void where BigDecimal
cannot be used since that only supports pow and, from JDK 9+, sqrt. I
expect the speed would be comparable to BigDecimal and so a JMH test
would be useful.
Moving it out of math to a new module in numbers would be a chance to
revisit the code. But it is a large and complex class. I would not
change its implementation without a very thorough set of tests against
other comparable unlimited precision number implementations in other
libraries (Python mpmath; Maxima; Matlab vpa; etc).
Alex
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: Move math algorithms from all projects to math libraries
Posted by Gilles Sadowski <gi...@gmail.com>.
Hello.
Le mar. 18 juil. 2023 à 02:48, Dimitrios Efthymiou
<ef...@gmail.com> a écrit :
>
> Thanks Gilles. I checked NUMBERS-193 and i have an implementation of DD and
> i will put it in *.ext package (TBD) along with some tests. Do i have to
> look at Dfd.java or something, because these dfd classes in math legacy
> core have lots of hard-coded decimals in there.
Yes, we need to sort out what to with with the "Dfp" classes: I don't
know how useful they will be once the DD implementation is available.
We'll perhaps need benchmarks to assess speed vs precision among
all extended precision implementations:
* DD in [Numbers],
* Dfp in [Math]
* BigDecimal in the JDK
If "Dfp" is somehow (TBD) useful, it should be moved to a module of
its own, perhaps in [Numbers].
> Do these need to be copied
> to DD or just implement the high/low part, add, multiply and checks for
> overflows?
You might want to have a look at
https://issues.apache.org/jira/browse/MATH-1591
Regards,
Gilles
> > > [...]
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: Move math algorithms from all projects to math libraries
Posted by Dimitrios Efthymiou <ef...@gmail.com>.
Absolutely. Thanks
On Tue, 18 Jul 2023, 07:39 Alex Herbert, <al...@gmail.com> wrote:
> On Tue, 18 Jul 2023 at 01:48, Dimitrios Efthymiou
> <ef...@gmail.com> wrote:
> >
> > Thanks Gilles. I checked NUMBERS-193 and i have an implementation of DD
> and
> > i will put it in *.ext package (TBD) along with some tests. Do i have to
> > look at Dfd.java or something, because these dfd classes in math legacy
> > core have lots of hard-coded decimals in there. Do these need to be
> copied
> > to DD or just implement the high/low part, add, multiply and checks for
> > overflows?
>
> I am currently working on the implementation for this by porting what
> I created for Statistics. If you can wait for this to be completed
> then we can discuss the functionality and public API on the mailing
> list or Jira ticket.
>
> Alex
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>
Re: Move math algorithms from all projects to math libraries
Posted by Alex Herbert <al...@gmail.com>.
On Tue, 18 Jul 2023 at 01:48, Dimitrios Efthymiou
<ef...@gmail.com> wrote:
>
> Thanks Gilles. I checked NUMBERS-193 and i have an implementation of DD and
> i will put it in *.ext package (TBD) along with some tests. Do i have to
> look at Dfd.java or something, because these dfd classes in math legacy
> core have lots of hard-coded decimals in there. Do these need to be copied
> to DD or just implement the high/low part, add, multiply and checks for
> overflows?
I am currently working on the implementation for this by porting what
I created for Statistics. If you can wait for this to be completed
then we can discuss the functionality and public API on the mailing
list or Jira ticket.
Alex
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: Move math algorithms from all projects to math libraries
Posted by Dimitrios Efthymiou <ef...@gmail.com>.
Thanks Gilles. I checked NUMBERS-193 and i have an implementation of DD and
i will put it in *.ext package (TBD) along with some tests. Do i have to
look at Dfd.java or something, because these dfd classes in math legacy
core have lots of hard-coded decimals in there. Do these need to be copied
to DD or just implement the high/low part, add, multiply and checks for
overflows?
On Tue, 18 Jul 2023, 00:53 Gilles Sadowski, <gi...@gmail.com> wrote:
> Le mar. 18 juil. 2023 à 00:38, Dimitrios Efthymiou
> <ef...@gmail.com> a écrit :
> >
> > good to know. I also see
> > https://cwiki.apache.org/confluence/display/COMMONS/MathWishList
> > Is this page still valid.
>
> At the top:
> ---CUT---
> Created by ASF Infrabot, last modified on Nov 01, 2013
> ---CUT---
> What do you think?
> This is a mixed bag of disparate ideas, some of which were (partly or
> completely) implemented, some weren't even discussed on the ML
> since then.
>
> The authoritative list of things to do first are those for which there is
> a decently recent discussion on JIRA.
>
> > I mean, could I work on one of these, like
> > Add further functionality for BigDecimal
> > <https://cwiki.apache.org/confluence/display/COMMONS/MathWishList#> and
> > BigInteger
> > <https://cwiki.apache.org/confluence/display/COMMONS/MathWishList#>
> > arithmetic
>
> See e.g. https://issues.apache.org/jira/browse/NUMBERS-193
>
> Regards,
> Gilles
>
> >
> > On Mon, 17 Jul 2023 at 23:22, Gilles Sadowski <gi...@gmail.com>
> wrote:
> >
> > > Le lun. 17 juil. 2023 à 20:49, Dimitrios Efthymiou
> > > <ef...@gmail.com> a écrit :
> > > >
> > > > All i am saying is that if HBase has a class, say MathUtils and a
> method
> > > > add(double... numbers) and its body has the math algorithm to do
> > > addition,
> > > > we can just replace the method body with a call to the appropriate
> math
> > > > class that does addition. That's all i am saying. HBase, for example
> > > > already depends on math. I am not saying, change the API of HBase.
> Just
> > > > extract whatever math algorithms HBase has, put them in math (if they
> > > don't
> > > > exist there already) and call math.
> > >
> > > Only the concerned projects can tell if they would be willing
> > > to transfer some code to "Commons".
> > >
> > > Gilles
> > >
> > > > [...]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>
Re: Move math algorithms from all projects to math libraries
Posted by Gilles Sadowski <gi...@gmail.com>.
Le mar. 18 juil. 2023 à 00:38, Dimitrios Efthymiou
<ef...@gmail.com> a écrit :
>
> good to know. I also see
> https://cwiki.apache.org/confluence/display/COMMONS/MathWishList
> Is this page still valid.
At the top:
---CUT---
Created by ASF Infrabot, last modified on Nov 01, 2013
---CUT---
What do you think?
This is a mixed bag of disparate ideas, some of which were (partly or
completely) implemented, some weren't even discussed on the ML
since then.
The authoritative list of things to do first are those for which there is
a decently recent discussion on JIRA.
> I mean, could I work on one of these, like
> Add further functionality for BigDecimal
> <https://cwiki.apache.org/confluence/display/COMMONS/MathWishList#> and
> BigInteger
> <https://cwiki.apache.org/confluence/display/COMMONS/MathWishList#>
> arithmetic
See e.g. https://issues.apache.org/jira/browse/NUMBERS-193
Regards,
Gilles
>
> On Mon, 17 Jul 2023 at 23:22, Gilles Sadowski <gi...@gmail.com> wrote:
>
> > Le lun. 17 juil. 2023 à 20:49, Dimitrios Efthymiou
> > <ef...@gmail.com> a écrit :
> > >
> > > All i am saying is that if HBase has a class, say MathUtils and a method
> > > add(double... numbers) and its body has the math algorithm to do
> > addition,
> > > we can just replace the method body with a call to the appropriate math
> > > class that does addition. That's all i am saying. HBase, for example
> > > already depends on math. I am not saying, change the API of HBase. Just
> > > extract whatever math algorithms HBase has, put them in math (if they
> > don't
> > > exist there already) and call math.
> >
> > Only the concerned projects can tell if they would be willing
> > to transfer some code to "Commons".
> >
> > Gilles
> >
> > > [...]
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: Move math algorithms from all projects to math libraries
Posted by Dimitrios Efthymiou <ef...@gmail.com>.
good to know. I also see
https://cwiki.apache.org/confluence/display/COMMONS/MathWishList
Is this page still valid. I mean, could I work on one of these, like
Add further functionality for BigDecimal
<https://cwiki.apache.org/confluence/display/COMMONS/MathWishList#> and
BigInteger
<https://cwiki.apache.org/confluence/display/COMMONS/MathWishList#>
arithmetic
On Mon, 17 Jul 2023 at 23:22, Gilles Sadowski <gi...@gmail.com> wrote:
> Le lun. 17 juil. 2023 à 20:49, Dimitrios Efthymiou
> <ef...@gmail.com> a écrit :
> >
> > All i am saying is that if HBase has a class, say MathUtils and a method
> > add(double... numbers) and its body has the math algorithm to do
> addition,
> > we can just replace the method body with a call to the appropriate math
> > class that does addition. That's all i am saying. HBase, for example
> > already depends on math. I am not saying, change the API of HBase. Just
> > extract whatever math algorithms HBase has, put them in math (if they
> don't
> > exist there already) and call math.
>
> Only the concerned projects can tell if they would be willing
> to transfer some code to "Commons".
>
> Gilles
>
> > [...]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>
Re: Move math algorithms from all projects to math libraries
Posted by Dimitrios Efthymiou <ef...@gmail.com>.
OK. That is what I need to know. Thank you Gilles
On Mon, 17 Jul 2023 at 23:22, Gilles Sadowski <gi...@gmail.com> wrote:
> Le lun. 17 juil. 2023 à 20:49, Dimitrios Efthymiou
> <ef...@gmail.com> a écrit :
> >
> > All i am saying is that if HBase has a class, say MathUtils and a method
> > add(double... numbers) and its body has the math algorithm to do
> addition,
> > we can just replace the method body with a call to the appropriate math
> > class that does addition. That's all i am saying. HBase, for example
> > already depends on math. I am not saying, change the API of HBase. Just
> > extract whatever math algorithms HBase has, put them in math (if they
> don't
> > exist there already) and call math.
>
> Only the concerned projects can tell if they would be willing
> to transfer some code to "Commons".
>
> Gilles
>
> > [...]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>
Re: Move math algorithms from all projects to math libraries
Posted by Gilles Sadowski <gi...@gmail.com>.
Le lun. 17 juil. 2023 à 20:49, Dimitrios Efthymiou
<ef...@gmail.com> a écrit :
>
> All i am saying is that if HBase has a class, say MathUtils and a method
> add(double... numbers) and its body has the math algorithm to do addition,
> we can just replace the method body with a call to the appropriate math
> class that does addition. That's all i am saying. HBase, for example
> already depends on math. I am not saying, change the API of HBase. Just
> extract whatever math algorithms HBase has, put them in math (if they don't
> exist there already) and call math.
Only the concerned projects can tell if they would be willing
to transfer some code to "Commons".
Gilles
> [...]
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: Move math algorithms from all projects to math libraries
Posted by Dimitrios Efthymiou <ef...@gmail.com>.
All i am saying is that if HBase has a class, say MathUtils and a method
add(double... numbers) and its body has the math algorithm to do addition,
we can just replace the method body with a call to the appropriate math
class that does addition. That's all i am saying. HBase, for example
already depends on math. I am not saying, change the API of HBase. Just
extract whatever math algorithms HBase has, put them in math (if they don't
exist there already) and call math. I don't have specific examples in mind,
but i know a few projects that already depend on math like
https://github.com/apache/pinot/blob/master/pom.xml
https://github.com/apache/flink/blob/master/pom.xml
https://github.com/apache/hbase/blob/master/pom.xml
https://github.com/apache/drill/blob/master/pom.xml
https://github.com/apache/accumulo/blob/main/pom.xml
https://github.com/apache/hive/blob/master/pom.xml
https://github.com/apache/ofbiz-framework/blob/trunk/build.gradle
https://github.com/apache/jmeter/blob/master/gradle.properties
https://github.com/apache/tomee/blob/main/pom.xml
On Mon, 17 Jul 2023, 18:39 Gilles Sadowski, <gi...@gmail.com> wrote:
> Le lun. 17 juil. 2023 à 15:19, Dimitrios Efthymiou
> <ef...@gmail.com> a écrit :
> >
> > I don't have specific functionality in mind.
>
> You mentioned ASF projects which, IIUC, you said depend on
> "Commons Math". So I asked: On which "Commons Math"
> utilities do they depend? [Last time I checked (I don't remember
> where or how), most were from the "stat" package).]
>
> > I just had an idea
> > to do a search for dependencies on java.lang.Math or BigInteger
> > or BigDecimal and if I find any, I would see if these dependencies
> > exist because the project has its own custom math algorithms.
> > If yes then, there you go. We have something to replace by
> > utilising the commons math libraries. I haven't done a
> > search yet. I wanted to see if the community would be OK
> > with new tickets (if any) for new functionality to be implemented
> > in the math libraries, GIVEN that there will automatically be
> > use-cases i.e. apache already uses those algorithms.
> > When I suggest new math functionality, I am always asked
> > what the use-cases are and I don't have any, because I just
> > want to implement unimplemented math algorithms. So, I thought
> > that this way (if I find any) there will be use-cases
>
> Yes, but if those projects don't want to depend on the new
> functionality, your time would be better used elsewhere.
> As you could read today[1], it's difficult to even share code
> inside the "Commons" project. For another project to
> delegate some functionality is much more to ask. What
> usually happens is the other way around; some functionality
> already exists somewhere, and is taken advantage of right
> away.
> For better or (and?) worse, most use-cases came from
> people who were using CM and needed something more,
> which they contributed back.
> Since it's "there" already, better improve it than find more
> things to add (if you don't have use-cases for them).
> Did I mention "clustering" and "genetic algorithm"?
>
> Regards,
> Gilles
>
> [1] https://issues.apache.org/jira/browse/IMAGING-358
>
> >
> > On Mon, 17 Jul 2023 at 11:43, Gilles Sadowski <gi...@gmail.com>
> wrote:
> >
> > > Le lun. 17 juil. 2023 à 02:34, Dimitrios Efthymiou
> > > <ef...@gmail.com> a écrit :
> > > >
> > > > I didn't say to introduce a dependency on math. I said that libraries
> > > that
> > > > already depend on math, may have math algorithms implemented that we
> > > could
> > > > replace with a call to the appropriate commons math methods
> > >
> > > Sounds nice.
> > > If we could already do that just within "Commons"... (see other post).
> > >
> > > > or if math
> > > > doesn't have those math algorithms, we can move them to math. Flink
> and
> > > > HBase for example depend on math
> > >
> > > For which functionality?
> > >
> > > Regards,
> > > Gilles
> > >
> > > >> [...]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>
Re: Move math algorithms from all projects to math libraries
Posted by Gilles Sadowski <gi...@gmail.com>.
Le lun. 17 juil. 2023 à 15:19, Dimitrios Efthymiou
<ef...@gmail.com> a écrit :
>
> I don't have specific functionality in mind.
You mentioned ASF projects which, IIUC, you said depend on
"Commons Math". So I asked: On which "Commons Math"
utilities do they depend? [Last time I checked (I don't remember
where or how), most were from the "stat" package).]
> I just had an idea
> to do a search for dependencies on java.lang.Math or BigInteger
> or BigDecimal and if I find any, I would see if these dependencies
> exist because the project has its own custom math algorithms.
> If yes then, there you go. We have something to replace by
> utilising the commons math libraries. I haven't done a
> search yet. I wanted to see if the community would be OK
> with new tickets (if any) for new functionality to be implemented
> in the math libraries, GIVEN that there will automatically be
> use-cases i.e. apache already uses those algorithms.
> When I suggest new math functionality, I am always asked
> what the use-cases are and I don't have any, because I just
> want to implement unimplemented math algorithms. So, I thought
> that this way (if I find any) there will be use-cases
Yes, but if those projects don't want to depend on the new
functionality, your time would be better used elsewhere.
As you could read today[1], it's difficult to even share code
inside the "Commons" project. For another project to
delegate some functionality is much more to ask. What
usually happens is the other way around; some functionality
already exists somewhere, and is taken advantage of right
away.
For better or (and?) worse, most use-cases came from
people who were using CM and needed something more,
which they contributed back.
Since it's "there" already, better improve it than find more
things to add (if you don't have use-cases for them).
Did I mention "clustering" and "genetic algorithm"?
Regards,
Gilles
[1] https://issues.apache.org/jira/browse/IMAGING-358
>
> On Mon, 17 Jul 2023 at 11:43, Gilles Sadowski <gi...@gmail.com> wrote:
>
> > Le lun. 17 juil. 2023 à 02:34, Dimitrios Efthymiou
> > <ef...@gmail.com> a écrit :
> > >
> > > I didn't say to introduce a dependency on math. I said that libraries
> > that
> > > already depend on math, may have math algorithms implemented that we
> > could
> > > replace with a call to the appropriate commons math methods
> >
> > Sounds nice.
> > If we could already do that just within "Commons"... (see other post).
> >
> > > or if math
> > > doesn't have those math algorithms, we can move them to math. Flink and
> > > HBase for example depend on math
> >
> > For which functionality?
> >
> > Regards,
> > Gilles
> >
> > >> [...]
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: Move math algorithms from all projects to math libraries
Posted by Dimitrios Efthymiou <ef...@gmail.com>.
I don't have specific functionality in mind. I just had an idea
to do a search for dependencies on java.lang.Math or BigInteger
or BigDecimal and if I find any, I would see if these dependencies
exist because the project has its own custom math algorithms.
If yes then, there you go. We have something to replace by
utilising the commons math libraries. I haven't done a
search yet. I wanted to see if the community would be OK
with new tickets (if any) for new functionality to be implemented
in the math libraries, GIVEN that there will automatically be
use-cases i.e. apache already uses those algorithms.
When I suggest new math functionality, I am always asked
what the use-cases are and I don't have any, because I just
want to implement unimplemented math algorithms. So, I thought
that this way (if I find any) there will be use-cases
On Mon, 17 Jul 2023 at 11:43, Gilles Sadowski <gi...@gmail.com> wrote:
> Le lun. 17 juil. 2023 à 02:34, Dimitrios Efthymiou
> <ef...@gmail.com> a écrit :
> >
> > I didn't say to introduce a dependency on math. I said that libraries
> that
> > already depend on math, may have math algorithms implemented that we
> could
> > replace with a call to the appropriate commons math methods
>
> Sounds nice.
> If we could already do that just within "Commons"... (see other post).
>
> > or if math
> > doesn't have those math algorithms, we can move them to math. Flink and
> > HBase for example depend on math
>
> For which functionality?
>
> Regards,
> Gilles
>
> >> [...]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>
Re: Move math algorithms from all projects to math libraries
Posted by Gilles Sadowski <gi...@gmail.com>.
Le lun. 17 juil. 2023 à 02:34, Dimitrios Efthymiou
<ef...@gmail.com> a écrit :
>
> I didn't say to introduce a dependency on math. I said that libraries that
> already depend on math, may have math algorithms implemented that we could
> replace with a call to the appropriate commons math methods
Sounds nice.
If we could already do that just within "Commons"... (see other post).
> or if math
> doesn't have those math algorithms, we can move them to math. Flink and
> HBase for example depend on math
For which functionality?
Regards,
Gilles
>> [...]
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: Move math algorithms from all projects to math libraries
Posted by Dimitrios Efthymiou <ef...@gmail.com>.
I didn't say to introduce a dependency on math. I said that libraries that
already depend on math, may have math algorithms implemented that we could
replace with a call to the appropriate commons math methods or if math
doesn't have those math algorithms, we can move them to math. Flink and
HBase for example depend on math
On Mon, 17 Jul 2023, 01:08 Gary Gregory, <ga...@gmail.com> wrote:
> At one point, I had proposed to deprecate Commons Lang' math package in
> favor of something else in Commons Math or elsewhere. Commons Lang would
> NOT depend on Commons Math/Other, we would just deprecate with a forwarding
> link.
>
> This idea was rejected IIRC because I do not think there was agreement on
> where to put what. I think the Lang Fraction class for example is not a
> match for the one in Math or Numbers or wherever it is.
>
> One thing to keep in mind it's OK to fill in the gaps in one component
> (Math, Numbers, and so on) but that does not automatically mean that a
> dependency will be introduced. For example, it would be odd for Lang or IO
> to depend on Math.
>
> Gary
>
> On Sun, Jul 16, 2023, 19:55 Dimitrios Efthymiou <
> efthymiou.dimitrios1@gmail.com> wrote:
>
> > Hello everyone.
> > One thing i would love to do is to go through the apache projects, see
> > which ones already depend on the math library, and see if they implement
> > some math stuff that could be replaced by a call to commons math or move
> > that function to the math library. Would such cases be considered valid
> for
> > implementing new math algorithms inside the math libraries? I don't
> think i
> > have seen any ticket that wants to implement new math algorithms.
> >
> > Thank you
> >
>
Re: Move math algorithms from all projects to math libraries
Posted by Gary Gregory <ga...@gmail.com>.
At one point, I had proposed to deprecate Commons Lang' math package in
favor of something else in Commons Math or elsewhere. Commons Lang would
NOT depend on Commons Math/Other, we would just deprecate with a forwarding
link.
This idea was rejected IIRC because I do not think there was agreement on
where to put what. I think the Lang Fraction class for example is not a
match for the one in Math or Numbers or wherever it is.
One thing to keep in mind it's OK to fill in the gaps in one component
(Math, Numbers, and so on) but that does not automatically mean that a
dependency will be introduced. For example, it would be odd for Lang or IO
to depend on Math.
Gary
On Sun, Jul 16, 2023, 19:55 Dimitrios Efthymiou <
efthymiou.dimitrios1@gmail.com> wrote:
> Hello everyone.
> One thing i would love to do is to go through the apache projects, see
> which ones already depend on the math library, and see if they implement
> some math stuff that could be replaced by a call to commons math or move
> that function to the math library. Would such cases be considered valid for
> implementing new math algorithms inside the math libraries? I don't think i
> have seen any ticket that wants to implement new math algorithms.
>
> Thank you
>