1

I'm looking at the documentation for DenseMatrix in MathNet Numerics which can be found here. I found two method definitions Matrix<T> Divide(double scalar) and Matrix<T> DivideByThis(double scalar) which both seem to return a Matrix and accept a double scalar.

Is there any difference between the two?

TylerH
  • 20,799
  • 66
  • 75
  • 101
covfefe
  • 2,485
  • 8
  • 47
  • 77

1 Answers1

2

Assuming m is a matrix of type Matrix<double> and s is a scalar of type double, then

  • m.Divide(s) is equivalent to m/s where the scalar is the divisor
  • m.DivideByThis(s) is equivalent to s/m where the scalar is the dividend (point-wise)

Beware that both operations are point-wise divisions, so DivideByThis does not do a matrix inversion or pseudo-inversion but instead divides the scalar by each value of the matrix.

Unfortunately the tool used to generate the API reference has some issues and fails to render the xml docs in this case. We hope to replace it with something more useful and better integrated into the docs in the future.

Christoph Rüegg
  • 4,626
  • 1
  • 20
  • 34