Immutable / unmodifiable SimpleMatrix wrapper

19 views
Skip to first unread message

John Bauer

unread,
Nov 3, 2020, 10:09:14 PM11/3/20
to efficient-java-matrix-library-discuss
Do you have any interest in adding an immutable / unmodifiable wrapper for SimpleMatrix?  If that's not on your radar, would you have any interest in a pull request which does that?

Peter A

unread,
Nov 3, 2020, 10:44:16 PM11/3/20
to efficient-java-mat...@googlegroups.com
Not on the current plan but if done right there would be no issue adding it. The main problem with an immutable SimpleMatrix is making it really immutable and not just inconvenient to modify. By design, much of EJML provides you access to its raw data types and avoids encapsulation. This helps with speed and makes it a nice library to wrap.

If you made all the accessors in SimpleMatrix read only, someone could just access the matrix it wraps and get full access to everything. If you blocked access to the matrix it wraps then you would deny access to all the operations not supported in SimpleMatrix by found in CommonOps and other places. The cleanest way to handle this would require Java to support something like C++'s const. Not holding my breath on that.

 

On Tue, Nov 3, 2020 at 7:09 PM John Bauer <hor...@gmail.com> wrote:
Do you have any interest in adding an immutable / unmodifiable wrapper for SimpleMatrix?  If that's not on your radar, would you have any interest in a pull request which does that?

--
You received this message because you are subscribed to the Google Groups "efficient-java-matrix-library-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to efficient-java-matrix-li...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/efficient-java-matrix-library-discuss/b37e66ae-5f2f-44b1-bb76-1a66799395f3n%40googlegroups.com.


--
"Now, now my good man, this is no time for making enemies."    — Voltaire (1694-1778), on his deathbed in response to a priest asking that he renounce Satan.
Reply all
Reply to author
Forward
0 new messages