commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Neidhart <thomas.neidh...@gmail.com>
Subject Re: how to load a RealMatrix from file
Date Fri, 20 Feb 2015 09:49:32 GMT
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.DEFAULT_FORMAT
 * MatrixUtils.OCTAVE_FORMAT

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

Thomas


On Fri, Feb 20, 2015 at 6:02 AM, Joakim Soderberg <j.soderberg@samsung.com>
wrote:

> 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
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message