11
Matrix 类
分类 描述 说明
unsigned int Row
矩阵行数
unsigned int Col
矩阵列数
属性
LinkList<T> Link
矩阵中元素
void setDimension(const unsigned int newLength)
设置向量长度
void setDimension(const unsigned int newRow,const
unsigned int newCol)
设置矩阵大小
Matrix & operator=(const Matrix & rhs)
矩阵赋值
unsigned int getRow() const
取得行数
unsigned int getCol() const
取得列数
T & operator()(const unsigned int index)
得到向量元素
T & operator()(const unsigned int x,const unsigned int y)
得到矩阵元素
Matrix & changerow(const unsigned int x,const unsigned
int y)
交换两行
Matrix & changecol(const unsigned int x,const unsigned
int y)
交换两列
Matrix trans()
矩阵转置
T det()
求方阵的行列式
Matrix<double> inv()
矩阵求逆
Matrix copny()
求方阵的伴随矩阵
Matrix operator+(Matrix & rhs)
两矩阵相加
Matrix operator-(Matrix & rhs)
两矩阵相减
Matrix operator*(Matrix & rhs)
两矩阵相乘
Matrix operator*(T & rhs)
矩阵乘以变量
Matrix operator*(const T & rhs)
矩阵乘以常数
方法
void Display()
矩阵的显示