1 //------------------------------------------------------------------------------
2 // GxB_Scalar_dup: make a deep copy of a sparse GxB_Scalar
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 // s = t, making a deep copy
11 
12 #include "GB.h"
13 
GxB_Scalar_dup(GxB_Scalar * s,const GxB_Scalar t)14 GrB_Info GxB_Scalar_dup     // make an exact copy of a GxB_Scalar
15 (
16     GxB_Scalar *s,          // handle of output GxB_Scalar to create
17     const GxB_Scalar t      // input GxB_Scalar to copy
18 )
19 {
20 
21     //--------------------------------------------------------------------------
22     // check inputs
23     //--------------------------------------------------------------------------
24 
25     GB_WHERE1 ("GxB_Scalar_dup (&s, t)") ;
26     GB_RETURN_IF_NULL (s) ;
27     GB_RETURN_IF_NULL_OR_FAULTY (t) ;
28     ASSERT (GB_SCALAR_OK (t)) ;
29 
30     //--------------------------------------------------------------------------
31     // duplicate the GxB_Scalar
32     //--------------------------------------------------------------------------
33 
34     return (GB_dup ((GrB_Matrix *) s, (GrB_Matrix) t, Context)) ;
35 }
36 
37