1 /*
2     Copyright (C) 2015 Anubhav Srivastava
3     Copyright (C) 2015 Elena Sergeicheva
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 <http://www.gnu.org/licenses/>.
11 */
12 
13 #include "fmpz_poly_mat.h"
14 
15 void
fmpz_poly_mat_concat_horizontal(fmpz_poly_mat_t res,const fmpz_poly_mat_t mat1,const fmpz_poly_mat_t mat2)16 fmpz_poly_mat_concat_horizontal(fmpz_poly_mat_t res, const fmpz_poly_mat_t mat1, const fmpz_poly_mat_t mat2)
17 {
18     slong i, j;
19     slong r1 = mat1->r;
20     slong c1 = mat1->c;
21     slong r2 = mat2->r;
22     slong c2 = mat2->c;
23 
24     for (i = 0; i < r1; i++)
25     {
26         for (j = 0; j < c1; j++)
27         {
28             fmpz_poly_set(fmpz_poly_mat_entry(res, i, j), fmpz_poly_mat_entry(mat1, i, j));
29         }
30     }
31 
32     for (i = 0; i < r2; i++)
33     {
34         for (j = 0; j < c2; j++)
35         {
36             fmpz_poly_set(fmpz_poly_mat_entry(res, i, j + c1), fmpz_poly_mat_entry(mat2, i, j));
37         }
38     }
39 }
40