1 /*
2 Copyright (C) 2010 William Hart
3 Copyright (C) 2011 Fredrik Johansson
4
5 This file is part of FLINT.
6
7 FLINT is free software: you can redistribute it and/or modify it under
8 the terms of the GNU Lesser General Public License (LGPL) as published
9 by the Free Software Foundation; either version 2.1 of the License, or
10 (at your option) any later version. See <https://www.gnu.org/licenses/>.
11 */
12
13 #include <stdio.h>
14 #include <stdlib.h>
15 #include <gmp.h>
16 #include "flint.h"
17 #include "fmpz.h"
18 #include "fmpz_mat.h"
19 #include "ulong_extras.h"
20
21 int
main(void)22 main(void)
23 {
24 int i;
25 FLINT_TEST_INIT(state);
26
27
28 flint_printf("entry....");
29 fflush(stdout);
30
31 for (i = 0; i < 1000 * flint_test_multiplier(); i++)
32 {
33 fmpz_mat_t a;
34 slong j, k;
35 slong rows = n_randint(state, 10);
36 slong cols = n_randint(state, 10);
37
38 fmpz_mat_init(a, rows, cols);
39
40 for (j = 0; j < rows; j++)
41 {
42 for (k = 0; k < cols; k++)
43 {
44 fmpz_set_ui(fmpz_mat_entry(a,j,k), 3*j + 7*k);
45 }
46 }
47
48 for (j = 0; j < rows; j++)
49 {
50 for (k = 0; k < cols; k++)
51 {
52 if (fmpz_get_ui(fmpz_mat_entry(a,j,k)) != 3*j + 7*k)
53 {
54 flint_printf("FAIL: get/set entry %wd,%wd\n", j, k);
55 abort();
56 }
57 }
58 }
59
60 fmpz_mat_clear(a);
61 }
62
63
64
65 FLINT_TEST_CLEANUP(state);
66 flint_printf("PASS\n");
67 return 0;
68 }
69