You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Heinz Kredel <kr...@rz.uni-mannheim.de> on 2012/01/21 13:01:15 UTC

[Math] Proposal for a set of interoperable interfaces for mathematical structures

Hi,

I develop a computer algebra system in Java (JAS) at 

   http://krum.rz.uni-mannheim.de/jas/

The system has only limited capabilities for linear algebra and its main focus 
is on general commutative and non commutative algebras. So I would eventually 
like to use linear algebra algorithms from Apache Commons Math or other 
libraries with the JAS data types (e.g. polynomials). However, the 
interoperability is hindered as there must be adaptor classes to implement the 
respective interfaces and to delegate the computation to the respective 
implementation. For example see

  http://krum.rz.uni-mannheim.de/jas/commons-math_adapter.jar
  http://krum.rz.uni-mannheim.de/jas/jlinalg_adapter.jar

As this has obvious disadvantages I propose to design and agree on a common 
set of interfaces to improve the situation. The interfaces could be hosted at 
ACM and then used by all interested parties. As there are already some related 
issues in the ACM Jira issue tracker with respect to the interfaces, for 
example 

https://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&jqlQuery=project+%3D+MATH+AND+%28summary+%7E+FieldElement+OR+description+%7E+FieldElement+OR+comment+%7E+FieldElement%29

it might be the time to work in the proposed direction. As I am not familiar 
with the ACM solution and conclusion finding and decision making, please make 
proposals on how we could work together, if you have interests in the same 
direction.

Kind regards

  Heinz

Re: [Math] Proposal for a set of interoperable interfaces for mathematical structures

Posted by Heinz Kredel <kr...@rz.uni-mannheim.de>.
Am Mittwoch 25 Januar 2012, 19:13:25 schrieb Axel:
> To extend JAS with the commons-math methods the easiest way is to extend
> the
> edu.jas.structure.AbelianGroupElem like this:
> 
> public interface AbelianGroupElem<C extends AbelianGroupElem<C>>
>          extends Element<C>, FieldElement<C>
> 
> and add the methods:
> add() and
> getField() in all derived classes.
> 
> But there's already an add() method in the AbelianGroupElem interface which
> is called sum().
> This is probably to avoid the method name add() which is often used in the
> Java Collection framework.
> (see https://issues.apache.org/jira/browse/MATH-285)

may be the names are not so important at the moment. I have given one reason 
for choosing sum() as name - some protection against my own stupidity. There 
may be other reasons to choose other names. For JAS I would not bother to 
change names in the current 2.4 release. My plan is to have such things/issues 
resolved and fixed for the 3.0 release.

There are other methods which we have to discuss, e.g. the toScript() method 
in Element. As far as I can see this method is useless in the current setting 
of ACMath. Only if ACMAth would have some interest/future plans to provide a 
scripting frontend to the library, for example like Octave or Scilab, it would 
make sense. So we must face the problem that not all methods are equally 
important for the different libraries. What we should have is a minimal set 
which provides the best interoperability and has enough mathematical methods 
to be useful. So continuing with Axels example we would have the following:

edu.jas.structure would be revised and go to org.apache.commons.math.structure 
(or what ever package ACMath sees fit). I would then restructure 
edu.jas.structure to extend the interfaces from 
org.apache.commons.math.structure and add interfaces as required. For example 
with

public interface Scripting {
   String toScript();
}

it would be in JAS

public interface RingElem<C extends RingElem<C>> extends 
   org.apache.commons.math.structure.RingElem, Scripting {
}

JAS has already some of such explicit return value interfaces, e.g. Rational, 
Modular and ModularRingfactory in edu.jas.arith. (It only makes reading of the 
class definition a bit more difficult.)

One can do similar extensions for missing methods for ACMath usage if 
required.

Heinz

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [Math] Proposal for a set of interoperable interfaces for mathematical structures

Posted by Axel <ax...@gmail.com>.
To extend JAS with the commons-math methods the easiest way is to extend
the
edu.jas.structure.AbelianGroupElem like this:

public interface AbelianGroupElem<C extends AbelianGroupElem<C>>
         extends Element<C>, FieldElement<C>

and add the methods:
add() and
getField() in all derived classes.

But there's already an add() method in the AbelianGroupElem interface which
is called sum().
This is probably to avoid the method name add() which is often used in the
Java Collection framework.
(see https://issues.apache.org/jira/browse/MATH-285)

Re: [Math] Proposal for a set of interoperable interfaces for mathematical structures

Posted by Axel <ax...@gmail.com>.
On Sat, Jan 21, 2012 at 2:10 PM, Luc Maisonobe <Lu...@free.fr>wrote:

> Le 21/01/2012 13:01, Heinz Kredel a écrit :
> > Hi,
> >
> ...
> Could you send us a link to the API rather than links to jars ?
>
>
JAS Javadoc API
http://krum.rz.uni-mannheim.de/jas/doc/api/index.html

The edu.jas.structure package contains the discussed basic structural
interfaces.
http://krum.rz.uni-mannheim.de/jas/doc/api/edu/jas/structure/package-summary.html

The current JAS soures could be found here:
http://code.google.com/p/java-algebra-system/source/browse/#git%2Fsrc%2Fedu%2Fjas%2Fstructure

Motivation for the used design:
http://krum.rz.uni-mannheim.de/kredel/oocas-casc2010-slides.pdf

Summary of algorithms based on these structures:
http://krum.rz.uni-mannheim.de/jas/gb-book.html
http://krum.rz.uni-mannheim.de/jas/algo-ca-book.html

Re: [Math] Proposal for a set of interoperable interfaces for mathematical structures

Posted by Heinz Kredel <kr...@rz.uni-mannheim.de>.
Am Samstag 21 Januar 2012, 14:10:56 schrieb Luc Maisonobe:
> Le 21/01/2012 13:01, Heinz Kredel a écrit :
> > Hi,
> > 
> > I develop a computer algebra system in Java (JAS) at
> > 
> >    http://krum.rz.uni-mannheim.de/jas/
> > 
> > The system has only limited capabilities for linear algebra and its main
> > focus is on general commutative and non commutative algebras. So I
> > would eventually like to use linear algebra algorithms from Apache
> > Commons Math or other libraries with the JAS data types (e.g.
> > polynomials). However, the interoperability is hindered as there must
> > be adaptor classes to implement the respective interfaces and to
> > delegate the computation to the respective implementation. For example
> > see
> > 
> >   http://krum.rz.uni-mannheim.de/jas/commons-math_adapter.jar
> >   http://krum.rz.uni-mannheim.de/jas/jlinalg_adapter.jar
> 
> Could you send us a link to the API rather than links to jars ?

? I had a included a summary and discussion of the APIs and interfaces. In 
case they were removed from the email you can find them at

http://krum.rz.uni-mannheim.de/kredel/cas-inter.pdf

Javadoc of the interfaces is at

http://krum.rz.uni-mannheim.de/jas/doc/api/edu/jas/structure/package-
summary.html


> > As this has obvious disadvantages I propose to design and agree on a
> > common set of interfaces to improve the situation.
> 
> Shared standards are always a good thing.
> 
> > The interfaces could be hosted at
> > ACM and then used by all interested parties. As there are already some
> > related issues in the ACM Jira issue tracker with respect to the
> > interfaces, for example
> > 
> > https://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&jql
> > Query=project+%3D+MATH+AND+%28summary+%7E+FieldElement+OR+description+%7
> > E+FieldElement+OR+comment+%7E+FieldElement%29
> > 
> > it might be the time to work in the proposed direction. As I am not
> > familiar with the ACM solution and conclusion finding and decision
> > making, please make proposals on how we could work together, if you
> > have interests in the same direction.
> 
> Could you send us a link to ACM solution ?

? The Apache commons math interfaces are in 

http://commons.apache.org/math/api-2.2/org/apache/commons/math/package-
summary.html

http://commons.apache.org/math/apidocs/org/apache/commons/math/package-
summary.html

regards

  Heinz

> 
> thanks
> Luc
> 
> > Kind regards
> > 
> >   Heinz


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [Math] Proposal for a set of interoperable interfaces for mathematical structures

Posted by Luc Maisonobe <Lu...@free.fr>.
Le 21/01/2012 13:01, Heinz Kredel a écrit :
> Hi,
> 
> I develop a computer algebra system in Java (JAS) at 
> 
>    http://krum.rz.uni-mannheim.de/jas/
> 
> The system has only limited capabilities for linear algebra and its main focus 
> is on general commutative and non commutative algebras. So I would eventually 
> like to use linear algebra algorithms from Apache Commons Math or other 
> libraries with the JAS data types (e.g. polynomials). However, the 
> interoperability is hindered as there must be adaptor classes to implement the 
> respective interfaces and to delegate the computation to the respective 
> implementation. For example see
> 
>   http://krum.rz.uni-mannheim.de/jas/commons-math_adapter.jar
>   http://krum.rz.uni-mannheim.de/jas/jlinalg_adapter.jar

Could you send us a link to the API rather than links to jars ?

> 
> As this has obvious disadvantages I propose to design and agree on a common 
> set of interfaces to improve the situation.

Shared standards are always a good thing.

> The interfaces could be hosted at 
> ACM and then used by all interested parties. As there are already some related 
> issues in the ACM Jira issue tracker with respect to the interfaces, for 
> example 
> 
> https://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&jqlQuery=project+%3D+MATH+AND+%28summary+%7E+FieldElement+OR+description+%7E+FieldElement+OR+comment+%7E+FieldElement%29
> 
> it might be the time to work in the proposed direction. As I am not familiar 
> with the ACM solution and conclusion finding and decision making, please make 
> proposals on how we could work together, if you have interests in the same 
> direction.

Could you send us a link to ACM solution ?

thanks
Luc

> 
> Kind regards
> 
>   Heinz
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org