1function C = GB_spec_split (A, ms, ns) 2%GB_SPEC_SPLIT a MATLAB mimic of GxB_Matrix_split 3% 4% Usage: 5% C = GB_spec_split (A, ms, ns) 6 7% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved. 8% SPDX-License-Identifier: Apache-2.0 9 10%------------------------------------------------------------------------------- 11% get inputs 12%------------------------------------------------------------------------------- 13 14A = GB_spec_matrix (A) ; 15atype = A.class ; 16 17%------------------------------------------------------------------------------- 18% C = split (A, ms, ns) 19%------------------------------------------------------------------------------- 20 21C_matrix = mat2cell (A.matrix, ms, ns) ; 22C_pattern = mat2cell (A.pattern, ms, ns) ; 23C = cell (length (ms), length (ns)) ; 24 25for i = 1:length(ms) 26 for j = 1:length(ns) 27 clear T 28 T.matrix = C_matrix {i,j} ; 29 T.pattern = C_pattern {i,j} ; 30 T.class = atype ; 31 C {i,j} = T ; 32 end 33end 34 35