convolve method
Matrix<T>
convolve(
- Matrix<
T> kernel, { - DataType<
T> ? dataType, - ConvolutionMode mode = ConvolutionMode.full,
Returns a view of the convolution between this matrix and the given
kernel
. The solution is obtained lazily by straightforward computation,
not by using a FFT.
Implementation
Matrix<T> convolve(
Matrix<T> kernel, {
DataType<T>? dataType,
ConvolutionMode mode = ConvolutionMode.full,
}) {
switch (mode) {
case ConvolutionMode.full:
return FullConvolutionMatrix<T>(
dataType ?? this.dataType, this, kernel);
case ConvolutionMode.valid:
return ValidConvolutionMatrix<T>(
dataType ?? this.dataType, this, kernel);
case ConvolutionMode.same:
return SameConvolutionMatrix<T>(
dataType ?? this.dataType, this, kernel);
}
}