用java定义一格矩阵类

来源:百度知道 编辑:UC知道 时间:2024/06/09 07:51:15
要求可以实现基本的乘法,加碱。

/*
* Matrix.java
*
* Created on 2007年5月24日, 上午10:16
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/

/**
*
* @author Administrator
*/
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class Matrix {
private static BufferedReader stdIn = new BufferedReader(
new InputStreamReader(System.in));

private static PrintWriter stdOut = new PrintWriter(System.out, true);

private static PrintWriter stdErr = new PrintWriter(System.err, true);

// private static

/** 行数 */
private int m = 0;

/** 列数 */
private int n = 0;

/** 储存矩阵内的数 */
public double[][] num = null;

/** 默认构造函数 */
public Matrix() {
this.n = 0;
this.m = 0;
}