1function w = GB_spec_Vector_extract (w, mask, accum, u, I, descriptor)
2%GB_SPEC_VECTOR_EXTRACT a MATLAB mimic of GrB_Vector_extract
3
4% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved.
5% SPDX-License-Identifier: Apache-2.0
6
7if (nargout > 1 || nargin ~= 6)
8    error ('usage: w = GB_spec_Vector_extract (w, mask, accum, u, I, desc)') ;
9end
10
11% make sure u is a column vector
12if (isstruct (u))
13    n = size (u.matrix, 2) ;
14else
15    n = size (u, 2);
16end
17if (n ~= 1)
18    error ('u must be a vector') ;
19end
20
21% GraphBLAS does not allow u to be transposed via the descriptor
22if (isfield (descriptor, 'inp0'))
23    descriptor = rmfield (descriptor, 'inp0') ;
24end
25
26w = GB_spec_Matrix_extract (w, mask, accum, u, I, 1, descriptor) ;
27
28