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