aboutsummaryrefslogtreecommitdiff
path: root/tests/pr_gradient_check.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-05-26 13:38:25 +0200
committerThomas White <taw@physics.org>2012-02-22 15:27:29 +0100
commit4cfe435b978498af703f4e5651a1bcfa1780c4ee (patch)
tree7949c9511c5ab597db47b1b748f868633941f3f4 /tests/pr_gradient_check.c
parent4229426f301b50df58b7ab1acd2dc84aeac3c5e5 (diff)
Do it ten times (but commented out)
Diffstat (limited to 'tests/pr_gradient_check.c')
-rw-r--r--tests/pr_gradient_check.c72
1 files changed, 39 insertions, 33 deletions
diff --git a/tests/pr_gradient_check.c b/tests/pr_gradient_check.c
index 40897ddd..18d8e58a 100644
--- a/tests/pr_gradient_check.c
+++ b/tests/pr_gradient_check.c
@@ -221,6 +221,7 @@ int main(int argc, char *argv[])
double cx, cy, cz;
UnitCell *cell;
struct quaternion orientation;
+ int i;
image.width = 1024;
image.height = 1024;
@@ -234,39 +235,44 @@ int main(int argc, char *argv[])
image.i0_available = 0;
image.filename = malloc(256);
- cell = cell_new_from_parameters(10.0e-9,
- 10.0e-9,
- 10.0e-9,
- deg2rad(90.0),
- deg2rad(90.0),
- deg2rad(90.0));
-
- orientation = random_quaternion();
- image.indexed_cell = cell_rotate(cell, orientation);
-
- cell_get_reciprocal(image.indexed_cell,
- &ax, &ay, &az, &bx, &by, &bz, &cx, &cy, &cz);
-
- incr_val = incr_frac * ax;
- test_gradients(&image, incr_val, REF_ASX, "ax*");
- incr_val = incr_frac * ay;
- test_gradients(&image, incr_val, REF_ASY, "ay*");
- incr_val = incr_frac * az;
- test_gradients(&image, incr_val, REF_ASZ, "az*");
-
- incr_val = incr_frac * bx;
- test_gradients(&image, incr_val, REF_BSX, "bx*");
- incr_val = incr_frac * by;
- test_gradients(&image, incr_val, REF_BSY, "by*");
- incr_val = incr_frac * bz;
- test_gradients(&image, incr_val, REF_BSZ, "bz*");
-
- incr_val = incr_frac * cx;
- test_gradients(&image, incr_val, REF_CSX, "cx*");
- incr_val = incr_frac * cy;
- test_gradients(&image, incr_val, REF_CSY, "cy*");
- incr_val = incr_frac * cz;
- test_gradients(&image, incr_val, REF_CSZ, "cz*");
+ cell = cell_new_from_parameters(10.0e-9, 10.0e-9, 10.0e-9,
+ deg2rad(90.0),
+ deg2rad(90.0),
+ deg2rad(90.0));
+
+ //for ( i=0; i<10; i++ ) {
+
+ orientation = random_quaternion();
+ image.indexed_cell = cell_rotate(cell, orientation);
+
+ cell_get_reciprocal(image.indexed_cell,
+ &ax, &ay, &az, &bx, &by,
+ &bz, &cx, &cy, &cz);
+
+ plot_graph(&image, incr_frac, REF_ASX);
+
+ incr_val = incr_frac * ax;
+ test_gradients(&image, incr_val, REF_ASX, "ax*");
+ incr_val = incr_frac * ay;
+ test_gradients(&image, incr_val, REF_ASY, "ay*");
+ incr_val = incr_frac * az;
+ test_gradients(&image, incr_val, REF_ASZ, "az*");
+
+ incr_val = incr_frac * bx;
+ test_gradients(&image, incr_val, REF_BSX, "bx*");
+ incr_val = incr_frac * by;
+ test_gradients(&image, incr_val, REF_BSY, "by*");
+ incr_val = incr_frac * bz;
+ test_gradients(&image, incr_val, REF_BSZ, "bz*");
+
+ incr_val = incr_frac * cx;
+ test_gradients(&image, incr_val, REF_CSX, "cx*");
+ incr_val = incr_frac * cy;
+ test_gradients(&image, incr_val, REF_CSY, "cy*");
+ incr_val = incr_frac * cz;
+ test_gradients(&image, incr_val, REF_CSZ, "cz*");
+
+ //}
return 0;
}