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

DoAdd() protected method

Add a scalar to each element of the matrix and stores the result in the result vector.
protected DoAdd ( Complex32 scalar, Matrix result ) : void
scalar Complex32 The scalar to add.
result Matrix The matrix to store the result of the addition.
return void
        protected override void DoAdd(Complex32 scalar, Matrix<Complex32> result)
        {
            var denseResult = result as DenseMatrix;
            if (denseResult == null)
            {
                base.DoAdd(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::DoAdd ( Matrix other, Matrix result ) : void