mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Starting Eigen 2 development. The current plan is to use the last
release of tvmet (inactive for 2 years and developer unreachable) as the basis for eigen2, because it provides seemingly good expression template mechanisms, we want that, and it would take years to reinvent that wheel. We'll see. So this commit imports the last tvmet release.
This commit is contained in:
1120
tvmet-1.7.1/doc/Doxyfile.in
Normal file
1120
tvmet-1.7.1/doc/Doxyfile.in
Normal file
File diff suppressed because it is too large
Load Diff
218
tvmet-1.7.1/doc/Makefile.am
Normal file
218
tvmet-1.7.1/doc/Makefile.am
Normal file
@@ -0,0 +1,218 @@
|
||||
# $Id: Makefile.am,v 1.22 2004/09/16 08:12:13 opetzold Exp $
|
||||
|
||||
AM_CXXFLAGS = -O \
|
||||
-I@top_srcdir@/include -I@top_builddir@/include
|
||||
|
||||
DOXY_DOC = \
|
||||
benchmark.dox \
|
||||
build.dox \
|
||||
compiler.dox \
|
||||
faq.dox \
|
||||
intro.dox \
|
||||
license.dox \
|
||||
links.dox \
|
||||
misc.dox \
|
||||
notes.dox \
|
||||
projects.dox \
|
||||
usage.dox \
|
||||
works.dox
|
||||
|
||||
HTML_MISC = \
|
||||
tvmet.css \
|
||||
header.html footer.html.in
|
||||
|
||||
LTEX_MISC = \
|
||||
tvmet.sty.in
|
||||
|
||||
BENCH_FIG = \
|
||||
axpy.png \
|
||||
matrix_matrix.png \
|
||||
matrix_vector.png \
|
||||
aat.png \
|
||||
ata.png
|
||||
|
||||
EXTRA_DIST = \
|
||||
$(DOXY_DOC) \
|
||||
$(HTML_MISC) \
|
||||
$(LTEX_MISC) \
|
||||
$(BENCH_FIG)
|
||||
|
||||
DISTCLEANFILES = \
|
||||
Doxyfile doxygen-warning \
|
||||
footer.html tvmet.sty
|
||||
|
||||
# some depencies
|
||||
Doxyfile: Doxyfile.in
|
||||
footer.html: footer.html.in
|
||||
tvmet.sty: tvmet.sty.in
|
||||
|
||||
# non-install programs for generating doxygen files
|
||||
noinst_PROGRAMS = dox_operators dox_functions
|
||||
dox_operators_SOURCES = dox_operators.cc Util.h
|
||||
dox_functions_SOURCES = dox_functions.cc Util.h
|
||||
|
||||
#
|
||||
# rules for documentation, if ordered
|
||||
#
|
||||
if CONFIG_DOC
|
||||
|
||||
#
|
||||
# file created on the fly
|
||||
#
|
||||
DOXY_BUILD = \
|
||||
changelog.dox \
|
||||
news.dox \
|
||||
credits.dox \
|
||||
install.dox \
|
||||
operators.dox \
|
||||
functions.dox
|
||||
|
||||
DOXY_HTML_SRC = \
|
||||
$(DOXY_DOC) \
|
||||
$(DOXY_BUILD) \
|
||||
$(patsubst %.in, %, $(HTML_MISC))
|
||||
|
||||
DOXY_LTEX_SRC = \
|
||||
$(patsubst %.in, %, $(LTEX_MISC))
|
||||
|
||||
# file creating rules; not needed every time
|
||||
operators.dox: dox_operators
|
||||
./dox_operators > operators.dox
|
||||
|
||||
functions.dox: dox_functions
|
||||
./dox_functions > functions.dox
|
||||
|
||||
# file creating rules
|
||||
changelog.dox: @top_srcdir@/ChangeLog
|
||||
@echo "/** \page changelog ChangeLog" > $@
|
||||
@echo "\verbatim" >> $@
|
||||
cat $< >> $@
|
||||
@echo "\endverbatim" >> $@
|
||||
@echo "*/" >> $@
|
||||
|
||||
news.dox: @top_srcdir@/NEWS
|
||||
@echo "/** \page news News" > $@
|
||||
@echo "\verbatim" >> $@
|
||||
cat $< >> $@
|
||||
@echo "\endverbatim" >> $@
|
||||
@echo "*/" >> $@
|
||||
|
||||
credits.dox: @top_srcdir@/THANKS
|
||||
@echo "/** \page credits Credits" > $@
|
||||
@echo "\verbatim" >> $@
|
||||
cat $< >> $@
|
||||
@echo "\endverbatim" >> $@
|
||||
@echo "*/" >> $@
|
||||
|
||||
install.dox: @top_srcdir@/INSTALL
|
||||
@echo "/** \page basic_install INSTALL" > $@
|
||||
@echo "\verbatim" >> $@
|
||||
cat $< >> $@
|
||||
@echo "\endverbatim" >> $@
|
||||
@echo "*/" >> $@
|
||||
|
||||
|
||||
#
|
||||
# doxygen API
|
||||
#
|
||||
DOC_API_PDF = $(PACKAGE)-$(VERSION).pdf
|
||||
|
||||
all-local: doxygen-api
|
||||
|
||||
# need's LaTeX style, since we use an own style for LaTeX
|
||||
# which is required for generating formulas in HTML too.
|
||||
# Doxygen LaTeX batchmode doesn't solves the problem right here.
|
||||
doxygen-html-dir:
|
||||
@if test ! -d ./html; then mkdir ./html; fi
|
||||
|
||||
doxygen-api: doxygen-html-dir Doxyfile $(DOXY_HTML_SRC)
|
||||
@echo "Making HTML manual"
|
||||
@cp @builddir@/tvmet.sty ./html/
|
||||
@DOXYGEN@ $(DOXYGEN_OPTS)
|
||||
@$(RM) -f ./html/tvmet.sty
|
||||
|
||||
#
|
||||
# doxygen LaTeX API
|
||||
#
|
||||
TEXINPUTS_PATH=$(TEXINPUTS):$(top_builddir)
|
||||
|
||||
noinst_DATA = $(DOC_API_PDF)
|
||||
|
||||
all-local: $(noinst_DATA)
|
||||
|
||||
dvi-local:
|
||||
ps-local:
|
||||
pdf-local: $(DOC_API_PDF)
|
||||
|
||||
$(DOC_API_PDF): Doxyfile $(DOXY_LTEX_SRC)
|
||||
@if test -d ./latex; then \
|
||||
echo "Making PDF manual"; \
|
||||
if test -f $@; then \
|
||||
$(RM) $@; \
|
||||
fi; \
|
||||
TEXINPUTS=$(TEXINPUTS_PATH) $(MAKE) -C ./latex refman.pdf; \
|
||||
$(LN_S) ./latex/refman.pdf $@; \
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# misc hooks
|
||||
#
|
||||
distclean-local:
|
||||
@rm -f $(DOXY_BUILD)
|
||||
@if test -f $(DOC_API_PDF); then \
|
||||
$(RM) -f $(DOC_API_PDF); \
|
||||
fi
|
||||
@if test -d html; then \
|
||||
$(RM) -rf html; \
|
||||
fi
|
||||
@if test -d latex; then \
|
||||
$(RM) -rf latex; \
|
||||
fi
|
||||
@if test -d rtf; then \
|
||||
$(RM) -rf rtf; \
|
||||
fi
|
||||
@if test -d man; then \
|
||||
$(RM) -rf man; \
|
||||
fi
|
||||
|
||||
doc-dist: doxygen-api
|
||||
echo "please wait while archiving the html docs."; \
|
||||
tar cf - -C ./html . | bzip2 --best -c > $(PACKAGE)-docs-$(VERSION).tar.bz2
|
||||
|
||||
# where to install all html documents
|
||||
TVMET_DOC_DIR = $(datadir)/doc/$(PACKAGE)-$(VERSION)
|
||||
|
||||
# Automake's "distcheck" is sensitive to having files left over
|
||||
# after "make uninstall", so we have to clean up the install hook.
|
||||
uninstall-local:
|
||||
@if test -d $(TVMET_DOC_DIR); then \
|
||||
rm -rf $(TVMET_DOC_DIR); \
|
||||
fi
|
||||
|
||||
# Install hooks
|
||||
make-install-dirs:
|
||||
@if test '!' -d $(TVMET_DOC_DIR); then \
|
||||
$(mkinstalldirs) $(TVMET_DOC_DIR); \
|
||||
fi
|
||||
|
||||
install-data-hook: make-install-dirs
|
||||
@echo Installing documentations into $(TVMET_DOC_DIR)
|
||||
@echo "install html"
|
||||
@$(INSTALL_DATA) @top_builddir@/doc/html/* $(TVMET_DOC_DIR)
|
||||
|
||||
else
|
||||
doc-dist:
|
||||
install-data-hook:
|
||||
endif # CONFIG_DOC
|
||||
|
||||
|
||||
# --------------------------------------------------------
|
||||
# in progress:
|
||||
# make refman twoside
|
||||
twoside:
|
||||
class=`cat latex/refman.tex | grep documentclass`
|
||||
newclass=`echo $$class | sed -e 's/twoside,//' -e 's/\[/\[twoside,/'`
|
||||
@echo "class:" $$class
|
||||
@echo "newclass:" $$newclass
|
||||
cat latex/refman.tex | sed 's/$$class/$$newclass/' >foo
|
||||
687
tvmet-1.7.1/doc/Makefile.in
Normal file
687
tvmet-1.7.1/doc/Makefile.in
Normal file
@@ -0,0 +1,687 @@
|
||||
# Makefile.in generated by automake 1.8.3 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004 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@
|
||||
|
||||
# $Id: Makefile.am,v 1.22 2004/09/16 08:12:13 opetzold Exp $
|
||||
|
||||
|
||||
SOURCES = $(dox_functions_SOURCES) $(dox_operators_SOURCES)
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = ..
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = @INSTALL@
|
||||
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 = :
|
||||
host_triplet = @host@
|
||||
noinst_PROGRAMS = dox_operators$(EXEEXT) dox_functions$(EXEEXT)
|
||||
subdir = doc
|
||||
DIST_COMMON = $(srcdir)/Doxyfile.in $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in $(srcdir)/footer.html.in \
|
||||
$(srcdir)/tvmet.sty.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/config/ac_c_long_long.m4 \
|
||||
$(top_srcdir)/config/ac_create_prefix_config_h.m4 \
|
||||
$(top_srcdir)/config/ac_cxx_have_complex.m4 \
|
||||
$(top_srcdir)/config/ac_cxx_have_complex_math1.m4 \
|
||||
$(top_srcdir)/config/ac_cxx_have_complex_math2.m4 \
|
||||
$(top_srcdir)/config/ac_cxx_have_ieee_math.m4 \
|
||||
$(top_srcdir)/config/ac_cxx_have_mutable.m4 \
|
||||
$(top_srcdir)/config/ac_cxx_have_namespaces.m4 \
|
||||
$(top_srcdir)/config/ac_cxx_have_sysv_math.m4 \
|
||||
$(top_srcdir)/config/ac_cxx_partial_specialization.m4 \
|
||||
$(top_srcdir)/config/ac_cxx_typename.m4 \
|
||||
$(top_srcdir)/config/ac_set_compiler.m4 \
|
||||
$(top_srcdir)/config/op_doxygen_doc.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(mkdir_p)
|
||||
CONFIG_HEADER = $(top_builddir)/config/config.h
|
||||
CONFIG_CLEAN_FILES = Doxyfile footer.html tvmet.sty
|
||||
PROGRAMS = $(noinst_PROGRAMS)
|
||||
am_dox_functions_OBJECTS = dox_functions.$(OBJEXT)
|
||||
dox_functions_OBJECTS = $(am_dox_functions_OBJECTS)
|
||||
dox_functions_LDADD = $(LDADD)
|
||||
am_dox_operators_OBJECTS = dox_operators.$(OBJEXT)
|
||||
dox_operators_OBJECTS = $(am_dox_operators_OBJECTS)
|
||||
dox_operators_LDADD = $(LDADD)
|
||||
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/config
|
||||
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/dox_functions.Po \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/dox_operators.Po
|
||||
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
|
||||
LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \
|
||||
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(AM_CXXFLAGS) $(CXXFLAGS)
|
||||
CXXLD = $(CXX)
|
||||
CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \
|
||||
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
SOURCES = $(dox_functions_SOURCES) $(dox_operators_SOURCES)
|
||||
DIST_SOURCES = $(dox_functions_SOURCES) $(dox_operators_SOURCES)
|
||||
DATA = $(noinst_DATA)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CONFIG_CPPUNIT_FALSE = @CONFIG_CPPUNIT_FALSE@
|
||||
CONFIG_CPPUNIT_TRUE = @CONFIG_CPPUNIT_TRUE@
|
||||
CONFIG_DOC_FALSE = @CONFIG_DOC_FALSE@
|
||||
CONFIG_DOC_TRUE = @CONFIG_DOC_TRUE@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
|
||||
CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
|
||||
CPPUNIT_LIBS = @CPPUNIT_LIBS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CXX_DEBUG_FLAGS = @CXX_DEBUG_FLAGS@
|
||||
CXX_OPTIMIZE_FLAGS = @CXX_OPTIMIZE_FLAGS@
|
||||
CXX_WARN_FLAGS = @CXX_WARN_FLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DOXYGEN = @DOXYGEN@
|
||||
DOXYGEN_HAVE_DOT = @DOXYGEN_HAVE_DOT@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LATEX_BATCHMODE = @LATEX_BATCHMODE@
|
||||
LATEX_MODE = @LATEX_MODE@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
|
||||
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJEXT = @OBJEXT@
|
||||
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@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
datadir = @datadir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
AM_CXXFLAGS = -O \
|
||||
-I@top_srcdir@/include -I@top_builddir@/include
|
||||
|
||||
DOXY_DOC = \
|
||||
benchmark.dox \
|
||||
build.dox \
|
||||
compiler.dox \
|
||||
faq.dox \
|
||||
intro.dox \
|
||||
license.dox \
|
||||
links.dox \
|
||||
misc.dox \
|
||||
notes.dox \
|
||||
projects.dox \
|
||||
usage.dox \
|
||||
works.dox
|
||||
|
||||
HTML_MISC = \
|
||||
tvmet.css \
|
||||
header.html footer.html.in
|
||||
|
||||
LTEX_MISC = \
|
||||
tvmet.sty.in
|
||||
|
||||
BENCH_FIG = \
|
||||
axpy.png \
|
||||
matrix_matrix.png \
|
||||
matrix_vector.png \
|
||||
aat.png \
|
||||
ata.png
|
||||
|
||||
EXTRA_DIST = \
|
||||
$(DOXY_DOC) \
|
||||
$(HTML_MISC) \
|
||||
$(LTEX_MISC) \
|
||||
$(BENCH_FIG)
|
||||
|
||||
DISTCLEANFILES = \
|
||||
Doxyfile doxygen-warning \
|
||||
footer.html tvmet.sty
|
||||
|
||||
dox_operators_SOURCES = dox_operators.cc Util.h
|
||||
dox_functions_SOURCES = dox_functions.cc Util.h
|
||||
|
||||
#
|
||||
# rules for documentation, if ordered
|
||||
#
|
||||
|
||||
#
|
||||
# file created on the fly
|
||||
#
|
||||
@CONFIG_DOC_TRUE@DOXY_BUILD = \
|
||||
@CONFIG_DOC_TRUE@ changelog.dox \
|
||||
@CONFIG_DOC_TRUE@ news.dox \
|
||||
@CONFIG_DOC_TRUE@ credits.dox \
|
||||
@CONFIG_DOC_TRUE@ install.dox \
|
||||
@CONFIG_DOC_TRUE@ operators.dox \
|
||||
@CONFIG_DOC_TRUE@ functions.dox
|
||||
|
||||
@CONFIG_DOC_TRUE@DOXY_HTML_SRC = \
|
||||
@CONFIG_DOC_TRUE@ $(DOXY_DOC) \
|
||||
@CONFIG_DOC_TRUE@ $(DOXY_BUILD) \
|
||||
@CONFIG_DOC_TRUE@ $(patsubst %.in, %, $(HTML_MISC))
|
||||
|
||||
@CONFIG_DOC_TRUE@DOXY_LTEX_SRC = \
|
||||
@CONFIG_DOC_TRUE@ $(patsubst %.in, %, $(LTEX_MISC))
|
||||
|
||||
|
||||
#
|
||||
# doxygen API
|
||||
#
|
||||
@CONFIG_DOC_TRUE@DOC_API_PDF = $(PACKAGE)-$(VERSION).pdf
|
||||
|
||||
#
|
||||
# doxygen LaTeX API
|
||||
#
|
||||
@CONFIG_DOC_TRUE@TEXINPUTS_PATH = $(TEXINPUTS):$(top_builddir)
|
||||
@CONFIG_DOC_TRUE@noinst_DATA = $(DOC_API_PDF)
|
||||
|
||||
# where to install all html documents
|
||||
@CONFIG_DOC_TRUE@TVMET_DOC_DIR = $(datadir)/doc/$(PACKAGE)-$(VERSION)
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .cc .lo .o .obj
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu doc/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
Doxyfile: $(top_builddir)/config.status $(srcdir)/Doxyfile.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
footer.html: $(top_builddir)/config.status $(srcdir)/footer.html.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
tvmet.sty: $(top_builddir)/config.status $(srcdir)/tvmet.sty.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
|
||||
clean-noinstPROGRAMS:
|
||||
@list='$(noinst_PROGRAMS)'; for p in $$list; do \
|
||||
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
|
||||
echo " rm -f $$p $$f"; \
|
||||
rm -f $$p $$f ; \
|
||||
done
|
||||
dox_functions$(EXEEXT): $(dox_functions_OBJECTS) $(dox_functions_DEPENDENCIES)
|
||||
@rm -f dox_functions$(EXEEXT)
|
||||
$(CXXLINK) $(dox_functions_LDFLAGS) $(dox_functions_OBJECTS) $(dox_functions_LDADD) $(LIBS)
|
||||
dox_operators$(EXEEXT): $(dox_operators_OBJECTS) $(dox_operators_DEPENDENCIES)
|
||||
@rm -f dox_operators$(EXEEXT)
|
||||
$(CXXLINK) $(dox_operators_LDFLAGS) $(dox_operators_OBJECTS) $(dox_operators_LDADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dox_functions.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dox_operators.Po@am__quote@
|
||||
|
||||
.cc.o:
|
||||
@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
|
||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
|
||||
|
||||
.cc.obj:
|
||||
@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
|
||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
|
||||
.cc.lo:
|
||||
@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
|
||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
-rm -f libtool
|
||||
uninstall-info-am:
|
||||
|
||||
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; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
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; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|
||||
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
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; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& 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)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkdir_p) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$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: check-am
|
||||
all-am: Makefile $(PROGRAMS) $(DATA) all-local
|
||||
installdirs:
|
||||
install: 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:
|
||||
-rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
|
||||
mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-libtool distclean-local distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am: dvi-local
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
@$(NORMAL_INSTALL)
|
||||
$(MAKE) $(AM_MAKEFLAGS) install-data-hook
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
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: pdf-local
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am: ps-local
|
||||
|
||||
uninstall-am: uninstall-info-am uninstall-local
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am all-local check check-am clean \
|
||||
clean-generic clean-libtool clean-noinstPROGRAMS ctags \
|
||||
distclean distclean-compile distclean-generic \
|
||||
distclean-libtool distclean-local distclean-tags distdir dvi \
|
||||
dvi-am dvi-local html html-am info info-am install install-am \
|
||||
install-data install-data-am install-exec install-exec-am \
|
||||
install-info install-info-am install-man install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am pdf-local \
|
||||
ps ps-am ps-local tags uninstall uninstall-am \
|
||||
uninstall-info-am uninstall-local
|
||||
|
||||
|
||||
# some depencies
|
||||
Doxyfile: Doxyfile.in
|
||||
footer.html: footer.html.in
|
||||
tvmet.sty: tvmet.sty.in
|
||||
|
||||
# file creating rules; not needed every time
|
||||
@CONFIG_DOC_TRUE@operators.dox: dox_operators
|
||||
@CONFIG_DOC_TRUE@ ./dox_operators > operators.dox
|
||||
|
||||
@CONFIG_DOC_TRUE@functions.dox: dox_functions
|
||||
@CONFIG_DOC_TRUE@ ./dox_functions > functions.dox
|
||||
|
||||
# file creating rules
|
||||
@CONFIG_DOC_TRUE@changelog.dox: @top_srcdir@/ChangeLog
|
||||
@CONFIG_DOC_TRUE@ @echo "/** \page changelog ChangeLog" > $@
|
||||
@CONFIG_DOC_TRUE@ @echo "\verbatim" >> $@
|
||||
@CONFIG_DOC_TRUE@ cat $< >> $@
|
||||
@CONFIG_DOC_TRUE@ @echo "\endverbatim" >> $@
|
||||
@CONFIG_DOC_TRUE@ @echo "*/" >> $@
|
||||
|
||||
@CONFIG_DOC_TRUE@news.dox: @top_srcdir@/NEWS
|
||||
@CONFIG_DOC_TRUE@ @echo "/** \page news News" > $@
|
||||
@CONFIG_DOC_TRUE@ @echo "\verbatim" >> $@
|
||||
@CONFIG_DOC_TRUE@ cat $< >> $@
|
||||
@CONFIG_DOC_TRUE@ @echo "\endverbatim" >> $@
|
||||
@CONFIG_DOC_TRUE@ @echo "*/" >> $@
|
||||
|
||||
@CONFIG_DOC_TRUE@credits.dox: @top_srcdir@/THANKS
|
||||
@CONFIG_DOC_TRUE@ @echo "/** \page credits Credits" > $@
|
||||
@CONFIG_DOC_TRUE@ @echo "\verbatim" >> $@
|
||||
@CONFIG_DOC_TRUE@ cat $< >> $@
|
||||
@CONFIG_DOC_TRUE@ @echo "\endverbatim" >> $@
|
||||
@CONFIG_DOC_TRUE@ @echo "*/" >> $@
|
||||
|
||||
@CONFIG_DOC_TRUE@install.dox: @top_srcdir@/INSTALL
|
||||
@CONFIG_DOC_TRUE@ @echo "/** \page basic_install INSTALL" > $@
|
||||
@CONFIG_DOC_TRUE@ @echo "\verbatim" >> $@
|
||||
@CONFIG_DOC_TRUE@ cat $< >> $@
|
||||
@CONFIG_DOC_TRUE@ @echo "\endverbatim" >> $@
|
||||
@CONFIG_DOC_TRUE@ @echo "*/" >> $@
|
||||
|
||||
@CONFIG_DOC_TRUE@all-local: doxygen-api
|
||||
|
||||
# need's LaTeX style, since we use an own style for LaTeX
|
||||
# which is required for generating formulas in HTML too.
|
||||
# Doxygen LaTeX batchmode doesn't solves the problem right here.
|
||||
@CONFIG_DOC_TRUE@doxygen-html-dir:
|
||||
@CONFIG_DOC_TRUE@ @if test ! -d ./html; then mkdir ./html; fi
|
||||
|
||||
@CONFIG_DOC_TRUE@doxygen-api: doxygen-html-dir Doxyfile $(DOXY_HTML_SRC)
|
||||
@CONFIG_DOC_TRUE@ @echo "Making HTML manual"
|
||||
@CONFIG_DOC_TRUE@ @cp @builddir@/tvmet.sty ./html/
|
||||
@CONFIG_DOC_TRUE@ @DOXYGEN@ $(DOXYGEN_OPTS)
|
||||
@CONFIG_DOC_TRUE@ @$(RM) -f ./html/tvmet.sty
|
||||
|
||||
@CONFIG_DOC_TRUE@all-local: $(noinst_DATA)
|
||||
|
||||
@CONFIG_DOC_TRUE@dvi-local:
|
||||
@CONFIG_DOC_TRUE@ps-local:
|
||||
@CONFIG_DOC_TRUE@pdf-local: $(DOC_API_PDF)
|
||||
|
||||
@CONFIG_DOC_TRUE@$(DOC_API_PDF): Doxyfile $(DOXY_LTEX_SRC)
|
||||
@CONFIG_DOC_TRUE@ @if test -d ./latex; then \
|
||||
@CONFIG_DOC_TRUE@ echo "Making PDF manual"; \
|
||||
@CONFIG_DOC_TRUE@ if test -f $@; then \
|
||||
@CONFIG_DOC_TRUE@ $(RM) $@; \
|
||||
@CONFIG_DOC_TRUE@ fi; \
|
||||
@CONFIG_DOC_TRUE@ TEXINPUTS=$(TEXINPUTS_PATH) $(MAKE) -C ./latex refman.pdf; \
|
||||
@CONFIG_DOC_TRUE@ $(LN_S) ./latex/refman.pdf $@; \
|
||||
@CONFIG_DOC_TRUE@ fi
|
||||
|
||||
#
|
||||
# misc hooks
|
||||
#
|
||||
@CONFIG_DOC_TRUE@distclean-local:
|
||||
@CONFIG_DOC_TRUE@ @rm -f $(DOXY_BUILD)
|
||||
@CONFIG_DOC_TRUE@ @if test -f $(DOC_API_PDF); then \
|
||||
@CONFIG_DOC_TRUE@ $(RM) -f $(DOC_API_PDF); \
|
||||
@CONFIG_DOC_TRUE@ fi
|
||||
@CONFIG_DOC_TRUE@ @if test -d html; then \
|
||||
@CONFIG_DOC_TRUE@ $(RM) -rf html; \
|
||||
@CONFIG_DOC_TRUE@ fi
|
||||
@CONFIG_DOC_TRUE@ @if test -d latex; then \
|
||||
@CONFIG_DOC_TRUE@ $(RM) -rf latex; \
|
||||
@CONFIG_DOC_TRUE@ fi
|
||||
@CONFIG_DOC_TRUE@ @if test -d rtf; then \
|
||||
@CONFIG_DOC_TRUE@ $(RM) -rf rtf; \
|
||||
@CONFIG_DOC_TRUE@ fi
|
||||
@CONFIG_DOC_TRUE@ @if test -d man; then \
|
||||
@CONFIG_DOC_TRUE@ $(RM) -rf man; \
|
||||
@CONFIG_DOC_TRUE@ fi
|
||||
|
||||
@CONFIG_DOC_TRUE@doc-dist: doxygen-api
|
||||
@CONFIG_DOC_TRUE@ echo "please wait while archiving the html docs."; \
|
||||
@CONFIG_DOC_TRUE@ tar cf - -C ./html . | bzip2 --best -c > $(PACKAGE)-docs-$(VERSION).tar.bz2
|
||||
|
||||
# Automake's "distcheck" is sensitive to having files left over
|
||||
# after "make uninstall", so we have to clean up the install hook.
|
||||
@CONFIG_DOC_TRUE@uninstall-local:
|
||||
@CONFIG_DOC_TRUE@ @if test -d $(TVMET_DOC_DIR); then \
|
||||
@CONFIG_DOC_TRUE@ rm -rf $(TVMET_DOC_DIR); \
|
||||
@CONFIG_DOC_TRUE@ fi
|
||||
|
||||
# Install hooks
|
||||
@CONFIG_DOC_TRUE@make-install-dirs:
|
||||
@CONFIG_DOC_TRUE@ @if test '!' -d $(TVMET_DOC_DIR); then \
|
||||
@CONFIG_DOC_TRUE@ $(mkinstalldirs) $(TVMET_DOC_DIR); \
|
||||
@CONFIG_DOC_TRUE@ fi
|
||||
|
||||
@CONFIG_DOC_TRUE@install-data-hook: make-install-dirs
|
||||
@CONFIG_DOC_TRUE@ @echo Installing documentations into $(TVMET_DOC_DIR)
|
||||
@CONFIG_DOC_TRUE@ @echo "install html"
|
||||
@CONFIG_DOC_TRUE@ @$(INSTALL_DATA) @top_builddir@/doc/html/* $(TVMET_DOC_DIR)
|
||||
|
||||
@CONFIG_DOC_FALSE@doc-dist:
|
||||
@CONFIG_DOC_FALSE@install-data-hook:
|
||||
|
||||
# --------------------------------------------------------
|
||||
# in progress:
|
||||
# make refman twoside
|
||||
twoside:
|
||||
class=`cat latex/refman.tex | grep documentclass`
|
||||
newclass=`echo $$class | sed -e 's/twoside,//' -e 's/\[/\[twoside,/'`
|
||||
@echo "class:" $$class
|
||||
@echo "newclass:" $$newclass
|
||||
cat latex/refman.tex | sed 's/$$class/$$newclass/' >foo
|
||||
# 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:
|
||||
202
tvmet-1.7.1/doc/Util.h
Normal file
202
tvmet-1.7.1/doc/Util.h
Normal file
@@ -0,0 +1,202 @@
|
||||
/*
|
||||
* Tiny Vector Matrix Library
|
||||
* Dense Vector Matrix Libary of Tiny size using Expression Templates
|
||||
*
|
||||
* Copyright (C) 2001 - 2003 Olaf Petzold <opetzold@users.sourceforge.net>
|
||||
*
|
||||
* 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.1 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
|
||||
*
|
||||
* $Id: Util.h,v 1.5 2003/12/19 18:01:37 opetzold Exp $
|
||||
*/
|
||||
|
||||
#ifndef TVMET_DOC_UTIL_H
|
||||
#define TVMET_DOC_UTIL_H
|
||||
|
||||
#include <vector>
|
||||
#include <tvmet/config.h>
|
||||
|
||||
struct Function {
|
||||
Function() { }
|
||||
virtual ~Function() { }
|
||||
virtual const char* name() const = 0;
|
||||
virtual const char* description() const = 0;
|
||||
virtual bool int_only() const = 0;
|
||||
static const char* group() { return "_function"; }
|
||||
static const char* group_unary() { return "_unary_function"; }
|
||||
static const char* group_binary() { return "_binary_function"; }
|
||||
template<class Stream> static Stream& doxy_groups(Stream& os) {
|
||||
os << "/**\n"
|
||||
<< " * \\defgroup " << group() << " Global Functions\n"
|
||||
<< " */\n\n";
|
||||
os << "/**\n"
|
||||
<< " * \\defgroup " << group_unary() << " Global Unary Functions\n"
|
||||
<< " * \\ingroup " << group() << "\n"
|
||||
<< " */\n\n";
|
||||
os << "/**\n"
|
||||
<< " * \\defgroup " << group_binary() << " Global Binary Functions\n"
|
||||
<< " * \\ingroup " << group() << "\n"
|
||||
<< " */\n\n";
|
||||
os << "/**\n"
|
||||
<< " * \\defgroup " << "_trinary_function" << " Global Trinary Functions\n"
|
||||
<< " * \\ingroup " << group() << "\n"
|
||||
<< " */\n\n";
|
||||
return os;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
class BinaryFunction : public Function {
|
||||
public:
|
||||
BinaryFunction(const char* s, const char* d, bool i = false)
|
||||
: m_name(s), m_description(d), m_int_only(i) { }
|
||||
const char* name() const { return m_name; }
|
||||
const char* description() const { return m_description; }
|
||||
const char* group() const { return group_binary(); }
|
||||
bool int_only() const { return m_int_only; }
|
||||
private:
|
||||
const char* m_name;
|
||||
const char* m_description;
|
||||
bool m_int_only;
|
||||
};
|
||||
|
||||
class UnaryFunction : public Function {
|
||||
public:
|
||||
UnaryFunction(const char* s, const char* d, bool i = false)
|
||||
: m_name(s), m_description(d), m_int_only(i) { }
|
||||
virtual ~UnaryFunction() { }
|
||||
const char* name() const { return m_name; }
|
||||
const char* description() const { return m_description; }
|
||||
const char* group() const { return group_unary(); }
|
||||
bool int_only() const { return m_int_only; }
|
||||
private:
|
||||
const char* m_name;
|
||||
const char* m_description;
|
||||
bool m_int_only;
|
||||
};
|
||||
|
||||
struct Operator {
|
||||
Operator() { }
|
||||
virtual ~Operator() { }
|
||||
virtual const char* symbol() const = 0;
|
||||
virtual const char* description() const = 0;
|
||||
virtual bool int_only() const = 0;
|
||||
static const char* group() { return "_operator"; }
|
||||
static const char* group_unary() { return "_unary_operator"; }
|
||||
static const char* group_binary() { return "_binary_operator"; }
|
||||
template<class Stream> static Stream& doxy_groups(Stream& os) {
|
||||
os << "/**\n"
|
||||
<< " * \\defgroup " << group() << " Global Operators\n"
|
||||
<< " */\n\n";
|
||||
os << "/**\n"
|
||||
<< " * \\defgroup " << group_binary() << " Global Binary Operators\n"
|
||||
<< " * \\ingroup " << group() << "\n"
|
||||
<< " */\n\n";
|
||||
os << "/**\n"
|
||||
<< " * \\defgroup " << group_unary() << " Global Unary Operators\n"
|
||||
<< " * \\ingroup " << group() << "\n"
|
||||
<< " */\n\n";
|
||||
return os;
|
||||
}
|
||||
};
|
||||
|
||||
class BinaryOperator : public Operator {
|
||||
public:
|
||||
BinaryOperator(const char* s, const char* d, bool i = false)
|
||||
: m_symbol(s), m_description(d), m_int_only(i) { }
|
||||
virtual ~BinaryOperator() { }
|
||||
const char* symbol() const { return m_symbol; }
|
||||
const char* description() const { return m_description; }
|
||||
const char* group() const { return group_binary(); }
|
||||
bool int_only() const { return m_int_only; }
|
||||
private:
|
||||
const char* m_symbol;
|
||||
const char* m_description;
|
||||
bool m_int_only;
|
||||
};
|
||||
|
||||
class UnaryOperator : public Operator {
|
||||
public:
|
||||
UnaryOperator(const char* s, const char* d, bool i = false)
|
||||
: m_symbol(s), m_description(d), m_int_only(i) { }
|
||||
virtual ~UnaryOperator() { }
|
||||
const char* symbol() const { return m_symbol; }
|
||||
const char* description() const { return m_description; }
|
||||
const char* group() const { return group_unary(); }
|
||||
bool int_only() const { return m_int_only; }
|
||||
private:
|
||||
const char* m_symbol;
|
||||
const char* m_description;
|
||||
bool m_int_only;
|
||||
};
|
||||
|
||||
class DataType {
|
||||
public:
|
||||
DataType(const char* s, const char* d, bool i = false)
|
||||
: m_name(s), m_description(d), m_is_int(i){ }
|
||||
const char* name() const { return m_name; }
|
||||
const char* description() const { return m_description; }
|
||||
bool is_int() const { return m_is_int; }
|
||||
private:
|
||||
const char* m_name;
|
||||
const char* m_description;
|
||||
bool m_is_int;
|
||||
};
|
||||
|
||||
class Type
|
||||
{
|
||||
public:
|
||||
Type() {
|
||||
datatypes.push_back( DataType("int", "int", true) );
|
||||
datatypes.push_back( DataType("float", "float") );
|
||||
datatypes.push_back( DataType("double", "double") );
|
||||
#ifdef TVMET_HAVE_LONG_DOUBLE
|
||||
datatypes.push_back( DataType("long double", "long double") );
|
||||
#endif // HAVE_LONG_DOUBLE
|
||||
#ifdef TVMET_HAVE_COMPLEX
|
||||
datatypes.push_back( DataType("const std::complex<T>&", "std::complex<T>") );
|
||||
#endif // HAVE_COMPLEX
|
||||
}
|
||||
|
||||
virtual ~Type() { }
|
||||
|
||||
public:
|
||||
template<class Stream>
|
||||
Stream& header(Stream& os) const {
|
||||
os << "namespace tvmet {\n\n";
|
||||
return os;
|
||||
}
|
||||
|
||||
template<class Stream>
|
||||
Stream& footer(Stream& os) const {
|
||||
os << "\n} // namespace tvmet\n\n";
|
||||
return os;
|
||||
}
|
||||
|
||||
public:
|
||||
typedef std::vector< DataType >::const_iterator const_iterator;
|
||||
|
||||
public:
|
||||
const_iterator begin() const { return datatypes.begin(); }
|
||||
const_iterator end() const { return datatypes.end(); }
|
||||
|
||||
private:
|
||||
std::vector< DataType > datatypes;
|
||||
};
|
||||
|
||||
#endif // TVMET_DOC_UTIL_H
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
BIN
tvmet-1.7.1/doc/aat.png
Normal file
BIN
tvmet-1.7.1/doc/aat.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
BIN
tvmet-1.7.1/doc/ata.png
Normal file
BIN
tvmet-1.7.1/doc/ata.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
BIN
tvmet-1.7.1/doc/axpy.png
Normal file
BIN
tvmet-1.7.1/doc/axpy.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
52
tvmet-1.7.1/doc/benchmark.dox
Normal file
52
tvmet-1.7.1/doc/benchmark.dox
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* $Id: benchmark.dox,v 1.8 2004/04/10 04:58:35 opetzold Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
\page benchmark Benchmark
|
||||
|
||||
Prior to version 0.8.0, tvmet had benchmark results listed here. Benchmarking
|
||||
isn't as easy as had been thought. The compiler's optimizer is very tricky -
|
||||
even more than I am. 8( To outwit the optimizer takes time - I would rather
|
||||
put the time into tvmet, itself.
|
||||
|
||||
Laurent Plagne has created some benchmarks using tvmet and other libraries,
|
||||
please have a look at
|
||||
<a href="http://www.opencascade.org/upload/87">opencascade</a>.
|
||||
|
||||
The following benchmarks are done on my
|
||||
Intel(R) Pentium(R) 4 CPU 2.40GHz
|
||||
Linux box:
|
||||
- \ref bench_axpy
|
||||
- \ref bench_matrix_matrix
|
||||
- \ref bench_matrix_vector
|
||||
- \ref bench_aat
|
||||
- \ref bench_ata
|
||||
|
||||
using a patched version of BTL 20030124. The patch is necessary to be able
|
||||
to compile tvmet due to the high inline level used here. The patch is
|
||||
distributed with the package.
|
||||
|
||||
\section bench_axpy axpy
|
||||
\image html axpy.png "axpy"
|
||||
|
||||
\section bench_matrix_matrix Matrix-Matrix
|
||||
\image html matrix_matrix.png "Matrix-Matrix"
|
||||
|
||||
\section bench_matrix_vector Matrix-Vector
|
||||
\image html matrix_vector.png "Matrix-Vector"
|
||||
|
||||
\section bench_aat MMt
|
||||
\image html aat.png "M M^t"
|
||||
|
||||
\section bench_ata MtM
|
||||
\image html ata.png "M^t M"
|
||||
|
||||
*/
|
||||
|
||||
|
||||
// Local Variables:
|
||||
// mode:c++
|
||||
// End:
|
||||
// LocalWords: BTL GHz Plagne
|
||||
199
tvmet-1.7.1/doc/build.dox
Normal file
199
tvmet-1.7.1/doc/build.dox
Normal file
@@ -0,0 +1,199 @@
|
||||
/*
|
||||
* $Id: build.dox,v 1.14 2005/04/07 15:59:19 opetzold Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
\page build Download, Configuration, Build and Installation of the library
|
||||
|
||||
<p>Contents:</p>
|
||||
- \ref download
|
||||
- \ref configure_unix
|
||||
- \ref install_unix
|
||||
- \ref install_win
|
||||
|
||||
|
||||
|
||||
|
||||
\section download Download tvmet
|
||||
|
||||
<p>
|
||||
You can download %tvmet <a href=http://sourceforge.net/project/showfiles.php?group_id=39733>here</a>.
|
||||
For the regression tests you will need <a href=http://sourceforge.net/projects/cppunit>CppUnit</a>.
|
||||
While these tests are not mandatory, they are recommended.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
For the API documentation you will also need <a href=http://www.doxygen.org>doxygen</a>,
|
||||
maybe you want a graphical class hierarchy, class graph etc you need
|
||||
the 'dot' tool of <a href="http://www.graphviz.org/">GraphViz</a>
|
||||
to draw the miscellaneous graphs.
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section configure_unix Configure tvmet on unix
|
||||
|
||||
See the \ref basic_install file for general informations.
|
||||
|
||||
<b>NEW</b> Starting with tvmet version 1.5.0 the configuration options
|
||||
has been changed!
|
||||
|
||||
<dl>
|
||||
<dt><tt>--enable-optimize</tt></dt>
|
||||
<dd>This affects the compiler optimization options. Machine specific
|
||||
compiler flags are switched on as well. The <code>TVMET_OPTIMIZE</code>
|
||||
symbol is defined, which uses the gcc's
|
||||
<code>__attribute__((always_inline))</code>.
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dt><tt>--enable-debug</tt></dt>
|
||||
<dd>Enables debugging mode for %tvmet. This affects the compiler
|
||||
options and preprocessor definitions. The <code>TVMET_DEBUG</code>
|
||||
symbol is defined. If you compile %tvmet from another source directory
|
||||
which defines <code>DEBUG</code>, then <code>TVMET_DEBUG</code> will be
|
||||
<b>not</b> defined (This behavior differs from release less than 0.6.0).
|
||||
Please have a look at the \ref debug section of the \ref faq.
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dt><tt>--enable-warnings</tt></dt>
|
||||
<dd>This affects the compiler warning options. The warning level is on
|
||||
a high level for default!</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dt><tt>--enable-docs</tt></dt>
|
||||
<dd>Enables generation of API documentation using <a href=http://www.doxygen.org>doxygen</a>.
|
||||
If the configure scripts founds the <a href="http://www.graphviz.org/">GraphViz</a>
|
||||
'dot' tool it will be used. Further more an PDF file of the API
|
||||
will be generated using doxygen too.
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dt><tt>--enable-verbose-latex</tt></dt>
|
||||
<dd>Uses LaTeX non-stop mode for generating the PDF file of tvmet's
|
||||
API documentation.
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dt><tt>--disable-cppunit</tt></dt>
|
||||
<dd>Disables the regression/unit test. For these tests you need an installed
|
||||
<a href="http://www.sourceforge.net/projects/cppunit">CppUnit</a>.
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dt><tt>--with-cxx=compiler</tt></dt>
|
||||
<dd>Set the C++ compiler to compiler and options. The known compiler are
|
||||
the GNU g++ (default), Intel icc, Kai C++ KCC, Portland Group C++ pgCC.
|
||||
Please have a look at the \ref compiler page.
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section install_unix Build and Installation of tvmet on unix
|
||||
|
||||
The build target for make are:
|
||||
|
||||
<dl>
|
||||
<dt><tt>all</tt></dt>
|
||||
<dd>Makes tvmet ready for installation.</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dt><tt>docs</tt></dt>
|
||||
<dd>Makes the documentation using doxygen. Depends on the options given
|
||||
to the configure script, the documentation are HTML and PDF/LaTeX.</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dt><tt>check</tt></dt>
|
||||
<dd>Build and run the regression tests (needs CppUnit).</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dt><tt>install</tt></dt>
|
||||
<dd>Installs tvmet.</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dt><tt>uninstall</tt></dt>
|
||||
<dd>Do you really want this? :-)</dd>
|
||||
</dl>
|
||||
|
||||
Further more inside the <tt>examples</tt> directory there is the target:
|
||||
|
||||
<dl>
|
||||
<dt><tt>examples</tt></dt>
|
||||
<dd>Build tvmet's examples.
|
||||
|
||||
At this date the example directory contains simple examples
|
||||
for matrix, vector and matrix-vector operations. Further more
|
||||
some sources which shows the use for expression tree printing
|
||||
(expands the expression tree used).
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
Files will be installed in the following directories:
|
||||
|
||||
<ul>
|
||||
<li><tt>Executables -> ${prefix}/bin</tt></li>
|
||||
<li><tt>Docs -> ${prefix}/share/doc/tvmet-${version}</tt></li>
|
||||
<li><tt>Man pages -> ${prefix}/man</tt></li>
|
||||
<li><tt>Header file -> ${prefix}/include/tvmet</tt></li>
|
||||
</ul>
|
||||
|
||||
Default value for prefix is <tt>/usr/local</tt> but you may change it
|
||||
with <tt>--prefix</tt> option to the <tt>configure</tt> script (see above).
|
||||
|
||||
|
||||
|
||||
|
||||
\section install_win Build and Installation of tvmet on MS Windows
|
||||
|
||||
First, the windows version used doesn't matter - the compiler is your
|
||||
tool. The compiler has to understand the high level C++ style of
|
||||
tvmet.
|
||||
|
||||
Second, tvmet comes with pre-configured files for the windows compiler.
|
||||
Therefore you don't need to follow the configure and build procedure. An
|
||||
exception is the <a href="http://www.cygwin.com">cygwin</a> and
|
||||
<a href="http://www.mingw.org/">MinGW</a> environment
|
||||
since they emulate the unix environment on windows - they follow the
|
||||
unix style process therefore.
|
||||
|
||||
Well, simply copy the tvmet source tree complete or only the include
|
||||
directory to a location of your choice and include the path to your
|
||||
compiler environment. Thats all.
|
||||
|
||||
To build the regression tests it's on your own to build support for
|
||||
<a href="http://cppunit.sourceforge.net">cppunit</a> and create the
|
||||
appropriate sub-project. tvmet does not deliver Microsoft Visual Studio
|
||||
project files.
|
||||
|
||||
If of interest the config file for Visual Studio can be found on
|
||||
<tt>tvmet/config/config-vc71.h</tt>. There are all compiler quirks and
|
||||
defines needed.
|
||||
|
||||
|
||||
\sa \ref vc71
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
// Local Variables:
|
||||
// mode:c++
|
||||
// End:
|
||||
// LocalWords: CppUnit GraphViz doxygen
|
||||
375
tvmet-1.7.1/doc/compiler.dox
Normal file
375
tvmet-1.7.1/doc/compiler.dox
Normal file
@@ -0,0 +1,375 @@
|
||||
/*
|
||||
* $Id: compiler.dox,v 1.24 2005/03/09 12:05:19 opetzold Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
\page compiler Compiler Support
|
||||
|
||||
<p>Contents:</p>
|
||||
- \ref requirements
|
||||
- \ref gcc
|
||||
- \ref kcc
|
||||
- \ref pgCC
|
||||
- \ref intel
|
||||
- \ref vc71
|
||||
|
||||
\section requirements General compiler Requirements
|
||||
|
||||
This library is designed for portability - no compiler specific extensions
|
||||
are used. Nevertheless, there are a few requirements: (These are all a part
|
||||
of the C++ standard.)
|
||||
|
||||
- Support for the <tt>mutable</tt> keyword is required. This is used by the
|
||||
CommaInitializer only.
|
||||
|
||||
- The <tt>typename</tt> keyword is used exhaustively here.
|
||||
|
||||
- The namespace concept is required. The tvmet library is itself is a
|
||||
namespace. To avoid collisions of operators, there is also an element_wise
|
||||
namespace within tvmet.
|
||||
|
||||
- Partial specialization is needed for the extrema functions min and max
|
||||
to distinguish between vectors and matrices. This allows tvmet to return
|
||||
an object with a specific behavior. (The location of an extremum in a
|
||||
matrix has a (row, column) position whereas a vector extremum has only a
|
||||
single index for its position).
|
||||
|
||||
\section gcc The GNU Compiler Collection
|
||||
|
||||
The <a href=http://gcc.gnu.org>GNU compiler</a> collection is mainly used for
|
||||
developing this library. Moreover, it does compile the library the fastest.
|
||||
|
||||
\subsection gcc2953 GNU C++ Compiler v2.95.3
|
||||
|
||||
Gcc v2.95.3 is the last official release of the version 2 series from gnu.org.
|
||||
Since this compiler features the \ref requirements it does work, but only
|
||||
partial.
|
||||
|
||||
There are certain difficulties - see \ref ambiguous_overload (also, please
|
||||
read about \ref gcc296). Furthermore, there are problems with functions and
|
||||
operators declared in the namespace <code>element_wise</code> - the
|
||||
compiler doesn't seem to find them--even though the compiler does know
|
||||
about namespace tvmet. It appears to be a problem with nested namespaces and
|
||||
the compiler's ability to perform function/operator lookup, especially during
|
||||
regression tests: <code> matrix /= matrix </code> compiles inside a single
|
||||
file but not at the regression tests--which is a contradiction in terms.
|
||||
|
||||
Porting to gcc v2.95.3 requires a lot of knowledge and effort--unfortunately,
|
||||
I don't have enough of either. The examples do compile and the regression
|
||||
tests build partially.
|
||||
|
||||
Matrix and vector operators are working, but don't expect too much.
|
||||
|
||||
\subsection gcc296 GNU C++ Compiler v2.96 (Rh7.x, MD8.x)
|
||||
|
||||
This compiler isn't an official release of the GNU Compiler group but shipped
|
||||
by <a href=http://www.redhat.com>Red Hat</a> and Co.
|
||||
|
||||
Blitz++ is using a hasFastAccess() flag to perform a check for the use of
|
||||
_bz_meta_vecAssign::fastAssign (without bounds checking) or
|
||||
_bz_meta_vecAssign::assign (with bounds checking). This
|
||||
isn't really necessary for operations on blitz::TinyVector, since it's
|
||||
always true. Nevertheless, it is important for the produced asm code using
|
||||
the gcc-c++-2.96-0.48mdk. Generally the code for Blitz++ using the gcc-2.96
|
||||
is better than tvmet because of this (tested!).
|
||||
|
||||
I got into trouble with stl_relops.h where miscellaneous operators are defined. A
|
||||
simple define of __SGI_STL_INTERNAL_RELOPS in the config header doesn't solve
|
||||
the problem, only the commented out header version, see \ref
|
||||
ambiguous_overload. Because of this problem, the regression tests don't
|
||||
compile with this version. Projects with do not use the relational
|
||||
operators are not affected.
|
||||
|
||||
It seems that the inlining performed by this compiler collection isn't very
|
||||
smart. I got a lot of warnings: can't inline call to ... So, it would be
|
||||
best to use the \ref gcc30x and later compilers.
|
||||
|
||||
\subsection gcc30x GNU C++ Compiler v3.0.x
|
||||
|
||||
These compiler produce better code than the \ref gcc296! Even the problems
|
||||
with blitz++ fastAssign have vanished. And this compiler conforms to the
|
||||
standard. The regression tests does compile and run successfully.
|
||||
|
||||
Due to the nature of ET and MT there is a need for a high level of inlining.
|
||||
The v3.0.x seems to do this well as compared to the v2.9x compilers which
|
||||
produce inline warnings.
|
||||
|
||||
This compiler works great with the
|
||||
<a href=http://www.stlport.org">STLPort-4.5.3</a>
|
||||
implementation of the STL/C++ Library, Tiny Vector and Matrix template library
|
||||
and <a href=http://cppunit.sourceforge.net>cpp-unit</a>.
|
||||
|
||||
\subsection gcc31x GNU C++ Compiler v3.1
|
||||
|
||||
%tvmet does compile with this new GNU C++ compiler. The produced code looks
|
||||
as good as the code created by \ref gcc30x. (Does anyone have time to make
|
||||
a benchmark?)
|
||||
|
||||
The primary goal is conformance to the standard ISO/IEC 14882:1998.
|
||||
|
||||
\subsection gcc32x GNU C++ Compiler v3.2.x
|
||||
|
||||
The once again changed Application Binary Interface (ABI) doesn't affect
|
||||
tvmet since it isn't a binary library--it's only compiled templates inside
|
||||
the client code.
|
||||
|
||||
There are some problems with the GNU C++ compiler collection on the
|
||||
regression test due to some bugs (IMO), \sa \ref regressiontest_failed.
|
||||
|
||||
\subsection gcc33x GNU C++ Compiler v3.3
|
||||
|
||||
Tested and works fine. Only some warnings on failed inlining which doesn't
|
||||
concern tvmet directly.
|
||||
|
||||
Anyway, here the code from <tt>examples/ray.cc</tt> on gcc 3.3.3 using
|
||||
<tt>-O2 -DTVMET_OPTIMIZE</tt>
|
||||
|
||||
\par Assembler (IA-32 Intel® Architecture):
|
||||
\code
|
||||
movl 16(%ebp), %edx
|
||||
movl 12(%ebp), %ebx
|
||||
movl 8(%ebp), %esi
|
||||
fldl 8(%edx)
|
||||
fldl 16(%edx)
|
||||
fmull 16(%ebx)
|
||||
fxch %st(1)
|
||||
movl %ebx, -24(%ebp)
|
||||
fmull 8(%ebx)
|
||||
movl %edx, -32(%ebp)
|
||||
fldl (%edx)
|
||||
fmull (%ebx)
|
||||
fxch %st(1)
|
||||
movl %edx, -60(%ebp)
|
||||
movl %edx, -12(%ebp)
|
||||
faddp %st, %st(2)
|
||||
faddp %st, %st(1)
|
||||
fadd %st(0), %st
|
||||
fstpl -56(%ebp)
|
||||
movl -56(%ebp), %ecx
|
||||
movl -52(%ebp), %eax
|
||||
movl %ecx, -20(%ebp)
|
||||
movl %eax, -16(%ebp)
|
||||
movl %ecx, -40(%ebp)
|
||||
movl %eax, -36(%ebp)
|
||||
movl %ecx, -68(%ebp)
|
||||
movl %eax, -64(%ebp)
|
||||
fldl (%edx)
|
||||
fmull -20(%ebp)
|
||||
fsubrl (%ebx)
|
||||
fstpl (%esi)
|
||||
fldl 8(%edx)
|
||||
fmull -20(%ebp)
|
||||
fsubrl 8(%ebx)
|
||||
fstpl 8(%esi)
|
||||
fldl 16(%edx)
|
||||
fmull -20(%ebp)
|
||||
fsubrl 16(%ebx)
|
||||
fstpl 16(%esi)
|
||||
addl $64, %esp
|
||||
popl %ebx
|
||||
popl %esi
|
||||
popl %ebp
|
||||
ret
|
||||
\endcode
|
||||
|
||||
\subsection gcc34x GNU C++ Compiler v3.4.x
|
||||
|
||||
The compiler 3.4.3 works fine, starting with tvmet release 1.7.1. The problem is
|
||||
the correct syntax for the CommaInitializer template declaration and
|
||||
implementation.
|
||||
|
||||
There is no assembler output for our <tt>examples/ray.cc</tt>, since I don't
|
||||
have this compiler yet (yes, I need to update my linux system ;-)
|
||||
|
||||
|
||||
\section kcc Kai C++
|
||||
|
||||
This has not been tested. Unfortunately Kai's compiler is no longer shipped
|
||||
-- one should use the Intel compiler instead
|
||||
(see <a href=http://www.kai.com>here</a>).
|
||||
|
||||
If you have used it successfully including regression and/or benchmark tests,
|
||||
please give me an answer.
|
||||
|
||||
\section pgCC Portland Group Compiler Technology
|
||||
|
||||
\subsection pgCC32 Portland Group C++ 3.2
|
||||
|
||||
The <a href=http://www.pgroup.com>Portland Group</a> C++ compiler is shipped
|
||||
with the RogueWave Standard C++ Library which provides conformance to the
|
||||
standard. Unfortunately, the <cname> C library wrapper headers and the C++
|
||||
overloads of the math functions are not provided on all platforms, see
|
||||
<http://www.cug.com/roundup>. The download evaluation version 3.2-4 for
|
||||
Linux is affected for example. At first glance, it does compile with pgCC
|
||||
since it has has the great <a href=http://www.edg.com>EDG</a> front-end.
|
||||
|
||||
Maybe there is a solution with other standard library implementations like
|
||||
<a href=http://www.stlport.org>STLPort</a> (On a quick try the STL Port
|
||||
doesn't recognize the pgCC). If you know more about this, please let me know.
|
||||
|
||||
Anyway, the code produced is very poor even if I use high inlining levels
|
||||
like the command line option -Minline=levels:100 which increases the compile
|
||||
time dramatically! The benchmark tests have not been done. Unfortunately,
|
||||
my trial period has expired. I haven't any idea if this compiler will pass
|
||||
the regression tests.
|
||||
|
||||
\subsection pgCC51 Portland Group C++ 5.1
|
||||
|
||||
The <a href=http://www.pgroup.com>Portland Group</a> C++ compiler is shipped
|
||||
with the <a href=http://www.stlport.org>STLport</a> Standard C++ Library, cool!
|
||||
|
||||
The code produced isn't very compact compared with the intel or gnu compiler.
|
||||
Anyway it works, but the compiler time increases dramatically
|
||||
even on higher inline levels.
|
||||
|
||||
|
||||
\section intel Intel Compiler
|
||||
|
||||
\subsection icc5 Intel Compiler v5.0.1
|
||||
|
||||
This compiler complains even more than gcc-3.0.x regarding template
|
||||
specifiers (e.g. correct spaces for template arguments to std::complex are
|
||||
needed even when not instanced).
|
||||
|
||||
The produced code looks good but, I haven't done a benchmark to compare it
|
||||
with the gcc-3.0.x since the compile time increases for the benchmark test
|
||||
dramatically.
|
||||
|
||||
I have not run any regression tests due to the compile time needed by my
|
||||
AMD K6/400 Linux box ...
|
||||
|
||||
\subsection icc6 Intel Compiler v6.0.x
|
||||
|
||||
Should work, but I haven't tested it.
|
||||
|
||||
\subsection icc7 Intel Compiler v7.x
|
||||
|
||||
This compiler is well supported by tvmet and passes the regression tests
|
||||
without any failure - as opposed to the GNU C++ compiler collection.
|
||||
|
||||
\subsection icc8 Intel Compiler v8.x
|
||||
|
||||
No regression tests are done - reports are welcome. I'm not expecting
|
||||
problems. Anyway, this versions uses pure macros for IEEE math isnan and
|
||||
isinf. This prevents overwriting with tvmet's functions. Therefore
|
||||
this functions are disabled after tvmet release 1.4.1. The code produced
|
||||
is even on <tt>examples/ray.cc</tt> more compact than the \ref gcc33x.
|
||||
|
||||
Anyway, here the code from <tt>examples/ray.cc</tt> using
|
||||
<tt>-O2 -DTVMET_OPTIMIZE</tt>
|
||||
|
||||
\par Assembler (IA-32 Intel® Architecture):
|
||||
\code
|
||||
movl 4(%esp), %ecx
|
||||
movl 8(%esp), %edx
|
||||
movl 12(%esp), %eax
|
||||
fldl (%edx)
|
||||
fmull (%eax)
|
||||
fldl 8(%edx)
|
||||
fmull 8(%eax)
|
||||
fldl 16(%edx)
|
||||
fmull 16(%eax)
|
||||
faddp %st, %st(1)
|
||||
faddp %st, %st(1)
|
||||
fldl (%eax)
|
||||
fxch %st(1)
|
||||
fadd %st(0), %st
|
||||
fmul %st, %st(1)
|
||||
fxch %st(1)
|
||||
fsubrl (%edx)
|
||||
fstpl (%ecx)
|
||||
fldl 8(%eax)
|
||||
fmul %st(1), %st
|
||||
fsubrl 8(%edx)
|
||||
fstpl 8(%ecx)
|
||||
fldl 16(%eax)
|
||||
fmulp %st, %st(1)
|
||||
fsubrl 16(%edx)
|
||||
fstpl 16(%ecx)
|
||||
ret
|
||||
\endcode
|
||||
|
||||
|
||||
|
||||
|
||||
\section vc71 Microsoft Visual C++ v7.1
|
||||
|
||||
\htmlonly
|
||||
<script language="JavaScript">
|
||||
var m_name="blbounnejapny";
|
||||
var m_domain="hotmail.com";
|
||||
var m_text='<a href="mailto:'+m_name+'@'+m_domain+'?subject=tvmet and Microsoft VC++">';
|
||||
m_text+='Robi Carnecky</a>';
|
||||
document.write(m_text);
|
||||
</script>
|
||||
\endhtmlonly
|
||||
\latexonly
|
||||
Robi Carnecky <blbounnejapny@hotmail.com>
|
||||
\endlatexonly
|
||||
has reported the success on tvmet using Visual C++ v7.1. At this
|
||||
release of tvmet there are some warnings left - the work is on
|
||||
progress.
|
||||
|
||||
The <a href="http://msdn.microsoft.com/visualc/vctoolkit2003/">Microsoft Visual C++ Toolkit 2003</a>
|
||||
and Visual C++ prior 7.1 do not compile - you will get an undefined
|
||||
internal error unfortunally.
|
||||
|
||||
Anyway, here the code from <tt>examples/ray.cc</tt>:
|
||||
|
||||
\par Assembler (IA-32 Intel® Architecture, no SSE2):
|
||||
\code
|
||||
push ebp
|
||||
mov ebp, esp
|
||||
and esp, -8 ; fffffff8H
|
||||
sub esp, 28 ; 0000001cH
|
||||
mov eax, DWORD PTR _ray$[ebp]
|
||||
mov ecx, DWORD PTR _surfaceNormal$[ebp]
|
||||
fld QWORD PTR [eax+16]
|
||||
fmul QWORD PTR [ecx+16]
|
||||
push ebx
|
||||
fld QWORD PTR [eax+8]
|
||||
push esi
|
||||
fmul QWORD PTR [ecx+8]
|
||||
push edi
|
||||
mov edi, DWORD PTR $T35206[esp+52]
|
||||
faddp ST(1), ST(0)
|
||||
mov DWORD PTR $T35027[esp+60], edi
|
||||
fld QWORD PTR [eax]
|
||||
pop edi
|
||||
fmul QWORD PTR [ecx]
|
||||
faddp ST(1), ST(0)
|
||||
fadd ST(0), ST(0)
|
||||
fstp QWORD PTR $T35206[esp+36]
|
||||
mov esi, DWORD PTR $T35206[esp+40]
|
||||
mov edx, DWORD PTR $T35206[esp+36]
|
||||
mov ebx, DWORD PTR $T35265[esp+40]
|
||||
mov DWORD PTR $T35027[esp+44], edx
|
||||
mov edx, DWORD PTR _reflection$[ebp]
|
||||
mov DWORD PTR $T35027[esp+48], esi
|
||||
fld QWORD PTR $T35027[esp+44]
|
||||
fmul QWORD PTR [ecx]
|
||||
pop esi
|
||||
mov DWORD PTR $T35027[esp+36], ebx
|
||||
pop ebx
|
||||
fsubr QWORD PTR [eax]
|
||||
fstp QWORD PTR [edx]
|
||||
fld QWORD PTR $T35027[esp+36]
|
||||
fmul QWORD PTR [ecx+8]
|
||||
fsubr QWORD PTR [eax+8]
|
||||
fstp QWORD PTR [edx+8]
|
||||
fld QWORD PTR $T35027[esp+36]
|
||||
fmul QWORD PTR [ecx+16]
|
||||
fsubr QWORD PTR [eax+16]
|
||||
fstp QWORD PTR [edx+16]
|
||||
mov esp, ebp
|
||||
pop ebp
|
||||
\endcode
|
||||
|
||||
\sa \ref regressiontest_failed
|
||||
\sa \ref install_win
|
||||
*/
|
||||
|
||||
|
||||
// Local Variables:
|
||||
// mode:c++
|
||||
// End:
|
||||
448
tvmet-1.7.1/doc/dox_functions.cc
Normal file
448
tvmet-1.7.1/doc/dox_functions.cc
Normal file
@@ -0,0 +1,448 @@
|
||||
/*
|
||||
* Tiny Vector Matrix Library
|
||||
* Dense Vector Matrix Libary of Tiny size using Expression Templates
|
||||
*
|
||||
* Copyright (C) 2001 - 2003 Olaf Petzold <opetzold@users.sourceforge.net>
|
||||
*
|
||||
* 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.1 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
|
||||
*
|
||||
* $Id: dox_functions.cc,v 1.8 2003/12/19 18:01:37 opetzold Exp $
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <tvmet/config.h>
|
||||
|
||||
#include "Util.h"
|
||||
|
||||
class FunctionBase
|
||||
{
|
||||
public:
|
||||
FunctionBase() {
|
||||
m_binary_functions.push_back( BinaryFunction("atan2", "arcus tangent of two variables") );
|
||||
m_binary_functions.push_back( BinaryFunction("drem", "floating-point remainder") );
|
||||
m_binary_functions.push_back( BinaryFunction("fmod", "floating-point remainder") );
|
||||
m_binary_functions.push_back( BinaryFunction("hypot", "Euclidean distance") );
|
||||
m_binary_functions.push_back( BinaryFunction("jn", "Bessel") );
|
||||
m_binary_functions.push_back( BinaryFunction("yn", "Bessel") );
|
||||
m_binary_functions.push_back( BinaryFunction("pow", "power") );
|
||||
|
||||
m_unary_functions.push_back( UnaryFunction("abs", "absolute value") );
|
||||
m_unary_functions.push_back( UnaryFunction("cbrt", "cube root") );
|
||||
m_unary_functions.push_back( UnaryFunction("floor", "round") );
|
||||
m_unary_functions.push_back( UnaryFunction("rint", "round") );
|
||||
m_unary_functions.push_back( UnaryFunction("sin", "sin") );
|
||||
m_unary_functions.push_back( UnaryFunction("sinh", "sinh") );
|
||||
m_unary_functions.push_back( UnaryFunction("cos", "cos") );
|
||||
m_unary_functions.push_back( UnaryFunction("cosh", "cosh") );
|
||||
m_unary_functions.push_back( UnaryFunction("asin", "asin") );
|
||||
m_unary_functions.push_back( UnaryFunction("acos", "acos") );
|
||||
m_unary_functions.push_back( UnaryFunction("atan", "atan") );
|
||||
m_unary_functions.push_back( UnaryFunction("exp", "exponential") );
|
||||
m_unary_functions.push_back( UnaryFunction("log", "logarithmic") );
|
||||
m_unary_functions.push_back( UnaryFunction("log10", "logarithmic") );
|
||||
m_unary_functions.push_back( UnaryFunction("sqrt", "sqrt") );
|
||||
#ifdef TVMET_HAVE_IEEE_MATH
|
||||
m_unary_functions.push_back( UnaryFunction("asinh", "IEEE Math asinh") );
|
||||
m_unary_functions.push_back( UnaryFunction("acosh", "IEEE Math acosh") );
|
||||
m_unary_functions.push_back( UnaryFunction("atanh", "IEEE Math atanh") );
|
||||
m_unary_functions.push_back( UnaryFunction("expm1", "IEEE Math expm1") );
|
||||
m_unary_functions.push_back( UnaryFunction("log1p", "IEEE Math log1p") );
|
||||
m_unary_functions.push_back( UnaryFunction("erf", "IEEE Math erf") );
|
||||
m_unary_functions.push_back( UnaryFunction("erfc", "IEEE Math erfc") );
|
||||
m_unary_functions.push_back( UnaryFunction("isnan", "IEEE Math isnan. "
|
||||
"Return nonzero value if X is a NaN.") );
|
||||
m_unary_functions.push_back( UnaryFunction("isinf", "IEEE Math isinf. "
|
||||
"Return nonzero value if X is positive or negative infinity.") );
|
||||
m_unary_functions.push_back( UnaryFunction("isfinite", "fIEEE Math isfinite. "
|
||||
"Return nonzero value if X is not +-Inf or NaN.") );
|
||||
m_unary_functions.push_back( UnaryFunction("j0", "IEEE Math Bessel") );
|
||||
m_unary_functions.push_back( UnaryFunction("j1", "IEEE Math Bessel") );
|
||||
m_unary_functions.push_back( UnaryFunction("y0", "IEEE Math Bessel") );
|
||||
m_unary_functions.push_back( UnaryFunction("y1", "IEEE Math Bessel") );
|
||||
m_unary_functions.push_back( UnaryFunction("lgamma", "IEEE Math lgamma") );
|
||||
#endif
|
||||
}
|
||||
|
||||
virtual ~FunctionBase() { }
|
||||
|
||||
public:
|
||||
template<class Stream>
|
||||
Stream& header(Stream& os) const {
|
||||
m_type.header(os);
|
||||
return os;
|
||||
}
|
||||
|
||||
template<class Stream>
|
||||
Stream& footer(Stream& os) const {
|
||||
m_type.footer(os);
|
||||
return os;
|
||||
}
|
||||
|
||||
template<class Stream>
|
||||
Stream& binary(Stream& os) const {
|
||||
return os;
|
||||
}
|
||||
|
||||
template<class Stream>
|
||||
Stream& unary(Stream& os) const {
|
||||
return os;
|
||||
}
|
||||
|
||||
public:
|
||||
typedef std::vector< BinaryFunction >::const_iterator bfun_iterator;
|
||||
typedef std::vector< UnaryFunction >::const_iterator ufun_iterator;
|
||||
|
||||
public:
|
||||
virtual const std::vector< BinaryFunction >& bfun() const { return m_binary_functions; }
|
||||
virtual const std::vector< UnaryFunction >& ufun() const { return m_unary_functions; }
|
||||
|
||||
protected:
|
||||
std::vector< BinaryFunction > m_binary_functions;
|
||||
std::vector< UnaryFunction > m_unary_functions;
|
||||
Type m_type;
|
||||
};
|
||||
|
||||
|
||||
|
||||
class XprFunctions : public FunctionBase
|
||||
{
|
||||
public:
|
||||
XprFunctions() { }
|
||||
|
||||
public:
|
||||
template<class Stream>
|
||||
Stream& operator()(Stream& os) const {
|
||||
header(os);
|
||||
|
||||
binary(os);
|
||||
binary2(os);
|
||||
unary(os);
|
||||
|
||||
footer(os);
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
public:
|
||||
template<class Stream>
|
||||
Stream& header(Stream& os) const {
|
||||
FunctionBase::header(os);
|
||||
os << "//\n"
|
||||
<< "// XprFunctions.h\n"
|
||||
<< "//\n\n";
|
||||
return os;
|
||||
}
|
||||
|
||||
// binary functions
|
||||
template<class Stream>
|
||||
Stream& binary(Stream& os) const {
|
||||
FunctionBase::binary(os);
|
||||
|
||||
for(bfun_iterator fun = bfun().begin(); fun != bfun().end(); ++fun) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn " << fun->name() << "(const XprVector<E1, Sz>& lhs, const XprVector<E2, Sz>& rhs)\n"
|
||||
<< " * \\brief " << fun->description() << " function for two XprVector.\n"
|
||||
<< " * \\ingroup " << fun->group() << "\n"
|
||||
<< " */\n\n";
|
||||
|
||||
os << "/**\n"
|
||||
<< " * \\fn " << fun->name() << "(const XprMatrix<E1, Rows, Cols>& lhs, const XprMatrix<E2, Rows, Cols>& rhs)\n"
|
||||
<< " * \\brief " << fun->description() << " function for two XprMatrix.\n"
|
||||
<< " * \\ingroup " << fun->group() << "\n"
|
||||
<< " */\n\n";
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
// binary functions with pod and std::complex<>
|
||||
template<class Stream>
|
||||
Stream& binary2(Stream& os) const {
|
||||
for(Type::const_iterator tp = m_type.begin(); tp != m_type.end(); ++tp) {
|
||||
for(bfun_iterator fun = bfun().begin(); fun != bfun().end(); ++fun) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn " << fun->name() << "(const XprVector<E, Sz>& lhs, " << tp->name() << " rhs)\n"
|
||||
<< " * \\brief " << fun->description() << " function between XprVector and " << tp->description() << ".\n"
|
||||
<< " * \\ingroup " << fun->group() << "\n"
|
||||
<< " */\n\n";
|
||||
|
||||
// os << "/**\n"
|
||||
// << " * \\fn " << fun->name() << "(" << tp->name() << " lhs, const XprVector<E, Sz>& rhs)\n"
|
||||
// << " * \\brief " << fun->description() << " function between " << tp->description() << " and XprVector.\n"
|
||||
// << " * \\ingroup " << fun->group() << "\n"
|
||||
// << " */\n\n";
|
||||
|
||||
os << "/**\n"
|
||||
<< " * \\fn " << fun->name() << "(const XprMatrix<E, Rows, Cols>& lhs, " << tp->name() << " rhs)\n"
|
||||
<< " * \\brief " << fun->description() << " function between XprMatrix and " << tp->description() << ".\n"
|
||||
<< " * \\ingroup " << fun->group() << "\n"
|
||||
<< " */\n\n";
|
||||
|
||||
// os << "/**\n"
|
||||
// << " * \\fn " << fun->name() << "(" << tp->name() << " lhs, const XprMatrix<E, Rows, Cols>& rhs)\n"
|
||||
// << " * \\brief " << fun->description() << " function between " << tp->description() << " and XprMatrix.\n"
|
||||
// << " * \\ingroup " << fun->group() << "\n"
|
||||
// << " */\n\n";
|
||||
}
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
// unary functions
|
||||
template<class Stream>
|
||||
Stream& unary(Stream& os) const {
|
||||
FunctionBase::unary(os);
|
||||
|
||||
for(ufun_iterator fun = ufun().begin(); fun != ufun().end(); ++fun) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn " << fun->name() << "(const XprVector<E, Sz>& rhs)\n"
|
||||
<< " * \\brief " << fun->description() << " function for XprVector\n"
|
||||
<< " * \\ingroup " << fun->group() << "\n"
|
||||
<< " */\n\n";
|
||||
|
||||
os << "/**\n"
|
||||
<< " * \\fn " << fun->name() << "(const XprMatrix<E, Rows, Cols>& rhs)\n"
|
||||
<< " * \\brief " << fun->description() << " function for XprMatrix.\n"
|
||||
<< " * \\ingroup " << fun->group() << "\n"
|
||||
<< " */\n\n";
|
||||
}
|
||||
return os;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
class VectorFunctions : public FunctionBase
|
||||
{
|
||||
public:
|
||||
VectorFunctions() { }
|
||||
|
||||
public:
|
||||
template<class Stream>
|
||||
Stream& operator()(Stream& os) const {
|
||||
header(os);
|
||||
|
||||
binary(os);
|
||||
binary2(os);
|
||||
binary3(os);
|
||||
unary(os);
|
||||
|
||||
footer(os);
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
public:
|
||||
template<class Stream>
|
||||
Stream& header(Stream& os) const {
|
||||
FunctionBase::header(os);
|
||||
|
||||
os << "//\n"
|
||||
<< "// VectorFunctions.h\n"
|
||||
<< "//\n\n";
|
||||
return os;
|
||||
}
|
||||
|
||||
// binary functions
|
||||
template<class Stream>
|
||||
Stream& binary(Stream& os) const {
|
||||
FunctionBase::binary(os);
|
||||
|
||||
for(bfun_iterator fun = bfun().begin(); fun != bfun().end(); ++fun) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn " << fun->name() << "(const Vector<T1, Sz>& lhs, const Vector<T2, Sz>& rhs)\n"
|
||||
<< " * \\brief " << fun->description() << " function for two Vector.\n"
|
||||
<< " * \\ingroup " << fun->group() << "\n"
|
||||
<< " */\n\n";
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
// binary functions with pod and std::complex<>
|
||||
template<class Stream>
|
||||
Stream& binary2(Stream& os) const {
|
||||
for(Type::const_iterator tp = m_type.begin(); tp != m_type.end(); ++tp) {
|
||||
for(bfun_iterator fun = bfun().begin(); fun != bfun().end(); ++fun) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn " << fun->name() << "(const Vector<T, Sz>& lhs, " << tp->name() << " rhs)\n"
|
||||
<< " * \\brief " << fun->description() << " function on Vector and " << tp->description() << ".\n"
|
||||
<< " * \\ingroup " << fun->group() << "\n"
|
||||
<< " */\n\n";
|
||||
|
||||
// os << "/**\n"
|
||||
// << " * \\fn " << fun->name() << "(" << tp->name() << " lhs, const Vector<T, Sz>& rhs)\n"
|
||||
// << " * \\brief " << fun->description() << " function on " << tp->description() << " and Vector.\n"
|
||||
// << " * \\ingroup " << fun->group() << "\n"
|
||||
// << " */\n\n";
|
||||
}
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
// binary functions with expressions
|
||||
template<class Stream>
|
||||
Stream& binary3(Stream& os) const {
|
||||
for(bfun_iterator fun = bfun().begin(); fun != bfun().end(); ++fun) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn " << fun->name() << "(const XprVector<E, Sz>& lhs, const Vector<T, Sz>& rhs)\n"
|
||||
<< " * \\brief " << fun->description() << " function on XprVector and Vector.\n"
|
||||
<< " * \\ingroup " << fun->group() << "\n"
|
||||
<< " */\n\n";
|
||||
|
||||
os << "/**\n"
|
||||
<< " * \\fn " << fun->name() << "(const Vector<T, Sz>& lhs, const XprVector<E, Sz>& rhs)\n"
|
||||
<< " * \\brief " << fun->description() << " function on Vector and XprVector.\n"
|
||||
<< " * \\ingroup " << fun->group() << "\n"
|
||||
<< " */\n\n";
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
// unary functions
|
||||
template<class Stream>
|
||||
Stream& unary(Stream& os) const {
|
||||
FunctionBase::unary(os);
|
||||
|
||||
for(ufun_iterator fun = ufun().begin(); fun != ufun().end(); ++fun) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn " << fun->name() << "(const Vector<T, Sz>& rhs)\n"
|
||||
<< " * \\brief " << fun->description() << " function on Vector.\n"
|
||||
<< " * \\ingroup " << fun->group() << "\n"
|
||||
<< " */\n\n";
|
||||
}
|
||||
return os;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
class MatrixFunctions : public FunctionBase
|
||||
{
|
||||
public:
|
||||
MatrixFunctions() { }
|
||||
|
||||
public:
|
||||
template<class Stream>
|
||||
Stream& operator()(Stream& os) const {
|
||||
header(os);
|
||||
|
||||
binary(os);
|
||||
binary2(os);
|
||||
binary3(os);
|
||||
unary(os);
|
||||
|
||||
footer(os);
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
public:
|
||||
template<class Stream>
|
||||
Stream& header(Stream& os) const {
|
||||
FunctionBase::header(os);
|
||||
|
||||
os << "//\n"
|
||||
<< "// MatrixFunctions.h\n"
|
||||
<< "//\n\n";
|
||||
return os;
|
||||
}
|
||||
|
||||
// binary functions
|
||||
template<class Stream>
|
||||
Stream& binary(Stream& os) const {
|
||||
FunctionBase::binary(os);
|
||||
|
||||
for(bfun_iterator fun = bfun().begin(); fun != bfun().end(); ++fun) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn " << fun->name() << "(const Matrix<T1, Rows, Cols>& lhs, const Matrix<T2, Cols, Cols>& rhs)\n"
|
||||
<< " * \\brief " << fun->description() << " function for two Matrizes.\n"
|
||||
<< " * \\ingroup " << fun->group() << "\n"
|
||||
<< " */\n\n";
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
// binary functions with pod and std::complex<>
|
||||
template<class Stream>
|
||||
Stream& binary2(Stream& os) const {
|
||||
for(Type::const_iterator tp = m_type.begin(); tp != m_type.end(); ++tp) {
|
||||
for(bfun_iterator fun = bfun().begin(); fun != bfun().end(); ++fun) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn " << fun->name() << "(const Matrix<T, Rows, Cols>& lhs, " << tp->name() << " rhs)\n"
|
||||
<< " * \\brief " << fun->description() << " function on Matrix and " << tp->description() << ".\n"
|
||||
<< " * \\ingroup " << fun->group() << "\n"
|
||||
<< " */\n\n";
|
||||
|
||||
// os << "/**\n"
|
||||
// << " * \\fn " << fun->name() << "(" << tp->name() << " lhs, const Matrix<T, Rows, Cols>& rhs)\n"
|
||||
// << " * \\brief " << fun->description() << " function on " << tp->description() << " and Matrix.\n"
|
||||
// << " * \\ingroup " << fun->group() << "\n"
|
||||
// << " */\n\n";
|
||||
}
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
// binary functions with expressions
|
||||
template<class Stream>
|
||||
Stream& binary3(Stream& os) const {
|
||||
for(bfun_iterator fun = bfun().begin(); fun != bfun().end(); ++fun) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn " << fun->name() << "(const XprMatrix<E, Rows, Cols>& lhs, const Matrix<T, Rows, Cols>& rhs)\n"
|
||||
<< " * \\brief " << fun->description() << " function on XprMatrix and Matrix.\n"
|
||||
<< " * \\ingroup " << fun->group() << "\n"
|
||||
<< " */\n\n";
|
||||
|
||||
os << "/**\n"
|
||||
<< " * \\fn " << fun->name() << "(const Matrix<T, Rows, Cols>& lhs, const XprMatrix<E, Rows, Cols>& rhs)\n"
|
||||
<< " * \\brief " << fun->description() << " function on Matrix and XprMatrix.\n"
|
||||
<< " * \\ingroup " << fun->group() << "\n"
|
||||
<< " */\n\n";
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
// unary functions
|
||||
template<class Stream>
|
||||
Stream& unary(Stream& os) const {
|
||||
FunctionBase::unary(os);
|
||||
|
||||
for(ufun_iterator fun = ufun().begin(); fun != ufun().end(); ++fun) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn " << fun->name() << "(const Matrix<T, Rows, Cols>& rhs)\n"
|
||||
<< " * \\brief " << fun->description() << " function on Matrix.\n"
|
||||
<< " * \\ingroup " << fun->group() << "\n"
|
||||
<< " */\n\n";
|
||||
}
|
||||
return os;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
XprFunctions xpr_fun;
|
||||
VectorFunctions vec_fun;
|
||||
MatrixFunctions mtx_fun;
|
||||
|
||||
Function::doxy_groups(std::cout);
|
||||
|
||||
xpr_fun(std::cout);
|
||||
vec_fun(std::cout);
|
||||
mtx_fun(std::cout);
|
||||
}
|
||||
425
tvmet-1.7.1/doc/dox_operators.cc
Normal file
425
tvmet-1.7.1/doc/dox_operators.cc
Normal file
@@ -0,0 +1,425 @@
|
||||
/*
|
||||
* Tiny Vector Matrix Library
|
||||
* Dense Vector Matrix Libary of Tiny size using Expression Templates
|
||||
*
|
||||
* Copyright (C) 2001 - 2003 Olaf Petzold <opetzold@users.sourceforge.net>
|
||||
*
|
||||
* 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.1 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
|
||||
*
|
||||
* $Id: dox_operators.cc,v 1.6 2003/11/30 08:26:25 opetzold Exp $
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#include <tvmet/config.h>
|
||||
|
||||
#include "Util.h"
|
||||
|
||||
class OperatorBase
|
||||
{
|
||||
public:
|
||||
OperatorBase() {
|
||||
m_binary_operators.push_back( BinaryOperator("+", "Addition") );
|
||||
m_binary_operators.push_back( BinaryOperator("-", "Subtraction") );
|
||||
m_binary_operators.push_back( BinaryOperator("*", "Multliply") );
|
||||
m_binary_operators.push_back( BinaryOperator("/", "Division") );
|
||||
m_binary_operators.push_back( BinaryOperator("%", "Modulo", true) );
|
||||
m_binary_operators.push_back( BinaryOperator("^", "Exclusive OR", true) );
|
||||
m_binary_operators.push_back( BinaryOperator("&", "AND", true) );
|
||||
m_binary_operators.push_back( BinaryOperator("|", "OR", true) );
|
||||
m_binary_operators.push_back( BinaryOperator("<<", "Left Shift", true) );
|
||||
m_binary_operators.push_back( BinaryOperator(">>", "Right Shift", true) );
|
||||
m_binary_operators.push_back( BinaryOperator(">", "Bigger") );
|
||||
m_binary_operators.push_back( BinaryOperator("<", "Lesser") );
|
||||
m_binary_operators.push_back( BinaryOperator(">=", "Bigger Equal") );
|
||||
m_binary_operators.push_back( BinaryOperator("<=", "Less Equal") );
|
||||
m_binary_operators.push_back( BinaryOperator("==", "Equal") );
|
||||
m_binary_operators.push_back( BinaryOperator("!=", "Not Equal") );
|
||||
m_binary_operators.push_back( BinaryOperator("&&", "Logical AND", true) );
|
||||
m_binary_operators.push_back( BinaryOperator("||", "Logical OR", true) );
|
||||
|
||||
m_unary_operators.push_back( UnaryOperator("!", "Logical Not", true) );
|
||||
m_unary_operators.push_back( UnaryOperator("~", "Bitwise Not", true) );
|
||||
m_unary_operators.push_back( UnaryOperator("-", "Negate") );
|
||||
}
|
||||
|
||||
virtual ~OperatorBase() { }
|
||||
|
||||
public:
|
||||
template<class Stream>
|
||||
Stream& header(Stream& os) const {
|
||||
m_type.header(os);
|
||||
return os;
|
||||
}
|
||||
|
||||
template<class Stream>
|
||||
Stream& footer(Stream& os) const {
|
||||
m_type.footer(os);
|
||||
return os;
|
||||
}
|
||||
|
||||
template<class Stream>
|
||||
Stream& binary(Stream& os) const {
|
||||
return os;
|
||||
}
|
||||
|
||||
template<class Stream>
|
||||
Stream& unary(Stream& os) const {
|
||||
return os;
|
||||
}
|
||||
|
||||
public:
|
||||
typedef std::vector< BinaryOperator >::const_iterator bop_iterator;
|
||||
typedef std::vector< UnaryOperator >::const_iterator uop_iterator;
|
||||
|
||||
public:
|
||||
virtual const std::vector< BinaryOperator >& bop() const { return m_binary_operators; }
|
||||
virtual const std::vector< UnaryOperator >& uop() const { return m_unary_operators; }
|
||||
|
||||
protected:
|
||||
std::vector< BinaryOperator > m_binary_operators;
|
||||
std::vector< UnaryOperator > m_unary_operators;
|
||||
Type m_type;
|
||||
};
|
||||
|
||||
|
||||
class XprOperators : public OperatorBase
|
||||
{
|
||||
public:
|
||||
XprOperators() { }
|
||||
|
||||
public:
|
||||
template<class Stream>
|
||||
Stream& operator()(Stream& os) const {
|
||||
header(os);
|
||||
|
||||
binary(os);
|
||||
binary2(os);
|
||||
unary(os);
|
||||
|
||||
footer(os);
|
||||
return os;
|
||||
}
|
||||
|
||||
public:
|
||||
template<class Stream>
|
||||
Stream& header(Stream& os) const {
|
||||
OperatorBase::header(os);
|
||||
|
||||
os << "//\n"
|
||||
<< "// XprOperators.h\n"
|
||||
<< "//\n\n";
|
||||
return os;
|
||||
}
|
||||
|
||||
// global binary math, bitops and logical operators
|
||||
template<class Stream>
|
||||
Stream& binary(Stream& os) const {
|
||||
OperatorBase::binary(os);
|
||||
|
||||
for(bop_iterator op = bop().begin(); op != bop().end(); ++op) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(const XprVector<E1, Sz>& lhs, const XprVector<E2, Sz>& rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator for two XprVector\n"
|
||||
<< " * \\ingroup " << op->group() << "\n"
|
||||
<< " */\n\n";
|
||||
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(const XprMatrix<E1, Rows1, Cols1>& lhs, const XprMatrix<E2, Cols1, Cols2>& rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator for two XprMatrix.\n"
|
||||
<< " * \\ingroup " << op->group() << "\n"
|
||||
<< " */\n\n";
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
// global binary math, bitops and logical operators with pod and std::complex<>
|
||||
template<class Stream>
|
||||
Stream& binary2(Stream& os) const {
|
||||
for(Type::const_iterator tp = m_type.begin(); tp != m_type.end(); ++tp) {
|
||||
for(bop_iterator op = bop().begin(); op != bop().end(); ++op) {
|
||||
if(tp->is_int() && op->int_only()) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(const XprVector<E, Sz>& lhs, " << tp->name() << " rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator between XprVector and " << tp->description() << ".\n"
|
||||
<< " * \\ingroup " << op->group() << "\n"
|
||||
<< " */\n\n";
|
||||
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(" << tp->name() << " lhs, const XprVector<E, Sz>& rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator between " << tp->description() << " and XprVector.\n"
|
||||
<< " * \\ingroup " << op->group() << "\n"
|
||||
<< " */\n\n";
|
||||
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(const XprMatrix<E, Rows, Cols>& lhs, " << tp->name() << " rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator between XprMatrix and " << tp->description() << ".\n"
|
||||
<< " * \\ingroup " << op->group() << "\n"
|
||||
<< " */\n\n";
|
||||
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(" << tp->name() << " lhs, const XprMatrix<E, Rows, Cols>& rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator between " << tp->description() << " and XprMatrix.\n"
|
||||
<< " * \\ingroup " << op->group() << "\n"
|
||||
<< " */\n\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
// global unary operators
|
||||
template<class Stream>
|
||||
Stream& unary(Stream& os) const {
|
||||
OperatorBase::unary(os);
|
||||
|
||||
for(uop_iterator op = uop().begin(); op != uop().end(); ++op) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(const XprVector<E, Sz>& rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator for XprVector\n"
|
||||
<< " * \\ingroup " << op->group() << "\n"
|
||||
<< " */\n\n";
|
||||
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(const XprMatrix<E, Rows, Cols>& rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator for XprMatrix.\n"
|
||||
<< " * \\ingroup " << op->group() << "\n"
|
||||
<< " */\n\n";
|
||||
}
|
||||
return os;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class VectorOperators : public OperatorBase
|
||||
{
|
||||
public:
|
||||
VectorOperators() { }
|
||||
|
||||
public:
|
||||
template<class Stream>
|
||||
Stream& operator()(Stream& os) const {
|
||||
header(os);
|
||||
|
||||
binary(os);
|
||||
binary2(os);
|
||||
binary3(os);
|
||||
unary(os);
|
||||
|
||||
footer(os);
|
||||
}
|
||||
|
||||
public:
|
||||
template<class Stream>
|
||||
Stream& header(Stream& os) const {
|
||||
OperatorBase::header(os);
|
||||
|
||||
os << "//\n"
|
||||
<< "// VectorOperators.h\n"
|
||||
<< "//\n\n";
|
||||
return os;
|
||||
}
|
||||
|
||||
// global binary math, bitops and logical operators
|
||||
template<class Stream>
|
||||
Stream& binary(Stream& os) const {
|
||||
OperatorBase::binary(os);
|
||||
|
||||
for(bop_iterator op = bop().begin(); op != bop().end(); ++op) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(const Vector<T1, Sz>& lhs, const Vector<T2, Sz>& rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator for two Vector\n"
|
||||
<< " * \\ingroup " << op->group() << "\n"
|
||||
<< " */\n\n";
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
// global binary math, bitops and logical operators with pod and std::complex<>
|
||||
template<class Stream>
|
||||
Stream& binary2(Stream& os) const {
|
||||
for(Type::const_iterator tp = m_type.begin(); tp != m_type.end(); ++tp) {
|
||||
for(bop_iterator op = bop().begin(); op != bop().end(); ++op) {
|
||||
if(tp->is_int() && op->int_only()) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(const Vector<T, Sz>& lhs, " << tp->name() << " rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator between Vector and " << tp->description() << ".\n"
|
||||
<< " * \\ingroup _operators\n"
|
||||
<< " * \\ingroup " << op->group() << "\n";
|
||||
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(" << tp->name() << " lhs, const Vector<T, Sz>& rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator between " << tp->description() << " and Vector.\n"
|
||||
<< " * \\ingroup " << op->group() << "\n"
|
||||
<< " */\n\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
// global binary operations with expressions
|
||||
template<class Stream>
|
||||
Stream& binary3(Stream& os) const {
|
||||
for(bop_iterator op = bop().begin(); op != bop().end(); ++op) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(const XprVector<E, Sz>& lhs, const Vector<T, Sz>& rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator between XprVector and Vector\n"
|
||||
<< " * \\ingroup " << op->group() << "\n"
|
||||
<< " */\n\n";
|
||||
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(const Vector<T, Sz>& lhs, const XprVector<E, Sz>& rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator between Vector and XprVector\n"
|
||||
<< " * \\ingroup " << op->group() << "\n"
|
||||
<< " */\n\n";
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
// global unary operators
|
||||
template<class Stream>
|
||||
Stream& unary(Stream& os) const {
|
||||
OperatorBase::unary(os);
|
||||
|
||||
for(uop_iterator op = uop().begin(); op != uop().end(); ++op) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(const Vector<T, Sz>& rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator for Vector\n"
|
||||
<< " * \\ingroup " << op->group() << "\n"
|
||||
<< " */\n\n";
|
||||
}
|
||||
return os;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
class MatrixOperators : public OperatorBase
|
||||
{
|
||||
public:
|
||||
MatrixOperators() { }
|
||||
|
||||
public:
|
||||
template<class Stream>
|
||||
Stream& operator()(Stream& os) const {
|
||||
header(os);
|
||||
|
||||
binary(os);
|
||||
binary2(os);
|
||||
binary3(os);
|
||||
unary(os);
|
||||
|
||||
footer(os);
|
||||
}
|
||||
|
||||
public:
|
||||
template<class Stream>
|
||||
Stream& header(Stream& os) const {
|
||||
OperatorBase::header(os);
|
||||
|
||||
os << "//\n"
|
||||
<< "// MatrixOperators.h\n"
|
||||
<< "//\n\n";
|
||||
return os;
|
||||
}
|
||||
|
||||
// global binary math, bitops and logical operators
|
||||
template<class Stream>
|
||||
Stream& binary(Stream& os) const {
|
||||
OperatorBase::binary(os);
|
||||
|
||||
for(bop_iterator op = bop().begin(); op != bop().end(); ++op) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(const Matrix<T1, Rows1, Cols1>& lhs, const Matrix<T2, Cols1, Cols2>& rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator for two Matrizes\n"
|
||||
<< " * \\ingroup " << op->group() << "\n"
|
||||
<< " */\n\n";
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
// global binary math, bitops and logical operators with pod and std::complex<>
|
||||
template<class Stream>
|
||||
Stream& binary2(Stream& os) const {
|
||||
for(Type::const_iterator tp = m_type.begin(); tp != m_type.end(); ++tp) {
|
||||
for(bop_iterator op = bop().begin(); op != bop().end(); ++op) {
|
||||
if(tp->is_int() && op->int_only()) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(const Matrix<T, Rows, Cols>& lhs, " << tp->name() << " rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator between Vector and " << tp->description() << ".\n"
|
||||
<< " * \\ingroup " << op->group() << "\n"
|
||||
<< " */\n\n";
|
||||
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(" << tp->name() << " lhs, const Matrix<T, Rows, Cols>& rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator between " << tp->description() << " and Vector.\n"
|
||||
<< " * \\ingroup " << op->group() << "\n"
|
||||
<< " */\n\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
// global binary operations with expressions
|
||||
template<class Stream>
|
||||
Stream& binary3(Stream& os) const {
|
||||
for(bop_iterator op = bop().begin(); op != bop().end(); ++op) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(const XprMatrix<E, Rows, Cols>& lhs, const Matrix<T, Rows, Cols>& rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator between XprMatrix and Matrix\n"
|
||||
<< " * \\ingroup " << op->group() << "\n"
|
||||
<< " */\n\n";
|
||||
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(const Matrix<T, Rows, Cols>& lhs, const XprMatrix<E, Rows, Cols>& rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator between Matrix and XprMatrix\n"
|
||||
<< " * \\ingroup " << op->group() << "\n"
|
||||
<< " */\n\n";
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
// global unary operators
|
||||
template<class Stream>
|
||||
Stream& unary(Stream& os) const {
|
||||
OperatorBase::unary(os);
|
||||
|
||||
for(uop_iterator op = uop().begin(); op != uop().end(); ++op) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(const Matrix<T, Rows, Cols>& rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator for Matrix\n"
|
||||
<< " * \\ingroup " << op->group() << "\n"
|
||||
<< " */\n\n";
|
||||
}
|
||||
return os;
|
||||
}
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
XprOperators xpr_op;
|
||||
VectorOperators vec_op;
|
||||
MatrixOperators mtx_op;
|
||||
|
||||
Operator::doxy_groups(std::cout);
|
||||
|
||||
xpr_op(std::cout);
|
||||
//vec_op(std::cout);
|
||||
//mtx_op(std::cout);
|
||||
}
|
||||
295
tvmet-1.7.1/doc/faq.dox
Normal file
295
tvmet-1.7.1/doc/faq.dox
Normal file
@@ -0,0 +1,295 @@
|
||||
/**
|
||||
\page faq FAQ
|
||||
|
||||
<p>Contents:</p>
|
||||
-# \ref license_tvmet
|
||||
-# \ref commercial_tvmet
|
||||
-# \ref debug
|
||||
-# \ref optimize
|
||||
-# \ref ambiguous_overload
|
||||
-# \ref conversion_non_scalar
|
||||
-# \ref could_not_convert
|
||||
-# \ref assign_op
|
||||
-# \ref comma_initializer
|
||||
-# \ref no_match_operator
|
||||
-# \ref dimension_error
|
||||
-# \ref rtlx_kernel_crash
|
||||
-# \ref regressiontest_failed
|
||||
|
||||
Certain items on this page are also covered by the \ref usage and \ref notes
|
||||
pages!
|
||||
|
||||
|
||||
|
||||
\section license_tvmet How is tvmet licensed?
|
||||
|
||||
tvmet comes with completely free source code. tvmet is available under the
|
||||
terms of the GNU Lesser General Public License (LGPL).
|
||||
|
||||
I have amended the LGPL to explicitly allow statically linking tvmet (or any
|
||||
modified version of tvmet) to your software. The LGPL is not clear on this
|
||||
and I definitely want to allow it.
|
||||
|
||||
\sa \ref license
|
||||
|
||||
|
||||
|
||||
|
||||
\section commercial_tvmet Can I use it in commercial software products?
|
||||
|
||||
Yes, you can. The LGPL allows you to do this, and you do not need to release
|
||||
the source code to your software. You do need to release the source code for
|
||||
any modifications you make to tvmet itself. (We would hope you would send
|
||||
any improvements like these back to us anyways.)
|
||||
|
||||
|
||||
|
||||
|
||||
\section debug Debugging the code
|
||||
|
||||
Not all faults can be caught at compile time. Therefore, there is a need
|
||||
for runtime debugging by defining <code>TVMET_DEBUG</code> (e.g. index
|
||||
operators of <code>Vector::operator(i)</code> and
|
||||
<code>Matrix::operator(i,j)</code>). On defined TVMET_DEBUG a bounds checking
|
||||
is involved. Runtime errors are handled throwing an assertion failure using
|
||||
std::assert(). <code>TVMET_DEBUG</code> is <b>not</b> enabled by defining
|
||||
<code>DEBUG</code>. This behavior differs from release less than 0.6.0
|
||||
|
||||
If you don't get the expected result on certain operations you can try the
|
||||
\ref expr_print feature to check that the expression is being evaluated as
|
||||
you expect.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section optimize Optimizing the code
|
||||
|
||||
Starting after tvmet 1.5.0 there is a new define <code>TVMET_OPTIMIZE</code>.
|
||||
|
||||
If this is defined tvmet uses some compiler specific keywords.
|
||||
Mainly, this declares the functions using gcc's
|
||||
<tt>__attribute__((always_inline))</tt>. This allows the
|
||||
compiler to produce high efficient code even on less
|
||||
optimization levels, like gcc's -O2 or even -O!
|
||||
This is known to work with gcc v3.3.3 (and higher).
|
||||
Using icc's v8 gnuc compatibility mode this may work, I've read
|
||||
that it's using as an hint, this means you can have static inline
|
||||
functions inside left so you can't get the full power of this feature
|
||||
for circumstances.
|
||||
|
||||
|
||||
|
||||
|
||||
\section ambiguous_overload ambiguous overload for ... Compiler Error
|
||||
|
||||
When using gcc-2.96 you can get a compiler error like:
|
||||
|
||||
\code
|
||||
ambiguous overload for ...
|
||||
/usr/include/g++-3/stl_relops.h:42: candidates are: bool operator>
|
||||
...
|
||||
\endcode
|
||||
|
||||
I haven't any solution for this--even if I don't use it in the tvmet library.
|
||||
A simple define __SGI_STL_INTERNAL_RELOPS in the config header doesn't solve
|
||||
the problem. The easiest way (brute force method) is to comment out all
|
||||
operators in stl_reops.h. (The better way is to use the gcc-3.0.x and later,
|
||||
see \ref compiler.)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section conversion_non_scalar conversion from ... to non-scalar type ... Compiler Error
|
||||
|
||||
You get a compiler error like:
|
||||
|
||||
\code
|
||||
conversion from `tvmet::XprVector< ... >, Sz>' to non-scalar type
|
||||
`tvmet::Vector<T, Sz>' requested
|
||||
\endcode
|
||||
|
||||
Please read about \ref construct. You probably ignored or forgot the rules
|
||||
of using expression templates.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section could_not_convert could not convert `tvmet::operatorXX(...)' to `bool' ... Compiler Error
|
||||
|
||||
You get a compiler error like:
|
||||
|
||||
\code
|
||||
could not convert `tvmet::operator==( ... , ... )' to `bool'
|
||||
\endcode
|
||||
|
||||
In the example above, you did try (or hoped) to use a global operator==
|
||||
which doesn't return a bool. Please read \ref compare.
|
||||
|
||||
|
||||
|
||||
|
||||
\section assign_op no match for ?= operator
|
||||
|
||||
You get a compiler error like:
|
||||
|
||||
\code
|
||||
no match for `tvmet::Vector<...>& /= tvmet::Vector<...>&' operator
|
||||
\endcode
|
||||
|
||||
For element-wise operations, you need to use the element_wise namespace
|
||||
(found within tvmet). As the name suggests, all these operators are
|
||||
performed in an element wise fashion. (e.g. division of two vectors--not
|
||||
allowed from a mathematical perspective--element by element.) The following
|
||||
code snippet shows how to use it:
|
||||
|
||||
\code
|
||||
using namespace tvmet;
|
||||
Vector<double,3> v1, v2;
|
||||
|
||||
v1 = 1,2,3;
|
||||
v2 = v1;
|
||||
|
||||
cout << v1 << endl;
|
||||
{
|
||||
using namespace tvmet::element_wise;
|
||||
v1 /= v2;
|
||||
}
|
||||
cout << v1 << endl;
|
||||
\endcode
|
||||
|
||||
\sa \ref operators
|
||||
\sa \ref alias
|
||||
|
||||
|
||||
|
||||
|
||||
\section comma_initializer storage size of `ERROR_CommaInitializerList_is_too_long' isn't known
|
||||
|
||||
You get a compiler error like:
|
||||
|
||||
\code
|
||||
In member function `tvmet::CommaInitializer<Obj, LEN>::Initializer<T, (N + 1)> ....
|
||||
storage size of `ERROR_CommaInitializerList_is_too_long' isn't known
|
||||
\endcode
|
||||
|
||||
You have caused a forced compile time error. tvmet prevents you from
|
||||
overwriting foreign memory! In other words, your comma separated initializer
|
||||
list is too long, e.g. you wrote something like:
|
||||
|
||||
\code
|
||||
using namespace tvmet;
|
||||
Vector<double,3> v0;
|
||||
|
||||
v0 = 1,2,3,4,5,6,7,8,9;
|
||||
\endcode
|
||||
|
||||
You just tried to fill a %Vector of length 3 with 9 values, which would
|
||||
normally result in values being written off the end of the vector. tvmet
|
||||
prevents this with the compile time error you just saw.
|
||||
|
||||
|
||||
|
||||
|
||||
\section no_match_operator no match for `...' operator
|
||||
|
||||
You get a compiler error like:
|
||||
|
||||
\code
|
||||
no match for `tvmet::Matrix<T, Sz, Sz>& * tvmet::XprVector<tvmet::MatrixColVectorReference<T, Sz, Sz>, Sz>' operator
|
||||
include/tvmet/xpr/VectorOperators.h:123: candidates are:
|
||||
// a lot of candidates....
|
||||
\endcode
|
||||
|
||||
Perhaps you wrote code like:
|
||||
|
||||
\code
|
||||
Matrix<float,3,3> eigenvecs;
|
||||
Matrix<float,3,3> M;
|
||||
...
|
||||
|
||||
Vector<float,3> ev0( M * col(eigenvecs, 0) );
|
||||
\endcode
|
||||
|
||||
Using %tvmet prior to release 1.2.0 in this case: Obviously an operator
|
||||
is missing... but which one? Well, all arithmetic operators have a
|
||||
functional equivalent, in this case, prod(). Rewriting the code above
|
||||
using the function syntax will give you a more descriptive error message:
|
||||
|
||||
\code
|
||||
no matching function for call to
|
||||
`prod(tvmet::Matrix<float, 3, 3>&, tvmet::XprVector<tvmet::MatrixColVectorReference<float, 3, 3>, 3>)'
|
||||
\endcode
|
||||
|
||||
This says, I forgot to write a function with the appropriate operator.
|
||||
In this case, please give me a hint by writing a short example, used compiler
|
||||
and tvmet release.
|
||||
|
||||
\sa \ref dimension_error.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section dimension_error no match for `tvmet::Matrix<double, R, C>& * tvmet::Vector<double, Sz>&' operator
|
||||
|
||||
You get a compiler error like:
|
||||
|
||||
\code
|
||||
no match for `tvmet::Matrix<double, 4, 4>& * tvmet::Vector<double, 3>&' operator
|
||||
candidates are: T tvmet::operator*(const T&, ...) ...
|
||||
\endcode
|
||||
|
||||
This is a feature of tvmet. The compiler detects a mathematical problem:
|
||||
You tried call an operator between tvmet objects which had incompatible
|
||||
dimensions. For example, you attempted to multiply a matrix of dimension
|
||||
4x4 with a vector of size 3 - this isn't mathematically feasible.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section rtlx_kernel_crash Using with Linux Real-time Extensions crashes in kernel mode
|
||||
|
||||
Normally there should not be a problem on using tvmet inside Linux kernel
|
||||
space as a C++ kernel module. Unfortunately, code working in normal
|
||||
environment (e.g. Linux user space) crashes the Linux box by using linux
|
||||
real-time extensions, definitely on <a href=http://www.rtai.org>RTAI</a>.
|
||||
|
||||
I haven't found the reason yet, my knowledge of assembler and debugging is
|
||||
too limited.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section regressiontest_failed Failed regression tests
|
||||
|
||||
Well, this is a strange world. It can happen that some (especially the
|
||||
tan) regression test can fail. This is not a problem with the %tvmet library.
|
||||
After some hours I reduce the problem to:
|
||||
|
||||
\code
|
||||
cout << (std::tan(1.0) - std::tan(1.0)) << endl;
|
||||
\endcode
|
||||
|
||||
got <tt>6.17995e-17</tt> on my Linux Mandrake 8.2/9.1 box. It makes no
|
||||
difference if I take the tan function from namespace std or from the global
|
||||
namespace. This is especially a problem for g++ v3.2 and prior. The Intel
|
||||
compiler v7.0 isn't affected.
|
||||
|
||||
Especially on VC++ 7.1 you will get 2 failed tests for complex
|
||||
%Matrix and %Vector. The error is about <tt>8.88178e-016</tt> and
|
||||
<tt>1.77636e-015</tt>.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
// Local Variables:
|
||||
// mode:c++
|
||||
// End:
|
||||
// LocalWords: RTAI
|
||||
17
tvmet-1.7.1/doc/footer.html.in
Normal file
17
tvmet-1.7.1/doc/footer.html.in
Normal file
@@ -0,0 +1,17 @@
|
||||
<hr>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="20%" align="right" valign="center">
|
||||
Author:<br>
|
||||
<script language="JavaScript">
|
||||
var m_name="opetzold";
|
||||
var m_domain="users.sourceforge.net";
|
||||
var m_text='<a href="mailto:'+m_name+'@'+m_domain+'?subject=tvmet @VERSION@">';
|
||||
m_text+='Olaf Petzold</a>';
|
||||
document.write(m_text);
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
37
tvmet-1.7.1/doc/header.html
Normal file
37
tvmet-1.7.1/doc/header.html
Normal file
@@ -0,0 +1,37 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html>
|
||||
<head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
|
||||
<title>
|
||||
Tiny Vector Matrix library using Expression Templates
|
||||
</title>
|
||||
<!-- This Tiny Vector and Matrix C++ template libary uses Meta Templates and
|
||||
Expression Templates to evaluate results at compile time - to make it fast
|
||||
for low order (tiny) systems. -->
|
||||
<META name="description" content="This Tiny Vector and Matrix C++ template
|
||||
libary uses Meta Templates and Expression Templates to evaluate results
|
||||
at compile time - to make it fast for low order (tiny) systems.">
|
||||
<META name="keywords" content="tiny, vector, matrix, fast, C++, STL, template, library,
|
||||
expression templates, meta templates, fixed size, fixed dimension,
|
||||
matrix-matrix, matrix-vector, vector-matrix, binary, unary, operations, operators,
|
||||
product, transpose, linear algebra, cross product, dot product, type promotion,
|
||||
exception, linux, kernel, embedded system, regression test, gcc, g++,
|
||||
blitz, blitz++, TinyVector, TinyMatrix, MTL, TNT,
|
||||
gnu compiler suite, portland group c++, kai c++, intel compiler, LGPL">
|
||||
<link href="tvmet.css" rel="stylesheet" type="text/css">
|
||||
</head>
|
||||
<body bgcolor="#ffffff">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="20%" align="left" valign="center">
|
||||
<a href="http://sourceforge.net/projects/tvmet">
|
||||
<img src="http://sourceforge.net/sflogo.php?group_id=39733&type=3" width="125" height="37" border="0" alt="SourceForge Logo"></a>
|
||||
</td>
|
||||
<td width="50%" align="center" valign="center">
|
||||
<b><big>T</big>iny <big>V</big>ector <big>M</big>atrix library using <big>E</big>xpression <big>T</big>emplates</b>
|
||||
</td>
|
||||
<td width="20%" align="right" valign="center">
|
||||
<a href="http://tvmet.sourceforge.net">Sourceforge Project Page</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr>
|
||||
140
tvmet-1.7.1/doc/intro.dox
Normal file
140
tvmet-1.7.1/doc/intro.dox
Normal file
@@ -0,0 +1,140 @@
|
||||
/*
|
||||
* $Id: intro.dox,v 1.12 2004/11/30 09:05:53 opetzold Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
\mainpage
|
||||
|
||||
\section intro_contents Contents
|
||||
- \ref introduction
|
||||
- \ref license
|
||||
- \ref news
|
||||
- \ref changelog
|
||||
- \ref benchmark
|
||||
- \ref build
|
||||
- \ref usage
|
||||
- \ref faq
|
||||
- \ref notes
|
||||
- \ref compiler
|
||||
- \ref works
|
||||
- \ref credits
|
||||
- \ref projects
|
||||
- \ref links
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
\page introduction Introduction
|
||||
|
||||
This Tiny %Vector and %Matrix template library uses
|
||||
<a href=http://extreme.indiana.edu/~tveldhui/papers/Template-Metaprograms/meta-art.html>Meta Templates</a>
|
||||
(MT) and <a href=http://extreme.indiana.edu/~tveldhui/papers/Expression-Templates/exprtmpl.html>
|
||||
Expression Templates</a> (ET) to evaluate results at compile time -- which
|
||||
makes it fast for low order (tiny) systems. "Tiny" is a subjective term,
|
||||
but typically means vectors and matrices of size ten (10) or less.
|
||||
|
||||
The technique used internally by tvmet is described by Todd Veldhuizen:
|
||||
|
||||
- <a href=http://osl.iu.edu/~tveldhui/papers/techniques/>
|
||||
Techniques for Scientific C++</a>
|
||||
- <a href=http://osl.iu.edu/~tveldhui/papers/Expression-Templates/exprtmpl.html>
|
||||
Expression Templates</a>
|
||||
- <a href=http://osl.iu.edu/~tveldhui/papers/Template-Metaprograms/meta-art.html>
|
||||
Template Metaprograms</a>
|
||||
|
||||
and is used by his <a href=http://oonumerics.org/blitz/>blitz++</a>, too.
|
||||
Therefore, the speed achieved by tvmet is similar to the speed of blitz++.
|
||||
Unfortunately, blitz++ isn't developed any more (year 2001, 2002)
|
||||
because of other interests being pursued by Todd Veldhuizen (like his Ph.D.).
|
||||
Furthermore, blitz++'s TinyVector is mainly developed for use by the blitz++
|
||||
Array class -- and not for minimalistic/tiny fast math support for which
|
||||
tvmet <b>is</b> designed. Because of this, the operators and functions are
|
||||
incomplete or not supported well. blitz::TinyMatrix supports a few lesser
|
||||
operators and functions (as with blitz::TinyVector). blitz++ doesn't conform
|
||||
to STL (e.g. Container<>::value_type isn't defined), it defines a T_numtype
|
||||
or, for blitz::TinyVector, it does have an iterator begin() - but the end()
|
||||
is missing (blitz::TinyMatrix doesn't have anything).
|
||||
|
||||
These were reasons why I developed tvmet. Still, tvmet is designed to be more
|
||||
than a mere rehashing of blitz++. The primary design goals are:
|
||||
|
||||
-# mathematical notation and correctness,
|
||||
-# high efficiency for small/tiny vector and matrices,
|
||||
-# functionality and wide range of supported operators and functions, and
|
||||
-# compatibility and portability.
|
||||
|
||||
The dimensions for vectors and matrices are statically bound at compile
|
||||
time using template arguments. The bounded dimensions feature a <b>compile
|
||||
time dimension check</b> to force adherence to proper dimensional sizes
|
||||
between operands (even in the night if you are sleepy). For example, you
|
||||
can't assign a %Vector or %Matrix with dimension = 3 to a %Vector or %Matrix
|
||||
of dimension = 4; nor can you create an expression using a binary operation
|
||||
between arguments with incompatible dimensions. This is a major difference
|
||||
between tvmet (which features this) and blitz++ (which does not prevent
|
||||
from this). Nevertheless, tvmet isn't a matlab, maple or octave for C++.
|
||||
|
||||
tvmet is a general purpose library and is not (yet) a linear algebra library.
|
||||
It does not have an interface to other numerical libraries as BLAS or LAPACK.
|
||||
<a href="http://sourceforge.net/projects/tvmet">Tiny Vector Matrix template
|
||||
library</a> offers these features:
|
||||
|
||||
-# Matrices and Vectors with fixed sizes (of course), the data is stored in
|
||||
a static array.
|
||||
-# compile time dimension check for Vectors and Matrices to preserve the
|
||||
mathematical meaning.
|
||||
-# vector, matrix, matrix-matrix and matrix-vector fast operations:
|
||||
- complete set of standard arithmetic operations for Vectors and Matrices
|
||||
(<a href=http://oonumerics.org/blitz/>blitz++</a> supports this only for
|
||||
TinyVector).
|
||||
- complete set of standard compare operations for Vectors and Matrices
|
||||
as well as ternary functions like <tt>a ? b : c</tt> (see eval for use).
|
||||
- binary and unary operations.
|
||||
- meta template use for %Matrix-Matrix-Product \f$M\,M\f$,
|
||||
%Matrix-Transpose \f$M^T\f$ and %Matrix-Vector-Product \f$M\,x\f$
|
||||
functions and operators.
|
||||
- meta template for special functions like
|
||||
\f$M^T\, x\f$, \f$M^T\,M\f$, \f$M\,M^T\f$ and \f$(M\,M)^T\f$
|
||||
functions, see \ref spec_meta_func.
|
||||
- simple %Matrix rows and column access as a %Vector.
|
||||
- chaining of matrix and vector expressions is possible and working.
|
||||
- %Vector inner and outer product (dot and cross product).
|
||||
-# special handling for the aliasing problem - see \ref alias.
|
||||
-# STL iterator interface. This opens the door to all sorts of great STL
|
||||
applications.
|
||||
-# type promotion (for handling Matrices and Vectors of differing types).
|
||||
-# works on self defined types such as the std::complex<> type.
|
||||
-# makes no use of exceptions. Therefore you can use it for embedded systems
|
||||
or in Linux kernel space.
|
||||
-# nice expression level printing for debugging purposes (print the expanded
|
||||
expression tree).
|
||||
-# good documentation with examples.
|
||||
-# regression tests for nearly all operations and functions.
|
||||
-# support for several compilers (see \ref compiler).
|
||||
-# written as a pure class and template library, no binary libraries and
|
||||
versioning are needed - designed to avoid code blot due to the use of
|
||||
templates.
|
||||
-# ISO/IEC 14882:1998 compliant.
|
||||
|
||||
Although there are many advantages and features, tvmet has some limitations.
|
||||
Due to the expression template and meta template programming, the compilation
|
||||
time increases for higher dimensional constructs. This can cause resource
|
||||
limitations, especially for memory (during compilation). On the other hand,
|
||||
the runtime performance will also decrease on higher order. Therefore only
|
||||
use tvmet only tiny (typically less than 10) sizes. (The maximum useful
|
||||
size/dimension depends on the operation, of course.) The \ref benchmark
|
||||
gives a good entry point about these problem.
|
||||
<a href=http://www.oonumerics.org/oon/#libraries>Other</a>
|
||||
general purpose libraries and linear algebra libraries will do a better job
|
||||
for larger matrix/vector problems.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
\bugs regression test TestUnFunc::Arc and TestUnFunc::Log fails due to
|
||||
precision errors.
|
||||
*/
|
||||
|
||||
// Local Variables:
|
||||
// mode:c++
|
||||
// End:
|
||||
677
tvmet-1.7.1/doc/license.dox
Normal file
677
tvmet-1.7.1/doc/license.dox
Normal file
@@ -0,0 +1,677 @@
|
||||
/*
|
||||
* $Id: license.dox,v 1.7 2004/06/08 12:11:15 opetzold Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
\page license License
|
||||
|
||||
<p>Contents:</p>
|
||||
- \ref tvmet_license
|
||||
- \ref addendum
|
||||
- \ref rationale
|
||||
|
||||
|
||||
|
||||
\section license tvmet's License
|
||||
|
||||
Copyright (C) 2001-2003 Olaf Petzold.
|
||||
|
||||
tvmet basically follows the standard GNU Lesser General Public License (LGPL).
|
||||
Because of repeated questions on this topic, it has become apparent that many
|
||||
people still had a number of uncertainties about licensing issues. Also, a
|
||||
number of stipulations in the GNU Lesser Public License statement have
|
||||
evidently been an impediment to truely wide-spread adoption of the tvmet
|
||||
Library.
|
||||
|
||||
Thus, the intent of the License Addendum has been to provide clarification
|
||||
of a number of obscure issues in the GNU Lesser General Public License, and
|
||||
to relax a few of its stipulations with an eye to solving a couple of
|
||||
practical issues.
|
||||
|
||||
Below follows the GNU Lesser Public License, followed by the tvmet Library
|
||||
License addendum.
|
||||
|
||||
Finally, detailed rationale behind the License Addendum is presented.
|
||||
|
||||
|
||||
|
||||
|
||||
\section tvmet_license The License
|
||||
<pre>
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 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.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
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 and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, 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 library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete 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 distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
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 Library or any portion
|
||||
of it, thus forming a work based on the Library, 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) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Section 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
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 Library, 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 Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you 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.
|
||||
|
||||
If distribution of 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 satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Section 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be 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.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library 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.
|
||||
|
||||
9. 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 Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
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 with
|
||||
this License.
|
||||
|
||||
11. 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 Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library 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 Library.
|
||||
|
||||
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.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library 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.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser 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 Library
|
||||
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 Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
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
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "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
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. 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 LIBRARY 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
|
||||
LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), 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 Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. 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.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
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.1 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
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
</pre>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section addendum Addendum to License
|
||||
|
||||
<pre>
|
||||
|
||||
ADDENDUM TO LICENSE
|
||||
February 2003
|
||||
|
||||
Copyright (C) 2003 Olaf Petzold
|
||||
|
||||
Everyone is permitted to create and distribute verbatim copies
|
||||
of this license addendum document, but changing it is not allowed.
|
||||
|
||||
|
||||
tvmet License Agreement:
|
||||
|
||||
|
||||
0. tvmet ("The Library") is licensed under GNU Lesser General Public License
|
||||
as published by the Free Software Foundation, version 2.1 of the License, or
|
||||
(at your option) any later version, with the following additional conditions.
|
||||
The following conditions take precedence over any conditions or restrictions
|
||||
stipulated by the Lesser General Public License insofar as a conflict exists.
|
||||
|
||||
1. The tvmet License Agreement ("License") covers only tvmet ("The Library").
|
||||
Other libraries which the Library may use are covered by their own respective
|
||||
licenses.
|
||||
|
||||
2. Modification of the configure scripts, makefiles, or installation tools of
|
||||
the Library to support a specific platform does not constitute creating a
|
||||
modified or derivative work based on the Library.
|
||||
|
||||
3. Statically linking of a copy of the Library against any work using the
|
||||
Library, i.e. the inclusion of (parts of) the Library into a program or
|
||||
binary, is functionally equivalent to a work using the Library by linking to
|
||||
it dynamically, and therefore does not constitute creating a modified or
|
||||
derivative work based on the Library.
|
||||
|
||||
4. Otherwise, if the work is a derivative of the Library, you may distribute
|
||||
the object code for the work under the terms of the GNU Lesser General Public
|
||||
License. Any executables containing that work also may be distributed under
|
||||
the Lesser General Public License whether or not they are linked directly
|
||||
with the Library itself.
|
||||
|
||||
5. Programs or binaries linked with the Library must be identified as such by
|
||||
including, in the Documentation or by other means (for example in the About
|
||||
Box or Online Help), the following statement:
|
||||
|
||||
"This software uses tvmet (http://tvmet.sourceforge.net)."
|
||||
|
||||
|
||||
|
||||
|
||||
END OF ADDENDUM
|
||||
</pre>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section rationale Rationale
|
||||
|
||||
We now launch into a point by point discussion of the License Addendum:
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
Point 0 says that whereever LGPL and tvmet License Addendum disagree, the tvmet
|
||||
License Addendum holds. In points not covered in the tvmet License Addendum,
|
||||
LGPL shall hold.
|
||||
</li>
|
||||
<li>
|
||||
Point 1 says we can not make any statements about anyone else's code; if your
|
||||
application must use other libraries (jpeg, png, tiff, glibc, and so on), then
|
||||
you must observe the licenses of these other libraries.
|
||||
</li>
|
||||
<li>
|
||||
Point 2 clarifies that when we're talking about derived works, we're not talking
|
||||
about making some minor changes to Makefiles or configuration scripts. However,
|
||||
it would still be nice to communicate them with the tvmet community so as to be
|
||||
able to support new platforms.
|
||||
</li>
|
||||
<li>
|
||||
Point 3 addresses the practical problem of linking tvmet statically into an
|
||||
application program or combined work. LGPL insists that the recipient of a
|
||||
distribution of a combined work i.e. a program linked with the Library, be
|
||||
allowed to relink; linking a program dynamically is usually the easiest way to
|
||||
comply with this stipulation. However, there are sometimes practical or
|
||||
logistical problems which make it difficult to comply with this requirement. We
|
||||
have taken the position that static linking is functionally equivalent to
|
||||
linking dynamically, and we're not really denying the recipient of a statically
|
||||
linked program any source code he or she wouldn't be able to obtain otherwise.
|
||||
</li>
|
||||
<li>
|
||||
Point 4 says that if you make a work based on the Library, then you may
|
||||
distribute this under the Lesser General Public License:- in other words, point
|
||||
4 applies only to a work using the Library being linked (statically or
|
||||
dynamically) to the Library. It is in the spirit of LGPL that the recipient of
|
||||
the combined work not be denied anything he or she would be able to receive with
|
||||
the regular LGPL. However, statically linking an application program with a work
|
||||
based on the Library, i.e. a modified copy would do just that! Point 5 says that
|
||||
the regular Lesser General Public License applies in that case.
|
||||
</li>
|
||||
<li>
|
||||
Point 5 requires you to identify your program as using the tvmet library. With
|
||||
static linking, there would be no way for a normal user to tell otherwise. We
|
||||
request that you include the given statement, and preferably a version number
|
||||
also. The motivation is two-fold:
|
||||
|
||||
-# A certain amount of publicity for tvmet :-)
|
||||
-# Some way for recipients of your program to know that (a) your program is
|
||||
linked to the tvmet Library, and (b) for them to verify that they have in fact
|
||||
not been denied anything they would have been able to obtain under LGPL, by
|
||||
visiting this page which details the license information (there are many GPL-
|
||||
vigilantes out there, and this might appease them).
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
This concludes our remarks on the License revision; please feel free to contact
|
||||
me if you have additional questions. The rationale section will likely be
|
||||
expanded when there are still questions left unanswered.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
// Local Variables:
|
||||
// mode:c++
|
||||
// End:
|
||||
41
tvmet-1.7.1/doc/links.dox
Normal file
41
tvmet-1.7.1/doc/links.dox
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* $Id: links.dox,v 1.3 2003/12/05 19:08:59 opetzold Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
\page links Links of Interest or Related Links
|
||||
|
||||
|
||||
|
||||
\section generell General Information on Numeric C++
|
||||
- <a href=http://osl.iu.edu/~tveldhui/papers/techniques/>Techniques for Scientific C++</a>
|
||||
- <a href=http://osl.iu.edu/~tveldhui/papers/Expression-Templates/exprtmpl.html>Expression Templates</a>
|
||||
- <a href=http://osl.iu.edu/~tveldhui/papers/Template-Metaprograms/meta-art.html>Template Metaprograms</a>
|
||||
- <a href=http://oonumerics.org/oon/>The Object-Oriented Numerics Page</a> - a very good entry point
|
||||
- <a href=http://www.openscience.org/links.php?section=103>The OpenScience Project > Mathematics > Linear Algebra</a>
|
||||
- <a href=http://sal.kachinatech.com/B/0/>SAL- Numerical Analysis - Miscellaneous Software</a>
|
||||
|
||||
\section numlibs Other ET and MT Vector and Matrix Libraries
|
||||
|
||||
- <a href=http://oonumerics.org/blitz/>blitz++</a>
|
||||
- <a href=http://www.genesys-e.org/ublas/>uBlas</a>
|
||||
- <a href=http://www.lsc.nd.edu/research/mtl>MTL</a>
|
||||
- <a href=http://sourceforge.net/projects/etsmo/>ETSMO</a> - no files released since over one year
|
||||
- <a href=http://met.sourceforge.net/>MET</a>
|
||||
- <a href=http://sourceforge.net/projects/metaet/>meta::Expr{T_emplate}</a>
|
||||
- <a href=http://www.acl.lanl.gov/pete/>PETE</a>
|
||||
- <a href=http://www.acl.lanl.gov/pooma/>POOMA</a>
|
||||
- <a href=http://math.nist.gov/tnt/>TNT</a> - Template Numerical Toolkit
|
||||
|
||||
This list isn't complete. For more freely available libraries please have
|
||||
a look <a href=http://www.oonumerics.org/oon/#libraries>here</a>.
|
||||
*/
|
||||
|
||||
|
||||
// Local Variables:
|
||||
// mode:c++
|
||||
// End:
|
||||
|
||||
// Local Variables:
|
||||
// mode:c++
|
||||
// End:
|
||||
BIN
tvmet-1.7.1/doc/matrix_matrix.png
Normal file
BIN
tvmet-1.7.1/doc/matrix_matrix.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
BIN
tvmet-1.7.1/doc/matrix_vector.png
Normal file
BIN
tvmet-1.7.1/doc/matrix_vector.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
8
tvmet-1.7.1/doc/misc.dox
Normal file
8
tvmet-1.7.1/doc/misc.dox
Normal file
@@ -0,0 +1,8 @@
|
||||
/*
|
||||
* $Id: misc.dox,v 1.1.1.1 2003/02/08 19:32:50 opetzold Exp $
|
||||
*/
|
||||
|
||||
|
||||
// Local Variables:
|
||||
// mode:c++
|
||||
// End:
|
||||
325
tvmet-1.7.1/doc/notes.dox
Normal file
325
tvmet-1.7.1/doc/notes.dox
Normal file
@@ -0,0 +1,325 @@
|
||||
/*
|
||||
* $Id: notes.dox,v 1.20 2004/04/11 01:29:41 opetzold Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
\page notes Some Notes ...
|
||||
|
||||
<p>Contents:</p>
|
||||
-# \ref optimizing
|
||||
-# \ref temporaries
|
||||
-# \ref operators
|
||||
-# \ref threads
|
||||
-# \ref expressions
|
||||
-# \ref adl
|
||||
-# \ref alias
|
||||
-# \ref spec_meta_func
|
||||
-# \ref mmv
|
||||
|
||||
|
||||
|
||||
|
||||
\section optimizing ... on optimizing
|
||||
|
||||
This depends heavily on compiler and the flags used. The code produced with
|
||||
-O could be better than with -O2 even on gcc-2.9x suite. To get the best
|
||||
results, you should examine the assembler code generated by your compiler.
|
||||
Maybe I will write a benchmark suite for different compiler options one day.
|
||||
(Maybe you could contribute?)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section temporaries ... on temporaries
|
||||
|
||||
The use of expression templates (ET) and meta templates (MT) allows the
|
||||
generated code to avoid the creation of many temporaries -- especially with
|
||||
standard mathematical and assignment operations. There are times that you
|
||||
have to use actual temporaries e.g. when swapping variables of type
|
||||
double -- with integer values you can use the XOR operator.
|
||||
|
||||
Some implementations are using a loop with temporaries even if there is a
|
||||
solution with ET. Than the loops are faster than MT.
|
||||
|
||||
\sa \ref mmv
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section operators ... on operators and namespace element_wise
|
||||
|
||||
Some operations on matrices and vectors are not available at first glance.
|
||||
These are defined in the namespace <code>element_wise</code> because they
|
||||
are element wise (and not strictly mathematical) operations.
|
||||
|
||||
But there is more: some functions do element wise operations per se (e.g.
|
||||
vector addition) and are NOT inside namespace element_wise. Furthermore,
|
||||
all comparison operators perform element wise operations.
|
||||
|
||||
\sa \ref compare
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section threads ... about Threads
|
||||
|
||||
This library is not thread safe. It's designed for small math operations where
|
||||
the overhead for locking policies is too great. If you require locking for
|
||||
a multi-threaded application, you will need to write a wrapper.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section expressions ... on expressions
|
||||
|
||||
The first versions of %tvmet had only one expression (Xpr) which was shared
|
||||
for both vectors and matrices. This was working fine, but limited tvmet's
|
||||
use for arithmetic expressions expressions on complex values. For this
|
||||
reason, I had to separate expression types for vectors and matrices. The
|
||||
same problem appeared when using the eval() function for evaluating these
|
||||
expressions. (Which index operator should handle it?) Unfortunately, the
|
||||
use of separate expression types vastly increases the number of operators
|
||||
and functions needed to make the library viable. Fortunately, most boundary
|
||||
checks are not necessary since they are done at compile time (such as those
|
||||
needed by the assignment operator, etc).
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section adl ... on namespaces and Koenig Lookup
|
||||
|
||||
IMO, the cleanest way would be to put all functions into their own
|
||||
namespace <code>Functional</code> instead of naming them with the
|
||||
<code>fncl_</code> prefix they currently have. (I did beforehand, and
|
||||
have thought better since). Unfortunately, this technique doesn't work well.
|
||||
I got compiler errors like:
|
||||
|
||||
\code
|
||||
template <class T> Functional::xyt<T>' is not a function
|
||||
conflict with `template <class E> xyz(Xpr<E>)' in call to `xyz'
|
||||
\endcode
|
||||
|
||||
when trying:
|
||||
|
||||
\code
|
||||
typedef Vector<double, 3> vector3d;
|
||||
vector3d t1(1,2,3);
|
||||
vector3d t2(t1);
|
||||
vector3d r;
|
||||
r = sqrt( t1 * t2 );
|
||||
\endcode
|
||||
|
||||
ADL (argument dependent lookup), aka Koenig Lookup, is causing the
|
||||
compiler to check for a match in namespace Functional, since the
|
||||
template instantiation is part of Functional (the Xpr stuff), it matches
|
||||
before the global namespace (the Vector stuff) is checked. Writing:
|
||||
|
||||
\code
|
||||
r = ::sqrt( t1 * t2 );
|
||||
\endcode
|
||||
|
||||
seems to solve the problem at first glance. However, to force the user of
|
||||
the library into this syntax is painful and could probably run cause other
|
||||
problems with other namespaces (I haven't checked this). Therefore, all
|
||||
"Functionals" have the prefix fncl_.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section alias ... about aliasing
|
||||
|
||||
tvmet assumes that all matrices and vectors are alias free. These means that
|
||||
source and destination memory layout of matrices and vectors never overlaps
|
||||
(during an operation).
|
||||
|
||||
This is very easy to understood if you see a matrix-vector product. Both
|
||||
contain different data in different (unique, non-overlapping) memory
|
||||
regions -- hence, they are alias free. Contrast this with a matrix-matrix
|
||||
multiply which maybe can have an aliasing, e.g. \f$A = A * B\f$.
|
||||
When source and destination memory regions are the same, the computed results
|
||||
may be wrong. (Probably they will be.) But, \f$C = A * B\f$ is alias free.
|
||||
|
||||
Let's see an example in detail:
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
Matrix<double,3,3> M1;
|
||||
M1 = 1,2,3,4,5,6,7,8,9;
|
||||
|
||||
cout << "M1 = " << M1 << endl;
|
||||
M1 = trans(M1);
|
||||
cout << "M1 = " << M1 << endl;
|
||||
\endcode
|
||||
|
||||
\par Output:
|
||||
\code
|
||||
M1 = Matrix<d, 3, 3> = [
|
||||
[1, 2, 3],
|
||||
[4, 5, 6],
|
||||
[7, 8, 9]
|
||||
]
|
||||
M1 = Matrix<d, 3, 3> = [
|
||||
[1, 4, 7],
|
||||
[4, 5, 8],
|
||||
[7, 8, 9]
|
||||
]
|
||||
\endcode
|
||||
|
||||
As you can see, the lower triangular matrix isn't what you expected due to
|
||||
the aliasing. These results depends on the compiler optimizations, too.
|
||||
|
||||
Unfortunately, to avoid the aliasing problem, you must use temporaries
|
||||
as shown here:
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
matrix_type temp_A(A);
|
||||
A = temp_A * B;
|
||||
cout << "matrix_type temp_A(A);\n"
|
||||
<< "A = temp_A * B = " << A << endl;
|
||||
\endcode
|
||||
|
||||
Anyway, it seems there is a small exception (no guarantee, since it's
|
||||
compiler dependent I assume) for element wise operations with matrices
|
||||
or vectors on right hand side.
|
||||
|
||||
Starting with tvmet release 1.4.1 there is a new function alias. These
|
||||
function use a proxy to call special member functions of the %Matrix/Vector
|
||||
class. These member functions introduce the temporary for you.
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
typedef tvmet::Matrix<double, 3, 3> matrix_type;
|
||||
matrix_type M;
|
||||
std::generate(M.begin(), M.end(),
|
||||
tvmet::util::Incrementor<matrix_type::value_type>());
|
||||
std::cout << "M = " << M << std::endl;
|
||||
|
||||
alias(M) = trans(M);
|
||||
std::cout << "M = " << M << std::endl;
|
||||
\endcode
|
||||
|
||||
with the expected
|
||||
|
||||
\par Output:
|
||||
\code
|
||||
M = [
|
||||
[1, 4, 7],
|
||||
[2, 5, 8],
|
||||
[3, 6, 9]
|
||||
]
|
||||
\endcode
|
||||
|
||||
These function/proxy will work for the element wise operators +=, -=, *= and /=
|
||||
with expressions, e.g. as trans() returns.
|
||||
|
||||
\sa \ref assign_op
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section spec_meta_func ... special Meta-Template Functions
|
||||
|
||||
From a principle point of view, there is no need for some special functions
|
||||
for %Matrix and %Vector functions, namely \f$M^T\, x\f$, \f$M^T\,M\f$,
|
||||
\f$M\,M^T\f$, and \f$(M\,M)^T\f$.
|
||||
|
||||
Unfortunately, the g++ compiler throws in the towel sometimes even on
|
||||
transposing matrices. Because of this, %tvmet offers specialized functions
|
||||
which speed up at runtime (about factor 2 ... 3) using meta templates.
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
using namespace tvmet;
|
||||
|
||||
Matrix<double, 6, 3> M1(0); // will be transposed to be conform to vector size
|
||||
Vector<double, 6> v1(0);
|
||||
Vector<double, 3> v2(0);
|
||||
|
||||
M1 = ...
|
||||
v1 = ...
|
||||
|
||||
v2 = Mtx_prod(M1, v1); // equal to: v2 = trans(M1)*v1;
|
||||
\endcode
|
||||
|
||||
BTW, the %Matrix-%Matrix \f$M\,M\f$ and %Matrix-%Vector \f$M\,x\f$
|
||||
products use Meta-Templates, too.
|
||||
|
||||
\sa \ref Mtx_prod
|
||||
\sa \ref MMt_prod
|
||||
\sa \ref MtM_prod
|
||||
\sa \ref trans_prod
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section mmv ... about Matrix-Matrix-Vector and Matrix-Matrix-Matrix-operations
|
||||
|
||||
The problem is related to the optimizer - due to the expression and meta
|
||||
templates used.
|
||||
|
||||
Internally, an expression template may contain other expression templates
|
||||
(meta templates inside as well as) too - the compiler will unroll all of
|
||||
these expression into a single resultant expression (which is a hard job).
|
||||
Sometimes the code generated from this is worse (from a performance point
|
||||
of view) than just using simple temporaries.
|
||||
|
||||
You can chain matrix-matrix and matrix-vector operations without writing
|
||||
temporaries by yourself (if this is what you want).
|
||||
|
||||
\par from examples/hspiess.cc:
|
||||
\code
|
||||
tvmet::Matrix<double,3,2> B;
|
||||
tvmet::Matrix<double,3,3> D;
|
||||
tvmet::Matrix<double,2,2> K;
|
||||
|
||||
B =
|
||||
-0.05, 0,
|
||||
0, 0.05,
|
||||
0.05, -0.05;
|
||||
D =
|
||||
2000, 1000, 0,
|
||||
1000, 2000, 0,
|
||||
0, 0, 500;
|
||||
|
||||
K = trans(B) * D * B;
|
||||
\endcode
|
||||
|
||||
The performance can be sub optimal due to the increasing complexity
|
||||
of operations. This can be reduced by a user specified temporary:
|
||||
|
||||
\par from examples/hspiess.cc:
|
||||
\code
|
||||
// as before
|
||||
|
||||
K = tvmet::Matrix<double,2,3>(trans(B) * D) * B;
|
||||
\endcode
|
||||
|
||||
or
|
||||
\code
|
||||
K = prod(tvmet::Matrix<double,2,3>(prod(trans(B), D)), B);
|
||||
\endcode
|
||||
|
||||
At this moment an intelligent cache and pre-evaluating strategy is
|
||||
missing by %tvmet.
|
||||
|
||||
\sa \ref spec_meta_func
|
||||
\sa some notes \ref temporaries
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
// Local Variables:
|
||||
// mode:c++
|
||||
// End:
|
||||
21
tvmet-1.7.1/doc/projects.dox
Normal file
21
tvmet-1.7.1/doc/projects.dox
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* $Id: projects.dox,v 1.6 2004/04/09 05:48:16 opetzold Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
\page projects Projects using tvmet
|
||||
|
||||
|
||||
Please write me about projects using tvmet - I'm highly interested in !
|
||||
|
||||
-# Not really a project but, an interesting application is
|
||||
<a href=http://www.radiumsoftware.com/files/pathtrace.cxx.1.12.txt>here</a>.
|
||||
-# <a href=http://www.iplt.org>IPLT</a>, an image processing libary
|
||||
and toolbox for the electron microscopy community.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
// Local Variables:
|
||||
// mode:c++
|
||||
// End:
|
||||
225
tvmet-1.7.1/doc/tvmet.css
Normal file
225
tvmet-1.7.1/doc/tvmet.css
Normal file
@@ -0,0 +1,225 @@
|
||||
BODY {
|
||||
background: white;
|
||||
color: black;
|
||||
margin-right: 20px;
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
H1 {
|
||||
text-align: center;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
H2 {
|
||||
color: white;
|
||||
font-family: Geneva, Arial, Helvetica, sans-serif;
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
background-color: black;
|
||||
}
|
||||
|
||||
H3 {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
CAPTION {
|
||||
font-weight: bold
|
||||
}
|
||||
|
||||
DIV.qindex {
|
||||
width: 100%;
|
||||
background-color: #eeeeff;
|
||||
border: 4px solid #eeeeff;
|
||||
text-align: center;
|
||||
margin-bottom: 2px
|
||||
}
|
||||
|
||||
A.qindex {
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
color: #0000ee
|
||||
}
|
||||
|
||||
A.qindex:visited {
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
color: #0000ee
|
||||
}
|
||||
|
||||
A.qindex:hover {
|
||||
text-decoration: none;
|
||||
background-color: #ddddff
|
||||
}
|
||||
|
||||
A.qindexHL {
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
background-color: #6666cc;
|
||||
color: #ffffff
|
||||
}
|
||||
|
||||
A.qindexHL:hover { text-decoration: none; background-color: #6666cc; color: #ffffff }
|
||||
A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff }
|
||||
A.el { text-decoration: none; font-weight: bold }
|
||||
A.elRef { font-weight: bold }
|
||||
A.code { text-decoration: none; font-weight: normal; color: #4444ee }
|
||||
A.codeRef { font-weight: normal; color: #4444ee }
|
||||
A:hover { text-decoration: none; background-color: #f2f2ff }
|
||||
|
||||
DL.el { margin-left: -1cm }
|
||||
|
||||
DIV.fragment {
|
||||
width: 98%;
|
||||
border: 1px solid #CCCCCC;
|
||||
background-color: #f5f5f5;
|
||||
padding-left: 4px;
|
||||
margin: 4px;
|
||||
}
|
||||
|
||||
DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px }
|
||||
|
||||
TD.md { background-color: #f2f2ff; font-weight: bold; }
|
||||
TD.mdname1 { background-color: #f2f2ff; font-weight: bold; color: #602020; }
|
||||
TD.mdname { background-color: #f2f2ff; font-weight: bold; color: #602020; width: 600px; }
|
||||
|
||||
DIV.groupHeader { margin-left: 16px; margin-top: 12px; margin-bottom: 6px; font-weight: bold }
|
||||
DIV.groupText { margin-left: 16px; font-style: italic; font-size: smaller }
|
||||
|
||||
TD.indexkey {
|
||||
background-color: #eeeeff;
|
||||
font-weight: bold;
|
||||
padding-right : 10px;
|
||||
padding-top : 2px;
|
||||
padding-left : 10px;
|
||||
padding-bottom : 2px;
|
||||
margin-left : 0px;
|
||||
margin-right : 0px;
|
||||
margin-top : 2px;
|
||||
margin-bottom : 2px
|
||||
}
|
||||
|
||||
TD.indexvalue {
|
||||
background-color: #eeeeff;
|
||||
font-style: italic;
|
||||
padding-right : 10px;
|
||||
padding-top : 2px;
|
||||
padding-left : 10px;
|
||||
padding-bottom : 2px;
|
||||
margin-left : 0px;
|
||||
margin-right : 0px;
|
||||
margin-top : 2px;
|
||||
margin-bottom : 2px
|
||||
}
|
||||
|
||||
TR.memlist { background-color: #f0f0f0;}
|
||||
P.formulaDsp { text-align: center; }
|
||||
|
||||
IMG.formulaDsp { }
|
||||
IMG.formulaInl { vertical-align: middle; }
|
||||
|
||||
SPAN.keyword { color: #008000 }
|
||||
SPAN.keywordtype { color: #604020 }
|
||||
SPAN.keywordflow { color: #e08000 }
|
||||
SPAN.comment { color: #800000 }
|
||||
SPAN.preprocessor { color: #806020 }
|
||||
SPAN.stringliteral { color: #002080 }
|
||||
SPAN.charliteral { color: #008080 }
|
||||
|
||||
.mdTable {
|
||||
border: 1px solid #868686;
|
||||
background-color: #f2f2ff;
|
||||
}
|
||||
|
||||
.mdRow {
|
||||
padding: 8px 20px;
|
||||
}
|
||||
|
||||
.mdescLeft {
|
||||
font-size: smaller;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
background-color: #FAFAFA;
|
||||
padding-left: 8px;
|
||||
border-top: 1px none #E0E0E0;
|
||||
border-right: 1px none #E0E0E0;
|
||||
border-bottom: 1px none #E0E0E0;
|
||||
border-left: 1px none #E0E0E0;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.mdescRight {
|
||||
font-size: smaller;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-style: italic;
|
||||
background-color: #FAFAFA;
|
||||
padding-left: 4px;
|
||||
border-top: 1px none #E0E0E0;
|
||||
border-right: 1px none #E0E0E0;
|
||||
border-bottom: 1px none #E0E0E0;
|
||||
border-left: 1px none #E0E0E0;
|
||||
margin: 0px;
|
||||
padding-bottom: 0px;
|
||||
padding-right: 8px;
|
||||
}
|
||||
|
||||
.memItemLeft {
|
||||
padding: 1px 0px 0px 8px;
|
||||
margin: 4px;
|
||||
border-top-width: 1px;
|
||||
border-right-width: 1px;
|
||||
border-bottom-width: 1px;
|
||||
border-left-width: 1px;
|
||||
border-top-style: solid;
|
||||
border-top-color: #E0E0E0;
|
||||
border-right-color: #E0E0E0;
|
||||
border-bottom-color: #E0E0E0;
|
||||
border-left-color: #E0E0E0;
|
||||
border-right-style: none;
|
||||
border-bottom-style: none;
|
||||
border-left-style: none;
|
||||
background-color: #FAFAFA;
|
||||
font-family: Geneva, Arial, Helvetica, sans-serif;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.memItemRight {
|
||||
padding: 1px 0px 0px 8px;
|
||||
margin: 4px;
|
||||
border-top-width: 1px;
|
||||
border-right-width: 1px;
|
||||
border-bottom-width: 1px;
|
||||
border-left-width: 1px;
|
||||
border-top-style: solid;
|
||||
border-top-color: #E0E0E0;
|
||||
border-right-color: #E0E0E0;
|
||||
border-bottom-color: #E0E0E0;
|
||||
border-left-color: #E0E0E0;
|
||||
border-right-style: none;
|
||||
border-bottom-style: none;
|
||||
border-left-style: none;
|
||||
background-color: #FAFAFA;
|
||||
font-family: Geneva, Arial, Helvetica, sans-serif;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.search {
|
||||
color: #0000ee;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
FORM.search {
|
||||
margin-bottom: 0px;
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
INPUT.search {
|
||||
font-size: 75%;
|
||||
color: #000080;
|
||||
font-weight: normal;
|
||||
background-color: #eeeeff;
|
||||
}
|
||||
|
||||
TD.tiny {
|
||||
font-size: 75%;
|
||||
}
|
||||
111
tvmet-1.7.1/doc/tvmet.sty.in
Normal file
111
tvmet-1.7.1/doc/tvmet.sty.in
Normal file
@@ -0,0 +1,111 @@
|
||||
%% Version: $Id: tvmet.sty.in,v 1.2 2004/03/27 14:00:33 opetzold Exp $
|
||||
|
||||
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
|
||||
\def\@rcs@ $#1Date: #2 #3$$#4Revision: #5$ {
|
||||
\ProvidesPackage{tvmet}[#2 v#5tvmet doxygen latex style]}
|
||||
\@rcs@ $Date: 2004/03/27 14:00:33 $$Revision: 1.2 $
|
||||
|
||||
\DeclareOption{}{%%%
|
||||
}
|
||||
|
||||
%%\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{}}
|
||||
\ExecuteOptions{}
|
||||
\ProcessOptions
|
||||
|
||||
% elementary for pdflatex
|
||||
\newif\ifpdf
|
||||
\ifx\pdfoutput\undefined
|
||||
\pdffalse % no pdftex
|
||||
\else
|
||||
\pdfoutput=1 % running pdftex
|
||||
\pdftrue
|
||||
\fi
|
||||
|
||||
% Postscript fonts
|
||||
\RequirePackage[scaled=0.92]{helvet}
|
||||
\RequirePackage{courier}
|
||||
\RequirePackage{typearea} % from KOMA script
|
||||
|
||||
% doxygen need this; it includes the style for formulas too
|
||||
\RequirePackage{fancyhdr}
|
||||
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%% tvmet style %%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
%%
|
||||
%% page borders
|
||||
%%
|
||||
\areaset[2cm]% % binding border
|
||||
{16cm}{26cm} % text width and height
|
||||
|
||||
%%
|
||||
%% sans serif is default font
|
||||
%%
|
||||
\renewcommand{\familydefault}{\sfdefault}
|
||||
|
||||
%%
|
||||
%% overwrite doxygen's hyperref setup
|
||||
%%
|
||||
\ifpdf\hypersetup{
|
||||
baseurl={http://tvmet.sourceforge.net},
|
||||
pdftitle={@PACKAGE@ @VERSION@ Reference Manual},
|
||||
pdfauthor={\textcopyright\,Olaf Petzold},
|
||||
pdfsubject={%
|
||||
This Tiny Vector and Matrix C++ template
|
||||
libary uses Meta Templates and Expression Templates to evaluate results
|
||||
at compile time - to make it fast for low order (tiny) systems.
|
||||
},
|
||||
pdfkeywords={%
|
||||
tiny vector matrix fast C++ STL template library
|
||||
expression templates meta templates fixed size fixed dimension
|
||||
matrix-matrix matrix-vector vector-matrix binary unary operations operators
|
||||
product transpose linear algebra cross product dot product type promotion
|
||||
exception linux kernel embedded system regression test gcc g++
|
||||
blitz blitz++ TinyVector TinyMatrix MTL TNT
|
||||
gnu compiler suite portland group c++ kai c++ intel compiler LGPL
|
||||
},
|
||||
%
|
||||
bookmarks={true},
|
||||
bookmarksnumbered={true},
|
||||
bookmarksopen={true},
|
||||
pdfpagelabels={true},
|
||||
pdfmenubar={true},
|
||||
pdftoolbar={true},
|
||||
plainpages={false},
|
||||
pdfstartview={FitH},
|
||||
pdfpagemode={UseOutlines},
|
||||
pdfhighlight={/I}
|
||||
}
|
||||
\fi
|
||||
|
||||
%%
|
||||
%% overwrite fancyheadings
|
||||
%%
|
||||
\makeatletter
|
||||
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
|
||||
\hbox{}\vspace*{\fill}
|
||||
\thispagestyle{empty}
|
||||
\newpage
|
||||
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
|
||||
\makeatother
|
||||
\renewcommand{\sectionmark}[1]{%
|
||||
\markright{\thesection.\ #1}}
|
||||
\makeatletter
|
||||
\lhead[\textbf{@PACKAGE@ @VERSION@}]{\fancyplain{}{\bfseries\rightmark}}
|
||||
\rhead[\fancyplain{}{\bfseries\leftmark}]{\textbf{@PACKAGE@ @VERSION@}}
|
||||
\makeatother
|
||||
\chead{}
|
||||
\lfoot{}
|
||||
\cfoot{\bfseries --\ \thepage\ --}
|
||||
\rfoot{}
|
||||
\setlength{\headwidth}{0.0cm}
|
||||
\setlength{\headwidth}{\textwidth}
|
||||
|
||||
\endinput
|
||||
|
||||
%%% Local Variables:
|
||||
%%% mode: latex
|
||||
%%% TeX-auto-save: nil
|
||||
%%% TeX-auto-parse-length: 99999
|
||||
%%% ispell-local-dictionary: "american"
|
||||
%%% End:
|
||||
407
tvmet-1.7.1/doc/usage.dox
Normal file
407
tvmet-1.7.1/doc/usage.dox
Normal file
@@ -0,0 +1,407 @@
|
||||
/*
|
||||
* $Id: usage.dox,v 1.14 2004/07/03 17:09:23 opetzold Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
\page usage Usage
|
||||
|
||||
<p>Contents:</p>
|
||||
-# \ref include
|
||||
-# \ref construct
|
||||
-# \ref c_arrays
|
||||
-# \ref compare
|
||||
-# \ref pod
|
||||
-# \ref stl
|
||||
-# \ref matrix_access
|
||||
-# \ref expr_print
|
||||
|
||||
|
||||
|
||||
|
||||
\section include Include files
|
||||
|
||||
The Tiny %Vector and %Matrix template library has many include files spread
|
||||
throughout the %tvmet include directory. As a user, you need only include
|
||||
<tt><%tvmet/Vector></tt> for vector operations and/or
|
||||
<tt><%tvmet/Matrix></tt> for matrix operations.
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
#include <tvmet/Matrix.h>
|
||||
#include <tvmet/Vector.h>
|
||||
|
||||
using namespace tvmet;
|
||||
\endcode
|
||||
|
||||
Simple, isn't it? Don't forget to use the namespace tvmet, but keep in mind
|
||||
that using the using directive inside headers will pollute the namespace. If
|
||||
you write this in a header file, the namespace for all subsequent header
|
||||
files (those which include the one you're writing) will also be polluted.
|
||||
(This is not a %tvmet specific phenomenon.) Therefore, write the using
|
||||
statement in the C++ file.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section construct Construction and Initializing
|
||||
|
||||
Due to the nature of
|
||||
<a href=http://extreme.indiana.edu/~tveldhui/papers/Expression-Templates/exprtmpl.html>
|
||||
Expression Templates</a> (ET) you can't write code like
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
tvmet::Vector<double, 3> v1(1,2,3); // OK
|
||||
tvmet::Vector<double, 3> v2 = v1; // not possible
|
||||
\endcode
|
||||
|
||||
The operator= function assigns an expression to the Vector which means that
|
||||
the object must be constructed before you may assign something to it. The
|
||||
solution is to write this as:
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
using namespace tvmet;
|
||||
|
||||
Vector<double, 3> v1(1,2,3);
|
||||
Vector<double, 3> v2; // construct the Vector<T,Sz> object at first
|
||||
v2 = v1; // ... and assign the contents of v1 to v2
|
||||
Vector<double, 3> v3(v1); // ... or simple use the copy constructor
|
||||
|
||||
std::cout << v3 << std::endl;
|
||||
\endcode
|
||||
|
||||
since the object v2 needs to be constructed before the object's operator=()
|
||||
can be called.
|
||||
|
||||
The same rule applies to the Matrix class. You can only assign vectors and
|
||||
matrices of the same dimension or you will get a compile error. This also
|
||||
applies to the argument list for the constructor of the classes.
|
||||
|
||||
Initializing can be done as shown above or by using a comma separated list:
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
using namespace tvmet;
|
||||
|
||||
Matrix<double, 3, 2> m1; // yes, non-square matrices are possible as well
|
||||
m1 = 1, 4,
|
||||
2, 5,
|
||||
3, 6;
|
||||
\endcode
|
||||
|
||||
Matrix element initialization always performed column wise! If the length
|
||||
of the comma separated list is longer than the storage size, you will get
|
||||
a compile time error. (tvmet is designed to prevent this -- it will prevent
|
||||
you from accidentally overwriting memory which does not belong to the
|
||||
matrix you are initializing.) You can use a comma separated list to
|
||||
initialize vectors as well.
|
||||
|
||||
If you want a clean (zero-valued) vector or matrix you can simple write:
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
using namespace tvmet;
|
||||
|
||||
Vector<double, 3> v4(0);
|
||||
Matrix<double, 3, 4> m2(0);
|
||||
\endcode
|
||||
|
||||
All elements of v4 and m2 are initialized with zero (or whatever value you
|
||||
provide at construction time). Keep in mind that the uninitialized %Matrix
|
||||
and %Vector classes will have random data when the are created (since they
|
||||
use a static array for internal storage) unless you initialize them!
|
||||
|
||||
Another way to initialize a vector or matrix follows:
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
using namespace tvmet;
|
||||
|
||||
Vector<double, 3> v5(1,2,3);
|
||||
Vector<double, 3> v6(v5);
|
||||
Vector<double, 3> v7(v5+v6);
|
||||
\endcode
|
||||
|
||||
This is useful for temporary results. The result will be immediately
|
||||
assigned to the new vector elements using the expression passed to the
|
||||
constructor.
|
||||
|
||||
Yet another way of initializing a vector or matrix is similar to the above.
|
||||
We assign an expression to it:
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
using namespace tvmet;
|
||||
|
||||
Matrix<double, 3, 3> m3, m4, m5;
|
||||
m3 = 1, 2, 3,
|
||||
4, 5, 6,
|
||||
7, 8, 9;
|
||||
m4 = m3;
|
||||
m5 = m3 + m4;
|
||||
\endcode
|
||||
|
||||
If you have your data inside arrays you can use tvmet's iterator interface
|
||||
to initialize a vector or matrix with it:
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
T data[] = { 1,4,7,
|
||||
2,5,8,
|
||||
3,6,9 };
|
||||
|
||||
std::size_t sz = sizeof(data)/sizeof(T);
|
||||
T* first = data;
|
||||
T* last = data + sz;
|
||||
|
||||
tvmet::Matrix<double, 3, 3> m(first, last);
|
||||
\endcode
|
||||
|
||||
The data will be copied into the matrix itself. When the constructor has
|
||||
finished, there will be no stored reference to the array pointer.
|
||||
|
||||
Starting with tvmet release 1.6.0 you can create an identity matrix
|
||||
simply by using the function identity(). Note, we have to specify the
|
||||
matrix type, since ADL can't work here.
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
typedef Matrix<double,3,3> matrix_type;
|
||||
...
|
||||
matrix_type E( identity<matrix_type>() );
|
||||
\endcode
|
||||
|
||||
|
||||
|
||||
|
||||
\section c_arrays Use of C style Arrays with tvmet
|
||||
|
||||
Sometimes you have some data arranged in a C style array for matrices
|
||||
and vectors. As with tvmet release 1.6.0 you can wrap an expression
|
||||
around using the functions vector_ref(const T* mem) and
|
||||
matrix_ref(const T* mem) where mem is the pointer to the C array.
|
||||
|
||||
The returned expressions (XprVector or XprMatrix) can be used
|
||||
as usual like tvmet's vectors and matrices. This means, you
|
||||
can use all mathematical functions on it.
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
static float lhs[3][3] = {
|
||||
{-1, 0, 1}, { 1, 0, 1}, {-1, 0, -1}
|
||||
};
|
||||
static float rhs[3][3] = {
|
||||
{ 0, 1, 1}, { 0, 1, -1}, { 0, -1, 1}
|
||||
};
|
||||
...
|
||||
|
||||
typedef Matrix<float, 3, 3> matrix_type;
|
||||
|
||||
matrix_type M( prod(matrix_ref<float, 3, 3>(&lhs[0][0]),
|
||||
matrix_ref<float, 3, 3>(&rhs[0][0])) );
|
||||
\endcode
|
||||
|
||||
This allows to initialize tvmet's vectors and matrices by
|
||||
an alternative way as described at \ref construct.
|
||||
|
||||
|
||||
\section compare Compare Vectors and Matrices
|
||||
|
||||
If you expect to find global comparison operators for comparing Vectors
|
||||
and Matrices, you are right -- these are provided. But, the return
|
||||
value probably isn't what you expect: a boolean value. Instead, the operator
|
||||
returns an expression (e.g. XprVector<>). The contents of this expression
|
||||
type is a element wise logical operation (depends on the given operator
|
||||
like ==, <, >, etc...)! To get a boolean value you need to evaluate the
|
||||
expression using all_elements() or any_elements(), as follows:
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
using namespace tvmet;
|
||||
using namespace std;
|
||||
|
||||
Vector<double, 3> v1, v2, bv;
|
||||
|
||||
v1 = 1,2,3;
|
||||
v2 = 1,3,3;
|
||||
|
||||
bv = v1 == v2;
|
||||
|
||||
cout << bv << endl;
|
||||
cout << "v1 == v2 is "
|
||||
<< ( all_elements( v1 == v2 ) ? "true" : "false" )
|
||||
<< endl;
|
||||
\endcode
|
||||
|
||||
This gives
|
||||
|
||||
\par [continued]
|
||||
\code
|
||||
Vector<d, 3>[1, 0, 1]
|
||||
v1 == v2 is false
|
||||
\endcode
|
||||
|
||||
The reason for this is the element wise operation on all elements (for both
|
||||
Vectors and Matrices). Comparing two vectors will result in a "boolean Vector"
|
||||
expression. Using all_elements/any_elements evaluates the result into a
|
||||
single boolean by repeatedly applying the comparison for each element.
|
||||
|
||||
An other example on comparing is shown below:
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
if(all_elements(X == Y)) { cout << "matrices are identical" << endl; }
|
||||
if(any_elements(X == Y)) { cout << "at least one element is equal" << endl; }
|
||||
if(any_elements(X != Y)) { cout << "not all elements are equal" << endl; }
|
||||
\endcode
|
||||
|
||||
%tvmet prior release 1.2.1 did have a boolean version eval for comparing.
|
||||
The functional and semantic meaning were not clear at all. Therefore I
|
||||
decided to remove it.
|
||||
|
||||
\sa \ref operators
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section pod Data Types like std::complex<>
|
||||
|
||||
As we can see above we can use POD (plain old data) types like <tt>double</tt> and
|
||||
<tt>int</tt> as data type of a %Vector or %Matrix. However, we are not limited to
|
||||
this - we can use e.g. <tt>std::complex<></tt> as well:
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
using namespace tvmet;
|
||||
|
||||
Vector<std::complex<double>,3> v1, v2;
|
||||
Matrix<std::complex<double>,3,3> m1;
|
||||
\endcode
|
||||
|
||||
And operate on these...
|
||||
|
||||
\par [continued]
|
||||
\code
|
||||
v1 = 1,2,3;
|
||||
m1 = 1,4,7,
|
||||
2,5,8,
|
||||
3,6,9;
|
||||
v2 = m1 * v1;
|
||||
\endcode
|
||||
|
||||
Be careful. <tt>std::complex<></tt> isn't tested well on regression tests.
|
||||
|
||||
|
||||
|
||||
|
||||
\section stl STL support
|
||||
|
||||
Since version 0.2.0 %tvmet has supported an iterator interface conform to
|
||||
the STL and since version 0.5.0 reverse STL iterators have been supported,
|
||||
too.
|
||||
|
||||
With these, you can mix the %tvmet Vector and Matrix containers with the
|
||||
STL algorithms.
|
||||
|
||||
For example, if you don't like %tvmet's ostream operator, you can create
|
||||
your own implementation like this:
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
tvmet::Vector<double, 6> v(1,2,3,4,5,6);
|
||||
std::cout << v << std::endl;
|
||||
|
||||
std::cout << "The Vector is:" << std::endl;
|
||||
std::copy(v.begin(), v.end(), std::ostream_iterator<double>(std::cout, "\n"));
|
||||
\endcode
|
||||
|
||||
Or, you create a random matrix and print it as shown here:
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
tvmet::Matrix<double,6,6> m;
|
||||
|
||||
std::generate(m.begin(), m.end(), rand);
|
||||
std::cout << m << std::endl;
|
||||
\endcode
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section matrix_access Matrix access by rows and columns
|
||||
|
||||
If you need a specific row or column of a given matrix you can get access to
|
||||
it by using the functions row and col. They will return an XprVector<T>.
|
||||
Unfortunately, you do not get any write access to the vector elements - only
|
||||
reading is permitted due to the expression template concept used here. For
|
||||
write access, you have to use matrix indexing with the parentheses operator.
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
using namespace tvmet;
|
||||
|
||||
typedef Matrix<double 5, 3> matrix_type;
|
||||
typedef Vector<double, 5> matrix_rowvector;
|
||||
typedef Vector<double, 3> matrix_colvector;
|
||||
|
||||
matrix_type M;
|
||||
M = ....
|
||||
|
||||
matrix_rowvector row2 = row(M, 2);
|
||||
matrix_colvector col3 = col(M, 3);
|
||||
...
|
||||
\endcode
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section expr_print Expression printing
|
||||
|
||||
Expression printing is a nice feature for debugging expressions. (For more
|
||||
about expression templates and expression tree please have a look
|
||||
<a href=http://extreme.indiana.edu/~tveldhui/papers/Expression-Templates/exprtmpl.html>here</a>).
|
||||
|
||||
You can write out a simple matrix-vector multiplication of a vector
|
||||
<tt>v1</tt> and a matrix <tt>m1</tt> of the dimension of 3 as follows:
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
std::cout << m1 * v1 << std::endl;
|
||||
\endcode
|
||||
|
||||
which will be expanded to:
|
||||
|
||||
\par [continued]
|
||||
\code
|
||||
XprVector<
|
||||
XprMVProduct<
|
||||
d, 3, 3, 3, 1, d, 1
|
||||
>
|
||||
3
|
||||
>
|
||||
\endcode
|
||||
|
||||
The "d" is a g++ placeholder for double. (This may vary from compiler to
|
||||
compiler since it is an implementation detail of runtime type information
|
||||
[rtti] determined by the compiler's manufacturer). The purpose of this
|
||||
feature is to check the right evaluation of expressions into the tree on
|
||||
complicated mathematical expressions.
|
||||
|
||||
A rich source of examples are the regression tests. They show all of the
|
||||
supported operations and functions (if there is a regression test for this
|
||||
of course). Some examples are in the examples directory.
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
// Local Variables:
|
||||
// mode:c++
|
||||
// End:
|
||||
40
tvmet-1.7.1/doc/works.dox
Normal file
40
tvmet-1.7.1/doc/works.dox
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* $Id: works.dox,v 1.5 2005/03/09 12:33:00 opetzold Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
\page works Future works
|
||||
|
||||
A good library is never complete. Here are some points which I hope to cover
|
||||
in the future:
|
||||
|
||||
-# more regression tests (bit operations are missing, not all functions and type
|
||||
promotion are tested) and examples (temporary the regression test can act
|
||||
as examples). The problems with the regression tests actually used is,
|
||||
that they does not follow mathematical, strong logical guide lines to cover all
|
||||
possible cases.
|
||||
-# write more examples, the regression test should not act as examples.
|
||||
-# better support for std::complex type.
|
||||
-# add functions like
|
||||
- matrix inverse using LUdecomposition and other matrix vector functions
|
||||
- meta functions for sin, cos etc.
|
||||
-# System V math support on linux seems to be incomplete
|
||||
-# better compiler support
|
||||
-# Interface to other numerical libraries as uBlas, BLAS, and LAPACK.
|
||||
|
||||
|
||||
Maybe, there will be a tvmet2. Some of the features mentioned above will
|
||||
require a redesign of tvmet. With this new design tvmet can better handle
|
||||
special matrices, like banded, symmetric or triangular matrices etc.
|
||||
Furthermore, sparse tiny vectors and matrices are easy to implement, as well
|
||||
as an allocator concept for re-sizable containers.
|
||||
|
||||
The priority depends on the \ref projects as well as the support from the
|
||||
community - please support %tvmet.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
// Local Variables:
|
||||
// mode:c++
|
||||
// End:
|
||||
Reference in New Issue
Block a user