1 //------------------------------------------------------------------------------
2 // GrB_Matrix_resize: change the size of a matrix
3 //------------------------------------------------------------------------------
4
5 // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved.
6 // SPDX-License-Identifier: Apache-2.0
7
8 //------------------------------------------------------------------------------
9
10 #include "GB.h"
11
GrB_Matrix_resize(GrB_Matrix C,GrB_Index nrows_new,GrB_Index ncols_new)12 GrB_Info GrB_Matrix_resize // change the size of a matrix
13 (
14 GrB_Matrix C, // matrix to modify
15 GrB_Index nrows_new, // new number of rows in matrix
16 GrB_Index ncols_new // new number of columns in matrix
17 )
18 {
19
20 //--------------------------------------------------------------------------
21 // check inputs
22 //--------------------------------------------------------------------------
23
24 GB_WHERE (C, "GrB_Matrix_resize (C, nrows_new, ncols_new)") ;
25 GB_BURBLE_START ("GrB_Matrix_resize") ;
26 GB_RETURN_IF_NULL_OR_FAULTY (C) ;
27
28 //--------------------------------------------------------------------------
29 // resize the matrix
30 //--------------------------------------------------------------------------
31
32 GrB_Info info = GB_resize (C, nrows_new, ncols_new, Context) ;
33 GB_BURBLE_END ;
34 return (info) ;
35 }
36
37 //------------------------------------------------------------------------------
38 // GxB_Matrix_resize: historical
39 //------------------------------------------------------------------------------
40
41 // This function now appears in the C API Specification as GrB_Matrix_resize.
42 // The new name is preferred. The old name will be kept for historical
43 // compatibility.
44
GxB_Matrix_resize(GrB_Matrix A,GrB_Index nrows_new,GrB_Index ncols_new)45 GrB_Info GxB_Matrix_resize // change the size of a matrix
46 (
47 GrB_Matrix A, // matrix to modify
48 GrB_Index nrows_new, // new number of rows in matrix
49 GrB_Index ncols_new // new number of columns in matrix
50 )
51 {
52 return (GrB_Matrix_resize (A, nrows_new, ncols_new)) ;
53 }
54
55