@@ -270,28 +270,21 @@ pub fn ifft3(input: &Array, norm_factor: f64,
270270}
271271
272272macro_rules! conv_func_def {
273- ( $fn_name: ident, $ffi_name: ident) => (
274- /// Convolution
273+ ( $doc_str : expr , $ fn_name: ident, $ffi_name: ident) => (
274+ # [ doc=$doc_str ]
275275 ///
276- /// The numeric suffix to the function name indicates the dimension in which the
277- /// convolution operation is going to take place.
278- ///
279- /// - 1 - Indicates 1d convolution
280- /// - 2 - Indicates 2d convolution
281- /// - 3 - Indicates 3d convolution
282- ///
283- /// # Parameters
276+ ///# Parameters
284277 ///
285278 /// - `signal` is the input signal
286279 /// - `filter` is the signal that shall be flipped for convolution operation
287280 /// - `mode` indicates if the convolution should be expanded or not(where output size
288- /// equals input)
281+ /// equals input). It takes a value of type [ConvMode](./enum.ConvMode.html)
289282 /// - `domain` indicates if the convolution should be performed in frequencey or spatial
290- /// domain
283+ /// domain. It takes a value of type [ConvDomain](./enum.ConvDomain.html)
291284 ///
292- /// # Return Values
285+ ///# Return Values
293286 ///
294- /// The convolved Array
287+ /// Convolved Array
295288 #[ allow( unused_mut) ]
296289 pub fn $fn_name( signal: & Array , filter: & Array ,
297290 mode: ConvMode , domain: ConvDomain ) -> Array {
@@ -307,9 +300,9 @@ macro_rules! conv_func_def {
307300 )
308301}
309302
310- conv_func_def ! ( convolve1, af_convolve1) ;
311- conv_func_def ! ( convolve2, af_convolve2) ;
312- conv_func_def ! ( convolve3, af_convolve3) ;
303+ conv_func_def ! ( "1d convolution" , convolve1, af_convolve1) ;
304+ conv_func_def ! ( "2d convolution" , convolve2, af_convolve2) ;
305+ conv_func_def ! ( "3d convolution" , convolve3, af_convolve3) ;
313306
314307/// Separable convolution for 2d signals
315308///
@@ -337,26 +330,19 @@ pub fn convolve2_sep(cfilt: &Array, rfilt: &Array, signal: &Array,
337330}
338331
339332macro_rules! fft_conv_func_def {
340- ( $fn_name: ident, $ffi_name: ident) => (
341- /// Convolution using Fast-fourier transform
342- ///
343- /// The numeric suffix to the function name indicates the dimension in which the
344- /// convolution operation is going to take place.
333+ ( $doc_str: expr, $fn_name: ident, $ffi_name: ident) => (
334+ #[ doc=$doc_str]
345335 ///
346- /// - 1 - Indicates 1d convolution
347- /// - 2 - Indicates 2d convolution
348- /// - 3 - Indicates 3d convolution
349- ///
350- /// # Parameters
336+ ///# Parameters
351337 ///
352338 /// - `signal` is the input signal
353339 /// - `filter` is the signal that shall be used for convolution operation
354340 /// - `mode` indicates if the convolution should be expanded or not(where output size
355- /// equals input)
341+ /// equals input). It takes values of type [ConvMode](./enum.ConvMode.html)
356342 ///
357- /// # Return Values
343+ ///# Return Values
358344 ///
359- /// The convolved Array
345+ /// Convolved Array
360346 #[ allow( unused_mut) ]
361347 pub fn $fn_name( signal: & Array , filter: & Array ,
362348 mode: ConvMode ) -> Array {
@@ -371,9 +357,9 @@ macro_rules! fft_conv_func_def {
371357 )
372358}
373359
374- fft_conv_func_def ! ( fft_convolve1, af_fft_convolve1) ;
375- fft_conv_func_def ! ( fft_convolve2, af_fft_convolve2) ;
376- fft_conv_func_def ! ( fft_convolve3, af_fft_convolve3) ;
360+ fft_conv_func_def ! ( "1d convolution using fast-fourier transform" , fft_convolve1, af_fft_convolve1) ;
361+ fft_conv_func_def ! ( "2d convolution using fast-fourier transform" , fft_convolve2, af_fft_convolve2) ;
362+ fft_conv_func_def ! ( "3d convolution using fast-fourier transform" , fft_convolve3, af_fft_convolve3) ;
377363
378364/// Finite impulse filter
379365///
@@ -623,4 +609,4 @@ pub fn fft3_c2r(input: &Array, norm_factor: f64, is_odd: bool) -> Array {
623609 HANDLE_ERROR ( AfError :: from ( err_val) ) ;
624610 Array :: from ( temp)
625611 }
626- }
612+ }
0 commit comments