public Matrix()
{
temp = new float[3,3];
}
public float [,] temp;
/// <summary>
/// 复制一个矩阵
/// </summary>
/// <param name="a"></param>
/// <returns></returns>
static float[,] copyAtoB(float[,] a)
{
int maxi,maxj,i,j;
maxi = a.GetLength(0);
maxj = a.GetLength(1);
float[,] b = new float[maxi,maxj];
for(i = 0;i < maxi;i++)
for(j = 0;j < maxj;j++)
b[i,j] = a[i,j];
b = disBtoA(b);
return b;
}
static float[,] disBtoA(float[,] a)
{
int maxi,maxj,i,j;
maxi = a.GetLength(0);
maxj = a.GetLength(1)-1;
float[,] b = new float[maxi,maxj];
for(i = 0;i < maxi;i++)
for(j = 0;j < maxj;j++)
b[i,j] = a[i,j];
return b;
}
public int row,col;
public static Matrix operator +(Matrix ihs,Matrix rhs)
{
Matrix mt = new Matrix();
mt.temp = copyAtoB(ihs.temp);
int a,b;
a = mt.temp.GetLength(0);
b = mt.temp.GetLength(1);
for(int i = 0; i < a; i++)
{
for(int j = 0 ; j < b ; j ++)
{
mt.temp[i,j] += rhs.temp[i,j];
}
}
return mt;
}
                 public static float operator ()(int row,int col)
{return this.temp[row,col]}
}我想要重载这个类的括号,可是总是调不过去啊,求达人指点