You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Roman Werpachowski (JIRA)" <ji...@apache.org> on 2010/07/21 10:58:50 UTC

[jira] Created: (MATH-391) Inconsistent behaviour of constructors in ArrayRealVector class

Inconsistent behaviour of constructors in ArrayRealVector class
---------------------------------------------------------------

                 Key: MATH-391
                 URL: https://issues.apache.org/jira/browse/MATH-391
             Project: Commons Math
          Issue Type: Bug
    Affects Versions: 2.1
            Reporter: Roman Werpachowski


ArrayRealVector(double[] d) allows to construct a zero-length vector, but ArrayRealVector(double[] d, boolean copyArray) doesn't. Both should allow this as zero-length vectors are mathematically well-defined objects and they are useful boundary cases in many algorithms.

Zero-length vectors worked in version 2.0, they should be working in 2.1 as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MATH-391) Inconsistent behaviour of constructors in ArrayRealVector class

Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-391?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12917274#action_12917274 ] 

Phil Steitz commented on MATH-391:
----------------------------------

I agree that the code should be consistent.  I agree as well that a zero-dimensional vector is legit.   Can anyone explain why ArrayRealVector(double[] d, boolean copyArray) requires positive length?

> Inconsistent behaviour of constructors in ArrayRealVector class
> ---------------------------------------------------------------
>
>                 Key: MATH-391
>                 URL: https://issues.apache.org/jira/browse/MATH-391
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 2.1
>            Reporter: Roman Werpachowski
>             Fix For: 2.2
>
>
> ArrayRealVector(double[] d) allows to construct a zero-length vector, but ArrayRealVector(double[] d, boolean copyArray) doesn't. Both should allow this as zero-length vectors are mathematically well-defined objects and they are useful boundary cases in many algorithms.
> This breaks some arithmetic operators (addition) on zero-length real vectors which worked in 2.0 but don't work in 2.1

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (MATH-391) Inconsistent behaviour of constructors in ArrayRealVector class

Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-391?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phil Steitz updated MATH-391:
-----------------------------

    Fix Version/s: 2.2

> Inconsistent behaviour of constructors in ArrayRealVector class
> ---------------------------------------------------------------
>
>                 Key: MATH-391
>                 URL: https://issues.apache.org/jira/browse/MATH-391
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 2.1
>            Reporter: Roman Werpachowski
>             Fix For: 2.2
>
>
> ArrayRealVector(double[] d) allows to construct a zero-length vector, but ArrayRealVector(double[] d, boolean copyArray) doesn't. Both should allow this as zero-length vectors are mathematically well-defined objects and they are useful boundary cases in many algorithms.
> This breaks some arithmetic operators (addition) on zero-length real vectors which worked in 2.0 but don't work in 2.1

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (MATH-391) Inconsistent behaviour of constructors in ArrayRealVector class

Posted by "Luc Maisonobe (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-391?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Luc Maisonobe resolved MATH-391.
--------------------------------

    Resolution: Fixed

Fixed in subversion repository as of r1003993 for barnch 2.X and r1003994 for trunk.
Note that the same problem occurred also in ArrayFieldVector but the fix is different. For Field-based vectors, we need to get the field, so either we use a non-empty array and retrieve the field from the first array element or we add a parameter for the field and allow the array to be empty. The two choices are now possible, as new constructors have been added and the javadoc updated to explain this behavior.
Thanks for reporting the issue.

> Inconsistent behaviour of constructors in ArrayRealVector class
> ---------------------------------------------------------------
>
>                 Key: MATH-391
>                 URL: https://issues.apache.org/jira/browse/MATH-391
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 2.1
>            Reporter: Roman Werpachowski
>             Fix For: 2.2
>
>
> ArrayRealVector(double[] d) allows to construct a zero-length vector, but ArrayRealVector(double[] d, boolean copyArray) doesn't. Both should allow this as zero-length vectors are mathematically well-defined objects and they are useful boundary cases in many algorithms.
> This breaks some arithmetic operators (addition) on zero-length real vectors which worked in 2.0 but don't work in 2.1

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (MATH-391) Inconsistent behaviour of constructors in ArrayRealVector class

Posted by "Roman Werpachowski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MATH-391?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roman Werpachowski updated MATH-391:
------------------------------------

    Description: 
ArrayRealVector(double[] d) allows to construct a zero-length vector, but ArrayRealVector(double[] d, boolean copyArray) doesn't. Both should allow this as zero-length vectors are mathematically well-defined objects and they are useful boundary cases in many algorithms.

This breaks some arithmetic operators (addition) on zero-length real vectors which worked in 2.0 but don't work in 2.1

  was:
ArrayRealVector(double[] d) allows to construct a zero-length vector, but ArrayRealVector(double[] d, boolean copyArray) doesn't. Both should allow this as zero-length vectors are mathematically well-defined objects and they are useful boundary cases in many algorithms.

Zero-length vectors worked in version 2.0, they should be working in 2.1 as well.


> Inconsistent behaviour of constructors in ArrayRealVector class
> ---------------------------------------------------------------
>
>                 Key: MATH-391
>                 URL: https://issues.apache.org/jira/browse/MATH-391
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 2.1
>            Reporter: Roman Werpachowski
>
> ArrayRealVector(double[] d) allows to construct a zero-length vector, but ArrayRealVector(double[] d, boolean copyArray) doesn't. Both should allow this as zero-length vectors are mathematically well-defined objects and they are useful boundary cases in many algorithms.
> This breaks some arithmetic operators (addition) on zero-length real vectors which worked in 2.0 but don't work in 2.1

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MATH-391) Inconsistent behaviour of constructors in ArrayRealVector class

Posted by "Luc Maisonobe (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MATH-391?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12917295#action_12917295 ] 

Luc Maisonobe commented on MATH-391:
------------------------------------

Most probably my bad ...

> Inconsistent behaviour of constructors in ArrayRealVector class
> ---------------------------------------------------------------
>
>                 Key: MATH-391
>                 URL: https://issues.apache.org/jira/browse/MATH-391
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 2.1
>            Reporter: Roman Werpachowski
>             Fix For: 2.2
>
>
> ArrayRealVector(double[] d) allows to construct a zero-length vector, but ArrayRealVector(double[] d, boolean copyArray) doesn't. Both should allow this as zero-length vectors are mathematically well-defined objects and they are useful boundary cases in many algorithms.
> This breaks some arithmetic operators (addition) on zero-length real vectors which worked in 2.0 but don't work in 2.1

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.