1 //------------------------------------------------------------------------------
2 // GrB_Vector_resize: change the size of a vector
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_Vector_resize(GrB_Vector w,GrB_Index nrows_new)12 GrB_Info GrB_Vector_resize      // change the size of a vector
13 (
14     GrB_Vector w,               // vector to modify
15     GrB_Index nrows_new         // new number of rows in vector
16 )
17 {
18 
19     //--------------------------------------------------------------------------
20     // check inputs
21     //--------------------------------------------------------------------------
22 
23     GB_WHERE (w, "GrB_Vector_resize (w, nrows_new)") ;
24     GB_BURBLE_START ("GrB_Vector_resize") ;
25     GB_RETURN_IF_NULL_OR_FAULTY (w) ;
26 
27     //--------------------------------------------------------------------------
28     // resize the vector
29     //--------------------------------------------------------------------------
30 
31     GrB_Info info = GB_resize ((GrB_Matrix) w, nrows_new, 1, Context) ;
32     GB_BURBLE_END ;
33     return (info) ;
34 }
35 
36 //------------------------------------------------------------------------------
37 // GxB_Vector_resize: historical
38 //------------------------------------------------------------------------------
39 
40 // This function now appears in the C API Specification as GrB_Vector_resize.
41 // The new name is preferred.  The old name will be kept for historical
42 // compatibility.
43 
GxB_Vector_resize(GrB_Vector u,GrB_Index nrows_new)44 GrB_Info GxB_Vector_resize      // change the size of a vector
45 (
46     GrB_Vector u,               // vector to modify
47     GrB_Index nrows_new         // new number of rows in vector
48 )
49 {
50     return (GrB_Vector_resize (u, nrows_new)) ;
51 }
52 
53