title: Sparse Matrix multiplication like (maxmin) in C++ using Octave libraries
body: <p>I'm implementing a maxmin function, it works like matrix multiplication but instead of summing products it gets max of min between two numbers pointwise. An example of naive implementation is</p>
  
  <pre><code>double mx = 0;
  double mn = 0;
  for (i = 0; i &lt; rowsC;i++)
  {
      for(j = 0; j &lt; colsC;j++)
      {
          mx = 0;
          for(k = 0; k &lt; colsA; k++)
          { 
              if (a(i, k) &lt; b(k, j))
                  mn = a(i,k);
              else
                  mn = b(k,j);
  
              if (mn &gt; mx)
                  mx = mn;
          } 
          c(i, j) = mx;
      }
  }
  </code></pre>
  
  <p>I'm coding it as an Octave oct-file so i have to use oct.h data structure. The problem is that i want to implement a sparse version, but usually you need a reference to the next non zero element in a row or in a column like in this example (see 4.3 algorithm):
  <a href="http://www.eecs.harvard.edu/~ellard/Q-97/HTML/root/node20.html" rel="nofollow">http://www.eecs.harvard.edu/~ellard/Q-97/HTML/root/node20.html</a></p>
  
  <p>There doing row_p->next gave the next nonzero element of the row (the same for the column). Is there a way to do the same with the octave SparseMatrix class? Or is there another way of implementing the sparse matrix multiplication i can adopt for my maxmin function?</p>