commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joakim Soderberg <>
Subject RE: how to load a RealMatrix from file
Date Fri, 20 Feb 2015 18:21:18 GMT
Thanks Thomas,
That’s helpful, but I think you should add more easy-to-use functions for the convenience
of the research community who just want to implement some algorithm and not spend time with
coding IO.

For my second question; why is there no vector - matrix multiplication operator?, i.e. x A,
where x is a vector and A a matrix.

-----Original Message-----
From: Thomas Neidhart [] 
Sent: Friday, February 20, 2015 1:50 AM
To: Commons Users List
Subject: Re: how to load a RealMatrix from file

Hi Joakim,

it depends how you stored the matrix in the first place.

The MatrixUtils.deserializeRealMatrix() method will only work if you have previously serialized
the matrix using MatrixUtils.serializeRealMatrix() and is mainly intended to be used for standard
Java serialization.

In case you want to load a matrix stored in text format, you might find the RealMatrixFormat
class useful.
There are two formats defined:

 * MatrixUtils.OCTAVE_FORMAT

but you can define your own format for formatting/parsing.


On Fri, Feb 20, 2015 at 6:02 AM, Joakim Soderberg <>

> Hello,
> Can someone please explain the easiest way to load a RealMatrix from flle?
> I have found MatrixUtils.deserializeRealMatrix(Object instance, String 
> fieldName, ObjectInputStream ois)
> But I was expecting to find a function like this:
>                 loadMatrix( inputStream)
> And why doesn't RealVector have an "operate" for Vector - Matrix 
> multiplication?
> cheers
> /J

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message