commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sébastien Brisard (JIRA) <>
Subject [jira] [Commented] (MATH-646) Unmodifiable views of RealVector
Date Mon, 15 Aug 2011 20:19:27 GMT


Sébastien Brisard commented on MATH-646:

Rather than an issue of large source file, the issue is whether this class should part of
the public API.
Personally I think that it shouldn't
I agree, that's the reason why I suggested we make this class private. No problem, I'll make
it a nested, anonymous class within the {{unmodifiableRealVector()}} method.
I'm suspicious that it is possible to call "setIndex" on the supposedly unmodifiable entry.
Maybe that it is harmless?
I have checked that calling {{setIndex}} is indeed harmless while iterating over the vector
in question. However, in my view, this method sould not be visible.

Thanks for your detailed review of the code. I'll have these errors corrected by the end of
this week, if that's OK with you.

> Unmodifiable views of RealVector
> --------------------------------
>                 Key: MATH-646
>                 URL:
>             Project: Commons Math
>          Issue Type: New Feature
>    Affects Versions: 3.0
>            Reporter: Sébastien Brisard
>              Labels: linear, vector
>         Attachments: MATH-646.patch
> The issue has been discussed on the [mailing list|<>].
Please find attached a proposal for a new class {{UnmodifiableRealVector}}. I chose not to
nest it in {{AbstractRealVector}} because it would make the corresponding file huge. Therefore,
{{UnmodifiableRealVector}} is {{final}}. Maybe you'd like it to be {{private}} as well? A
static method is provided in {{AbstractRealVector}} to build an {{UnmodifiableRealVector}}
from any {{RealVector}}.
> Tests are also provided. Since iterating through different implementations of {{RealVector}}
is actually different, a test is provided for {{UnmodifiableRealVector}} built on {{ArrayRealVector}}
and {{OpenMapRealVector}}. These tests both derive from the same abstract test class. Hope
everything works fine.

This message is automatically generated by JIRA.
For more information on JIRA, see:


View raw message