File: test_mdfft.c

package info (click to toggle)
bart-cuda 0.8.00-2
  • links: PTS, VCS
  • area: contrib
  • in suites: bookworm, sid
  • size: 7,752 kB
  • sloc: ansic: 100,267; python: 717; makefile: 576; sh: 564; cpp: 104
file content (47 lines) | stat: -rw-r--r-- 769 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* Copyright 2018. Martin Uecker.
 * All rights reserved. Use of this source code is governed by
 * a BSD-style license which can be found in the LICENSE file.
 *
 * Authors:
 * 2018 Martin Uecker <martin.uecker@med.uni-goettingen.de>
 */

#include <complex.h>

#include "num/multind.h"
#include "num/flpmath.h"
#include "num/mdfft.h"

#include "utest.h"





static bool test_mdfft(void)
{
	enum { N = 4 };
	long dims[N] = { 10, 10, 1, 1 };

	complex float* x = md_calloc(N, dims, sizeof(complex float));
	complex float* y = md_calloc(N, dims, sizeof(complex float));

	x[0] = 1.;

	md_fft(N, dims, 3, 0, y, x);

	md_zfill(N, dims, x, 1.);

	float err = md_znrmse(N, dims, x, y);

	md_free(x);
	md_free(y);

	return (err < 1.E-6);
}




UT_REGISTER_TEST(test_mdfft);