herrDeng網內搜尋
自訂搜尋
Ads
訂閱:
張貼留言 (Atom)
熱門文章
-
計算你的BMI
-
a[]={1,1,2,3,5,8,13,21,34}; 建立鍊節串列,並列印之
-
用 C/C++算上學期加權平均
-
輸出你的課表 含Java code以及結果
-
GCD(10^10+1, 10^11+2)=?
-
1. 利用遞迴input n算2^n 2. 用C算GCD(3333,456)
-
int a[]={21, 23, 57, 13 ,17, 6}; float average; average=?
-
計算平均
-
請用 C/C++/java寫一簡易程式
2 則留言:
friend Matrix operator^(Matrix& A, Matrix& B)
{
Matrix C(A.row, A.col);
for (int i = 0; i < A.row; i++) {
for (int j = 0; j < A.col; j++)
C(i, j) = (T)((T)A(i, j) ^ (T)B(i, j));
}
return C;
}
friend Matrix& operator*(Matrix A, Matrix B)
{
for (int i = 0;i < A.row;i++) {
for (int j = 0;j < B.col;j++) {
C(i, j) = 0;
for (int k = 0;k <A.col;k++)
C(i, j) += A(i, k)*B(k, j);
}
}
return C;
}
friend Matrix operator^(Matrix& A, Matrix& B)
{
Matrix C(A.row, A.col);
for (int i = 0; i < A.row; i++) {
for (int j = 0; j < A.col; j++)
C(i, j) = (T)((T)A(i, j) ^ (T)B(i, j));
}
return C;
}
friend Matrix& operator*(Matrix A, Matrix B)
{
for (int i = 0;i < A.row;i++) {
for (int j = 0;j < B.col;j++) {
C(i, j) = 0;
for (int k = 0;k <A.col;k++)
C(i, j) += A(i, k)*B(k, j);
}
}
return C;
}
張貼留言