Navigation

Operators and Keywords

Function List:

C++ API

sparseimages.m File Reference


Functions

function sparseimages (nm, typ) if(strcmp(typ
function png set (0,"defaulttextfontname","*")
endif if (!isempty(findstr(octave_config_info("DEFS"),"HAVE_COLAMD"))&&!isempty(findstr(octave_config_info("DEFS"),"HAVE_CHOLMOD"))&&!isempty(findstr(octave_config_info("DEFS"),"HAVE_UMFPACK"))) if(strcmp(typ
endif txt txtimages (nm, 15, typ)
else if (strcmp(nm,"gplot")) gplotimages("gplot"
 elseif (strcmp(nm,"grid")) femimages("grid"
else otherimages (nm, 200, typ)
endif endif else sombreroimage (nm, typ)
endif endfunction function bury_output () f
 set (f,"visible","off")
endfunction function gplotimages (nm, typ) bury_output()
 gplot (A, xy) print(cstrcat(nm
 cstrcat ("-d", typ)) bury_output()
endfunction function txtimages (nm, n, typ) a
 if (strcmp(nm,"gplot")||strcmp(nm,"grid")) fid
 fputs (fid,"\n")
 fputs (fid,"+---------------------------------+\n")
 fputs (fid,"| Image unavailable in text mode. |\n")
 fclose (fid)
 elseif (strcmp(nm,"spmatrix")) printsparse(a
 cstrcat ("spmatrix.", typ))
else if (!isempty(findstr(octave_config_info("DEFS"),"HAVE_COLAMD"))&&!isempty(findstr(octave_config_info("DEFS"),"HAVE_CHOLMOD"))) if(strcmp(nm
 printsparse (r1, cstrcat("spchol.", typ))
 elseif (strcmp(nm,"spcholperm"))[r2
 printsparse (r2, cstrcat("spcholperm.", typ))
endif endif endif endfunction
function 
otherimages (nm, n, typ) bury_output()
 if (strcmp(nm,"spmatrix")) spy(a)
 axis ("ij") print(cstrcat("spmatrix."
 spy (r1)
 spy (r2)
endif endif endif endfunction
function 
printsparse (a, nm) fid
else fprintf (fid," | ")
else fprintf (fid,"--")
endif endfor fprintf (fid,"\n") fprintf(fid
else fprintf (fid," ")
endfunction function femimages (nm, typ) bury_output()
ones (1, 11)
 Sdata (D *(j-1)+(1:D),:)
 V (D_nodes)
 idx (D_nodes)
 Q (N_nodes)
 V (idx)
 plot3 (xelems, yelems, velems)
 view (10, 10)
 print (cstrcat(nm,".", typ), cstrcat("-d", typ)) bury_output()
 fputs (fid,"+---------------------------------------+\n")
 fputs (fid,"| Image unavailable because of a |\n")
 fputs (fid,"| missing sparse matrix implementation. |\n")
 title ("Sorry, graphics not available because octave was\\ncompiled without the sparse matrix implementation.")
end_unwind_protect endif
endfunction function 
image_as_txt (nm) fid

Variables

else typ
 A
 xy = [0,4,8,6,4,2
else spchol r1 = chol(a)
 p2
 q2 = chol(a)
 a
for i
endif for j
 node_x = ones(5,1)*[1,1.05,1.1,1.2,1.3,1.5,1.7,1.8,1.9,1.95,2]
 nodes = [node_x(:), node_y(:)]
 elems = size(node_x) []
for idx
 __pad0__
endfor E = size(elems,1)
 N = size(nodes,1)
 D = size(elems,2)
 elemx = elems(:,[1,2,3,1])'
 xelems = reshape( nodes(elemx, 1), 4, E)
 yelems = reshape( nodes(elemx, 2), 4, E)
 conductivity = [1*ones(1,16),2*ones(1,48),1*ones(1,16)]
 D_nodes = [1:5, 51:55]
 D_value = [10*ones(1,5), 20*ones(1,5)]
 N_nodes = []
 N_value = []
 C = sparse((1:D*E), reshape(elems',D*E,1),1, D*E, N)
 Siidx = floor([0:D*E-1]'/D)*D*ones(1,D) + ones(D*E,1)*(1:D)
 Sjidx = [1:D*E]'*ones(1,D)
 Sdata = zeros(D*E,D)
 dfact = prod(2:(D-1))
 const = conductivity(j)*2/dfact/abs(det(a))
endfor SE = sparse(Siidx,Sjidx,Sdata)
 S = C'* SE *C
 V = zeros(N,1)
 Q = zeros(N,1)
 velems = reshape( V(elemx), 4, E)
 sz = size(xelems,2)
endif endfunction function txt fid = fopen (sprintf ("%s.txt", nm), "wt")
 return
 x = y = linspace (-8, 8, 41)'
 r = meshgrid (x, y) sqrt (xx .^ 2 + yy .^ 2) + eps
 z = sin (r) ./ r
unwind_protect mesh (x, y, z)

Function Documentation

axis ( "ij"   ) 

endif endfunction function bury_output (  ) 

cstrcat ( "spmatrix."  ,
typ   
)

cstrcat ( "-d"  ,
typ   
)

Type Constraints

elseif ( strcmp(nm,"spcholperm")   ) 

elseif ( strcmp(nm,"spmatrix")   ) 

elseif ( strcmp(nm,"grid")   ) 

fclose ( fid   ) 

endfunction function femimages ( nm  ,
typ   
)

else fprintf ( fid  ,
" "   
)

fprintf ( fid  ,
"\n"   
)

else fprintf ( fid  ,
"--"   
)

else fprintf ( fid  ,
" | "   
)

fputs ( fid  ,
"| missing sparse matrix implementation. |\n"   
)

fputs ( fid  ,
"| Image unavailable because of a |\n"   
)

fputs ( fid  ,
"+---------------------------------------+\n"   
)

fputs ( fid  ,
"| Image unavailable in text mode. |\n"   
)

fputs ( fid  ,
"+---------------------------------+\n"   
)

fputs ( fid  ,
"\n"   
)

gplot ( ,
xy   
)

endfunction function gplotimages ( nm  ,
typ   
)

idx ( D_nodes   ) 

if ( strcmp(nm,"spmatrix")   ) 

else if ( isemptyfindstr(octave_config_info("DEFS"),"HAVE_COLAMD"))&&!isempty(findstr(octave_config_info("DEFS"),"HAVE_CHOLMOD")  ) 

if ( strcmp(nm,"gplot")||strcmp(nm,"grid")   ) 

else if ( strcmp(nm,"gplot")   ) 

endif if ( isemptyfindstr(octave_config_info("DEFS"),"HAVE_COLAMD"))&&!isempty(findstr(octave_config_info("DEFS"),"HAVE_CHOLMOD"))&&!isempty(findstr(octave_config_info("DEFS"),"HAVE_UMFPACK")  ) 

end_unwind_protect endif endfunction function image_as_txt ( nm   ) 

* ones ( ,
11   
)

endif endif endif endfunction function otherimages ( nm  ,
,
typ   
)

else otherimages ( nm  ,
200  ,
typ   
)

plot3 ( xelems  ,
yelems  ,
velems   
)

print ( cstrcat(nm,".", typ ,
cstrcat("-d", typ)   
)

endif endif endif endfunction function printsparse ( ,
nm   
)

printsparse ( r2  ,
cstrcat("spcholperm.", typ)   
)

printsparse ( r1  ,
cstrcat("spchol.", typ)   
)

Q ( N_nodes   ) 

Sdata ( D j-1)+(1:D,
 
)

set ( ,
"visible"  ,
"off"   
)

function png set ( ,
"defaulttextfontname"  ,
"*"   
)

endif endif else sombreroimage ( nm  ,
typ   
)

function sparseimages ( nm  ,
typ   
)

spy ( r2   ) 

spy ( r1   ) 

title ( Sorry,
graphics not available because octave was\\ncompiled without the sparse matrix implementation."   
)

endfunction function txtimages ( nm  ,
,
typ   
)

endif txt txtimages ( nm  ,
15  ,
typ   
)

V ( idx   ) 

V ( D_nodes   ) 

view ( 10  ,
10   
)


Variable Documentation

test try clear a a

Initial value:

 10*speye(n) + sparse(1:n,ceil([1:n]/2),1,n,n) + ...
      sparse(ceil([1:n]/2),1:n,1,n,n)

A

Initial value:

 sparse ([2,6,1,3,2,4,3,5,4,6,1,5],
              [1,1,2,2,3,3,4,4,5,5,6,6], 1, 6, 6)

C = sparse((1:D*E), reshape(elems',D*E,1),1, D*E, N)

conductivity = [1*ones(1,16),2*ones(1,48),1*ones(1,16)]

const = conductivity(j)*2/dfact/abs(det(a))

sparse matrix D = size(elems,2)

D_nodes = [1:5, 51:55]

D_value = [10*ones(1,5), 20*ones(1,5)]

dfact = prod(2:(D-1))

endfor E = size(elems,1)

elems = size(node_x) []

elemx = elems(:,[1,2,3,1])'

endif endfunction function txt fid = fopen (sprintf ("%s.txt", nm), "wt")

id i

Initial value:

 1:size(a,1)
    if (rem(i,5) == 0)
      fprintf (fid,"         %2d - ", i)

Initial value:

 1:w-1
      widx = (idx-1)*h

for j

Initial value:

 1:size(a,2)
      if (a(i,j) == 0)
        fprintf(fid,"  ")
      else
        fprintf(fid," *")
      endif
    endfor
    fprintf(fid,"\n")
  endfor
  fprintf(fid,"            |-")

unwind_protect mesh(x, y, z)

F77_RET_T octave_idx_type const octave_idx_type & N = size(nodes,1)

N_nodes = []

N_value = []

node_x = ones(5,1)*[1,1.05,1.1,1.2,1.3,1.5,1.7,1.8,1.9,1.95,2]

nodes = [node_x(:), node_y(:)]

p2

Q = zeros(N,1)

q2 = chol(a)

r = meshgrid (x, y) sqrt (xx .^ 2 + yy .^ 2) + eps

else spchol r1 = chol(a)

return

else S = C'* SE *C

Sdata = zeros(D*E,D)

endfor SE = sparse(Siidx,Sjidx,Sdata)

Siidx = floor([0:D*E-1]'/D)*D*ones(1,D) + ones(D*E,1)*(1:D)

Sjidx = [1:D*E]'*ones(1,D)

sz = size(xelems,2)

typ

V = zeros(N,1)

velems = reshape( V(elemx), 4, E)

x = y = linspace (-8, 8, 41)'

xelems = reshape( nodes(elemx, 1), 4, E)

xy = [0,4,8,6,4,2

yelems = reshape( nodes(elemx, 2), 4, E)

z = sin (r) ./ r