commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gilles (JIRA)" <j...@apache.org>
Subject [jira] [Created] (MATH-629) Multiple dispatch of overloaded methods in "ArrayRealVector"
Date Fri, 22 Jul 2011 22:43:09 GMT
Multiple dispatch of overloaded methods in "ArrayRealVector"
------------------------------------------------------------

                 Key: MATH-629
                 URL: https://issues.apache.org/jira/browse/MATH-629
             Project: Commons Math
          Issue Type: Improvement
            Reporter: Gilles
            Assignee: Gilles
            Priority: Trivial
             Fix For: 3.0


E.g. the "add(RealVector)" method is
{code}
public RealVector add(RealVector v) {
    if (v instanceof ArrayRealVector) {
        return add((ArrayRealVector) v);
    } else { // ...
{code}

To avoid one unnecessary method call, it should become
{code}
public RealVector add(RealVector v) {
    if (v instanceof ArrayRealVector) {
        return add(((ArrayRealVector) v).data);
    } else { // ...
{code}

And similarly for other methods.


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message