8 public static partial class ArithmeticsOperations
21 throw new ArgumentOutOfRangeException(nameof(
Matrix),
"Heights to do not match.");
25 throw new ArgumentOutOfRangeException(nameof(
Matrix),
"Widths to do not match.");
27 int DestOffset = M.
Start;
29 int DestSkip = M.
Skip;
31 float[] Dest = M.
Data;
34 for (y = 0; y < h; y++, DestOffset += DestSkip, SrcOffset += SrcSkip)
36 for (x = 0; x < w; x++)
37 Dest[DestOffset++] += Src[SrcOffset++] * Scalar;
52 throw new ArgumentOutOfRangeException(nameof(
Matrix),
"Heights to do not match.");
56 throw new ArgumentOutOfRangeException(nameof(
Matrix),
"Widths to do not match.");
58 int DestOffset = M.
Start;
60 int DestSkip = M.
Skip;
62 float[] Dest = M.
Data;
65 for (y = 0; y < h; y++, DestOffset += DestSkip, SrcOffset += SrcSkip)
67 for (x = 0; x < w; x++)
68 Dest[DestOffset++] += Src[SrcOffset++] * Scalar;
83 throw new ArgumentOutOfRangeException(nameof(
Matrix),
"Heights to do not match.");
87 throw new ArgumentOutOfRangeException(nameof(
Matrix),
"Widths to do not match.");
89 int DestOffset = M.
Start;
91 int DestSkip = M.
Skip;
96 for (y = 0; y < h; y++, DestOffset += DestSkip, SrcOffset += SrcSkip)
98 for (x = 0; x < w; x++)
99 Dest[DestOffset++] += Src[SrcOffset++] * Scalar;
static void WeightedAddition(this Matrix< int > M, Matrix< int > Matrix, int Scalar)
Performs a weighted addition of a matrix to the current matrix, including a scalar multiplication on ...
static void WeightedAddition(this Matrix< float > M, Matrix< int > Matrix, float Scalar)
Performs a weighted addition of a matrix to the current matrix, including a scalar multiplication on ...
static void WeightedAddition(this Matrix< float > M, Matrix< float > Matrix, float Scalar)
Performs a weighted addition of a matrix to the current matrix, including a scalar multiplication on ...
Implements a Matrix, basic component for computations in Image Processing and Computer Vision.
int Height
Height of matrix (number of rows)
T[] Data
Underlying data on which the matrix is defined.
int Width
Width of matrix (number of columns)
int Skip
Number of elements to skip from the right edge in the underlying data to the left edge of the new row...
int Start
Start offset of matrix in underlying data.