This is an answer to a question in C++ area.
It should be ready to be modified to code in C++, C#, or Java, because VB.Net is fully OOP. Even though it can be used for vectors, you may still want to modify it to a Vector Class.
Here you are, the test Main()
Module mdlMain Sub Main() Dim a As New Matrix(3, 5) Dim b As New Matrix(5, 4) Dim rnd As New Random() For i As Integer = 0 To a.M For j As Integer = 0 To a.N a.Values(i, j) = Math.Round(rnd.NextDouble, 1) Next Next For i As Integer = 0 To b.M For j As Integer = 0 To b.N b.Values(i, j) = Math.Round(rnd.NextDouble, 1) Next Next Dim c As Matrix = a * b For i As Integer = 0 To c.M For j As Integer = 0 To c.N Console.Write(c.Values(i, j).ToString & ",") Next Console.WriteLine() Next Console.ReadKey() End Sub
i appreciate this man, but its an oops also for vb.net..
i haven't started learning it...
but i hope someone could help me out and translate this to c++ code
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.