changeset 6001:d45cb743ff2e

[project @ 2006-09-26 16:28:15 by jwe]
author jwe
date Tue, 26 Sep 2006 16:28:15 +0000
parents fbe7ccb47f62
children c5d0490aad55
files ChangeLog configure.in doc/ChangeLog doc/interpreter/Makefile.in doc/interpreter/images/Makefile.in doc/interpreter/images/sparseimages.m
diffstat 6 files changed, 67 insertions(+), 312 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Sep 26 15:43:44 2006 +0000
+++ b/ChangeLog	Tue Sep 26 16:28:15 2006 +0000
@@ -1,3 +1,8 @@
+2006-09-26  John W. Eaton  <jwe@octave.org>
+
+	* configure.in (AC_CONFIG_FILES):
+	Remove doc/interpreter/images/Makefile from the list.
+
 2006-09-16  John W. Eaton  <jwe@octave.org>
 
 	* octave-bug.in: Delete LIBPLPLOT variables.
--- a/configure.in	Tue Sep 26 15:43:44 2006 +0000
+++ b/configure.in	Tue Sep 26 16:28:15 2006 +0000
@@ -29,7 +29,7 @@
 EXTERN_CXXFLAGS="$CXXFLAGS"
 
 AC_INIT
-AC_REVISION($Revision: 1.520 $)
+AC_REVISION($Revision: 1.521 $)
 AC_PREREQ(2.57)
 AC_CONFIG_SRCDIR([src/octave.cc])
 AC_CONFIG_HEADER(config.h)
@@ -1744,8 +1744,7 @@
 ### Do the substitutions in all the Makefiles.
 
 AC_CONFIG_FILES([Makefile octMakefile Makeconf test/Makefile \
-  dlfcn/Makefile doc/Makefile doc/faq/Makefile \
-  doc/interpreter/Makefile doc/interpreter/images/Makefile \
+  dlfcn/Makefile doc/Makefile doc/faq/Makefile doc/interpreter/Makefile 
   doc/liboctave/Makefile doc/refcard/Makefile emacs/Makefile \
   examples/Makefile liboctave/Makefile liboctave/oct-types.h \
   src/Makefile libcruft/Makefile libcruft/Makerules \
--- a/doc/ChangeLog	Tue Sep 26 15:43:44 2006 +0000
+++ b/doc/ChangeLog	Tue Sep 26 16:28:15 2006 +0000
@@ -1,3 +1,23 @@
+2006-09-26  John W. Eaton  <jwe@octave.org>
+
+	* interpreter/Makefile.in (stamp-images): Delete.
+	(octave.info): Depend on $(IMAGES_TXT), not stamp-images.
+	(octave.dvi): Depend on $(IMAGES_EPS), not stamp-images.
+	(octave.pdf): Depend on $(IMAGES_PDF), not stamp-images.
+	(html-figs): Depend on $(IMAGES_PNG), not stamp-images.
+	(SCRIPT_SOURCES, SPARSEIMAGES_1, SPARSEIMAGES_EPS,
+	SPARSEIMAGES_PDF, SPARSEIMAGES_PNG, SPARSE_IMAGES_TXT, IMAGES_EPS,
+	IMAGES_PDF, IMAGES_PNG, IMAGES_TXT, and IMAGES): New variables.
+	(SOURCES): Include $(SCRIPT_SOURCES) in the list.
+	(DISTFILES): Include $(IMAGES) in the list.
+	(maintainer-clean): Delete $(IMAGES) here.
+	(DISTSUBDIRS, SUBDIRS): Remove $(IMAGEDIR) from list.
+	(octave.dvi, octave.info, octave.pdf, HTML/index.html):
+	Don't include $(IMAGEDIR) in list of directories to search
+	* sparseimages.m: Move here from images/sparseimages.m.
+	* images/Makefile.in: Delete.
+	* images: Delete directory.
+
 2006-08-24  John W. Eaton  <jwe@octave.org>
 
 	* interpreter/images/Makefile.in (SPARSEIMAGES_PDF): New macro.
--- a/doc/interpreter/Makefile.in	Tue Sep 26 15:43:44 2006 +0000
+++ b/doc/interpreter/Makefile.in	Tue Sep 26 16:28:15 2006 +0000
@@ -18,7 +18,21 @@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_DATA = @INSTALL_DATA@
 
-IMAGEDIR = images
+SCRIPT_SOURCES = sparseimages.m
+
+SPARSEIMAGES_1 = gplot grid spmatrix spchol spcholperm
+
+SPARSEIMAGES_EPS = $(addsuffix .eps, $(SPARSEIMAGES_1))
+SPARSEIMAGES_PDF = $(addsuffix .pdf, $(SPARSEIMAGES_1))
+SPARSEIMAGES_PNG = $(addsuffix .png, $(SPARSEIMAGES_1))
+SPARSEIMAGES_TXT = $(addsuffix .txt, $(SPARSEIMAGES_1))
+
+IMAGES_EPS = $(SPARSEIMAGES_EPS)
+IMAGES_PDF = $(SPARSEIMAGES_PDF)
+IMAGES_PNG = $(SPARSEIMAGES_PNG)
+IMAGES_TXT = $(SPARSEIMAGES_TXT)
+  
+IMAGES = $(IMAGES_EPS) $(IMAGES_PDF) $(IMAGES_PNG) $(IMAGES_TXT)
 
 SUB_SOURCE := arith.txi audio.txi basics.txi bugs.txi \
 	container.txi control.txi cp-idx.txi data.txi \
@@ -31,7 +45,7 @@
 	stmt.txi stream.txi strings.txi struct.txi system.txi \
 	testfun.txi tips.txi var.txi vr-idx.txi
 
-SOURCES := $(SUB_SOURCE)
+SOURCES := $(SUB_SOURCE) $(SCRIPT_SOURCES)
 
 MAIN_TEXINFO := $(srcdir)/octave.texi
 
@@ -47,13 +61,13 @@
 
 # FIXME -- need to include generated figures here...
 DISTFILES = Makefile.in dir munge-texi.cc $(MAN_SRC) \
-  $(SOURCES) $(TEXINFO) $(FORMATTED)
+  $(SOURCES) $(TEXINFO) $(FORMATTED) $(IMAGES)
 
 DISTDIRS = HTML
 
-DISTSUBDIRS = $(IMAGEDIR)
+DISTSUBDIRS :=
 
-SUBDIRS := $(IMAGEDIR)
+SUBDIRS :=
 
 # Look for version.h to get version information.
 xfiles := $(TOPDIR)/src/version.h $(srcdir)/$(TOPDIR)/src/version.h
@@ -90,21 +104,17 @@
 	  -d $(TOPDIR)/scripts/DOCSTRINGS < $< > $@.t
 	@$(top_srcdir)/move-if-change $@.t $@
 
-stamp-images:
-	$(MAKE) -C images
-.PHONY: stamp-images
+octave.info: $(IMAGES_TXT) $(TEXINFO)
+	-$(MAKEINFO) -I.. -I$(srcdir) -I$(srcdir)/.. $(MAIN_TEXINFO)
 
-octave.info: stamp-images $(TEXINFO)
-	-$(MAKEINFO) -I.. -I$(srcdir) -I$(srcdir)/.. -I$(IMAGEDIR) $(MAIN_TEXINFO)
-
-octave.dvi: stamp-images $(TEXINFO)
-	-TEXINPUTS="..:$(srcdir):$(srcdir)/..:$(IMAGEDIR):$(TEXINPUTS):" $(TEXI2DVI) $(MAIN_TEXINFO)
+octave.dvi: $(IMAGES_EPS) $(TEXINFO)
+	-TEXINPUTS="..:$(srcdir):$(srcdir)/..:$(TEXINPUTS):" $(TEXI2DVI) $(MAIN_TEXINFO)
 
 octave.ps: octave.dvi
 	-dvips -o $@ $<
 
-octave.pdf: stamp-images $(TEXINFO)
-	-TEXINPUTS="..:$(srcdir):$(srcdir)/..:$(IMAGEDIR):$(TEXINPUTS):" $(TEXI2PDF) $(MAIN_TEXINFO)
+octave.pdf: $(IMAGES_PDF) $(TEXINFO)
+	-TEXINPUTS="..:$(srcdir):$(srcdir)/..:$(TEXINPUTS):" $(TEXI2PDF) $(MAIN_TEXINFO)
 
 ../../INSTALL.OCTAVE: install.texi
 	rm -f INSTALL
@@ -121,15 +131,26 @@
 	mv BUGS ../../BUGS
 
 HTML/index.html: html-figs $(TEXINFO)
-	-$(MAKEINFO) --html --ifinfo --output=HTML -I.. -I$(srcdir) -I$(srcdir)/.. -I$(IMAGEDIR) $(MAIN_TEXINFO)
+	-$(MAKEINFO) --html --ifinfo --output=HTML -I.. -I$(srcdir) -I$(srcdir)/.. $(MAIN_TEXINFO)
 
-html-figs: stamp-images html-dir
-	$(INSTALL_DATA) images/*.png HTML
+html-figs: $(IMAGES_PNG) html-dir
+	$(INSTALL_DATA) $(IMAGES_PNG) HTML
 .PHONY: html-figs
 
 html-dir:
 	if [ -d HTML ]; then true; else mkdir HTML; fi
 
+define run-octave
+  $(TOPDIR)/run-octave -f -q -H -p $(srcdir) \
+    --eval "$(notdir $(basename $<)) ('$(notdir $(basename $@))', '$(patsubst .%,%, $(suffix $@))')"
+endef
+
+$(SPARSEIMAGES_EPS) $(SPARSEIMAGES_PNG) $(SPARSEIMAGES_TXT): sparseimages.m
+	$(run-octave)
+
+$(IMAGES_PDF) : %.pdf : %.eps
+	if [ -f $< ] ; then $(GHOSTSCRIPT) -dBATCH -dEPSCrop -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=$@ $< ; fi
+
 check: all
 .PHONY: check
 
@@ -206,7 +227,7 @@
 .PHONY: distclean
 
 maintainer-clean: clean-texi
-	rm -f Makefile tags TAGS $(FORMATTED)
+	rm -f Makefile tags TAGS $(FORMATTED) $(IMAGES)
 	rm -rf HTML
 .PHONY: maintainer-clean
 
--- a/doc/interpreter/images/Makefile.in	Tue Sep 26 15:43:44 2006 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-TOPDIR = ../../..
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-
-include $(TOPDIR)/Makeconf
-
-SOURCES = sparseimages.m
-
-SPARSEIMAGES_1 = gplot grid spmatrix spchol spcholperm
-SPARSEIMAGES = \
-  $(addsuffix .eps, $(SPARSEIMAGES_1)) \
-  $(addsuffix .png, $(SPARSEIMAGES_1)) \
-  $(addsuffix .txt, $(SPARSEIMAGES_1))
-
-# These are kept separate from the rest because they are generated
-# from the EPS files instead of directly from the sparseimages.m script.
-SPARSEIMAGES_PDF = \
-  $(addsuffix .pdf, $(SPARSEIMAGES_1))
-
-IMAGES = $(SPARSEIMAGES) $(SPARSEIMAGES_PDF)
-
-DISTFILES = Makefile.in $(SOURCES) $(IMAGES)
-
-all: $(IMAGES)
-.PHONY: all
-
-define run-octave
-  $(TOPDIR)/run-octave -f -q -H -p $(srcdir) \
-    --eval "$(notdir $(basename $<)) ('$(notdir $(basename $@))', '$(patsubst .%,%, $(suffix $@))')"
-endef
-
-$(SPARSEIMAGES): sparseimages.m
-	$(run-octave)
-
-%.pdf : %.eps
-	if [ -f $< ] ; then $(GHOSTSCRIPT) -dBATCH -dEPSCrop -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=$@ $< ; fi
-
-install install-strip:
-.PHONY: install install-strip
-
-uninstall:
-.PHONY: uninstall
-
-tags: $(SOURCES)
-	ctags $(SOURCES)
-
-TAGS: $(SOURCES)
-	etags $(SOURCES)
-
-clean:
-.PHONY: clean
-
-mostlyclean:
-.PHONY: mostlyclean
-
-distclean: clean
-	rm -f Makefile
-.PHONY: distclean
-
-maintainer-clean: distclean
-	rm -f tags TAGS
-	rm -f $(IMAGES)
-.PHONY: maintainer-clean
-
-dist:
-	ln $(DISTFILES) ../../../`cat ../../../.fname`/doc/interpreter/images
-.PHONY: dist
--- a/doc/interpreter/images/sparseimages.m	Tue Sep 26 15:43:44 2006 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,221 +0,0 @@
-function sparseimages(nm,typ)
-  if (strcmp(typ,"txt"))
-    txtimages(nm,15,typ);
-  else
-    if (strcmp (nm, "gplot"))
-      gplotimages("gplot",typ);
-    elseif (strcmp (nm, "grid"))
-      femimages("grid",typ);
-    else
-      otherimages(nm,200,typ);
-    endif
-  endif
-  ## Kluge to give gnuplot enough time to process last figure before we
-  ## exit.  Otherwise, Octave will delete the temporary data files when
-  ## it exits and gnuplot will fail...
-  sleep (1);
-endfunction
-
-## Use this function before plotting commands and after every call to
-## print since print() resets output to stdout (unfortunately, gnpulot
-## can't pop output as it can the terminal type).
-function bury_output ()
-  automatic_replot(0);
-  __gnuplot_set__ term dumb
-  [status, dummy] = fileattrib("/dev/null");
-  if (status)
-    __gnuplot_raw__ ("set output \"/dev/null\"\n");
-  endif
-endfunction
-
-function gplotimages(nm,typ)
-  bury_output ();
-  A = 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);
-  xy = [0,4,8,6,4,2;5,0,5,7,5,7]';
-  gplot(A,xy)
-  print(strcat(nm,".",typ),strcat("-d",typ))
-  bury_output ();
-endfunction
-
-function txtimages(nm,n,typ)
-  a = 10*speye(n) + sparse(1:n,ceil([1:n]/2),1,n,n) + ...
-      sparse(ceil([1:n]/2),1:n,1,n,n);
-  if (strcmp (nm, "gplot") || strcmp (nm, "grid"))
-    fid = fopen (sprintf ("%s.txt", nm), "wt");
-    fputs (fid, "+---------------------------------+\n");
-    fputs (fid, "| Image unavailable in text mode. |\n");
-    fputs (fid, "+---------------------------------+\n");
-    fclose (fid);
-  elseif (strcmp (nm, "spmatrix"))
-    printsparse(a,strcat("spmatrix.",typ));
-  else
-    if (!isempty(findstr(octave_config_info ("DEFS"),"HAVE_COLAMD")) &&
-	!isempty(findstr(octave_config_info ("DEFS"),"HAVE_CHOLMOD")))
-      if (strcmp (nm, "spchol"))
-	r1 = chol(a);
-	printsparse(r1,strcat("spchol.",typ));
-      elseif (strcmp (nm, "spcholperm"))
-	[r2,p2,q2]=chol(a);
-	printsparse(r2,strcat("spcholperm.",typ));
-      endif
-      ## printf("Text NNZ: Matrix %d, Chol %d, PermChol %d\n",nnz(a),nnz(r1),nnz(r2));
-    endif
-  endif
-endfunction
-
-function otherimages(nm,n,typ)
-  bury_output ();
-  a = 10*speye(n) + sparse(1:n,ceil([1:n]/2),1,n,n) + ...
-      sparse(ceil([1:n]/2),1:n,1,n,n);
-  if (strcmp (nm, "spmatrix"))
-    spy(a);
-    axis("ij")
-    print(strcat("spmatrix.",typ),strcat("-d",typ))
-    bury_output ();
-  else
-    if (!isempty(findstr(octave_config_info ("DEFS"),"HAVE_COLAMD")) &&
-	!isempty(findstr(octave_config_info ("DEFS"),"HAVE_CHOLMOD")))
-      if (strcmp (nm, "spchol"))
-	r1 = chol(a);
-	spy(r1);
-	axis("ij")
-	print(strcat("spchol.",typ),strcat("-d",typ))
-	bury_output ();
-      elseif (strcmp (nm, "spcholperm"))
-	[r2,p2,q2]=chol(a);
-	spy(r2);
-	axis("ij")
-	print(strcat("spcholperm.",typ),strcat("-d",typ))
-	bury_output ();
-      endif
-      ## printf("Image NNZ: Matrix %d, Chol %d, PermChol %d\n",nnz(a),nnz(r1),nnz(r2));
-    endif
-  endif
-endfunction
-
-function printsparse(a,nm)
-  fid = fopen (nm,"wt");
-  for i = 1:size(a,1)
-    if (rem(i,5) == 0)
-      fprintf (fid,"         %2d - ", i);
-    else
-      fprintf (fid,"            | ");
-    endif
-    for j = 1:size(a,2)
-      if (a(i,j) == 0)
-	fprintf(fid,"  ")
-      else
-	fprintf(fid," *")
-      endif
-    endfor
-    fprintf(fid,"\n")
-  endfor
-  fprintf(fid,"            |-");
-  for j=1:size(a,2)
-    if (rem(j,5)==0)
-      fprintf(fid,"-|");
-    else
-      fprintf(fid,"--");
-    endif
-  endfor
-  fprintf(fid,"\n")
-  fprintf(fid,"              ");
-  for j=1:size(a,2)
-    if (rem(j,5)==0)
-      fprintf(fid,"%2d",j);
-    else
-      fprintf(fid,"  ");
-    endif
-  endfor
-  fclose(fid);
-endfunction
-
-function femimages (nm,typ)
-  bury_output ();
-  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")))
-    ## build a rectangle
-    node_y = [1;1.2;1.5;1.8;2]*ones(1,11);
-    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(:)];
-
-    [h,w] = size(node_x);
-    elems = [];
-    for idx = 1:w-1
-      widx = (idx-1)*h;
-      elems = [elems; widx+[(1:h-1);(2:h);h+(1:h-1)]']; 
-      elems = [elems; widx+[(2:h);h+(2:h);h+(1:h-1)]']; 
-    endfor
-
-    E = size(elems,1);  #No. of elements
-    N = size(nodes,1);  #No. of elements
-    D = size(elems,2);  #dimentions+1
-
-    ## Plot FEM Geometry
-    elemx = elems(:,[1,2,3,1])';
-    xelems = reshape( nodes(elemx, 1), 4, E);
-    yelems = reshape( nodes(elemx, 2), 4, E);
-
-    ## Set element conductivity
-    conductivity = [1*ones(1,16),2*ones(1,48),1*ones(1,16)];
-
-    ## Dirichlet boundary conditions
-    D_nodes = [1:5, 51:55]; 
-    D_value = [10*ones(1,5), 20*ones(1,5)]; 
-  
-    ## Neumann boundary conditions
-    ## Note that N_value must be normalized by the boundary
-    ##   length and element conductivity
-    N_nodes = [];
-    N_value = [];
-
-    ## Calculate connectivity matrix
-    C = sparse((1:D*E), reshape(elems',D*E,1),1, D*E, N);
-
-    ## Calculate stiffness matrix
-    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));
-    for j = 1:E
-      a = inv([ ones(D,1), nodes( elems(j,:), : ) ]);
-      const = conductivity(j)*2/dfact/abs(det(a));
-      Sdata(D*(j-1)+(1:D),:)= const * a(2:D,:)'*a(2:D,:);
-    endfor
-
-    ## Element-wise system matrix
-    SE = sparse(Siidx,Sjidx,Sdata);
-    ## Global system matrix
-    S = C'* SE *C;
-
-    ## Set Dirichlet boundary
-    V = zeros(N,1);
-    V(D_nodes) = D_value;
-    idx = 1:N;
-    idx(D_nodes) = [];
-
-    ## Set Neumann boundary
-    Q = zeros(N,1);
-    Q(N_nodes) = N_value; # FIXME
-
-    V(idx) = S(idx,idx)\( Q(idx) - S(idx,D_nodes)*V(D_nodes) );
-
-    velems = reshape( V(elemx), 4, E);
-
-    sz = size(xelems,2);
-    ## FIXME How can I do this without a gnuplot specific commands? plot3 anyone?
-    unwind_protect
-      __gnuplot_set__  parametric;
-      __gnuplot_raw__ ("set nohidden3d;\n");
-      tmp = [([xelems; NaN*ones(1,sz)])(:), ([yelems; NaN*ones(1,sz)])(:), ([velems; NaN*ones(1,sz)])(:)];
-      __gnuplot_splot__(tmp);
-      __gnuplot_raw__ ("set view 80,10;\n")
-      print(strcat(nm,".",typ),strcat("-d",typ))
-      bury_output ();
-    unwind_protect_cleanup
-      __gnuplot_set__ noparametric; 
-    end_unwind_protect
-  endif
-endfunction