MathNet.Numerics.LinearAlgebra.Single.DenseMatrix.DoRemainderByThis C# (CSharp) Method

DoRemainderByThis() protected method

Computes the remainder (% operator), where the result has the sign of the dividend, for the given dividend for each element of the matrix.
protected DoRemainderByThis ( float dividend, Matrix result ) : void
dividend float The scalar numerator to use.
result Matrix A vector to store the results in.
return void
        protected override void DoRemainderByThis(float dividend, Matrix<float> result)
        {
            var denseResult = result as DenseMatrix;
            if (denseResult == null)
            {
                base.DoRemainderByThis(dividend, result);
                return;
            }

            CommonParallel.For(0, _values.Length, 4096, (a, b) =>
            {
                var v = denseResult._values;
                for (int i = a; i < b; i++)
                {
                    v[i] = dividend%_values[i];
                }
            });
        }