hi,
this is the code for my class for matrix multiplication.
but i am not getting the required result of multiplication
getting error as "Number of indices exceeds the number of dimensions of the indexed array"
please help me to solve this problem...
thaking you.....
Public Class complexnum
Private x As Double
Private y As Double
Private matrixA As Double
Private matrixB As Double
Private e, f, g As Integer
Public Property Real() As Double
Get
Return x
End Get
Set(ByVal Value As Double)
x = Value
End Set
End Property
Public Property Imaginary() As Double
Get
Return y
End Get
Set(ByVal Value As Double)
y = Value
End Set
End Property
Public Sub New(Optional ByVal real As Double = 0.0, Optional ByVal imaginary As Double = 0.0)
x = real
y = imaginary
End Sub
Public Function multiplication() As complexnum
Dim row1() As Double
Dim row2() As Double
Dim i As Integer
Dim j As Integer
Dim k As Integer
Dim tmprow1 As Double
Dim tmprow2 As Double
For i = 0 To e - 1
For j = 0 To f - 1
For k = 0 To g - 1
Dim result(i, j) As Double
result(i, j) = result(i, j) + (row1(i, k) * row2(k, j))
Next
Next
Next
End Function
Public Overrides Function ToString() As String
Dim result As String = x.ToString()
If y >= 0 Then
result &= " + " & _
y.ToString() & _
"i"
Else
result &= " - " & _
(-y).ToString() & _
"i"
End If
Return result
End Function
End Class