文件名称:gsxqf
- 所属分类:
- 数学计算/工程计算
- 资源属性:
- [Windows] [Visual C] [Basic/ASP] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 2kb
- 下载次数:
- 0次
- 提 供 者:
- chu***
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
vb编写的高斯消去法,通用函数,如有不好的地方,还请指教!-Dim a(), b(), n, k, l 定义必须的通用变量
Private Sub Command1_Click()
If k = n Then
Command1.Enabled = False
Text2.Enabled = False
Else
k = k+ 1
Text2 = ""
End If
End Sub
Private Sub Command2_Click()
If l = n Then
Text3.Enabled = False
Else
l = l+ 1
Text2 = ""
Text3 = ""
Command1.Enabled = True
Text2.Enabled = True
End If
End Sub
Private Sub Command3_Click() 求解方程组
Dim m()
ReDim m(1 To n, 1 To n)
For i = 1 To n- 1
For j = i+ 1 To n
m(j, i) = a(j, i)/a(i, i)
End Sub
Private Sub Form_Activate()
k = 1
l = 1
Picture1.Print "系数"
End Sub
Private Sub Text1_Change() 指定方程组元数
n = Val(Text1)
ReDim a(1 To n, 1 To n)
ReDim b(1 To n)
End Sub
Private Sub Text2_Change() 给方程组各系数Aij赋值
a(k, l) = Val(Text2)
Picture1.Print a(k, l) & ","
End Sub
Private Sub Text3_Change() 给方程组系数Bi赋值
b(l) = Val(Text3)
Picture1.Print b(l) & ","
End Sub
Private Sub Command1_Click()
If k = n Then
Command1.Enabled = False
Text2.Enabled = False
Else
k = k+ 1
Text2 = ""
End If
End Sub
Private Sub Command2_Click()
If l = n Then
Text3.Enabled = False
Else
l = l+ 1
Text2 = ""
Text3 = ""
Command1.Enabled = True
Text2.Enabled = True
End If
End Sub
Private Sub Command3_Click() 求解方程组
Dim m()
ReDim m(1 To n, 1 To n)
For i = 1 To n- 1
For j = i+ 1 To n
m(j, i) = a(j, i)/a(i, i)
End Sub
Private Sub Form_Activate()
k = 1
l = 1
Picture1.Print "系数"
End Sub
Private Sub Text1_Change() 指定方程组元数
n = Val(Text1)
ReDim a(1 To n, 1 To n)
ReDim b(1 To n)
End Sub
Private Sub Text2_Change() 给方程组各系数Aij赋值
a(k, l) = Val(Text2)
Picture1.Print a(k, l) & ","
End Sub
Private Sub Text3_Change() 给方程组系数Bi赋值
b(l) = Val(Text3)
Picture1.Print b(l) & ","
End Sub
(系统自动生成,下载前可以参看下载内容)
下载文件列表
高斯消去法
..........\Form1.frm
..........\MSSCCPRJ.SCC
..........\工程1.vbp
..........\工程1.vbw
..........\Form1.frm
..........\MSSCCPRJ.SCC
..........\工程1.vbp
..........\工程1.vbw