MathNet.Numerics.LinearAlgebra.Complex32.DenseMatrix.DoSubtract C# (CSharp) Method

DoSubtract() protected method

Subtracts a scalar from each element of the matrix and stores the result in the result vector.
protected DoSubtract ( Complex32 scalar, Matrix result ) : void
scalar Complex32 The scalar to subtract.
result Matrix The matrix to store the result of the subtraction.
return void
        protected override void DoSubtract(Complex32 scalar, Matrix<Complex32> result)
        {
            var denseResult = result as DenseMatrix;
            if (denseResult == null)
            {
                base.DoSubtract(scalar, result);
                return;
            }

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

Same methods

DenseMatrix::DoSubtract ( Matrix other, Matrix result ) : void