1function test83
2%TEST83 test GrB_assign with J=lo:0:hi, an empty list, and C_replace true
3
4% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved.
5% SPDX-License-Identifier: Apache-2.0
6
7% exercises the C_replace_phase of GB_assign.c
8
9rng ('default') ;
10n = 10 ;
11A = sparse (ones (n,0)) ;
12M = sparse (ones (n)) ;
13M (1,1) = 0 ;
14S = sparse (rand (n)) ;
15
16J.begin = 1 ;
17J.inc = 0 ;
18J.end = 2 ;
19
20I = [ ] ;
21
22J1 = 2:0:3 ;
23
24d.outp = 'replace' ;
25
26C2 = GB_mex_assign (S, M, 'plus', A, I, J, d) ;
27
28C1 = S ;
29C1 (1,1) = 0 ;
30assert (isequal (C1, C2.matrix)) ;
31
32fprintf ('\ntest83: all tests passed\n') ;
33
34
35