File: adj2sp.cat

package info (click to toggle)
scilab 2.4-1
  • links: PTS
  • area: non-free
  • in suites: potato, slink
  • size: 55,196 kB
  • ctags: 38,019
  • sloc: ansic: 231,970; fortran: 148,976; tcl: 7,099; makefile: 4,585; sh: 2,978; csh: 154; cpp: 101; asm: 39; sed: 5
file content (44 lines) | stat: -rw-r--r-- 1,311 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44

adj2sp(1)                      Scilab Function                      adj2sp(1)
NAME
  adj2sp - converts adjacency form into  sparse matrix.

CALLING SEQUENCE
  A = adj2sp(xadj,adjncy,anz) A = adj2sp(xadj,adjncy,anz,mn)

PARAMETERS

  xadj   :  integer vector of length (n+1).

  adjncy :  integer vector of length nz containing the row indices
            for the corresponding elements in anz

  anz    :  column vector of length nz, containing the non-zero
            elements of A

  mn     : row vector with 2 entries, mn=size(A) (optional).

  A      :  real or complex sparse matrix (nz non-zero entries)

DESCRIPTION
  sp2adj converts an adjacency form representation of a matrix
  into its standard Scilab representation (utility fonction).
  xadj, adjncy, anz = adjacency representation of A i.e:

  xadj(j+1)-xadj(j) = number of non zero entries in row j.
  adjncy = column index of the non zeros entries
  in row 1, row 2,..., row n.
  anz = values of non zero entries in row 1, row 2,..., row n.
  xadj is a (column) vector of size n+1 and
  adjncy is an integer (column) vector of size nz=nnz(A).
  anz is a real vector of size nz=nnz(A).

EXAMPLE
  A = sprand(100,50,.05);
  [xadj,adjncy,anz]= sp2adj(A);
  [n,m]=size(A);
  p = adj2sp(xadj,adjncy,anz,[n,m]);
  A-p,

SEE ALSO
  sp2adj, spcompack