Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
2025.0.0 - 日本語


spyCol

Represent sparsity pattern of a matrix with column coloring

Syntax

spyCol(A,col)

Parameters

A

a full or sparse matrix

col

a vector of integers

Description

sp = sparse(rand(20,20) < .2);
ij = spget(sp);
jacobian = spCompJacobian(deff("y=f",""),sp);
col = jacobian.colors;
k = unique(col,"keepOrder");
gcf().color_map = jet(max(k))
subplot(1,2,1)
spyCol(sp,col)
title(msprintf("Colored (%d x %d) Jacobian\n%d colors",size(sp,1),size(sp,2),max(k)))
subplot(1,4,3)
compMat = sparse([ij(:,1) col(ij(:,2))],ones(ij(:,1)));
spyCol(compMat(:,k),k)
title("Compressed Jacobian")
subplot(1,4,4)
spyCol(jacobian.seed,1:size(jacobian.seed,2))
title("Seed matrix")
gcf().children.isoview="on"

See also

  • spCompJacobian — Consruct a compressed Jacobian engine from its sparsity pattern using column intersection graph coloring
  • spCompHessian — Consruct a compressed Hessian engine from its sparsity pattern using column intersection graph coloring

Bibliography

A. H. Gebremedhin, D. C. Nguyen, Md. M. A. Patwary, A. Pothen}, ColPack: Software for graph coloring and related problems in scientific computing, ACM Trans. Math. Softw., N. 40(1), pp. 1-31, 2013, https://doi.org/10.1145/2513109.2513110.

Report an issue
<< spCompJacobian Sparse Jacobian computation chfact >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Thu Oct 24 11:17:41 CEST 2024