[Fwd: Re: no toString method?]


Sender: Michal Rehak <michal.rehak@gmail.com>
Subject: Re: no toString method?


Hi David,

perhaps this method may help (just a wrapper over print method for lazy 
people like me):

    /** Prints matrix content into string with linebreaks
      *
      * @param A
      *            printed matrix
      * @param width
      *            column width of output
      * @param precision
      *            number precision of output
      * @return string representation of given matrix
      */
     public static String println(Matrix A, int width, int precision) {
         StringWriter sw = new StringWriter();
         A.print(new PrintWriter(sw), width, precision);

         sw.flush();
         return sw.toString();
     }


But it is usefull for small matrixes only. I tried to implement similar 
methods, as found in matlab (into static class). If You are of any 
interest, I may post the code.


Michal


rakudave wrote:
> Dear JAMA authors
> 
> I just started using JAMA for school when I noticed that there is no
> Matrix.toString method, so I can't see what's going on. Do you plan to
> add such a method in the future or is there a reason for this absence?
> 
> kind regards
> David
> 
> 
> 
> 
> 







Date Index | Thread Index | Problems or questions? Contact list-master@nist.gov