哪位高人帮忙解决一道问题~~~

来源:百度知道 编辑:UC知道 时间:2024/06/06 07:33:28
定义一个矩阵类,要求存储矩阵的值,矩阵维数,矩阵的行列数(如果是多维的,则存储更多,最多为4维),能够实现的功能如下:能实现矩阵的读取、更改、显示等操作,注意以上几种操作都要进行范围判断,计算逆矩阵,矩阵的转置,求取矩阵的最大值和最小值。如果是方阵,要实现矩阵的乘方运算,能够计算矩阵的行列式值。~~~

//Matrix.h
#pragma once

// Matrix 命令目标

class Matrix
{
private:
double *p;
long Row;
long Col;

public:
Matrix();
virtual ~Matrix();
long GetRows(void);
long GetCols(void);
Matrix(long n);
Matrix(long row ,long col);
Matrix(double *arrAddress ,long col);
Matrix(double *arrAddress ,long arrWidth ,long arrHeight);
Matrix(const Matrix &m);//拷贝构造函数
bool IsVector(void);
Matrix SubMatrix(long offset);
double Arg(void);
double * operator[](long heightPos);
bool IsPtv(void);
Matrix T(void);
// Matrix operator *(Matrix & m1);
// Matrix operator *(double alpha ,Matrix &m1);
Matrix operator * (double alpha);
Matrix operator * ( Matrix &m1);
Matrix operator / (Matrix &m1);
Matrix operator =(Matrix &m);
Matrix Inver();