@@ -427,20 +427,20 @@ function __init__()
427
427
@require BlockBandedMatrices= " ffab5731-97b5-5995-9138-79e8c1846df0" begin
428
428
function findstructralnz (x:: BlockBandedMatrices.BlockBandedMatrix )
429
429
l,u= BlockBandedMatrices. blockbandwidths (x)
430
- nrowblock= BlockBandedMatrices. nblocks (x,1 )
431
- ncolblock= BlockBandedMatrices. nblocks (x,2 )
432
- rowsizes= [ BlockBandedMatrices. blocksize (x,(i, 1 ))[ 1 ] for i in 1 : nrowblock]
433
- colsizes= [ BlockBandedMatrices. blocksize (x,( 1 ,i))[ 2 ] for i in 1 : ncolblock]
430
+ nrowblock= BlockBandedMatrices. blocksize (x,1 )
431
+ ncolblock= BlockBandedMatrices. blocksize (x,2 )
432
+ rowsizes= BlockBandedMatrices. blocklengths ( axes (x, 1 ))
433
+ colsizes= BlockBandedMatrices. blocklengths ( axes (x, 2 ))
434
434
BlockBandedMatrixIndex (nrowblock,ncolblock,rowsizes,colsizes,l,u)
435
435
end
436
436
437
437
function findstructralnz (x:: BlockBandedMatrices.BandedBlockBandedMatrix )
438
438
l,u= BlockBandedMatrices. blockbandwidths (x)
439
439
lambda,mu= BlockBandedMatrices. subblockbandwidths (x)
440
- nrowblock= BlockBandedMatrices. nblocks (x,1 )
441
- ncolblock= BlockBandedMatrices. nblocks (x,2 )
442
- rowsizes= [ BlockBandedMatrices. blocksize (x,(i, 1 ))[ 1 ] for i in 1 : nrowblock]
443
- colsizes= [ BlockBandedMatrices. blocksize (x,( 1 ,i))[ 2 ] for i in 1 : ncolblock]
440
+ nrowblock= BlockBandedMatrices. blocksize (x,1 )
441
+ ncolblock= BlockBandedMatrices. blocksize (x,2 )
442
+ rowsizes= BlockBandedMatrices. blocklengths ( axes (x, 1 ))
443
+ colsizes= BlockBandedMatrices. blocklengths ( axes (x, 2 ))
444
444
BandedBlockBandedMatrixIndex (nrowblock,ncolblock,rowsizes,colsizes,l,u,lambda,mu)
445
445
end
446
446
@@ -454,8 +454,8 @@ function __init__()
454
454
function matrix_colors (A:: BlockBandedMatrices.BlockBandedMatrix )
455
455
l,u= BlockBandedMatrices. blockbandwidths (A)
456
456
blockwidth= l+ u+ 1
457
- nblock= BlockBandedMatrices. nblocks (A,2 )
458
- cols= [BlockBandedMatrices . blocksize (A,( 1 ,i))[ 2 ] for i in 1 : nblock]
457
+ nblock= BlockBandedMatrices. blocksize (A,2 )
458
+ cols= blocklengths ( axes (A, 2 ))
459
459
blockcolors= _cycle (1 : blockwidth,nblock)
460
460
# the reserved number of colors of a block is the maximum length of columns of blocks with the same block color
461
461
ncolors= [maximum (cols[i: blockwidth: nblock]) for i in 1 : blockwidth]
@@ -470,8 +470,8 @@ function __init__()
470
470
lambda,mu= BlockBandedMatrices. subblockbandwidths (A)
471
471
blockwidth= l+ u+ 1
472
472
subblockwidth= lambda+ mu+ 1
473
- nblock= BlockBandedMatrices. nblocks (A,2 )
474
- cols= [BlockBandedMatrices . blocksize (A,( 1 ,i))[ 2 ] for i in 1 : nblock]
473
+ nblock= BlockBandedMatrices. blocksize (A,2 )
474
+ cols= blocklengths ( axes (A, 2 ))
475
475
blockcolors= _cycle (1 : blockwidth,nblock)
476
476
# the reserved number of colors of a block is the min of subblockwidth and the largest length of columns of blocks with the same block color
477
477
ncolors= [min (subblockwidth,maximum (cols[i: blockwidth: nblock])) for i in 1 : min (blockwidth,nblock)]
0 commit comments