Line | |
---|
1 | function [Nbegcol,Nlencol,Nrowndx] = lindosparse(cJacobian); |
---|
2 | |
---|
3 | Nbegcol = []; |
---|
4 | Nrowndx = []; |
---|
5 | Nlencol = []; |
---|
6 | top = 0; |
---|
7 | for i = 1:size(cJacobian,2) |
---|
8 | [ii,jj,kk] = find(cJacobian(:,i)); |
---|
9 | if isempty(ii) |
---|
10 | Nbegcol = [Nbegcol top]; |
---|
11 | Nlencol = [Nlencol 0]; |
---|
12 | else |
---|
13 | Nbegcol = [Nbegcol top]; |
---|
14 | Nrowndx = [Nrowndx ii(:)'-1]; |
---|
15 | Nlencol = [Nlencol length(ii)]; |
---|
16 | top = top + length(ii); |
---|
17 | end |
---|
18 | end |
---|
19 | if isempty(Nrowndx) |
---|
20 | Nrowndx = []; |
---|
21 | end |
---|
22 | Nbegcol = [Nbegcol sum(Nlencol)]; |
---|
Note: See
TracBrowser
for help on using the repository browser.