File tree Expand file tree Collapse file tree
src/ubic/basecode/io/writer Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2929import java .util .Iterator ;
3030import java .util .Map ;
3131
32+ import cern .colt .matrix .DoubleMatrix1D ;
3233import cern .colt .matrix .DoubleMatrix2D ;
3334import ubic .basecode .dataStructure .matrix .Matrix2D ;
3435import ubic .basecode .dataStructure .matrix .Matrix3D ;
@@ -194,6 +195,23 @@ public void writeMatrix(DoubleMatrix2D coltMatrix) throws IOException {
194195 buf .append ("\n " );
195196 }
196197 out .write (buf .toString ());
198+ out .close ();
199+ }
200+
201+
202+ /**
203+ * Write a bare 1D matrix (one value per line)
204+ * @param coltMatrix
205+ * @throws IOException
206+ */
207+ public void writeMatrix (DoubleMatrix1D coltMatrix ) throws IOException {
208+ StringBuffer buf = new StringBuffer ();
209+ for (int i = 0 ; i < coltMatrix .size (); i ++) {
210+ buf .append (coltMatrix .get (i ));
211+ buf .append ("\n " );
212+ }
213+ out .write (buf .toString ());
214+ out .close ();
197215 }
198216
199217 /**
You can’t perform that action at this time.
0 commit comments