Option Base 1
Function Determinant(ByRef factor) As Single
Dim i As Long, j As Long, k As Long, row As Long, order As Long
Dim r As Long, c As Long, Pivot As Single, Pivot2 As Single, temp() As Single
Determinant = 1
Dim m
m = factor
row = UBound(m, 1)
If Not UBound(m, 2) = row + 1 Then MsgBox "无解或不定解!": Exit Function
ReDim temp(1 To row)
For i = 1 To rowPivot = 0
For j = i To row
For k = i To row
If Abs(m(k, j)) > Pivot Then
Pivot = Abs(m(k, j))
r = k: c = j
End If
Next k
Next j
If Pivot = 0 Then Determinant = 0: Exit Function
If r <> i Then
order = order + 1
For j =