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

DoModulusByThis() protected method

Computes the canonical modulus, where the result has the sign of the divisor, for the given dividend for each element of the matrix.
protected DoModulusByThis ( 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 DoModulusByThis(float dividend, Matrix<float> result)
        {
            var denseResult = result as DenseMatrix;
            if (denseResult == null)
            {
                base.DoModulusByThis(dividend, result);
                return;
            }

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