title: How can I multiply two matrices in C#?
body: <p>Like described in the title, is there some library in the Microsoft framework which allows to multiply two matrices or do I have to write my own method to do this? // I've got an answer to this by now</p>
  
  <p>Second question:
  I wrote this multi class with a MultiplyMatrix method but it doesn't work like I want to. Can anyone help and tell where I made a mistake?</p>
  
  <pre><code>class multi
      {
          public void MultiplyMatrix(double[,] _A, double[,] _B, int _n, int _m, int _r)
          {
              int n, m, r;
              double si;
              n = _n;
              m = _m;
              r = _r;
              double[,] A = new double[n, m];
              double[,] B = new double[m, r];
              double[,] C = new double[n, r];
              A = _A;
              B = _B;
              try
              {
                  for (int i = 0; i &lt; n; i++)
                  {
                      for (int j = 0; j &lt; r; j++)
                      {
                          si = 0;
                          for (int k = 0; k &lt; m; k++)
                          {
                              si += A[i, m + k] + B[k, r + j];
                          }
                          C[i, r + j] = si;
                      }
                  }
                  for (int i = 0; i &lt; C.Length; i++)
                  {
                      for (int j = 0; j &lt; C.Length; j++)
                      {
                          Console.Write(C[i, j]+" ");
                          if (j % 3 == 0)
                              Console.WriteLine();
                      }
                  }
              }
              catch (IndexOutOfRangeException) { } // I always get this exception
  
          }
  
      }
  </code></pre>
  
  <p>I forgot to tell: I want to make a webservice to multiply on it.</p>
  
  <p>Thanks:)</p>