[Fwd: Re: no toString method?]





-------- Original Message --------
Subject: 	Re: no toString method?
Date: 	Sun, 4 Oct 2009 15:58:47 -0400
From: 	Sam Wilson <samwilson001@gmail.com>
Reply-To: 	samwilson001@gmail.com <samwilson001@gmail.com>
To: 	Boisvert, Ronald F. <ronald.boisvert@nist.gov>
References: 	<4AC8BCA4.70104@nist.gov>



This is the two string method i use, it is suitable for any sized 
matrix, although larger matrix are awkward to visualise

http://code.google.com/p/annas/source/browse/Annas/Trunk/src/Annas/Math/Matrix.java

this is a link to a project I own which has a need for matrix manipulation

http://annas.googlecode.com

2009/10/4 Michal Rehak <michal.rehak@gmail.com 
<mailto:michal.rehak@gmail.com>>

    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