[Fwd: Re: no toString method?]
- Subject: [Fwd: Re: no toString method?]
- From: Ronald Boisvert <boisvert@nist.gov>
- Date: Mon, 05 Oct 2009 08:46:16 -0400
- Content-Transfer-Encoding: 7bit
- Content-Type: text/plain; charset=iso-8859-1; format=flowed
- User-Agent: Thunderbird 2.0.0.23 (Windows/20090812)
-------- 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