title: Dot Product between 2 matrices in ruby, most efficient way
body: <p>I am writing a machine learning algorithm in ruby that uses gradient descent and logistic regression.</p>
  
  <p>The algorithms works fine, except that in ruby the dot product between matrices is very slow.</p>
  
  <p>I started using a gem RubyPython that allows you to import python libraries like <code>numpy</code> into ruby and use it's functions.</p>
  
  <p>The performance of <code>numpy</code> is impressive. The application started to run 1000% faster, except that i always get <code>segmentation fault</code> halfway.</p>
  
  <p>Does anyone know any other way to speed up the dot product of 2 matrices in ruby?</p>