文档库

最新最全的文档下载
当前位置:文档库 > 矩阵计算

矩阵计算

#ifndef _MATRIX_H

#define _MATRIX_H

//í·????

#include <stdio.h>

#include <stdlib.h>

//???óê????á11

//???????ó

class _Matrix

{

private:

public:

int m;

int n;

float *arr;

//3?ê??ˉ

_Matrix(int mm = 0,int nn = 0); //éè??m

void set_m(int mm); //éè??n

void set_n(int nn);

//3?ê??ˉ

void init_matrix();

//êí·?

void free_matrix(); //?áè?i,j×?±êμ?ê???

//꧰ü·μ??-31415,3é1|·μ???μ float read(int i,int j); //?′è?i,j×?±êμ?ê???

//꧰ü·μ??-1,3é1|·μ??1 int write(int i,int j,float val); };

//????????àà

class _Matrix_Calc

{

private:

public:

_Matrix_Calc();

//C = A + B

//3é1|·μ??1,꧰ü·μ??-1

int add(_Matrix *A,_Matrix *B,_Matrix *C);