is the maximum # function evaluations (0 for none).
*/
#ifdef TEST_INTEGRATOR
int count = 0;
int which_integrand = 0;
const double radius = 0.50124145262344534123412; /* random */
/* Simple constant function */
num
fconst (double x[], size_t dim, void *params)
{
return 1;
}
/*** f0, f1, f2, and f3 are test functions from the Monte-Carlo
integration routines in GSL 1.6 (monte/test.c). Copyright (c)
1996-2000 Michael Booth, GNU GPL. ****/
/* Simple product function */
num f0 (unsigned dim, const double *x, void *params)
{
double prod = 1.0;
unsigned int i;
for (i = 0; i < dim; ++i)
prod *= 2.0 * x[i];
return prod;
}
/* Gaussian centered at 1/2. */
num f1 (unsigned dim, const double *x, void *params)
{
double a = *(double *)params;
double sum = 0.;
unsigned int i;
for (i = 0; i < dim; i++) {
double dx = x[i] - 0.5;
sum += dx * dx;
}
return (pow (M_2_SQRTPI / (2. * a), (double) dim) *
exp (-sum / (a * a)));
}
/* double gaussian */
num f2 (unsigned dim, const double *x, void *params)
{
double a = *(double *)params;
double sum1 = 0.;
double sum2 = 0.;
unsigned int i;
for (i = 0; i < dim; i++) {
double dx1 = x[i] - 1. / 3.;
double dx2 = x[i] - 2. / 3.;
sum1 += dx1 * dx1;
sum2 += dx2 * dx2;
}
return 0.5 * pow (M_2_SQRTPI / (2. * a), dim)
* (exp (-sum1 / (a * a)) + exp (-sum2 / (a * a)));
}
/* Tsuda's example */
num f3 (unsigned dim, const double *x, void *params)
{
double c = *(double *)params;
double prod = 1.;
unsigned int i;
for (i = 0; i < dim; i++)
prod *= c / (c + 1) * pow((c + 1) / (c + x[i]), 2.0);
return prod;
}
/*** end of GSL test functions ***/
num f_test(unsigned dim, const double *x, void *data)
{
double val;
unsigned i;
++count;
switch (which_integrand) {
case 0: /* simple smooth (separable) objective: prod. cos(x[i]). */
val = 1;
for (i = 0; i < dim; ++i)
val *= cos(x[i]);
break;
case 1: { /* integral of exp(-x^2), rescaled to (0,infinity) limits */
double scale = 1.0;
val = 0;
for (i = 0; i < dim; ++i) {
double z = (1 - x[i]) / x[i];
val += z * z;
scale *= M_2_SQRTPI / (x[i] * x[i]);
}
val = exp(-val) * scale;
break;
}
case 2: /* discontinuous objective: volume of hypersphere */
val = 0;
for (i = 0; i < dim; ++i)
val += x[i] * x[i];
val = val < radius * radius;
break;
case 3:
val = f0(dim, x, data);
break;
case 4:
val = f1(dim, x, data);
break;
case 5:
val = f2(dim, x, data);
break;
case 6:
val = f3(dim, x, data);
break;
default:
fprintf(stderr, "unknown integrand %d\n", which_integrand);
exit(EXIT_FAILURE);
}
/* if (count < 100) printf("%d: f(%g, ...) = %g\n", count, x[0], val); */
return val;
}
/* surface area of n-dimensional unit hypersphere */
static double S(unsigned n)
{
double val;
int fact = 1;
if (n % 2 == 0) { /* n even */
val = 2 * pow(M_PI, n * 0.5);
n = n / 2;
while (n > 1) fact *= (n -= 1);
val /= fact;
}
else { /* n odd */
val = (1 << (n/2 + 1)) * pow(M_PI, n/2);
while (n > 2) fact *= (n -= 2);
val /= fact;
}
return val;
}
static num exact_integral(unsigned dim, const double *xmax) {
unsigned i;
double val;
switch(which_integrand) {
case 0:
val = 1;
for (i = 0; i < dim; ++i)
val *= sin(xmax[i]);
break;
case 2:
val = dim == 0 ? 1 : S(dim) * pow(radius * 0.5, dim) / dim;
break;
default:
val = 1.0;
}
return val;
}
int main(int argc, char **argv)
{
double *xmin, *xmax;
double tol, err;
num val;
unsigned i, dim, maxEval;
double fdata;
dim = argc > 1 ? atoi(argv[1]) : 2;
tol = argc > 2 ? atof(argv[2]) : 1e-2;
which_integrand = argc > 3 ? atoi(argv[3]) : 0;
maxEval = argc > 4 ? atoi(argv[4]) : 0;
fdata = which_integrand == 6 ? (1.0 + sqrt (10.0)) / 9.0 : 0.1;
xmin = (double *) malloc(dim * sizeof(double));
xmax = (double *) malloc(dim * sizeof(double));
for (i = 0; i < dim; ++i) {
xmin[i] = 0;
xmax[i] = 1 + (which_integrand >= 1 ? 0 : 0.4 * sin(i));
}
printf("%u-dim integral, tolerance = %g, integrand = %d\n",
dim, tol, which_integrand);
adapt_integrate(f_test, &fdata,
dim, xmin, xmax,
maxEval, 0, tol, &val, &err);
printf("integration val = %g, est. err = %g, true err = %g\n",
val, err, num_abs(val - exact_integral(dim, xmax)));
printf("#evals = %d\n", count);
free(xmax);
free(xmin);
return 0;
}
#else
/*************************************************************************/
/* libctl interface */
static int adapt_integrate(integrand f, void *fdata,
unsigned dim, const double *xmin, const double *xmax,
unsigned maxEval,
double reqAbsError, double reqRelError,
num *val, double *err);
typedef struct {
cmultivar_func f;
void *fdata;
} cnum_wrap_data;
static num cnum_wrap(unsigned ndim, const double *x, void *fdata_)
{
cnum_wrap_data *fdata = (cnum_wrap_data *) fdata_;
cnumber val = fdata->f(ndim, (double *) x, fdata->fdata);
return (cnumber_re(val) + I*cnumber_im(val));
}
cnumber cadaptive_integration(cmultivar_func f, number *xmin, number *xmax,
integer n, void *fdata,
number abstol, number reltol, integer maxnfe,
number *esterr, integer *errflag)
{
num val;
cnum_wrap_data wdata;
wdata.f = f; wdata.fdata = fdata;
*errflag = adapt_integrate(cnum_wrap, &wdata, n, xmin, xmax,
maxnfe, abstol, reltol, &val, esterr);
return make_cnumber(creal(val), cimag(val));
}
static cnumber cf_scm_wrapper(integer n, number *x, void *f_scm_p)
{
SCM *f_scm = (SCM *) f_scm_p;
return scm2cnumber(gh_call1(*f_scm, make_number_list(n, x)));
}
SCM cadaptive_integration_scm(SCM f_scm, SCM xmin_scm, SCM xmax_scm,
SCM abstol_scm, SCM reltol_scm, SCM maxnfe_scm)
{
integer n, maxnfe, errflag, i;
number *xmin, *xmax, abstol, reltol;
cnumber integral;
n = list_length(xmin_scm);
abstol = fabs(gh_scm2double(abstol_scm));
reltol = fabs(gh_scm2double(reltol_scm));
maxnfe = gh_scm2int(maxnfe_scm);
if (list_length(xmax_scm) != n) {
fprintf(stderr, "adaptive_integration: xmin/xmax dimension mismatch\n");
return SCM_UNDEFINED;
}
xmin = (number*) malloc(sizeof(number) * n);
xmax = (number*) malloc(sizeof(number) * n);
if (!xmin || !xmax) {
fprintf(stderr, "adaptive_integration: error, out of memory!\n");
exit(EXIT_FAILURE);
}
for (i = 0; i < n; ++i) {
xmin[i] = number_list_ref(xmin_scm, i);
xmax[i] = number_list_ref(xmax_scm, i);
}
integral = cadaptive_integration(cf_scm_wrapper, xmin, xmax, n, &f_scm,
abstol, reltol, maxnfe,
&abstol, &errflag);
free(xmax);
free(xmin);
switch (errflag) {
case 3:
fprintf(stderr, "adaptive_integration: invalid inputs\n");
return SCM_UNDEFINED;
case 1:
fprintf(stderr, "adaptive_integration: maxnfe too small\n");
break;
case 2:
fprintf(stderr, "adaptive_integration: lenwork too small\n");
break;
}
return gh_cons(cnumber2scm(integral), gh_double2scm(abstol));
}
#endif
#endif /* CTL_HAS_COMPLEX_INTEGRATION */
libctl-3.1/src/Makefile.in 0000644 0001754 0000144 00000044366 11212243176 012417 0000000 0000000 # Makefile.in generated by automake 1.11 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = src
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/ctl.h.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h ctl.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"
LTLIBRARIES = $(lib_LTLIBRARIES)
libctl_la_LIBADD =
am_libctl_la_OBJECTS = ctl.lo subplex.lo ctl-f77-glue.lo integrator.lo \
cintegrator.lo
libctl_la_OBJECTS = $(am_libctl_la_OBJECTS)
libctl_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(libctl_la_LDFLAGS) $(LDFLAGS) -o $@
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
SOURCES = $(libctl_la_SOURCES)
DIST_SOURCES = $(libctl_la_SOURCES)
HEADERS = $(nodist_include_HEADERS)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
FGREP = @FGREP@
FLIBS = @FLIBS@
GEN_CTL_IO = @GEN_CTL_IO@
GREP = @GREP@
GUILE = @GUILE@
GUILE_CONFIG = @GUILE_CONFIG@
INDENT = @INDENT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBCTL_DIR = @LIBCTL_DIR@
LIBCTL_VERSION = @LIBCTL_VERSION@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHARED_VERSION_INFO = @SHARED_VERSION_INFO@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
ac_ct_F77 = @ac_ct_F77@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
lib_LTLIBRARIES = libctl.la
nodist_include_HEADERS = ctl.h
BUILT_SOURCES = ctl.h
EXTRA_DIST = ctl.h.in
libctl_la_SOURCES = ctl.c subplex.c ctl-f77-glue.c integrator.c cintegrator.c
libctl_la_LDFLAGS = -no-undefined -version-info @SHARED_VERSION_INFO@
all: $(BUILT_SOURCES) ctl.h
$(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu src/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
ctl.h: stamp-h2
@if test ! -f $@; then \
rm -f stamp-h2; \
$(MAKE) $(AM_MAKEFLAGS) stamp-h2; \
else :; fi
stamp-h2: $(srcdir)/ctl.h.in $(top_builddir)/config.status
@rm -f stamp-h2
cd $(top_builddir) && $(SHELL) ./config.status src/ctl.h
$(srcdir)/ctl.h.in: $(am__configure_deps)
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
rm -f stamp-h2
touch $@
distclean-hdr:
-rm -f ctl.h stamp-h2
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
list2=; for p in $$list; do \
if test -f $$p; then \
list2="$$list2 $$p"; \
else :; fi; \
done; \
test -z "$$list2" || { \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
}
uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
for p in $$list; do \
$(am__strip_dir) \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
done
clean-libLTLIBRARIES:
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
test "$$dir" != "$$p" || dir=.; \
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
libctl.la: $(libctl_la_OBJECTS) $(libctl_la_DEPENDENCIES)
$(libctl_la_LINK) -rpath $(libdir) $(libctl_la_OBJECTS) $(libctl_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cintegrator.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctl-f77-glue.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctl.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/integrator.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/subplex.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-nodist_includeHEADERS: $(nodist_include_HEADERS)
@$(NORMAL_INSTALL)
test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
@list='$(nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
$(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
done
uninstall-nodist_includeHEADERS:
@$(NORMAL_UNINSTALL)
@list='$(nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
test -n "$$files" || exit 0; \
echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(includedir)" && rm -f $$files
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) ctl.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) ctl.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) ctl.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) ctl.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) check-am
all-am: Makefile $(LTLIBRARIES) $(HEADERS) ctl.h
installdirs:
for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
clean: clean-am
clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-hdr distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-nodist_includeHEADERS
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-libLTLIBRARIES
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-libLTLIBRARIES uninstall-nodist_includeHEADERS
.MAKE: all check install install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libLTLIBRARIES clean-libtool ctags distclean \
distclean-compile distclean-generic distclean-hdr \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-libLTLIBRARIES install-man \
install-nodist_includeHEADERS install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-libLTLIBRARIES \
uninstall-nodist_includeHEADERS
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
libctl-3.1/src/Makefile.am 0000644 0001754 0000144 00000000375 10413643716 012404 0000000 0000000 lib_LTLIBRARIES = libctl.la
nodist_include_HEADERS = ctl.h
BUILT_SOURCES = ctl.h
EXTRA_DIST = ctl.h.in
libctl_la_SOURCES = ctl.c subplex.c ctl-f77-glue.c integrator.c cintegrator.c
libctl_la_LDFLAGS = -no-undefined -version-info @SHARED_VERSION_INFO@
libctl-3.1/ChangeLog 0000644 0001754 0000144 00000213535 11212243241 011322 0000000 0000000 Fri Jun 5 12:22:40 EDT 2009 stevenj@fftw.org
* copyright-year update
M ./COPYRIGHT -1 +1
M ./base/class.scm -1 +1
M ./base/ctl.scm -1 +1
M ./base/extern-funcs.scm -1 +1
M ./base/help.scm -1 +1
M ./base/include.scm -1 +1
M ./base/interaction.scm -1 +1
M ./base/io-vars.scm -1 +1
M ./base/main.c -1 +1
M ./base/math-utils.scm -1 +1
M ./base/matrix3x3.scm -1 +1
M ./base/simplex.scm -1 +1
M ./base/utils.scm -1 +1
M ./base/vector3.scm -1 +1
M ./examples/example.c -1 +1
M ./examples/example.scm.in -1 +1
M ./src/ctl-f77-glue.c -1 +1
M ./src/ctl.c -1 +1
M ./src/ctl.h.in -1 +1
M ./utils/ctl-io.scm -1 +1
M ./utils/ctlgeom.h -1 +1
M ./utils/geom.c -1 +1
M ./utils/geom.scm -1 +1
Fri Jun 5 12:20:58 EDT 2009 stevenj@fftw.org
* NEWS, shared-lib version bump
M ./NEWS +18
M ./configure.ac -1 +1
Wed Jun 3 23:29:48 EDT 2009 stevenj@fftw.org
* use GUILE_CONFIG and GUILE env vars
M ./configure.ac -7 +8
M ./utils/gen-ctl-io.in -3 +3
Wed Jun 3 13:25:37 EDT 2009 stevenj@fftw.org
* whoops
M ./utils/ctlgeom.h -1 +1
Tue Jun 2 18:03:18 EDT 2009 stevenj@fftw.org
* use new autoconf datarootdir var
M ./utils/gen-ctl-io.in +1
Tue Jun 2 17:55:24 EDT 2009 stevenj@fftw.org
* tolerance tweak
M ./utils/geomtst.c -2 +2
Tue Jun 2 17:52:08 EDT 2009 stevenj@fftw.org
* fixed ellipsoid overlap function
M ./utils/geom.c -13 +42
M ./utils/geomtst.c -25 +38
Wed Apr 29 19:10:37 EDT 2009 stevenj@fftw.org
* first stab at ellipsoid_overlap function
M ./utils/ctlgeom.h +2
M ./utils/geom.c -12 +60
M ./utils/geomtst.c -2 +48
Mon Jan 12 19:31:24 EST 2009 stevenj@fftw.org
* bug fix in numerical derivative routine (didn't converge when error was exactly zero)
M ./base/math-utils.scm -1 +1
Thu Apr 24 21:32:32 EDT 2008 stevenj@fftw.org
* use primitive-load rather than load, since Guile nowadays includes the current directory in the load path and this conflicts with include's path tracking for relative paths
M ./base/include.scm -2 +7
Sat Apr 12 01:40:20 EDT 2008 stevenj@fftw.org
* grr, Guile-callable C functions cannot have > 10 argumeents
M ./base/main.c -3 +2
M ./utils/nlopt.c -11 +29
Sat Apr 12 01:01:01 EDT 2008 stevenj@fftw.org
* various small fixes to nlopt_minimize wrapper
M ./base/main.c +8
M ./utils/nlopt.c -9 +10
Sat Apr 12 00:01:56 EDT 2008 stevenj@fftw.org
* added preliminary support for nlopt_minimize wrapper (calling program must modify Makefile to use it)
M ./Makefile.am -1 +1
M ./base/main.c +6
M ./configure.ac -1 +7
M ./utils/Makefile.am -3 +9
A ./utils/nlopt.c
Sat Mar 8 23:26:13 EST 2008 stevenj@fftw.org
* rm inadvertent (but harmless) type conversion
M ./src/cintegrator.c -1 +1
M ./src/integrator.c -1 +1
Sat Mar 8 20:42:14 EST 2008 stevenj@fftw.org
* fixed bug in integrator test program
M ./src/cintegrator.c -1 +1
M ./src/integrator.c -1 +1
Wed Feb 27 21:15:18 EST 2008 stevenj@fftw.org
tagged 3.0.3
Wed Feb 27 21:14:57 EST 2008 stevenj@fftw.org
* 3.0.3 release date
M ./NEWS -1 +1
Sun Feb 24 00:21:37 EST 2008 stevenj@fftw.org
* version bump to 3.0.3
M ./NEWS +11
M ./configure.ac -2 +2
Sun Feb 24 00:11:05 EST 2008 stevenj@fftw.org
* correct gh_new_procedure arg cast and add mising string.h header; thanks to David Foster for the bug reports (when compiling C++ code on MacOS X)
M ./utils/ctl-io.scm -1 +1
M ./utils/gen-ctl-io.in +1
Thu Dec 6 18:55:32 EST 2007 stevenj@fftw.org
* bug fix: boolean should be counted as a primitive type (otherwise classes can't have boolean properties!)
M ./base/class.scm +1
Tue Jul 31 19:44:07 EDT 2007 stevenj@fftw.org
* SCM_VELTS is deprecated
M ./src/ctl.c +6
Tue Jul 31 19:41:31 EDT 2007 stevenj@fftw.org
* use set-param instead of set
M ./examples/run.ctl -1 +1
Wed Apr 25 12:52:16 EDT 2007 stevenj@fftw.org
* added "begin-timed", similar to "begin-time" but returns value of last statement instead of time
M ./base/utils.scm +9
Mon Oct 16 13:24:13 EDT 2006 stevenj@fftw.org
* add libctlgeom dependency (thanks to Ed Hill for suggestion)
M ./utils/Makefile.am -1 +1
Tue Aug 22 12:18:54 EDT 2006 stevenj@fftw.org
tagged 3.0.2
Tue Aug 22 12:15:38 EDT 2006 stevenj@fftw.org
* version bump
M ./NEWS +4
M ./configure.ac -2 +2
Thu Jul 6 21:38:55 EDT 2006 stevenj@fftw.org
* use gh_load instead of ctl_include when loading INCLUDE_SCM (apparently fixes a problem with guile 1.6.8)
M ./base/main.c -1 +1
Fri May 12 15:01:16 EDT 2006 stevenj@fftw.org
* generalize (get-resolution) to accept vectors of non-numeric values
M ./utils/geom.scm -1 +1
Sat May 6 17:52:24 EDT 2006 stevenj@fftw.org
tagged libctl-3-0-1
Mon May 1 14:06:27 EDT 2006 stevenj@fftw.org
* updated NEWS
M ./NEWS +7
Mon May 1 14:04:12 EDT 2006 stevenj@fftw.org
* use 3:0:0 as soname, to avoid conflicts with "manually" numbered libs packaged for Debian
M ./configure.ac -2 +2
Tue Apr 4 17:57:36 EDT 2006 stevenj@fftw.org
* -lgen is required for dirname/basename on SGI; thanks to Robyn Landers
M ./configure.ac +3
Tue Apr 4 17:44:22 EDT 2006 stevenj@fftw.org
* use datadir for libctl dir in gen-ctl-io, not prefix; thanks to Robyn Landers
M ./utils/gen-ctl-io.in -1 +2
Sun Apr 2 00:10:22 EST 2006 stevenj@fftw.org
tagged 3.0
Sat Apr 1 23:43:30 EST 2006 stevenj@fftw.org
* a couple fixes, and updated NEWS
M ./NEWS -1 +1
M ./base/main.c +3
M ./utils/Makefile.am -1 +1
Sat Apr 1 22:41:27 EST 2006 stevenj@fftw.org
* whoops, don't distribute ctl.h since it is built from ctl.h.in
M ./src/Makefile.am -1 +1
Sat Apr 1 22:03:08 EST 2006 stevenj@fftw.org
* more path fixes
M ./configure.ac -10 +5
M ./examples/Makefile.am -2 +6
M ./utils/ctlgeom.h -1 +3
Sat Apr 1 22:30:26 EST 2006 stevenj@fftw.org
* several fixes for VPATH builds
./examples/example.scm -> ./examples/example.scm.in
M ./configure.ac -3 +3
M ./examples/Makefile.am -1 +1
M ./examples/example.scm.in -1 +1
M ./utils/gen-ctl-io.in +1
Mon Mar 27 20:48:20 EST 2006 stevenj@fftw.org
* update copyrights, etcetera, in preparation for release
M ./AUTHORS +5
M ./COPYING -396 +232
M ./COPYRIGHT -1 +1
M ./NEWS -1 +6
M ./base/class.scm -1 +1
M ./base/ctl.scm -1 +1
M ./base/extern-funcs.scm -1 +1
M ./base/help.scm -1 +1
M ./base/include.scm -1 +1
M ./base/interaction.scm -1 +1
M ./base/io-vars.scm -1 +1
M ./base/main.c -1 +1
M ./base/math-utils.scm -1 +1
M ./base/matrix3x3.scm -1 +1
M ./base/simplex.scm -1 +1
M ./base/utils.scm -1 +1
M ./base/vector3.scm -1 +1
M ./doc/license.html -6 +6
M ./examples/example.c -1 +1
M ./examples/example.scm -1 +1
M ./src/cintegrator.c -2 +2
M ./src/ctl-f77-glue.c -1 +1
M ./src/ctl.c -1 +1
M ./src/ctl.h.in -1 +1
M ./src/integrator.c -2 +2
M ./utils/ctl-io.scm -1 +1
M ./utils/ctlgeom.h -1 +1
M ./utils/gen-ctl-io.1 -3 +35
M ./utils/geom.c -1 +1
M ./utils/geom.scm -1 +1
Wed Mar 22 02:36:10 EST 2006 stevenj@fftw.org
* support absolute tolerance in integration routines
M ./base/main.c -2 +2
M ./base/math-utils.scm -3 +9
M ./src/cintegrator.c -8 +10
M ./src/ctl.h.in -6 +8
M ./src/integrator.c -7 +9
M ./utils/geom.c -1 +1
Mon Feb 13 01:43:33 EST 2006 stevenj@fftw.org
* disable complex integration if C99 complex nums not available
M ./base/math-utils.scm -2 +5
M ./configure.ac +18
M ./src/cintegrator.c -2 +6
M ./src/ctl.h.in +7
Mon Feb 13 01:33:27 EST 2006 stevenj@fftw.org
* added complex-integrand integration (requires C99 complex numbers!)
M ./base/main.c -1 +3
M ./base/math-utils.scm -1 +1
M ./src/Makefile.am -1 +1
A ./src/cintegrator.c
M ./src/ctl.h.in +10
Mon Feb 13 01:17:08 EST 2006 stevenj@fftw.org
* whoops, fix in integrate-old
M ./base/math-utils.scm -2 +2
Tue Jan 24 17:00:20 EST 2006 stevenj@fftw.org
* use pkgdatadir for spec file
M ./examples/Makefile.am -4 +5
Mon Dec 5 17:37:14 EST 2005 stevenj@fftw.org
* fixes related to inversion-symmetry fixes in MPB
M ./utils/geom.c -8 +27
Thu Dec 1 19:39:41 EST 2005 stevenj@fftw.org
* whoops, fixed some mismatched new/free for C++
M ./utils/geom.c -5 +5
Wed Nov 9 12:46:01 EST 2005 stevenj@fftw.org
* whoops again
M ./utils/ctl-io.scm -2 +2
Wed Nov 9 12:36:34 EST 2005 stevenj@fftw.org
* whoops
M ./utils/ctl-io.scm -1 +1
Wed Nov 9 12:32:31 EST 2005 stevenj@fftw.org
* in ctl-io and geom.c, use malloc/free for C and new/delete for C++; also fix memory leak in SWIG output typemap
M ./utils/ctl-io.scm -21 +42
M ./utils/geom.c -16 +22
Tue Nov 8 22:16:05 EST 2005 stevenj@fftw.org
* made material_of_point_in_tree* backwards compatible, so that MPB 1.4.2 still works with libctl 3
M ./NEWS -7 +4
M ./utils/ctlgeom.h -2 +1
M ./utils/geom.c -2 +10
Tue Nov 8 18:50:19 EST 2005 stevenj@fftw.org
* fix for vpath builds
M ./examples/Makefile.am -2 +2
Mon Nov 7 22:07:07 EST 2005 stevenj@fftw.org
* added NEWS
M ./NEWS +55
Sat Nov 5 16:50:59 EST 2005 stevenj@fftw.org
* geometry_tree in_object functions no longer shift pt to unit cell, which produces unexpected results in Meep when we are only looking at the objects in a given chunk (it should also be unnecessary since the objects are already replicated periodically(?)); export shift_to_unit_cell function for when it is needed
M ./utils/ctlgeom.h +1
M ./utils/geom.c -22 +17
Wed Nov 2 13:45:23 EST 2005 stevenj@fftw.org
* (print) should call (flush-all-ports); otherwise C and Scheme I/O get out of sync (grrr)
M ./base/utils.scm -1 +4
Wed Oct 12 16:02:59 EDT 2005 stevenj@fftw.org
* added geom_cartesian_lattice function and call it from geom_initialize
M ./utils/ctlgeom.h +2
M ./utils/geom.c -3 +18
Mon Oct 10 17:08:19 EDT 2005 stevenj@fftw.org
* added strip-suffix function, and define "verbose?" corresponding to main.c variable
M ./base/include.scm +5
M ./base/main.c +7
Mon Oct 10 14:26:12 EDT 2005 stevenj@fftw.org
* minor fixes
M ./utils/ctl-io.scm -2 +6
M ./utils/geom.c -1 +1
Fri Oct 7 00:07:58 EDT 2005 stevenj@fftw.org
* another C++ whoops
M ./utils/geom.c -3 +3
Thu Oct 6 22:12:16 EDT 2005 stevenj@fftw.org
* sigh
M ./utils/ctlgeom.h -1
Thu Oct 6 21:40:43 EDT 2005 stevenj@fftw.org
* fix C++ omissions
M ./utils/ctlgeom.h -5 +5
Mon Aug 29 23:32:30 EDT 2005 stevenj@fftw.org
* backwards compatibility (gen-ctl-io w/o args == code + header)
M ./utils/gen-ctl-io.in -2 +4
Tue Jul 19 18:38:40 EDT 2005 stevenj@fftw.org
* for interpolate-uniform, don't do any interpolation if n=0
M ./base/math-utils.scm -11 +15
Tue Jul 19 18:35:48 EDT 2005 stevenj@fftw.org
* added "search next" in tree, and conversion to/from "object" coords
M ./utils/ctlgeom.h +5
M ./utils/geom.c -19 +112
Tue Jul 12 19:27:25 EDT 2005 stevenj@fftw.org
* added interpolate-uniform function
M ./base/math-utils.scm +21
Sat Jun 25 17:32:13 EDT 2005 stevenj@fftw.org
* missing fabs in error computation for 1d quadrature
M ./src/integrator.c -1 +1
Fri Jun 17 17:27:07 EDT 2005 stevenj@fftw.org
* add geom_initialize function to initialize all of the usual input variables to default values
M ./utils/ctlgeom.h +1
M ./utils/geom.c +12
Sat Jun 11 18:24:24 EDT 2005 stevenj@fftw.org
* added more test functions from gsl-1.6/monte/test.c
M ./src/integrator.c -9 +86
Fri Jun 10 18:45:45 EDT 2005 stevenj@fftw.org
* fmt
M ./src/integrator.c -3 +3
Fri Jun 10 18:44:48 EDT 2005 stevenj@fftw.org
* slight cleanup
M ./src/integrator.c -34 +25
Fri Jun 10 16:46:57 EDT 2005 stevenj@fftw.org
* remove C99-only constructs
M ./src/integrator.c -8 +9
Fri Jun 10 16:38:04 EDT 2005 stevenj@fftw.org
* tweak
M ./src/integrator.c -1 +1
Fri Jun 10 16:37:08 EDT 2005 stevenj@fftw.org
* tweak
M ./src/integrator.c -2 +1
Fri Jun 10 16:15:27 EDT 2005 stevenj@fftw.org
* rename width -> halfwidth for clarity
M ./src/integrator.c -13 +13
Fri Jun 10 12:20:03 EDT 2005 stevenj@fftw.org
* whitespace
M ./src/integrator.c -1
Fri Jun 10 12:11:53 EDT 2005 stevenj@fftw.org
* some error checking
M ./src/integrator.c +8
Thu Jun 9 23:42:52 EDT 2005 stevenj@fftw.org
* whoops, bug in integration for 0-dimensional
M ./src/integrator.c -2 +2
M ./utils/geom.c -4 +4
Thu Jun 9 22:43:10 EDT 2005 stevenj@fftw.org
* use adaptive integration in overlap calculation
M ./utils/ctlgeom.h -2 +3
M ./utils/geom.c -41 +93
M ./utils/geom.scm -1 +1
M ./utils/geomtst.c -2 +2
Thu Jun 9 21:39:57 EDT 2005 stevenj@fftw.org
* add adaptive multi-dimensional integration
M ./base/main.c +4
M ./base/math-utils.scm -1 +11
M ./src/Makefile.am -1 +1
M ./src/ctl.h.in -2 +12
A ./src/integrator.c
M ./src/subplex.c -2 +2
Mon Jun 6 22:39:20 EDT 2005 stevenj@fftw.org
* return precedence 0 for no object
M ./utils/geom.c -1 +3
Mon Jun 6 21:27:27 EDT 2005 stevenj@fftw.org
* store object precedence in geometry tree
M ./utils/ctlgeom.h -1 +3
M ./utils/geom.c -5 +11
Mon Jun 6 18:50:33 EDT 2005 stevenj@fftw.org
* silence warning
M ./utils/geom.c -2 +2
Mon Jun 6 18:42:57 EDT 2005 stevenj@fftw.org
* added routine to compute overlap fraction of box with object (for sub-pixel averaging) and test program
M ./utils/Makefile.am +4
M ./utils/ctlgeom.h +10
M ./utils/geom.c -1 +283
M ./utils/geom.scm +3
A ./utils/geomtst.c
Mon Jun 6 18:40:57 EDT 2005 stevenj@fftw.org
* ctl-io.[ch] depends on geom.scm
M ./examples/Makefile.am -2 +2
Mon Jun 6 17:52:19 EDT 2005 stevenj@fftw.org
* whoops, missing "break"
M ./utils/geom.c +1
Mon Jun 6 00:22:58 EDT 2005 stevenj@fftw.org
* fixes to normal vector routines for block and ellipsoid
M ./src/ctl.c +37
M ./src/ctl.h.in +5
M ./utils/geom.c -11 +9
Sun Jun 5 22:31:03 EDT 2005 stevenj@fftw.org
* in libgeom, set default values for input variables (geometry_lattice, etcetera)
M ./utils/Makefile.am -4 +7
A ./utils/geom-ctl-io-defaults.c
Fri Jun 3 16:19:07 EDT 2005 stevenj@fftw.org
* added missing decls for cnumber_equal/cvector3_equal/cmatrix3x3_equal
M ./src/ctl.h.in +3
Fri Jun 3 15:59:13 EDT 2005 stevenj@fftw.org
* another whoops
M ./utils/geom.c +1
Fri Jun 3 15:54:09 EDT 2005 stevenj@fftw.org
* whoops
M ./utils/geom.c -2 +2
Fri Jun 3 15:35:45 EDT 2005 stevenj@fftw.org
* new feature: compound-geometric-object types (finally, after many requests). Also set "nothing" as default material type for objects if (make material-type) works (i.e. all material-type properties have defaults)
M ./base/class.scm +4
M ./utils/ctl-io.scm -1 +5
M ./utils/ctlgeom.h -5 +6
M ./utils/geom.c -49 +173
M ./utils/geom.scm -2 +17
Fri Jun 3 02:46:36 EDT 2005 stevenj@fftw.org
* install libctlgeom library with generic material; BACKWARDS INCOMPATIBLE CHANGE: users must include their own ctl-io.h *before* ctlgeom.h, or they get ctlgeom-types.h instead
M ./configure.ac -1 +1
M ./examples/example.c -1 +1
M ./utils/Makefile.am -3 +21
M ./utils/ctlgeom.h -1 +17
M ./utils/geom.c +86
M ./utils/geom.scm -1 +2
Thu Jun 2 21:15:50 EDT 2005 stevenj@fftw.org
* require that gen-ctl-io output type be specified, only allow a single output file at a time, and allow a -o option to specify an alternate file name/location (for vpath builds, e.g.)
M ./doc/developer.html -2 +3
M ./examples/Makefile.am -2 +2
M ./utils/gen-ctl-io.in -50 +69
Thu Jun 2 20:49:33 EDT 2005 stevenj@fftw.org
* BACKWARDS INCOMPATIBLE: gen-ctl-io generates code *or* header with --code and --header ... generating them both at the same time made parallel 'make' invocations unreliable
M ./examples/Makefile.am -2 +5
M ./utils/gen-ctl-io.in -29 +56
Thu Jun 2 19:57:57 EDT 2005 stevenj@fftw.org
* whoops, various "object of point" routines should also return the amount by which the object needs to be shifted
M ./utils/ctlgeom.h -3 +5
M ./utils/geom.c -12 +28
Thu Jun 2 19:44:07 EDT 2005 stevenj@fftw.org
* add functions to get the object of a point, not just the material, and to get the analytical normal vector to an object
M ./utils/ctlgeom.h -1 +6
M ./utils/geom.c -9 +103
M ./utils/geom.scm +3
Thu Jun 2 19:41:51 EDT 2005 stevenj@fftw.org
* in unit_vector3, only return 0 when norm == 0, not merely when the norm is small (which is not necessarily a problem)
M ./src/ctl.c -1 +1
Thu Jun 2 19:41:27 EDT 2005 stevenj@fftw.org
* use -no-undefined in creating shared libraries
M ./src/Makefile.am -1 +1
Thu Jun 2 19:41:04 EDT 2005 stevenj@fftw.org
* set example program prompt to example> rather than guile>
M ./examples/example.scm +5
Wed Jun 1 19:52:35 EDT 2005 stevenj@fftw.org
* convert to use automake
./base/ctl-f77-glue.c -> ./src/ctl-f77-glue.c
./base/ctl.c -> ./src/ctl.c
./base/ctl.h.in -> ./src/ctl.h.in
./base/subplex.c -> ./src/subplex.c
M ./ChangeLog -1071 +1
A ./Makefile.am
R ./Makefile.in
A ./autogen.sh
R ./base/Makefile.in
R ./base/f77_func.h.in
M ./base/main.c -2 +45
M ./configure.ac -15 +18
A ./examples/Makefile.am
R ./examples/Makefile.in
A ./src/
A ./src/Makefile.am
M ./src/ctl-f77-glue.c -1 +1
A ./utils/Makefile.am
R ./utils/Makefile.in
Fri Jan 21 21:49:05 EST 2005 stevenj
* added one-sided 2nd derivative, for completeness
M ./base/math-utils.scm +25
Fri Jan 21 20:50:45 EST 2005 stevenj
* whoops, fixed one-sided derivative routine to achieve proper accuracy
M ./base/math-utils.scm -4 +4
Thu Jan 20 03:43:19 EST 2005 stevenj
* added one-sided numerical derivative
M ./base/math-utils.scm -6 +60
Sat Nov 27 22:50:26 EST 2004 stevenj
* remove dup. line
M ./doc/user-ref.html -1
Wed Oct 20 21:30:35 EDT 2004 stevenj
* fix in find-root-deriv to prevent infinite loop in some cases where root does not exist; thanks to XiuLun Yang for the bug report
M ./base/math-utils.scm +5
Thu Sep 30 15:46:10 EDT 2004 stevenj
* link reorg
M ./doc/guile-links.html -14 +14
Thu Sep 30 15:42:01 EDT 2004 stevenj
* updated links
M ./doc/guile-links.html -12 +31
Wed Aug 4 21:48:40 EDT 2004 stevenj
* const correctness
M ./base/ctl.c -13 +13
M ./base/ctl.h.in -13 +13
Wed Aug 4 21:33:26 EDT 2004 stevenj
* don't call indent in C++ mode, because some implementations (Tru64, grr) screw up C++ code (e.g. foo::bar -> foo: :bar)
M ./utils/gen-ctl-io.in -2 +4
Wed Aug 4 21:23:09 EDT 2004 stevenj
* whoops, missing type in decl
M ./base/ctl.h.in -1 +1
Wed Jul 7 19:40:42 EDT 2004 stevenj
* bug fix in make_hermitian_cmatrix3x3; thanks to Mischa Megens
M ./base/ctl.c -1 +1
Tue Jun 22 19:50:08 EDT 2004 stevenj
* whoops, forgot to escape $
M ./utils/gen-ctl-io.in -14 +14
Tue Jun 22 19:45:05 EDT 2004 stevenj
* whoops
M ./utils/gen-ctl-io.in -1 +3
Tue Jun 22 19:42:33 EDT 2004 stevenj
* add typemaps for basic types
M ./utils/gen-ctl-io.in +25
Tue Jun 22 19:22:28 EDT 2004 stevenj
* whoops
M ./utils/ctl-io.scm -1 +1
Tue Jun 22 19:20:56 EDT 2004 stevenj
* swig fixes
M ./utils/ctl-io.scm -34 +36
M ./utils/gen-ctl-io.in -19 +36
Tue Jun 22 18:52:41 EDT 2004 stevenj
* support SWIG typemap generation
M ./base/class.scm +4
M ./examples/example.scm +3
M ./utils/ctl-io.scm +33
M ./utils/gen-ctl-io.in -5 +12
Tue Mar 2 21:43:42 EST 2004 stevenj
* make list-transform-positive/negative tail recursive
M ./base/utils.scm -10 +8
Mon Feb 2 20:10:13 EST 2004 stevenj
* get-resolution
M ./utils/ctlgeom.h +1
M ./utils/geom.c +5
M ./utils/geom.scm -3 +5
Tue Jan 20 02:49:11 EST 2004 stevenj
* more efficient vector32scm, hopefully
M ./base/ctl.c -16 +23
M ./base/ctl.h.in +5
M ./configure.ac -1 +1
Sun Dec 14 20:05:17 EST 2003 stevenj
* tree0 takes geom_box boundaries
M ./utils/ctlgeom.h -1 +2
M ./utils/geom.c -6 +9
Sun Dec 14 19:24:56 EST 2003 stevenj
* generalized lattice-duplicates function
M ./utils/geom.scm -3 +11
Sun Dec 14 18:52:00 EST 2003 stevenj
* object-member? does more checks to prevent it from barfing on non-objects
M ./base/class.scm -1 +3
Sat Dec 13 01:16:58 EST 2003 stevenj
* whoops
M ./utils/geom.c +2
Sat Dec 13 01:16:34 EST 2003 stevenj
* improvement in restrict_box_tree
M ./utils/geom.c +13
Thu Dec 11 04:06:06 EST 2003 stevenj
* added geometry-center var
M ./utils/geom.c -2 +4
M ./utils/geom.scm +1
Thu Dec 11 03:04:17 EST 2003 stevenj
* add restrict_geom_box_tree
M ./utils/ctlgeom.h +1
M ./utils/geom.c +27
Tue Dec 9 05:22:28 EST 2003 stevenj
* remember include file
M ./base/include.scm -1 +5
Tue Dec 9 05:09:45 EST 2003 stevenj
* whoops
M ./utils/ctl-io.scm -2 +2
Tue Dec 9 05:08:48 EST 2003 stevenj
* C++ crap
M ./utils/ctl-io.scm -5 +8
M ./utils/geom.c -3 +3
Tue Dec 9 04:58:46 EST 2003 stevenj
* more C++ fixes
M ./base/ctl.h.in +2
M ./utils/ctl-io.scm -33 +45
M ./utils/gen-ctl-io.in -6 +10
Tue Dec 9 04:14:14 EST 2003 stevenj
* more C++ crap
M ./utils/geom.c -1 +5
Tue Dec 9 04:07:26 EST 2003 stevenj
* more C++ crap
M ./utils/geom.c -29 +34
Tue Dec 9 03:57:50 EST 2003 stevenj
* more compatibility crap
M ./base/main.c -1 +1
M ./utils/ctlgeom.h -13 +17
Tue Dec 9 03:50:37 EST 2003 stevenj
* more C++ namespace crap
M ./base/main.c -1 +5
M ./utils/ctlgeom.h -8 +14
M ./utils/gen-ctl-io.in +1
M ./utils/geom.c +4
Tue Dec 9 03:39:42 EST 2003 stevenj
* whoops
M ./utils/gen-ctl-io.in -2 +2
Tue Dec 9 03:37:31 EST 2003 stevenj
* support --cxx
M ./utils/gen-ctl-io.in -8 +36
Tue Dec 9 03:20:32 EST 2003 stevenj
* duh
M ./utils/gen-ctl-io.in -2 +2
Tue Dec 9 03:18:16 EST 2003 stevenj
* really fixed exit status
M ./utils/gen-ctl-io.in -4 +10
Tue Dec 9 03:10:22 EST 2003 stevenj
* fail if guile fails
M ./utils/gen-ctl-io.in -2 +2
Fri Jun 20 21:47:37 EDT 2003 stevenj
* whoops
M ./utils/geom.c -1 +1
Fri Jun 20 20:00:40 EDT 2003 stevenj
* added routines operating on supplied geometry rather than global
M ./utils/ctlgeom.h +8
M ./utils/geom.c -4 +25
Fri Jun 20 04:49:36 EDT 2003 stevenj
* bumped version
M ./configure.ac -1 +1
Fri Jun 20 04:41:05 EDT 2003 stevenj
* added object equal/copy functions to ctl-io
M ./base/class.scm +6
M ./base/ctl.c +29
M ./utils/ctl-io.scm +183
Fri Jun 20 01:28:53 EDT 2003 stevenj
* need to define pow2 (comes with mpb, but...)
M ./base/math-utils.scm +1
Sat Sep 14 23:22:30 EDT 2002 stevenj
* put my CPPFLAGS first, for precedence
M ./base/Makefile.in -1 +1
M ./examples/Makefile.in -1 +1
M ./utils/Makefile.in -1 +1
Fri Sep 13 03:26:10 EDT 2002 stevenj
tagged libctl-2-2
Fri Sep 13 03:26:10 EDT 2002 stevenj
* added release date
M ./NEWS -1 +1
Wed Sep 11 23:01:29 EDT 2002 stevenj
* reordering
M ./NEWS -2 +2
Wed Sep 11 23:01:12 EDT 2002 stevenj
* documented memoize
M ./doc/user-ref.html +8
Wed Sep 11 22:58:01 EDT 2002 stevenj
* added note
M ./NEWS +2
Wed Sep 11 20:03:58 EDT 2002 stevenj
* print command-line params
M ./base/main.c +1
Wed Sep 11 04:08:45 EDT 2002 stevenj
* added SICP online(!)
M ./doc/guile-links.html +4
Wed Sep 11 03:52:05 EDT 2002 stevenj
* documented find-root-deriv
M ./ChangeLog +6
M ./NEWS +3
M ./doc/user-ref.html +9
Fri Sep 6 23:01:40 EDT 2002 stevenj
* guile 1.6 is out
M ./NEWS -1 +1
Fri Sep 6 23:00:08 EDT 2002 stevenj
* updated
M ./ChangeLog +4
Sat Aug 17 23:15:44 EDT 2002 stevenj
* added glug
M ./doc/guile-links.html +3
Fri Aug 16 04:43:00 EDT 2002 stevenj
* updated
M ./ChangeLog -2 +26
M ./NEWS +2
Fri Aug 16 04:38:24 EDT 2002 stevenj
* fixes for guile 1.5.x
M ./base/ctl.c -2 +22
M ./base/ctl.h.in -11 +7
M ./base/extern-funcs.scm -3 +1
M ./configure.ac -3 +11
M ./utils/geom.c +2
Thu Aug 15 19:03:38 EDT 2002 stevenj
* slight compilation-warning fixes
M ./base/ctl.c +2
M ./base/main.c +1
Thu Jun 13 03:47:34 EDT 2002 stevenj
* make memoize work for functions with more than one argument
M ./base/utils.scm -2 +2
Thu Jun 13 03:29:25 EDT 2002 stevenj
* added find-root-deriv
M ./base/math-utils.scm +51
Thu Apr 18 01:20:48 EDT 2002 stevenj
* documented integration and deriv2 routines
M ./doc/user-ref.html -14 +35
Thu Apr 18 00:52:11 EDT 2002 stevenj
* updated
M ./ChangeLog +7
M ./NEWS -1 +12
M ./configure.ac -1 +1
Tue Apr 16 23:42:02 EDT 2002 stevenj
* define sub-version vars for version checks in cpp
M ./base/ctl.h.in +3
M ./configure.ac +12
Wed Apr 3 21:00:57 EST 2002 stevenj
* updated
M ./ChangeLog +31
Wed Apr 3 20:42:44 EST 2002 stevenj
* fixed cvector3 omissions; thanks to Doug Allan for the bug report
M ./base/class.scm -1 +1
M ./base/matrix3x3.scm +1
M ./base/vector3.scm +1
Sat Mar 23 22:43:25 EST 2002 stevenj
* added some comments
M ./base/math-utils.scm +14
Sat Mar 23 22:37:57 EST 2002 stevenj
* added simple trapezoidal-rule integration routines
M ./base/math-utils.scm -8 +43
Sat Mar 23 22:16:10 EST 2002 stevenj
* add binary=, binary+ should handle 0 + vector
M ./base/vector3.scm -1 +10
Sat Mar 23 21:42:00 EST 2002 stevenj
* added generic memoize function
M ./base/utils.scm +15
Sat Mar 23 20:10:23 EST 2002 stevenj
* support derivatives of vector fields, add deriv2
M ./base/math-utils.scm -8 +12
M ./base/vector3.scm -2 +4
Fri Mar 22 06:24:24 EST 2002 stevenj
* fixed incomplete SCM support
M ./NEWS +4
M ./base/ctl.c -1 +24
M ./base/ctl.h.in -1 +6
M ./configure.ac -1 +1
Thu Mar 21 05:57:38 EST 2002 stevenj
* whoops
M ./base/ctl-f77-glue.c +1
Thu Mar 21 05:53:03 EST 2002 stevenj
* fixed fortran wrappers to use autoconf, although these are still out of date
M ./base/ctl-f77-glue.c -61 +46
A ./base/f77_func.h.in
M ./configure.ac -1 +8
Thu Mar 21 05:24:04 EST 2002 stevenj
* updated
M ./ChangeLog +56
M ./NEWS +13
M ./configure.ac -1 +1
Thu Mar 21 04:12:49 EST 2002 stevenj
* bug fix in use of complex numbers as input variables and parameters
M ./base/ctl.c -1 +1
Thu Mar 21 03:14:31 EST 2002 stevenj
* added SCM type
M ./base/class.scm +2
M ./base/ctl.h.in +2
M ./doc/developer.html +2
Thu Mar 21 03:10:25 EST 2002 stevenj
* bumped version
M ./configure.ac -1 +1
Thu Mar 21 01:41:26 EST 2002 stevenj
* backward compatibility
M ./base/main.c -1 +4
Thu Mar 21 00:57:02 EST 2002 stevenj
* slight rearrangement
M ./base/main.c -3 +4
Thu Mar 21 00:56:33 EST 2002 stevenj
* added ctl_export_hook function to export additional Guile symbols
M ./base/main.c +7
Thu Mar 21 00:01:03 EST 2002 stevenj
* handle ! in identifier conversion
M ./utils/ctl-io.scm -1 +1
Wed Mar 13 23:47:03 EST 2002 stevenj
* use mandir
M ./utils/Makefile.in -2 +3
Mon Mar 11 01:14:04 EST 2002 stevenj
tagged libctl-2-0
Mon Mar 11 01:14:04 EST 2002 stevenj
* whoops
M ./base/ctl.c +1
Mon Mar 11 00:30:39 EST 2002 stevenj
* added date
M ./NEWS -1 +1
Sat Mar 9 20:08:39 EST 2002 stevenj
* added AUTHORS file to be GNU-ly correct
A ./AUTHORS
Fri Mar 8 19:29:49 EST 2002 stevenj
* guile 1.4 supports only magnitude, not abs, for complex numbers
M ./base/math-utils.scm -12 +12
M ./base/simplex.scm -4 +4
M ./base/vector3.scm -3 +3
M ./doc/user-ref.html -5 +5
Fri Mar 8 01:35:47 EST 2002 stevenj
* added fix_path for include-relative paths
M ./base/ctl.c +22
M ./base/ctl.h.in +1
M ./base/include.scm +5
Thu Mar 7 21:28:45 EST 2002 stevenj
* mentioned numerical derivatives
M ./NEWS +3
Thu Mar 7 21:04:42 EST 2002 stevenj
* 2002 copyright year update
M ./COPYRIGHT -1 +1
M ./base/class.scm -1 +1
M ./base/ctl-f77-glue.c -1 +1
M ./base/ctl.c -1 +1
M ./base/ctl.h.in -1 +1
M ./base/ctl.scm -1 +1
M ./base/extern-funcs.scm -1 +1
M ./base/help.scm -1 +1
M ./base/include.scm -1 +1
M ./base/interaction.scm -1 +1
M ./base/io-vars.scm -1 +1
M ./base/main.c -1 +1
M ./base/math-utils.scm -1 +1
M ./base/matrix3x3.scm -1 +1
M ./base/simplex.scm -1 +1
M ./base/utils.scm -1 +1
M ./base/vector3.scm -1 +1
M ./doc/license.html -1 +1
M ./examples/Makefile.in -1 +1
M ./examples/example.c -1 +1
M ./examples/example.scm -1 +1
M ./examples/run.ctl -1 +1
M ./utils/ctl-io.scm -1 +1
M ./utils/ctlgeom.h -1 +1
M ./utils/gen-ctl-io.1 -1 +1
M ./utils/gen-ctl-io.in -1 +1
M ./utils/geom.c -1 +1
M ./utils/geom.scm -1 +1
Thu Mar 7 21:02:53 EST 2002 stevenj
* updated, bumped version
M ./ChangeLog +91
M ./NEWS +24
M ./configure.ac -1 +1
Thu Mar 7 20:53:12 EST 2002 stevenj
* improved complex docs and functions
M ./base/matrix3x3.scm +3
M ./doc/user-ref.html -3 +30
Thu Mar 7 19:51:30 EST 2002 stevenj
* handle integers for cnumbers
M ./base/ctl.c -4 +4
M ./examples/example.scm -1 +1
Thu Mar 7 18:56:58 EST 2002 stevenj
* whoops, forgot to check in
M ./base/ctl.h.in +5
Thu Mar 7 18:55:36 EST 2002 stevenj
* whoops
M ./examples/example.c -2 +2
Thu Mar 7 18:37:49 EST 2002 stevenj
* added more complex utilities
M ./base/ctl.c -4 +57
M ./base/ctl.h.in -2 +9
Thu Mar 7 07:19:04 EST 2002 stevenj
* Get rid of unneeded make-default, and use consistent syntax for
Get rid of unneeded make-default, and use consistent syntax for
define-property and define-post-processed-property, compared to
define-input-var. NOT BACKWARD COMPATIBLE. Thanks to
Theis Peter Hansen for the suggestion.
M ./base/class.scm -9 +5
M ./doc/developer.html -21 +16
M ./examples/example.scm -2 +2
M ./utils/geom.scm -23 +16
Thu Mar 7 06:00:36 EST 2002 stevenj
* added complex number support
M ./base/class.scm -3 +8
M ./base/ctl.c +147
M ./base/ctl.h.in -6 +43
M ./base/matrix3x3.scm +2
M ./base/utils.scm +3
M ./base/vector3.scm -2 +6
M ./doc/developer.html -2 +8
M ./doc/user-ref.html -1 +15
M ./examples/example.c -1 +4
M ./examples/example.scm -1 +1
Thu Mar 7 05:28:21 EST 2002 stevenj
* make arith-sequence (and interpolate) tail recursive
M ./base/math-utils.scm -4 +6
Thu Mar 7 03:56:22 EST 2002 stevenj
* documented set-param!
M ./doc/user-ref.html +4
Thu Mar 7 03:53:38 EST 2002 stevenj
* fixed set-param\!
M ./base/io-vars.scm -2 +1
M ./base/main.c +16
Thu Mar 7 03:33:28 EST 2002 stevenj
* added set-param!
M ./base/io-vars.scm -1 +7
Thu Mar 7 03:05:23 EST 2002 stevenj
* fixed lattice-duplicates function for no-size; more generally, it rounds
fixed lattice-duplicates function for no-size; more generally, it rounds
the number of duplicates up to the next integer
M ./utils/geom.scm -7 +5
Thu Mar 7 02:35:03 EST 2002 stevenj
* handle no-size in reciprocal<->cartesian functions
M ./utils/geom.scm -2 +6
Fri Jan 18 22:43:05 EST 2002 stevenj
* include install-sh, etc, in snapshot
M ./Makefile.in +2
Fri Jan 18 22:36:22 EST 2002 stevenj
* configure.in -> configure.ac
M ./Makefile.in -2 +2
Fri Jan 18 22:25:17 EST 2002 stevenj
* updated version
M ./configure.ac -1 +1
Thu Jan 17 23:16:51 EST 2002 stevenj
* added get-grid-size-prod
M ./utils/geom.scm +3
Thu Jan 17 03:07:55 EST 2002 stevenj
* allow user to specify resolution instead of grid size
M ./utils/ctlgeom.h +3
M ./utils/geom.c +16
M ./utils/geom.scm +17
Tue Jan 8 20:43:46 EST 2002 stevenj
* slight cleanup
M ./base/math-utils.scm -6 +6
Sat Dec 15 19:28:58 EST 2001 stevenj
* documented numerical derivatives
M ./doc/user-ref.html +30
Sat Dec 15 19:24:26 EST 2001 stevenj
* use d2f rather than df2 to denote second derivative
M ./base/math-utils.scm -2 +2
Sat Dec 15 19:03:13 EST 2001 stevenj
* add comment on Neville tableau
M ./base/math-utils.scm +2
Sat Dec 15 18:50:59 EST 2001 stevenj
* tolerance should be fractional
M ./base/math-utils.scm -1 +1
Sat Dec 15 08:04:19 EST 2001 stevenj
* added numerical differentiation routines
M ./base/math-utils.scm +76
Thu Dec 13 01:25:28 EST 2001 stevenj
* call ctl_stop_hook even with --help, --version, etcetera.
M ./base/main.c -1 +2
Thu Nov 22 04:46:53 EST 2001 stevenj
* Documented object-property-value; thanks to Theis Peter Hansen for the
Documented object-property-value; thanks to Theis Peter Hansen for the
suggestion.
M ./doc/user-ref.html -1 +8
Tue Nov 20 19:20:12 EST 2001 stevenj
* autoconf file should not be in cvs
M ./Makefile.in +1
R ./install-sh
Thu Nov 15 23:29:28 EST 2001 stevenj
tagged libctl-1-5
Thu Nov 15 23:29:28 EST 2001 stevenj
* updated date
M ./NEWS -1 +1
Thu Oct 11 04:47:32 EDT 2001 stevenj
* don't need lattice-size derived property
M ./utils/geom.scm -5
Thu Oct 11 04:43:57 EDT 2001 stevenj
* bumped version
M ./configure.ac -1 +1
Thu Oct 11 04:43:27 EDT 2001 stevenj
* add config.guess/config.sub to make dist.
M ./Makefile.in +1
Thu Oct 11 04:39:00 EDT 2001 stevenj
* removed non-owned files
R ./config.guess
R ./config.sub
Thu Oct 11 04:37:27 EDT 2001 stevenj
* updated
M ./ChangeLog +36
M ./NEWS +8
Thu Oct 11 04:36:37 EDT 2001 stevenj
* document fold-right
M ./doc/user-ref.html +4
Thu Oct 11 04:26:39 EDT 2001 stevenj
* updated
M ./NEWS +2
Thu Oct 11 04:22:09 EDT 2001 stevenj
* slight cleanup
M ./utils/geom.scm -3 +3
Thu Oct 11 03:55:08 EDT 2001 stevenj
* added basis-size property to geometry-lattice
M ./NEWS +3
M ./base/class.scm -6 +5
M ./utils/geom.c -12 +14
M ./utils/geom.scm -7 +23
Thu Oct 4 20:06:39 EDT 2001 stevenj
* bumped version
M ./configure.ac -1 +1
Thu Jul 19 21:32:51 EDT 2001 stevenj
* make geometric-object-duplicates tail-recursive
M ./utils/geom.scm -7 +8
Wed Jul 18 21:21:42 EDT 2001 stevenj
* added sqr function
M ./base/utils.scm +2
Wed Jul 18 21:18:56 EDT 2001 stevenj
* whoops, got rid of old fold-right
M ./base/utils.scm -5
Wed Jul 18 21:08:45 EDT 2001 stevenj
* fold-right is now tail-recursive (by calling fold-left)
M ./base/utils.scm -2 +4
Wed Jul 18 21:06:29 EDT 2001 stevenj
* added, used, and documented tail-recursive fold-left
M ./base/utils.scm +13
M ./base/vector3.scm -1 +1
M ./doc/user-ref.html +11
M ./utils/ctl-io.scm -1 +1
M ./utils/geom.scm -1 +1
Tue Jul 10 18:07:21 EDT 2001 stevenj
* make sure guile program is in PATH
M ./configure.ac +5
Fri Jul 6 00:11:36 EDT 2001 stevenj
* updated
M ./ChangeLog -1 +16
M ./NEWS +4
Fri Jul 6 00:11:08 EDT 2001 stevenj
* fixed parentheses mismatch, improved quoting
M ./configure.ac -7 +7
Fri Jul 6 00:06:12 EDT 2001 stevenj
* support function lists
M ./base/ctl.c +8
M ./base/ctl.h.in +2
Fri Jul 6 00:04:04 EDT 2001 stevenj
* use autoconf 2.50
A ./configure.ac
R ./configure.in
Fri Feb 23 19:03:20 EST 2001 stevenj
tagged libctl-1-4
Fri Feb 23 19:03:20 EST 2001 stevenj
* bumped version, in preparation for release
M ./ChangeLog +10
M ./NEWS +2
M ./configure.in -1 +1
Thu Feb 22 17:00:48 EST 2001 stevenj
* fixed cppflags order
M ./configure.in -3 +9
Tue Feb 20 20:49:54 EST 2001 stevenj
* added minimize-multiple-expert fmin parameter, after a suggestion from Dale Fried
M ./ChangeLog +60
M ./NEWS +4
M ./base/ctl.h.in +2
M ./base/main.c -1 +1
M ./base/math-utils.scm -3 +5
M ./base/subplex.c -1 +14
M ./configure.in -1 +1
Sun Feb 4 05:40:40 EST 2001 stevenj
* added hook functions to help us use MPI (where we need to call MPI_Init and MPI_Finalize)
M ./base/ctl.h.in +13
M ./base/main.c +18
Sun Feb 4 05:14:21 EST 2001 stevenj
* cleanups, and made sure output is flushed
M ./base/interaction.scm -11 +5
Sun Feb 4 05:10:13 EST 2001 stevenj
* display-many -> print, added print-ok?
M ./NEWS +4
M ./base/extern-funcs.scm -2 +2
M ./base/help.scm -11 +11
M ./base/interaction.scm -11 +11
M ./base/math-utils.scm -1 +1
M ./base/simplex.scm -1 +1
M ./base/utils.scm -8 +18
M ./doc/user-ref.html -5 +8
M ./utils/ctl-io.scm -136 +136
Sun Jan 21 05:13:58 EST 2001 stevenj
* whoops, fixed prototype
M ./base/ctl.h.in -3 +3
Sun Jan 21 05:13:21 EST 2001 stevenj
* put ctl_get_list etc. back in because MPB configure script looks for it
M ./base/ctl.c +15
M ./base/ctl.h.in -3 +3
Sun Jan 21 04:36:36 EST 2001 stevenj
* whoops, fixed 'function support
M ./base/ctl.c +5
M ./base/ctl.h.in +1
Sun Jan 21 04:22:21 EST 2001 stevenj
* add support for 'function type
M ./NEWS +3
M ./base/class.scm +2
M ./base/ctl.c -10 +5
M ./base/ctl.h.in -2 +7
M ./doc/developer.html +2
Sun Jan 21 04:21:52 EST 2001 stevenj
* put class input & destruction headers in ctl-io.h so that they can be
put class input & destruction headers in ctl-io.h so that they can be
used elsewhere if desired
M ./utils/ctl-io.scm -4 +6
Sun Jan 21 04:15:44 EST 2001 stevenj
* added function-passing example
M ./examples/example.c +8
M ./examples/example.scm +3
Sun Jan 21 03:49:57 EST 2001 stevenj
* slight clarification in comment
M ./base/class.scm -1 +1
Sat Jan 20 23:51:50 EST 2001 stevenj
* another minor change
M ./doc/guile-links.html -2 +2
Sat Jan 20 23:51:22 EST 2001 stevenj
* minor change
M ./doc/guile-links.html -1 +1
Sat Jan 20 23:50:00 EST 2001 stevenj
* spelling correction
M ./doc/license.html -1 +1
Sat Jan 20 23:44:28 EST 2001 stevenj
* Fixed command-line parameter order (whoops).
M ./doc/advanced-user.html -1 +1
Sun Jan 7 19:48:37 EST 2001 stevenj
* updated links
M ./doc/guile-links.html -3 +5
Sun Jan 7 18:20:04 EST 2001 stevenj
tagged libctl-1-3
Sun Jan 7 18:20:04 EST 2001 stevenj
* 2001 copyright year update
M ./COPYRIGHT -1 +1
M ./base/class.scm -1 +1
M ./base/ctl-f77-glue.c -1 +1
M ./base/ctl.c -1 +1
M ./base/ctl.h.in -1 +1
M ./base/ctl.scm -1 +1
M ./base/extern-funcs.scm -1 +1
M ./base/help.scm -1 +1
M ./base/include.scm -1 +1
M ./base/interaction.scm -1 +1
M ./base/io-vars.scm -1 +1
M ./base/main.c -1 +1
M ./base/math-utils.scm -1 +1
M ./base/matrix3x3.scm -1 +1
M ./base/simplex.scm -1 +1
M ./base/utils.scm -1 +1
M ./base/vector3.scm -1 +1
M ./doc/license.html -1 +1
M ./examples/Makefile.in -1 +1
M ./examples/example.c -1 +1
M ./examples/example.scm -1 +1
M ./examples/run.ctl -1 +1
M ./utils/ctl-io.scm -1 +1
M ./utils/ctlgeom.h -1 +1
M ./utils/gen-ctl-io.1 -1 +1
M ./utils/gen-ctl-io.in -1 +1
M ./utils/geom.c -1 +1
M ./utils/geom.scm -1 +1
Sun Jan 7 17:57:08 EST 2001 stevenj
* bumped version for new release
M ./ChangeLog +24
M ./NEWS +8
M ./configure.in -1 +1
Tue Nov 21 16:28:02 EST 2000 stevenj
* documented vector3-{x,y,z}
M ./doc/user-ref.html +5
Mon Jul 17 05:48:33 EDT 2000 stevenj
* use new subplex algorithm in minimize/maximize multiple
M ./base/math-utils.scm +18
M ./base/subplex.c -4 +3
Thu Jul 13 21:40:36 EDT 2000 stevenj
* added subplex optimization algorithm
M ./base/Makefile.in -1 +1
M ./base/ctl.h.in +14
M ./base/main.c +3
A ./base/subplex.c
Mon Jul 10 03:29:15 EDT 2000 stevenj
* updated
M ./ChangeLog +44
M ./NEWS -1 +1
Tue May 2 01:14:09 EDT 2000 stevenj
* allow negative radiii in cylinders (for cones).
M ./utils/geom.c -1 +1
Tue May 2 00:25:33 EDT 2000 stevenj
* bug fix in displaying cone data
M ./utils/geom.c -1 +1
Tue May 2 00:13:40 EDT 2000 stevenj
* updated
M ./NEWS +4
Tue May 2 00:12:17 EDT 2000 stevenj
* added cone object type
M ./utils/geom.c -17 +36
M ./utils/geom.scm +3
Thu Apr 6 03:46:48 EDT 2000 stevenj
* bug fix in matrix3x3-inverse. Yikes!
M ./base/matrix3x3.scm -1 +1
Thu Mar 16 20:34:15 EST 2000 stevenj
* documented rotation functions
M ./doc/user-ref.html +14
Thu Mar 16 20:33:55 EST 2000 stevenj
* fixed typos
M ./NEWS -3 +2
Thu Mar 16 20:10:25 EST 2000 stevenj
* bumped version
A ./ChangeLog
M ./NEWS +15
M ./configure.in -1 +1
Thu Mar 16 19:49:00 EST 2000 stevenj
* declare prototype for external functions in ctl-io.h, to make sure
declare prototype for external functions in ctl-io.h, to make sure
programmer doesn't accidentally declare a mismatching prototype.
M ./utils/ctl-io.scm -2 +2
Thu Mar 16 19:41:57 EST 2000 stevenj
* Added support for list parameters and return values for external functions.
Added support for list parameters and return values for external functions.
(List parameters were nominally supported before, but there was a bug
where the corresponding list type was not guaranteed to be correctly declared.)
M ./examples/example.c +14
M ./examples/example.scm +3
M ./utils/ctl-io.scm -2 +12
Tue Feb 15 01:49:37 EST 2000 stevenj
* cartesian<->reciprocal functions should use units of 2 pi / a.
M ./utils/geom.scm -4 +2
Sat Feb 12 07:48:50 EST 2000 stevenj
* fixed bug in find-root for converging to negative roots
M ./base/math-utils.scm -1 +2
Thu Feb 10 18:15:10 EST 2000 stevenj
* Added lattice<->reciprocal conversion functions.
M ./utils/geom.scm +3
Fri Feb 4 02:16:14 EST 2000 stevenj
* Added routines for converting cartesian->reciprocal, etcetera, and for
Added routines for converting cartesian->reciprocal, etcetera, and for
rotating lattice and reciprocal vectors.
M ./utils/geom.scm +65
Wed Feb 2 05:29:20 EST 2000 stevenj
* include/install simplex.scm
M ./base/Makefile.in -1 +1
M ./base/ctl.scm +1
Wed Feb 2 03:38:24 EST 2000 stevenj
* use simplex method for multi-dim minimization
M ./base/math-utils.scm -2 +8
A ./base/simplex.scm
Wed Feb 2 03:38:04 EST 2000 stevenj
* added rotation functions
M ./base/matrix3x3.scm +9
M ./base/vector3.scm +19
Sat Jan 29 02:58:05 EST 2000 stevenj
tagged libctl-1-1-1
Sat Jan 29 02:58:05 EST 2000 stevenj
* bumped version number
M ./NEWS +10
M ./configure.in -1 +1
Thu Jan 27 01:34:30 EST 2000 stevenj
* set SHELL
M ./base/Makefile.in +2
M ./examples/Makefile.in +2
M ./utils/Makefile.in +2
Thu Jan 27 01:09:55 EST 2000 stevenj
* slight refinement to box division criterion
M ./utils/geom.c -2 +6
Fri Jan 14 21:29:51 EST 2000 stevenj
* INCLUDES -> CPPFLAGS
M ./base/Makefile.in -2 +2
M ./configure.in -10 +3
M ./examples/Makefile.in -3 +3
M ./utils/Makefile.in -2 +2
Thu Jan 13 17:53:38 EST 2000 stevenj
* use configure to find indent program
M ./configure.in +3
M ./utils/gen-ctl-io.in -2 +2
Wed Jan 12 02:01:57 EST 2000 stevenj
* Added dependency rule to ensure ctl-io.h is created before main.o is
Added dependency rule to ensure ctl-io.h is created before main.o is
built. Thanks to Christoph Becher for the bug report.
M ./examples/Makefile.in +2
Wed Jan 12 01:41:50 EST 2000 stevenj
* need to set SHELL for non-GNU make
M ./Makefile.in +2
Sun Jan 2 17:59:13 EST 2000 stevenj
tagged libctl-1-1
Sun Jan 2 17:59:13 EST 2000 stevenj
* added gen-ctl-io man page
M ./NEWS +3
M ./utils/Makefile.in +2
A ./utils/gen-ctl-io.1
Sun Jan 2 16:31:17 EST 2000 stevenj
* bumped version
M ./COPYRIGHT -1 +1
M ./NEWS +7
M ./base/class.scm -1 +1
M ./base/ctl-f77-glue.c -1 +1
M ./base/ctl.c -1 +1
M ./base/ctl.h.in -1 +1
M ./base/ctl.scm -1 +1
M ./base/extern-funcs.scm -1 +1
M ./base/help.scm -1 +1
M ./base/include.scm -1 +1
M ./base/interaction.scm -1 +1
M ./base/io-vars.scm -1 +1
M ./base/main.c -1 +1
M ./base/math-utils.scm -1 +1
M ./base/matrix3x3.scm -1 +1
M ./base/utils.scm -1 +1
M ./base/vector3.scm -1 +1
M ./configure.in -1 +1
M ./doc/license.html -1 +1
M ./examples/Makefile.in -1 +1
M ./examples/example.c -1 +1
M ./examples/example.scm -1 +1
M ./examples/run.ctl -1 +1
M ./utils/ctl-io.scm -1 +1
M ./utils/ctlgeom.h -1 +1
M ./utils/gen-ctl-io.in -1 +1
M ./utils/geom.c -1 +1
M ./utils/geom.scm -1 +1
Sat Dec 11 16:57:25 EST 1999 stevenj
* fixed typo (thanks to Jim Van Zandt for noticing).
M ./doc/developer.html -1 +1
Tue Dec 7 02:39:01 EST 1999 stevenj
* added vector3-{xyz}
M ./base/vector3.scm +4
Mon Dec 6 23:29:32 EST 1999 stevenj
* sphere/cylinder radii/height now need only be non-negative, not positive.
M ./utils/geom.scm -3 +5
Thu Dec 2 05:22:57 EST 1999 stevenj
* check malloc return value
M ./base/main.c -1 +6
Thu Dec 2 04:31:09 EST 1999 stevenj
* don't complain when allocating tree for 0 geometric objects
M ./utils/geom.c -1 +1
Mon Nov 29 21:48:28 EST 1999 stevenj
* fixed trailing spaces in sed command; thanks to Ron Chase for the bug report
M ./examples/Makefile.in -1 +2
Fri Nov 26 21:21:03 EST 1999 stevenj
* fixed typo
M ./doc/introduction.html -1 +1
Thu Nov 25 21:02:48 EST 1999 stevenj
* MPB_VERSION -> LIBCTL_VERSION
M ./Makefile.in -1 +1
Thu Nov 25 05:55:49 EST 1999 stevenj
* added 'make snapshot'
M ./Makefile.in +11
Thu Nov 25 04:50:54 EST 1999 stevenj
* whoops, fixed typo
M ./utils/ctlgeom.h -1 +1
Thu Nov 25 04:35:49 EST 1999 stevenj
* added inobject variants
M ./utils/ctlgeom.h +2
M ./utils/geom.c -5 +27
Mon Nov 22 06:41:13 EST 1999 stevenj
* added online book on Scheme(!)
M ./doc/guile-links.html +8
Mon Nov 22 06:33:04 EST 1999 stevenj
* noted that guile-links section has scheme links too
M ./doc/index.html -1 +1
Mon Nov 22 05:14:01 EST 1999 stevenj
tagged libctl-1-0-1
Mon Nov 22 05:14:01 EST 1999 stevenj
* bumped version
M ./configure.in -1 +1
Mon Nov 22 05:13:41 EST 1999 stevenj
* noted 1.0.1 release (impending)
M ./NEWS +2
Sun Nov 21 00:15:06 EST 1999 stevenj
* noted changes
M ./NEWS +5
Sun Nov 21 00:11:45 EST 1999 stevenj
* don't ignore ensure_periodicity
M ./utils/geom.c -13 +25
Sat Nov 20 09:35:03 EST 1999 stevenj
* fixed bug in lattice duplicates function for non-orthogonal lattices
M ./utils/geom.scm -6 +4
Fri Nov 19 03:26:51 EST 1999 stevenj
tagged libctl-1-0
Fri Nov 19 03:26:51 EST 1999 stevenj
* take unit cell size as optional extra parameter to lattice-dup function
M ./utils/geom.scm -13 +19
Fri Nov 19 02:55:14 EST 1999 stevenj
* removed beta from version number
M ./configure.in -1 +1
Fri Nov 19 01:17:24 EST 1999 stevenj
* added NEWS file
A ./NEWS
Thu Nov 18 19:13:35 EST 1999 stevenj
* added vector3= and vector3-close?
M ./base/vector3.scm +6
M ./doc/user-ref.html +10
Thu Nov 18 05:31:26 EST 1999 stevenj
* moved things around so that clean targets are together.
M ./Makefile.in -3 +3
Thu Nov 18 05:30:11 EST 1999 stevenj
* Added 'make dist' target.
M ./Makefile.in +10
M ./configure.in -1 +3
Thu Nov 18 04:41:25 EST 1999 stevenj
* added libctl version string
M ./base/ctl.h.in +3
M ./base/main.c -1 +6
M ./configure.in +2
Wed Nov 17 22:33:29 EST 1999 stevenj
* use define-param for interactive?
M ./base/ctl.scm -1 +1
Wed Nov 17 22:31:53 EST 1999 stevenj
* used define-param for input vars
M ./base/io-vars.scm -1 +1
M ./doc/advanced-user.html -1 +4
Wed Nov 17 21:57:27 EST 1999 stevenj
* interactive -> interactive?
M ./base/ctl.scm -1 +1
M ./base/main.c -2 +2
M ./doc/advanced-user.html -1 +1
M ./examples/example.scm -1 +1
M ./examples/run.ctl -1 +1
Mon Nov 15 03:12:47 EST 1999 stevenj
* updated URLs
M ./doc/guile-links.html -2 +1
Sun Nov 14 04:08:10 EST 1999 stevenj
* Library -> Lesser everywhere.
M ./COPYING -89 +111
M ./COPYRIGHT -3 +3
M ./README -2 +2
M ./base/class.scm -3 +3
M ./base/ctl-f77-glue.c -3 +3
M ./base/ctl.c -3 +3
M ./base/ctl.h.in -3 +3
M ./base/ctl.scm -3 +3
M ./base/extern-funcs.scm -3 +3
M ./base/help.scm -3 +3
M ./base/include.scm -3 +3
M ./base/interaction.scm -3 +3
M ./base/io-vars.scm -3 +3
M ./base/main.c -1 +1
M ./base/math-utils.scm -3 +3
M ./base/matrix3x3.scm -3 +3
M ./base/utils.scm -3 +3
M ./base/vector3.scm -3 +3
M ./examples/Makefile.in -1 +1
M ./examples/example.c -3 +3
M ./examples/example.scm -1 +1
M ./examples/run.ctl -1 +1
M ./utils/ctl-io.scm -3 +3
M ./utils/ctlgeom.h -3 +3
M ./utils/gen-ctl-io.in -3 +3
M ./utils/geom.c -3 +3
M ./utils/geom.scm -3 +3
Sun Nov 14 04:04:32 EST 1999 stevenj
* Updated copyright year. GNU Library General Public License -> GNU
Updated copyright year. GNU Library General Public License -> GNU
Lesser General Public License, at least in license.html.
M ./COPYRIGHT -1 +1
M ./base/class.scm -1 +1
M ./base/ctl-f77-glue.c -1 +1
M ./base/ctl.c -1 +1
M ./base/ctl.h.in -1 +1
M ./base/ctl.scm -1 +1
M ./base/extern-funcs.scm -1 +1
M ./base/help.scm -1 +1
M ./base/include.scm -1 +1
M ./base/interaction.scm -1 +1
M ./base/io-vars.scm -1 +1
M ./base/main.c -1 +1
M ./base/math-utils.scm -1 +1
M ./base/matrix3x3.scm -1 +1
M ./base/utils.scm -1 +1
M ./base/vector3.scm -1 +1
M ./doc/index.html -2 +2
M ./doc/license.html -5 +5
M ./examples/Makefile.in -1 +1
M ./examples/example.c -1 +1
M ./examples/example.scm -1 +1
M ./examples/run.ctl -1 +1
M ./utils/ctl-io.scm -1 +1
M ./utils/ctlgeom.h -1 +1
M ./utils/gen-ctl-io.in -1 +1
M ./utils/geom.c -1 +1
M ./utils/geom.scm -1 +1
Sun Nov 14 03:54:44 EST 1999 stevenj
* added missing tags
M ./doc/index.html -9 +9
Fri Nov 12 23:36:25 EST 1999 stevenj
* removed extraneous
M ./doc/developer.html -1 +1
Fri Nov 12 23:36:05 EST 1999 stevenj
* added missing
M ./doc/developer.html -1 +1
Fri Nov 12 20:46:07 EST 1999 stevenj
* Added (begin-time ...) macro, and documented display-many.
M ./base/utils.scm +26
M ./doc/user-ref.html +16
Mon Oct 25 23:01:29 EDT 1999 stevenj
* Flush output files/ports when calling external functions, to keep Guile
Flush output files/ports when calling external functions, to keep Guile
and C output in sync (ugh).
M ./base/ctl.h.in +3
M ./configure.in +6
M ./utils/ctl-io.scm +4
M ./utils/gen-ctl-io.in +1
Mon Oct 25 22:56:15 EDT 1999 stevenj
* Got rid of (newline) in most places (just use "\n").
M ./utils/ctl-io.scm -135 +110
Mon Oct 25 19:24:55 EDT 1999 stevenj
* Bug fix (mis-copied algebra).
M ./utils/geom.c -7 +7
Thu Oct 21 23:02:02 EDT 1999 stevenj
* Bug fix.
M ./examples/example.c +7
M ./utils/geom.c -2 +2
Thu Oct 21 22:36:05 EDT 1999 stevenj
* Added geom_box_tree_stats.
M ./examples/example.c -1 +5
M ./utils/ctlgeom.h +1
M ./utils/geom.c +24
Thu Oct 21 22:29:22 EDT 1999 stevenj
* Get rid of warnings...
M ./utils/geom.c -1 +3
Thu Oct 21 22:18:01 EDT 1999 stevenj
* Bugfix in geom: some "unit" vectors need to be rescaled if lattice
Bugfix in geom: some "unit" vectors need to be rescaled if lattice
vectors are not perpendicular. Also added trees of object bounding
boxes for log-time searches.
M ./examples/example.c +7
M ./examples/run.ctl -16 +14
M ./utils/ctlgeom.h -7 +26
M ./utils/geom.c -109 +644
Thu Oct 14 00:10:48 EDT 1999 stevenj
* Fixed bug when gcc and/or Guile are installed in non-standard directories.
M ./configure.in -5 +11
Mon Oct 4 22:27:10 EDT 1999 stevenj
* Add --enable-debug option that uses -g (only) and #defines DEBUG.
M ./configure.in +6
Mon Oct 4 22:08:47 EDT 1999 stevenj
* No space between -I and directory.
M ./configure.in -1 +1
Sat Sep 18 02:35:59 EDT 1999 stevenj
* Interleaving Guile (display ...) with printf is unreliable.
M ./base/main.c -3 +4
Sat Sep 18 02:22:48 EDT 1999 stevenj
* "Unofficial" home page is now superceded by official page.
M ./doc/guile-links.html -5 +2
Thu Sep 16 21:52:33 EDT 1999 stevenj
* ctlgeom.h is in system include directory.
M ./utils/geom.c -1 +1
Wed Sep 15 16:35:27 EDT 1999 stevenj
* Alpha linker doesn't like space between -L and directory.
M ./configure.in -1 +1
Tue Sep 14 23:42:18 EDT 1999 stevenj
* Yikes!!! loop to destroy list items went for i <= num_items, instead of example.scm (renamed in Repository).
M ./examples/Makefile.in -1 +1
M ./examples/README -1 +1
M ./examples/example.c -3 +3
M ./examples/run.ctl -1 +1
Fri Sep 10 20:40:51 EDT 1999 stevenj
* Hackery to allow both installation of program executables, and also
Hackery to allow both installation of program executables, and also
uninstalled execution. Also handle a couple of command-line options,
like --version and --verbose.
M ./base/main.c -13 +63
M ./doc/developer.html +8
M ./examples/Makefile.in -9 +38
Fri Sep 10 05:03:05 EDT 1999 stevenj
* Removed redundant script.
R ./install.sh
Fri Sep 10 04:56:51 EDT 1999 stevenj
* Fail if Guile is not found. Added check for GH_LOOKUP_OK.
M ./configure.in -1 +32
Fri Sep 10 04:43:31 EDT 1999 stevenj
* Whoops, install main.c.
M ./base/Makefile.in +1
Fri Sep 10 04:40:39 EDT 1999 stevenj
* Added missing semicolon.
M ./base/Makefile.in -1 +1
Fri Sep 10 04:39:11 EDT 1999 stevenj
* Make sure that ctl-io.* are generated first.
M ./examples/Makefile.in -1 +1
Fri Sep 10 04:36:04 EDT 1999 stevenj
* Documented new installation/developer procedure.
M ./README -5 +10
M ./doc/developer.html -13 +19
Fri Sep 10 04:28:18 EDT 1999 stevenj
* Updated from latest libtool.
M ./config.guess -69 +366
M ./config.sub -280 +92
Fri Sep 10 04:25:17 EDT 1999 stevenj
* Added top-level Makefile.
A ./Makefile.in
Fri Sep 10 04:23:18 EDT 1999 stevenj
* The Great Move. Set up everything so that we can install in a
The Great Move. Set up everything so that we can install in a
central location.
A ./base/Makefile.in
R ./base/ctl-config.h.in
R ./base/ctl.h
A ./base/ctl.h.in
M ./configure.in -15 +50
M ./examples/Makefile.in -44 +53
M ./examples/example.scm -1 +1
A ./install-sh
A ./utils/Makefile.in
M ./utils/README -3 +4
R ./utils/gen-ctl-io
A ./utils/gen-ctl-io.in
M ./utils/geom.c -1 +1
Fri Sep 10 02:15:25 EDT 1999 stevenj
* libgeom used to be in its own directory (libgeom/) with its own README;
libgeom used to be in its own directory (libgeom/) with its own README;
now, this is merged with utils.
M ./utils/README -3 +7
Wed Sep 8 23:07:29 EDT 1999 stevenj
* Wrote native C matrix inverse routine.
M ./base/ctl.c -2 +29
M ./base/ctl.h +1
Tue Sep 7 04:45:55 EDT 1999 stevenj
* Yikes, bug fix!
M ./utils/geom.c +2
Sun Sep 5 17:31:04 EDT 1999 stevenj
* Added typedef for "string" to char*.
M ./base/ctl.h +1
Sun Sep 5 00:14:56 EDT 1999 stevenj
* Added matrix3x3_transpose function.
M ./base/ctl.c +16
M ./base/ctl.h +1
Sat Sep 4 22:42:50 EDT 1999 stevenj
* Parenthesized to get rid of gcc -Wall warning.
M ./utils/geom.c -2 +2
Sat Sep 4 00:29:51 EDT 1999 stevenj
* Added geometric-objects-lattice-duplicates function.
M ./utils/geom.scm +15
Wed Sep 1 23:18:21 EDT 1999 stevenj
* Linked to R4RS reference.
M ./doc/guile-links.html +5
Wed Sep 1 23:18:04 EDT 1999 stevenj
* Added display_geometric_object_info to libgeom.
M ./utils/ctlgeom.h +1
M ./utils/geom.c +66
M ./utils/geom.scm +3
Wed Sep 1 21:48:05 EDT 1999 stevenj
* Added point-in-periodic-object? function.
M ./utils/ctlgeom.h +1
M ./utils/geom.c -47 +59
M ./utils/geom.scm +3
Wed Sep 1 00:46:07 EDT 1999 stevenj
* fixed bug in find-root that occurred if you accidentally guess exactly
fixed bug in find-root that occurred if you accidentally guess exactly
the root.
M ./base/math-utils.scm -11 +14
Mon Aug 30 19:15:44 EDT 1999 stevenj
* Fixed typo.
M ./doc/basic-user.html -1 +1
Mon Aug 30 16:06:08 EDT 1999 stevenj
* Give later items in the geometry list precedence over earlier items.
M ./utils/geom.c -1 +2
Mon Aug 30 05:28:21 EDT 1999 stevenj
* More bugfixes in libgeom. Turned ensure_periodicity on by default.
M ./utils/geom.c -10 +9
M ./utils/geom.scm -1 +1
Mon Aug 30 04:30:14 EDT 1999 stevenj
* Moved main.c to src/ directory, and have 'make' copy it into program dir.
A ./base/main.c
M ./examples/Makefile.in -2 +6
R ./examples/main.c
Mon Aug 30 04:21:11 EDT 1999 stevenj
* Eliminated grid_size from libgeom.
M ./utils/geom.scm -5
Mon Aug 30 04:15:33 EDT 1999 stevenj
* Use LDFLAGS.
M ./examples/Makefile.in -1 +1
Mon Aug 30 04:10:26 EDT 1999 stevenj
* config.h -> ctl-config.h, since it has to get included in other projects
config.h -> ctl-config.h, since it has to get included in other projects
that may have their own config.h file.
R ./base/config.h.in
A ./base/ctl-config.h.in
M ./base/ctl.h -1 +1
M ./configure.in -1 +1
M ./examples/Makefile.in -2 +2
Mon Aug 30 02:28:56 EDT 1999 stevenj
* really fixed material_of_point this time, I hope.
M ./utils/geom.c -23 +12
Mon Aug 30 01:08:48 EDT 1999 stevenj
* $(PWD) -> `pwd`
M ./examples/Makefile.in -5 +7
Mon Aug 30 00:53:57 EDT 1999 stevenj
* Use "interactive" boolean variable to determine whether interactive mode
Use "interactive" boolean variable to determine whether interactive mode
is entered.
M ./base/ctl.scm +2
M ./doc/advanced-user.html +7
M ./examples/example.c -1 +1
M ./examples/example.scm -1 +5
M ./examples/main.c -3 +7
Mon Aug 30 00:46:29 EDT 1999 stevenj
* bug fix.
M ./utils/geom.c -10 +15
Fri Aug 27 21:04:29 EDT 1999 stevenj
* Fixed Guile 1.3 problems (gh_lookup is broken, and the set! code
Fixed Guile 1.3 problems (gh_lookup is broken, and the set! code
didn't work either...both problems due to the @%#$ module system).
M ./base/ctl.c -4 +40
M ./base/ctl.h -1 +5
Fri Aug 27 21:03:15 EDT 1999 stevenj
* Fixed typo.
M ./examples/main.c -1 +1
Fri Aug 27 18:05:44 EDT 1999 stevenj
* configure script (which is automatically generated from configure.in by
configure script (which is automatically generated from configure.in by
autoconf) should not be in the repository.
R ./configure
Thu Jun 4 03:40:48 EDT 1998 stevenj
* Added config.h to dependencies.
M ./examples/Makefile.in -1 +1
Tue Jun 2 02:14:29 EDT 1998 stevenj
* Added user-interaction utilities.
M ./base/ctl.scm +1
A ./base/interaction.scm
M ./base/utils.scm +42
Thu May 28 21:33:25 EDT 1998 tairan
* Added quotes around directory names (caused problems on Tairan's machine).
M ./utils/gen-ctl-io -2 +2
Thu May 28 06:44:47 EDT 1998 stevenj
* Noted configure script.
M ./README +4
Thu May 28 06:43:41 EDT 1998 stevenj
* Added configure script. Not strictly necessary, since this is generated
Added configure script. Not strictly necessary, since this is generated
from configure.in by autoconf, but this allows group member to simply
check out the source code without running autoconf.
A ./configure
Thu May 28 06:11:14 EDT 1998 stevenj
* Updated to use autoconf.
A ./base/config.h.in
M ./base/ctl.c -5 +9
M ./base/ctl.h -2 +4
A ./config.guess
A ./config.sub
A ./configure.in
R ./examples/Makefile
A ./examples/Makefile.in
A ./install.sh
Wed May 20 23:30:11 EDT 1998 stevenj
* Minor fixes.
M ./doc/advanced-user.html -2 +2
M ./doc/basic-user.html -2 +2
Wed May 20 23:15:51 EDT 1998 stevenj
* Made use of post-processing in example more explicit.
M ./doc/developer.html -7 +7
Wed May 20 23:13:43 EDT 1998 stevenj
* Fixed typo.
M ./doc/developer.html -1 +1
Wed May 20 23:11:21 EDT 1998 stevenj
* Fixed overloaded name.
M ./doc/user-ref.html -1 +1
Wed May 20 23:06:35 EDT 1998 stevenj
* Fixed font.
M ./doc/advanced-user.html -1 +2
Wed May 20 23:00:35 EDT 1998 stevenj
* Added command-line parameters.
M ./base/io-vars.scm +8
M ./doc/advanced-user.html +24
M ./doc/user-ref.html +14
M ./examples/main.c -2 +19
M ./examples/run.ctl -1 +5
Wed May 20 02:29:53 EDT 1998 stevenj
* Small fixes.
M ./base/ctl.c -1 +1
M ./base/ctl.h +1
M ./examples/Makefile -1 +2
Wed May 20 01:36:13 EDT 1998 stevenj
* Noted libgeom.
M ./README +4
Wed May 20 01:34:29 EDT 1998 stevenj
* Noted use of libgeom.
M ./examples/README -1 +2
Wed May 20 01:27:30 EDT 1998 stevenj
* Added include mechanism for splitting Scheme source files. Added libgeom.
A ./base/class.scm
M ./base/ctl.c +62
M ./base/ctl.h -4 +12
M ./base/ctl.scm -868 +11
A ./base/extern-funcs.scm
A ./base/help.scm
A ./base/include.scm
A ./base/io-vars.scm
A ./base/math-utils.scm
A ./base/matrix3x3.scm
A ./base/utils.scm
A ./base/vector3.scm
M ./examples/Makefile -5 +13
M ./examples/example.c -2 +2
M ./examples/example.scm -56 +4
M ./examples/main.c -8 +9
A ./utils/README
M ./utils/ctl-io.scm -4 +5
A ./utils/ctlgeom.h
M ./utils/gen-ctl-io -5 +5
A ./utils/geom.c
A ./utils/geom.scm
Tue May 19 06:46:46 EDT 1998 stevenj
* Updated README.
M ./README -13 +14
Tue May 19 03:36:33 EDT 1998 stevenj
* Don't display derived properties in help.
M ./base/ctl.scm -8 +11
Tue May 19 03:29:09 EDT 1998 stevenj
* Various bug fixes.
M ./doc/user-ref.html -21 +21
Tue May 19 03:17:11 EDT 1998 stevenj
* Noted user reference section.
M ./doc/index.html +5
Tue May 19 03:15:15 EDT 1998 stevenj
* Added user reference section.
M ./doc/advanced-user.html -3 +3
M ./doc/developer.html -3 +3
A ./doc/user-ref.html
Tue May 19 02:05:56 EDT 1998 stevenj
* Added routines for maximization, minimization, and root-finding. I really
Added routines for maximization, minimization, and root-finding. I really
have to figure out how to divide ctl.scm into multiple files.
M ./base/ctl.scm -1 +253
Sun May 17 08:56:35 EDT 1998 stevenj
* Removed extraneous backslash.
M ./examples/Makefile -1 +1
Sun May 17 06:31:29 EDT 1998 stevenj
* Fixed call to gh_scm2newstr.
M ./base/ctl.h -1 +1
Sun May 17 05:10:50 EDT 1998 stevenj
* Documented derived and post-processed properties.
M ./doc/developer.html +69
Sun May 17 04:13:18 EDT 1998 stevenj
* Documented export-function mechanism.
M ./doc/developer.html -79 +126
Sun May 17 01:26:35 EDT 1998 stevenj
* New mechanism for exporting subroutines. (run) is no longer special.
M ./base/ctl.c -37 +40
M ./base/ctl.h +32
M ./base/ctl.scm -6 +54
M ./examples/example.c -46 +72
M ./examples/example.scm +8
M ./examples/main.c -50 +19
M ./utils/ctl-io.scm -5 +162
Sat May 16 08:29:33 EDT 1998 stevenj
* Added derived and post-processed properties.
M ./base/ctl.scm -24 +78
M ./examples/example.c -2 +17
M ./examples/example.scm -5 +16
M ./examples/run.ctl -2 +4
Sat May 16 07:02:32 EDT 1998 stevenj
* Noted matrix3x3 type.
M ./doc/developer.html +2
Sat May 16 07:00:11 EDT 1998 stevenj
* Added matrix3x3 type.
M ./base/ctl.c -3 +53
M ./base/ctl.h -1 +13
M ./base/ctl.scm +98
Fri May 15 21:07:56 EDT 1998 stevenj
* Went back to Guile 1.2 for now.
M ./examples/Makefile -2 +1
Fri May 15 06:27:59 EDT 1998 stevenj
* Upgraded for Guile 1.3.
M ./examples/Makefile -2 +3
M ./examples/main.c -3 +7
Mon May 11 06:02:13 EDT 1998 stevenj
* Called check-vars before input variables are imported to C.
M ./base/ctl.scm -1 +1
Mon May 11 06:01:58 EDT 1998 stevenj
* Wrote developer documentation.
M ./doc/basic-user.html -2 +7
M ./doc/developer.html +270
Mon May 11 04:23:53 EDT 1998 stevenj
* make-list-type-name -> make-list-type
M ./base/ctl.scm -1 +1
M ./examples/example.scm -3 +3
Mon May 11 02:12:18 EDT 1998 stevenj
* Defined macros for creating classes, properties, and variables, considerably
Defined macros for creating classes, properties, and variables, considerably
simplifying the specification file. Also fixed check-vars.
M ./base/ctl.scm -16 +52
M ./examples/example.scm -56 +23
Sun May 10 19:14:30 EDT 1998 stevenj
* Some minor functionality improvements.
M ./base/ctl.scm -3 +12
Sun May 10 19:14:18 EDT 1998 stevenj
* Added duplicate-object functions.
M ./examples/example.scm +25
M ./examples/run.ctl -1 +13
Sun May 10 07:21:55 EDT 1998 stevenj
* Added documentation.
A ./doc/
A ./doc/advanced-user.html
A ./doc/basic-user.html
A ./doc/developer.html
A ./doc/guile-links.html
A ./doc/index.html
A ./doc/introduction.html
A ./doc/license.html
Sun May 10 02:17:05 EDT 1998 stevenj
* make clean removes executable and core files.
M ./examples/Makefile -2 +2
Sun May 10 02:11:14 EDT 1998 stevenj
* Specified location of ctl.scm and specification file at compile time.
M ./examples/Makefile -1 +17
M ./examples/README -1 +1
M ./examples/main.c +10
Sat May 9 22:54:04 EDT 1998 stevenj
* LGPL'ed everything.
A ./COPYING
A ./COPYRIGHT
M ./base/ctl-f77-glue.c +21
M ./base/ctl.c +21
M ./base/ctl.h +21
M ./base/ctl.scm +20
M ./examples/example.c +21
M ./examples/example.scm +10
M ./examples/main.c +14
M ./examples/run.ctl +10
M ./utils/ctl-io.scm +20
M ./utils/gen-ctl-io +20
Sat May 9 20:09:26 EDT 1998 stevenj
* Added interpolate function & other conveniences.
M ./base/ctl.scm +34
M ./examples/example.scm +4
M ./examples/run.ctl -1 +4
Sat May 9 19:40:49 EDT 1998 stevenj
* combine -> map
M ./base/ctl.scm -13 +5
Sat May 9 19:33:26 EDT 1998 stevenj
* Added Fortran wrappers for ctl.c functions.
A ./base/ctl-f77-glue.c
M ./base/ctl.c -14 +24
M ./base/ctl.h -2 +4
Sat May 9 18:21:47 EDT 1998 stevenj
* Separated Guile 1.2 dependencies so that we can remove them easily when
Separated Guile 1.2 dependencies so that we can remove them easily when
we go to Guile 1.3.
M ./base/ctl.c -4 +9
Sat May 9 08:49:43 EDT 1998 stevenj
* Sample control file.
A ./examples/run.ctl
Sat May 9 08:49:10 EDT 1998 stevenj
* Got example program importing and exporting variable values automatically,
Got example program importing and exporting variable values automatically,
and fleshed out examples a bit. Fixed bugs.
M ./base/ctl.c -21 +19
M ./base/ctl.h -1 +1
M ./base/ctl.scm +6
M ./utils/ctl-io.scm -3 +6
M ./utils/gen-ctl-io +17
Sat May 9 08:48:48 EDT 1998 stevenj
* Got example program importing and exporting variable values automatically,
Got example program importing and exporting variable values automatically,
and fleshed out examples a bit.
M ./README -1 +1
M ./examples/Makefile -4 +4
A ./examples/README
A ./examples/example.c
M ./examples/example.scm +22
M ./examples/main.c -12 +18
Sat May 9 06:09:42 EDT 1998 stevenj
* Got rid of unnecessary call to gh_defer_ints.
M ./examples/main.c -4
Sat May 9 06:08:21 EDT 1998 stevenj
* Bug fixes (missing function object-member?, etcetera).
M ./base/ctl.c -3 +11
M ./base/ctl.h +2
Sat May 9 06:08:06 EDT 1998 stevenj
* Added Makefile.
A ./examples/Makefile
Sat May 9 05:32:11 EDT 1998 stevenj
* Added functions to free input/output data.
M ./utils/ctl-io.scm -16 +143
M ./utils/gen-ctl-io -1 +1
Sat May 9 03:57:46 EDT 1998 stevenj
* Fixed grammatical errors.
M ./README -4 +4
Sat May 9 02:11:34 EDT 1998 sfan
* made a small change
M ./README +2
Sat May 9 01:57:43 EDT 1998 stevenj
* Fixed bugs. (Arghh...Guile 1.2 is missing a function in its header file!)
M ./base/ctl.c -2 +7
Sat May 9 01:40:32 EDT 1998 photon
* Mentioned Guile.
M ./README +7
Sat May 9 01:33:15 EDT 1998 stevenj
* Disabled Guile interrupts during run_prog.
M ./examples/main.c -1 +6
Sat May 9 01:22:00 EDT 1998 stevenj
* Use gh_callx instead of gh_apply.
M ./base/ctl.c -12 +8
Sat May 9 01:09:45 EDT 1998 stevenj
* Modified to put output into the same directory as the input file.
M ./utils/gen-ctl-io -9 +11
Sat May 9 00:57:59 EDT 1998 stevenj
* Modified for automatic generation of input/output code from specifications.
M ./base/ctl.c +44
M ./base/ctl.h +12
M ./base/ctl.scm -37 +125
M ./examples/example.scm +16
A ./utils/
A ./utils/ctl-io.scm
A ./utils/gen-ctl-io
Thu May 7 22:13:51 EDT 1998 stevenj
* C glue for accessing guile data.
A ./base/ctl.c
A ./base/ctl.h
Thu May 7 20:15:55 EDT 1998 stevenj
* 3vector -> vector3 (so I can use the same type name in C).
M ./base/ctl.scm -25 +23
M ./examples/example.scm -5 +5
Thu May 7 18:57:35 EDT 1998 stevenj
* Modified class display.
M ./base/ctl.scm -8 +9
Thu May 7 18:53:30 EDT 1998 stevenj
* Sample main program.
A ./examples/main.c
Thu May 7 18:11:08 EDT 1998 stevenj
* Added root Guile script.
A ./base/
A ./base/ctl.scm
Thu May 7 18:10:48 EDT 1998 stevenj
* Add photonic crystal example specifications.
A ./examples/
A ./examples/example.scm
Thu Apr 23 22:46:32 EDT 1998 stevenj
* Initial revision
A ./README
libctl-3.1/config.guess 0000755 0001754 0000144 00000132264 11204551150 012071 0000000 0000000 #! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
# Free Software Foundation, Inc.
timestamp='2009-04-27'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
# 02110-1301, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Per Bothner .
# Please send patches to . Submit a context
# diff and a properly formatted ChangeLog entry.
#
# This script attempts to guess a canonical system name similar to
# config.sub. If it succeeds, it prints the system name on stdout, and
# exits with 0. Otherwise, it exits with 1.
#
# The plan is that this can be called by configure scripts if you
# don't specify an explicit build system type.
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
Usage: $0 [OPTION]
Output the configuration name of the system \`$me' is run on.
Operation modes:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
Report bugs and patches to ."
version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit ;;
--version | -v )
echo "$version" ; exit ;;
--help | --h* | -h )
echo "$usage"; exit ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
echo "$me: invalid option $1$help" >&2
exit 1 ;;
* )
break ;;
esac
done
if test $# != 0; then
echo "$me: too many arguments$help" >&2
exit 1
fi
trap 'exit 1' 1 2 15
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
# compiler to aid in system detection is discouraged as it requires
# temporary files to be created and, as you can see below, it is a
# headache to deal with in a portable fashion.
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
# use `HOST_CC' if defined, but it is deprecated.
# Portable tmp directory creation inspired by the Autoconf team.
set_cc_for_build='
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
: ${TMPDIR=/tmp} ;
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
dummy=$tmp/dummy ;
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
case $CC_FOR_BUILD,$HOST_CC,$CC in
,,) echo "int x;" > $dummy.c ;
for c in cc gcc c89 c99 ; do
if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
CC_FOR_BUILD="$c"; break ;
fi ;
done ;
if test x"$CC_FOR_BUILD" = x ; then
CC_FOR_BUILD=no_compiler_found ;
fi
;;
,,*) CC_FOR_BUILD=$CC ;;
,*,*) CC_FOR_BUILD=$HOST_CC ;;
esac ; set_cc_for_build= ;'
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
PATH=$PATH:/.attbin ; export PATH
fi
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:NetBSD:*:*)
# NetBSD (nbsd) targets should (where applicable) match one or
# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
# switched to ELF, *-*-netbsd* would select the old
# object file format. This provides both forward
# compatibility and a consistent mechanism for selecting the
# object file format.
#
# Note: NetBSD doesn't particularly care about the vendor
# portion of the name. We always set it to "unknown".
sysctl="sysctl -n hw.machine_arch"
UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
/usr/sbin/$sysctl 2>/dev/null || echo unknown)`
case "${UNAME_MACHINE_ARCH}" in
armeb) machine=armeb-unknown ;;
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
sh5el) machine=sh5le-unknown ;;
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
esac
# The Operating System including object format, if it has switched
# to ELF recently, or will in the future.
case "${UNAME_MACHINE_ARCH}" in
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
eval $set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep __ELF__ >/dev/null
then
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
# Return netbsd for either. FIX?
os=netbsd
else
os=netbsdelf
fi
;;
*)
os=netbsd
;;
esac
# The OS release
# Debian GNU/NetBSD machines have a different userland, and
# thus, need a distinct triplet. However, they do not need
# kernel version information, so it can be replaced with a
# suitable tag, in the style of linux-gnu.
case "${UNAME_VERSION}" in
Debian*)
release='-gnu'
;;
*)
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
;;
esac
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}"
exit ;;
*:OpenBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
exit ;;
*:ekkoBSD:*:*)
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
exit ;;
*:SolidBSD:*:*)
echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
exit ;;
macppc:MirBSD:*:*)
echo powerpc-unknown-mirbsd${UNAME_RELEASE}
exit ;;
*:MirBSD:*:*)
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
exit ;;
alpha:OSF1:*:*)
case $UNAME_RELEASE in
*4.0)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
;;
*5.*)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
;;
esac
# According to Compaq, /usr/sbin/psrinfo has been available on
# OSF/1 and Tru64 systems produced since 1995. I hope that
# covers most systems running today. This code pipes the CPU
# types through head -n 1, so we only detect the type of CPU 0.
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
case "$ALPHA_CPU_TYPE" in
"EV4 (21064)")
UNAME_MACHINE="alpha" ;;
"EV4.5 (21064)")
UNAME_MACHINE="alpha" ;;
"LCA4 (21066/21068)")
UNAME_MACHINE="alpha" ;;
"EV5 (21164)")
UNAME_MACHINE="alphaev5" ;;
"EV5.6 (21164A)")
UNAME_MACHINE="alphaev56" ;;
"EV5.6 (21164PC)")
UNAME_MACHINE="alphapca56" ;;
"EV5.7 (21164PC)")
UNAME_MACHINE="alphapca57" ;;
"EV6 (21264)")
UNAME_MACHINE="alphaev6" ;;
"EV6.7 (21264A)")
UNAME_MACHINE="alphaev67" ;;
"EV6.8CB (21264C)")
UNAME_MACHINE="alphaev68" ;;
"EV6.8AL (21264B)")
UNAME_MACHINE="alphaev68" ;;
"EV6.8CX (21264D)")
UNAME_MACHINE="alphaev68" ;;
"EV6.9A (21264/EV69A)")
UNAME_MACHINE="alphaev69" ;;
"EV7 (21364)")
UNAME_MACHINE="alphaev7" ;;
"EV7.9 (21364A)")
UNAME_MACHINE="alphaev79" ;;
esac
# A Pn.n version is a patched version.
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
exit ;;
Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead
# of the specific Alpha model?
echo alpha-pc-interix
exit ;;
21064:Windows_NT:50:3)
echo alpha-dec-winnt3.5
exit ;;
Amiga*:UNIX_System_V:4.0:*)
echo m68k-unknown-sysv4
exit ;;
*:[Aa]miga[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-amigaos
exit ;;
*:[Mm]orph[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-morphos
exit ;;
*:OS/390:*:*)
echo i370-ibm-openedition
exit ;;
*:z/VM:*:*)
echo s390-ibm-zvmoe
exit ;;
*:OS400:*:*)
echo powerpc-ibm-os400
exit ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit ;;
arm:riscos:*:*|arm:RISCOS:*:*)
echo arm-unknown-riscos
exit ;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
exit ;;
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
if test "`(/bin/universe) 2>/dev/null`" = att ; then
echo pyramid-pyramid-sysv3
else
echo pyramid-pyramid-bsd
fi
exit ;;
NILE*:*:*:dcosx)
echo pyramid-pyramid-svr4
exit ;;
DRS?6000:unix:4.0:6*)
echo sparc-icl-nx6
exit ;;
DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
case `/usr/bin/uname -p` in
sparc) echo sparc-icl-nx7; exit ;;
esac ;;
s390x:SunOS:*:*)
echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4H:SunOS:5.*:*)
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
eval $set_cc_for_build
SUN_ARCH="i386"
# If there is a compiler, see if it is configured for 64-bit objects.
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
# This test works for both compilers.
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
SUN_ARCH="x86_64"
fi
fi
echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:*:*)
case "`/usr/bin/arch -k`" in
Series*|S4*)
UNAME_RELEASE=`uname -v`
;;
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
exit ;;
sun3*:SunOS:*:*)
echo m68k-sun-sunos${UNAME_RELEASE}
exit ;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
case "`/bin/arch`" in
sun3)
echo m68k-sun-sunos${UNAME_RELEASE}
;;
sun4)
echo sparc-sun-sunos${UNAME_RELEASE}
;;
esac
exit ;;
aushp:SunOS:*:*)
echo sparc-auspex-sunos${UNAME_RELEASE}
exit ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
# "atarist" or "atariste" at least should have a processor
# > m68000). The system name ranges from "MiNT" over "FreeMiNT"
# to the lowercase version "mint" (or "freemint"). Finally
# the system name "TOS" denotes a system which is actually not
# MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
echo m68k-milan-mint${UNAME_RELEASE}
exit ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
echo m68k-hades-mint${UNAME_RELEASE}
exit ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
echo m68k-unknown-mint${UNAME_RELEASE}
exit ;;
m68k:machten:*:*)
echo m68k-apple-machten${UNAME_RELEASE}
exit ;;
powerpc:machten:*:*)
echo powerpc-apple-machten${UNAME_RELEASE}
exit ;;
RISC*:Mach:*:*)
echo mips-dec-mach_bsd4.3
exit ;;
RISC*:ULTRIX:*:*)
echo mips-dec-ultrix${UNAME_RELEASE}
exit ;;
VAX*:ULTRIX*:*:*)
echo vax-dec-ultrix${UNAME_RELEASE}
exit ;;
2020:CLIX:*:* | 2430:CLIX:*:*)
echo clipper-intergraph-clix${UNAME_RELEASE}
exit ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#ifdef __cplusplus
#include /* for printf() prototype */
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
#endif
#if defined (host_mips) && defined (MIPSEB)
#if defined (SYSTYPE_SYSV)
printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_SVR4)
printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
#endif
#endif
exit (-1);
}
EOF
$CC_FOR_BUILD -o $dummy $dummy.c &&
dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
SYSTEM_NAME=`$dummy $dummyarg` &&
{ echo "$SYSTEM_NAME"; exit; }
echo mips-mips-riscos${UNAME_RELEASE}
exit ;;
Motorola:PowerMAX_OS:*:*)
echo powerpc-motorola-powermax
exit ;;
Motorola:*:4.3:PL8-*)
echo powerpc-harris-powermax
exit ;;
Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
echo powerpc-harris-powermax
exit ;;
Night_Hawk:Power_UNIX:*:*)
echo powerpc-harris-powerunix
exit ;;
m88k:CX/UX:7*:*)
echo m88k-harris-cxux7
exit ;;
m88k:*:4*:R4*)
echo m88k-motorola-sysv4
exit ;;
m88k:*:3*:R3*)
echo m88k-motorola-sysv3
exit ;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
[ ${TARGET_BINARY_INTERFACE}x = x ]
then
echo m88k-dg-dgux${UNAME_RELEASE}
else
echo m88k-dg-dguxbcs${UNAME_RELEASE}
fi
else
echo i586-dg-dgux${UNAME_RELEASE}
fi
exit ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
exit ;;
M88*:*:R3*:*)
# Delta 88k system running SVR3
echo m88k-motorola-sysv3
exit ;;
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
echo m88k-tektronix-sysv3
exit ;;
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
echo m68k-tektronix-bsd
exit ;;
*:IRIX*:*:*)
echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
exit ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
i*86:AIX:*:*)
echo i386-ibm-aix
exit ;;
ia64:AIX:*:*)
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
exit ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include
main()
{
if (!__power_pc())
exit(1);
puts("powerpc-ibm-aix3.2.5");
exit(0);
}
EOF
if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
then
echo "$SYSTEM_NAME"
else
echo rs6000-ibm-aix3.2.5
fi
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
echo rs6000-ibm-aix3.2.4
else
echo rs6000-ibm-aix3.2
fi
exit ;;
*:AIX:*:[456])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
fi
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${IBM_ARCH}-ibm-aix${IBM_REV}
exit ;;
*:AIX:*:*)
echo rs6000-ibm-aix
exit ;;
ibmrt:4.4BSD:*|romp-ibm:BSD:*)
echo romp-ibm-bsd4.4
exit ;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
exit ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
echo rs6000-bull-bosx
exit ;;
DPX/2?00:B.O.S.:*:*)
echo m68k-bull-sysv3
exit ;;
9000/[34]??:4.3bsd:1.*:*)
echo m68k-hp-bsd
exit ;;
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
echo m68k-hp-bsd4.4
exit ;;
9000/[34678]??:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
case "${UNAME_MACHINE}" in
9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
if [ -x /usr/bin/getconf ]; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case "${sc_cpu_version}" in
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
case "${sc_kernel_bits}" in
32) HP_ARCH="hppa2.0n" ;;
64) HP_ARCH="hppa2.0w" ;;
'') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
esac ;;
esac
fi
if [ "${HP_ARCH}" = "" ]; then
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#define _HPUX_SOURCE
#include
#include
int main ()
{
#if defined(_SC_KERNEL_BITS)
long bits = sysconf(_SC_KERNEL_BITS);
#endif
long cpu = sysconf (_SC_CPU_VERSION);
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
case CPU_PA_RISC2_0:
#if defined(_SC_KERNEL_BITS)
switch (bits)
{
case 64: puts ("hppa2.0w"); break;
case 32: puts ("hppa2.0n"); break;
default: puts ("hppa2.0"); break;
} break;
#else /* !defined(_SC_KERNEL_BITS) */
puts ("hppa2.0"); break;
#endif
default: puts ("hppa1.0"); break;
}
exit (0);
}
EOF
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
test -z "$HP_ARCH" && HP_ARCH=hppa
fi ;;
esac
if [ ${HP_ARCH} = "hppa2.0w" ]
then
eval $set_cc_for_build
# hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
# 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
# generating 64-bit code. GNU and HP use different nomenclature:
#
# $ CC_FOR_BUILD=cc ./config.guess
# => hppa2.0w-hp-hpux11.23
# $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
# => hppa64-hp-hpux11.23
if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
grep __LP64__ >/dev/null
then
HP_ARCH="hppa2.0w"
else
HP_ARCH="hppa64"
fi
fi
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit ;;
ia64:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ia64-hp-hpux${HPUX_REV}
exit ;;
3050*:HI-UX:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include
int
main ()
{
long cpu = sysconf (_SC_CPU_VERSION);
/* The order matters, because CPU_IS_HP_MC68K erroneously returns
true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
results, however. */
if (CPU_IS_PA_RISC (cpu))
{
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
default: puts ("hppa-hitachi-hiuxwe2"); break;
}
}
else if (CPU_IS_HP_MC68K (cpu))
puts ("m68k-hitachi-hiuxwe2");
else puts ("unknown-hitachi-hiuxwe2");
exit (0);
}
EOF
$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
{ echo "$SYSTEM_NAME"; exit; }
echo unknown-hitachi-hiuxwe2
exit ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
echo hppa1.1-hp-bsd
exit ;;
9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd
exit ;;
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
echo hppa1.0-hp-mpeix
exit ;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
echo hppa1.1-hp-osf
exit ;;
hp8??:OSF1:*:*)
echo hppa1.0-hp-osf
exit ;;
i*86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then
echo ${UNAME_MACHINE}-unknown-osf1mk
else
echo ${UNAME_MACHINE}-unknown-osf1
fi
exit ;;
parisc*:Lites*:*:*)
echo hppa1.1-hp-lites
exit ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
exit ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd
exit ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd
exit ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
exit ;;
CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*[A-Z]90:*:*:*)
echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-e 's/\.[^.]*$/.X/'
exit ;;
CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*T3E:*:*:*)
echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*SV1:*:*:*)
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
*:UNICOS/mp:*:*)
echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
5000:UNIX_System_V:4.*:*)
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit ;;
sparc*:BSD/OS:*:*)
echo sparc-unknown-bsdi${UNAME_RELEASE}
exit ;;
*:BSD/OS:*:*)
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit ;;
*:FreeBSD:*:*)
case ${UNAME_MACHINE} in
pc98)
echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
amd64)
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
*)
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
esac
exit ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
exit ;;
*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
i*:windows32*:*)
# uname -m includes "-pc" on this system.
echo ${UNAME_MACHINE}-mingw32
exit ;;
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit ;;
*:Interix*:[3456]*)
case ${UNAME_MACHINE} in
x86)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
EM64T | authenticamd | genuineintel)
echo x86_64-unknown-interix${UNAME_RELEASE}
exit ;;
IA64)
echo ia64-unknown-interix${UNAME_RELEASE}
exit ;;
esac ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
exit ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
# UNAME_MACHINE based on the output of uname instead of i386?
echo i586-pc-interix
exit ;;
i*:UWIN*:*)
echo ${UNAME_MACHINE}-pc-uwin
exit ;;
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
echo x86_64-unknown-cygwin
exit ;;
p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin
exit ;;
prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
*:GNU:*:*)
# the GNU system
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
exit ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit ;;
arm*:Linux:*:*)
eval $set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
echo ${UNAME_MACHINE}-unknown-linux-gnu
else
echo ${UNAME_MACHINE}-unknown-linux-gnueabi
fi
exit ;;
avr32*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
cris:Linux:*:*)
echo cris-axis-linux-gnu
exit ;;
crisv32:Linux:*:*)
echo crisv32-axis-linux-gnu
exit ;;
frv:Linux:*:*)
echo frv-unknown-linux-gnu
exit ;;
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
m32r*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
mips:Linux:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#undef CPU
#undef mips
#undef mipsel
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
CPU=mipsel
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
CPU=mips
#else
CPU=
#endif
#endif
EOF
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
/^CPU/{
s: ::g
p
}'`"
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
mips64:Linux:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#undef CPU
#undef mips64
#undef mips64el
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
CPU=mips64el
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
CPU=mips64
#else
CPU=
#endif
#endif
EOF
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
/^CPU/{
s: ::g
p
}'`"
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
or32:Linux:*:*)
echo or32-unknown-linux-gnu
exit ;;
ppc:Linux:*:*)
echo powerpc-unknown-linux-gnu
exit ;;
ppc64:Linux:*:*)
echo powerpc64-unknown-linux-gnu
exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
EV5) UNAME_MACHINE=alphaev5 ;;
EV56) UNAME_MACHINE=alphaev56 ;;
PCA56) UNAME_MACHINE=alphapca56 ;;
PCA57) UNAME_MACHINE=alphapca56 ;;
EV6) UNAME_MACHINE=alphaev6 ;;
EV67) UNAME_MACHINE=alphaev67 ;;
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
exit ;;
padre:Linux:*:*)
echo sparc-unknown-linux-gnu
exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
PA7*) echo hppa1.1-unknown-linux-gnu ;;
PA8*) echo hppa2.0-unknown-linux-gnu ;;
*) echo hppa-unknown-linux-gnu ;;
esac
exit ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
echo hppa64-unknown-linux-gnu
exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux
exit ;;
sh64*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
sh*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
vax:Linux:*:*)
echo ${UNAME_MACHINE}-dec-linux-gnu
exit ;;
x86_64:Linux:*:*)
echo x86_64-unknown-linux-gnu
exit ;;
xtensa*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
i*86:Linux:*:*)
# The BFD linker knows what the default object file format is, so
# first see if it will tell us. cd to the root directory to prevent
# problems with other programs or directories called `ld' in the path.
# Set LC_ALL=C to ensure ld outputs messages in English.
ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
| sed -ne '/supported targets:/!d
s/[ ][ ]*/ /g
s/.*supported targets: *//
s/ .*//
p'`
case "$ld_supported_targets" in
elf32-i386)
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
;;
a.out-i386-linux)
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
exit ;;
"")
# Either a pre-BFD a.out linker (linux-gnuoldld) or
# one that does not give us useful --help.
echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
exit ;;
esac
# Determine whether the default compiler is a.out or elf
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include
#ifdef __ELF__
# ifdef __GLIBC__
# if __GLIBC__ >= 2
LIBC=gnu
# else
LIBC=gnulibc1
# endif
# else
LIBC=gnulibc1
# endif
#else
#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
LIBC=gnu
#else
LIBC=gnuaout
#endif
#endif
#ifdef __dietlibc__
LIBC=dietlibc
#endif
EOF
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
/^LIBC/{
s: ::g
p
}'`"
test x"${LIBC}" != x && {
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
exit
}
test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
# earlier versions are messed up and put the nodename in both
# sysname and nodename.
echo i386-sequent-sysv4
exit ;;
i*86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
# I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit ;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
echo ${UNAME_MACHINE}-pc-os2-emx
exit ;;
i*86:XTS-300:*:STOP)
echo ${UNAME_MACHINE}-unknown-stop
exit ;;
i*86:atheos:*:*)
echo ${UNAME_MACHINE}-unknown-atheos
exit ;;
i*86:syllable:*:*)
echo ${UNAME_MACHINE}-pc-syllable
exit ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit ;;
i*86:*DOS:*:*)
echo ${UNAME_MACHINE}-pc-msdosdjgpp
exit ;;
i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
else
echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
fi
exit ;;
i*86:*:5:[678]*)
# UnixWare 7.x, OpenUNIX and OpenServer 6.
case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
exit ;;
i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then
UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586
(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
&& UNAME_MACHINE=i686
(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
&& UNAME_MACHINE=i686
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
else
echo ${UNAME_MACHINE}-pc-sysv32
fi
exit ;;
pc:*:*:*)
# Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i586.
# Note: whatever this is, it MUST be the same as what config.sub
# prints for the "djgpp" host, or else GDB configury will decide that
# this is a cross-build.
echo i586-pc-msdosdjgpp
exit ;;
Intel:Mach:3*:*)
echo i386-pc-mach3
exit ;;
paragon:*:*:*)
echo i860-intel-osf1
exit ;;
i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
fi
exit ;;
mini*:CTIX:SYS*5:*)
# "miniframe"
echo m68010-convergent-sysv
exit ;;
mc68k:UNIX:SYSTEM5:3.51m)
echo m68k-convergent-sysv
exit ;;
M680?0:D-NIX:5.3:*)
echo m68k-diab-dnix
exit ;;
M68*:*:R3V[5678]*:*)
test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4.3${OS_REL}; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4; exit; } ;;
NCR*:*:4.2:* | MPRAS*:*:4.2:*)
OS_REL='.3'
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4.3${OS_REL}; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; }
/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
echo m68k-unknown-lynxos${UNAME_RELEASE}
exit ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit ;;
TSUNAMI:LynxOS:2.*:*)
echo sparc-unknown-lynxos${UNAME_RELEASE}
exit ;;
rs6000:LynxOS:2.*:*)
echo rs6000-unknown-lynxos${UNAME_RELEASE}
exit ;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
echo powerpc-unknown-lynxos${UNAME_RELEASE}
exit ;;
SM[BE]S:UNIX_SV:*:*)
echo mips-dde-sysv${UNAME_RELEASE}
exit ;;
RM*:ReliantUNIX-*:*:*)
echo mips-sni-sysv4
exit ;;
RM*:SINIX-*:*:*)
echo mips-sni-sysv4
exit ;;
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null`
echo ${UNAME_MACHINE}-sni-sysv4
else
echo ns32k-sni-sysv
fi
exit ;;
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says
echo i586-unisys-sysv4
exit ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes .
# How about differentiating between stratus architectures? -djm
echo hppa1.1-stratus-sysv4
exit ;;
*:*:*:FTX*)
# From seanf@swdc.stratus.com.
echo i860-stratus-sysv4
exit ;;
i*86:VOS:*:*)
# From Paul.Green@stratus.com.
echo ${UNAME_MACHINE}-stratus-vos
exit ;;
*:VOS:*:*)
# From Paul.Green@stratus.com.
echo hppa1.1-stratus-vos
exit ;;
mc68*:A/UX:*:*)
echo m68k-apple-aux${UNAME_RELEASE}
exit ;;
news*:NEWS-OS:6*:*)
echo mips-sony-newsos6
exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
else
echo mips-unknown-sysv${UNAME_RELEASE}
fi
exit ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
echo powerpc-be-beos
exit ;;
BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
echo powerpc-apple-beos
exit ;;
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
echo i586-pc-beos
exit ;;
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
echo i586-pc-haiku
exit ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
exit ;;
SX-5:SUPER-UX:*:*)
echo sx5-nec-superux${UNAME_RELEASE}
exit ;;
SX-6:SUPER-UX:*:*)
echo sx6-nec-superux${UNAME_RELEASE}
exit ;;
SX-7:SUPER-UX:*:*)
echo sx7-nec-superux${UNAME_RELEASE}
exit ;;
SX-8:SUPER-UX:*:*)
echo sx8-nec-superux${UNAME_RELEASE}
exit ;;
SX-8R:SUPER-UX:*:*)
echo sx8r-nec-superux${UNAME_RELEASE}
exit ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit ;;
*:Rhapsody:*:*)
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit ;;
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
case $UNAME_PROCESSOR in
unknown) UNAME_PROCESSOR=powerpc ;;
esac
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
if test "$UNAME_PROCESSOR" = "x86"; then
UNAME_PROCESSOR=i386
UNAME_MACHINE=pc
fi
echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
exit ;;
*:QNX:*:4*)
echo i386-pc-qnx
exit ;;
NSE-?:NONSTOP_KERNEL:*:*)
echo nse-tandem-nsk${UNAME_RELEASE}
exit ;;
NSR-?:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
exit ;;
*:NonStop-UX:*:*)
echo mips-compaq-nonstopux
exit ;;
BS2000:POSIX*:*:*)
echo bs2000-siemens-sysv
exit ;;
DS/*:UNIX_System_V:*:*)
echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
exit ;;
*:Plan9:*:*)
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
# operating systems.
if test "$cputype" = "386"; then
UNAME_MACHINE=i386
else
UNAME_MACHINE="$cputype"
fi
echo ${UNAME_MACHINE}-unknown-plan9
exit ;;
*:TOPS-10:*:*)
echo pdp10-unknown-tops10
exit ;;
*:TENEX:*:*)
echo pdp10-unknown-tenex
exit ;;
KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
echo pdp10-dec-tops20
exit ;;
XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
echo pdp10-xkl-tops20
exit ;;
*:TOPS-20:*:*)
echo pdp10-unknown-tops20
exit ;;
*:ITS:*:*)
echo pdp10-unknown-its
exit ;;
SEI:*:*:SEIUX)
echo mips-sei-seiux${UNAME_RELEASE}
exit ;;
*:DragonFly:*:*)
echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit ;;
*:*VMS:*:*)
UNAME_MACHINE=`(uname -p) 2>/dev/null`
case "${UNAME_MACHINE}" in
A*) echo alpha-dec-vms ; exit ;;
I*) echo ia64-dec-vms ; exit ;;
V*) echo vax-dec-vms ; exit ;;
esac ;;
*:XENIX:*:SysV)
echo i386-pc-xenix
exit ;;
i*86:skyos:*:*)
echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
exit ;;
i*86:rdos:*:*)
echo ${UNAME_MACHINE}-pc-rdos
exit ;;
i*86:AROS:*:*)
echo ${UNAME_MACHINE}-pc-aros
exit ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
eval $set_cc_for_build
cat >$dummy.c <
# include
#endif
main ()
{
#if defined (sony)
#if defined (MIPSEB)
/* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
I don't know.... */
printf ("mips-sony-bsd\n"); exit (0);
#else
#include
printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
"4"
#else
""
#endif
); exit (0);
#endif
#endif
#if defined (__arm) && defined (__acorn) && defined (__unix)
printf ("arm-acorn-riscix\n"); exit (0);
#endif
#if defined (hp300) && !defined (hpux)
printf ("m68k-hp-bsd\n"); exit (0);
#endif
#if defined (NeXT)
#if !defined (__ARCHITECTURE__)
#define __ARCHITECTURE__ "m68k"
#endif
int version;
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
if (version < 4)
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
else
printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
exit (0);
#endif
#if defined (MULTIMAX) || defined (n16)
#if defined (UMAXV)
printf ("ns32k-encore-sysv\n"); exit (0);
#else
#if defined (CMU)
printf ("ns32k-encore-mach\n"); exit (0);
#else
printf ("ns32k-encore-bsd\n"); exit (0);
#endif
#endif
#endif
#if defined (__386BSD__)
printf ("i386-pc-bsd\n"); exit (0);
#endif
#if defined (sequent)
#if defined (i386)
printf ("i386-sequent-dynix\n"); exit (0);
#endif
#if defined (ns32000)
printf ("ns32k-sequent-dynix\n"); exit (0);
#endif
#endif
#if defined (_SEQUENT_)
struct utsname un;
uname(&un);
if (strncmp(un.version, "V2", 2) == 0) {
printf ("i386-sequent-ptx2\n"); exit (0);
}
if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
printf ("i386-sequent-ptx1\n"); exit (0);
}
printf ("i386-sequent-ptx\n"); exit (0);
#endif
#if defined (vax)
# if !defined (ultrix)
# include
# if defined (BSD)
# if BSD == 43
printf ("vax-dec-bsd4.3\n"); exit (0);
# else
# if BSD == 199006
printf ("vax-dec-bsd4.3reno\n"); exit (0);
# else
printf ("vax-dec-bsd\n"); exit (0);
# endif
# endif
# else
printf ("vax-dec-bsd\n"); exit (0);
# endif
# else
printf ("vax-dec-ultrix\n"); exit (0);
# endif
#endif
#if defined (alliant) && defined (i860)
printf ("i860-alliant-bsd\n"); exit (0);
#endif
exit (1);
}
EOF
$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
{ echo "$SYSTEM_NAME"; exit; }
# Apollos put the system type in the environment.
test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
# Convex versions that predate uname can use getsysinfo(1)
if [ -x /usr/convex/getsysinfo ]
then
case `getsysinfo -f cpu_type` in
c1*)
echo c1-convex-bsd
exit ;;
c2*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit ;;
c34*)
echo c34-convex-bsd
exit ;;
c38*)
echo c38-convex-bsd
exit ;;
c4*)
echo c4-convex-bsd
exit ;;
esac
fi
cat >&2 < in order to provide the needed
information to handle your system.
config.guess timestamp = $timestamp
uname -m = `(uname -m) 2>/dev/null || echo unknown`
uname -r = `(uname -r) 2>/dev/null || echo unknown`
uname -s = `(uname -s) 2>/dev/null || echo unknown`
uname -v = `(uname -v) 2>/dev/null || echo unknown`
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
hostinfo = `(hostinfo) 2>/dev/null`
/bin/universe = `(/bin/universe) 2>/dev/null`
/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
/bin/arch = `(/bin/arch) 2>/dev/null`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
UNAME_MACHINE = ${UNAME_MACHINE}
UNAME_RELEASE = ${UNAME_RELEASE}
UNAME_SYSTEM = ${UNAME_SYSTEM}
UNAME_VERSION = ${UNAME_VERSION}
EOF
exit 1
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:
libctl-3.1/config.h.in 0000644 0001754 0000144 00000007246 11212243176 011602 0000000 0000000 /* config.h.in. Generated from configure.ac by autoheader. */
/* If we have C99 complex nums */
#undef CTL_HAS_COMPLEX_INTEGRATION
/* Define to enable debugging checks. */
#undef DEBUG
/* Define to dummy `main' function (if any) required to link to the Fortran
libraries. */
#undef F77_DUMMY_MAIN
/* Define to a macro mangling the given C identifier (in lower and upper
case), which must not contain underscores, for linking with Fortran. */
#undef F77_FUNC
/* As F77_FUNC, but for C identifiers containing underscores. */
#undef F77_FUNC_
/* Define if F77 and FC dummy `main' functions are identical. */
#undef FC_DUMMY_MAIN_EQ_F77
/* Define if gh_lookup works */
#undef GH_LOOKUP_OK
/* Define to 1 if you have the header file. */
#undef HAVE_COMPLEX_H
/* Define to 1 if you have the header file. */
#undef HAVE_DLFCN_H
/* Define if we have gh_bool2scm */
#undef HAVE_GH_BOOL2SCM
/* Define if we have gh_length */
#undef HAVE_GH_LENGTH
/* Define if we have gh_list_ref */
#undef HAVE_GH_LIST_REF
/* Define if we have gh_load. */
#undef HAVE_GH_LOAD
/* Define if we have gh_vector_ref */
#undef HAVE_GH_VECTOR_REF
/* Define to 1 if you have the header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the `dl' library (-ldl). */
#undef HAVE_LIBDL
/* Define to 1 if you have the `gen' library (-lgen). */
#undef HAVE_LIBGEN
/* Define to 1 if you have the `guile' library (-lguile). */
#undef HAVE_LIBGUILE
/* Define to 1 if you have the `m' library (-lm). */
#undef HAVE_LIBM
/* Define to 1 if you have the `readline' library (-lreadline). */
#undef HAVE_LIBREADLINE
/* Define to 1 if you have the header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the header file. */
#undef HAVE_NLOPT_H
/* Define if we have SCM_COMPLEXP */
#undef HAVE_SCM_COMPLEXP
/* Define to 1 if you have the `scm_c_lookup' function. */
#undef HAVE_SCM_C_LOOKUP
/* Define to 1 if you have the `scm_c_make_vector' function. */
#undef HAVE_SCM_C_MAKE_VECTOR
/* Define if we have scm_flush_all_ports */
#undef HAVE_SCM_FLUSH_ALL_PORTS
/* Define to 1 if you have the `scm_make_complex' function. */
#undef HAVE_SCM_MAKE_COMPLEX
/* Define to 1 if you have the `scm_variable_set_x' function. */
#undef HAVE_SCM_VARIABLE_SET_X
/* Define to 1 if you have the header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the header file. */
#undef HAVE_UNISTD_H
/* bugfix v. */
#undef LIBCTL_BUGFIX_VERSION
/* major v. */
#undef LIBCTL_MAJOR_VERSION
/* minor v. */
#undef LIBCTL_MINOR_VERSION
/* Define to version string for libctl. */
#undef LIBCTL_VERSION
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#undef LT_OBJDIR
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Version number of package */
#undef VERSION
libctl-3.1/INSTALL 0000644 0001754 0000144 00000027136 11204551150 010603 0000000 0000000 Installation Instructions
*************************
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
2006, 2007, 2008, 2009 Free Software Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
Basic Installation
==================
Briefly, the shell commands `./configure; make; make install' should
configure, build, and install this package. The following
more-detailed instructions are generic; see the `README' file for
instructions specific to this package.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. Caching is
disabled by default to prevent problems with accidental use of stale
cache files.
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You need `configure.ac' if
you want to change it or regenerate `configure' using a newer version
of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system.
Running `configure' might take a while. While running, it prints
some messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
6. Often, you can also type `make uninstall' to remove the installed
files again.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. Run `./configure --help'
for details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c99 CFLAGS=-g LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you can use GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
With a non-GNU `make', it is safer to compile the package for one
architecture at a time in the source code directory. After you have
installed the package for one architecture, use `make distclean' before
reconfiguring for another architecture.
On MacOS X 10.5 and later systems, you can create libraries and
executables that work on multiple system types--known as "fat" or
"universal" binaries--by specifying multiple `-arch' options to the
compiler but only a single `-arch' option to the preprocessor. Like
this:
./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CPP="gcc -E" CXXCPP="g++ -E"
This is not guaranteed to produce working output in all cases, you
may have to build one architecture at a time and combine the results
using the `lipo' tool if you have problems.
Installation Names
==================
By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PREFIX'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Particular systems
==================
On HP-UX, the default C compiler is not ANSI C compatible. If GNU
CC is not installed, it is recommended to use the following options in
order to use an ANSI C compiler:
./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
parse its `' header file. The option `-nodtk' can be used as
a workaround. If GNU CC is not installed, it is therefore recommended
to try
./configure CC="cc"
and if that doesn't work, try
./configure CC="cc -nodtk"
On Solaris, don't put `/usr/ucb' early in your `PATH'. This
directory contains several dysfunctional programs; working variants of
these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
in your `PATH', put it _after_ `/usr/bin'.
On Haiku, software installed for all users goes in `/boot/common',
not `/usr/local'. It is recommended to use the following options:
./configure --prefix=/boot/common
Specifying the System Type
==========================
There may be some features `configure' cannot figure out
automatically, but needs to determine by the type of machine the package
will run on. Usually, assuming the package is built to be run on the
_same_ architectures, `configure' can figure that out, but if it prints
a message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS
KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the option `--target=TYPE' to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script).
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
an Autoconf bug. Until the bug is fixed you can use this workaround:
CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
`configure' Invocation
======================
`configure' recognizes the following options to control how it
operates.
`--help'
`-h'
Print a summary of all of the options to `configure', and exit.
`--help=short'
`--help=recursive'
Print a summary of the options unique to this package's
`configure', and exit. The `short' variant lists options used
only in the top level, while the `recursive' variant lists options
also present in any nested packages.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--prefix=DIR'
Use DIR as the installation prefix. *Note Installation Names::
for more details, including other options available for fine-tuning
the installation locations.
`--no-create'
`-n'
Run the configure checks, but stop before creating any output
files.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.
libctl-3.1/COPYING 0000644 0001754 0000144 00000043110 10412106151 010570 0000000 0000000 GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
libctl-3.1/install-sh 0000755 0001754 0000144 00000032537 11204551150 011557 0000000 0000000 #!/bin/sh
# install - install a program, script, or datafile
scriptversion=2009-04-28.21; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
nl='
'
IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit=${DOITPROG-}
if test -z "$doit"; then
doit_exec=exec
else
doit_exec=$doit
fi
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_glob='?'
initialize_posix_glob='
test "$posix_glob" != "?" || {
if (set -f) 2>/dev/null; then
posix_glob=
else
posix_glob=:
fi
}
'
posix_mkdir=
# Desired mode of installed file.
mode=0755
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
src=
dst=
dir_arg=
dst_arg=
copy_on_change=false
no_target_directory=
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) ;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
-s) stripcmd=$stripprog;;
-t) dst_arg=$2
shift;;
-T) no_target_directory=true;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call `install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
trap '(exit $?); exit' 1 2 13 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names starting with `-'.
case $src in
-*) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst;;
esac
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
test -d "$dstdir"
dstdir_status=$?
fi
fi
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writeable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
-*) prefix='./';;
*) prefix='';;
esac
eval "$initialize_posix_glob"
oIFS=$IFS
IFS=/
$posix_glob set -f
set fnord $dstdir
shift
$posix_glob set +f
IFS=$oIFS
prefixes=
for d
do
test -z "$d" && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
eval "$initialize_posix_glob" &&
$posix_glob set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
$posix_glob set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
libctl-3.1/README 0000644 0001754 0000144 00000002267 10247401727 010442 0000000 0000000 This is libctl, a Guile-based library for supporting flexible control
files in scientific simulations. libctl is copyright (c) 1998 by
Steven G. Johnson.
To install libctl, one normally only needs to do:
./configure
make
make install
Files are installed under /usr/local by default, but this can be
changed by passing --prefix= to configure.
Documentation can be found in the doc/ directory, and an example
program in the examples/ directory. The main source code for libctl
is in the base/ and utils/ directories.
In utils/geom.*, you can find specification files and functions for
dealing with structures consisting of solid geometric objects in some
lattice basis. The example program uses this code.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
libctl-3.1/utils/ 0000777 0001754 0000144 00000000000 11212243240 010762 5 0000000 0000000 libctl-3.1/utils/nlopt.c 0000644 0001754 0000144 00000006403 11000043123 012172 0000000 0000000 /* wrapper around NLopt nonlinear optimization library (if installed) */
#ifdef HAVE_NLOPT
#include
#include
#include
#include
#include
static double f_scm_wrap(integer n, const double *x, double *grad, void *f_scm_p)
{
SCM *f_scm = (SCM *) f_scm_p;
SCM ret = gh_call1(*f_scm, make_number_list(n, x));
if (scm_real_p(ret))
return scm_to_double(ret);
else { /* otherwise must be a list of value, gradient components,
i.e. (cons value gradient). */
SCM gscm = ret;
int i;
for (i = 0; i < n; ++i) {
gscm = SCM_CDR(gscm);
grad[i] = scm_to_double(SCM_CAR(gscm));
}
return scm_to_double(SCM_CAR(ret));
}
}
/* Scheme-callable wrapper for nlopt_minimize() function.
Note that Guile-callable C subroutines cannot take more than
10 arguments (grrr), so we past the last few arguments with a "rest"
list parameter */
SCM nlopt_minimize_scm(SCM algorithm_scm,
SCM f_scm,
SCM lb_scm, SCM ub_scm, SCM x_scm,
SCM minf_max_scm, SCM ftol_rel_scm, SCM ftol_abs_scm,
SCM rest
/*
SCM xtol_rel_scm, SCM xtol_abs_scm,
SCM maxeval_scm, SCM maxtime_scm
*/)
{
nlopt_algorithm algorithm = (nlopt_algorithm) scm_to_int(algorithm_scm);
int i, n = list_length(x_scm);
double *x, *lb, *ub, *xtol_abs = 0;
double minf_max = scm_to_double(minf_max_scm);
double ftol_rel = scm_to_double(ftol_rel_scm);
double ftol_abs = scm_to_double(ftol_abs_scm);
double xtol_rel = 0;
double maxeval = 0;
double maxtime = 0;
int nrest = list_length(rest);
/*
double xtol_rel = scm_to_double(xtol_rel_scm);
int maxeval = scm_to_int(maxeval_scm);
double maxtime = scm_to_double(maxtime_scm);
*/
double minf;
nlopt_result result;
SCM v, ret;
x = (double *) malloc(sizeof(double) * n * 4);
lb = x + n; ub = lb + n;
if (!x) {
fprintf(stderr, "nlopt_minimize_scm: out of memory!\n");
exit(EXIT_FAILURE);
}
if (list_length(lb_scm) != n || list_length(ub_scm) != n) {
fprintf(stderr, "nlopt_minimize_scm: invalid arguments\n");
exit(EXIT_FAILURE);
}
for (v=x_scm, i=0; i < n; ++i) {
x[i] = scm_to_double(SCM_CAR(v));
v = SCM_CDR(v);
}
for (v=lb_scm, i=0; i < n; ++i) {
lb[i] = scm_to_double(SCM_CAR(v));
v = SCM_CDR(v);
}
for (v=ub_scm, i=0; i < n; ++i) {
ub[i] = scm_to_double(SCM_CAR(v));
v = SCM_CDR(v);
}
if (nrest >= 1) xtol_rel = scm_to_double(SCM_CAR(rest));
if (nrest >= 2) {
SCM xtol_abs_scm = scm_cadr(rest);
if (list_length(xtol_abs_scm)) {
xtol_abs = ub + n;
for (v=xtol_abs_scm, i=0; i < n; ++i) {
xtol_abs[i] = scm_to_double(SCM_CAR(v));
v = SCM_CDR(v);
}
}
}
if (nrest >= 3) maxeval = scm_to_int(scm_caddr(rest));
if (nrest >= 4) maxtime = scm_to_double(scm_cadddr(rest));
result = nlopt_minimize(algorithm, n, f_scm_wrap, &f_scm,
lb, ub, x, &minf,
minf_max, ftol_rel, ftol_abs, xtol_rel, xtol_abs,
maxeval, maxtime);
ret = scm_cons(scm_from_int((int) result),
scm_cons(scm_from_double(minf), make_number_list(n, x)));
free(x);
return ret;
}
#endif /* HAVE_NLOPT */
libctl-3.1/utils/geom.scm 0000644 0001754 0000144 00000025216 11212243114 012337 0000000 0000000 ; libctl: flexible Guile-based control files for scientific software
; Copyright (C) 1998-2009, Steven G. Johnson
;
; This library is free software; you can redistribute it and/or
; modify it under the terms of the GNU Lesser General Public
; License as published by the Free Software Foundation; either
; version 2 of the License, or (at your option) any later version.
;
; This library is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
; Lesser General Public License for more details.
;
; You should have received a copy of the GNU Lesser General Public
; License along with this library; if not, write to the
; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
; Boston, MA 02111-1307, USA.
;
; Steven G. Johnson can be contacted at stevenj@alum.mit.edu.
; ****************************************************************
(if (not (defined? 'material-type))
(define-class material-type no-parent
(define-property data no-default 'SCM))) ; generic user-defined data
; A default material so that we don't have to specify a material for
; an object when we just care about its geometry. If material-type is
; an "abstract superclass" (no properties of its own), programs could
; interpret this as equating to default-material (below). However, we
; only define this default if (make material-type) works, i.e. if
; defaults exist for all properties (if any) of material-type.
(define nothing (if (for-all? (class-properties-all material-type)
property-has-default?)
(make material-type)
no-default))
(define-class geometric-object no-parent
(define-property material nothing 'material-type)
(define-property center no-default 'vector3))
(define-class compound-geometric-object geometric-object
(define-property component-objects '()
(make-list-type 'geometric-object)))
(define (non-negative? x) (not (negative? x)))
(define-class cylinder geometric-object
(define-post-processed-property axis (vector3 0 0 1) 'vector3 unit-vector3)
(define-property radius no-default 'number non-negative?)
(define-property height no-default 'number non-negative?))
(define-class cone cylinder
(define-property radius2 0 'number))
(define-class sphere geometric-object
(define-property radius no-default 'number non-negative?))
(define-class block geometric-object
(define-post-processed-property e1 (vector3 1 0 0) 'vector3 unit-vector3)
(define-post-processed-property e2 (vector3 0 1 0) 'vector3 unit-vector3)
(define-post-processed-property e3 (vector3 0 0 1) 'vector3 unit-vector3)
(define-property size no-default 'vector3)
(define-derived-property projection-matrix 'matrix3x3
(lambda (object)
(matrix3x3-inverse
(matrix3x3
(object-property-value object 'e1)
(object-property-value object 'e2)
(object-property-value object 'e3))))))
(define-class ellipsoid block
(define-derived-property inverse-semi-axes 'vector3
(lambda (object)
(vector-map (lambda (x) (/ 2.0 x))
(object-property-value object 'size)))))
; ****************************************************************
(define-class lattice no-parent
(define-post-processed-property basis1 (vector3 1 0 0) 'vector3 unit-vector3)
(define-post-processed-property basis2 (vector3 0 1 0) 'vector3 unit-vector3)
(define-post-processed-property basis3 (vector3 0 0 1) 'vector3 unit-vector3)
(define-property size (vector3 1 1 1) 'vector3)
(define-property basis-size (vector3 1 1 1) 'vector3)
(define-derived-property b1 'vector3
(lambda (object)
(vector3-scale (vector3-x (object-property-value object 'basis-size))
(object-property-value object 'basis1))))
(define-derived-property b2 'vector3
(lambda (object)
(vector3-scale (vector3-y (object-property-value object 'basis-size))
(object-property-value object 'basis2))))
(define-derived-property b3 'vector3
(lambda (object)
(vector3-scale (vector3-z (object-property-value object 'basis-size))
(object-property-value object 'basis3))))
(define-derived-property basis 'matrix3x3
(lambda (object)
(let ((B (matrix3x3
(object-property-value object 'b1)
(object-property-value object 'b2)
(object-property-value object 'b3))))
(if (zero? (matrix3x3-determinant B))
(error "lattice basis vectors must be linearly independent!"))
B)))
(define-derived-property metric 'matrix3x3
(lambda (object)
(let ((B (object-property-value object 'basis)))
(matrix3x3* (matrix3x3-transpose B) B)))))
; ****************************************************************
; Define some utility functions:
(define (shift-geometric-object go shift-vector)
(let ((c (object-property-value go 'center)))
(modify-object go (center (vector3+ c shift-vector)))))
(define (geometric-object-duplicates shift-vector min-multiple max-multiple go)
(define (g-o-d min-multiple L)
(if (<= min-multiple max-multiple)
(g-o-d (+ min-multiple 1)
(cons (shift-geometric-object
go (vector3-scale min-multiple shift-vector))
L))
L))
(g-o-d min-multiple '()))
(define (geometric-objects-duplicates shift-vector min-multiple max-multiple
go-list)
(fold-left append '()
(map (lambda (go)
(geometric-object-duplicates
shift-vector min-multiple max-multiple go))
go-list)))
(define (lattice-duplicates lat go-list . usize)
(define (lat->lattice v)
(cartesian->lattice (matrix3x3* (object-property-value lat 'basis) v)))
(let ((u1 (if (>= (length usize) 1) (list-ref usize 0) 1))
(u2 (if (>= (length usize) 2) (list-ref usize 1) 1))
(u3 (if (>= (length usize) 3) (list-ref usize 2) 1))
(s (object-property-value lat 'size)))
(let ((b1 (lat->lattice (vector3 u1 0 0)))
(b2 (lat->lattice (vector3 0 u2 0)))
(b3 (lat->lattice (vector3 0 0 u3)))
(n1 (ceiling (/ (vector3-x s) u1)))
(n2 (ceiling (/ (vector3-y s) u2)))
(n3 (ceiling (/ (vector3-z s) u3))))
(geometric-objects-duplicates
b1 (- (floor (/ (- n1 1) 2))) (ceiling (/ (- n1 1) 2))
(geometric-objects-duplicates
b2 (- (floor (/ (- n2 1) 2))) (ceiling (/ (- n2 1) 2))
(geometric-objects-duplicates
b3 (- (floor (/ (- n3 1) 2))) (ceiling (/ (- n3 1) 2))
go-list))))))
(define (geometric-objects-lattice-duplicates go-list . usize)
(apply lattice-duplicates (cons geometry-lattice
(cons go-list usize))))
; ****************************************************************
(define-input-var dimensions 3 'integer)
(define-input-var default-material nothing 'material-type)
(define-input-var geometry-center (vector3 0) 'vector3)
(define-input-var geometry-lattice (make lattice) 'lattice)
(define-input-var geometry '() (make-list-type 'geometric-object))
(define-input-var ensure-periodicity true 'boolean)
(define-external-function point-in-object? true false
'boolean 'vector3 'geometric-object)
(define-external-function normal-to-object true false
'vector3 'vector3 'geometric-object)
(define-external-function point-in-periodic-object? true false
'boolean 'vector3 'geometric-object)
; (define-external-function material-of-point true false
; 'material-type 'vector3)
(define-external-function display-geometric-object-info false false
no-return-value 'integer 'geometric-object)
(define-external-function range-overlap-with-object true false
'number 'vector3 'vector3 'geometric-object 'number 'integer)
(define-external-function square-basis false false
'matrix3x3 'matrix3x3 'vector3)
; ****************************************************************
; Functions and variables for determining the grid size
(define no-size 1e-20) ; for when a particular lattice dimension has no size
(define-param resolution 10) ; the resolution (may be a vector3)
(define-param grid-size false) ; force grid size, if set
(define (get-resolution)
(if (vector? resolution)
resolution
(vector3 resolution resolution resolution)))
(define (get-grid-size)
(if grid-size
grid-size
(let ((res (get-resolution)))
(vector-map
(lambda (x) (inexact->exact (max (ceiling x) 1)))
(vector-map * res (object-property-value geometry-lattice 'size))))))
(define (get-grid-size-prod)
(let ((s (get-grid-size)))
(* (vector3-x s) (vector3-y s) (vector3-z s))))
; ****************************************************************
; Cartesian conversion and rotation for lattice and reciprocal coords:
; The following conversion routines work for vector3 and matrix3x3 arguments:
(define (lattice->cartesian x)
(if (vector3? x)
(matrix3x3*
(object-property-value geometry-lattice 'basis) x)
(matrix3x3*
(matrix3x3*
(object-property-value geometry-lattice 'basis) x)
(matrix3x3-inverse (object-property-value geometry-lattice 'basis)))))
(define (cartesian->lattice x)
(if (vector3? x)
(matrix3x3*
(matrix3x3-inverse (object-property-value geometry-lattice 'basis)) x)
(matrix3x3*
(matrix3x3*
(matrix3x3-inverse (object-property-value geometry-lattice 'basis)) x)
(object-property-value geometry-lattice 'basis))))
(define (reciprocal->cartesian x)
(let ((s (vector-map
(lambda (x) (if (= x no-size) 1 x))
(object-property-value geometry-lattice 'size))))
(let ((Rst
(matrix3x3-transpose
(matrix3x3* (object-property-value geometry-lattice 'basis)
(matrix3x3 (vector3 (vector3-x s) 0 0)
(vector3 0 (vector3-y s) 0)
(vector3 0 0 (vector3-z s)))))))
(if (vector3? x)
(matrix3x3* (matrix3x3-inverse Rst) x)
(matrix3x3* (matrix3x3* (matrix3x3-inverse Rst) x) Rst)))))
(define (cartesian->reciprocal x)
(let ((s (vector-map
(lambda (x) (if (= x no-size) 1 x))
(object-property-value geometry-lattice 'size))))
(let ((Rst
(matrix3x3-transpose
(matrix3x3* (object-property-value geometry-lattice 'basis)
(matrix3x3 (vector3 (vector3-x s) 0 0)
(vector3 0 (vector3-y s) 0)
(vector3 0 0 (vector3-z s)))))))
(if (vector3? x)
(matrix3x3* Rst x)
(matrix3x3* (matrix3x3* Rst x) (matrix3x3-inverse Rst))))))
(define (lattice->reciprocal x) (cartesian->reciprocal (lattice->cartesian x)))
(define (reciprocal->lattice x) (cartesian->lattice (reciprocal->cartesian x)))
; rotate vectors in lattice/reciprocal coords (note that the axis
; is also given in the corresponding basis):
(define (rotate-lattice-vector3 axis theta v)
(cartesian->lattice
(rotate-vector3 (lattice->cartesian axis) theta
(lattice->cartesian v))))
(define (rotate-reciprocal-vector3 axis theta v)
(cartesian->reciprocal
(rotate-vector3 (reciprocal->cartesian axis) theta
(reciprocal->cartesian v))))
; ****************************************************************
libctl-3.1/utils/ctl-io.scm 0000644 0001754 0000144 00000074066 11212243114 012606 0000000 0000000 ; libctl: flexible Guile-based control files for scientific software
; Copyright (C) 1998-2009, Steven G. Johnson
;
; This library is free software; you can redistribute it and/or
; modify it under the terms of the GNU Lesser General Public
; License as published by the Free Software Foundation; either
; version 2 of the License, or (at your option) any later version.
;
; This library is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
; Lesser General Public License for more details.
;
; You should have received a copy of the GNU Lesser General Public
; License along with this library; if not, write to the
; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
; Boston, MA 02111-1307, USA.
;
; Steven G. Johnson can be contacted at stevenj@alum.mit.edu.
; ***************************************************************************
; "Standard" Scheme functions missing from Guile 1.2:
(define (string-upcase s)
(list->string (map (lambda (c)
(if (and (char>=? c #\a) (char<=? c #\z))
(integer->char (+ (char->integer c)
(char->integer #\A)
(- (char->integer #\a))))
c))
(string->list s))))
; ***************************************************************************
(define cxx false) ; set to true for C++ output (c.f. gen-ctl-io --cxx)
(define namespace "ctlio")
(define (ns0) (ns namespace))
(define (ns namespace) (if cxx (string-append namespace "::") ""))
(define (c-identifier s)
(list->string (map (lambda (c)
(if (or (eq? c #\-) (eq? c #\space))
#\_ (if (eq? c #\?) #\p (if (eq? c #\!) #\B c))))
(string->list s))))
(define symbol->c-identifier (compose c-identifier symbol->string))
(define c-type-string (compose c-identifier type-string))
(define declared-type-names '())
(define (declare-type-name type-name)
(if (and (list-type-name? type-name)
(not (member (c-type-string type-name) declared-type-names)))
(begin
(if (list-type-name? (list-el-type-name type-name))
(declare-type-name (list-el-type-name type-name)))
(print "typedef struct {\n")
(print "int num_items;\n")
(print (c-type-string (list-el-type-name type-name))
" *items;\n")
(print "} " (c-type-string type-name) ";\n\n")
(set! declared-type-names (cons (c-type-string type-name)
declared-type-names)))))
(define (only-list-types type-names)
(list-transform-positive type-names list-type-name?))
(define (c-var-decl' var-name var-type-name ns)
(print (c-type-string var-type-name) " " ns
(symbol->c-identifier var-name) ";\n"))
(define (c-var-decl var-name var-type-name)
(c-var-decl' var-name var-type-name ""))
; ***************************************************************************
; use new/delete for C++, malloc/free for C
(define (free . vars)
(let ((var (apply string-append vars)))
(if cxx
(string-append "delete[] (" var ")")
(string-append "free(" var ")"))))
(define (free1 . vars)
(let ((var (apply string-append vars)))
(if cxx
(string-append "delete (" var ")")
(string-append "free(" var ")"))))
(define (malloc tname . nums)
(let ((num (apply string-append nums)))
(if cxx
(string-append "(new " tname "[" num "])")
(string-append
"((" tname " *) malloc(sizeof(" tname ") * (" num ")))"))))
(define (malloc1 . tnames)
(let ((tname (apply string-append tnames)))
(if cxx
(string-append "(new " tname ")")
(string-append "((" tname " *) malloc(sizeof(" tname ")))"))))
; ***************************************************************************
(define (find-direct-subclasses class)
(list-transform-positive class-list
(lambda (c) (eq? (class-parent c) class))))
(define (class-identifier class)
(symbol->c-identifier (class-type-name class)))
(define (class-enum-name0 class)
(string-upcase (class-identifier class)))
(define (class-enum-name class)
(string-append (ns (class-identifier (class-parent class)))
(class-enum-name0 class)))
(define (class-self-enum-name class)
(string-append (ns (class-identifier class))
(class-enum-name0 class) "_SELF"))
(define (c-class-decl class)
(for-each (compose declare-type-name property-type-name)
(class-properties class))
(print "typedef struct " (class-identifier class)
"_struct {\n")
(for-each
(lambda (property)
(c-var-decl (property-name property) (property-type-name property)))
(class-properties class))
(let ((subclasses (find-direct-subclasses class)))
(if (not (null? subclasses))
(begin
(print "enum { " (class-enum-name0 class) "_SELF")
(for-each (lambda (sc) (print ", " (class-enum-name0 sc)))
subclasses)
(print " } which_subclass;\n")
(print "union {\n")
(for-each (lambda (sc)
(print
"struct " (class-identifier sc) "_struct *"
(class-identifier sc) "_data;\n"))
subclasses)
(print "} subclass;\n"))))
(print "} " (class-identifier class) ";\n")
(if (and (not (null? (find-direct-subclasses class)))
(null? (class-properties class)))
(print "#define " (class-enum-name0 class) "_ABSTRACT 1\n"))
(print "\n"))
(define (display-c-class-decls)
(print "/******* Type declarations *******/\n\n")
(for-each c-class-decl (reverse class-list)))
; ***************************************************************************
(define (declare-var var)
(c-var-decl' (var-name var) (var-type-name var) (ns0)))
(define (declare-extern-var var)
(print "extern ")
(c-var-decl (var-name var) (var-type-name var)))
(define (declarer-if-not-input-var declarer)
(lambda (var)
(if (not (member var input-var-list))
(declarer var)
(begin (print "/* " (var-name var)
" is both input and output */\n")))))
(define (all-type-names)
(append
exported-type-list
(map var-type-name
(append (reverse input-var-list)
(reverse output-var-list)))
(map external-function-return-type-name
external-function-list)
(fold-left append '()
(map external-function-arg-type-names
external-function-list))))
(define (declare-var-types) (for-each declare-type-name (all-type-names)))
(define (declare-vars declarer)
(print "/******* Input variables *******/\n")
(for-each declarer (reverse input-var-list))
(print "\n")
(print "/******* Output variables *******/\n")
(for-each (declarer-if-not-input-var declarer) (reverse output-var-list))
(print "\n"))
(define (declare-vars-header)
(declare-var-types)
(declare-vars declare-extern-var))
(define (declare-vars-source) (declare-vars declare-var))
; ***************************************************************************
(define (input-value s-var-name-str c-var-name-str type-name getter)
(let ((desc (get-type-descriptor type-name)))
(cond
((eq? (type-descriptor-kind desc) 'simple)
(print c-var-name-str " = "
(getter type-name s-var-name-str) ";\n"))
((eq? (type-descriptor-kind desc) 'object)
(print (class-input-function-name type-name) "("
(getter 'object s-var-name-str)
", &" c-var-name-str ");\n"))
((eq? (type-descriptor-kind desc) 'uniform-list)
(input-list (getter 'list s-var-name-str) c-var-name-str
(list-el-type-name type-name))))))
(define (get-global type-symbol name-str)
(string-append "ctl_get_" (symbol->c-identifier type-symbol)
"(\"" name-str "\")" ))
(define (property-getter object-name-str)
(lambda (type-symbol name-str)
(string-append (symbol->c-identifier type-symbol)
"_object_property(" object-name-str ", "
"\"" name-str "\")" )))
(define (list-getter lo-name-str)
(lambda (type-symbol name-str)
(string-append (symbol->c-identifier type-symbol)
"_list_ref(" lo-name-str ", "
name-str ")" )))
(define list-temp-suffix "_t")
(define (input-list list-object-get-str c-var-name-str type-name)
(print "{\n")
(let ((lo-name-str (string-append "lo" list-temp-suffix))
(index-name-str (string-append "i" list-temp-suffix))
(saved-list-temp-suffix list-temp-suffix))
(set! list-temp-suffix (string-append list-temp-suffix "_t"))
(print "list " lo-name-str " = "
list-object-get-str ";\n")
(print "int " index-name-str ";\n")
(print c-var-name-str
".num_items = list_length(" lo-name-str ");\n")
(print c-var-name-str ".items = "
(malloc (c-type-string type-name) c-var-name-str ".num_items")
";\n")
(print "for (" index-name-str " = 0; " index-name-str " < "
c-var-name-str ".num_items; " index-name-str "++) {\n")
(input-value index-name-str
(string-append c-var-name-str ".items[" index-name-str "]")
type-name (list-getter lo-name-str))
(print "}\n")
(set! list-temp-suffix saved-list-temp-suffix))
(print "}\n"))
(define (class-input-function-name type-name)
(string-append (symbol->c-identifier type-name)
"_input"))
(define (class-input-function-decl class ns)
(print "void " ns
(class-input-function-name (class-type-name class))
"(SCM so, "
(c-type-string (class-type-name class)) " *o)"))
(define (class-input-function class)
(class-input-function-decl class (ns0))
(print "\n{\n")
(for-each
(lambda (property)
(input-value (symbol->string (property-name property))
(string-append "o->" (symbol->c-identifier
(property-name property)))
(property-type-name property)
(property-getter "so")))
(class-properties class))
(let ((subclasses (find-direct-subclasses class)))
(for-each
(lambda (sc)
(print "if (object_is_member(\"" (class-type-name sc)
"\", so)) {\n")
(print "o->which_subclass = " (class-enum-name sc) ";\n")
(print "o->subclass." (class-identifier sc) "_data = "
(malloc1 (class-identifier sc)) ";\n")
(print (class-input-function-name (class-type-name sc))
"(so, o->subclass." (class-identifier sc) "_data);\n"
"}\nelse "))
subclasses)
(if (not (null? subclasses))
(begin
(print "\n")
(print "o->which_subclass = "
(class-self-enum-name class) ";\n"))))
(print "}\n\n"))
(define (output-class-input-functions-header)
(print "/******* class input function prototypes *******/\n\n")
(for-each
(lambda (class)
(print "extern ") (class-input-function-decl class "")
(print ";\n"))
class-list)
(print "\n"))
(define (output-class-input-functions-source)
(print "/******* class input functions *******/\n\n")
(for-each class-input-function class-list))
(define (input-vars-function)
(print "/******* read input variables *******/\n\n")
(print "SCM " (ns0) "read_input_vars(void)\n")
(print "{\n")
(print "if (num_read_input_vars++) destroy_input_vars();\n")
(for-each
(lambda (var)
(input-value
(symbol->string (var-name var))
(symbol->c-identifier (var-name var))
(var-type-name var)
get-global))
(reverse input-var-list))
(print "return SCM_UNSPECIFIED;\n")
(print "}\n\n"))
; ***************************************************************************
(define (copy-value c0-var-name-str c-var-name-str type-name)
(let ((desc (get-type-descriptor type-name)))
(cond
((eq? (type-descriptor-kind desc) 'simple)
(print c-var-name-str " = " c0-var-name-str ";\n"))
((eq? (type-descriptor-kind desc) 'object)
(print (class-copy-function-name type-name) "(&"
c0-var-name-str
", &" c-var-name-str ");\n"))
((eq? (type-descriptor-kind desc) 'uniform-list)
(copy-list c0-var-name-str c-var-name-str
(list-el-type-name type-name))))))
(define (copy-list c0-var-name-str c-var-name-str type-name)
(print "{\n")
(let ((index-name-str (string-append "i" list-temp-suffix))
(saved-list-temp-suffix list-temp-suffix))
(set! list-temp-suffix (string-append list-temp-suffix "_t"))
(print "int " index-name-str ";\n")
(print c-var-name-str ".num_items = "
c0-var-name-str ".num_items;\n")
(print c-var-name-str ".items = "
(malloc (c-type-string type-name) c-var-name-str ".num_items")
";\n")
(print "for (" index-name-str " = 0; " index-name-str " < "
c-var-name-str ".num_items; " index-name-str "++) {\n")
(copy-value (string-append c0-var-name-str ".items[" index-name-str "]")
(string-append c-var-name-str ".items[" index-name-str "]")
type-name)
(print "}\n")
(set! list-temp-suffix saved-list-temp-suffix))
(print "}\n"))
(define (class-copy-function-name type-name)
(string-append (symbol->c-identifier type-name)
"_copy"))
(define (class-copy-function-decl class ns)
(print "void " ns
(class-copy-function-name (class-type-name class))
"(const " (c-type-string (class-type-name class)) " *o0,"
(c-type-string (class-type-name class)) " *o)"))
(define (class-copy-function class)
(class-copy-function-decl class (ns0))
(print "\n{\n")
(for-each
(lambda (property)
(copy-value (string-append "o0->" (symbol->c-identifier
(property-name property)))
(string-append "o->" (symbol->c-identifier
(property-name property)))
(property-type-name property)))
(class-properties class))
(let ((subclasses (find-direct-subclasses class)))
(for-each
(lambda (sc)
(print "if (o0->which_subclass == " (class-enum-name sc) ") {\n")
(print "o->which_subclass = " (class-enum-name sc) ";\n")
(print "o->subclass." (class-identifier sc) "_data = "
(malloc1 (class-identifier sc)) ";\n")
(print (class-copy-function-name (class-type-name sc))
"(o0->subclass." (class-identifier sc)
"_data, o->subclass." (class-identifier sc) "_data);\n"
"}\nelse "))
subclasses)
(if (not (null? subclasses))
(begin
(print "\n")
(print "o->which_subclass = "
(class-self-enum-name class) ";\n"))))
(print "}\n\n"))
(define (output-class-copy-functions-header)
(print "/******* class copy function prototypes *******/\n\n")
(for-each
(lambda (class)
(print "extern ") (class-copy-function-decl class "")
(print ";\n"))
class-list)
(print "\n"))
(define (output-class-copy-functions-source)
(print "/******* class copy functions *******/\n\n")
(for-each class-copy-function class-list))
; ***************************************************************************
(define (equal-value c0-var-name-str c-var-name-str type-name)
(let ((desc (get-type-descriptor type-name)))
(cond
((primitive-type? type-name)
(print "if (" c-var-name-str " != " c0-var-name-str ") return 0;\n"))
((eq? type-name 'string)
(print "if (strcmp(" c-var-name-str ", " c0-var-name-str
")) return 0;\n"))
((eq? (type-descriptor-kind desc) 'simple)
(print "if (!" type-name "_equal("
c-var-name-str ", " c0-var-name-str ")) return 0;\n"))
((eq? (type-descriptor-kind desc) 'object)
(print "if (!" (class-equal-function-name type-name) "(&"
c0-var-name-str
", &" c-var-name-str ")) return 0;\n"))
((eq? (type-descriptor-kind desc) 'uniform-list)
(equal-list c0-var-name-str c-var-name-str
(list-el-type-name type-name))))))
(define (equal-list c0-var-name-str c-var-name-str type-name)
(print "{\n")
(let ((index-name-str (string-append "i" list-temp-suffix))
(saved-list-temp-suffix list-temp-suffix))
(set! list-temp-suffix (string-append list-temp-suffix "_t"))
(print "int " index-name-str ";\n")
(print "if (" c-var-name-str ".num_items != "
c0-var-name-str ".num_items) return 0;\n")
(print "for (" index-name-str " = 0; " index-name-str " < "
c-var-name-str ".num_items; " index-name-str "++) {\n")
(equal-value (string-append c0-var-name-str ".items[" index-name-str "]")
(string-append c-var-name-str ".items[" index-name-str "]")
type-name)
(print "}\n")
(set! list-temp-suffix saved-list-temp-suffix))
(print "}\n"))
(define (class-equal-function-name type-name)
(string-append (symbol->c-identifier type-name)
"_equal"))
(define (class-equal-function-decl class ns)
(print "boolean " ns
(class-equal-function-name (class-type-name class))
"(const " (c-type-string (class-type-name class)) " *o0, "
"const " (c-type-string (class-type-name class)) " *o)"))
(define (class-equal-function class)
(class-equal-function-decl class (ns0))
(print "\n{\n")
(for-each
(lambda (property)
(equal-value (string-append "o0->" (symbol->c-identifier
(property-name property)))
(string-append "o->" (symbol->c-identifier
(property-name property)))
(property-type-name property)))
(class-properties class))
(let ((subclasses (find-direct-subclasses class)))
(if (not (null? subclasses))
(print "if (o0->which_subclass != o->which_subclass) return 0;\n"))
(for-each
(lambda (sc)
(print "if (o0->which_subclass == " (class-enum-name sc) ") {\n")
(print "if (!" (class-equal-function-name (class-type-name sc))
"(o0->subclass." (class-identifier sc)
"_data, o->subclass." (class-identifier sc) "_data)) return 0;\n"
"}\nelse "))
subclasses)
(print ";\n"))
(print "return 1;\n")
(print "}\n\n"))
(define (output-class-equal-functions-header)
(print "/******* class equal function prototypes *******/\n\n")
(for-each
(lambda (class)
(print "extern ") (class-equal-function-decl class "")
(print ";\n"))
class-list)
(print "\n"))
(define (output-class-equal-functions-source)
(print "/******* class equal functions *******/\n\n")
(for-each class-equal-function class-list))
; ***************************************************************************
(define (export-object-value c-var-name-str type-name exporter)
(error "object output variables are not yet supported. "
type-name c-var-name-str))
(define (export-list-value c-var-name-str type-name exporter)
(let ((el-type-name (list-el-type-name type-name)))
(let ((el-desc (get-type-descriptor el-type-name)))
(cond
((eq? (type-descriptor-kind el-desc) 'simple)
(exporter (string-append "make_" (type-descriptor-name-str el-desc)
"_list("
c-var-name-str ".num_items, "
c-var-name-str ".items)")))
(else
(error
"only export of lists of simple types is currently supported, not "
el-type-name))))))
(define (output-value s-var-name-str c-var-name-str type-name setter)
(let ((desc (get-type-descriptor type-name)))
(cond
((eq? (type-descriptor-kind desc) 'simple)
(print (setter type-name s-var-name-str c-var-name-str) "\n"))
((eq? (type-descriptor-kind desc) 'object)
(export-object-value c-var-name-str type-name
(lambda (sobj-str)
(print
(setter 'object s-var-name-str sobj-str))
(print "\n"))))
((eq? (type-descriptor-kind desc) 'uniform-list)
(export-list-value c-var-name-str type-name
(lambda (slist-str)
(print
(setter 'list s-var-name-str slist-str))
(print "\n")))))))
(define (set-global type-symbol s-name-str c-name-str)
(string-append "ctl_set_" (symbol->c-identifier type-symbol)
"(\"" s-name-str "\", " c-name-str ");" ))
(define (output-vars-function)
(print "/******* write output variables *******/\n\n")
(print "SCM " (ns0) "write_output_vars(void)\n")
(print "{\n")
(print "num_write_output_vars++;\n")
(for-each
(lambda (var)
(output-value
(symbol->string (var-name var))
(symbol->c-identifier (var-name var))
(var-type-name var)
set-global))
(reverse output-var-list))
(print "return SCM_UNSPECIFIED;\n")
(print "}\n\n"))
; ***************************************************************************
(define (destroy-c-var var-str type-name)
(let ((desc (get-type-descriptor type-name)))
(cond
((eq? type-name 'string)
(print (free var-str) ";\n"))
((eq? (type-descriptor-kind desc) 'uniform-list)
(destroy-list var-str (list-el-type-name type-name)))
((eq? (type-descriptor-kind desc) 'object)
(destroy-object var-str type-name)))))
(define (class-destroy-function-name type-name)
(string-append (symbol->c-identifier type-name)
"_destroy"))
(define (class-destroy-function-decl class ns)
(print "void " ns
(class-destroy-function-name (class-type-name class))
"("
(c-type-string (class-type-name class)) " o)"))
(define (destroy-list var-str el-type-name)
(let ((index-name (string-append "index" list-temp-suffix))
(saved-suffix list-temp-suffix))
(set! list-temp-suffix (string-append list-temp-suffix "_t"))
(print "{\n")
(print "int " index-name ";\n")
(print "for (" index-name " = 0; " index-name " < "
var-str ".num_items; " index-name "++) {\n")
(destroy-c-var (string-append var-str ".items[" index-name "]")
el-type-name)
(print "}\n")
(print "}\n")
(print (free var-str ".items") ";\n")
(set! list-temp-suffix saved-suffix)))
(define (destroy-object var-str type-name)
(print (class-destroy-function-name type-name) "(" var-str ");\n"))
(define (destroy-property prefix-str property)
(destroy-c-var (string-append prefix-str (symbol->c-identifier
(property-name property)))
(property-type-name property)))
(define (class-destroy-function class)
(class-destroy-function-decl class (ns0))
(print "\n{\n")
(for-each
(lambda (property) (destroy-property "o." property))
(class-properties class))
(let ((subclasses (find-direct-subclasses class)))
(for-each
(lambda (sc)
(print "if (o.which_subclass == " (class-enum-name sc) ") {\n")
(destroy-object (string-append "*o.subclass."
(class-identifier sc) "_data")
(class-type-name sc))
(print (free1 "o.subclass." (class-identifier sc) "_data") ";\n")
(print "}\n")
(print "else "))
subclasses)
(if (not (null? subclasses))
(begin
(print "{ }\n"))))
(print "}\n\n"))
(define (output-class-destruction-functions-header)
(print "/******* class destruction function prototypes *******/\n\n")
(for-each
(lambda (class)
(print "extern ") (class-destroy-function-decl class "")
(print ";\n"))
class-list)
(print "\n"))
(define (output-class-destruction-functions-source)
(print "/******* class destruction functions *******/\n\n")
(for-each class-destroy-function class-list))
(define (destroy-input-vars-function)
(print "/******* destroy input variables *******/\n\n")
(print "SCM " (ns0) "destroy_input_vars(void)\n")
(print "{\n")
(for-each
(lambda (var)
(destroy-c-var
(symbol->c-identifier (var-name var))
(var-type-name var)))
(reverse input-var-list))
(print "return SCM_UNSPECIFIED;\n")
(print "}\n\n"))
(define (destroy-output-vars-function)
(print "/******* destroy output variables *******/\n\n")
(print "SCM " (ns0) "destroy_output_vars(void)\n")
(print "{\n")
(for-each
(lambda (var)
(if (not (member var input-var-list))
(destroy-c-var
(symbol->c-identifier (var-name var))
(var-type-name var))))
(reverse output-var-list))
(print "return SCM_UNSPECIFIED;\n")
(print "}\n\n"))
; ***************************************************************************
(define (list->indices lst start-index)
(if (null? lst) '()
(cons start-index (list->indices (cdr lst) (+ start-index 1)))))
(define (declare-external-function external-function ns)
(print "SCM " ns (symbol->c-identifier
(external-function-aux-name
(external-function-name external-function)))
"(")
(for-each
(lambda (argnum)
(if (> argnum 0) (print ", "))
(print "SCM arg_scm_" argnum))
(list->indices (external-function-arg-type-names external-function) 0))
(if (= (length (external-function-arg-type-names external-function)) 0)
(print "void"))
(print ")"))
(define (declare-external-c-function external-function)
(print
"extern "
(if (not (eq? (external-function-return-type-name external-function)
no-return-value))
(c-type-string (external-function-return-type-name external-function))
"void")
" "
(symbol->c-identifier (external-function-name external-function))
"(")
(for-each
(lambda (arg-type-name argnum)
(if (> argnum 0) (print ", "))
(print (c-type-string arg-type-name)))
(external-function-arg-type-names external-function)
(list->indices (external-function-arg-type-names external-function) 0))
(if (= (length (external-function-arg-type-names external-function)) 0)
(print "void"))
(print ");\n"))
(define (output-external-functions-header)
(print "/******* external-functions *******/\n\n")
(for-each
(lambda (ef)
(declare-external-c-function ef)
(print "extern ")
(declare-external-function ef "")
(print ";\n\n"))
external-function-list)
(print "\nextern void export_external_functions(void);\n")
(print "\n"))
(define (output-external-function-export external-function)
(print
"gh_new_procedure(\""
(external-function-aux-name (external-function-name external-function))
"\", "
"(SCM (*)()) "
(symbol->c-identifier
(external-function-aux-name (external-function-name external-function)))
", "
(length (external-function-arg-type-names external-function))
", 0, 0);\n"))
(define (output-export-external-functions)
(print "void " (ns0) "export_external_functions(void)\n")
(print "{\n")
(for-each output-external-function-export external-function-list)
(print "}\n\n"))
(define (get-c-local type-symbol name-str)
(string-append "ctl_convert_" (symbol->c-identifier type-symbol)
"_to_c(" name-str ")"))
(define (set-c-local type-symbol s-name-str c-name-str)
(string-append s-name-str " = ctl_convert_"
(symbol->c-identifier type-symbol)
"_to_scm(" c-name-str ");"))
(define (output-external-function external-function)
(declare-external-function external-function (ns0)) (print "\n")
(print "{\n")
(if (not (eq? (external-function-return-type-name external-function)
no-return-value))
(begin
(print "SCM return_val_scm;\n")
(c-var-decl 'return-val-c (external-function-return-type-name
external-function))))
(for-each
(lambda (arg-type-name argnum)
(print (c-type-string arg-type-name) " arg_c_" argnum ";\n"))
(external-function-arg-type-names external-function)
(list->indices (external-function-arg-type-names external-function) 0))
(print "\n")
(for-each
(lambda (arg-type-name argnum)
(input-value (string-append "arg_scm_" (number->string argnum))
(string-append "arg_c_" (number->string argnum))
arg-type-name
get-c-local))
(external-function-arg-type-names external-function)
(list->indices (external-function-arg-type-names external-function) 0))
(print "\n")
(print "#ifdef HAVE_SCM_FLUSH_ALL_PORTS\nscm_flush_all_ports();\n#endif\n")
(if (not (eq? (external-function-return-type-name external-function)
no-return-value))
(print "return_val_c = "))
(print
(symbol->c-identifier (external-function-name external-function))
"(")
(for-each
(lambda (argnum)
(if (> argnum 0) (print ", "))
(print "arg_c_" argnum))
(list->indices (external-function-arg-type-names external-function) 0))
(print ");\n\n")
(print "fflush(stdout); fflush(stderr);\n")
(for-each
(lambda (arg-type-name argnum)
(destroy-c-var
(string-append "arg_c_" (number->string argnum)) arg-type-name))
(external-function-arg-type-names external-function)
(list->indices (external-function-arg-type-names external-function) 0))
(print "\n")
(if (not (eq? (external-function-return-type-name external-function)
no-return-value))
(begin
(output-value
"return_val_scm" "return_val_c"
(external-function-return-type-name external-function)
set-c-local)
(destroy-c-var "return_val_c"
(external-function-return-type-name external-function))
(print "return return_val_scm;\n"))
(begin (print "return SCM_UNSPECIFIED;\n")))
(print "}\n\n"))
(define (output-external-functions-source)
(print "/******* external-functions *******/\n\n")
(for-each output-external-function external-function-list)
(output-export-external-functions))
; ***************************************************************************
(define (swig-type-header type-name)
(print "%typemap(guile,in) "
(if cxx (string-append namespace "::") "")
(c-type-string type-name) " {\n")
(if cxx (print "using namespace " namespace ";\n"))
(input-value "$input" "$1" type-name get-c-local)
(print "}\n")
(if (and (not (eq? 'object (type-descriptor-kind
(get-type-descriptor type-name))))
(or (not (list-type-name? type-name))
(eq? 'simple (type-descriptor-kind
(get-type-descriptor
(list-el-type-name type-name))))))
(begin
(print "%typemap(guile,out) "
(if cxx (string-append namespace "::") "")
(c-type-string type-name) " {\n")
(if cxx (print "using namespace " namespace ";\n"))
(output-value "$result" "$1" type-name set-c-local)
(destroy-c-var "$1" type-name)
(print "}\n")))
(print "\n")
)
(define (output-swig-header)
(print "%{\n#include \"ctl-io.h\"\n%}\n\n")
(print "/******* SWIG type-conversion mappings *******/\n\n")
(for-each swig-type-header
(append (only-list-types (all-type-names))
(map class-type-name class-list))))
; ***************************************************************************
(define (output-header)
(display-c-class-decls)
(declare-vars-header)
(print "extern int num_read_input_vars;\n")
(print "extern int num_write_output_vars;\n\n")
(print "extern SCM read_input_vars(void);\n")
(print "extern SCM write_output_vars(void);\n")
(print "extern SCM destroy_input_vars(void);\n")
(print "extern SCM destroy_output_vars(void);\n\n")
(output-external-functions-header)
(output-class-input-functions-header)
(output-class-copy-functions-header)
(output-class-equal-functions-header)
(output-class-destruction-functions-header)
)
(define (output-source)
(declare-vars-source)
(print
"int " (ns0) "num_read_input_vars = 0; /* # calls to read_input_vars */\n"
"int " (ns0) "num_write_output_vars = 0; /* # calls to read_input_vars */\n\n")
(output-class-input-functions-source)
(output-class-copy-functions-source)
(output-class-equal-functions-source)
(output-class-destruction-functions-source)
(input-vars-function)
(output-vars-function)
(destroy-input-vars-function)
(destroy-output-vars-function)
(output-external-functions-source))
libctl-3.1/utils/nlopt-constants.scm 0000644 0001754 0000144 00000001711 11212243225 014553 0000000 0000000 ; AUTOMATICALLY GENERATED - DO NOT EDIT
(define NLOPT-GN-DIRECT 0)
(define NLOPT-GN-DIRECT-L 1)
(define NLOPT-GN-DIRECT-L-RAND 2)
(define NLOPT-GN-DIRECT-NOSCAL 3)
(define NLOPT-GN-DIRECT-L-NOSCAL 4)
(define NLOPT-GN-DIRECT-L-RAND-NOSCAL 5)
(define NLOPT-GN-ORIG-DIRECT 6)
(define NLOPT-GN-ORIG-DIRECT-L 7)
(define NLOPT-GD-STOGO 8)
(define NLOPT-GD-STOGO-RAND 9)
(define NLOPT-LD-LBFGS-NOCEDAL 10)
(define NLOPT-LD-LBFGS 11)
(define NLOPT-LN-PRAXIS 12)
(define NLOPT-LD-VAR1 13)
(define NLOPT-LD-VAR2 14)
(define NLOPT-LD-TNEWTON 15)
(define NLOPT-LD-TNEWTON-RESTART 16)
(define NLOPT-LD-TNEWTON-PRECOND 17)
(define NLOPT-LD-TNEWTON-PRECOND-RESTART 18)
(define NLOPT-GN-CRS2-LM 19)
(define NLOPT-GN-MLSL 20)
(define NLOPT-GD-MLSL 21)
(define NLOPT-GN-MLSL-LDS 22)
(define NLOPT-GD-MLSL-LDS 23)
(define NLOPT-LD-MMA 24)
(define NLOPT-LN-COBYLA 25)
(define NLOPT-LN-NEWUOA 26)
(define NLOPT-LN-NEWUOA-BOUND 27)
(define NLOPT-LN-NELDERMEAD 28)
(define NLOPT-LN-SBPLX 29)
libctl-3.1/utils/geom-ctl-io-defaults.c 0000644 0001754 0000144 00000001253 10412107621 014767 0000000 0000000 /* for inclusion into geom-ctl-io.c ... this is somewhat of a hack,
necessitated because gen-ctl-io doesn't write default values (from
geom.scm) for the input variable, instead relying on them being
initialized from Scheme. */
integer dimensions = 3;
material_type default_material = { 0 };
vector3 geometry_center = { 0, 0, 0 };
lattice geometry_lattice = { { 1,0,0 },
{ 0,1,0 },
{ 0,0,1 },
{ 1e20,1e20,1e20 },
{ 1,1,1 },
{ 1,0,0 },
{ 0,1,0 },
{ 0,0,1 },
{ { 1,0,0 }, { 0,1,0 }, { 0,0,1 } },
{ { 1,0,0 }, { 0,1,0 }, { 0,0,1 } } };
geometric_object_list geometry = { 0, 0 };
boolean ensure_periodicity = 0;
libctl-3.1/utils/ctlgeom.h 0000644 0001754 0000144 00000013766 11212243114 012516 0000000 0000000 /* libctl: flexible Guile-based control files for scientific software
* Copyright (C) 1998-2009, Steven G. Johnson
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* Steven G. Johnson can be contacted at stevenj@alum.mit.edu.
*/
#ifndef GEOM_H
#define GEOM_H
#ifndef CTL_IO_H
# include
#endif
#ifdef CXX_CTL_IO
#define MATERIAL_TYPE ctlio::material_type
#define GEOMETRIC_OBJECT ctlio::geometric_object
#define GEOMETRIC_OBJECT_LIST ctlio::geometric_object_list
#define LATTICE ctlio::lattice
#else
#define MATERIAL_TYPE material_type
#define GEOMETRIC_OBJECT geometric_object
#define GEOMETRIC_OBJECT_LIST geometric_object_list
#define LATTICE lattice
#endif
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/**************************************************************************/
extern void geom_initialize(void);
extern void geom_fix_object(GEOMETRIC_OBJECT o);
extern void geom_fix_objects(void);
extern void geom_fix_objects0(GEOMETRIC_OBJECT_LIST geometry);
extern void geom_fix_lattice(void);
extern void geom_fix_lattice0(LATTICE *L);
extern void geom_cartesian_lattice(void);
extern void geom_cartesian_lattice0(LATTICE *L);
extern boolean point_in_objectp(vector3 p, GEOMETRIC_OBJECT o);
extern boolean point_in_periodic_objectp(vector3 p, GEOMETRIC_OBJECT o);
extern boolean point_in_fixed_objectp(vector3 p, GEOMETRIC_OBJECT o);
extern boolean point_in_fixed_pobjectp(vector3 p, GEOMETRIC_OBJECT *o);
extern boolean point_in_periodic_fixed_objectp(vector3 p, GEOMETRIC_OBJECT o);
extern vector3 to_geom_object_coords(vector3 p, GEOMETRIC_OBJECT o);
extern vector3 from_geom_object_coords(vector3 p, GEOMETRIC_OBJECT o);
extern vector3 normal_to_object(vector3 p, GEOMETRIC_OBJECT o);
extern vector3 normal_to_fixed_object(vector3 p, GEOMETRIC_OBJECT o);
extern int intersect_line_with_object(vector3 p, vector3 d, GEOMETRIC_OBJECT o,
double s[2]);
extern MATERIAL_TYPE material_of_point_inobject(vector3 p, boolean *inobject);
extern MATERIAL_TYPE material_of_point_inobject0(
GEOMETRIC_OBJECT_LIST geometry, vector3 p, boolean *inobject);
extern MATERIAL_TYPE material_of_point(vector3 p);
extern MATERIAL_TYPE material_of_point0(GEOMETRIC_OBJECT_LIST geometry,
vector3 p);
GEOMETRIC_OBJECT object_of_point0(GEOMETRIC_OBJECT_LIST geometry, vector3 p,
vector3 *shiftby);
GEOMETRIC_OBJECT object_of_point(vector3 p, vector3 *shiftby);
vector3 shift_to_unit_cell(vector3 p);
extern matrix3x3 square_basis(matrix3x3 lattice_basis, vector3 size);
typedef struct {
vector3 low, high;
} geom_box;
typedef struct {
geom_box box;
const GEOMETRIC_OBJECT *o;
vector3 shiftby;
int precedence;
} geom_box_object;
typedef struct geom_box_tree_struct {
geom_box b, b1, b2;
struct geom_box_tree_struct *t1, *t2;
int nobjects;
geom_box_object *objects;
} *geom_box_tree;
extern void destroy_geom_box_tree(geom_box_tree t);
extern geom_box_tree create_geom_box_tree(void);
extern geom_box_tree create_geom_box_tree0(GEOMETRIC_OBJECT_LIST geometry,
geom_box b0);
extern geom_box_tree restrict_geom_box_tree(geom_box_tree, const geom_box *);
extern geom_box_tree geom_tree_search(vector3 p, geom_box_tree t, int *oindex);
extern geom_box_tree geom_tree_search_next(vector3 p, geom_box_tree t, int *oindex);
extern MATERIAL_TYPE material_of_point_in_tree_inobject(vector3 p, geom_box_tree t, boolean *inobject);
extern MATERIAL_TYPE material_of_point_in_tree(vector3 p, geom_box_tree t);
extern MATERIAL_TYPE material_of_unshifted_point_in_tree_inobject(vector3 p, geom_box_tree t, boolean *inobject);
const GEOMETRIC_OBJECT *object_of_point_in_tree(vector3 p, geom_box_tree t,
vector3 *shiftby,
int *precedence);
extern vector3 to_geom_box_coords(vector3 p, geom_box_object *gbo);
extern void display_geom_box_tree(int indentby, geom_box_tree t);
extern void geom_box_tree_stats(geom_box_tree t, int *depth, int *nobjects);
extern void geom_get_bounding_box(GEOMETRIC_OBJECT o, geom_box *box);
extern number box_overlap_with_object(geom_box b, GEOMETRIC_OBJECT o, number tol, integer maxeval);
extern number ellipsoid_overlap_with_object(geom_box b, GEOMETRIC_OBJECT o, number tol, integer maxeval);
extern number range_overlap_with_object(vector3 low, vector3 high,
GEOMETRIC_OBJECT o, number tol,
integer maxeval);
extern vector3 get_grid_size(void);
extern vector3 get_resolution(void);
extern void get_grid_size_n(int *nx, int *ny, int *nz);
GEOMETRIC_OBJECT make_geometric_object(MATERIAL_TYPE material, vector3 center);
GEOMETRIC_OBJECT make_cylinder(MATERIAL_TYPE material, vector3 center,
number radius, number height, vector3 axis);
GEOMETRIC_OBJECT make_cone(MATERIAL_TYPE material, vector3 center,
number radius, number height, vector3 axis,
number radius2);
GEOMETRIC_OBJECT make_sphere(MATERIAL_TYPE material, vector3 center,
number radius);
GEOMETRIC_OBJECT make_block(MATERIAL_TYPE material, vector3 center,
vector3 e1, vector3 e2, vector3 e3,
vector3 size);
GEOMETRIC_OBJECT make_ellipsoid(MATERIAL_TYPE material, vector3 center,
vector3 e1, vector3 e2, vector3 e3,
vector3 size);
/**************************************************************************/
#ifdef __cplusplus
} /* extern "C" */
#endif /* __cplusplus */
#endif /* GEOM_H */
libctl-3.1/utils/README 0000644 0001754 0000144 00000002313 10247401730 011564 0000000 0000000 This directory contains utilities for use with libctl.
First, there are ctl-io.scm and gen-ctl-io.scm, which are used to
generate C glue code (ctl-io.h and ctl-io.c) from a specifications
file for translating input/output variables to/from C.
Second, there is libctlgeom, a collection of utility code for manipulating
geometric objects, for use with libctl. libctlgeom contains:
* geom.scm: specifications file containing classes and utilities
for dealing with three-dimensional geometric objects (spheres,
cylinders, etcetera). This should be included in the specifications
file for anything using libgeom, with:
(include "/utils/geom.scm")
Each geometric object derives from the class geometric-object, and
has a material property whose type is the class material-type. Users
should provide their own material-type class (if none is provided,
a dummy class is used).
* geom.c, geom.h: C routines (callable from Guile) for performing
various operations on a geometry, such as finding out what object
a given point is inside. Note that most of these routines
use the global input variables defined in geom.scm--they must
be called only when these variables have been imported to C.
libctl-3.1/utils/geom.c 0000644 0001754 0000144 00000171212 11212243114 011775 0000000 0000000 /* libctl: flexible Guile-based control files for scientific software
* Copyright (C) 1998-2009, Steven G. Johnson
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* Steven G. Johnson can be contacted at stevenj@alum.mit.edu.
*/
#include
#include
#include
#include "ctl-io.h"
#include
#ifdef CXX_CTL_IO
using namespace ctlio;
# define CTLIO ctlio::
# define GEOM geometric_object::
# define BLK block::
# define CYL cylinder::
# define MAT material_type::
#else
# define CTLIO
# define GEOM
# define BLK
# define CYL
# define MAT
#endif
#ifdef __cplusplus
# define MALLOC(type,num) (new type[num])
# define MALLOC1(type) (new type)
# define FREE(p) delete[] (p)
# define FREE1(p) delete (p)
#else
# define MALLOC(type,num) ((type *) malloc(sizeof(type) * (num)))
# define MALLOC1(type) MALLOC(type,1)
# define FREE(p) free(p)
# define FREE1(p) free(p)
#endif
/**************************************************************************/
/* If v is a vector in the lattice basis, normalize v so that
its cartesian length is unity. */
static void lattice_normalize(vector3 *v)
{
*v = vector3_scale(
1.0 /
sqrt(vector3_dot(*v,
matrix3x3_vector3_mult(geometry_lattice.metric,
*v))),
*v);
}
/* "Fix" the parameters of the given object to account for the
geometry_lattice basis, which may be non-orthogonal. In particular,
this means that the normalization of several unit vectors, such
as the cylinder or block axes, needs to be changed.
Unfortunately, we can't do this stuff at object-creation time
in Guile, because the geometry_lattice variable may not have
been assigned to its final value at that point. */
void geom_fix_object(geometric_object o)
{
switch(o.which_subclass) {
case GEOM CYLINDER:
lattice_normalize(&o.subclass.cylinder_data->axis);
break;
case GEOM BLOCK:
{
matrix3x3 m;
lattice_normalize(&o.subclass.block_data->e1);
lattice_normalize(&o.subclass.block_data->e2);
lattice_normalize(&o.subclass.block_data->e3);
m.c0 = o.subclass.block_data->e1;
m.c1 = o.subclass.block_data->e2;
m.c2 = o.subclass.block_data->e3;
o.subclass.block_data->projection_matrix = matrix3x3_inverse(m);
break;
}
case GEOM COMPOUND_GEOMETRIC_OBJECT:
{
int i;
int n = o.subclass.compound_geometric_object_data
->component_objects.num_items;
geometric_object *os = o.subclass.compound_geometric_object_data
->component_objects.items;
for (i = 0; i < n; ++i) {
#if MATERIAL_TYPE_ABSTRACT
if (os[i].material.which_subclass == MAT MATERIAL_TYPE_SELF)
material_type_copy(&o.material, &os[i].material);
#endif
geom_fix_object(os[i]);
}
break;
}
case GEOM GEOMETRIC_OBJECT_SELF: case GEOM SPHERE:
break; /* these objects are fine */
}
}
/* fix all objects in the geometry list as described in
geom_fix_object, above */
void geom_fix_objects0(geometric_object_list geometry)
{
int index;
for (index = 0; index < geometry.num_items; ++index)
geom_fix_object(geometry.items[index]);
}
void geom_fix_objects(void)
{
geom_fix_objects0(geometry);
}
void geom_fix_lattice0(lattice *L)
{
L->basis1 = unit_vector3(L->basis1);
L->basis2 = unit_vector3(L->basis2);
L->basis3 = unit_vector3(L->basis3);
L->b1 = vector3_scale(L->basis_size.x, L->basis1);
L->b2 = vector3_scale(L->basis_size.y, L->basis2);
L->b3 = vector3_scale(L->basis_size.z, L->basis3);
L->basis.c0 = L->b1;
L->basis.c1 = L->b2;
L->basis.c2 = L->b3;
L->metric = matrix3x3_mult(matrix3x3_transpose(L->basis), L->basis);
}
void geom_fix_lattice(void)
{
geom_fix_lattice0(&geometry_lattice);
}
void geom_cartesian_lattice0(lattice *L)
{
L->basis1.x = 1; L->basis1.y = 0; L->basis1.z = 0;
L->basis2.x = 0; L->basis2.y = 1; L->basis2.z = 0;
L->basis3.x = 0; L->basis3.y = 0; L->basis3.z = 1;
L->basis_size.x = L->basis_size.y = L->basis_size.z = 1;
geom_fix_lattice0(L);
}
void geom_cartesian_lattice(void)
{
geom_cartesian_lattice0(&geometry_lattice);
}
void geom_initialize(void)
{
/* initialize many of the input variables that are normally
initialized from Scheme, except for default_material and
geometry_lattice.size. */
geom_cartesian_lattice();
geometry_center.x = geometry_center.y = geometry_center.z = 0;
dimensions = 3;
ensure_periodicity = 1;
geometry.num_items = 0;
geometry.items = 0;
}
/**************************************************************************/
/* Return whether or not the point p (in the lattice basis) is inside
the object o.
Requires that the global input var geometry_lattice already be
initialized.
point_in_fixed_objectp additionally requires that geom_fix_object
has been called on o (if the lattice basis is non-orthogonal). */
boolean CTLIO point_in_objectp(vector3 p, geometric_object o)
{
geom_fix_object(o);
return point_in_fixed_objectp(p, o);
}
boolean point_in_fixed_objectp(vector3 p, geometric_object o)
{
return point_in_fixed_pobjectp(p, &o);
}
/* as point_in_fixed_objectp, but sets o to the object in question (if true)
(which may be different from the input o if o is a compound object) */
boolean point_in_fixed_pobjectp(vector3 p, geometric_object *o)
{
vector3 r = vector3_minus(p,o->center);
switch (o->which_subclass) {
case GEOM GEOMETRIC_OBJECT_SELF:
return 0;
case GEOM SPHERE:
{
number radius = o->subclass.sphere_data->radius;
return(radius > 0.0 &&
vector3_dot(r,matrix3x3_vector3_mult(geometry_lattice.metric, r))
<= radius*radius);
}
case GEOM CYLINDER:
{
vector3 rm = matrix3x3_vector3_mult(geometry_lattice.metric, r);
number proj = vector3_dot(o->subclass.cylinder_data->axis, rm);
number height = o->subclass.cylinder_data->height;
if (fabs(proj) <= 0.5 * height) {
number radius = o->subclass.cylinder_data->radius;
if (o->subclass.cylinder_data->which_subclass == CYL CONE)
radius += (proj/height + 0.5) *
(o->subclass.cylinder_data->subclass.cone_data->radius2
- radius);
return(radius != 0.0 && vector3_dot(r,rm) - proj*proj <= radius*radius);
}
else
return 0;
}
case GEOM BLOCK:
{
vector3 proj =
matrix3x3_vector3_mult(o->subclass.block_data->projection_matrix, r);
switch (o->subclass.block_data->which_subclass) {
case BLK BLOCK_SELF:
{
vector3 size = o->subclass.block_data->size;
return(fabs(proj.x) <= 0.5 * size.x &&
fabs(proj.y) <= 0.5 * size.y &&
fabs(proj.z) <= 0.5 * size.z);
}
case BLK ELLIPSOID:
{
vector3 isa =
o->subclass.block_data->subclass.ellipsoid_data->inverse_semi_axes;
double
a = proj.x * isa.x,
b = proj.y * isa.y,
c = proj.z * isa.z;
return(a*a + b*b + c*c <= 1.0);
}
}
}
case GEOM COMPOUND_GEOMETRIC_OBJECT:
{
int i;
int n = o->subclass.compound_geometric_object_data
->component_objects.num_items;
geometric_object *os = o->subclass.compound_geometric_object_data
->component_objects.items;
vector3 shiftby = o->center;
for (i = 0; i < n; ++i) {
*o = os[i];
o->center = vector3_plus(o->center, shiftby);
if (point_in_fixed_pobjectp(p, o))
return 1;
}
break;
}
}
return 0;
}
/**************************************************************************/
/* convert a point p inside o to a coordinate in [0,1]^3 that
is some "natural" coordinate for the object */
vector3 to_geom_object_coords(vector3 p, geometric_object o)
{
const vector3 half = {0.5, 0.5, 0.5};
vector3 r = vector3_minus(p,o.center);
switch (o.which_subclass) {
default: {
vector3 po = {0,0,0};
return po;
}
case GEOM SPHERE:
{
number radius = o.subclass.sphere_data->radius;
return vector3_plus(half, vector3_scale(0.5 / radius, r));
}
/* case GEOM CYLINDER:
NOT YET IMPLEMENTED */
case GEOM BLOCK:
{
vector3 proj =
matrix3x3_vector3_mult(o.subclass.block_data->projection_matrix, r);
vector3 size = o.subclass.block_data->size;
if (size.x != 0.0) proj.x /= size.x;
if (size.y != 0.0) proj.y /= size.y;
if (size.z != 0.0) proj.z /= size.z;
return vector3_plus(half, proj);
}
}
}
/* inverse of to_geom_object_coords */
vector3 from_geom_object_coords(vector3 p, geometric_object o)
{
const vector3 half = {0.5, 0.5, 0.5};
p = vector3_minus(p, half);
switch (o.which_subclass) {
default:
return o.center;
case GEOM SPHERE:
{
number radius = o.subclass.sphere_data->radius;
return vector3_plus(o.center, vector3_scale(radius / 0.5, p));
}
/* case GEOM CYLINDER:
NOT YET IMPLEMENTED */
case GEOM BLOCK:
{
vector3 size = o.subclass.block_data->size;
return vector3_plus(
o.center,
vector3_plus(
vector3_scale(size.x * p.x, o.subclass.block_data->e1),
vector3_plus(
vector3_scale(size.y * p.y, o.subclass.block_data->e2),
vector3_scale(size.z * p.z, o.subclass.block_data->e3))
));
}
}
}
/**************************************************************************/
/* Return the normal vector from the given object to the given point,
in lattice coordinates, using the surface of the object that the
point is "closest" to for some definition of "closest" that is
reasonable (at least for points near to the object). The length and
sign of the normal vector are arbitrary. */
vector3 CTLIO normal_to_object(vector3 p, geometric_object o)
{
geom_fix_object(o);
return normal_to_fixed_object(p, o);
}
vector3 normal_to_fixed_object(vector3 p, geometric_object o)
{
vector3 r = vector3_minus(p,o.center);
switch (o.which_subclass) {
case GEOM CYLINDER:
{
vector3 rm = matrix3x3_vector3_mult(geometry_lattice.metric, r);
double proj = vector3_dot(o.subclass.cylinder_data->axis, rm),
height = o.subclass.cylinder_data->height,
radius, prad;
if (fabs(proj) > height * 0.5)
return o.subclass.cylinder_data->axis;
radius = o.subclass.cylinder_data->radius;
prad = sqrt(fabs(vector3_dot(r,rm) - proj*proj));
if (o.subclass.cylinder_data->which_subclass == CYL CONE)
radius += (proj/height + 0.5) *
(o.subclass.cylinder_data->subclass.cone_data->radius2
- radius);
if (fabs(fabs(proj) - height * 0.5) < fabs(prad - radius))
return o.subclass.cylinder_data->axis;
if (o.subclass.cylinder_data->which_subclass == CYL CONE)
return vector3_minus(r, vector3_scale(proj + prad * (o.subclass.cylinder_data->subclass.cone_data->radius2 - radius) / height, o.subclass.cylinder_data->axis));
else
return vector3_minus(r, vector3_scale(proj, o.subclass.cylinder_data->axis));
}
case GEOM BLOCK:
{
vector3 proj =
matrix3x3_vector3_mult(o.subclass.block_data->projection_matrix, r);
switch (o.subclass.block_data->which_subclass) {
case BLK BLOCK_SELF:
{
vector3 size = o.subclass.block_data->size;
double d1 = fabs(fabs(proj.x) - 0.5 * size.x);
double d2 = fabs(fabs(proj.y) - 0.5 * size.y);
double d3 = fabs(fabs(proj.z) - 0.5 * size.z);
if (d1 < d2 && d1 < d3)
return matrix3x3_row1(o.subclass.block_data->projection_matrix);
else if (d2 < d1 && d2 < d3)
return matrix3x3_row2(o.subclass.block_data->projection_matrix);
else
return matrix3x3_row3(o.subclass.block_data->projection_matrix);
}
case BLK ELLIPSOID:
{
vector3 isa =
o.subclass.block_data->subclass.ellipsoid_data->inverse_semi_axes;
proj.x *= isa.x * isa.x;
proj.y *= isa.y * isa.y;
proj.z *= isa.z * isa.z;
return matrix3x3_transpose_vector3_mult(
o.subclass.block_data->projection_matrix, proj);
}
}
}
default:
return r;
}
}
/**************************************************************************/
/* Here is a useful macro to loop over different possible shifts of
the lattice vectors. body is executed for each possible shift,
where the shift is given by the value of shiftby (which should
be a vector3 variable). I would much rather make this a function,
but C's lack of lambda-like function construction or closures makes
this easier to do as a macro. (One could at least wish for
an easier way to make multi-line macros.) */
#define LOOP_PERIODIC(shiftby, body) { \
switch (dimensions) { \
case 1: \
{ \
int iii; \
shiftby.y = shiftby.z = 0; \
for (iii = -1; iii <= 1; ++iii) { \
shiftby.x = iii * geometry_lattice.size.x; \
body; \
} \
break; \
} \
case 2: \
{ \
int iii, jjj; \
shiftby.z = 0; \
for (iii = -1; iii <= 1; ++iii) { \
shiftby.x = iii * geometry_lattice.size.x; \
for (jjj = -1; jjj <= 1; ++jjj) { \
shiftby.y = jjj * geometry_lattice.size.y; \
body; \
} \
} \
break; \
} \
case 3: \
{ \
int iii, jjj, kkk; \
for (iii = -1; iii <= 1; ++iii) { \
shiftby.x = iii * geometry_lattice.size.x; \
for (jjj = -1; jjj <= 1; ++jjj) { \
shiftby.y = jjj * geometry_lattice.size.y; \
for (kkk = -1; kkk <= 1; ++kkk) { \
shiftby.z = kkk * geometry_lattice.size.z; \
body; \
} \
} \
} \
break; \
} \
} \
}
/**************************************************************************/
/* Like point_in_objectp, but also checks the object shifted
by the lattice vectors: */
boolean CTLIO point_in_periodic_objectp(vector3 p, geometric_object o)
{
geom_fix_object(o);
return point_in_periodic_fixed_objectp(p, o);
}
boolean point_in_periodic_fixed_objectp(vector3 p, geometric_object o)
{
vector3 shiftby;
LOOP_PERIODIC(shiftby,
if (point_in_fixed_objectp(vector3_minus(p, shiftby), o))
return 1);
return 0;
}
boolean point_shift_in_periodic_fixed_pobjectp(vector3 p, geometric_object *o,
vector3 *shiftby)
{
geometric_object o0 = *o;
LOOP_PERIODIC((*shiftby),
{
*o = o0;
if (point_in_fixed_pobjectp(
vector3_minus(p, *shiftby), o))
return 1;
});
return 0;
}
/**************************************************************************/
/* Functions to return the object or material type corresponding to
the point p (in the lattice basis). Returns default_material if p
is not in any object.
Requires that the global input vars geometry_lattice, geometry,
dimensions, default_material and ensure_periodicity already be
initialized.
Also requires that geom_fix_objects() has been called!
material_of_point_inobject is a variant that also returns whether
or not the point was in any object. */
geometric_object object_of_point0(geometric_object_list geometry, vector3 p,
vector3 *shiftby)
{
geometric_object o;
int index;
shiftby->x = shiftby->y = shiftby->z = 0;
/* loop in reverse order so that later items are given precedence: */
for (index = geometry.num_items - 1; index >= 0; --index) {
o = geometry.items[index];
if ((ensure_periodicity
&& point_shift_in_periodic_fixed_pobjectp(p, &o, shiftby))
|| point_in_fixed_pobjectp(p, &o))
return o;
}
o.which_subclass = GEOM GEOMETRIC_OBJECT_SELF; /* no object found */
return o;
}
geometric_object object_of_point(vector3 p, vector3 *shiftby)
{
return object_of_point0(geometry, p, shiftby);
}
material_type material_of_point_inobject0(geometric_object_list geometry,
vector3 p, boolean *inobject)
{
vector3 shiftby;
geometric_object o = object_of_point0(geometry, p, &shiftby);
*inobject = o.which_subclass != GEOM GEOMETRIC_OBJECT_SELF;;
return (*inobject ? o.material : default_material);
}
material_type material_of_point_inobject(vector3 p, boolean *inobject)
{
return material_of_point_inobject0(geometry, p, inobject);
}
material_type material_of_point0(geometric_object_list geometry, vector3 p)
{
boolean inobject;
return material_of_point_inobject0(geometry, p, &inobject);
}
material_type material_of_point(vector3 p)
{
return material_of_point0(geometry, p);
}
/**************************************************************************/
/* Given a geometric object o, display some information about it,
indented by indentby spaces. */
void CTLIO display_geometric_object_info(int indentby, geometric_object o)
{
geom_fix_object(o);
printf("%*s", indentby, "");
switch (o.which_subclass) {
case GEOM CYLINDER:
switch (o.subclass.cylinder_data->which_subclass) {
case CYL CONE:
printf("cone");
break;
case CYL CYLINDER_SELF:
printf("cylinder");
break;
}
break;
case GEOM SPHERE:
printf("sphere");
break;
case GEOM BLOCK:
switch (o.subclass.block_data->which_subclass) {
case BLK ELLIPSOID:
printf("ellipsoid");
break;
case BLK BLOCK_SELF:
printf("block");
break;
}
break;
case GEOM COMPOUND_GEOMETRIC_OBJECT:
printf("compound object");
break;
default:
printf("geometric object");
break;
}
printf(", center = (%g,%g,%g)\n",
o.center.x, o.center.y, o.center.z);
switch (o.which_subclass) {
case GEOM CYLINDER:
printf("%*s radius %g, height %g, axis (%g, %g, %g)\n",
indentby, "", o.subclass.cylinder_data->radius,
o.subclass.cylinder_data->height,
o.subclass.cylinder_data->axis.x,
o.subclass.cylinder_data->axis.y,
o.subclass.cylinder_data->axis.z);
if (o.subclass.cylinder_data->which_subclass == CYL CONE)
printf("%*s radius2 %g\n", indentby, "",
o.subclass.cylinder_data->subclass.cone_data->radius2);
break;
case GEOM SPHERE:
printf("%*s radius %g\n", indentby, "",
o.subclass.sphere_data->radius);
break;
case GEOM BLOCK:
printf("%*s size (%g,%g,%g)\n", indentby, "",
o.subclass.block_data->size.x,
o.subclass.block_data->size.y,
o.subclass.block_data->size.z);
printf("%*s axes (%g,%g,%g), (%g,%g,%g), (%g,%g,%g)\n",
indentby, "",
o.subclass.block_data->e1.x,
o.subclass.block_data->e1.y,
o.subclass.block_data->e1.z,
o.subclass.block_data->e2.x,
o.subclass.block_data->e2.y,
o.subclass.block_data->e2.z,
o.subclass.block_data->e3.x,
o.subclass.block_data->e3.y,
o.subclass.block_data->e3.z);
break;
case GEOM COMPOUND_GEOMETRIC_OBJECT:
{
int i;
int n = o.subclass.compound_geometric_object_data
->component_objects.num_items;
geometric_object *os = o.subclass.compound_geometric_object_data
->component_objects.items;
printf("%*s %d components:\n", indentby, "", n);
for (i = 0; i < n; ++i)
display_geometric_object_info(indentby + 5, os[i]);
break;
}
default:
break;
}
}
/**************************************************************************/
/* Compute the intersections with o of a line along p+s*d, returning
the number of intersections (at most 2) and the two intersection "s"
values in s[0] and s[1]. (Note: o must not be a compound object.) */
int intersect_line_with_object(vector3 p, vector3 d, geometric_object o,
double s[2])
{
p = vector3_minus(p, o.center);
s[0] = s[1] = 0;
switch (o.which_subclass) {
case GEOM SPHERE: {
number radius = o.subclass.sphere_data->radius;
vector3 dm = matrix3x3_vector3_mult(geometry_lattice.metric, d);
double a = vector3_dot(d, dm);
double b2 = -vector3_dot(dm, p);
double c = vector3_dot(p, matrix3x3_vector3_mult(
geometry_lattice.metric, p)) - radius * radius;
double discrim = b2*b2 - a*c;
if (discrim < 0)
return 0;
else if (discrim == 0) {
s[0] = b2 / a;
return 1;
}
else {
discrim = sqrt(discrim);
s[0] = (b2 + discrim) / a;
s[1] = (b2 - discrim) / a;
return 2;
}
}
case GEOM CYLINDER: {
vector3 dm = matrix3x3_vector3_mult(geometry_lattice.metric, d);
vector3 pm = matrix3x3_vector3_mult(geometry_lattice.metric, p);
number height = o.subclass.cylinder_data->height;
number radius = o.subclass.cylinder_data->radius;
number radius2 = o.subclass.cylinder_data->which_subclass == CYL CONE ? o.subclass.cylinder_data->subclass.cone_data->radius2 : radius;
double dproj = vector3_dot(o.subclass.cylinder_data->axis, dm);
double pproj = vector3_dot(o.subclass.cylinder_data->axis, pm);
double D = (radius2 - radius) / height;
double L = radius + (radius2 - radius) * 0.5 + pproj*D;
double a = vector3_dot(d,dm) - dproj*dproj * (1 + D*D);
double b2 = dproj * (pproj + D*L) - vector3_dot(p,dm);
double c = vector3_dot(p,pm) - pproj*pproj - L*L;
double discrim = b2*b2 - a*c;
int ret;
if (a == 0) { /* linear equation */
if (b2 == 0) {
if (c == 0) { /* infinite intersections */
s[0] = ((height * 0.5) - pproj) / dproj;
s[1] = -((height * 0.5) + pproj) / dproj;
return 2;
}
else
ret = 0;
}
else {
s[0] = 0.5 * c / b2;
ret = 1;
}
}
else if (discrim < 0)
ret = 0;
else if (discrim == 0) {
s[0] = b2 / a;
ret = 1;
}
else {
discrim = sqrt(discrim);
s[0] = (b2 + discrim) / a;
s[1] = (b2 - discrim) / a;
ret = 2;
}
if (ret == 2 && fabs(pproj + s[1] * dproj) > height * 0.5)
ret = 1;
if (ret >= 1 && fabs(pproj + s[0] * dproj) > height * 0.5) {
--ret;
s[0] = s[1];
}
if (ret == 2 || dproj == 0)
return ret;
/* find intersections with endcaps */
s[ret] = (height * 0.5 - pproj) / dproj;
if (a * s[ret]*s[ret] - 2*b2 * s[ret] + c <= 0)
++ret;
if (ret < 2) {
s[ret] = -(height * 0.5 + pproj) / dproj;
if (a * s[ret]*s[ret] - 2*b2 * s[ret] + c <= 0)
++ret;
}
if (ret == 2 && s[0] == s[1]) ret = 1;
return ret;
}
case GEOM BLOCK:
{
vector3 dproj = matrix3x3_vector3_mult(o.subclass.block_data->projection_matrix, d);
vector3 pproj = matrix3x3_vector3_mult(o.subclass.block_data->projection_matrix, p);
switch (o.subclass.block_data->which_subclass) {
case BLK BLOCK_SELF:
{
vector3 size = o.subclass.block_data->size;
int ret = 0;
size.x *= 0.5; size.y *= 0.5; size.z *= 0.5;
if (dproj.x != 0) {
s[ret] = (size.x - pproj.x) / dproj.x;
if (fabs(pproj.y+s[ret]*dproj.y) <= size.y &&
fabs(pproj.z+s[ret]*dproj.z) <= size.z)
++ret;
s[ret] = (-size.x - pproj.x) / dproj.x;
if (fabs(pproj.y+s[ret]*dproj.y) <= size.y &&
fabs(pproj.z+s[ret]*dproj.z) <= size.z)
++ret;
if (ret == 2) return 2;
}
if (dproj.y != 0) {
s[ret] = (size.y - pproj.y) / dproj.y;
if (fabs(pproj.x+s[ret]*dproj.x) <= size.x &&
fabs(pproj.z+s[ret]*dproj.z) <= size.z)
++ret;
if (ret == 2) return 2;
s[ret] = (-size.y - pproj.y) / dproj.y;
if (fabs(pproj.x+s[ret]*dproj.x) <= size.x &&
fabs(pproj.z+s[ret]*dproj.z) <= size.z)
++ret;
if (ret == 2) return 2;
}
if (dproj.z != 0) {
s[ret] = (size.z - pproj.z) / dproj.z;
if (fabs(pproj.x+s[ret]*dproj.x) <= size.x &&
fabs(pproj.y+s[ret]*dproj.y) <= size.y)
++ret;
if (ret == 2) return 2;
s[ret] = (-size.z - pproj.z) / dproj.z;
if (fabs(pproj.x+s[ret]*dproj.x) <= size.x &&
fabs(pproj.y+s[ret]*dproj.y) <= size.y)
++ret;
}
return ret;
}
case BLK ELLIPSOID:
{
vector3 isa = o.subclass.block_data->subclass.ellipsoid_data->inverse_semi_axes;
double a, b2, c, discrim;
dproj.x *= isa.x; dproj.y *= isa.y; dproj.z *= isa.z;
pproj.x *= isa.x; pproj.y *= isa.y; pproj.z *= isa.z;
a = vector3_dot(dproj, dproj);
b2 = -vector3_dot(dproj, pproj);
c = vector3_dot(pproj, pproj) - 1;
discrim = b2*b2 - a*c;
if (discrim < 0)
return 0;
else if (discrim == 0) {
s[0] = b2 / a;
return 1;
}
else {
discrim = sqrt(discrim);
s[0] = (b2 + discrim) / a;
s[1] = (b2 - discrim) / a;
return 2;
}
}
}
}
default:
return 0;
}
}
/**************************************************************************/
/* Given a basis (matrix columns are the basis unit vectors) and the
size of the lattice (in basis vectors), returns a new "square"
basis. This corresponds to a region of the same volume, but made
rectangular, suitable for outputing to an HDF file.
Given a vector in the range (0..1, 0..1, 0..1), multiplying by
the square basis matrix will yield the coordinates of a point
in the rectangular volume, given in the lattice basis. */
matrix3x3 CTLIO square_basis(matrix3x3 basis, vector3 size)
{
matrix3x3 square;
square.c0 = basis.c0;
square.c1 = vector3_minus(basis.c1, vector3_scale(vector3_dot(basis.c0,
basis.c1),
basis.c1));
square.c2 = vector3_minus(basis.c2, vector3_scale(vector3_dot(basis.c0,
basis.c2),
basis.c2));
square.c2 = vector3_minus(square.c2, vector3_scale(vector3_dot(basis.c0,
square.c2),
unit_vector3(square.c2)));
square.c0 = vector3_scale(size.x, square.c0);
square.c1 = vector3_scale(size.y, square.c1);
square.c2 = vector3_scale(size.z, square.c2);
return matrix3x3_mult(matrix3x3_inverse(basis), square);
}
/**************************************************************************/
/**************************************************************************/
/* Fast geometry routines */
/* Using the above material_of_point routine is way too slow, especially
when there are lots of objects to test. Thus, we develop the following
replacement routines.
The basic idea here is twofold. (1) Compute bounding boxes for
each geometric object, for which inclusion tests can be computed
quickly. (2) Build a tree that recursively breaks down the unit cell
in half, allowing us to perform searches in logarithmic time. */
/**************************************************************************/
/* geom_box utilities: */
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define MIN(a,b) ((a) < (b) ? (a) : (b))
static void geom_box_union(geom_box *bu,
const geom_box *b1, const geom_box *b2)
{
bu->low.x = MIN(b1->low.x, b2->low.x);
bu->low.y = MIN(b1->low.y, b2->low.y);
bu->low.z = MIN(b1->low.z, b2->low.z);
bu->high.x = MAX(b1->high.x, b2->high.x);
bu->high.y = MAX(b1->high.y, b2->high.y);
bu->high.z = MAX(b1->high.z, b2->high.z);
}
static void geom_box_intersection(geom_box *bi,
const geom_box *b1,
const geom_box *b2)
{
bi->low.x = MAX(b1->low.x, b2->low.x);
bi->low.y = MAX(b1->low.y, b2->low.y);
bi->low.z = MAX(b1->low.z, b2->low.z);
bi->high.x = MIN(b1->high.x, b2->high.x);
bi->high.y = MIN(b1->high.y, b2->high.y);
bi->high.z = MIN(b1->high.z, b2->high.z);
}
static void geom_box_add_pt(geom_box *b, vector3 p)
{
b->low.x = MIN(b->low.x, p.x);
b->low.y = MIN(b->low.y, p.y);
b->low.z = MIN(b->low.z, p.z);
b->high.x = MAX(b->high.x, p.x);
b->high.y = MAX(b->high.y, p.y);
b->high.z = MAX(b->high.z, p.z);
}
#define BETWEEN(x, low, high) ((x) >= (low) && (x) <= (high))
static int geom_box_contains_point(const geom_box *b, vector3 p)
{
return (BETWEEN(p.x, b->low.x, b->high.x) &&
BETWEEN(p.y, b->low.y, b->high.y) &&
BETWEEN(p.z, b->low.z, b->high.z));
}
/* return whether or not the given two boxes intersect */
static int geom_boxes_intersect(const geom_box *b1, const geom_box *b2)
{
/* true if the x, y, and z ranges all intersect. */
return ((BETWEEN(b1->low.x, b2->low.x, b2->high.x) ||
BETWEEN(b1->high.x, b2->low.x, b2->high.x) ||
BETWEEN(b2->low.x, b1->low.x, b1->high.x)) &&
(BETWEEN(b1->low.y, b2->low.y, b2->high.y) ||
BETWEEN(b1->high.y, b2->low.y, b2->high.y) ||
BETWEEN(b2->low.y, b1->low.y, b1->high.y)) &&
(BETWEEN(b1->low.z, b2->low.z, b2->high.z) ||
BETWEEN(b1->high.z, b2->low.z, b2->high.z) ||
BETWEEN(b2->low.z, b1->low.z, b1->high.z)));
}
static void geom_box_shift(geom_box *b, vector3 shiftby)
{
b->low = vector3_plus(b->low, shiftby);
b->high = vector3_plus(b->high, shiftby);
}
/**************************************************************************/
/* Computing a bounding box for a geometric object: */
/* compute | (b x c) / (a * (b x c)) |, for use below */
static number compute_dot_cross(vector3 a, vector3 b, vector3 c)
{
vector3 bxc = vector3_cross(b, c);
return fabs(vector3_norm(bxc) / vector3_dot(a, bxc));
}
/* Compute a bounding box for the object o, preferably the smallest
bounding box. The box is a parallelepiped with axes given by
the geometry lattice vectors, and its corners are given in the
lattice basis.
Requires that geometry_lattice global has been initialized,
etcetera. */
void geom_get_bounding_box(geometric_object o, geom_box *box)
{
geom_fix_object(o);
/* initialize to empty box at the center of the object: */
box->low = box->high = o.center;
switch (o.which_subclass) {
case GEOM GEOMETRIC_OBJECT_SELF:
break;
case GEOM SPHERE:
{
/* Find the parallelepiped that the sphere inscribes.
The math comes out surpisingly simple--try it! */
number radius = o.subclass.sphere_data->radius;
/* actually, we could achieve the same effect here
by inverting the geometry_lattice.basis matrix... */
number r1 = compute_dot_cross(geometry_lattice.b1,
geometry_lattice.b2,
geometry_lattice.b3) * radius;
number r2 = compute_dot_cross(geometry_lattice.b2,
geometry_lattice.b3,
geometry_lattice.b1) * radius;
number r3 = compute_dot_cross(geometry_lattice.b3,
geometry_lattice.b1,
geometry_lattice.b2) * radius;
box->low.x -= r1;
box->low.y -= r2;
box->low.z -= r3;
box->high.x += r1;
box->high.y += r2;
box->high.z += r3;
break;
}
case GEOM CYLINDER:
{
/* Find the bounding boxes of the two (circular) ends of
the cylinder, then take the union. Again, the math
for finding the bounding parallelepiped of a circle
comes out suprisingly simple in the end. Proof left
as an exercise for the reader. */
number radius = o.subclass.cylinder_data->radius;
number h = o.subclass.cylinder_data->height * 0.5;
vector3 axis = /* cylinder axis in cartesian coords */
matrix3x3_vector3_mult(geometry_lattice.basis,
o.subclass.cylinder_data->axis);
vector3 e12 = vector3_cross(geometry_lattice.basis1,
geometry_lattice.basis2);
vector3 e23 = vector3_cross(geometry_lattice.basis2,
geometry_lattice.basis3);
vector3 e31 = vector3_cross(geometry_lattice.basis3,
geometry_lattice.basis1);
number elen2, eproj;
number r1, r2, r3;
geom_box tmp_box;
/* Find bounding box dimensions, in lattice coords,
for the circular ends of the cylinder: */
elen2 = vector3_dot(e23, e23);
eproj = vector3_dot(e23, axis);
r1 = fabs(sqrt(fabs(elen2 - eproj*eproj)) /
vector3_dot(e23, geometry_lattice.b1));
elen2 = vector3_dot(e31, e31);
eproj = vector3_dot(e31, axis);
r2 = fabs(sqrt(fabs(elen2 - eproj*eproj)) /
vector3_dot(e31, geometry_lattice.b2));
elen2 = vector3_dot(e12, e12);
eproj = vector3_dot(e12, axis);
r3 = fabs(sqrt(fabs(elen2 - eproj*eproj)) /
vector3_dot(e12, geometry_lattice.b3));
/* Get axis in lattice coords: */
axis = o.subclass.cylinder_data->axis;
tmp_box = *box; /* set tmp_box to center of object */
/* bounding box for -h*axis cylinder end: */
box->low.x -= h * axis.x + r1*radius;
box->low.y -= h * axis.y + r2*radius;
box->low.z -= h * axis.z + r3*radius;
box->high.x -= h * axis.x - r1*radius;
box->high.y -= h * axis.y - r2*radius;
box->high.z -= h * axis.z - r3*radius;
if (o.subclass.cylinder_data->which_subclass == CYL CONE)
radius =
fabs(o.subclass.cylinder_data->subclass.cone_data->radius2);
/* bounding box for +h*axis cylinder end: */
tmp_box.low.x += h * axis.x - r1*radius;
tmp_box.low.y += h * axis.y - r2*radius;
tmp_box.low.z += h * axis.z - r3*radius;
tmp_box.high.x += h * axis.x + r1*radius;
tmp_box.high.y += h * axis.y + r2*radius;
tmp_box.high.z += h * axis.z + r3*radius;
geom_box_union(box, box, &tmp_box);
break;
}
case GEOM BLOCK:
{
/* blocks are easy: just enlarge the box to be big enough to
contain all 8 corners of the block. */
vector3 s1 = vector3_scale(o.subclass.block_data->size.x,
o.subclass.block_data->e1);
vector3 s2 = vector3_scale(o.subclass.block_data->size.y,
o.subclass.block_data->e2);
vector3 s3 = vector3_scale(o.subclass.block_data->size.z,
o.subclass.block_data->e3);
vector3 corner =
vector3_plus(o.center,
vector3_scale(-0.5,
vector3_plus(s1, vector3_plus(s2, s3))));
geom_box_add_pt(box, corner);
geom_box_add_pt(box, vector3_plus(corner, s1));
geom_box_add_pt(box, vector3_plus(corner, s2));
geom_box_add_pt(box, vector3_plus(corner, s3));
geom_box_add_pt(box, vector3_plus(corner, vector3_plus(s1, s2)));
geom_box_add_pt(box, vector3_plus(corner, vector3_plus(s1, s3)));
geom_box_add_pt(box, vector3_plus(corner, vector3_plus(s3, s2)));
geom_box_add_pt(box,
vector3_plus(corner, vector3_plus(s1, vector3_plus(s2, s3))));
break;
}
case GEOM COMPOUND_GEOMETRIC_OBJECT:
{
int i;
int n = o.subclass.compound_geometric_object_data
->component_objects.num_items;
geometric_object *os = o.subclass.compound_geometric_object_data
->component_objects.items;
for (i = 0; i < n; ++i) {
geom_box boxi;
geom_get_bounding_box(os[i], &boxi);
geom_box_shift(&boxi, o.center);
geom_box_union(box, box, &boxi);
}
break;
}
}
}
/**************************************************************************/
/* Compute the fraction of a box's volume (or area/length in 2d/1d) that
overlaps an object. Instead of a box, we also allow an ellipsoid
inscribed inside the box (or a skewed ellipsoid if the box is not
orthogonal). */
typedef struct {
geometric_object o;
vector3 p, dir;
int pdim[2]; /* the (up to two) integration directions */
double scx[2]; /* scale factor (e.g. sign flip) for x coordinates */
unsigned dim;
double a0, b0; /* box limits along analytic direction */
int is_ellipsoid; /* 0 for box, 1 for ellipsoid */
double winv[2], c[2]; /* ellipsoid width-inverses/centers in int. dirs */
double w0, c0; /* width/center along analytic direction */
} overlap_data;
static double overlap_integrand(integer ndim, number *x, void *data_)
{
overlap_data *data = (overlap_data *) data_;
double s[2];
const double *scx = data->scx;
vector3 p = data->p;
double a0 = data->a0, b0 = data->b0;
double scale_result = 1.0;
if (ndim > 0) {
switch (data->pdim[0]) {
case 0: p.x = scx[0] * x[0]; break;
case 1: p.y = scx[0] * x[0]; break;
case 2: p.z = scx[0] * x[0]; break;
}
if (ndim > 1) {
switch (data->pdim[1]) {
case 0: p.x = scx[1] * x[1]; break;
case 1: p.y = scx[1] * x[1]; break;
case 2: p.z = scx[1] * x[1]; break;
}
}
}
if (data->is_ellipsoid && ndim > 0) {
/* compute width of ellipsoid at this point, along the
analytic-intersection direction */
double dx = (x[0] - data->c[0]) * data->winv[0];
double w = 1.0 - dx * dx;
if (ndim > 1) { /* rescale 2nd dimension to stay inside ellipsoid */
double x1;
if (w < 0) return 0.0; /* outside the ellipsoid */
scale_result = sqrt(w);
x1 = data->c[1] + (x[1] - data->c[1]) * scale_result;
switch (data->pdim[1]) {
case 0: p.x = scx[1] * x1; break;
case 1: p.y = scx[1] * x1; break;
case 2: p.z = scx[1] * x1; break;
}
dx = (x1 - data->c[1]) * data->winv[1];
w -= dx * dx;
}
if (w < 0) return 0.0; /* outside the ellipsoid */
w = data->w0 * sqrt(w);
a0 = data->c0 - w; b0 = data->c0 + w;
}
if (2 == intersect_line_with_object(p, data->dir, data->o, s)) {
double ds = (s[0] < s[1]
? MIN(s[1],b0) - MAX(s[0],a0)
: MIN(s[0],b0) - MAX(s[1],a0));
return (ds > 0 ? ds * scale_result : 0.0);
}
return 0.0;
}
#define K_PI 3.14159265358979323846
number overlap_with_object(geom_box b, int is_ellipsoid, geometric_object o,
number tol, integer maxeval)
{
overlap_data data;
int empty_x = b.low.x == b.high.x;
int empty_y = b.low.y == b.high.y;
int empty_z = b.low.z == b.high.z;
double V0 = ((empty_x ? 1 : b.high.x - b.low.x) *
(empty_y ? 1 : b.high.y - b.low.y) *
(empty_z ? 1 : b.high.z - b.low.z));
vector3 ex = {1,0,0}, ey = {0,1,0}, ez = {0,0,1};
geom_box bb;
double xmin[2] = {0,0}, xmax[2] = {0,0}, esterr;
int errflag;
unsigned i;
geom_get_bounding_box(o, &bb);
geom_box_intersection(&bb, &b, &bb);
if (bb.low.x > bb.high.x || bb.low.y > bb.high.y || bb.low.z > bb.high.z
|| (!empty_x && bb.low.x == bb.high.x)
|| (!empty_y && bb.low.y == bb.high.y)
|| (!empty_z && bb.low.z == bb.high.z))
return 0.0;
data.winv[0] = data.winv[1] = data.w0 = 1.0;
data.c[0] = data.c[1] = data.c0 = 0;
data.o = o;
data.p.x = data.p.y = data.p.z = 0;
data.dim = 0;
if (!empty_x) {
data.dir = ex;
data.a0 = bb.low.x;
data.b0 = bb.high.x;
data.w0 = 0.5 * (b.high.x - b.low.x);
data.c0 = 0.5 * (b.high.x + b.low.x);
if (!empty_y) {
xmin[data.dim] = bb.low.y;
xmax[data.dim] = bb.high.y;
data.winv[data.dim] = 2.0 / (b.high.y - b.low.y);
data.c[data.dim] = 0.5 * (b.high.y + b.low.y);
data.pdim[data.dim++] = 1;
}
if (!empty_z) {
xmin[data.dim] = bb.low.z;
xmax[data.dim] = bb.high.z;
data.winv[data.dim] = 2.0 / (b.high.z - b.low.z);
data.c[data.dim] = 0.5 * (b.high.z + b.low.z);
data.pdim[data.dim++] = 2;
}
}
else if (!empty_y) {
data.dir = ey;
data.a0 = bb.low.y;
data.b0 = bb.high.y;
data.w0 = 0.5 * (b.high.y - b.low.y);
data.c0 = 0.5 * (b.high.y + b.low.y);
if (!empty_x) {
xmin[data.dim] = bb.low.x;
xmax[data.dim] = bb.high.x;
data.winv[data.dim] = 2.0 / (b.high.x - b.low.x);
data.c[data.dim] = 0.5 * (b.high.x + b.low.x);
data.pdim[data.dim++] = 0;
}
if (!empty_z) {
xmin[data.dim] = bb.low.z;
xmax[data.dim] = bb.high.z;
data.winv[data.dim] = 2.0 / (b.high.z - b.low.z);
data.c[data.dim] = 0.5 * (b.high.z + b.low.z);
data.pdim[data.dim++] = 2;
}
}
else if (!empty_z) {
data.dir = ez;
data.a0 = bb.low.z;
data.b0 = bb.high.z;
data.w0 = 0.5 * (b.high.z - b.low.z);
data.c0 = 0.5 * (b.high.z + b.low.z);
if (!empty_x) {
xmin[data.dim] = bb.low.x;
xmax[data.dim] = bb.high.x;
data.winv[data.dim] = 2.0 / (b.high.x - b.low.x);
data.c[data.dim] = 0.5 * (b.high.x + b.low.x);
data.pdim[data.dim++] = 0;
}
if (!empty_y) {
xmin[data.dim] = bb.low.y;
xmax[data.dim] = bb.high.y;
data.winv[data.dim] = 2.0 / (b.high.y - b.low.y);
data.c[data.dim] = 0.5 * (b.high.y + b.low.y);
data.pdim[data.dim++] = 1;
}
}
else
return 1.0;
#if 1
/* To maintain mirror symmetries through the x/y/z axes, we flip
the integration range whenever xmax < 0. (This is in case
the integration routine is not fully symmetric, which may
happen(?) due to the upper bound on the #evaluations.)*/
for (i = 0; i < data.dim; ++i) {
if (xmax[i] < 0) {
double xm = xmin[i];
data.scx[i] = -1;
xmin[i] = -xmax[i];
xmax[i] = -xm;
data.c[i] = -data.c[i];
}
else
data.scx[i] = 1;
}
#else
for (i = 0; i < data.dim; ++i) data.scx[i] = 1;
#endif
if ((data.is_ellipsoid = is_ellipsoid)) { /* data for ellipsoid calc. */
if (data.dim == 1)
V0 *= K_PI / 4;
else if (data.dim == 2)
V0 *= K_PI / 6;
}
return adaptive_integration(overlap_integrand, xmin, xmax,
data.dim, &data,
0.0, tol, maxeval,
&esterr, &errflag) / V0;
}
number box_overlap_with_object(geom_box b, geometric_object o,
number tol, integer maxeval)
{
return overlap_with_object(b, 0, o, tol, maxeval);
}
number ellipsoid_overlap_with_object(geom_box b, geometric_object o,
number tol, integer maxeval)
{
return overlap_with_object(b, 1, o, tol, maxeval);
}
number CTLIO range_overlap_with_object(vector3 low, vector3 high,
geometric_object o, number tol,
integer maxeval)
{
geom_box b;
b.low = low;
b.high = high;
return box_overlap_with_object(b, o, tol, maxeval);
}
/**************************************************************************/
/* geom_box_tree: a tree of boxes and the objects contained within
them. The tree recursively partitions the unit cell, allowing us
to perform binary searches for the object containing a given point. */
void destroy_geom_box_tree(geom_box_tree t)
{
if (t) {
destroy_geom_box_tree(t->t1);
destroy_geom_box_tree(t->t2);
if (t->nobjects && t->objects)
FREE(t->objects);
FREE1(t);
}
}
/* return whether the object o, shifted by the vector shiftby,
possibly intersects b. Upon return, obj_b is the bounding
box for o. */
static int object_in_box(geometric_object o, vector3 shiftby,
geom_box *obj_b, const geom_box *b)
{
geom_get_bounding_box(o, obj_b);
geom_box_shift(obj_b, shiftby);
return geom_boxes_intersect(obj_b, b);
}
#define CHECK(cond, s) if (!(cond)){fprintf(stderr,s "\n");exit(EXIT_FAILURE);}
static geom_box_tree new_geom_box_tree(void)
{
geom_box_tree t;
t = MALLOC1(struct geom_box_tree_struct);
CHECK(t, "out of memory");
t->t1 = t->t2 = NULL;
t->nobjects = 0;
t->objects = NULL;
return t;
}
/* Divide b into b1 and b2, cutting b in two along the axis
divide_axis (0 = x, 1 = y, 2 = z) at divide_point. */
static void divide_geom_box(const geom_box *b,
int divide_axis, number divide_point,
geom_box *b1, geom_box *b2)
{
*b1 = *b2 = *b;
switch (divide_axis) {
case 0:
b1->high.x = b2->low.x = divide_point;
break;
case 1:
b1->high.y = b2->low.y = divide_point;
break;
case 2:
b1->high.z = b2->low.z = divide_point;
break;
}
}
#define VEC_I(v,i) ((i) == 0 ? (v).x : ((i) == 1 ? (v).y : (v).z))
#define SMALL 1.0e-7
/* Find the best place (best_partition) to "cut" along the axis
divide_axis in order to maximally divide the objects between
the partitions. Upon return, n1 and n2 are the number of objects
below and above the partition, respectively. */
static void find_best_partition(int nobjects, const geom_box_object *objects,
int divide_axis,
number *best_partition, int *n1, int *n2)
{
number cur_partition;
int i, j, cur_n1, cur_n2;
*n1 = *n2 = nobjects + 1;
*best_partition = 0;
/* Search for the best partition, by checking all possible partitions
either just above the high end of an object or just below the
low end of an object. */
for (i = 0; i < nobjects; ++i) {
cur_partition = VEC_I(objects[i].box.high, divide_axis) + SMALL;
cur_n1 = cur_n2 = 0;
for (j = 0; j < nobjects; ++j) {
if (VEC_I(objects[j].box.low, divide_axis) <= cur_partition)
++cur_n1;
if (VEC_I(objects[j].box.high, divide_axis) >= cur_partition)
++cur_n2;
}
CHECK(cur_n1 + cur_n2 >= nobjects, "bug 1 in find_best_partition");
if (MAX(cur_n1, cur_n2) < MAX(*n1, *n2)) {
*best_partition = cur_partition;
*n1 = cur_n1;
*n2 = cur_n2;
}
}
for (i = 0; i < nobjects; ++i) {
cur_partition = VEC_I(objects[i].box.low, divide_axis) - SMALL;
cur_n1 = cur_n2 = 0;
for (j = 0; j < nobjects; ++j) {
if (VEC_I(objects[j].box.low, divide_axis) <= cur_partition)
++cur_n1;
if (VEC_I(objects[j].box.high, divide_axis) >= cur_partition)
++cur_n2;
}
CHECK(cur_n1 + cur_n2 >= nobjects, "bug 2 in find_best_partition");
if (MAX(cur_n1, cur_n2) < MAX(*n1, *n2)) {
*best_partition = cur_partition;
*n1 = cur_n1;
*n2 = cur_n2;
}
}
}
/* divide_geom_box_tree: recursively divide t in two, each time
dividing along the axis that maximally partitions the boxes,
and only stop partitioning when partitioning doesn't help any
more. Upon return, t points to the partitioned tree. */
static void divide_geom_box_tree(geom_box_tree t)
{
int division_nobjects[3][2] = {{0,0},{0,0},{0,0}};
number division_point[3];
int best = 0;
int i, j, n1, n2;
if (!t)
return;
if (t->t1 || t->t2) { /* this node has already been divided */
divide_geom_box_tree(t->t1);
divide_geom_box_tree(t->t2);
return;
}
if (t->nobjects <= 2)
return; /* no point in partitioning */
/* Try partitioning along each dimension, counting the
number of objects in the partitioned boxes and finding
the best partition. */
for (i = 0; i < dimensions; ++i) {
find_best_partition(t->nobjects, t->objects, i, &division_point[i],
&division_nobjects[i][0],
&division_nobjects[i][1]);
if (MAX(division_nobjects[i][0], division_nobjects[i][1]) <
MAX(division_nobjects[best][0], division_nobjects[best][1]))
best = i;
}
/* don't do anything if division makes the worst case worse or if
it fails to improve the best case: */
if (MAX(division_nobjects[best][0], division_nobjects[best][1]) + 1 >
t->nobjects ||
MIN(division_nobjects[best][0], division_nobjects[best][1]) + 1 >=
t->nobjects)
return; /* division didn't help us */
divide_geom_box(&t->b, best, division_point[best], &t->b1, &t->b2);
t->t1 = new_geom_box_tree();
t->t2 = new_geom_box_tree();
t->t1->b = t->b1;
t->t2->b = t->b2;
t->t1->nobjects = division_nobjects[best][0];
t->t1->objects = MALLOC(geom_box_object, t->t1->nobjects);
CHECK(t->t1->objects, "out of memory");
t->t2->nobjects = division_nobjects[best][1];
t->t2->objects = MALLOC(geom_box_object, t->t2->nobjects);
CHECK(t->t2->objects, "out of memory");
for (j = n1 = n2 = 0; j < t->nobjects; ++j) {
if (geom_boxes_intersect(&t->b1, &t->objects[j].box)) {
CHECK(n1 < t->t1->nobjects, "BUG in divide_geom_box_tree");
t->t1->objects[n1++] = t->objects[j];
}
if (geom_boxes_intersect(&t->b2, &t->objects[j].box)) {
CHECK(n2 < t->t2->nobjects, "BUG in divide_geom_box_tree");
t->t2->objects[n2++] = t->objects[j];
}
}
CHECK(j == t->nobjects && n1 == t->t1->nobjects && n2 == t->t2->nobjects,
"BUG in divide_geom_box_tree: wrong nobjects");
t->nobjects = 0;
FREE(t->objects);
t->objects = NULL;
divide_geom_box_tree(t->t1);
divide_geom_box_tree(t->t2);
}
geom_box_tree create_geom_box_tree(void)
{
geom_box b0;
b0.low = vector3_plus(geometry_center,
vector3_scale(-0.5, geometry_lattice.size));
b0.high = vector3_plus(geometry_center,
vector3_scale(0.5, geometry_lattice.size));
return create_geom_box_tree0(geometry, b0);
}
static int num_objects_in_box(const geometric_object *o, vector3 shiftby,
const geom_box *b)
{
if (o->which_subclass == GEOM COMPOUND_GEOMETRIC_OBJECT) {
int n = o->subclass.compound_geometric_object_data
->component_objects.num_items;
geometric_object *os = o->subclass.compound_geometric_object_data
->component_objects.items;
int i, sum = 0;
shiftby = vector3_plus(shiftby, o->center);
for (i = 0; i < n; ++i)
sum += num_objects_in_box(os + i, shiftby, b);
return sum;
}
else {
geom_box ob;
return object_in_box(*o, shiftby, &ob, b);
}
}
static int store_objects_in_box(const geometric_object *o, vector3 shiftby,
const geom_box *b,
geom_box_object *bo,
int precedence)
{
if (o->which_subclass == GEOM COMPOUND_GEOMETRIC_OBJECT) {
int n = o->subclass.compound_geometric_object_data
->component_objects.num_items;
geometric_object *os = o->subclass.compound_geometric_object_data
->component_objects.items;
int i, sum = 0;
shiftby = vector3_plus(shiftby, o->center);
for (i = 0; i < n; ++i)
sum += store_objects_in_box(os + i, shiftby, b, bo + sum,
precedence - sum);
return sum;
}
else {
geom_box ob;
if (object_in_box(*o, shiftby, &ob, b)) {
bo->box = ob;
bo->o = o;
bo->shiftby = shiftby;
bo->precedence = precedence;
return 1;
}
else
return 0;
}
}
geom_box_tree create_geom_box_tree0(geometric_object_list geometry,
geom_box b0)
{
geom_box_tree t = new_geom_box_tree();
int i, index;
t->b = b0;
for (i = geometry.num_items - 1; i >= 0; --i) {
vector3 shiftby = {0,0,0};
if (ensure_periodicity) {
LOOP_PERIODIC(shiftby,
t->nobjects += num_objects_in_box(
geometry.items + i, shiftby, &t->b));
}
else
t->nobjects += num_objects_in_box(
geometry.items + i, shiftby, &t->b);
}
t->objects = MALLOC(geom_box_object, t->nobjects);
CHECK(t->objects || t->nobjects == 0, "out of memory");
for (i = geometry.num_items - 1, index = 0; i >= 0; --i) {
vector3 shiftby = {0,0,0};
if (ensure_periodicity) {
int precedence = t->nobjects - index;
LOOP_PERIODIC(shiftby,
index += store_objects_in_box(
geometry.items + i, shiftby, &t->b,
t->objects + index, precedence));
}
else
index += store_objects_in_box(
geometry.items + i, shiftby, &t->b,
t->objects + index, t->nobjects - index);
}
CHECK(index == t->nobjects, "bug in create_geom_box_tree0");
divide_geom_box_tree(t);
return t;
}
/* create a new tree from t, pruning all nodes that don't intersect b */
geom_box_tree restrict_geom_box_tree(geom_box_tree t, const geom_box *b)
{
geom_box_tree tr;
int i, j;
if (!t || !geom_boxes_intersect(&t->b, b))
return NULL;
tr = new_geom_box_tree();
for (i = 0, j = 0; i < t->nobjects; ++i)
if (geom_boxes_intersect(&t->objects[i].box, b))
++j;
tr->nobjects = j;
tr->objects = MALLOC(geom_box_object, tr->nobjects);
CHECK(tr->objects || tr->nobjects == 0, "out of memory");
for (i = 0, j = 0; i < t->nobjects; ++i)
if (geom_boxes_intersect(&t->objects[i].box, b))
tr->objects[j++] = t->objects[i];
tr->t1 = restrict_geom_box_tree(t->t1, b);
tr->t2 = restrict_geom_box_tree(t->t2, b);
if (tr->nobjects == 0) {
if (tr->t1 && !tr->t2) {
geom_box_tree tr0 = tr;
tr = tr->t1;
FREE1(tr0);
}
else if (tr->t2 && !tr->t1) {
geom_box_tree tr0 = tr;
tr = tr->t2;
FREE1(tr0);
}
}
return tr;
}
/**************************************************************************/
/* recursively search the tree for the given point, returning the
subtree (if any) that contains it and the index oindex of the
object in that tree. The input value of oindex indicates the
starting object to search in t (0 to search all). */
static geom_box_tree tree_search(vector3 p, geom_box_tree t, int *oindex)
{
int i;
geom_box_tree gbt;
if (!t || !geom_box_contains_point(&t->b, p))
return NULL;
for (i = *oindex; i < t->nobjects; ++i)
if (geom_box_contains_point(&t->objects[i].box, p) &&
point_in_fixed_objectp(vector3_minus(p, t->objects[i].shiftby),
*t->objects[i].o)) {
*oindex = i;
return t;
}
*oindex = 0;
gbt = tree_search(p, t->t1, oindex);
if (!gbt)
gbt = tree_search(p, t->t2, oindex);
return gbt;
}
/* shift p to be within the unit cell of the lattice (centered on the
origin) */
vector3 shift_to_unit_cell(vector3 p)
{
while (p.x >= 0.5 * geometry_lattice.size.x)
p.x -= geometry_lattice.size.x;
while (p.x < -0.5 * geometry_lattice.size.x)
p.x += geometry_lattice.size.x;
while (p.y >= 0.5 * geometry_lattice.size.y)
p.y -= geometry_lattice.size.y;
while (p.y < -0.5 * geometry_lattice.size.y)
p.y += geometry_lattice.size.y;
while (p.z >= 0.5 * geometry_lattice.size.z)
p.z -= geometry_lattice.size.z;
while (p.z < -0.5 * geometry_lattice.size.z)
p.z += geometry_lattice.size.z;
return p;
}
const geometric_object *object_of_point_in_tree(vector3 p, geom_box_tree t,
vector3 *shiftby,
int *precedence)
{
int oindex = 0;
t = tree_search(p, t, &oindex);
if (t) {
geom_box_object *gbo = t->objects + oindex;
*shiftby = gbo->shiftby;
*precedence = gbo->precedence;
return gbo->o;
}
else {
shiftby->x = shiftby->y = shiftby->z = 0;
*precedence = 0;
return 0;
}
}
material_type material_of_unshifted_point_in_tree_inobject(
vector3 p, geom_box_tree t, boolean *inobject)
{
int oindex = 0;
t = tree_search(p, t, &oindex);
if (t) {
*inobject = 1;
return (t->objects[oindex].o->material);
}
else {
*inobject = 0;
return default_material;
}
}
material_type material_of_point_in_tree_inobject(vector3 p, geom_box_tree t,
boolean *inobject)
{
/* backwards compatibility */
return material_of_unshifted_point_in_tree_inobject(
shift_to_unit_cell(p), t, inobject);
}
material_type material_of_point_in_tree(vector3 p, geom_box_tree t)
{
boolean inobject;
return material_of_point_in_tree_inobject(p, t, &inobject);
}
geom_box_tree geom_tree_search_next(vector3 p, geom_box_tree t, int *oindex)
{
*oindex += 1; /* search starting at next oindex */
return tree_search(p, t, oindex);
}
geom_box_tree geom_tree_search(vector3 p, geom_box_tree t, int *oindex)
{
*oindex = -1; /* search all indices > -1 */
return geom_tree_search_next(p, t, oindex);
}
/**************************************************************************/
/* convert a vector p in the given object to some coordinate
in [0,1]^3 that is a more "natural" map of the object interior. */
vector3 to_geom_box_coords(vector3 p, geom_box_object *gbo)
{
return to_geom_object_coords(vector3_minus(p, gbo->shiftby), *gbo->o);
}
/**************************************************************************/
void display_geom_box_tree(int indentby, geom_box_tree t)
{
int i;
if (!t)
return;
printf("%*sbox (%g..%g, %g..%g, %g..%g)\n", indentby, "",
t->b.low.x, t->b.high.x,
t->b.low.y, t->b.high.y,
t->b.low.z, t->b.high.z);
for (i = 0; i < t->nobjects; ++i) {
printf("%*sbounding box (%g..%g, %g..%g, %g..%g)\n", indentby+5, "",
t->objects[i].box.low.x, t->objects[i].box.high.x,
t->objects[i].box.low.y, t->objects[i].box.high.y,
t->objects[i].box.low.z, t->objects[i].box.high.z);
printf("%*sshift object by (%g, %g, %g)\n", indentby+5, "",
t->objects[i].shiftby.x, t->objects[i].shiftby.y,
t->objects[i].shiftby.z);
display_geometric_object_info(indentby + 5, *t->objects[i].o);
}
display_geom_box_tree(indentby + 5, t->t1);
display_geom_box_tree(indentby + 5, t->t2);
}
/**************************************************************************/
/* Computing tree statistics (depth and number of nodes): */
/* helper function for geom_box_tree_stats */
static void get_tree_stats(geom_box_tree t, int *depth, int *nobjects)
{
if (t) {
int d1, d2;
*nobjects += t->nobjects;
d1 = d2 = *depth + 1;
get_tree_stats(t->t1, &d1, nobjects);
get_tree_stats(t->t2, &d2, nobjects);
*depth = MAX(d1, d2);
}
}
void geom_box_tree_stats(geom_box_tree t, int *depth, int *nobjects)
{
*depth = *nobjects = 0;
get_tree_stats(t, depth, nobjects);
}
/**************************************************************************/
vector3 get_grid_size(void)
{
return ctl_convert_vector3_to_c(gh_call0(gh_lookup("get-grid-size")));
}
vector3 get_resolution(void)
{
return ctl_convert_vector3_to_c(gh_call0(gh_lookup("get-resolution")));
}
void get_grid_size_n(int *nx, int *ny, int *nz)
{
vector3 grid_size;
grid_size = get_grid_size();
*nx = (int) grid_size.x;
*ny = (int) grid_size.y;
*nz = (int) grid_size.z;
}
/**************************************************************************/
/* constructors for the geometry types (ugh, wish these
could be automatically generated from geom.scm) */
geometric_object make_geometric_object(material_type material, vector3 center)
{
geometric_object o;
material_type_copy(&material, &o.material);
o.center = center;
o.which_subclass = GEOM GEOMETRIC_OBJECT_SELF;
return o;
}
geometric_object make_cylinder(material_type material, vector3 center,
number radius, number height, vector3 axis)
{
geometric_object o = make_geometric_object(material, center);
o.which_subclass = GEOM CYLINDER;
o.subclass.cylinder_data = MALLOC1(cylinder);
CHECK(o.subclass.cylinder_data, "out of memory");
o.subclass.cylinder_data->radius = radius;
o.subclass.cylinder_data->height = height;
o.subclass.cylinder_data->axis = axis;
o.subclass.cylinder_data->which_subclass = CYL CYLINDER_SELF;
geom_fix_object(o);
return o;
}
geometric_object make_cone(material_type material, vector3 center,
number radius, number height, vector3 axis,
number radius2)
{
geometric_object o = make_cylinder(material, center, radius,height, axis);
o.subclass.cylinder_data->which_subclass = CYL CONE;
o.subclass.cylinder_data->subclass.cone_data = MALLOC1(cone);
CHECK(o.subclass.cylinder_data->subclass.cone_data, "out of memory");
o.subclass.cylinder_data->subclass.cone_data->radius2 = radius2;
return o;
}
geometric_object make_sphere(material_type material, vector3 center,
number radius)
{
geometric_object o = make_geometric_object(material, center);
o.which_subclass = GEOM SPHERE;
o.subclass.sphere_data = MALLOC1(sphere);
CHECK(o.subclass.sphere_data, "out of memory");
o.subclass.sphere_data->radius = radius;
return o;
}
geometric_object make_block(material_type material, vector3 center,
vector3 e1, vector3 e2, vector3 e3,
vector3 size)
{
geometric_object o = make_geometric_object(material, center);
o.which_subclass = GEOM BLOCK;
o.subclass.block_data = MALLOC1(block);
CHECK(o.subclass.block_data, "out of memory");
o.subclass.block_data->e1 = e1;
o.subclass.block_data->e2 = e2;
o.subclass.block_data->e3 = e3;
o.subclass.block_data->size = size;
o.subclass.block_data->which_subclass = BLK BLOCK_SELF;
geom_fix_object(o);
return o;
}
geometric_object make_ellipsoid(material_type material, vector3 center,
vector3 e1, vector3 e2, vector3 e3,
vector3 size)
{
geometric_object o = make_block(material, center, e1,e2,e3, size);
o.subclass.block_data->which_subclass = BLK ELLIPSOID;
o.subclass.block_data->subclass.ellipsoid_data = MALLOC1(ellipsoid);
CHECK(o.subclass.block_data->subclass.ellipsoid_data, "out of memory");
o.subclass.block_data->subclass.ellipsoid_data->inverse_semi_axes.x
= 2.0 / size.x;
o.subclass.block_data->subclass.ellipsoid_data->inverse_semi_axes.y
= 2.0 / size.y;
o.subclass.block_data->subclass.ellipsoid_data->inverse_semi_axes.z
= 2.0 / size.z;
return o;
}
libctl-3.1/utils/Makefile.in 0000644 0001754 0000144 00000061457 11212243177 012771 0000000 0000000 # Makefile.in generated by automake 1.11 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
noinst_PROGRAMS = geomtst$(EXEEXT)
subdir = utils
DIST_COMMON = README $(dist_man_MANS) $(include_HEADERS) \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/gen-ctl-io.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h $(top_builddir)/src/ctl.h
CONFIG_CLEAN_FILES = gen-ctl-io
CONFIG_CLEAN_VPATH_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \
"$(DESTDIR)$(man1dir)" "$(DESTDIR)$(includedir)" \
"$(DESTDIR)$(includedir)"
LTLIBRARIES = $(lib_LTLIBRARIES)
libctlgeom_la_LIBADD =
am_libctlgeom_la_OBJECTS = geom.lo
nodist_libctlgeom_la_OBJECTS = geom-ctl-io.lo
libctlgeom_la_OBJECTS = $(am_libctlgeom_la_OBJECTS) \
$(nodist_libctlgeom_la_OBJECTS)
libctlgeom_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(libctlgeom_la_LDFLAGS) $(LDFLAGS) -o $@
PROGRAMS = $(noinst_PROGRAMS)
am_geomtst_OBJECTS = geomtst.$(OBJEXT)
geomtst_OBJECTS = $(am_geomtst_OBJECTS)
geomtst_DEPENDENCIES = libctlgeom.la $(top_builddir)/src/libctl.la
SCRIPTS = $(bin_SCRIPTS)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/src
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
SOURCES = $(libctlgeom_la_SOURCES) $(nodist_libctlgeom_la_SOURCES) \
$(geomtst_SOURCES)
DIST_SOURCES = $(libctlgeom_la_SOURCES) $(geomtst_SOURCES)
man1dir = $(mandir)/man1
NROFF = nroff
MANS = $(dist_man_MANS)
HEADERS = $(include_HEADERS) $(nodist_include_HEADERS)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
FGREP = @FGREP@
FLIBS = @FLIBS@
GEN_CTL_IO = @GEN_CTL_IO@
GREP = @GREP@
GUILE = @GUILE@
GUILE_CONFIG = @GUILE_CONFIG@
INDENT = @INDENT@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBCTL_DIR = @LIBCTL_DIR@
LIBCTL_VERSION = @LIBCTL_VERSION@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHARED_VERSION_INFO = @SHARED_VERSION_INFO@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
ac_ct_F77 = @ac_ct_F77@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
bin_SCRIPTS = gen-ctl-io
include_HEADERS = ctlgeom.h
nodist_include_HEADERS = ctlgeom-types.h
lib_LTLIBRARIES = libctlgeom.la
EXTRA_DIST = gen-ctl-io.in README geom.scm geom-ctl-io-defaults.c nlopt.c
BUILT_SOURCES = gen-ctl-io geom-ctl-io.c ctl-io.c ctl-io.h ctlgeom-types.h nlopt-constants.scm
libctlgeom_la_SOURCES = geom.c
nodist_libctlgeom_la_SOURCES = geom-ctl-io.c ctl-io.h
libctlgeom_la_LDFLAGS = -version-info @SHARED_VERSION_INFO@ $(top_builddir)/src/libctl.la
geomtst_SOURCES = geomtst.c
geomtst_LDADD = libctlgeom.la $(top_builddir)/src/libctl.la
dist_man_MANS = gen-ctl-io.1
all: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu utils/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu utils/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
gen-ctl-io: $(top_builddir)/config.status $(srcdir)/gen-ctl-io.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
list2=; for p in $$list; do \
if test -f $$p; then \
list2="$$list2 $$p"; \
else :; fi; \
done; \
test -z "$$list2" || { \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
}
uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
for p in $$list; do \
$(am__strip_dir) \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
done
clean-libLTLIBRARIES:
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
test "$$dir" != "$$p" || dir=.; \
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
libctlgeom.la: $(libctlgeom_la_OBJECTS) $(libctlgeom_la_DEPENDENCIES)
$(libctlgeom_la_LINK) -rpath $(libdir) $(libctlgeom_la_OBJECTS) $(libctlgeom_la_LIBADD) $(LIBS)
clean-noinstPROGRAMS:
@list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
echo " rm -f" $$list; \
rm -f $$list || exit $$?; \
test -n "$(EXEEXT)" || exit 0; \
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
echo " rm -f" $$list; \
rm -f $$list
geomtst$(EXEEXT): $(geomtst_OBJECTS) $(geomtst_DEPENDENCIES)
@rm -f geomtst$(EXEEXT)
$(LINK) $(geomtst_OBJECTS) $(geomtst_LDADD) $(LIBS)
install-binSCRIPTS: $(bin_SCRIPTS)
@$(NORMAL_INSTALL)
test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
@list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
done | \
sed -e 'p;s,.*/,,;n' \
-e 'h;s|.*|.|' \
-e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
if ($$2 == $$4) { files[d] = files[d] " " $$1; \
if (++n[d] == $(am__install_max)) { \
print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
else { print "f", d "/" $$4, $$1 } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \
$(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
} \
; done
uninstall-binSCRIPTS:
@$(NORMAL_UNINSTALL)
@list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 's,.*/,,;$(transform)'`; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(bindir)" && rm -f $$files
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geom-ctl-io.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geom.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geomtst.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-man1: $(dist_man_MANS)
@$(NORMAL_INSTALL)
test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
@list=''; test -n "$(man1dir)" || exit 0; \
{ for i in $$list; do echo "$$i"; done; \
l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
sed -n '/\.1[a-z]*$$/p'; \
} | while read p; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; echo "$$p"; \
done | \
sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
sed 'N;N;s,\n, ,g' | { \
list=; while read file base inst; do \
if test "$$base" = "$$inst"; then list="$$list $$file"; else \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
fi; \
done; \
for i in $$list; do echo "$$i"; done | $(am__base_list) | \
while read files; do \
test -z "$$files" || { \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
done; }
uninstall-man1:
@$(NORMAL_UNINSTALL)
@list=''; test -n "$(man1dir)" || exit 0; \
files=`{ for i in $$list; do echo "$$i"; done; \
l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
sed -n '/\.1[a-z]*$$/p'; \
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
test -z "$$files" || { \
echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
install-includeHEADERS: $(include_HEADERS)
@$(NORMAL_INSTALL)
test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
$(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
done
uninstall-includeHEADERS:
@$(NORMAL_UNINSTALL)
@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
test -n "$$files" || exit 0; \
echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(includedir)" && rm -f $$files
install-nodist_includeHEADERS: $(nodist_include_HEADERS)
@$(NORMAL_INSTALL)
test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
@list='$(nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
$(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
done
uninstall-nodist_includeHEADERS:
@$(NORMAL_UNINSTALL)
@list='$(nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
test -n "$$files" || exit 0; \
echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(includedir)" && rm -f $$files
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@list='$(MANS)'; if test -n "$$list"; then \
list=`for p in $$list; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
if test -n "$$list" && \
grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
echo " typically \`make maintainer-clean' will remove them" >&2; \
exit 1; \
else :; fi; \
else :; fi
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) check-am
all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(MANS) \
$(HEADERS)
installdirs:
for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(includedir)" "$(DESTDIR)$(includedir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
clean: clean-am
clean-am: clean-generic clean-libLTLIBRARIES clean-libtool clean-local \
clean-noinstPROGRAMS mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-includeHEADERS install-man \
install-nodist_includeHEADERS
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-binSCRIPTS install-libLTLIBRARIES
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man: install-man1
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-binSCRIPTS uninstall-includeHEADERS \
uninstall-libLTLIBRARIES uninstall-man \
uninstall-nodist_includeHEADERS
uninstall-man: uninstall-man1
.MAKE: all check install install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libLTLIBRARIES clean-libtool clean-local \
clean-noinstPROGRAMS ctags distclean distclean-compile \
distclean-generic distclean-libtool distclean-tags distdir dvi \
dvi-am html html-am info info-am install install-am \
install-binSCRIPTS install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-includeHEADERS install-info \
install-info-am install-libLTLIBRARIES install-man \
install-man1 install-nodist_includeHEADERS install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-binSCRIPTS \
uninstall-includeHEADERS uninstall-libLTLIBRARIES \
uninstall-man uninstall-man1 uninstall-nodist_includeHEADERS
ctl-io.c: geom.scm
$(GEN_CTL_IO) --code -o $@ $(srcdir)/geom.scm $(top_srcdir)
ctl-io.h: geom.scm
$(GEN_CTL_IO) --header -o $@ $(srcdir)/geom.scm $(top_srcdir)
ctlgeom-types.h: ctl-io.h
cp -f ctl-io.h $@
geom-ctl-io.c: ctl-io.c
sed 's,/.* Input variables .*/,@#include "geom-ctl-io-defaults.c"@#if 0@,;s,/.* Output variables .*/,#endif@,' ctl-io.c | tr '@' '\n' > $@
nlopt-constants.scm:
echo "#include " > nlopt-constants.h
echo "; AUTOMATICALLY GENERATED - DO NOT EDIT" > $@
names=`$(CPP) nlopt-constants.h 2>/dev/null | $(EGREP) 'NLOPT_[LG][ND]' | sed 's/ //g;s/_/-/g' |tr = , |cut -d, -f1`; i=0; for n in $$names; do echo "(define $$n $$i)" >> $@; i=`expr $$i + 1`; done
rm nlopt-constants.h
clean-local:
rm -f ctl-io.[ch] geom-ctl-io.c ctlgeom-types.h nlopt-constants.scm
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
libctl-3.1/utils/gen-ctl-io.1 0000644 0001754 0000144 00000005444 10412110653 012727 0000000 0000000 .\" libctl: flexible Guile-based control files for scientific software
.\" Copyright (C) 1998, 1999, 2000, 2001, 2002, Steven G. Johnson
.\"
.\" This library is free software; you can redistribute it and/or
.\" modify it under the terms of the GNU Lesser General Public
.\" License as published by the Free Software Foundation; either
.\" version 2 of the License, or (at your option) any later version.
.\"
.\" This library is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
.\" Lesser General Public License for more details.
.\"
.\" You should have received a copy of the GNU Lesser General Public
.\" License along with this library; if not, write to the
.\" Free Software Foundation, Inc., 59 Temple Place - Suite 330,
.\" Boston, MA 02111-1307, USA.
.\"
.\" Steven G. Johnson can be contacted at stevenj@alum.mit.edu.
.\"
.TH GEN-CTL-IO 1 "March 27, 2006" "libctl" "libctl"
.SH NAME
gen-ctl-io \- generate C interface code for libctl control files
.SH SYNOPSIS
.B gen-ctl-io
[OPTION]... [\fIspec-file\fR]
.SH DESCRIPTION
.PP
." Add any additional description here
.B gen-ctl-io
generates C code to import/export the input/output
variables used in a libctl control file.
.B gen-ctl-io
generates files like \fIctl-io.h\fP and \fIctl-io.c\fP. These files define global variables, data structures, and functions for the input/output variables, classes, and function interfaces defined in the
.I spec-file
argument, automating the interaction between C and Guile.
The arguments such as
.B --code
and
.B --header
are used to control whether \fIctl-io.c\fP or \fIctl-io.h\fP,
etcetera, are generated. If no argument is specified then both of
these files are generated by default, for backwards compatibility.
libctl is a free library to aid in interfacing scientific software
with the GNU Guile scripting and extension language. Documentation
for it may be found online at the libctl home page:
.I http://ab-initio.mit.edu/libctl
.SH OPTIONS
.TP
\fB\--code\fR
Generate C (or C++) source code to implement the Guile interface
functions. The default output file name is ctl-io.c (in C) or
ctl-io.cpp (in C++).
.TP
\fB\--header\fR
Generate the header file declaring the interface data types and
functions. The default output file name is ctl-io.h (in C) or
ctl-io.hpp (in C++).
.TP
\fB\--swig\fR
Generate a SWIG interface definition file declaring automatic conversions
for the various libctl data types. The default output file name is
ctl-io.i.
.TP
\fB\--cxx\fR
Generate C++ code instead of C code.
.TP
\fB\-o\fR \fIfile\fR
Use
.I file
as the output file name instead of the defaults (above).
.SH BUGS
Send bug reports to S. G. Johnson, stevenj@alum.mit.edu.
.SH AUTHORS
Written by Steven G. Johnson.
libctl-3.1/utils/geomtst.c 0000644 0001754 0000144 00000016534 11211317606 012544 0000000 0000000 #include
#include
#include
#include
#include
/************************************************************************/
/* return a random number in [0,1]: */
static double mydrand(void)
{
double d = rand();
return (d / (double) RAND_MAX);
}
/* return a uniform random number in [a,b] */
static double myurand(double a, double b)
{
return ((b - a) * mydrand() + a);
}
#define K_PI 3.141592653589793238462643383279502884197
/* return a random unit vector, uniformly distributed over a sphere */
vector3 random_unit_vector3(void)
{
double z, t, r;
vector3 v;
z = 2*mydrand() - 1;
t = 2*K_PI*mydrand();
r = sqrt(1 - z*z);
v.x = r * cos(t);
v.y = r * sin(t);
v.z = z;
return v;
}
double find_edge(geometric_object o, vector3 dir, double max, double tol)
{
double min = 0;
if (!(point_in_fixed_objectp(vector3_scale(min, dir), o) &&
!point_in_fixed_objectp(vector3_scale(max, dir), o))) {
fprintf(stderr, "object out of bounds in find_edge");
exit(1);
}
do {
double d = (min + max) / 2;
if (point_in_fixed_objectp(vector3_scale(d, dir), o))
min = d;
else
max = d;
} while (max - min > tol);
return (min + max) / 2;
}
static vector3 make_vector3(double x, double y, double z)
{
vector3 v;
v.x = x; v.y = y; v.z = z;
return v;
}
/* return a random geometric object, centered at the origin, with
diameter roughly 1 */
geometric_object random_object(void)
{
material_type m = { 0 };
vector3 c = { 0, 0, 0 };
geometric_object o;
switch (rand() % 5) {
case 0:
o = make_sphere(m, c, myurand(0.5,1.5));
break;
case 1:
o = make_cylinder(m, c, myurand(0.5,1.5), myurand(0.5,1.5),
random_unit_vector3());
break;
case 2:
o = make_cone(m, c, myurand(0.5,1.5), myurand(0.5,1.5),
random_unit_vector3(), myurand(0.5,1.5));
break;
case 3:
o = make_block(m, c,
#if 1
random_unit_vector3(),
random_unit_vector3(),
random_unit_vector3(),
#else
make_vector3(1,0,0),
make_vector3(0,1,0),
make_vector3(0,0,1),
#endif
make_vector3(myurand(0.5,1.5),
myurand(0.5,1.5),
myurand(0.5,1.5)));
break;
case 4:
o = make_ellipsoid(m, c,
random_unit_vector3(),
random_unit_vector3(),
random_unit_vector3(),
make_vector3(myurand(0.5,1.5),
myurand(0.5,1.5),
myurand(0.5,1.5)));
break;
}
return o;
}
/************************************************************************/
static double z1(double x) { return (x == 0 ? 1.0 : x); }
static double simple_overlap(geom_box b, geometric_object o, double tol)
{
double d1,d2,d3, x1,x2,x3, olap0 = 0;
double itol = 1.0 / ((int) (1/tol + 0.5));
d1 = (b.high.x - b.low.x) * itol;
d2 = (b.high.y - b.low.y) * itol;
d3 = (b.high.z - b.low.z) * itol;
for (x1 = b.low.x + d1*0.5; x1 <= b.high.x; x1 += d1+(b.high.x==b.low.x))
for (x2 = b.low.y + d2*0.5; x2 <= b.high.y; x2 += d2+(b.high.y==b.low.y))
for (x3 = b.low.z + d3*0.5; x3 <= b.high.z; x3 += d3+(b.high.z==b.low.z)){
vector3 v;
v.x = x1; v.y = x2; v.z = x3;
olap0 += z1(d1)*z1(d2)*z1(d3) * point_in_fixed_objectp(v, o);
}
olap0 /= z1(b.high.x-b.low.x) * z1(b.high.y-b.low.y) * z1(b.high.z-b.low.z);
return olap0;
}
static double sqr(double x) { return x * x; }
static double simple_ellip_overlap(geom_box b, geometric_object o, double tol)
{
double d1,d2,d3, x1,x2,x3, c1,c2,c3, w1,w2,w3, olap0 = 0;
double itol = 1.0 / ((int) (1/tol + 0.5));
int dim;
d1 = (b.high.x - b.low.x) * itol;
d2 = (b.high.y - b.low.y) * itol;
d3 = (b.high.z - b.low.z) * itol;
c1 = (b.high.x + b.low.x) * 0.5;
c2 = (b.high.y + b.low.y) * 0.5;
c3 = (b.high.z + b.low.z) * 0.5;
w1 = 2.0 / z1(b.high.x - b.low.x);
w2 = 2.0 / z1(b.high.y - b.low.y);
w3 = 2.0 / z1(b.high.z - b.low.z);
for (x1 = b.low.x + d1*0.5; x1 <= b.high.x; x1 += d1+(b.high.x==b.low.x))
for (x2 = b.low.y + d2*0.5; x2 <= b.high.y; x2 += d2+(b.high.y==b.low.y))
for (x3 = b.low.z + d3*0.5; x3 <= b.high.z; x3 += d3+(b.high.z==b.low.z))
if (sqr((x1 - c1) * w1) + sqr((x2 - c2) * w2) + sqr((x3 - c3) * w3)
< 1.0) {
vector3 v;
v.x = x1; v.y = x2; v.z = x3;
olap0 += z1(d1)*z1(d2)*z1(d3) * point_in_fixed_objectp(v, o);
}
olap0 /= z1(b.high.x-b.low.x) * z1(b.high.y-b.low.y) * z1(b.high.z-b.low.z);
dim = (b.high.x!=b.low.x) + (b.high.y!=b.low.y) + (b.high.z!=b.low.z);
olap0 /= dim == 3 ? 3.14159265358979323846 / 6 :
(dim == 2 ? 3.14159265358979323846 / 4 : 1);
return olap0;
}
static void test_overlap(double tol,
number (*box_overlap_with_object)
(geom_box b, geometric_object o,
number tol, integer maxeval),
double (*simple_overlap)
(geom_box b, geometric_object o, double tol))
{
geometric_object o = random_object();
vector3 dir = random_unit_vector3();
geom_box b;
double d, olap, olap0;
int dim;
#if 1
geometry_lattice.basis1 = random_unit_vector3();
geometry_lattice.basis2 = random_unit_vector3();
geometry_lattice.basis3 = random_unit_vector3();
geom_fix_lattice();
geom_fix_object(o);
#endif
b.low = make_vector3(myurand(-1,0), myurand(-1,0), myurand(-1,0));
b.high = make_vector3(myurand(0,1), myurand(0,1), myurand(0,1));
d = find_edge(o, dir, 10, tol);
b.low = vector3_plus(b.low, vector3_scale(d, dir));
b.high = vector3_plus(b.high, vector3_scale(d, dir));
dim = rand() % 3 + 1;
if (dim < 3)
b.low.z = b.high.z = 0;
if (dim < 2)
b.low.y = b.high.y = 0;
olap = box_overlap_with_object(b, o, tol/100, 10000/tol);
olap0 = simple_overlap(b, o, tol/2);
if (fabs(olap0 - olap) > 2 * tol * fabs(olap)) {
fprintf(stderr, "Large error %e in overlap (%g vs. %g) for:\n"
" lattice = (%g,%g,%g), (%g,%g,%g), (%g,%g,%g)\n"
" box = (%g,%g,%g) - (%g,%g,%g)\n",
fabs(olap0 - olap) / fabs(olap),
olap, olap0,
geometry_lattice.basis1.x,
geometry_lattice.basis1.y,
geometry_lattice.basis1.z,
geometry_lattice.basis2.x,
geometry_lattice.basis2.y,
geometry_lattice.basis2.z,
geometry_lattice.basis3.x,
geometry_lattice.basis3.y,
geometry_lattice.basis3.z,
b.low.x, b.low.y, b.low.z,
b.high.x, b.high.y, b.high.z);
display_geometric_object_info(2, o);
#if 1
while (1) {
tol /= sqrt(2.0);
fprintf(stderr, "olap = %g, olap0 = %g (with tol = %e)\n",
box_overlap_with_object(b, o, tol/100, 10000/tol),
simple_overlap(b, o, tol/2), tol);
}
#endif
exit(1);
}
else
printf("Got %dd overlap %g vs. %g with tol = %e\n",
dim,olap,olap0,tol);
geometric_object_destroy(o);
}
/************************************************************************/
int main(void)
{
const int ntest = 100;
const double tol = 1e-2;
int i;
srand(time(NULL));
geom_initialize();
for (i = 0; i < ntest; ++i) {
printf("**** box overlap: ****\n");
test_overlap(tol,
box_overlap_with_object,
simple_overlap);
printf("**** ellipsoid overlap: ****\n");
test_overlap(tol,
ellipsoid_overlap_with_object,
simple_ellip_overlap);
}
return 0;
}
libctl-3.1/utils/gen-ctl-io.in 0000744 0001754 0000144 00000014073 11211615025 013175 0000000 0000000 #!/bin/sh
# libctl: flexible Guile-based control files for scientific software
# Copyright (C) 1998, 1999, 2000, 2001, 2002, Steven G. Johnson
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
#
# Steven G. Johnson can be contacted at stevenj@alum.mit.edu.
code=false
header=false
cxx=false
swig=false
output_file=""
while test $# -ge 1; do
case $1 in
-o) shift; output_file=$1 ;;
--cxx) cxx=true ;;
--code) code=true; header=false; swig=false ;;
--header) header=true; code=false; swig=false ;;
--swig) swig=true; header=false; code=false ;;
*) break;;
esac
shift
done
if test $code = true; then
if test $cxx = true; then
default_output_file=ctl-io.cpp
else
default_output_file=ctl-io.c
fi
elif test $header = true; then
if test $cxx = true; then
default_output_file=ctl-io.hpp
else
default_output_file=ctl-io.h
fi
elif test $swig = true; then
default_output_file=ctl-io.i
else
# No output specified. Backwards compatibility mode (code + header output).
$0 --header $*
$0 --code $*
exit 0
fi
if test "x$output_file" = x; then
output_file=$default_output_file
fi
spec_file=$1
if test ! -f "$spec_file"; then
echo "cannot read specification file $spec_file"
exit 1
fi
if test "$#" = "2"; then
libctl_dir="$2"
else
prefix="@prefix@"
datarootdir="@datarootdir@"
libctl_dir="@datadir@/libctl"
fi
case $libctl_dir in .*) libctl_dir=`pwd`/$libctl_dir ;; esac
if test ! -r $libctl_dir/utils/ctl-io.scm; then
echo "couldn't find $libctl_dir/utils/ctl-io.scm"
exit 1
fi
ok=yes
###########################################################################
if test $header = true; then
rm -f $output_file
cat > $output_file <
#include
EOF
if test $cxx = true; then
cat >> $output_file <> $output_file <> $output_file
(@GUILE@ -l $libctl_dir/base/include.scm \
-c "(include "'"'"$libctl_dir/base/ctl.scm"'"'") (include "'"'"$libctl_dir/utils/ctl-io.scm"'"'") (set"'!'" cxx $cxx) (include "'"'"$spec_file"'"'") (output-header)" >> $output_file) || ok=no
if test $ok = no; then rm -f $output_file; exit 1; fi
echo >> $output_file
if test $cxx = true; then
cat >> $output_file <> $output_file <> $output_file < /dev/null 2>&1
rm -f ${output_file}~ ${output_file}.BAK
fi
fi # header = true
###########################################################################
if test $code = true; then
rm -f $output_file
cat > $output_file <
#include
#include
#include "ctl-io.h"
#ifdef CXX_CTL_IO
using namespace ctlio;
#endif
EOF
(@GUILE@ -l $libctl_dir/base/include.scm \
-c "(include "'"'"$libctl_dir/base/ctl.scm"'"'") (include "'"'"$libctl_dir/utils/ctl-io.scm"'"'") (set"'!'" cxx $cxx) (include "'"'"$spec_file"'"'") (output-source)" >> $output_file) || ok=no
if test $ok = no; then rm -f $output_file; exit 1; fi
if test $cxx = false; then
@INDENT@ $output_file > /dev/null 2>&1
rm -f ${output_file}~ ${output_file}.BAK
fi
fi # code = true
###########################################################################
if test $swig = true; then
cat > $output_file <> $output_file) || ok=no
if test $ok = no; then rm -f $output_file; exit 1; fi
cat >> $output_file <