1 package baseCode.dataStructure.matrix;
2
3 /***
4 * Use this factory to create matrices of type selected at runtime.
5 * <p>
6 * Copyright (c) 2004
7 * </p>
8 * <p>
9 * Institution: Columbia University
10 * </p>
11 *
12 * @author Paul Pavlidis
13 * @version $Id: DoubleMatrix2DNamedFactory.java,v 1.2 2004/07/27 03:18:58 pavlidis Exp $
14 */
15
16 public class DoubleMatrix2DNamedFactory {
17
18 public static SparseDoubleMatrix2DNamed sparse( double T[][] ) {
19 return new SparseDoubleMatrix2DNamed( T );
20 }
21
22 public static SparseDoubleMatrix2DNamed sparse( int rows, int cols ) {
23 return new SparseDoubleMatrix2DNamed( rows, cols );
24 }
25
26 public static DenseDoubleMatrix2DNamed dense( double T[][] ) {
27 return new DenseDoubleMatrix2DNamed( T );
28 }
29
30 public static DenseDoubleMatrix2DNamed dense( int cols, int rows ) {
31 return new DenseDoubleMatrix2DNamed( rows, cols );
32 }
33
34 }