This example looks at scc
View output (PDF) | source (python)
- See also
casadi::diagcat();
casadi_int scc(std::vector< casadi_int > &index, std::vector< casadi_int > &offset) const
Find the strongly connected components of the bigraph defined by the sparsity pattern.
29 A = diagcat(1,DM([[2,3],[3,4]]),DM([[5,6,7],[6,8,9],[7,9,10]]),11)
37 perm = list(numpy.random.permutation(list(range(A.size1()))))
45 n,p,r = AP.sparsity().scc()
50 APrestored.sparsity().spy()
51 print(
"# blocks: ", n)
52 print(
"block boundaries: ", r[:n])