課程名稱︰計算機程式
課程性質︰系定必修
課程教師︰鍾添東
開課學院:工學院
開課系所︰機械系
考試日期(年月日)︰2009/04/21
考試時限(分鐘):約60分鐘
是否需發放獎勵金:是
(如未明確表示,則不予發放)
試題 :
In a C++ program, write a function:
double gauss_det(double **a,int n);
to find the determinant of a n x n square matrix [A] by using the Gausian
elimination method (without row or column exchanges) to reduce the matrix
to an upper triangular matrix, and then the determinant is the product of
all diagonal terms. Test your program by a main program and finding the
determinants of:
┌25 5 1┐ ┌ 31 -15 -16 8┐
[A] = │64 8 1│ [B] = │-15 12 11 -8│
└144 12 1┘ │-16 11 11 -7│
└ 8 -8 -7 6┘
Ans:
(1) Gauss Reduction of [A] = det[A] =
(2) Gauss Reduction of [B] = det[B] =
(3)Main program:
====
老師要求考卷上一定要寫出兩個矩陣[A],[B]還有兩者的determinant值
因為是上機考 所以Main program的部份可直接用電腦跑給助教看過ok即可
不須抄在紙上
因為是課堂的最後才小考 如果真的不會寫 老師會開始給提示
到最後好像還會把關鍵的內容寫出來 所以其實還蠻鬆的(畢竟是小考)
給大家參考看看~
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.252.156