1 /* 2 Copyright (C) 2010 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 "fmpz_mat.h" 13 fmpz_mat_equal(const fmpz_mat_t mat1,const fmpz_mat_t mat2)14int fmpz_mat_equal(const fmpz_mat_t mat1, const fmpz_mat_t mat2) 15 { 16 slong j; 17 18 if (mat1->r != mat2->r || mat1->c != mat2->c) 19 { 20 return 0; 21 } 22 23 if (mat1->r == 0 || mat1->c == 0) 24 return 1; 25 26 for (j = 0; j < mat1->r; j++) 27 { 28 if (!_fmpz_vec_equal(mat1->rows[j], mat2->rows[j], mat1->c)) 29 { 30 return 0; 31 } 32 } 33 34 return 1; 35 } 36