-- switch Matrix class to column-major order like in Eigen

-- many more Eigenification changes, in preparation of the big merge
-- big changes in the Comma Initializer to allow for column-major order,
   leading to a simpler and cleaner solution. "commaWrite" hook added to
   the classes using the Comma Initializer.
-- lots of API improvements, cleanup, removal of dead/useless stuff
-- testsuite updated
This commit is contained in:
Benoit Jacob 2007-08-17 07:10:44 +00:00
parent 07f96b6047
commit ad89fc8295
57 changed files with 472 additions and 38852 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,761 +0,0 @@
2003-02-12 Olaf Petzold <opetzold@wit.regiocom.net>
* ChangeLog: this files is renamed to ChangeLog.1 and holds all old
Changes. We use the cvs ChangeLog now.
* examples/Makefile.am: example target diag added.
* examples/diag.cc: added.
* regression/TestMathOps.h: TestMathOps<T>::MatrixDiagVector() added.
* include/tvmet/MatrixFunctions.h: diag(Matrix<T, Sz, Sz>& m) added.
* include/tvmet/Matrix.h: MatrixDiagVectorReference added.
2003-02-10 opetzold <opetzold@wit.regiocom.net>
* Makefile.am (rpm): rpm package is using bz2 archive now.
* tvmet.spec.in: target tvmet-doc-xxx removed, it's inside the standard
rpm package
2003-02-09 opetzold <opetzold@wit.regiocom.net>
* version 0.8.0 released (cvs tagged)
* Makefile.am: target doc-dist added to dist-hook, as well as
moving ps/pdf manuals into distdir.
* doc/compiler.dox: HTML <li></li> environment removed to avoid
problems with latex ref manual.
* configure.in, Makefile.am: parts adapted to new syntax style of
autoconf 2.5x and automake 1.6x
* include/tvmet/util/Timer.h: rusage cpp wrapper replaced with
config.h's defined(TVMET_HAVE_XYZ_H)
* configure.in: enhanced for better recognizing, features from autoconf-2.5x
added. Some problems left using
AC_INIT(AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS)
* doc/Doxyfile.in (INPUT): points to @top_srcdir@/include/@PACKAGE@, therefore
we can apply other lib's includes too (e.g. for benchmark)
2003-02-08 opetzold <opetzold@wit.regiocom.net>
* config/license: removed
* version 0.7.6 released internally (cvs tagged)
* misc corrections to the cvs
* doc/bench*.png: replaced with an 'empty' picture
* doc/Makefile.am: bug fixed: tgz dist installs the docs now
* include/tvmet/Makefile.am: bug fixed: tgz dist install target doesn't
install meta and util directory; include/tvmet/meta/Makefile.am,
include/tvmet/util/Makefile.am added
* version 0.7.5 released internally (cvs tagged)
* project imported into cvs, cvs keyword Id corrected and added
* doc/Util.h: header guard prefix TVMET extended
* include/tvmet/meta/: copyright and cvs Id keyword added
2002-12-28 opetzold <opetzold@wit.regiocom.net>
* benchmark/BenchImpl.h: Each BenchImpl does run 10 times each benchmark to
trick the optimizer a little bit.
2002-12-27 opetzold <opetzold@wit.regiocom.net>
* benchmark/Makefile.am: each benchmark got his own optimizer cxxflags.
2002-12-22 opetzold <opetzold@wit.regiocom.net>
* version 0.7.4 released internally
* include/tvmet/MatrixFunctions.h: element_wise::product(Matrix, Matrix)
added.
* benchmark/benchmark.m: stl and peak benchmark added
* benchmark/stl.{cc|h}: created to measure STL performance
* benchmark/peak.{cc|h}: created to measure peak performance
* benchmark/Interface.h: interface_peak etc. added
* benchmark/BenchmarkBase.h: created, moved basic functionality from
Benchmark.h
2002-12-21 opetzold <opetzold@wit.regiocom.net>
* benchmark/BenchInfo.h: created, class definition moved from
Benchmark.h into.
2002-12-17 opetzold <opetzold@wit.regiocom.net>
* version 0.7.3 released internally
* doc/benchmark.dox: Result comments to each benchmark removed.
* doc/ doxygen extension is dox now to avoid confusion.
* include/tvmet/util/General.h: all functions inside doxygroup
_util_function now.
* benchmark/Makefile.am: Depencies corrected.
2002-12-16 opetzold <opetzold@wit.regiocom.net>
* benchmark/Benchmark.h (class BenchInfo): typeid added
* benchmark/*.cc: axpy included in benchmark
* benchmark/BenchImpl.h (BenchImpl::vector_inner_product): result z static
now to avoid removing by optimizer of gcc-3.2, thanks to Jörg Walter.
* benchmark/Benchmark.h (class Benchmark): BUG inside set_complexity(),
vector_add(), vector_outer_product() removed, thanks to Jörg Walter.
2002-12-15 opetzold <opetzold@wit.regiocom.net>
* include/tvmet/XprMatrixOperators.h: element_wise
operator*(XprMatrix, XprMatrix) supports non-square matrizes now.
* bechmark/*: (C) added
* include/tvmet/XprOperators.h: IMPLEMENT macros splitted for
XprVector<> and XprMatrix<>, NS element_wise introduced,
file splited into Xpr{Matrix, Vector}Operators.h
2002-12-14 opetzold <opetzold@wit.regiocom.net>
* version 0.7.2 released internally; interface has changed too!
* include/tvmet/MatrixImpl.h (Matrix::print_on): small BUG removed,
introduced from v0.4.2 (last comma separator was wrong)
* doc/operator_tab.html: added as doc for namespace element_wise
* regressions/*: adapted to namespace element_wise
* include/tvmet/tvmet.h: doxygen namespace description moved from
doc/misc.doc into this header.
* include/tvmet/MatrixOperators.h: operators for *=, /= ... <<= for
Matrix<> and XprMatrix<> inside namespace element_wise now!
Macro KICK_MATH_SENSE absolete now!
* include/tvmet/MatrixImpl.h: operator impl for +=, -= ... <<= for
Matrix<> and XprMatrix<> moved here from Matrix.h.
* include/tvmet/MatrixImpl.h: Forgotten macro prefix TVMET_ added.
operator %=,^=,&=,|= have as argument int since these
are bitops, only int's are allowed/usefull.
* include/tvmet/Matrix.h (class Matrix): operator %=,^=,&=,|= have
as argumeent int since these are bitops, only int's
are allowed/usefull.
* include/tvmet/VectorOperators.h: operators for /=, %= ... <<= for
Vector<> and XprVector<> inside namespace element_wise now!
Macro KICK_MATH_SENSE absolete now!
* include/tvmet/VectorImpl.h: operator impl for +=, -= ... <<= for
Vector<> and XprVector<> moved here from Vector.h.
* include/tvmet/Vector.h (class Vector): member operators for
+=, -= ... <<= for Vector<> and XprVector<> named to equivalent
functions.
* doc/faq.doc: comma_initializer and assign_op compiler error section
added.
* include/tvmet/VectorImpl.h: Forgotten macro prefix TVMET_ added.
* version 0.7.1 released internally
2002-12-10 opetzold <opetzold@wit.regiocom.net>
* doc/notes.doc: notes about aliasing added.
* doc/benchmark.doc: Fomula written for benchmarks, notes abot aliasing.
* benchmark/ublas.h: assumes alias free ops, thanks to Jörg Walter
2002-12-08 opetzold <opetzold@wit.regiocom.net>
* include/tvmet/MatrixOperators.h: operator*(XprMatrix, Matrix|Matrix, XprMatrix)
moved from NS tvmet::element_wise to tvmet,
operator/(XprMatrix, Matrix|Matrix, XprMatrix) moved from NS
tvmet to tvmet::element_wise. M = transpose(M1) * M2 is working now.
* include/tvmet/meta/Gemv.h: doxygen class docs corrected.
* regression/TestMathOps.h: productTranspose regression Test added
* include/tvmet/MatrixFunctions.h: Formula written in doxygen docs for
productTransposed(M,x)
2002-11-30 opetzold <opetzold@wit.regiocom.net>
* version 0.7.0 released
* include/tvmet/{Matrix,Vector}.h: Reference level printing changed.
2002-11-26 opetzold <opetzold@wit.regiocom.net>
* include/tvmet/{Xpr,BinaryFunctionals,UnaryFunctionals,Matrix,Vector}.h:
expression printing enhanced.
* include/tvmet/VectorOperators.h: Vector<std::complex<T>, Sz> and std::complex<T>,
std::complex<T> and Vector<std::complex<T>, Sz> are working now.
* include/tvmet/MatrixOperators.h: Matrix<T, Rows, Cols> and complex<T>,
complex<T> and Matrix<T, Rows, Cols> are working now.
2002-11-24 opetzold <opetzold@wit.regiocom.net>
* regression/TestSTL.h: added for regression with STL's vector class.
* include/tvmet/Vector.h (class Vector): runtime condition added for
construction from given iterator.
* regression/*: TVMET prefix for all *.h
* version 0.6.3 released internally
* regression/Makefile.am: CXXFLAGS limited to the minimum optimizations
* regression/TestMathOps.h: adapted to the new situation.
* regression/MVOps.h: moved to namespace util, file moved to
include/tvmet/util/General.h; functions renamed
* include/tvmet/Timer.h: moved to util subdir.
* include/tvmet/*: All meta stuff moved to an own namespace into a
subdirectoy meta.
* include/tvmet/Matrix.h (class Matrix::assign): adapted for use of meta
templates default parameter
* include/tvmet/MetaMatrix.h (class Matrix): {Row,Col}Stride have default
parameter now.
* doc/Makefile.am: CXXFLAGS limited to the minimum optimizations
2002-11-23 opetzold |opetzold@wit.regiocom.net>
* version 0.6.2 released internally
* doc/benchmark.doc: updated.
* benchmark/* completly rewritten, uses interfaces for libaries (blitz,
ublas, mtl), results in MFlops now.
2002-11-16 opetzold <opetzold@wit.regiocom.net>
* benchmark/Timer.h (class Timer): moved to namespace tvmet::util, file
moved to include/tvmet
2002-11-14 opetzold <opetzold@wit.regiocom.net>
* version 0.6.1 released internally
* doc/{notes,faq}.doc: About regression test moved from notes to
faq. Added to faq dimension check error compiler.
* doc/*: Benchmark results added.
* regression/TestMathOps.h (TestMathOps<T>::MatrixOps()): Regression
for trace(Matrix<>) added.
* include/tvmet/MatrixFunctions.h: trace(Matrix<>) added.
* include/tvmet/Matrix.h (class MetaMatrix): MetaMatrix::trace added.
2002-11-13 opetzold <opetzold@wit.regiocom.net>
* include/tvmet/*.h: brute force replace DECLARE_XYZ with TVMET prefix
to avoid complications with other macros.
Same to asXpr() -> as_expr() to hold member conventions.
* include/tvmet/*.h: brute force replace ExprType with expr_type to be
conform to the used style.
2002-11-12 opetzold <opetzold@wit.regiocom.net>
* regression/MVOps.h: Header guard with TVMET prefix, doxygen like,
VVAdd fn added.
2002-11-10 opetzold <opetzold@wit.regiocom.net>
* regression/*: completly rewritten. Now we have a benchmark with blitz++,
tvmet, ublas and conventional implementation.
* doc/*: Corrections and Enhancements to the docs generally (intro rewritten).
* include/tvmet/tvmet.h: Guard for defined DEBUG arround TVMET_DEBUG removed.
TVMET_DEBUG isn't turned on at defined DEBUG any more.
2002-11-03 opetzold <opetzold@wit.regiocom.net>
* version 0.6.0 released
* regression/TestMathOps.h: Test for normalize(Vector<>) added.
* include/tvmet/{Matrix,Vector}Operators.h: Matrix/Vector<T, Sz> and POD's
extended with long long int to handle long long from Traits
too.
2002-10-29 opetzold <opetzold@wit.regiocom.net>
* doc/{usage,faq}.doc enhanced.
* include/tvmet/VectorFunctions.h: normalize(Vector<>) added.
* regression/TestUnFunc.h: copy && paste devel killed:
3 test cases indicate that they are testing the inverse functions,
asin, acos, atan but the test case calls the sin function - thanks
to Darin DeForest (deforest) from sf.
2002-10-19 opetzold <opetzold@wit.regiocom.net>
* include/tvmet/{Matrix|Vector}Functions.h: Formula docs enhanced,
doxy grouping enhanced for unary and binary functions and
operators.
2002-10-17 opetzold <opetzold@wit.regiocom.net>
* version 0.5.1 released as doc update
* doc/Doxygen.in: PREDEFINED targets use the forgotten TVMET prefix too.
* include/tvmet/{Binary|UnaryFunctionals.h, Traits.h,
TypePromotion.h TvmetBase.h}: macros
generated operators, functions and functionals doc added for
doxygen include path.
2002-10-10 opetzold <opetzold@wit.regiocom.net>
* doc/{functions|operators}_doc.cc: naming convention for private
data updated
* doc/*: Corrections and Enhancements to the docs generally.
2002-08-18 opetzold <opetzold@wit.regiocom.net>
* version 0.5.o released after some time of playing with.
* doc/tvmet.css: using tvmet.css now.
* Small docs enhancements.
2002-08-03 opetzold <opetzold@wit.regiocom.net>
* include/tvmet/VectorImpl.h (print_on): simplifyied rewritten.
* include/tvmet/MatrixImpl.h (print_on): simplifyied rewritten.
* version 0.4.2 released only internal
* doc/compiler.doc: Section general compiler requirements added.
* include/tvmet/*.h: forwards for namespace std rewritten to avoid
doxygen confuse.
* regression/TestMathOps.h: Regression test for row() and col() added.
* include/tvmet/Matrix.h (Matrix{Row, Col}VectorReference):
operator[] const added, manual ctor removed.
* include/tvmet/Matrix.h (Matrix{Row, Col}VectorReference): XprLevel is
IndentLevl now (removed bug from beginning time.)
* examples/mv.cc: cstdlib for rand added for compatibility.
2002-07-27 opetzold <opetzold@wit.regiocom.net>
* version 0.4.1 released only internal
* regression/Makefile.am (regression_LDADD): cppunit-1.9.8 needs -ldl for
dl{open,close,sym}.
* include/tvmet/Matrix.h (class Matrix): added reverse_iterator STL
interface as well as empty() and max_size(). size() is static now.
* include/tvmet/Vector.h (class Vector): added reverse_iterator STL
interface as well as front(), back(), empty(), max_size().
size() is static now.
* tvmet.spec.in: Adapted for manual.
* Makefile.am (man_MANS): manual for tvmet-config written
* include/tvmet/*: brute force query replace printOn with print_on
for member naming conformity.
* include/tvmet/*: brute force query replace restrict by _tvmet_restrict
due to the use of the prefix macro.
* include/tvmet/* all header guards with TVMET_ prefix extensioned.
* doc/Doxyfile.in: adapted to the new situation
* tvmet-config.in (Usage): corrected very old package name (tvm)
* include/tvmet/config/config-{icc,kcc,pgi}.h: dummies created for
compiler specifics.
* include/tvmet/config/config-gcc.h: created for gcc specifics.
* include/tvmet/TvmetBase.h: created, contents of old tvmet.h moved in.
* include/tvmet/tvmet.h (IndentLevel): forgotten member rename to be
conform to m_xxx; particular rewritten and splitted, so below
and above.
* configure.in: We are using the ac_create_prefix_config_h to create
a prefixed config.h header now. Unfortunally accconfig.h is
deprecated too. With this we can easy mix different packages
(prior all autoXXX defined PACKAGE and VERSION with the result
of multiple define warnings).
* Makefile.am (m4sources): added ac_create_prefix_config_h.m4, aclocal.m4
moved from root dir to config dir.
2002-07-24 opetzold <opetzold@wit.regiocom.net>
* include/tvmet/VectorImpl.h: printOn() does care the io manipulators
std::setw(), see examples/mv.cc
* include/tvmet/MatrixImpl.h: same too.
2002-07-23 opetzold <opetzold@wit.regiocom.net>
* version 0.4.0 released
* include/tvmet/Traits.h: rewritten to avoid macro and ifdef garbage.
* include/tvmet/*: member rename to be conform to m_xxx
* include/tvmet/Matrix.h: CT_CONDITION have the tvmet identifier now.
* include/tvmet/Vector.h: CT_CONDITION have the tvmet identifier now.
2002-07-17 opetzold <opetzold@wit.regiocom.net>
* now we have a postscript and pdf manual
* doc/functions_doc.cc: some missed return statements added.
2002-07-16 opetzold <opetzold@wit.regiocom.net>
* doc/Makefile.am: pdf support improved.
* doc/Makefile.am (doc-dist): tvmet-doc-xxx dist doesn't have html subdir anymore
- usefull for sourceforge dist since we have only html docs.
* regression/main.cc (main): args removed to avoid warnings.
* configure.in: CXX_OPTIMIZE_FLAG/CXX_DEBUG_FLAGS for GnuCC -W -Wall added
* include/tvmet/TypePromotion.h: No idea when this bug where introduced - the
header guard was in wrong scope, v0.3.1 suffered. Nobdy told me ...
* include/tvmet/TypePromotion.h: Support for long long. Enhanced for unsigned
and complex types as well. Change ranking breaks compatibility
with prior releases.
* include/tvmet/Traits.h: support for long long. Specialized version for
long double and long long self removed - there isn't a way to guarantee
the precision than.
* config/ac_c_long_long.m4 added.
2002-07-13 opetzold <opetzold@wit.regiocom.net>
* acconfig.h: political correct error messages now 8-)
2002-07-07 opetzold <opetzold@wit.regiocom.net>
* version 0.3.1 released
* include/tvmet/Vector.h (class Vector): brute force query replace ThisType
by this_type, to be conform to the naming convention
* include/tvmet/Matrix.h (class Matrix): brute force query replace ThisType
by this_type, to be conform to the naming convention
* doc/Doxyfile.in: slighly minor changes.
2002-07-06 opetzold <opetzold@wit.regiocom.net>
* include/tvmet/Matrix.h (class Matrix): same here.
* include/tvmet/Vector.h (class Vector): doxygen correctness for copy ctor doc.
2002-06-25 opetzold <opetzold@wit.regiocom.net>
* doc/notes.doc: chapter _thread inside contents now.
* include/tvmet/TypePromotion.h: classes inside namespace tvmet now.
2002-06-23 opetzold <opetzold@wit.regiocom.net>
* version 0.3.0 released
* doc-dists does have a doxygen tag file now
* header class descriptions follows now the statement
\class <name> [<header-file>] [<header-name>]
* include/tvmet/CompileTimeError.h, include/tvmet/CommaInitializer.h: doxygen
confuseness removed (first line of header (LGPL) introduced a doxy comment - therfore
doxygen did interpret the follwing statement)
2002-06-22 opetzold <opetzold@wit.regiocom.net>
* include/tvmet/Functional.h: class replaced by struct, since all members are public
* include/tvmet/XprOperators.h: std::complex<T> templated
* include/tvmet/XprFunctions.h: std::complex<T> templated
* include/tvmet/VectorOperators.h: std::complex<T> templated
* include/tvmet/VectorFunctions.h: std::complex<T> templated
* include/tvmet/VectorEval.h: std::complex<T> templated, macro removed
* include/tvmet/UnaryFunctionals.h: std::complex<T> templated
* include/tvmet/MatrixFunctions.h: std::complex<T> templated
* include/tvmet/MatrixOperators.h: std::complex<T> templated
* include/tvmet/MatrixEval.h: std::complex<T> templated, macro removed
* include/tvmet/XprFunctions.h: forgotten exp function added
* regression/TestMathOps.h: bug removed in regressions due to prior initialized
vars. Moved the test into MatrixMatrixVector.
* benchmark/Benchmark.h: new, parts from m1.cc and v1.cc has been moved here.
2002-06-20 opetzold <opetzold@wit.regiocom.net>
* include/tvmet/TypePromotion.h: std::complex<int> added, therfore the priorities
for all complex types have changed!
* include/tvmet/Traits.h: depends on HAVE_LONG_DOUBLE, sum_type of double
is long double or double.
* include/tvmet/{MatrixEval.h, MatrixFunctions.h, MatrixOperators.h, Traits.h,
TypePromotion.h, UnaryFunctionals.h, VectorEval.h, VectorFunctions.h,
VectorOperators.h, XprFunctions.h, XprOperators.h} HAVE_LONG_DOUBLE
encapsulated.
* configure.in: AC_C_LONG_DOUBLE added.
* include/tvmet/UnaryFunctionals.h: for std::complex<> expanded, uses now a const reference.
functions for std::complex<int> added
* include/tvmet/MatrixEval.h: std::complex<int> added
* doc/Doxyfile.in (BIN_ABSPATH): updated for doxygen 2.2.18 (new generated).
2002-06-16 opetzold <opetzold@wit.regiocom.net>
* examples/Makefile.am (examples): bug corrected.
* include/tvmet/Traits.h: complex<int> numeric traits added.
* include/tvmet/MatrixOperators.h: operator*() is in namespace element_wise left
2002-06-13 opetzold <opetzold@wit.regiocom.net>
* doc/Makefile.am (doc-dist): gzip with bzip2 replaced
* Makefile.am (doc-dist): gzip to bzip2 replaced as well
* include/tvmet/MatrixFunctions.h: for std::complex<> expanded, uses now a const reference.
functions for std::complex<int> added
2002-06-12 opetzold <opetzold@wit.regiocom.net>
* include/tvmet/XprFunctions.h: for std::complex<> expanded, uses now a const reference.
functions for std::complex<int> added
* include/tvmet/MatrixOperators.h (DECLARE_BINARY_OPERATOR): for std::complex<>
expanded, uses now a const reference.
operators for std::complex<int> added
* include/tvmet/VectorOperators.h (DECLARE_BINARY_OPERATOR): for std::complex<>
expanded, uses now a const reference.
operators for std::complex<int> added
* include/tvmet/XprOperators.h (DECLARE_BINARY_OPERATOR): for std::complex<>
expanded, uses now a const reference.
logical operators for float, double etc. removed, since isn't applicable
operators for std::complex<int> added
2002-06-11 opetzold <opetzold@wit.regiocom.net>
* acconfig.h (__S_STL_INTERNAL_RELOPS): hack removed since isn't usefull.
* doc/Makefile.am (api): target renamed to doc
* include/tvmet/tvmet.h: NS_TVMET_BEGIN/END removed again due to doxygen problems
description of namespace moved to misc.doc
* doc/Doxyfile.in (INPUT): @top_srcdir@/include/tvmet now
* include/tvmet/tvmet.h: macros NS_TVMET_BEGIN/END completly removed - too
much trouble with doxygen, only NS_TVMET_NAME is used now. NS_TVMET_NAME
has a guard now.
* include/tvmet/*.h: doxygen grouping for global functions and operators
* doc/functions.doc: added for global functions documenting
* doc/operators.doc: added for global operators documenting
2002-06-09 opetzold <opetzold@wit.regiocom.net>
* version 0.2.1 released
* benchmark/* completly rewritten
* regression/MVOps.h: extracted from TestMathOp.h for use for benchmarking
2002-06-08 opetzold <opetzold@wit.regiocom.net>
* regression/: checked/rewritten and updated against cppunit-1.8.0,
which s now used for regression test.0
TestConstruction.cc TestMathOps.cc TestXpr.cc removed.
* regression/main.cc: Oops, non std iostream include header fixed. Thanks
to gcc-3.1 8-)
* include/tvmet/*.h: doxygen enhancements
* doc/Makefile.am: modified for splitted doc files, ChangeLog and THANKS files
included into html doc tree.
* doc/intro.doc: original intro.doxy splitted to several *.doc files,
anhanced docs and topics regrouped.
* include/tvmet/Matrix.h (class Matrix): Member assignValue(), forgotten return
statement added. Thanks to Kresimir Fresl <fresl@grad.hr>
2002-06-02 opetzold <opetzold@wit.regiocom.net>
* version 0.2.0 released
* include/tvmet/Matrix.h (class Matrix): STL iterator constructors and interface
added.
* include/tvmet/Vector.h (class Vector): STL iterator constructors and interface
added.
* generell: Designer decision to rename all const_reference to ConstReference,
reference to Reference, expr_type to ExprType. This make its possible
to support the STL interface. Finally this means a public interface
change.
* include/tvmet/MatrixFunctions.h (class MetaMM ): typename
PromoteTraits<T1, T2>::value_type' is implicitly a typename,
changed, (class MetaMV ): same here.
* include/tvmet/: brute-force query-replace int with int
* doc/intro.doxy: slightly changed and anhanced docs due to positive
test with stlport and gcc-3.1.
* include/tvmet/UnaryFunctionals.h: removed ieee math functions
from namespace std, STLport does it right.
2002-06-01 opetzold <opetzold@wit.regiocom.net>
* cleaned some comments/doxygen tags for cosmetic
* removed doing vector cross product as ET from todo list
* include/tvmet/Vector.h (class Vector): enum size removed, since it's never used
here and not really usefull. Added new member function size() instead.
* include/tvmet/Matrix.h (class Matrix): enum { rows, cols} removed since they are
never used here, and not really usefull. Added new member functions
rows() and cols() instead.
* include/tvmet/Vector.h (class Vector): template argument length replaced
with tvmet::Vector template argument Sz, since it's the same.
Removed enum length, since isn't needed.
* Makefile.am (rpm): --target=noarch added, therefore it's really
plattform independed 8)
2002-04-27 opetzold <opetzold@wit.regiocom.net>
* version 0.1.2 released
* include/tvmet/tvmet.h (NS_TVMET): removed since it holds only the name self and
isn't used anwhere expect NS_TVMET_BEGIN.
* doc/header.html: meta tags added and sf logo changed.
2002-04-21 opetzold <opetzold@wit.regiocom.net>
* docs/ adhanced
* include/tvmet/Matrix.h (MatrixReference::operator()): removed const since
it isn't const.
2002-04-20 opetzold <opetzold@wit.regiocom.net>
* include/tvmet/Matrix.h: MatrixColVectorReference, MatrixRowVectorReference added.
* include/tvmet/MatrixFunctions.h: row() and col() functions added
* examples/: new complex examples
* macro for automake added tvmet.m4
2002-03-11 O.Petzold <opetzold@wit.regiocom.net>
* version 0.1.1 released
2002-03-05 O.Petzold <opetzold@wit.regiocom.net>
* examples/: some examples added for xpr printing and simple mv, mm ops
* include/tvmet/Vector.h (VectorReference, VectorConstReference): XprLevel
printing uses typeid now.
* include/tvmet/Matrix.h (MatrixReference, MatrixConstReference): XprLevel
printing uses typeid now.
* include/tvmet/VectorImpl.h (operator<<()): XprLevel printing uses typeid now.
* include/tvmet/MatrixImpl.h (operator<<()): XprLevel printing uses typeid now.
2002-03-04 O.Petzold <opetzold@wit.regiocom.net>
* include/tvmet/MatrixFunctions.h: min/max temp vars improved
* include/tvmet/VectorFunctions.h: min/max temp vars improved
* doc/intro.doxy: corrections
2002-03-01 O.Petzold <opetzold@wit.regiocom.net>
* version 0.1.0 released

View File

@ -1,101 +0,0 @@
# $Id: Makefile.am,v 1.25 2004/09/16 08:12:28 opetzold Exp $
ACLOCAL_AMFLAGS = -I config
SUBDIRS = include examples testsuite doc tests benchmark
m4sources = \
config/ac_c_long_long.m4 \
config/ac_create_prefix_config_h.m4 \
config/ac_cxx_have_complex.m4 \
config/ac_cxx_have_complex_math1.m4 \
config/ac_cxx_have_complex_math2.m4 \
config/ac_cxx_have_ieee_math.m4 \
config/ac_cxx_have_mutable.m4 \
config/ac_cxx_have_namespaces.m4 \
config/ac_cxx_have_sysv_math.m4 \
config/ac_cxx_partial_specialization.m4 \
config/ac_cxx_typename.m4 \
config/ac_set_compiler.m4 \
config/ac_prog_cxx_intel.m4 \
config/ac_prog_cxx_kai.m4 \
config/ac_prog_cxx_pgi.m4 \
config/op_doxygen_doc.m4
# m4 automake macros
m4datadir = $(datadir)/aclocal
m4data_DATA = tvmet.m4
# setup/config scripts
bin_SCRIPTS = tvmet-config
# manual for script
man_MANS = tvmet-config.1
EXTRA_DIST = \
$(m4sources) \
$(m4data_DATA) \
$(man_MANS) \
ChangeLog.1 \
LICENSE
DISTCLEANFILES = \
$(PACKAGE)-docs-$(VERSION).tar.bz2 \
$(PACKAGE)-$(VERSION).pdf.bz2
# Targets
ChangeLog:
@if test -d CVS -a -x `which cvs2log`; then \
echo "Create ChangeLog from CVS"; \
`which cvs2log`; \
fi
dist-hook: ChangeLog
cp tvmet.spec $(distdir)
$(MAKE) doc-dist
@if test -f $(top_builddir)/doc/$(PACKAGE)-$(VERSION).ps; then \
$(LN_S) $(top_builddir)/doc/$(PACKAGE)-$(VERSION).ps $(PACKAGE)-$(VERSION).ps; \
cat $(top_builddir)/doc/$(PACKAGE)-$(VERSION).ps | bzip2 --best > $(PACKAGE)-$(VERSION).ps.bz2; \
fi
@if test -f $(top_builddir)/doc/$(PACKAGE)-$(VERSION).pdf; then \
$(LN_S) $(top_builddir)/doc/$(PACKAGE)-$(VERSION).pdf $(PACKAGE)-$(VERSION).pdf; \
cat $(top_builddir)/doc/$(PACKAGE)-$(VERSION).pdf | bzip2 --best > $(PACKAGE)-$(VERSION).pdf.bz2; \
fi
.PHONY: release snapshot rpm docs doc-dist
release:
rm -rf .deps */.deps
$(MAKE) distcheck
snapshot:
$(MAKE) dist distdir=$(PACKAGE)-$(VERSION)-`date +"%y%m%d"`
docs:
$(MAKE) -C doc
if CONFIG_DOC
doc-dist: docs
$(MAKE) -C doc doc-dist
mv -f doc/$(PACKAGE)-docs-$(VERSION).tar.bz2 .
else
doc-dist:
endif
example:
$(MAKE) -C examples example
rpm: dist
@if test -f $(PACKAGE).spec; then \
echo "Build rpm distribution"; \
$(RM) $(PACKAGE).spec && make $(PACKAGE).spec; \
fi
rpm -ta --target noarch $(PACKAGE)-$(VERSION).tar.bz2
cp ~/RPM/SRPMS/$(PACKAGE)-$(VERSION)-1.src.rpm .
cp ~/RPM/RPMS/noarch/$(PACKAGE)-$(VERSION)-1.noarch.rpm .
md5:
md5sum `find . -maxdepth 1 -name "*.rpm" -or -name "*.gz" -or -name "*.bz2" -xtype f` > MD5sums
sign: md5
cat MD5sums | gpg --clearsign > .MD5sums && mv .MD5sums MD5sums

View File

@ -1,822 +0,0 @@
# 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.25 2004/09/16 08:12:28 opetzold Exp $
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@
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/tvmet-config.in \
$(srcdir)/tvmet.spec.in $(top_srcdir)/config/config.h.in \
$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
THANKS config/config.guess config/config.sub config/depcomp \
config/install-sh config/ltmain.sh config/missing
subdir = .
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)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno configure.status.lineno
mkinstalldirs = $(mkdir_p)
CONFIG_HEADER = $(top_builddir)/config/config.h
CONFIG_CLEAN_FILES = tvmet-config tvmet.spec
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(m4datadir)"
binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
SCRIPTS = $(bin_SCRIPTS)
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-exec-recursive install-info-recursive \
install-recursive installcheck-recursive installdirs-recursive \
pdf-recursive ps-recursive uninstall-info-recursive \
uninstall-recursive
man1dir = $(mandir)/man1
NROFF = nroff
MANS = $(man_MANS)
m4dataDATA_INSTALL = $(INSTALL_DATA)
DATA = $(m4data_DATA)
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
{ test ! -d $(distdir) \
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -fr $(distdir); }; }
DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2
GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
distcleancheck_listfiles = find . -type f -print
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@
ACLOCAL_AMFLAGS = -I config
SUBDIRS = include examples testsuite doc tests benchmark
m4sources = \
config/ac_c_long_long.m4 \
config/ac_create_prefix_config_h.m4 \
config/ac_cxx_have_complex.m4 \
config/ac_cxx_have_complex_math1.m4 \
config/ac_cxx_have_complex_math2.m4 \
config/ac_cxx_have_ieee_math.m4 \
config/ac_cxx_have_mutable.m4 \
config/ac_cxx_have_namespaces.m4 \
config/ac_cxx_have_sysv_math.m4 \
config/ac_cxx_partial_specialization.m4 \
config/ac_cxx_typename.m4 \
config/ac_set_compiler.m4 \
config/ac_prog_cxx_intel.m4 \
config/ac_prog_cxx_kai.m4 \
config/ac_prog_cxx_pgi.m4 \
config/op_doxygen_doc.m4
# m4 automake macros
m4datadir = $(datadir)/aclocal
m4data_DATA = tvmet.m4
# setup/config scripts
bin_SCRIPTS = tvmet-config
# manual for script
man_MANS = tvmet-config.1
EXTRA_DIST = \
$(m4sources) \
$(m4data_DATA) \
$(man_MANS) \
ChangeLog.1 \
LICENSE
DISTCLEANFILES = \
$(PACKAGE)-docs-$(VERSION).tar.bz2 \
$(PACKAGE)-$(VERSION).pdf.bz2
all: all-recursive
.SUFFIXES:
am--refresh:
@:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \
cd $(srcdir) && $(AUTOMAKE) --gnu \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
config/config.h: config/stamp-h1
@if test ! -f $@; then \
rm -f config/stamp-h1; \
$(MAKE) config/stamp-h1; \
else :; fi
config/stamp-h1: $(top_srcdir)/config/config.h.in $(top_builddir)/config.status
@rm -f config/stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config/config.h
$(top_srcdir)/config/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_srcdir) && $(AUTOHEADER)
rm -f config/stamp-h1
touch $@
distclean-hdr:
-rm -f config/config.h config/stamp-h1
tvmet-config: $(top_builddir)/config.status $(srcdir)/tvmet-config.in
cd $(top_builddir) && $(SHELL) ./config.status $@
tvmet.spec: $(top_builddir)/config.status $(srcdir)/tvmet.spec.in
cd $(top_builddir) && $(SHELL) ./config.status $@
install-binSCRIPTS: $(bin_SCRIPTS)
@$(NORMAL_INSTALL)
test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
@list='$(bin_SCRIPTS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
if test -f $$d$$p; then \
f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \
$(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \
else :; fi; \
done
uninstall-binSCRIPTS:
@$(NORMAL_UNINSTALL)
@list='$(bin_SCRIPTS)'; for p in $$list; do \
f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
rm -f "$(DESTDIR)$(bindir)/$$f"; \
done
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
install-man1: $(man1_MANS) $(man_MANS)
@$(NORMAL_INSTALL)
test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)"
@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
for i in $$l2; do \
case "$$i" in \
*.1*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
else file=$$i; fi; \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
case "$$ext" in \
1*) ;; \
*) ext='1' ;; \
esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \
done
uninstall-man1:
@$(NORMAL_UNINSTALL)
@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
for i in $$l2; do \
case "$$i" in \
*.1*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
case "$$ext" in \
1*) ;; \
*) ext='1' ;; \
esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \
rm -f "$(DESTDIR)$(man1dir)/$$inst"; \
done
install-m4dataDATA: $(m4data_DATA)
@$(NORMAL_INSTALL)
test -z "$(m4datadir)" || $(mkdir_p) "$(DESTDIR)$(m4datadir)"
@list='$(m4data_DATA)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f="`echo $$p | sed -e 's|^.*/||'`"; \
echo " $(m4dataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(m4datadir)/$$f'"; \
$(m4dataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(m4datadir)/$$f"; \
done
uninstall-m4dataDATA:
@$(NORMAL_UNINSTALL)
@list='$(m4data_DATA)'; for p in $$list; do \
f="`echo $$p | sed -e 's|^.*/||'`"; \
echo " rm -f '$(DESTDIR)$(m4datadir)/$$f'"; \
rm -f "$(DESTDIR)$(m4datadir)/$$f"; \
done
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@set fnord $$MAKEFLAGS; amf=$$2; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@set fnord $$MAKEFLAGS; amf=$$2; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
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: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
if (etags --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
else \
include_option=--include; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -f $$subdir/TAGS && \
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
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: ctags-recursive $(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)
$(am__remove_distdir)
mkdir $(distdir)
$(mkdir_p) $(distdir)/. $(distdir)/config $(distdir)/doc $(distdir)/include/tvmet/config
@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
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d "$(distdir)/$$subdir" \
|| mkdir "$(distdir)/$$subdir" \
|| exit 1; \
(cd $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="../$(top_distdir)" \
distdir="../$(distdir)/$$subdir" \
distdir) \
|| exit 1; \
fi; \
done
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$(top_distdir)" distdir="$(distdir)" \
dist-hook
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r $(distdir)
dist-gzip: distdir
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
dist-bzip2: distdir
$(AMTAR) chof - $(distdir) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
dist-tarZ: distdir
$(AMTAR) chof - $(distdir) | compress -c >$(distdir).tar.Z
$(am__remove_distdir)
dist-shar: distdir
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__remove_distdir)
dist dist-all: distdir
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(AMTAR) chof - $(distdir) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - ;;\
*.tar.bz2*) \
bunzip2 -c $(distdir).tar.bz2 | $(AMTAR) xf - ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(AMTAR) xf - ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir); chmod a+w $(distdir)
mkdir $(distdir)/_build
mkdir $(distdir)/_inst
chmod a-w $(distdir)
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& cd $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
$(am__remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
distuninstallcheck:
@cd $(distuninstallcheck_dir) \
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
@if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
check: check-recursive
all-am: Makefile $(SCRIPTS) $(MANS) $(DATA)
installdirs: installdirs-recursive
installdirs-am:
for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(m4datadir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
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-recursive
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-hdr \
distclean-libtool distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
info: info-recursive
info-am:
install-data-am: install-m4dataDATA install-man
install-exec-am: install-binSCRIPTS
install-info: install-info-recursive
install-man: install-man1
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-binSCRIPTS uninstall-info-am \
uninstall-m4dataDATA uninstall-man
uninstall-info: uninstall-info-recursive
uninstall-man: uninstall-man1
.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
check-am clean clean-generic clean-libtool clean-recursive \
ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
dist-shar dist-tarZ dist-zip distcheck distclean \
distclean-generic distclean-hdr distclean-libtool \
distclean-recursive distclean-tags distcleancheck distdir \
distuninstallcheck dvi dvi-am html html-am info info-am \
install install-am install-binSCRIPTS install-data \
install-data-am install-exec install-exec-am install-info \
install-info-am install-m4dataDATA install-man install-man1 \
install-strip installcheck installcheck-am installdirs \
installdirs-am maintainer-clean maintainer-clean-generic \
maintainer-clean-recursive mostlyclean mostlyclean-generic \
mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \
tags tags-recursive uninstall uninstall-am \
uninstall-binSCRIPTS uninstall-info-am uninstall-m4dataDATA \
uninstall-man uninstall-man1
# Targets
ChangeLog:
@if test -d CVS -a -x `which cvs2log`; then \
echo "Create ChangeLog from CVS"; \
`which cvs2log`; \
fi
dist-hook: ChangeLog
cp tvmet.spec $(distdir)
$(MAKE) doc-dist
@if test -f $(top_builddir)/doc/$(PACKAGE)-$(VERSION).ps; then \
$(LN_S) $(top_builddir)/doc/$(PACKAGE)-$(VERSION).ps $(PACKAGE)-$(VERSION).ps; \
cat $(top_builddir)/doc/$(PACKAGE)-$(VERSION).ps | bzip2 --best > $(PACKAGE)-$(VERSION).ps.bz2; \
fi
@if test -f $(top_builddir)/doc/$(PACKAGE)-$(VERSION).pdf; then \
$(LN_S) $(top_builddir)/doc/$(PACKAGE)-$(VERSION).pdf $(PACKAGE)-$(VERSION).pdf; \
cat $(top_builddir)/doc/$(PACKAGE)-$(VERSION).pdf | bzip2 --best > $(PACKAGE)-$(VERSION).pdf.bz2; \
fi
.PHONY: release snapshot rpm docs doc-dist
release:
rm -rf .deps */.deps
$(MAKE) distcheck
snapshot:
$(MAKE) dist distdir=$(PACKAGE)-$(VERSION)-`date +"%y%m%d"`
docs:
$(MAKE) -C doc
@CONFIG_DOC_TRUE@doc-dist: docs
@CONFIG_DOC_TRUE@ $(MAKE) -C doc doc-dist
@CONFIG_DOC_TRUE@ mv -f doc/$(PACKAGE)-docs-$(VERSION).tar.bz2 .
@CONFIG_DOC_FALSE@doc-dist:
example:
$(MAKE) -C examples example
rpm: dist
@if test -f $(PACKAGE).spec; then \
echo "Build rpm distribution"; \
$(RM) $(PACKAGE).spec && make $(PACKAGE).spec; \
fi
rpm -ta --target noarch $(PACKAGE)-$(VERSION).tar.bz2
cp ~/RPM/SRPMS/$(PACKAGE)-$(VERSION)-1.src.rpm .
cp ~/RPM/RPMS/noarch/$(PACKAGE)-$(VERSION)-1.noarch.rpm .
md5:
md5sum `find . -maxdepth 1 -name "*.rpm" -or -name "*.gz" -or -name "*.bz2" -xtype f` > MD5sums
sign: md5
cat MD5sums | gpg --clearsign > .MD5sums && mv .MD5sums MD5sums
# 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:

6945
tvmet-1.7.1/aclocal.m4 vendored

File diff suppressed because it is too large Load Diff

23174
tvmet-1.7.1/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,342 +0,0 @@
dnl $Id: configure.ac,v 1.47 2005/04/26 15:07:00 opetzold Exp $
dnl Configure script for the Tiny Vector Matrix Expression Template Library
dnl Process this file with autoconf to produce a configure script.
dnl autoconf 2.50 or higher to rebuild aclocal.m4, because the
dnl AC_CREATE_PREFIX_CONFIG_H macro needs the AS_DIRNAME macro.
AC_PREREQ(2.59)
dnl Copy revision stamp into the `configure' script,
AC_REVISION($Revision: 1.47 $)
dnl Disable caching.
define([AC_CACHE_LOAD], )
define([AC_CACHE_SAVE], )
dnl Process this file with autoconf to produce a configure script.
AC_INIT([tvmet],[1.7.1],[opetzold@users.sourceforge.net])
dnl inform about
AC_MSG_RESULT([Configure Tiny Vector Matrix using Expression Templates library AC_PACKAGE_VERSION])
dnl config and versioning, the config.h header is in config - we use a prefixed
dnl config header, see below
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_HEADERS([config/config.h])
dnl Getting the Canonical System Type
AC_CANONICAL_HOST
dnl require gnu style, automake 1.8 or better, etc.
AM_INIT_AUTOMAKE([gnu 1.8 no-define dist-bzip2])
dnl --enable-maintainer-mode for configure
AM_MAINTAINER_MODE
# Declare variables which we want substituted in the Makefile.in's
AC_SUBST(CXX_OPTIMIZE_FLAGS)
AC_SUBST(CXX_DEBUG_FLAGS)
AC_SUBST(CXX_WARN_FLAGS)
dnl Manual configuration options of oopattern.
AC_ARG_ENABLE(tvmet, [
Options of tvmet:])
dnl Process command-line arguments for compiler (parts borrowed from blitz++)
AC_MSG_CHECKING([for compiler])
AC_ARG_WITH(cxx,
[ --with-cxx=compiler set specific C++ compiler and options (e.g. g++ (default), KCC, icc, pgCC)],
[case "$withval" in
KCC*) # KAI C++ http://www.kai.com/
AC_MSG_RESULT([KAI C++])
CXX_OPTIMIZE_FLAGS="-DTVMET_OPTIMIZE +K3 -O3 -fast --inline_keyword_space_time=10000"
CXX_DEBUG_FLAGS="-g +K0 -DTVMET_DEBUG"
CXX_WARN_FLAGS=""
;;
g++*|gcc*) # gcc http://gcc.gnu.org/
AC_MSG_RESULT([GNU C++])
AC_SET_COMPILER($withval,"g++","")
CXX_OPTIMIZE_FLAGS="-DTVMET_OPTIMIZE -O2 -finline-limit=5000 -ftemplate-depth-200 -fomit-frame-pointer"
CXX_DEBUG_FLAGS="-g -O1 -DTVMET_DEBUG"
CXX_WARN_FLAGS="-W -Wall -Winline"
# paranoia on older gcc versions
gxx_version=`$CXX -v 2>&1 | grep "^.*g.. version" | \
sed -e 's/^.*g.. version *//' -e 's/cygnus-//' -e 's/egcs-//'`
case "$gxx_version" in
1.* | 2.[[0123456789]].*)
AC_MSG_ERROR([g++ version $gxx_version will probably fail to compile tvmet])
;;
esac
;;
icc) # Intel C++ compiler http://www.intel.com/
AC_MSG_RESULT([Intel C++])
AC_SET_COMPILER($withval,"icc","")
CXX_OPTIMIZE_FLAGS="-DTVMET_OPTIMIZE -O2 -fp_port -Qoption,c,-ip_ninl_max_total_stats=3000"
CXX_DEBUG_FLAGS="-g -O0 -DTVMET_DEBUG"
CXX_WARN_FLAGS="-Wall"
;;
pgCC*) # Portland group http://www.pgroup.com/
AC_MSG_RESULT([Portland Group C++])
AC_SET_COMPILER($withval,"pgCC","")
CXX_OPTIMIZE_FLAGS="-DTVMET_OPTIMIZE -O4 -Mnoframe -Mnodepchk -Minline=levels:25"
CXX_DEBUG_FLAGS="-g -O0 -DTVMET_DEBUG"
CXX_WARN_FLAGS=""
;;
*)
AC_MSG_WARN([--with-cxx: unknown c++ compiler $withval])
;;
esac],[
AC_MSG_RESULT([GNU C++ (default)])
AC_SET_COMPILER($withval,"g++","")
CXX_OPTIMIZE_FLAGS="-DTVMET_OPTIMIZE -O2 -finline-limit=5000 -ftemplate-depth-200 -fomit-frame-pointer"
CXX_DEBUG_FLAGS="-g -O1 -DTVMET_DEBUG"
CXX_WARN_FLAGS="-W -Wall -Winline"
])
dnl Check if the script was called with --enable-optimize, and if so
dnl modify the compilation flags.
AC_MSG_CHECKING([for compiler optimizations])
tvmet_optimize=0
AC_ARG_ENABLE(optimize,
[ --enable-optimize enable compiler optimization flags],
[if test "$enableval" = yes; then
AC_MSG_RESULT([yes])
CXXFLAGS="$CXXFLAGS $CXX_OPTIMIZE_FLAGS"
tvmet_optimize=1
else
AC_MSG_RESULT([no])
fi], [
AC_MSG_RESULT([no])
])
dnl Set platform-specific optimization settings
if test $tvmet_optimize -eq 1; then
AC_MSG_CHECKING([for compiler platform-specific optimizations])
case "$build_os" in
*linux*)
case "$CXX" in
g++)
AC_MSG_RESULT([GNU/Linux (CPU=$build_cpu) using GNU GCC])
# specifying -march=cpu-type implies -mcpu=cpu-type.
case "$build_cpu" in
i386|i486)
CXXFLAGS="$CXXFLAGS -malign-double -march=i386"
;;
i586)
CXXFLAGS="$CXXFLAGS -malign-double -march=i586 -msse"
;;
i686)
CXXFLAGS="$CXXFLAGS -malign-double -march=i686 -msse2"
;;
k6*)
CXXFLAGS="$CXXFLAGS -malign-double -march=k6 -m3dnow"
esac
;;
icc)
AC_MSG_RESULT([GNU/Linux (CPU=$build_cpu) using Intel CC])
case "$build_cpu" in
i586)
# Intel Pentium Pro, Intel Pentium II, and Intel Pentium III processors
CXXFLAGS="$CXXFLAGS -tpp6"
;;
i686)
# Intel Pentium 4 processors
CXXFLAGS="$CXXFLAGS -tpp7"
;;
esac
;;
esac
;;
*)
AC_MSG_RESULT([tvmet has not been tuned for this platform])
;;
esac
fi
dnl Check if the script was called with --enable-debug, and if so
dnl modify the compilation flags.
AC_MSG_CHECKING([for compiler debug flags])
AC_ARG_ENABLE(debug,
[ --enable-debug enable compiler debug flags],
[if test "$enableval" = yes; then
AC_MSG_RESULT([yes])
CXXFLAGS="$CXXFLAGS $CXX_DEBUG_FLAGS"
fi], [
AC_MSG_RESULT([no])
])
dnl Check if the script was called with --enable-warnings, and if so
dnl modify the compilation flags.
AC_MSG_CHECKING([for compiler warn flags])
AC_ARG_ENABLE(warnings,
[ --enable-warnings enable compiler warning flags],
[if test "$enableval" = yes; then
AC_MSG_RESULT([yes])
CXXFLAGS="$CXXFLAGS $CXX_WARN_FLAGS"
fi], [
AC_MSG_RESULT([no])
])
dnl doxygen docs
OP_DOXYGEN_DOC
dnl cppunit support
oopattern_config_cppunit=yes
AC_ARG_ENABLE(cppunit,
[ --disable-cppunit disable unit tests using cppunit],
oopattern_config_cppunit=$enableval)
dnl check for cppunit for unit tests
if test x"$oopattern_config_cppunit" = xyes; then
dnl Check if we have libcppunit
AM_PATH_CPPUNIT(1.8.0)
if test "x$no_cppunit" = xyes; then
CONFIG_CPPUNIT=no
else
CONFIG_CPPUNIT=yes
fi
fi
AC_MSG_CHECKING(for libcppunit support)
if test "x${oopattern_config_cppunit}" = xyes -a "x$CONFIG_CPPUNIT" = xyes; then
CONFIG_CPPUNIT=yes
AC_MSG_RESULT([yes])
else
CONFIG_CPPUNIT=no
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL(CONFIG_CPPUNIT,[test x"$CONFIG_CPPUNIT" = xyes])
dnl Checks for programs.
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_LANG([C++])
AC_PROG_CXX
AC_PROG_LN_S
dnl don't be confused, we don't build shared/static libs; it's
dnl for the head install process only (for build and install
dnl process from separate build directory)
AC_PROG_LIBTOOL
dnl Checks for libraries.
AC_CHECK_LIB(dl, main)
dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_STDBOOL dnl for unit tests
AC_CHECK_HEADERS([sys/time.h unistd.h])
# Checks for library functions.
AC_CHECK_FUNCS([floor pow rint sqrt])
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_STRUCT_TM
AC_C_LONG_DOUBLE
AC_C_LONG_LONG
AC_C_RESTRICT
AC_CXX_HAVE_MUTABLE
AC_CXX_TYPENAME
AC_CXX_PARTIAL_SPECIALIZATION
AC_CXX_NAMESPACES
AC_CXX_HAVE_IEEE_MATH
AC_CXX_HAVE_SYSV_MATH
AC_CXX_HAVE_COMPLEX
AC_CXX_HAVE_COMPLEX_MATH1
AC_CXX_HAVE_COMPLEX_MATH2
dnl create makefiles
AC_CONFIG_FILES([
Makefile
tvmet-config
tvmet.spec
include/Makefile
include/tvmet/Makefile
include/tvmet/config/Makefile
include/tvmet/meta/Makefile
include/tvmet/loop/Makefile
include/tvmet/util/Makefile
include/tvmet/xpr/Makefile
include/tvmet/config/config-vc71.h
doc/Makefile
doc/Doxyfile
doc/footer.html
doc/tvmet.sty
testsuite/Makefile
tests/Makefile
examples/Makefile
benchmark/Makefile
])
AC_CONFIG_COMMANDS([default],[[chmod a+x tvmet-config]],[[]])
AC_OUTPUT
dnl prefixed config header
AC_CREATE_PREFIX_CONFIG_H([include/tvmet/config.h], $PACKAGE, [config/config.h])
dnl -------------------
dnl tvmet's user epilog
dnl -------------------
echo "
Configuration for $PACKAGE $VERSION:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The following optional features are enabled:
Source code location : $srcdir
tvmet's unit-tests available : `if test "x$CONFIG_CPPUNIT" = xyes; then echo yes; else echo no; fi`
build documentation : `if test "x$CONFIG_DOC" = xyes; then echo yes; else echo no; fi`
using LaTeX non-stop mode : `if test "x$CONFIG_DOC_LATEX_NONSTOP" = xyes; then echo yes; else echo no; fi`
graphs and diagrams : `if test "x$DOXYGEN_HAVE_DOT" = xyes; then echo -n yes; else echo no; fi`
Install path : $prefix
Compiler Flags used:
CXX : $CXX
CXXFLAGS : $CXXFLAGS
The configure script has generated makefiles for your platform.
You have several options now:
make Depends on configure's flags given, build the docs,
build $PACKAGE $VERSION and run the regression tests.
make docs Makes the docs using doxygen (if enabled).
make check Make the unit tests (if CppUnit available).
make install Install tvmet.
make uninstall Uninstall tvmet.
"

View File

@ -1,7 +1,7 @@
/*
* Tiny Vector Matrix Library
* Dense Vector Matrix Libary of Tiny size using Expression Templates
/* This file is part of Eigen, a C++ template library for linear algebra
* Copyright (C) 2007 Benoit Jacob <jacob@math.jussieu.fr>
*
* Based on Tvmet source code, http://tvmet.sourceforge.net,
* Copyright (C) 2001 - 2003 Olaf Petzold <opetzold@users.sourceforge.net>
*
* This library is free software; you can redistribute it and/or
@ -28,7 +28,6 @@
namespace tvmet {
/**
* \class CommaInitializer CommaInitializer.h "tvmet/CommaInitializer.h"
* \brief Initialize classes using a comma separated lists.
@ -63,99 +62,74 @@ namespace tvmet {
template<class Obj, int LEN>
class CommaInitializer
{
CommaInitializer();
CommaInitializer& operator=(const CommaInitializer&);
typedef typename Obj::value_type value_type;
private:
/**
* \class Initializer
* \brief Helper fo recursive overloaded comma operator.
*/
template<class T, int N> class Initializer
template<int N> class Initializer
{
Initializer();
Initializer& operator=(const Initializer&);
public:
typedef T value_type;
typedef T* iterator;
public:
Initializer(iterator iter) : m_iter(iter) { }
Initializer(Obj& obj, int index) : m_obj(obj), m_index(index) {}
/** Overloads the comma operator for recursive assign values from comma
separated list. */
Initializer<value_type, N+1> operator,(value_type rhs)
Initializer<N+1> operator,(value_type rhs)
{
TVMET_CT_CONDITION(N < LEN, CommaInitializerList_is_too_long)
*m_iter = rhs;
return Initializer<value_type, N+1>(m_iter + 1);
m_obj.commaWrite(m_index, rhs);
return Initializer<N+1>(m_obj, m_index+1);
}
private:
iterator m_iter;
Obj& m_obj;
int m_index;
};
public:
typedef typename Obj::value_type value_type;
typedef value_type* iterator;
public:
CommaInitializer(const CommaInitializer& rhs)
: m_object(rhs.m_object),
m_data(rhs.m_data),
m_wipeout_on_destruct(true)
{
rhs.disable();
}
m_data(rhs.m_data)
{}
/** Constructor used by Vector or Matrix operator(value_type rhs) */
CommaInitializer(Obj& obj, value_type x)
: m_object(obj),
m_data(x),
m_wipeout_on_destruct(true)
{ }
m_data(x)
{}
/** Destructs and assigns the comma separated value. */
~CommaInitializer() {
if(m_wipeout_on_destruct) m_object.assign_value(m_data);
}
/** Destructor, does nothing. */
~CommaInitializer() {}
/** Overloaded comma operator, called only once for the first occoured comma. This
means the first value is assigned by %operator=() and the 2nd value after the
comma. Therfore we call the %Initializer::operator,() for the list starting
comma. Therefore we call the %Initializer::operator,() for the list starting
after the 2nd. */
Initializer<value_type, 2> operator,(value_type rhs);
void disable() const { m_wipeout_on_destruct = false; }
Initializer<2> operator,(value_type rhs);
private:
Obj& m_object;
value_type m_data;
mutable bool m_wipeout_on_destruct;
};
/*
* Implementation
*/
template<class Obj, int LEN>
typename CommaInitializer<Obj, LEN>::template Initializer<typename Obj::value_type, 2>
typename CommaInitializer<Obj, LEN>::template Initializer<2>
CommaInitializer<Obj, LEN>::operator,(typename Obj::value_type rhs)
{
m_wipeout_on_destruct = false;
iterator iter1 = m_object.data();
*iter1 = m_data;
iterator iter2 = iter1 + 1;
*iter2 = rhs;
return Initializer<value_type, 2>(iter2 + 1);
m_object.commaWrite(0, m_data);
m_object.commaWrite(1, rhs);
return Initializer<2>(m_object, 2);
}
} // namespace tvmet
#endif // TVMET_COMMA_INITIALIZER_H
// Local Variables:

View File

@ -1,68 +0,0 @@
/*
* 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: Io.h,v 1.3 2004/04/30 16:03:38 opetzold Exp $
*/
#ifndef TVMET_IO_H
#define TVMET_IO_H
namespace tvmet {
/**
* \class IoPrintHelper Io.h "tvmet/Io.h"
* \brief Determines the number of digits regarding the sign of the
* container.
* This class is nesessary due to the complex type and the
* function min(), which are not defined for this type.
* So we have to dispatch between pod and complex types
* to get an information about the extra space for signs.
*/
template<class C>
class IoPrintHelper {
IoPrintHelper();
IoPrintHelper(const IoPrintHelper&);
IoPrintHelper& operator=(const IoPrintHelper&);
private:
static std::streamsize width(const C& e) {
std::streamsize w = static_cast<std::streamsize>(10); //FIXME arbitrary value
return w > 0 ? w : 0;
}
public:
static std::streamsize width(dispatch<true>, const C& e) {
return width(e);
}
static std::streamsize width(dispatch<false>, const C& e) {
std::streamsize w = width(e);
if(min(e) < 0) return w+1;
else return w;
}
};
};
#endif /* TVMET_IO_H */
// Local Variables:
// mode:C++
// End:

View File

@ -1,7 +1,7 @@
/*
* Tiny Vector Matrix Library
* Dense Vector Matrix Libary of Tiny size using Expression Templates
/* This file is part of Eigen, a C++ template library for linear algebra
* Copyright (C) 2007 Benoit Jacob <jacob@math.jussieu.fr>
*
* Based on Tvmet source code, http://tvmet.sourceforge.net,
* Copyright (C) 2001 - 2003 Olaf Petzold <opetzold@users.sourceforge.net>
*
* This library is free software; you can redistribute it and/or
@ -38,74 +38,56 @@
namespace tvmet {
/* forwards */
template<class T, int Rows, int Cols> class Matrix;
template<class T,
int RowsBgn, int RowsEnd,
int ColsBgn, int ColsEnd,
int RowStride, int ColStride /*=1*/>
class MatrixSliceConstReference; // unused here; for me only
/**
* \class MatrixConstReference Matrix.h "tvmet/Matrix.h"
* \class MatrixConstRef Matrix.h "tvmet/Matrix.h"
* \brief value iterator for ET
*/
template<class T, int NRows, int NCols>
class MatrixConstReference
: public TvmetBase < MatrixConstReference<T, NRows, NCols> >
template<class T, int Rows, int Cols>
class MatrixConstRef
: public TvmetBase < MatrixConstRef<T, Rows, Cols> >
{
public:
typedef T value_type;
typedef T* pointer;
typedef const T* const_pointer;
/** Dimensions. */
enum {
Rows = NRows, /**< Number of rows. */
Cols = NCols, /**< Number of cols. */
Size = Rows * Cols /**< Complete Size of Matrix. */
};
public:
/** Complexity counter. */
enum {
ops = Rows * Cols
};
typedef T value_type;
private:
MatrixConstReference();
MatrixConstReference& operator=(const MatrixConstReference&);
MatrixConstRef();
MatrixConstRef& operator=(const MatrixConstRef&);
public:
/** Constructor. */
explicit MatrixConstReference(const Matrix<T, Rows, Cols>& rhs)
: m_data(rhs.data())
explicit MatrixConstRef(const Matrix<T, Rows, Cols>& rhs)
: m_array(rhs.array())
{ }
/** Constructor by a given memory pointer. */
explicit MatrixConstReference(const_pointer data)
: m_data(data)
explicit MatrixConstRef(const T* data)
: m_array(data)
{ }
public: // access operators
/** access by index. */
value_type operator()(int i, int j) const {
assert((i < Rows) && (j < Cols));
return m_data[i * Cols + j];
T operator()(int i, int j) const {
assert(i >= 0 && j >= 0 && i < Rows && j < Cols);
return m_array[i + j * Rows];
}
public: // debugging Xpr parse tree
/** debugging Xpr parse tree */
void print_xpr(std::ostream& os, int l=0) const {
os << IndentLevel(l)
<< "MatrixConstReference[O=" << ops << "]<"
<< "T=" << typeid(value_type).name() << ">,"
<< "MatrixConstRef[O=" << ops << "]<"
<< "T=" << typeid(T).name() << ">,"
<< std::endl;
}
private:
const_pointer _tvmet_restrict m_data;
const T* _tvmet_restrict m_array;
};
@ -119,40 +101,13 @@ private:
* two paramters are needed). Therefore the cleanest way to do it is
* with operator() rather than with operator[]. \see C++ FAQ Lite 13.8
*/
template<class T, int NRows, int NCols>
template<class T, int Rows, int Cols>
class Matrix
{
public:
/** Data type of the tvmet::Matrix. */
typedef T value_type;
/** Reference type of the tvmet::Matrix data elements. */
typedef T& reference;
/** const reference type of the tvmet::Matrix data elements. */
typedef const T& const_reference;
/** STL iterator interface. */
typedef T* iterator;
/** STL const_iterator interface. */
typedef const T* const_iterator;
/** STL reverse iterator interface. */
typedef std::reverse_iterator<iterator> reverse_iterator;
/** STL const reverse iterator interface. */
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
public:
/** Dimensions. */
enum {
Rows = NRows, /**< Number of rows. */
Cols = NCols, /**< Number of cols. */
Size = Rows * Cols /**< Complete Size of Matrix. */
};
public:
typedef T value_type;
/** Complexity counter. */
enum {
ops_assign = Rows * Cols,
@ -160,94 +115,30 @@ public:
use_meta = ops < TVMET_COMPLEXITY_M_ASSIGN_TRIGGER ? true : false
};
public: // STL interface
/** STL iterator interface. */
iterator begin() { return m_data; }
/** STL iterator interface. */
iterator end() { return m_data + Size; }
/** STL const_iterator interface. */
const_iterator begin() const { return m_data; }
/** STL const_iterator interface. */
const_iterator end() const { return m_data + Size; }
/** STL reverse iterator interface reverse begin. */
reverse_iterator rbegin() { return reverse_iterator( end() ); }
/** STL const reverse iterator interface reverse begin. */
const_reverse_iterator rbegin() const {
return const_reverse_iterator( end() );
}
/** STL reverse iterator interface reverse end. */
reverse_iterator rend() { return reverse_iterator( begin() ); }
/** STL const reverse iterator interface reverse end. */
const_reverse_iterator rend() const {
return const_reverse_iterator( begin() );
}
/** The size of the matrix. */
static int size() { return Size; }
/** STL vector max_size() - returns allways rows()*cols(). */
static int max_size() { return Size; }
/** STL vector empty() - returns allways false. */
static bool empty() { return false; }
public:
/** The number of rows of matrix. */
/** The number of rows of the matrix. */
static int rows() { return Rows; }
/** The number of columns of matrix. */
/** The number of columns of the matrix. */
static int cols() { return Cols; }
public:
/** Default Destructor */
/** Default Destructor. Does nothing. */
~Matrix() {}
/** Default Constructor. The allocated memory region isn't cleared. If you want
a clean use the constructor argument zero. */
/** Default Constructor. Does nothing. The matrix entries are not initialized. */
explicit Matrix() {}
/** Copy Constructor, not explicit! */
Matrix(const Matrix& rhs)
{
*this = XprMatrix<ConstReference, Rows, Cols>(rhs.const_ref());
*this = XprMatrix<ConstRef, Rows, Cols>(rhs.constRef());
}
/**
* Constructor with STL iterator interface. The data will be copied into the matrix
* self, there isn't any stored reference to the array pointer.
*/
template<class InputIterator>
explicit Matrix(InputIterator first, InputIterator last)
explicit Matrix(const value_type* array)
{
assert(static_cast<int>(std::distance(first, last)) <= Size);
std::copy(first, last, m_data);
for(int i = 0; i < Rows * Cols; i++) m_array[i] = array[i];
}
/**
* Constructor with STL iterator interface. The data will be copied into the matrix
* self, there isn't any stored reference to the array pointer.
*/
template<class InputIterator>
explicit Matrix(InputIterator first, int sz)
{
assert(sz <= Size);
std::copy(first, first + sz, m_data);
}
/** Construct the matrix by value. */
explicit Matrix(value_type rhs)
{
typedef XprLiteral<value_type> expr_type;
*this = XprMatrix<expr_type, Rows, Cols>(expr_type(rhs));
}
/** Construct a matrix by expression. */
template<class E>
explicit Matrix(const XprMatrix<E, Rows, Cols>& e)
@ -255,49 +146,37 @@ public:
*this = e;
}
/** assign a value_type on array, this can be used for a single value
/** assign a T on array, this can be used for a single value
or a comma separeted list of values. */
CommaInitializer<Matrix, Size> operator=(value_type rhs) {
return CommaInitializer<Matrix, Size>(*this, rhs);
CommaInitializer<Matrix, Rows * Cols> operator=(T rhs) {
return CommaInitializer<Matrix, Rows * Cols>(*this, rhs);
}
public: // access operators
value_type* _tvmet_restrict data() { return m_data; }
const value_type* _tvmet_restrict data() const { return m_data; }
T* _tvmet_restrict array() { return m_array; }
const T* _tvmet_restrict array() const { return m_array; }
public: // index access operators
value_type& _tvmet_restrict operator()(int i, int j) {
T& _tvmet_restrict operator()(int i, int j) {
// Note: g++-2.95.3 does have problems on typedef reference
assert((i < Rows) && (j < Cols));
return m_data[i * Cols + j];
assert(i >= 0 && j >= 0 && i < Rows && j < Cols);
return m_array[i + j * Rows];
}
value_type operator()(int i, int j) const {
assert((i < Rows) && (j < Cols));
return m_data[i * Cols + j];
const T& operator()(int i, int j) const {
assert(i >= 0 && j >= 0 && i < Rows && j < Cols);
return m_array[i + j * Rows];
}
public: // ET interface
typedef MatrixConstReference<T, Rows, Cols> ConstReference;
typedef MatrixSliceConstReference<
T,
0, Rows, 0, Cols,
Rows, 1
> SliceConstReference;
typedef MatrixConstRef<T, Rows, Cols> ConstRef;
/** Return a const Reference of the internal data */
ConstReference const_ref() const { return ConstReference(*this); }
ConstRef constRef() const { return ConstRef(*this); }
/**
* Return a sliced const Reference of the internal data.
* \note Doesn't work since isn't implemented, but it is in
* progress. Therefore this is a placeholder. */
ConstReference const_sliceref() const { return SliceConstReference(*this); }
/** Return the vector as const expression. */
XprMatrix<ConstReference, Rows, Cols> as_expr() const {
return XprMatrix<ConstReference, Rows, Cols>(this->const_ref());
/** Return the matrix as const expression. */
XprMatrix<ConstRef, Rows, Cols> expr() const {
return XprMatrix<ConstRef, Rows, Cols>(this->constRef());
}
private:
@ -315,8 +194,7 @@ private:
loop::Matrix<Rows, Cols>::assign(dest, src, assign_fn);
}
private:
/** assign this to a matrix of a different type T2 using
/** assign *this to a matrix of a different type T2 using
the functional assign_fn. */
template<class T2, class Assign>
void assign_to(Matrix<T2, Rows, Cols>& dest, const Assign& assign_fn) const {
@ -329,68 +207,52 @@ public: // assign operations
generated. */
template<class T2>
Matrix& operator=(const Matrix<T2, Rows, Cols>& rhs) {
rhs.assign_to(*this, Fcnl_assign<value_type, T2>());
rhs.assign_to(*this, Fcnl_assign<T, T2>());
return *this;
}
/** assign a given XprMatrix element wise to this matrix. */
template <class E>
Matrix& operator=(const XprMatrix<E, Rows, Cols>& rhs) {
rhs.assign_to(*this, Fcnl_assign<value_type, typename E::value_type>());
rhs.assign_to(*this, Fcnl_assign<T, typename E::value_type>());
return *this;
}
private:
template<class Obj, int LEN> friend class CommaInitializer;
void commaWrite(int index, T rhs)
{
int row = index / Cols;
int col = index % Cols;
m_array[row + col * Rows] = rhs;
}
/** This is a helper for assigning a comma separated initializer
list. It's equal to Matrix& operator=(value_type) which does
list. It's equal to Matrix& operator=(T) which does
replace it. */
Matrix& assign_value(value_type rhs) {
typedef XprLiteral<value_type> expr_type;
Matrix& assign_value(T rhs) {
typedef XprLiteral<T> expr_type;
*this = XprMatrix<expr_type, Rows, Cols>(expr_type(rhs));
return *this;
}
public: // math operators with scalars
// NOTE: this meaning is clear - element wise ops even if not in ns element_wise
Matrix& operator+=(value_type) _tvmet_always_inline;
Matrix& operator-=(value_type) _tvmet_always_inline;
Matrix& operator*=(value_type) _tvmet_always_inline;
Matrix& operator/=(value_type) _tvmet_always_inline;
Matrix& operator+=(T) _tvmet_always_inline;
Matrix& operator-=(T) _tvmet_always_inline;
Matrix& operator*=(T) _tvmet_always_inline;
Matrix& operator/=(T) _tvmet_always_inline;
Matrix& operator%=(int) _tvmet_always_inline;
Matrix& operator^=(int) _tvmet_always_inline;
Matrix& operator&=(int) _tvmet_always_inline;
Matrix& operator|=(int) _tvmet_always_inline;
Matrix& operator<<=(int) _tvmet_always_inline;
Matrix& operator>>=(int) _tvmet_always_inline;
public: // math operators with matrizes
// NOTE: access using the operators in ns element_wise, since that's what is does
template <class T2> Matrix& M_add_eq(const Matrix<T2, Rows, Cols>&) _tvmet_always_inline;
template <class T2> Matrix& M_sub_eq(const Matrix<T2, Rows, Cols>&) _tvmet_always_inline;
template <class T2> Matrix& M_mul_eq(const Matrix<T2, Rows, Cols>&) _tvmet_always_inline;
template <class T2> Matrix& M_div_eq(const Matrix<T2, Rows, Cols>&) _tvmet_always_inline;
template <class T2> Matrix& M_mod_eq(const Matrix<T2, Rows, Cols>&) _tvmet_always_inline;
template <class T2> Matrix& M_xor_eq(const Matrix<T2, Rows, Cols>&) _tvmet_always_inline;
template <class T2> Matrix& M_and_eq(const Matrix<T2, Rows, Cols>&) _tvmet_always_inline;
template <class T2> Matrix& M_or_eq (const Matrix<T2, Rows, Cols>&) _tvmet_always_inline;
template <class T2> Matrix& M_shl_eq(const Matrix<T2, Rows, Cols>&) _tvmet_always_inline;
template <class T2> Matrix& M_shr_eq(const Matrix<T2, Rows, Cols>&) _tvmet_always_inline;
public: // math operators with expressions
// NOTE: access using the operators in ns element_wise, since that's what is does
template <class E> Matrix& M_add_eq(const XprMatrix<E, Rows, Cols>&) _tvmet_always_inline;
template <class E> Matrix& M_sub_eq(const XprMatrix<E, Rows, Cols>&) _tvmet_always_inline;
template <class E> Matrix& M_mul_eq(const XprMatrix<E, Rows, Cols>&) _tvmet_always_inline;
template <class E> Matrix& M_div_eq(const XprMatrix<E, Rows, Cols>&) _tvmet_always_inline;
template <class E> Matrix& M_mod_eq(const XprMatrix<E, Rows, Cols>&) _tvmet_always_inline;
template <class E> Matrix& M_xor_eq(const XprMatrix<E, Rows, Cols>&) _tvmet_always_inline;
template <class E> Matrix& M_and_eq(const XprMatrix<E, Rows, Cols>&) _tvmet_always_inline;
template <class E> Matrix& M_or_eq (const XprMatrix<E, Rows, Cols>&) _tvmet_always_inline;
template <class E> Matrix& M_shl_eq(const XprMatrix<E, Rows, Cols>&) _tvmet_always_inline;
template <class E> Matrix& M_shr_eq(const XprMatrix<E, Rows, Cols>&) _tvmet_always_inline;
public: // aliased math operators with expressions
template <class T2> Matrix& alias_assign(const Matrix<T2, Rows, Cols>&) _tvmet_always_inline;
@ -409,7 +271,7 @@ public: // io
/** Structure for info printing as Matrix<T, Rows, Cols>. */
struct Info : public TvmetBase<Info> {
std::ostream& print_xpr(std::ostream& os) const {
os << "Matrix<T=" << typeid(value_type).name()
os << "Matrix<T=" << typeid(T).name()
<< ", R=" << Rows << ", C=" << Cols << ">";
return os;
}
@ -426,7 +288,7 @@ public: // io
private:
/** The data of matrix self. */
value_type m_data[Size];
T m_array[Rows * Cols];
};
typedef Matrix<int, 2, 2> Matrix2i;

View File

@ -26,60 +26,6 @@
namespace tvmet {
/**
* \fn bool all_elements(const XprMatrix<E, Rows, Cols>& e)
* \brief check on statements for all elements
* \ingroup _unary_function
* This is for use with boolean operators like
* \par Example:
* \code
* all_elements(matrix > 0) {
* // true branch
* } else {
* // false branch
* }
* \endcode
* \sa \ref compare
*/
template<class E, int Rows, int Cols>
inline
bool all_elements(const XprMatrix<E, Rows, Cols>& e) {
return meta::Matrix<Rows, Cols, 0, 0>::all_elements(e);
}
/**
* \fn bool any_elements(const XprMatrix<E, Rows, Cols>& e)
* \brief check on statements for any elements
* \ingroup _unary_function
* This is for use with boolean operators like
* \par Example:
* \code
* any_elements(matrix > 0) {
* // true branch
* } else {
* // false branch
* }
* \endcode
* \sa \ref compare
*/
template<class E, int Rows, int Cols>
inline
bool any_elements(const XprMatrix<E, Rows, Cols>& e) {
return meta::Matrix<Rows, Cols, 0, 0>::any_elements(e);
}
/*
* trinary evaluation functions with matrizes and xpr of
*
* XprMatrix<E1, Rows, Cols> ? Matrix<T2, Rows, Cols> : Matrix<T3, Rows, Cols>
* XprMatrix<E1, Rows, Cols> ? Matrix<T2, Rows, Cols> : XprMatrix<E3, Rows, Cols>
* XprMatrix<E1, Rows, Cols> ? XprMatrix<E2, Rows, Cols> : Matrix<T3, Rows, Cols>
* XprMatrix<E1, Rows, Cols> ? XprMatrix<E2, Rows, Cols> : XprMatrix<E3, Rows, Cols>
*/
/**
* \fn eval(const XprMatrix<E1, Rows, Cols>& e1, const Matrix<T2, Rows, Cols>& m2, const Matrix<T3, Rows, Cols>& m3)
* \brief Evals the matrix expressions.
@ -92,8 +38,8 @@ inline
XprMatrix<
XprEval<
XprMatrix<E1, Rows, Cols>,
MatrixConstReference<T2, Rows, Cols>,
MatrixConstReference<T3, Rows, Cols>
MatrixConstRef<T2, Rows, Cols>,
MatrixConstRef<T3, Rows, Cols>
>,
Rows, Cols
>
@ -102,11 +48,11 @@ eval(const XprMatrix<E1, Rows, Cols>& e1,
const Matrix<T3, Rows, Cols>& m3) {
typedef XprEval<
XprMatrix<E1, Rows, Cols>,
MatrixConstReference<T2, Rows, Cols>,
MatrixConstReference<T3, Rows, Cols>
MatrixConstRef<T2, Rows, Cols>,
MatrixConstRef<T3, Rows, Cols>
> expr_type;
return XprMatrix<expr_type, Rows, Cols>(
expr_type(e1, m2.const_ref(), m3.const_ref()));
expr_type(e1, m2.constRef(), m3.constRef()));
}
@ -122,7 +68,7 @@ inline
XprMatrix<
XprEval<
XprMatrix<E1, Rows, Cols>,
MatrixConstReference<T2, Rows, Cols>,
MatrixConstRef<T2, Rows, Cols>,
XprMatrix<E3, Rows, Cols>
>,
Rows, Cols
@ -132,11 +78,11 @@ eval(const XprMatrix<E1, Rows, Cols>& e1,
const XprMatrix<E3, Rows, Cols>& e3) {
typedef XprEval<
XprMatrix<E1, Rows, Cols>,
MatrixConstReference<T2, Rows, Cols>,
MatrixConstRef<T2, Rows, Cols>,
XprMatrix<E3, Rows, Cols>
> expr_type;
return XprMatrix<expr_type, Rows, Cols>(
expr_type(e1, m2.const_ref(), e3));
expr_type(e1, m2.constRef(), e3));
}
@ -153,7 +99,7 @@ XprMatrix<
XprEval<
XprMatrix<E1, Rows, Cols>,
XprMatrix<E2, Rows, Cols>,
MatrixConstReference<T3, Rows, Cols>
MatrixConstRef<T3, Rows, Cols>
>,
Rows, Cols
>
@ -163,10 +109,10 @@ eval(const XprMatrix<E1, Rows, Cols>& e1,
typedef XprEval<
XprMatrix<E1, Rows, Cols>,
XprMatrix<E2, Rows, Cols>,
MatrixConstReference<T3, Rows, Cols>
MatrixConstRef<T3, Rows, Cols>
> expr_type;
return XprMatrix<expr_type, Rows, Cols>(
expr_type(e1, e2, m3.const_ref()));
expr_type(e1, e2, m3.constRef()));
}
@ -268,7 +214,6 @@ eval(const XprMatrix<E1, Rows, Cols>& e1, const XprMatrix<E2, Rows, Cols>& e2, P
}
TVMET_IMPLEMENT_MACRO(int)
TVMET_IMPLEMENT_MACRO(float)
TVMET_IMPLEMENT_MACRO(double)
@ -368,7 +313,6 @@ eval(const XprMatrix<E1, Rows, Cols>& e1, const XprMatrix<E2, Rows, Cols>& e2, c
}
#endif // defined(EIGEN_USE_COMPLEX)
} // namespace tvmet
#endif // TVMET_MATRIX_EVAL_H

View File

@ -30,7 +30,7 @@ namespace tvmet {
/* forwards */
template<class T, int Sz> class Vector;
template<class T, int Sz> class VectorConstReference;
template<class T, int Sz> class VectorConstRef;
/*********************************************************
@ -53,8 +53,8 @@ template<class T1, class T2, int Rows, int Cols> \
XprMatrix< \
XprBinOp< \
Fcnl_##NAME<T1, T2>, \
MatrixConstReference<T1, Rows, Cols>, \
MatrixConstReference<T2, Rows, Cols> \
MatrixConstRef<T1, Rows, Cols>, \
MatrixConstRef<T2, Rows, Cols> \
>, \
Rows, Cols \
> \
@ -66,7 +66,7 @@ XprMatrix< \
XprBinOp< \
Fcnl_##NAME<typename E::value_type, T>, \
XprMatrix<E, Rows, Cols>, \
MatrixConstReference<T, Rows, Cols> \
MatrixConstRef<T, Rows, Cols> \
>, \
Rows, Cols \
> \
@ -77,7 +77,7 @@ template<class T, class E, int Rows, int Cols> \
XprMatrix< \
XprBinOp< \
Fcnl_##NAME<typename E::value_type, T>, \
MatrixConstReference<T, Rows, Cols>, \
MatrixConstRef<T, Rows, Cols>, \
XprMatrix<E, Rows, Cols> \
>, \
Rows, Cols \
@ -105,7 +105,7 @@ template<class T, int Rows, int Cols> \
XprMatrix< \
XprBinOp< \
Fcnl_##NAME<T, POD >, \
MatrixConstReference<T, Rows, Cols>, \
MatrixConstRef<T, Rows, Cols>, \
XprLiteral<POD > \
>, \
Rows, Cols \
@ -118,7 +118,7 @@ XprMatrix< \
XprBinOp< \
Fcnl_##NAME< POD, T>, \
XprLiteral< POD >, \
MatrixConstReference<T, Rows, Cols> \
MatrixConstRef<T, Rows, Cols> \
>, \
Rows, Cols \
> \
@ -155,7 +155,7 @@ template<class T, int Rows, int Cols> \
XprMatrix< \
XprBinOp< \
Fcnl_##NAME< std::complex<T>, std::complex<T> >, \
MatrixConstReference< std::complex<T>, Rows, Cols>, \
MatrixConstRef< std::complex<T>, Rows, Cols>, \
XprLiteral<std::complex<T> > \
>, \
Rows, Cols \
@ -168,7 +168,7 @@ XprMatrix< \
XprBinOp< \
Fcnl_##NAME< std::complex<T>, std::complex<T> >, \
XprLiteral< std::complex<T> >, \
MatrixConstReference< std::complex<T>, Rows, Cols> \
MatrixConstRef< std::complex<T>, Rows, Cols> \
>, \
Rows, Cols \
> \
@ -194,8 +194,8 @@ template<class T1, int Rows1, int Cols1,
class T2, int Cols2>
XprMatrix<
XprMMProduct<
MatrixConstReference<T1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1)
MatrixConstReference<T2, Cols1, Cols2>, Cols2 // M2(Cols1, Cols2)
MatrixConstRef<T1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1)
MatrixConstRef<T2, Cols1, Cols2>, Cols2 // M2(Cols1, Cols2)
>,
Rows1, Cols2 // return Dim
>
@ -208,7 +208,7 @@ template<class E1, int Rows1, int Cols1,
XprMatrix<
XprMMProduct<
XprMatrix<E1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1)
MatrixConstReference<T2, Cols1, Cols2>, Cols2 // M2(Cols1, Cols2)
MatrixConstRef<T2, Cols1, Cols2>, Cols2 // M2(Cols1, Cols2)
>,
Rows1, Cols2 // return Dim
>
@ -220,7 +220,7 @@ template<class T1, int Rows1, int Cols1,
class E2, int Cols2>
XprMatrix<
XprMMProduct<
MatrixConstReference<T1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1)
MatrixConstRef<T1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1)
XprMatrix<E2, Cols1, Cols2>, Cols2 // M2(Cols1, Cols2)
>,
Rows1, Cols2 // return Dim
@ -233,8 +233,8 @@ template<class T1, int Rows1, int Cols1,
class T2, int Cols2>
XprMatrix<
XprMMProductTransposed<
MatrixConstReference<T1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1)
MatrixConstReference<T2, Cols1, Cols2>, Cols2 // M2(Cols1, Cols2)
MatrixConstRef<T1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1)
MatrixConstRef<T2, Cols1, Cols2>, Cols2 // M2(Cols1, Cols2)
>,
Cols2, Rows1 // return Dim
>
@ -246,8 +246,8 @@ template<class T1, int Rows1, int Cols1,
class T2, int Cols2> // Rows2 = Rows1
XprMatrix<
XprMtMProduct<
MatrixConstReference<T1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1)
MatrixConstReference<T2, Rows1, Cols2>, Cols2 // M2(Rows1, Cols2)
MatrixConstRef<T1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1)
MatrixConstRef<T2, Rows1, Cols2>, Cols2 // M2(Rows1, Cols2)
>,
Cols1, Cols2 // return Dim
>
@ -259,8 +259,8 @@ template<class T1, int Rows1, int Cols1,
class T2, int Rows2>
XprMatrix<
XprMMtProduct<
MatrixConstReference<T1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1)
MatrixConstReference<T2, Rows2, Cols1>, Cols1 // M2(Rows2, Cols1)
MatrixConstRef<T1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1)
MatrixConstRef<T2, Rows2, Cols1>, Cols1 // M2(Rows2, Cols1)
>,
Rows1, Rows2 // return Dim
>
@ -276,8 +276,8 @@ MMt_prod(const Matrix<T1, Rows1, Cols1>& lhs,
template<class T1, class T2, int Rows, int Cols>
XprVector<
XprMVProduct<
MatrixConstReference<T1, Rows, Cols>, Rows, Cols, // M(Rows, Cols)
VectorConstReference<T2, Cols> // V
MatrixConstRef<T1, Rows, Cols>, Rows, Cols, // M(Rows, Cols)
VectorConstRef<T2, Cols> // V
>,
Rows
>
@ -288,7 +288,7 @@ prod(const Matrix<T1, Rows, Cols>& lhs,
template<class T1, class E2, int Rows, int Cols>
XprVector<
XprMVProduct<
MatrixConstReference<T1, Rows, Cols>, Rows, Cols,
MatrixConstRef<T1, Rows, Cols>, Rows, Cols,
XprVector<E2, Cols>
>,
Rows
@ -301,7 +301,7 @@ template<class E1, class T2, int Rows, int Cols>
XprVector<
XprMVProduct<
XprMatrix<E1, Rows, Cols>, Rows, Cols, // M(Rows, Cols)
VectorConstReference<T2, Cols> // V
VectorConstRef<T2, Cols> // V
>,
Rows
>
@ -312,8 +312,8 @@ prod(const XprMatrix<E1, Rows, Cols>& lhs,
template<class T1, class T2, int Rows, int Cols>
XprVector<
XprMtVProduct<
MatrixConstReference<T1, Rows, Cols>, Rows, Cols, // M(Rows, Cols)
VectorConstReference<T2, Rows> // V
MatrixConstRef<T1, Rows, Cols>, Rows, Cols, // M(Rows, Cols)
VectorConstRef<T2, Rows> // V
>,
Cols
>
@ -329,7 +329,7 @@ Mtx_prod(const Matrix<T1, Rows, Cols>& lhs,
template<class T, int Rows, int Cols>
XprMatrix<
XprMatrixTranspose<
MatrixConstReference<T, Rows, Cols>
MatrixConstRef<T, Rows, Cols>
>,
Cols, Rows
>
@ -344,7 +344,7 @@ trace(const Matrix<T, Sz, Sz>& m) _tvmet_always_inline;
template<class T, int Rows, int Cols>
XprVector<
XprMatrixRow<
MatrixConstReference<T, Rows, Cols>,
MatrixConstRef<T, Rows, Cols>,
Rows, Cols
>,
Cols
@ -356,7 +356,7 @@ row(const Matrix<T, Rows, Cols>& m,
template<class T, int Rows, int Cols>
XprVector<
XprMatrixCol<
MatrixConstReference<T, Rows, Cols>,
MatrixConstRef<T, Rows, Cols>,
Rows, Cols
>,
Rows
@ -368,7 +368,7 @@ col(const Matrix<T, Rows, Cols>& m,
template<class T, int Sz>
XprVector<
XprMatrixDiag<
MatrixConstReference<T, Sz, Sz>,
MatrixConstRef<T, Sz, Sz>,
Sz
>,
Sz
@ -444,7 +444,7 @@ identity() _tvmet_always_inline;
template<class T, int Rows, int Cols>
XprMatrix<
MatrixConstReference<T, Rows, Cols>,
MatrixConstRef<T, Rows, Cols>,
Rows, Cols
>
cmatrix_ref(const T* mem) _tvmet_always_inline;
@ -471,19 +471,19 @@ inline \
XprMatrix< \
XprBinOp< \
Fcnl_##NAME<T1, T2>, \
MatrixConstReference<T1, Rows, Cols>, \
MatrixConstReference<T2, Rows, Cols> \
MatrixConstRef<T1, Rows, Cols>, \
MatrixConstRef<T2, Rows, Cols> \
>, \
Rows, Cols \
> \
NAME (const Matrix<T1, Rows, Cols>& lhs, const Matrix<T2, Rows, Cols>& rhs) { \
typedef XprBinOp < \
Fcnl_##NAME<T1, T2>, \
MatrixConstReference<T1, Rows, Cols>, \
MatrixConstReference<T2, Rows, Cols> \
MatrixConstRef<T1, Rows, Cols>, \
MatrixConstRef<T2, Rows, Cols> \
> expr_type; \
return XprMatrix<expr_type, Rows, Cols>( \
expr_type(lhs.const_ref(), rhs.const_ref())); \
expr_type(lhs.constRef(), rhs.constRef())); \
} \
\
template<class E, class T, int Rows, int Cols> \
@ -492,7 +492,7 @@ XprMatrix< \
XprBinOp< \
Fcnl_##NAME<typename E::value_type, T>, \
XprMatrix<E, Rows, Cols>, \
MatrixConstReference<T, Rows, Cols> \
MatrixConstRef<T, Rows, Cols> \
>, \
Rows, Cols \
> \
@ -500,10 +500,10 @@ NAME (const XprMatrix<E, Rows, Cols>& lhs, const Matrix<T, Rows, Cols>& rhs) { \
typedef XprBinOp< \
Fcnl_##NAME<typename E::value_type, T>, \
XprMatrix<E, Rows, Cols>, \
MatrixConstReference<T, Rows, Cols> \
MatrixConstRef<T, Rows, Cols> \
> expr_type; \
return XprMatrix<expr_type, Rows, Cols>( \
expr_type(lhs, rhs.const_ref())); \
expr_type(lhs, rhs.constRef())); \
} \
\
template<class T, class E, int Rows, int Cols> \
@ -511,7 +511,7 @@ inline \
XprMatrix< \
XprBinOp< \
Fcnl_##NAME<typename E::value_type, T>, \
MatrixConstReference<T, Rows, Cols>, \
MatrixConstRef<T, Rows, Cols>, \
XprMatrix<E, Rows, Cols> \
>, \
Rows, Cols \
@ -519,11 +519,11 @@ XprMatrix< \
NAME (const Matrix<T, Rows, Cols>& lhs, const XprMatrix<E, Rows, Cols>& rhs) { \
typedef XprBinOp< \
Fcnl_##NAME<T, typename E::value_type>, \
MatrixConstReference<T, Rows, Cols>, \
MatrixConstRef<T, Rows, Cols>, \
XprMatrix<E, Rows, Cols> \
> expr_type; \
return XprMatrix<expr_type, Rows, Cols>( \
expr_type(lhs.const_ref(), rhs)); \
expr_type(lhs.constRef(), rhs)); \
}
TVMET_IMPLEMENT_MACRO(add) // per se element wise
@ -547,7 +547,7 @@ inline \
XprMatrix< \
XprBinOp< \
Fcnl_##NAME<T, POD >, \
MatrixConstReference<T, Rows, Cols>, \
MatrixConstRef<T, Rows, Cols>, \
XprLiteral<POD > \
>, \
Rows, Cols \
@ -555,11 +555,11 @@ XprMatrix< \
NAME (const Matrix<T, Rows, Cols>& lhs, POD rhs) { \
typedef XprBinOp< \
Fcnl_##NAME<T, POD >, \
MatrixConstReference<T, Rows, Cols>, \
MatrixConstRef<T, Rows, Cols>, \
XprLiteral< POD > \
> expr_type; \
return XprMatrix<expr_type, Rows, Cols>( \
expr_type(lhs.const_ref(), XprLiteral< POD >(rhs))); \
expr_type(lhs.constRef(), XprLiteral< POD >(rhs))); \
} \
\
template<class T, int Rows, int Cols> \
@ -568,7 +568,7 @@ XprMatrix< \
XprBinOp< \
Fcnl_##NAME< POD, T>, \
XprLiteral< POD >, \
MatrixConstReference<T, Rows, Cols> \
MatrixConstRef<T, Rows, Cols> \
>, \
Rows, Cols \
> \
@ -576,10 +576,10 @@ NAME (POD lhs, const Matrix<T, Rows, Cols>& rhs) { \
typedef XprBinOp< \
Fcnl_##NAME< POD, T>, \
XprLiteral< POD >, \
MatrixConstReference<T, Rows, Cols> \
MatrixConstRef<T, Rows, Cols> \
> expr_type; \
return XprMatrix<expr_type, Rows, Cols>( \
expr_type(XprLiteral< POD >(lhs), rhs.const_ref())); \
expr_type(XprLiteral< POD >(lhs), rhs.constRef())); \
}
TVMET_IMPLEMENT_MACRO(add, int)
@ -613,7 +613,7 @@ inline \
XprMatrix< \
XprBinOp< \
Fcnl_##NAME< std::complex<T>, std::complex<T> >, \
MatrixConstReference< std::complex<T>, Rows, Cols>, \
MatrixConstRef< std::complex<T>, Rows, Cols>, \
XprLiteral<std::complex<T> > \
>, \
Rows, Cols \
@ -622,11 +622,11 @@ NAME (const Matrix< std::complex<T>, Rows, Cols>& lhs, \
const std::complex<T>& rhs) { \
typedef XprBinOp< \
Fcnl_##NAME< std::complex<T>, std::complex<T> >, \
MatrixConstReference< std::complex<T>, Rows, Cols>, \
MatrixConstRef< std::complex<T>, Rows, Cols>, \
XprLiteral< std::complex<T> > \
> expr_type; \
return XprMatrix<expr_type, Rows, Cols>( \
expr_type(lhs.const_ref(), XprLiteral< std::complex<T> >(rhs))); \
expr_type(lhs.constRef(), XprLiteral< std::complex<T> >(rhs))); \
} \
\
template<class T, int Rows, int Cols> \
@ -635,7 +635,7 @@ XprMatrix< \
XprBinOp< \
Fcnl_##NAME< std::complex<T>, std::complex<T> >, \
XprLiteral< std::complex<T> >, \
MatrixConstReference< std::complex<T>, Rows, Cols> \
MatrixConstRef< std::complex<T>, Rows, Cols> \
>, \
Rows, Cols \
> \
@ -644,10 +644,10 @@ NAME (const std::complex<T>& lhs, \
typedef XprBinOp< \
Fcnl_##NAME< std::complex<T>, std::complex<T> >, \
XprLiteral< std::complex<T> >, \
MatrixConstReference<T, Rows, Cols> \
MatrixConstRef<T, Rows, Cols> \
> expr_type; \
return XprMatrix<expr_type, Rows, Cols>( \
expr_type(XprLiteral< std::complex<T> >(lhs), rhs.const_ref())); \
expr_type(XprLiteral< std::complex<T> >(lhs), rhs.constRef())); \
}
TVMET_IMPLEMENT_MACRO(add)
@ -676,18 +676,18 @@ template<class T1, int Rows1, int Cols1,
inline
XprMatrix<
XprMMProduct<
MatrixConstReference<T1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1)
MatrixConstReference<T2, Cols1, Cols2>, Cols2 // M2(Cols1, Cols2)
MatrixConstRef<T1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1)
MatrixConstRef<T2, Cols1, Cols2>, Cols2 // M2(Cols1, Cols2)
>,
Rows1, Cols2 // return Dim
>
prod(const Matrix<T1, Rows1, Cols1>& lhs, const Matrix<T2, Cols1, Cols2>& rhs) {
typedef XprMMProduct<
MatrixConstReference<T1, Rows1, Cols1>, Rows1, Cols1,
MatrixConstReference<T2, Cols1, Cols2>, Cols2
MatrixConstRef<T1, Rows1, Cols1>, Rows1, Cols1,
MatrixConstRef<T2, Cols1, Cols2>, Cols2
> expr_type;
return XprMatrix<expr_type, Rows1, Cols2>(
expr_type(lhs.const_ref(), rhs.const_ref()));
expr_type(lhs.constRef(), rhs.constRef()));
}
@ -702,17 +702,17 @@ inline
XprMatrix<
XprMMProduct<
XprMatrix<E1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1)
MatrixConstReference<T2, Cols1, Cols2>, Cols2 // M2(Cols1, Cols2)
MatrixConstRef<T2, Cols1, Cols2>, Cols2 // M2(Cols1, Cols2)
>,
Rows1, Cols2 // return Dim
>
prod(const XprMatrix<E1, Rows1, Cols1>& lhs, const Matrix<T2, Cols1, Cols2>& rhs) {
typedef XprMMProduct<
XprMatrix<E1, Rows1, Cols1>, Rows1, Cols1,
MatrixConstReference<T2, Cols1, Cols2>, Cols2
MatrixConstRef<T2, Cols1, Cols2>, Cols2
> expr_type;
return XprMatrix<expr_type, Rows1, Cols2>(
expr_type(lhs, rhs.const_ref()));
expr_type(lhs, rhs.constRef()));
}
@ -726,18 +726,18 @@ template<class T1, int Rows1, int Cols1,
inline
XprMatrix<
XprMMProduct<
MatrixConstReference<T1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1)
MatrixConstRef<T1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1)
XprMatrix<E2, Cols1, Cols2>, Cols2 // M2(Cols1, Cols2)
>,
Rows1, Cols2 // return Dim
>
prod(const Matrix<T1, Rows1, Cols1>& lhs, const XprMatrix<E2, Cols1, Cols2>& rhs) {
typedef XprMMProduct<
MatrixConstReference<T1, Rows1, Cols1>, Rows1, Cols1,
MatrixConstRef<T1, Rows1, Cols1>, Rows1, Cols1,
XprMatrix<E2, Cols1, Cols2>, Cols2
> expr_type;
return XprMatrix<expr_type, Rows1, Cols2>(
expr_type(lhs.const_ref(), rhs));
expr_type(lhs.constRef(), rhs));
}
@ -755,18 +755,18 @@ template<class T1, int Rows1, int Cols1,
inline
XprMatrix<
XprMMProductTransposed<
MatrixConstReference<T1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1)
MatrixConstReference<T2, Cols1, Cols2>, Cols2 // M2(Cols1, Cols2)
MatrixConstRef<T1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1)
MatrixConstRef<T2, Cols1, Cols2>, Cols2 // M2(Cols1, Cols2)
>,
Cols2, Rows1 // return Dim
>
trans_prod(const Matrix<T1, Rows1, Cols1>& lhs, const Matrix<T2, Cols1, Cols2>& rhs) {
typedef XprMMProductTransposed<
MatrixConstReference<T1, Rows1, Cols1>, Rows1, Cols1,
MatrixConstReference<T2, Cols1, Cols2>, Cols2
MatrixConstRef<T1, Rows1, Cols1>, Rows1, Cols1,
MatrixConstRef<T2, Cols1, Cols2>, Cols2
> expr_type;
return XprMatrix<expr_type, Cols2, Rows1>(
expr_type(lhs.const_ref(), rhs.const_ref()));
expr_type(lhs.constRef(), rhs.constRef()));
}
@ -787,18 +787,18 @@ template<class T1, int Rows1, int Cols1,
inline
XprMatrix<
XprMtMProduct<
MatrixConstReference<T1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1)
MatrixConstReference<T2, Rows1, Cols2>, Cols2 // M2(Rows1, Cols2)
MatrixConstRef<T1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1)
MatrixConstRef<T2, Rows1, Cols2>, Cols2 // M2(Rows1, Cols2)
>,
Cols1, Cols2 // return Dim
>
MtM_prod(const Matrix<T1, Rows1, Cols1>& lhs, const Matrix<T2, Rows1, Cols2>& rhs) {
typedef XprMtMProduct<
MatrixConstReference<T1, Rows1, Cols1>, Rows1, Cols1,
MatrixConstReference<T2, Rows1, Cols2>, Cols2
MatrixConstRef<T1, Rows1, Cols1>, Rows1, Cols1,
MatrixConstRef<T2, Rows1, Cols2>, Cols2
> expr_type;
return XprMatrix<expr_type, Cols1, Cols2>(
expr_type(lhs.const_ref(), rhs.const_ref()));
expr_type(lhs.constRef(), rhs.constRef()));
}
@ -813,18 +813,18 @@ template<class T1, int Rows1, int Cols1,
inline
XprMatrix<
XprMMtProduct<
MatrixConstReference<T1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1)
MatrixConstReference<T2, Rows2, Cols1>, Cols1 // M2(Rows2, Cols1)
MatrixConstRef<T1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1)
MatrixConstRef<T2, Rows2, Cols1>, Cols1 // M2(Rows2, Cols1)
>,
Rows1, Rows2 // return Dim
>
MMt_prod(const Matrix<T1, Rows1, Cols1>& lhs, const Matrix<T2, Rows2, Cols1>& rhs) {
typedef XprMMtProduct<
MatrixConstReference<T1, Rows1, Cols1>, Rows1, Cols1,
MatrixConstReference<T2, Rows2, Cols1>, Cols1
MatrixConstRef<T1, Rows1, Cols1>, Rows1, Cols1,
MatrixConstRef<T2, Rows2, Cols1>, Cols1
> expr_type;
return XprMatrix<expr_type, Rows1, Rows2>(
expr_type(lhs.const_ref(), rhs.const_ref()));
expr_type(lhs.constRef(), rhs.constRef()));
}
@ -842,18 +842,18 @@ template<class T1, class T2, int Rows, int Cols>
inline
XprVector<
XprMVProduct<
MatrixConstReference<T1, Rows, Cols>, Rows, Cols, // M(Rows, Cols)
VectorConstReference<T2, Cols> // V
MatrixConstRef<T1, Rows, Cols>, Rows, Cols, // M(Rows, Cols)
VectorConstRef<T2, Cols> // V
>,
Rows
>
prod(const Matrix<T1, Rows, Cols>& lhs, const Vector<T2, Cols>& rhs) {
typedef XprMVProduct<
MatrixConstReference<T1, Rows, Cols>, Rows, Cols,
VectorConstReference<T2, Cols>
MatrixConstRef<T1, Rows, Cols>, Rows, Cols,
VectorConstRef<T2, Cols>
> expr_type;
return XprVector<expr_type, Rows>(
expr_type(lhs.const_ref(), rhs.const_ref()));
expr_type(lhs.constRef(), rhs.constRef()));
}
@ -866,18 +866,18 @@ template<class T1, class E2, int Rows, int Cols>
inline
XprVector<
XprMVProduct<
MatrixConstReference<T1, Rows, Cols>, Rows, Cols,
MatrixConstRef<T1, Rows, Cols>, Rows, Cols,
XprVector<E2, Cols>
>,
Rows
>
prod(const Matrix<T1, Rows, Cols>& lhs, const XprVector<E2, Cols>& rhs) {
typedef XprMVProduct<
MatrixConstReference<T1, Rows, Cols>, Rows, Cols,
MatrixConstRef<T1, Rows, Cols>, Rows, Cols,
XprVector<E2, Cols>
> expr_type;
return XprVector<expr_type, Rows>(
expr_type(lhs.const_ref(), rhs));
expr_type(lhs.constRef(), rhs));
}
@ -891,17 +891,17 @@ inline
XprVector<
XprMVProduct<
XprMatrix<E1, Rows, Cols>, Rows, Cols, // M(Rows, Cols)
VectorConstReference<T2, Cols> // V
VectorConstRef<T2, Cols> // V
>,
Rows
>
prod(const XprMatrix<E1, Rows, Cols>& lhs, const Vector<T2, Cols>& rhs) {
typedef XprMVProduct<
XprMatrix<E1, Rows, Cols>, Rows, Cols,
VectorConstReference<T2, Cols>
VectorConstRef<T2, Cols>
> expr_type;
return XprVector<expr_type, Rows>(
expr_type(lhs, rhs.const_ref()));
expr_type(lhs, rhs.constRef()));
}
@ -918,18 +918,18 @@ template<class T1, class T2, int Rows, int Cols>
inline
XprVector<
XprMtVProduct<
MatrixConstReference<T1, Rows, Cols>, Rows, Cols, // M(Rows, Cols)
VectorConstReference<T2, Rows> // V
MatrixConstRef<T1, Rows, Cols>, Rows, Cols, // M(Rows, Cols)
VectorConstRef<T2, Rows> // V
>,
Cols
>
Mtx_prod(const Matrix<T1, Rows, Cols>& lhs, const Vector<T2, Rows>& rhs) {
typedef XprMtVProduct<
MatrixConstReference<T1, Rows, Cols>, Rows, Cols,
VectorConstReference<T2, Rows>
MatrixConstRef<T1, Rows, Cols>, Rows, Cols,
VectorConstRef<T2, Rows>
> expr_type;
return XprVector<expr_type, Cols>(
expr_type(lhs.const_ref(), rhs.const_ref()));
expr_type(lhs.constRef(), rhs.constRef()));
}
@ -947,16 +947,16 @@ template<class T, int Rows, int Cols>
inline
XprMatrix<
XprMatrixTranspose<
MatrixConstReference<T, Rows, Cols>
MatrixConstRef<T, Rows, Cols>
>,
Cols, Rows
>
trans(const Matrix<T, Rows, Cols>& rhs) {
typedef XprMatrixTranspose<
MatrixConstReference<T, Rows, Cols>
MatrixConstRef<T, Rows, Cols>
> expr_type;
return XprMatrix<expr_type, Cols, Rows>(
expr_type(rhs.const_ref()));
expr_type(rhs.constRef()));
}
@ -987,17 +987,17 @@ template<class T, int Rows, int Cols>
inline
XprVector<
XprMatrixRow<
MatrixConstReference<T, Rows, Cols>,
MatrixConstRef<T, Rows, Cols>,
Rows, Cols
>,
Cols
>
row(const Matrix<T, Rows, Cols>& m, int no) {
typedef XprMatrixRow<
MatrixConstReference<T, Rows, Cols>,
MatrixConstRef<T, Rows, Cols>,
Rows, Cols
> expr_type;
return XprVector<expr_type, Cols>(expr_type(m.const_ref(), no));
return XprVector<expr_type, Cols>(expr_type(m.constRef(), no));
}
@ -1010,17 +1010,17 @@ template<class T, int Rows, int Cols>
inline
XprVector<
XprMatrixCol<
MatrixConstReference<T, Rows, Cols>,
MatrixConstRef<T, Rows, Cols>,
Rows, Cols
>,
Rows
>
col(const Matrix<T, Rows, Cols>& m, int no) {
typedef XprMatrixCol<
MatrixConstReference<T, Rows, Cols>,
MatrixConstRef<T, Rows, Cols>,
Rows, Cols
> expr_type;
return XprVector<expr_type, Rows>(expr_type(m.const_ref(), no));
return XprVector<expr_type, Rows>(expr_type(m.constRef(), no));
}
@ -1033,202 +1033,23 @@ template<class T, int Sz>
inline
XprVector<
XprMatrixDiag<
MatrixConstReference<T, Sz, Sz>,
MatrixConstRef<T, Sz, Sz>,
Sz
>,
Sz
>
diag(const Matrix<T, Sz, Sz>& m) {
typedef XprMatrixDiag<
MatrixConstReference<T, Sz, Sz>,
MatrixConstRef<T, Sz, Sz>,
Sz
> expr_type;
return XprVector<expr_type, Sz>(expr_type(m.const_ref()));
return XprVector<expr_type, Sz>(expr_type(m.constRef()));
}
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
* min/max unary functions
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
/**
* \fn maximum(const XprMatrix<E, Rows, Cols>& e)
* \brief Find the maximum of a matrix expression
* \ingroup _unary_function
*/
template<class E, int Rows, int Cols>
inline
Extremum<typename E::value_type, int, matrix_tag>
maximum(const XprMatrix<E, Rows, Cols>& e) {
typedef typename E::value_type value_type;
value_type temp(e(0, 0));
int row_no(0), col_no(0);
for(int i = 0; i != Rows; ++i) {
for(int j = 0; j != Cols; ++j) {
if(e(i, j) > temp) {
temp = e(i, j);
row_no = i;
col_no = j;
}
}
}
return Extremum<value_type, int, matrix_tag>(temp, row_no, col_no);
}
/**
* \fn maximum(const Matrix<T, Rows, Cols>& m)
* \brief Find the maximum of a matrix
* \ingroup _unary_function
*/
template<class T, int Rows, int Cols>
inline
Extremum<T, int, matrix_tag>
maximum(const Matrix<T, Rows, Cols>& m) { return maximum(m.as_expr()); }
/**
* \fn minimum(const XprMatrix<E, Rows, Cols>& e)
* \brief Find the minimum of a matrix expression
* \ingroup _unary_function
*/
template<class E, int Rows, int Cols>
inline
Extremum<typename E::value_type, int, matrix_tag>
minimum(const XprMatrix<E, Rows, Cols>& e) {
typedef typename E::value_type value_type;
value_type temp(e(0, 0));
int row_no(0), col_no(0);
for(int i = 0; i != Rows; ++i) {
for(int j = 0; j != Cols; ++j) {
if(e(i, j) < temp) {
temp = e(i, j);
row_no = i;
col_no = j;
}
}
}
return Extremum<value_type, int, matrix_tag>(temp, row_no, col_no);
}
/**
* \fn minimum(const Matrix<T, Rows, Cols>& m)
* \brief Find the minimum of a matrix
* \ingroup _unary_function
*/
template<class T, int Rows, int Cols>
inline
Extremum<T, int, matrix_tag>
minimum(const Matrix<T, Rows, Cols>& m) { return minimum(m.as_expr()); }
/**
* \fn max(const XprMatrix<E, Rows, Cols>& e)
* \brief Find the maximum of a matrix expression
* \ingroup _unary_function
*/
template<class E, int Rows, int Cols>
inline
typename E::value_type
max(const XprMatrix<E, Rows, Cols>& e) {
typedef typename E::value_type value_type;
value_type temp(e(0, 0));
for(int i = 0; i != Rows; ++i)
for(int j = 0; j != Cols; ++j)
if(e(i, j) > temp)
temp = e(i, j);
return temp;
}
/**
* \fn max(const Matrix<T, Rows, Cols>& m)
* \brief Find the maximum of a matrix
* \ingroup _unary_function
*/
template<class T, int Rows, int Cols>
inline
T max(const Matrix<T, Rows, Cols>& m) {
typedef T value_type;
typedef typename Matrix<
T, Rows, Cols
>::const_iterator const_iterator;
const_iterator iter(m.begin());
const_iterator last(m.end());
value_type temp(*iter);
for( ; iter != last; ++iter)
if(*iter > temp)
temp = *iter;
return temp;
}
/**
* \fn min(const XprMatrix<E, Rows, Cols>& e)
* \brief Find the minimum of a matrix expression
* \ingroup _unary_function
*/
template<class E, int Rows, int Cols>
inline
typename E::value_type
min(const XprMatrix<E, Rows, Cols>& e) {
typedef typename E::value_type value_type;
value_type temp(e(0, 0));
for(int i = 0; i != Rows; ++i)
for(int j = 0; j != Cols; ++j)
if(e(i, j) < temp)
temp = e(i, j);
return temp;
}
/**
* \fn min(const Matrix<T, Rows, Cols>& m)
* \brief Find the minimum of a matrix
* \ingroup _unary_function
*/
template<class T, int Rows, int Cols>
inline
T min(const Matrix<T, Rows, Cols>& m) {
typedef T value_type;
typedef typename Matrix<
T, Rows, Cols
>::const_iterator const_iterator;
const_iterator iter(m.begin());
const_iterator last(m.end());
value_type temp(*iter);
for( ; iter != last; ++iter)
if(*iter < temp)
temp = *iter;
return temp;
}
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
* other unary functions
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
/**
* \fn XprMatrix<XprIdentity<typename M::value_type, M::Rows, M::Cols>, M::Rows, M::Cols>identity()
* \brief Fill a matrix to an identity matrix.
@ -1329,11 +1150,11 @@ identity() {
template<class T, int Rows, int Cols>
inline
XprMatrix<
MatrixConstReference<T, Rows, Cols>,
MatrixConstRef<T, Rows, Cols>,
Rows, Cols
>
cmatrix_ref(const T* mem) {
typedef MatrixConstReference<T, Rows, Cols> expr_type;
typedef MatrixConstRef<T, Rows, Cols> expr_type;
return XprMatrix<expr_type, Rows, Cols>(expr_type(mem));
};

View File

@ -27,17 +27,14 @@
#include <iomanip> // setw
#include <tvmet/Functional.h>
#include <tvmet/Io.h>
namespace tvmet {
/*
* member operators for i/o
*/
template<class T, int NRows, int NCols>
std::ostream& Matrix<T, NRows, NCols>::print_xpr(std::ostream& os, int l) const
template<class T, int Rows, int Cols>
std::ostream& Matrix<T, Rows, Cols>::print_xpr(std::ostream& os, int l) const
{
os << IndentLevel(l++) << "Matrix[" << ops << "]<"
<< typeid(T).name() << ", " << Rows << ", " << Cols << ">,"
@ -48,26 +45,19 @@ std::ostream& Matrix<T, NRows, NCols>::print_xpr(std::ostream& os, int l) const
}
template<class T, int NRows, int NCols>
std::ostream& Matrix<T, NRows, NCols>::print_on(std::ostream& os) const
template<class T, int Rows, int Cols>
std::ostream& Matrix<T, Rows, Cols>::print_on(std::ostream& os) const
{
std::streamsize w;
if(Traits<value_type>::isComplex())
w = IoPrintHelper<Matrix>::width(dispatch<true>(), *this);
else
w = IoPrintHelper<Matrix>::width(dispatch<false>(), *this);
os << std::setw(0) << "[\n";
os << "[\n";
for(int i = 0; i < Rows; ++i) {
os << " [";
for(int j = 0; j < (Cols - 1); ++j) {
os << std::setw(w) << this->operator()(i, j) << ", ";
os << this->operator()(i, j) << ", ";
}
os << std::setw(w) << this->operator()(i, Cols - 1)
os << this->operator()(i, Cols - 1)
<< (i != (Rows-1) ? "],\n" : "]\n");
}
os << "]";
return os;
}
@ -75,10 +65,10 @@ std::ostream& Matrix<T, NRows, NCols>::print_on(std::ostream& os) const
* member operators with scalars, per se element wise
*/
#define TVMET_IMPLEMENT_MACRO(NAME, OP) \
template<class T, int NRows, int NCols> \
template<class T, int Rows, int Cols> \
inline \
Matrix<T, NRows, NCols>& \
Matrix<T, NRows, NCols>::operator OP (value_type rhs) { \
Matrix<T, Rows, Cols>& \
Matrix<T, Rows, Cols>::operator OP (value_type rhs) { \
typedef XprLiteral<value_type> expr_type; \
this->M_##NAME(XprMatrix<expr_type, Rows, Cols>(expr_type(rhs))); \
return *this; \
@ -90,36 +80,16 @@ TVMET_IMPLEMENT_MACRO(mul_eq, *=)
TVMET_IMPLEMENT_MACRO(div_eq, /=)
#undef TVMET_IMPLEMENT_MACRO
#define TVMET_IMPLEMENT_MACRO(NAME, OP) \
template<class T, int NRows, int NCols> \
inline \
Matrix<T, NRows, NCols>& \
Matrix<T, NRows, NCols>::operator OP (int rhs) { \
typedef XprLiteral<value_type> expr_type; \
this->M_##NAME(XprMatrix<expr_type, Rows, Cols>(expr_type(rhs))); \
return *this; \
}
TVMET_IMPLEMENT_MACRO(mod_eq, %=)
TVMET_IMPLEMENT_MACRO(xor_eq,^=)
TVMET_IMPLEMENT_MACRO(and_eq, &=)
TVMET_IMPLEMENT_MACRO(or_eq, |=)
TVMET_IMPLEMENT_MACRO(shl_eq, <<=)
TVMET_IMPLEMENT_MACRO(shr_eq, >>=)
#undef TVMET_IMPLEMENT_MACRO
/*
* member functions (operators) with matrizes, for use with +=,-= ... <<=
* member functions (operators) with matrizes, for use with +=,-= ...
*/
#define TVMET_IMPLEMENT_MACRO(NAME) \
template<class T1, int NRows, int NCols> \
template<class T1, int Rows, int Cols> \
template <class T2> \
inline \
Matrix<T1, NRows, NCols>& \
Matrix<T1, NRows, NCols>::M_##NAME (const Matrix<T2, Rows, Cols>& rhs) { \
this->M_##NAME( XprMatrix<typename Matrix<T2, Rows, Cols>::ConstReference, Rows, Cols>(rhs.const_ref()) ); \
Matrix<T1, Rows, Cols>& \
Matrix<T1, Rows, Cols>::M_##NAME (const Matrix<T2, Rows, Cols>& rhs) { \
this->M_##NAME( XprMatrix<typename Matrix<T2, Rows, Cols>::ConstRef, Rows, Cols>(rhs.constRef()) ); \
return *this; \
}
@ -127,24 +97,18 @@ TVMET_IMPLEMENT_MACRO(add_eq)
TVMET_IMPLEMENT_MACRO(sub_eq)
TVMET_IMPLEMENT_MACRO(mul_eq)
TVMET_IMPLEMENT_MACRO(div_eq)
TVMET_IMPLEMENT_MACRO(mod_eq)
TVMET_IMPLEMENT_MACRO(xor_eq)
TVMET_IMPLEMENT_MACRO(and_eq)
TVMET_IMPLEMENT_MACRO(or_eq)
TVMET_IMPLEMENT_MACRO(shl_eq)
TVMET_IMPLEMENT_MACRO(shr_eq)
#undef TVMET_IMPLEMENT_MACRO
/*
* member functions (operators) with expressions, for use width +=,-= ... <<=
* member functions (operators) with expressions, for use with +=,-= ...
*/
#define TVMET_IMPLEMENT_MACRO(NAME) \
template<class T, int NRows, int NCols> \
template<class T, int Rows, int Cols> \
template<class E> \
inline \
Matrix<T, NRows, NCols>& \
Matrix<T, NRows, NCols>::M_##NAME (const XprMatrix<E, Rows, Cols>& rhs) { \
Matrix<T, Rows, Cols>& \
Matrix<T, Rows, Cols>::M_##NAME (const XprMatrix<E, Rows, Cols>& rhs) { \
rhs.assign_to(*this, Fcnl_##NAME<value_type, typename E::value_type>()); \
return *this; \
}
@ -153,26 +117,19 @@ TVMET_IMPLEMENT_MACRO(add_eq)
TVMET_IMPLEMENT_MACRO(sub_eq)
TVMET_IMPLEMENT_MACRO(mul_eq)
TVMET_IMPLEMENT_MACRO(div_eq)
TVMET_IMPLEMENT_MACRO(mod_eq)
TVMET_IMPLEMENT_MACRO(xor_eq)
TVMET_IMPLEMENT_MACRO(and_eq)
TVMET_IMPLEMENT_MACRO(or_eq)
TVMET_IMPLEMENT_MACRO(shl_eq)
TVMET_IMPLEMENT_MACRO(shr_eq)
#undef TVMET_IMPLEMENT_MACRO
/*
* aliased member functions (operators) with matrizes,
* for use with +=,-= ... <<=
* for use with +=,-= ...
*/
#define TVMET_IMPLEMENT_MACRO(NAME) \
template<class T1, int NRows, int NCols> \
template<class T1, int Rows, int Cols> \
template <class T2> \
inline \
Matrix<T1, NRows, NCols>& \
Matrix<T1, NRows, NCols>::alias_##NAME (const Matrix<T2, Rows, Cols>& rhs) { \
this->alias_##NAME( XprMatrix<typename Matrix<T2, Rows, Cols>::ConstReference, Rows, Cols>(rhs.const_ref()) ); \
Matrix<T1, Rows, Cols>& \
Matrix<T1, Rows, Cols>::alias_##NAME (const Matrix<T2, Rows, Cols>& rhs) { \
this->alias_##NAME( XprMatrix<typename Matrix<T2, Rows, Cols>::ConstRef, Rows, Cols>(rhs.constRef()) ); \
return *this; \
}
@ -186,15 +143,15 @@ TVMET_IMPLEMENT_MACRO(div_eq)
/*
* aliased member functions (operators) with expressions,
* for use width +=,-= ... <<= and aliased(),
* for use with +=,-= ... and aliased(),
*/
#define TVMET_IMPLEMENT_MACRO(NAME) \
template<class T, int NRows, int NCols> \
template<class T, int Rows, int Cols> \
template<class E> \
inline \
Matrix<T, NRows, NCols>& \
Matrix<T, NRows, NCols>::alias_##NAME (const XprMatrix<E, Rows, Cols>& rhs) { \
typedef Matrix<T, NRows, NCols> temp_type; \
Matrix<T, Rows, Cols>& \
Matrix<T, Rows, Cols>::alias_##NAME (const XprMatrix<E, Rows, Cols>& rhs) { \
typedef Matrix<T, Rows, Cols> temp_type; \
temp_type(rhs).assign_to(*this, Fcnl_##NAME<value_type, typename E::value_type>()); \
return *this; \
}

View File

@ -86,8 +86,8 @@ template<class T1, class T2, int Rows, int Cols> \
XprMatrix< \
XprBinOp< \
Fcnl_##NAME<T1, T2>, \
MatrixConstReference<T1, Rows, Cols>, \
MatrixConstReference<T2, Rows, Cols> \
MatrixConstRef<T1, Rows, Cols>, \
MatrixConstRef<T2, Rows, Cols> \
>, \
Rows, Cols \
> \
@ -99,7 +99,7 @@ XprMatrix< \
XprBinOp< \
Fcnl_##NAME<typename E::value_type, T>, \
XprMatrix<E, Rows, Cols>, \
MatrixConstReference<T, Rows, Cols> \
MatrixConstRef<T, Rows, Cols> \
>, \
Rows, Cols \
> \
@ -110,7 +110,7 @@ template<class T, class E, int Rows, int Cols> \
XprMatrix< \
XprBinOp< \
Fcnl_##NAME<typename E::value_type, T>, \
MatrixConstReference<T, Rows, Cols>, \
MatrixConstRef<T, Rows, Cols>, \
XprMatrix<E, Rows, Cols> \
>, \
Rows, Cols \
@ -137,7 +137,7 @@ template<class T, int Rows, int Cols> \
XprMatrix< \
XprBinOp< \
Fcnl_##NAME<T, POD >, \
MatrixConstReference<T, Rows, Cols>, \
MatrixConstRef<T, Rows, Cols>, \
XprLiteral<POD > \
>, \
Rows, Cols \
@ -150,7 +150,7 @@ XprMatrix< \
XprBinOp< \
Fcnl_##NAME< POD, T>, \
XprLiteral< POD >, \
MatrixConstReference<T, Rows, Cols> \
MatrixConstRef<T, Rows, Cols> \
>, \
Rows, Cols \
> \
@ -187,7 +187,7 @@ template<class T, int Rows, int Cols> \
XprMatrix< \
XprBinOp< \
Fcnl_##NAME< std::complex<T>, std::complex<T> >, \
MatrixConstReference< std::complex<T>, Rows, Cols>, \
MatrixConstRef< std::complex<T>, Rows, Cols>, \
XprLiteral<std::complex<T> > \
>, \
Rows, Cols \
@ -200,7 +200,7 @@ XprMatrix< \
XprBinOp< \
Fcnl_##NAME< std::complex<T>, std::complex<T> >, \
XprLiteral< std::complex<T> >, \
MatrixConstReference< std::complex<T>, Rows, Cols> \
MatrixConstRef< std::complex<T>, Rows, Cols> \
>, \
Rows, Cols \
> \
@ -226,8 +226,8 @@ template<class T1, int Rows1, int Cols1,
class T2, int Cols2>
XprMatrix<
XprMMProduct<
MatrixConstReference<T1, Rows1, Cols1>, Rows1, Cols1,
MatrixConstReference<T2, Cols1, Cols2>, Cols2
MatrixConstRef<T1, Rows1, Cols1>, Rows1, Cols1,
MatrixConstRef<T2, Cols1, Cols2>, Cols2
>,
Rows1, Cols2
>
@ -240,7 +240,7 @@ template<class E1, int Rows1, int Cols1,
XprMatrix<
XprMMProduct<
XprMatrix<E1, Rows1, Cols1>, Rows1, Cols1,
MatrixConstReference<T2, Cols1, Cols2>, Cols2
MatrixConstRef<T2, Cols1, Cols2>, Cols2
>,
Rows1, Cols2
>
@ -252,7 +252,7 @@ template<class T1, int Rows1, int Cols1,
class E2, int Cols2>
XprMatrix<
XprMMProduct<
MatrixConstReference<T1, Rows1, Cols1>, Rows1, Cols1,
MatrixConstRef<T1, Rows1, Cols1>, Rows1, Cols1,
XprMatrix<E2, Cols1, Cols2>, Cols2
>,
Rows1, Cols2
@ -269,8 +269,8 @@ operator*(const Matrix<T1, Rows1, Cols1>& lhs,
template<class T1, int Rows, int Cols, class T2>
XprVector<
XprMVProduct<
MatrixConstReference<T1, Rows, Cols>, Rows, Cols,
VectorConstReference<T2, Cols>
MatrixConstRef<T1, Rows, Cols>, Rows, Cols,
VectorConstRef<T2, Cols>
>,
Rows
>
@ -281,7 +281,7 @@ operator*(const Matrix<T1, Rows, Cols>& lhs,
template<class T1, class E2, int Rows, int Cols>
XprVector<
XprMVProduct<
MatrixConstReference<T1, Rows, Cols>, Rows, Cols,
MatrixConstRef<T1, Rows, Cols>, Rows, Cols,
XprVector<E2, Cols>
>,
Rows
@ -294,7 +294,7 @@ template<class E1, class T2, int Rows, int Cols>
XprVector<
XprMVProduct<
XprMatrix<E1, Rows, Cols>, Rows, Cols,
VectorConstReference<T2, Cols>
VectorConstRef<T2, Cols>
>,
Rows
>
@ -316,7 +316,7 @@ template <class T, int Rows, int Cols> \
XprMatrix< \
XprUnOp< \
Fcnl_##NAME<T>, \
MatrixConstReference<T, Rows, Cols> \
MatrixConstRef<T, Rows, Cols> \
>, \
Rows, Cols \
> \
@ -397,8 +397,8 @@ inline \
XprMatrix< \
XprBinOp< \
Fcnl_##NAME<T1, T2>, \
MatrixConstReference<T1, Rows, Cols>, \
MatrixConstReference<T2, Rows, Cols> \
MatrixConstRef<T1, Rows, Cols>, \
MatrixConstRef<T2, Rows, Cols> \
>, \
Rows, Cols \
> \
@ -412,7 +412,7 @@ XprMatrix< \
XprBinOp< \
Fcnl_##NAME<typename E::value_type, T>, \
XprMatrix<E, Rows, Cols>, \
MatrixConstReference<T, Rows, Cols> \
MatrixConstRef<T, Rows, Cols> \
>, \
Rows, Cols \
> \
@ -425,7 +425,7 @@ inline \
XprMatrix< \
XprBinOp< \
Fcnl_##NAME<typename E::value_type, T>, \
MatrixConstReference<T, Rows, Cols>, \
MatrixConstRef<T, Rows, Cols>, \
XprMatrix<E, Rows, Cols> \
>, \
Rows, Cols \
@ -454,7 +454,7 @@ inline \
XprMatrix< \
XprBinOp< \
Fcnl_##NAME<T, POD >, \
MatrixConstReference<T, Rows, Cols>, \
MatrixConstRef<T, Rows, Cols>, \
XprLiteral<POD > \
>, \
Rows, Cols \
@ -469,7 +469,7 @@ XprMatrix< \
XprBinOp< \
Fcnl_##NAME< POD, T>, \
XprLiteral< POD >, \
MatrixConstReference<T, Rows, Cols> \
MatrixConstRef<T, Rows, Cols> \
>, \
Rows, Cols \
> \
@ -508,7 +508,7 @@ inline \
XprMatrix< \
XprBinOp< \
Fcnl_##NAME< std::complex<T>, std::complex<T> >, \
MatrixConstReference< std::complex<T>, Rows, Cols>, \
MatrixConstRef< std::complex<T>, Rows, Cols>, \
XprLiteral<std::complex<T> > \
>, \
Rows, Cols \
@ -524,7 +524,7 @@ XprMatrix< \
XprBinOp< \
Fcnl_##NAME< std::complex<T>, std::complex<T> >, \
XprLiteral< std::complex<T> >, \
MatrixConstReference< std::complex<T>, Rows, Cols> \
MatrixConstRef< std::complex<T>, Rows, Cols> \
>, \
Rows, Cols \
> \
@ -560,8 +560,8 @@ template<class T1, int Rows1, int Cols1,
inline
XprMatrix<
XprMMProduct<
MatrixConstReference<T1, Rows1, Cols1>, Rows1, Cols1,
MatrixConstReference<T2, Cols1, Cols2>, Cols2
MatrixConstRef<T1, Rows1, Cols1>, Rows1, Cols1,
MatrixConstRef<T2, Cols1, Cols2>, Cols2
>,
Rows1, Cols2
>
@ -582,7 +582,7 @@ inline
XprMatrix<
XprMMProduct<
XprMatrix<E1, Rows1, Cols1>, Rows1, Cols1,
MatrixConstReference<T2, Cols1, Cols2>, Cols2
MatrixConstRef<T2, Cols1, Cols2>, Cols2
>,
Rows1, Cols2
>
@ -602,7 +602,7 @@ template<class T1, int Rows1, int Cols1,
inline
XprMatrix<
XprMMProduct<
MatrixConstReference<T1, Rows1, Cols1>, Rows1, Cols1,
MatrixConstRef<T1, Rows1, Cols1>, Rows1, Cols1,
XprMatrix<E2, Cols1, Cols2>, Cols2
>,
Rows1, Cols2
@ -628,8 +628,8 @@ template<class T1, int Rows, int Cols, class T2>
inline
XprVector<
XprMVProduct<
MatrixConstReference<T1, Rows, Cols>, Rows, Cols,
VectorConstReference<T2, Cols>
MatrixConstRef<T1, Rows, Cols>, Rows, Cols,
VectorConstRef<T2, Cols>
>,
Rows
>
@ -648,7 +648,7 @@ template<class T1, class E2, int Rows, int Cols>
inline
XprVector<
XprMVProduct<
MatrixConstReference<T1, Rows, Cols>, Rows, Cols,
MatrixConstRef<T1, Rows, Cols>, Rows, Cols,
XprVector<E2, Cols>
>,
Rows
@ -669,7 +669,7 @@ inline
XprVector<
XprMVProduct<
XprMatrix<E1, Rows, Cols>, Rows, Cols,
VectorConstReference<T2, Cols>
VectorConstRef<T2, Cols>
>,
Rows
>
@ -693,16 +693,16 @@ inline \
XprMatrix< \
XprUnOp< \
Fcnl_##NAME<T>, \
MatrixConstReference<T, Rows, Cols> \
MatrixConstRef<T, Rows, Cols> \
>, \
Rows, Cols \
> \
operator OP (const Matrix<T, Rows, Cols>& rhs) { \
typedef XprUnOp< \
Fcnl_##NAME<T>, \
MatrixConstReference<T, Rows, Cols> \
MatrixConstRef<T, Rows, Cols> \
> expr_type; \
return XprMatrix<expr_type, Rows, Cols>(expr_type(rhs.const_ref())); \
return XprMatrix<expr_type, Rows, Cols>(expr_type(rhs.constRef())); \
}
TVMET_IMPLEMENT_MACRO(neg, -)

View File

@ -36,7 +36,7 @@ inline \
XprMatrix< \
XprUnOp< \
Fcnl_##NAME< std::complex<T> >, \
MatrixConstReference<std::complex<T>, Rows, Cols> \
MatrixConstRef<std::complex<T>, Rows, Cols> \
>, \
Rows, Cols \
> \
@ -60,16 +60,16 @@ inline \
XprMatrix< \
XprUnOp< \
Fcnl_##NAME< std::complex<T> >, \
MatrixConstReference<std::complex<T>, Rows, Cols> \
MatrixConstRef<std::complex<T>, Rows, Cols> \
>, \
Rows, Cols \
> \
NAME(const Matrix<std::complex<T>, Rows, Cols>& rhs) { \
typedef XprUnOp< \
Fcnl_##NAME< std::complex<T> >, \
MatrixConstReference<std::complex<T>, Rows, Cols> \
MatrixConstRef<std::complex<T>, Rows, Cols> \
> expr_type; \
return XprMatrix<expr_type, Rows, Cols>(expr_type(rhs.const_ref())); \
return XprMatrix<expr_type, Rows, Cols>(expr_type(rhs.constRef())); \
}
TVMET_IMPLEMENT_MACRO(real)

View File

@ -41,12 +41,12 @@ template<class T, int Sz> class Vector;
/**
* \class VectorConstReference Vector.h "tvmet/Vector.h"
* \class VectorConstRef Vector.h "tvmet/Vector.h"
* \brief Const value iterator for ET
*/
template<class T, int Sz>
class VectorConstReference
: public TvmetBase< VectorConstReference<T, Sz> >
class VectorConstRef
: public TvmetBase< VectorConstRef<T, Sz> >
{
public: // types
typedef T value_type;
@ -66,37 +66,37 @@ public:
};
private:
VectorConstReference();
VectorConstReference& operator=(const VectorConstReference&);
VectorConstRef();
VectorConstRef& operator=(const VectorConstRef&);
public:
/** Constructor. */
explicit VectorConstReference(const Vector<T, Size>& rhs)
: m_data(rhs.data())
explicit VectorConstRef(const Vector<T, Size>& rhs)
: m_array(rhs.array())
{ }
/** Constructor by a given memory pointer. */
explicit VectorConstReference(const_pointer data)
: m_data(data)
explicit VectorConstRef(const_pointer data)
: m_array(data)
{ }
public: // access operators
/** access by index. */
value_type operator()(int i) const {
assert(i < Size);
return m_data[i];
return m_array[i];
}
public: // debugging Xpr parse tree
void print_xpr(std::ostream& os, int l=0) const {
os << IndentLevel(l)
<< "VectorConstReference[O=" << ops << "]<"
<< "VectorConstRef[O=" << ops << "]<"
<< "T=" << typeid(T).name() << ">,"
<< std::endl;
}
private:
const_pointer _tvmet_restrict m_data;
const_pointer _tvmet_restrict m_array;
};
@ -104,37 +104,13 @@ private:
* \class Vector Vector.h "tvmet/Vector.h"
* \brief Compile time fixed length vector with evaluation on compile time.
*/
template<class T, int Sz>
template<class T, int Size>
class Vector
{
public:
/** Data type of the tvmet::Vector. */
typedef T value_type;
/** Reference type of the tvmet::Vector data elements. */
typedef T& reference;
/** const reference type of the tvmet::Vector data elements. */
typedef const T& const_reference;
/** STL iterator interface. */
typedef T* iterator;
/** STL const_iterator interface. */
typedef const T* const_iterator;
/** STL reverse iterator interface. */
typedef std::reverse_iterator<iterator> reverse_iterator;
/** STL const reverse iterator interface. */
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
public:
/** Dimensions. */
enum {
Size = Sz /**< The size of the vector. */
};
public:
/** Complexity counter. */
enum {
@ -143,173 +119,22 @@ public:
use_meta = ops < TVMET_COMPLEXITY_V_ASSIGN_TRIGGER ? true : false
};
public: // STL interface
/** STL iterator interface. */
iterator begin() { return m_data; }
/** STL iterator interface. */
iterator end() { return m_data + Size; }
/** STL const_iterator interface. */
const_iterator begin() const { return m_data; }
/** STL const_iterator interface. */
const_iterator end() const { return m_data + Size; }
/** STL reverse iterator interface reverse begin. */
reverse_iterator rbegin() { return reverse_iterator( end() ); }
/** STL const reverse iterator interface reverse begin. */
const_reverse_iterator rbegin() const {
return const_reverse_iterator( end() );
}
/** STL reverse iterator interface reverse end. */
reverse_iterator rend() { return reverse_iterator( begin() ); }
/** STL const reverse iterator interface reverse end. */
const_reverse_iterator rend() const {
return const_reverse_iterator( begin() );
}
/** STL vector front element. */
value_type front() { return m_data[0]; }
/** STL vector const front element. */
const_reference front() const { return m_data[0]; }
/** STL vector back element. */
value_type back() { return m_data[Size-1]; }
/** STL vector const back element. */
const_reference back() const { return m_data[Size-1]; }
/** STL vector empty() - returns allways false. */
static bool empty() { return false; }
/** The size of the vector. */
static int size() { return Size; }
/** STL vector max_size() - returns allways Size. */
static int max_size() { return Size; }
public:
/** Default Destructor */
~Vector() {}
/** Default Constructor. The allocated memory region isn't cleared. If you want
a clean use the constructor argument zero. */
/** Default Constructor. Does nothing. */
explicit Vector() {}
/** Copy Constructor, not explicit! */
Vector(const Vector& rhs)
{
*this = XprVector<ConstReference, Size>(rhs.const_ref());
*this = XprVector<ConstRef, Size>(rhs.constRef());
}
/**
* Constructor with STL iterator interface. The data will be copied into the
* vector self, there isn't any stored reference to the array pointer.
*/
template<class InputIterator>
explicit Vector(InputIterator first, InputIterator last)
explicit Vector(const value_type* array)
{
assert( static_cast<int>(std::distance(first, last)) <= Size);
std::copy(first, last, m_data);
}
/**
* Constructor with STL iterator interface. The data will be copied into the
* vector self, there isn't any stored reference to the array pointer.
*/
template<class InputIterator>
explicit Vector(InputIterator first, int sz)
{
assert(sz <= Size);
std::copy(first, first + sz, m_data);
}
/** Constructor with initializer for all elements. */
explicit Vector(value_type rhs)
{
typedef XprLiteral<value_type> expr_type;
*this = XprVector<expr_type, Size>(expr_type(rhs));
}
/** Default Constructor with initializer list. */
explicit Vector(value_type x0, value_type x1)
{
TVMET_CT_CONDITION(2 <= Size, ArgumentList_is_too_long)
m_data[0] = x0; m_data[1] = x1;
}
/** Default Constructor with initializer list. */
explicit Vector(value_type x0, value_type x1, value_type x2)
{
TVMET_CT_CONDITION(3 <= Size, ArgumentList_is_too_long)
m_data[0] = x0; m_data[1] = x1; m_data[2] = x2;
}
/** Default Constructor with initializer list. */
explicit Vector(value_type x0, value_type x1, value_type x2, value_type x3)
{
TVMET_CT_CONDITION(4 <= Size, ArgumentList_is_too_long)
m_data[0] = x0; m_data[1] = x1; m_data[2] = x2; m_data[3] = x3;
}
/** Default Constructor with initializer list. */
explicit Vector(value_type x0, value_type x1, value_type x2, value_type x3,
value_type x4)
{
TVMET_CT_CONDITION(5 <= Size, ArgumentList_is_too_long)
m_data[0] = x0; m_data[1] = x1; m_data[2] = x2; m_data[3] = x3; m_data[4] = x4;
}
/** Default Constructor with initializer list. */
explicit Vector(value_type x0, value_type x1, value_type x2, value_type x3,
value_type x4, value_type x5)
{
TVMET_CT_CONDITION(6 <= Size, ArgumentList_is_too_long)
m_data[0] = x0; m_data[1] = x1; m_data[2] = x2; m_data[3] = x3; m_data[4] = x4;
m_data[5] = x5;
}
/** Default Constructor with initializer list. */
explicit Vector(value_type x0, value_type x1, value_type x2, value_type x3,
value_type x4, value_type x5, value_type x6)
{
TVMET_CT_CONDITION(7 <= Size, ArgumentList_is_too_long)
m_data[0] = x0; m_data[1] = x1; m_data[2] = x2; m_data[3] = x3; m_data[4] = x4;
m_data[5] = x5; m_data[6] = x6;
}
/** Default Constructor with initializer list. */
explicit Vector(value_type x0, value_type x1, value_type x2, value_type x3,
value_type x4, value_type x5, value_type x6, value_type x7)
{
TVMET_CT_CONDITION(8 <= Size, ArgumentList_is_too_long)
m_data[0] = x0; m_data[1] = x1; m_data[2] = x2; m_data[3] = x3; m_data[4] = x4;
m_data[5] = x5; m_data[6] = x6; m_data[7] = x7;
}
/** Default Constructor with initializer list. */
explicit Vector(value_type x0, value_type x1, value_type x2, value_type x3,
value_type x4, value_type x5, value_type x6, value_type x7,
value_type x8)
{
TVMET_CT_CONDITION(9 <= Size, ArgumentList_is_too_long)
m_data[0] = x0; m_data[1] = x1; m_data[2] = x2; m_data[3] = x3; m_data[4] = x4;
m_data[5] = x5; m_data[6] = x6; m_data[7] = x7; m_data[8] = x8;
}
/** Default Constructor with initializer list. */
explicit Vector(value_type x0, value_type x1, value_type x2, value_type x3,
value_type x4, value_type x5, value_type x6, value_type x7,
value_type x8, value_type x9)
{
TVMET_CT_CONDITION(10 <= Size, ArgumentList_is_too_long)
m_data[0] = x0; m_data[1] = x1; m_data[2] = x2; m_data[3] = x3; m_data[4] = x4;
m_data[5] = x5; m_data[6] = x6; m_data[7] = x7; m_data[8] = x8; m_data[9] = x9;
for(int i = 0; i < Size; i++) m_array[i] = array[i];
}
/** Construct a vector by expression. */
@ -326,19 +151,19 @@ public:
}
public: // access operators
value_type* _tvmet_restrict data() { return m_data; }
const value_type* _tvmet_restrict data() const { return m_data; }
value_type* _tvmet_restrict array() { return m_array; }
const value_type* _tvmet_restrict array() const { return m_array; }
public: // index access operators
value_type& _tvmet_restrict operator()(int i) {
// Note: g++-2.95.3 does have problems on typedef reference
assert(i < Size);
return m_data[i];
return m_array[i];
}
value_type operator()(int i) const {
assert(i < Size);
return m_data[i];
return m_array[i];
}
value_type& _tvmet_restrict operator[](int i) {
@ -351,14 +176,14 @@ public: // index access operators
}
public: // ET interface
typedef VectorConstReference<T, Size> ConstReference;
typedef VectorConstRef<T, Size> ConstRef;
/** Return a const Reference of the internal data */
ConstReference const_ref() const { return ConstReference(*this); }
ConstRef constRef() const { return ConstRef(*this); }
/** Return the vector as const expression. */
XprVector<ConstReference, Size> as_expr() const {
return XprVector<ConstReference, Size>(this->const_ref());
XprVector<ConstRef, Size> expr() const {
return XprVector<ConstRef, Size>(this->constRef());
}
private:
@ -402,6 +227,11 @@ public: // assign operations
private:
template<class Obj, int LEN> friend class CommaInitializer;
void commaWrite(int index, T rhs)
{
m_array[index] = rhs;
}
/** This is a helper for assigning a comma separated initializer
list. It's equal to Vector& operator=(value_type) which does
replace it. */
@ -431,12 +261,6 @@ public: // math assign operators with vectors
template <class T2> Vector& M_sub_eq(const Vector<T2, Size>&) _tvmet_always_inline;
template <class T2> Vector& M_mul_eq(const Vector<T2, Size>&) _tvmet_always_inline;
template <class T2> Vector& M_div_eq(const Vector<T2, Size>&) _tvmet_always_inline;
template <class T2> Vector& M_mod_eq(const Vector<T2, Size>&) _tvmet_always_inline;
template <class T2> Vector& M_xor_eq(const Vector<T2, Size>&) _tvmet_always_inline;
template <class T2> Vector& M_and_eq(const Vector<T2, Size>&) _tvmet_always_inline;
template <class T2> Vector& M_or_eq (const Vector<T2, Size>&) _tvmet_always_inline;
template <class T2> Vector& M_shl_eq(const Vector<T2, Size>&) _tvmet_always_inline;
template <class T2> Vector& M_shr_eq(const Vector<T2, Size>&) _tvmet_always_inline;
public: // math operators with expressions
// NOTE: access using the operators in ns element_wise, since that's what is does
@ -444,12 +268,6 @@ public: // math operators with expressions
template <class E> Vector& M_sub_eq(const XprVector<E, Size>&) _tvmet_always_inline;
template <class E> Vector& M_mul_eq(const XprVector<E, Size>&) _tvmet_always_inline;
template <class E> Vector& M_div_eq(const XprVector<E, Size>&) _tvmet_always_inline;
template <class E> Vector& M_mod_eq(const XprVector<E, Size>&) _tvmet_always_inline;
template <class E> Vector& M_xor_eq(const XprVector<E, Size>&) _tvmet_always_inline;
template <class E> Vector& M_and_eq(const XprVector<E, Size>&) _tvmet_always_inline;
template <class E> Vector& M_or_eq (const XprVector<E, Size>&) _tvmet_always_inline;
template <class E> Vector& M_shl_eq(const XprVector<E, Size>&) _tvmet_always_inline;
template <class E> Vector& M_shr_eq(const XprVector<E, Size>&) _tvmet_always_inline;
public: // aliased math operators with expressions, used with proxy
template <class T2> Vector& alias_assign(const Vector<T2, Size>&) _tvmet_always_inline;
@ -486,7 +304,7 @@ public: // io
private:
/** The data of vector self. */
value_type m_data[Size];
value_type m_array[Size];
};
typedef Vector<int, 2> Vector2i;

View File

@ -96,19 +96,19 @@ inline
XprVector<
XprEval<
XprVector<E1, Sz>,
VectorConstReference<T2, Sz>,
VectorConstReference<T3, Sz>
VectorConstRef<T2, Sz>,
VectorConstRef<T3, Sz>
>,
Sz
>
eval(const XprVector<E1, Sz>& e1, const Vector<T2, Sz>& v2, const Vector<T3, Sz>& v3) {
typedef XprEval<
XprVector<E1, Sz>,
VectorConstReference<T2, Sz>,
VectorConstReference<T3, Sz>
VectorConstRef<T2, Sz>,
VectorConstRef<T3, Sz>
> expr_type;
return XprVector<expr_type, Sz>(
expr_type(e1, v2.const_ref(), v3.const_ref()));
expr_type(e1, v2.constRef(), v3.constRef()));
}
@ -124,7 +124,7 @@ inline
XprVector<
XprEval<
XprVector<E1, Sz>,
VectorConstReference<T2, Sz>,
VectorConstRef<T2, Sz>,
XprVector<E3, Sz>
>,
Sz
@ -132,11 +132,11 @@ XprVector<
eval(const XprVector<E1, Sz>& e1, const Vector<T2, Sz>& v2, const XprVector<E3, Sz>& e3) {
typedef XprEval<
XprVector<E1, Sz>,
VectorConstReference<T2, Sz>,
VectorConstRef<T2, Sz>,
XprVector<E3, Sz>
> expr_type;
return XprVector<expr_type, Sz>(
expr_type(e1, v2.const_ref(), e3));
expr_type(e1, v2.constRef(), e3));
}
@ -153,7 +153,7 @@ XprVector<
XprEval<
XprVector<E1, Sz>,
XprVector<E2, Sz>,
VectorConstReference<T3, Sz>
VectorConstRef<T3, Sz>
>,
Sz
>
@ -161,10 +161,10 @@ eval(const XprVector<E1, Sz>& e1, const XprVector<E2, Sz>& e2, const Vector<T3,
typedef XprEval<
XprVector<E1, Sz>,
XprVector<E2, Sz>,
VectorConstReference<T3, Sz>
VectorConstRef<T3, Sz>
> expr_type;
return XprVector<expr_type, Sz>(
expr_type(e1, e2, v3.const_ref()));
expr_type(e1, e2, v3.constRef()));
}

View File

@ -49,8 +49,8 @@ template<class T1, class T2, int Sz> \
XprVector< \
XprBinOp< \
Fcnl_##NAME<T1, T2>, \
VectorConstReference<T1, Sz>, \
VectorConstReference<T2, Sz> \
VectorConstRef<T1, Sz>, \
VectorConstRef<T2, Sz> \
>, \
Sz \
> \
@ -62,7 +62,7 @@ XprVector< \
XprBinOp< \
Fcnl_##NAME<typename E::value_type, T>, \
XprVector<E, Sz>, \
VectorConstReference<T, Sz> \
VectorConstRef<T, Sz> \
>, \
Sz \
> \
@ -73,7 +73,7 @@ template<class E, class T, int Sz> \
XprVector< \
XprBinOp< \
Fcnl_##NAME<T, typename E::value_type>, \
VectorConstReference<T, Sz>, \
VectorConstRef<T, Sz>, \
XprVector<E, Sz> \
>, \
Sz \
@ -101,7 +101,7 @@ template<class T, int Sz> \
XprVector< \
XprBinOp< \
Fcnl_##NAME< T, POD >, \
VectorConstReference<T, Sz>, \
VectorConstRef<T, Sz>, \
XprLiteral< POD > \
>, \
Sz \
@ -114,7 +114,7 @@ XprVector< \
XprBinOp< \
Fcnl_##NAME< POD, T>, \
XprLiteral< POD >, \
VectorConstReference<T, Sz> \
VectorConstRef<T, Sz> \
>, \
Sz \
> \
@ -151,7 +151,7 @@ template<class T, int Sz> \
XprVector< \
XprBinOp< \
Fcnl_##NAME< std::complex<T>, std::complex<T> >, \
VectorConstReference< std::complex<T>, Sz>, \
VectorConstRef< std::complex<T>, Sz>, \
XprLiteral< std::complex<T> > \
>, \
Sz \
@ -164,7 +164,7 @@ XprVector< \
XprBinOp< \
Fcnl_##NAME< std::complex<T>, std::complex<T> >, \
XprLiteral< std::complex<T> >, \
VectorConstReference< std::complex<T>, Sz> \
VectorConstRef< std::complex<T>, Sz> \
>, \
Sz \
> \
@ -222,7 +222,7 @@ template<class T, int Sz>
XprVector<
XprBinOp<
Fcnl_div<T, T>,
VectorConstReference<T, Sz>,
VectorConstRef<T, Sz>,
XprLiteral< T >
>,
Sz
@ -274,7 +274,7 @@ T min(const Vector<T, Sz>& v) _tvmet_always_inline;
template<class T, int Sz>
XprVector<
VectorConstReference<T, Sz>,
VectorConstRef<T, Sz>,
Sz
>
cvector_ref(const T* mem) _tvmet_always_inline;
@ -301,19 +301,19 @@ inline \
XprVector< \
XprBinOp< \
Fcnl_##NAME<T1, T2>, \
VectorConstReference<T1, Sz>, \
VectorConstReference<T2, Sz> \
VectorConstRef<T1, Sz>, \
VectorConstRef<T2, Sz> \
>, \
Sz \
> \
NAME (const Vector<T1, Sz>& lhs, const Vector<T2, Sz>& rhs) { \
typedef XprBinOp < \
Fcnl_##NAME<T1, T2>, \
VectorConstReference<T1, Sz>, \
VectorConstReference<T2, Sz> \
VectorConstRef<T1, Sz>, \
VectorConstRef<T2, Sz> \
> expr_type; \
return XprVector<expr_type, Sz>( \
expr_type(lhs.const_ref(), rhs.const_ref())); \
expr_type(lhs.constRef(), rhs.constRef())); \
} \
\
template<class E, class T, int Sz> \
@ -322,7 +322,7 @@ XprVector< \
XprBinOp< \
Fcnl_##NAME<typename E::value_type, T>, \
XprVector<E, Sz>, \
VectorConstReference<T, Sz> \
VectorConstRef<T, Sz> \
>, \
Sz \
> \
@ -330,10 +330,10 @@ NAME (const XprVector<E, Sz>& lhs, const Vector<T, Sz>& rhs) { \
typedef XprBinOp< \
Fcnl_##NAME<typename E::value_type, T>, \
XprVector<E, Sz>, \
VectorConstReference<T, Sz> \
VectorConstRef<T, Sz> \
> expr_type; \
return XprVector<expr_type, Sz>( \
expr_type(lhs, rhs.const_ref())); \
expr_type(lhs, rhs.constRef())); \
} \
\
template<class E, class T, int Sz> \
@ -341,7 +341,7 @@ inline \
XprVector< \
XprBinOp< \
Fcnl_##NAME<T, typename E::value_type>, \
VectorConstReference<T, Sz>, \
VectorConstRef<T, Sz>, \
XprVector<E, Sz> \
>, \
Sz \
@ -349,11 +349,11 @@ XprVector< \
NAME (const Vector<T, Sz>& lhs, const XprVector<E, Sz>& rhs) { \
typedef XprBinOp< \
Fcnl_##NAME<T, typename E::value_type>, \
VectorConstReference<T, Sz>, \
VectorConstRef<T, Sz>, \
XprVector<E, Sz> \
> expr_type; \
return XprVector<expr_type, Sz>( \
expr_type(lhs.const_ref(), rhs)); \
expr_type(lhs.constRef(), rhs)); \
}
TVMET_IMPLEMENT_MACRO(add) // per se element wise
@ -377,7 +377,7 @@ inline \
XprVector< \
XprBinOp< \
Fcnl_##NAME< T, POD >, \
VectorConstReference<T, Sz>, \
VectorConstRef<T, Sz>, \
XprLiteral< POD > \
>, \
Sz \
@ -385,11 +385,11 @@ XprVector< \
NAME (const Vector<T, Sz>& lhs, POD rhs) { \
typedef XprBinOp< \
Fcnl_##NAME<T, POD >, \
VectorConstReference<T, Sz>, \
VectorConstRef<T, Sz>, \
XprLiteral< POD > \
> expr_type; \
return XprVector<expr_type, Sz>( \
expr_type(lhs.const_ref(), XprLiteral< POD >(rhs))); \
expr_type(lhs.constRef(), XprLiteral< POD >(rhs))); \
} \
\
template<class T, int Sz> \
@ -398,7 +398,7 @@ XprVector< \
XprBinOp< \
Fcnl_##NAME< POD, T>, \
XprLiteral< POD >, \
VectorConstReference<T, Sz> \
VectorConstRef<T, Sz> \
>, \
Sz \
> \
@ -406,10 +406,10 @@ NAME (POD lhs, const Vector<T, Sz>& rhs) { \
typedef XprBinOp< \
Fcnl_##NAME< POD, T>, \
XprLiteral< POD >, \
VectorConstReference<T, Sz> \
VectorConstRef<T, Sz> \
> expr_type; \
return XprVector<expr_type, Sz>( \
expr_type(XprLiteral< POD >(lhs), rhs.const_ref())); \
expr_type(XprLiteral< POD >(lhs), rhs.constRef())); \
}
TVMET_IMPLEMENT_MACRO(add, int)
@ -443,7 +443,7 @@ inline \
XprVector< \
XprBinOp< \
Fcnl_##NAME< std::complex<T>, std::complex<T> >, \
VectorConstReference< std::complex<T>, Sz>, \
VectorConstRef< std::complex<T>, Sz>, \
XprLiteral< std::complex<T> > \
>, \
Sz \
@ -451,11 +451,11 @@ XprVector< \
NAME (const Vector<std::complex<T>, Sz>& lhs, const std::complex<T>& rhs) { \
typedef XprBinOp< \
Fcnl_##NAME< std::complex<T>, std::complex<T> >, \
VectorConstReference< std::complex<T>, Sz>, \
VectorConstRef< std::complex<T>, Sz>, \
XprLiteral< std::complex<T> > \
> expr_type; \
return XprVector<expr_type, Sz>( \
expr_type(lhs.const_ref(), XprLiteral< std::complex<T> >(rhs))); \
expr_type(lhs.constRef(), XprLiteral< std::complex<T> >(rhs))); \
} \
\
template<class T, int Sz> \
@ -464,7 +464,7 @@ XprVector< \
XprBinOp< \
Fcnl_##NAME< std::complex<T>, std::complex<T> >, \
XprLiteral< std::complex<T> >, \
VectorConstReference< std::complex<T>, Sz> \
VectorConstRef< std::complex<T>, Sz> \
>, \
Sz \
> \
@ -472,10 +472,10 @@ NAME (const std::complex<T>& lhs, const Vector< std::complex<T>, Sz>& rhs) { \
typedef XprBinOp< \
Fcnl_##NAME< std::complex<T>, std::complex<T> >, \
XprLiteral< std::complex<T> >, \
VectorConstReference< std::complex<T>, Sz> \
VectorConstRef< std::complex<T>, Sz> \
> expr_type; \
return XprVector<expr_type, Sz>( \
expr_type(XprLiteral< std::complex<T> >(lhs), rhs.const_ref())); \
expr_type(XprLiteral< std::complex<T> >(lhs), rhs.constRef())); \
}
TVMET_IMPLEMENT_MACRO(add)
@ -623,7 +623,7 @@ inline
XprVector<
XprBinOp<
Fcnl_div<T, T>,
VectorConstReference<T, Sz>,
VectorConstRef<T, Sz>,
XprLiteral< T >
>,
Sz
@ -631,11 +631,11 @@ XprVector<
normalize(const Vector<T, Sz>& v) {
typedef XprBinOp<
Fcnl_div<T, T>,
VectorConstReference<T, Sz>,
VectorConstRef<T, Sz>,
XprLiteral< T >
> expr_type;
return XprVector<expr_type, Sz>(
expr_type(v.const_ref(), XprLiteral< T >(norm2(v))));
expr_type(v.constRef(), XprLiteral< T >(norm2(v))));
}
@ -678,7 +678,7 @@ maximum(const XprVector<E, Sz>& e) {
template<class T, int Sz>
inline
Extremum<T, int, vector_tag>
maximum(const Vector<T, Sz>& v) { return maximum(v.as_expr()); }
maximum(const Vector<T, Sz>& v) { return maximum(v.expr()); }
/**
@ -715,7 +715,7 @@ minimum(const XprVector<E, Sz>& e) {
template<class T, int Sz>
inline
Extremum<T, int, vector_tag>
minimum(const Vector<T, Sz>& v) { return minimum(v.as_expr()); }
minimum(const Vector<T, Sz>& v) { return minimum(v.expr()); }
/**
@ -835,11 +835,11 @@ T min(const Vector<T, Sz>& v) {
template<class T, int Sz>
inline
XprVector<
VectorConstReference<T, Sz>,
VectorConstRef<T, Sz>,
Sz
>
cvector_ref(const T* mem) {
typedef VectorConstReference<T, Sz> expr_type;
typedef VectorConstRef<T, Sz> expr_type;
return XprVector<expr_type, Sz>(expr_type(mem));
};

View File

@ -27,17 +27,14 @@
#include <iomanip> // setw
#include <tvmet/Functional.h>
#include <tvmet/Io.h>
namespace tvmet {
/*
* member operators for i/o
*/
template<class T, int Sz>
std::ostream& Vector<T, Sz>::print_xpr(std::ostream& os, int l) const
template<class T, int Size>
std::ostream& Vector<T, Size>::print_xpr(std::ostream& os, int l) const
{
os << IndentLevel(l++) << "Vector[" << ops << "]<"
<< typeid(T).name() << ", " << Size << ">,"
@ -48,21 +45,14 @@ std::ostream& Vector<T, Sz>::print_xpr(std::ostream& os, int l) const
}
template<class T, int Sz>
std::ostream& Vector<T, Sz>::print_on(std::ostream& os) const
template<class T, int Size>
std::ostream& Vector<T, Size>::print_on(std::ostream& os) const
{
std::streamsize w;
if(Traits<value_type>::isComplex())
w = IoPrintHelper<Vector>::width(dispatch<true>(), *this);
else
w = IoPrintHelper<Vector>::width(dispatch<false>(), *this);
os << std::setw(0) << "[\n ";
os << "[\n ";
for(int i = 0; i < (Size - 1); ++i) {
os << std::setw(w) << m_data[i] << ", ";
os << m_array[i] << ", ";
}
os << std::setw(w) << m_data[Size - 1] << "\n]";
os << m_array[Size - 1] << "\n]";
return os;
}
@ -71,9 +61,9 @@ std::ostream& Vector<T, Sz>::print_on(std::ostream& os) const
* member operators with scalars, per se element wise
*/
#define TVMET_IMPLEMENT_MACRO(NAME, OP) \
template<class T, int Sz> \
template<class T, int Size> \
inline \
Vector<T, Sz>& Vector<T, Sz>::operator OP (value_type rhs) { \
Vector<T, Size>& Vector<T, Size>::operator OP (value_type rhs) { \
typedef XprLiteral<value_type> expr_type; \
this->M_##NAME(XprVector<expr_type, Size>(expr_type(rhs))); \
return *this; \
@ -86,33 +76,15 @@ TVMET_IMPLEMENT_MACRO(div_eq, /=)
#undef TVMET_IMPLEMENT_MACRO
#define TVMET_IMPLEMENT_MACRO(NAME, OP) \
template<class T, int Sz> \
inline \
Vector<T, Sz>& Vector<T, Sz>::operator OP (int rhs) { \
typedef XprLiteral<value_type> expr_type; \
this->M_##NAME(XprVector<expr_type, Size>(expr_type(rhs))); \
return *this; \
}
TVMET_IMPLEMENT_MACRO(mod_eq, %=)
TVMET_IMPLEMENT_MACRO(xor_eq,^=)
TVMET_IMPLEMENT_MACRO(and_eq, &=)
TVMET_IMPLEMENT_MACRO(or_eq, |=)
TVMET_IMPLEMENT_MACRO(shl_eq, <<=)
TVMET_IMPLEMENT_MACRO(shr_eq, >>=)
#undef TVMET_IMPLEMENT_MACRO
/*
* member functions (operators) with vectors, for use with +=,-= ... <<=
*/
#define TVMET_IMPLEMENT_MACRO(NAME) \
template<class T1, int Sz> \
template<class T1, int Size> \
template <class T2> \
inline Vector<T1, Sz>& \
Vector<T1, Sz>::M_##NAME (const Vector<T2, Size>& rhs) { \
this->M_##NAME( XprVector<typename Vector<T2, Size>::ConstReference, Size>(rhs.const_ref()) ); \
inline Vector<T1, Size>& \
Vector<T1, Size>::M_##NAME (const Vector<T2, Size>& rhs) { \
this->M_##NAME( XprVector<typename Vector<T2, Size>::ConstRef, Size>(rhs.constRef()) ); \
return *this; \
}
@ -120,24 +92,18 @@ TVMET_IMPLEMENT_MACRO(add_eq)
TVMET_IMPLEMENT_MACRO(sub_eq)
TVMET_IMPLEMENT_MACRO(mul_eq)
TVMET_IMPLEMENT_MACRO(div_eq)
TVMET_IMPLEMENT_MACRO(mod_eq)
TVMET_IMPLEMENT_MACRO(xor_eq)
TVMET_IMPLEMENT_MACRO(and_eq)
TVMET_IMPLEMENT_MACRO(or_eq)
TVMET_IMPLEMENT_MACRO(shl_eq)
TVMET_IMPLEMENT_MACRO(shr_eq)
#undef TVMET_IMPLEMENT_MACRO
/*
* member functions (operators) with expressions, for use width +=,-= ... <<=
* member functions (operators) with expressions, for use with +=,-= ... <<=
*/
#define TVMET_IMPLEMENT_MACRO(NAME) \
template<class T, int Sz> \
template<class T, int Size> \
template <class E> \
inline \
Vector<T, Sz>& \
Vector<T, Sz>::M_##NAME (const XprVector<E, Size>& rhs) { \
Vector<T, Size>& \
Vector<T, Size>::M_##NAME (const XprVector<E, Size>& rhs) { \
rhs.assign_to(*this, Fcnl_##NAME<value_type, typename E::value_type>()); \
return *this; \
}
@ -146,12 +112,6 @@ TVMET_IMPLEMENT_MACRO(add_eq)
TVMET_IMPLEMENT_MACRO(sub_eq)
TVMET_IMPLEMENT_MACRO(mul_eq)
TVMET_IMPLEMENT_MACRO(div_eq)
TVMET_IMPLEMENT_MACRO(mod_eq)
TVMET_IMPLEMENT_MACRO(xor_eq)
TVMET_IMPLEMENT_MACRO(and_eq)
TVMET_IMPLEMENT_MACRO(or_eq)
TVMET_IMPLEMENT_MACRO(shl_eq)
TVMET_IMPLEMENT_MACRO(shr_eq)
#undef TVMET_IMPLEMENT_MACRO
@ -160,12 +120,12 @@ TVMET_IMPLEMENT_MACRO(shr_eq)
* for use with +=,-= ... <<=
*/
#define TVMET_IMPLEMENT_MACRO(NAME) \
template<class T1, int Sz> \
template<class T1, int Size> \
template <class T2> \
inline \
Vector<T1, Sz>& \
Vector<T1, Sz>::alias_##NAME (const Vector<T2, Size>& rhs) { \
this->alias_##NAME( XprVector<typename Vector<T2, Size>::ConstReference, Size>(rhs.const_ref()) ); \
Vector<T1, Size>& \
Vector<T1, Size>::alias_##NAME (const Vector<T2, Size>& rhs) { \
this->alias_##NAME( XprVector<typename Vector<T2, Size>::ConstRef, Size>(rhs.constRef()) ); \
return *this; \
}
@ -179,15 +139,15 @@ TVMET_IMPLEMENT_MACRO(div_eq)
/*
* aliased member functions (operators) with expressions,
* for use width +=,-= ... <<=
* for use with +=,-= ... <<=
*/
#define TVMET_IMPLEMENT_MACRO(NAME) \
template<class T, int Sz> \
template<class T, int Size> \
template <class E> \
inline \
Vector<T, Sz>& \
Vector<T, Sz>::alias_##NAME (const XprVector<E, Size>& rhs) { \
typedef Vector<T, Sz> temp_type; \
Vector<T, Size>& \
Vector<T, Size>::alias_##NAME (const XprVector<E, Size>& rhs) { \
typedef Vector<T, Size> temp_type; \
temp_type(rhs).assign_to(*this, Fcnl_##NAME<value_type, typename E::value_type>()); \
return *this; \
}

View File

@ -85,8 +85,8 @@ template<class T1, class T2, int Sz> \
XprVector< \
XprBinOp< \
Fcnl_##NAME<T1, T2>, \
VectorConstReference<T1, Sz>, \
VectorConstReference<T2, Sz> \
VectorConstRef<T1, Sz>, \
VectorConstRef<T2, Sz> \
>, \
Sz \
> \
@ -98,7 +98,7 @@ XprVector< \
XprBinOp< \
Fcnl_##NAME<typename E::value_type, T>, \
XprVector<E, Sz>, \
VectorConstReference<T, Sz> \
VectorConstRef<T, Sz> \
>, \
Sz \
> \
@ -109,7 +109,7 @@ template<class E, class T, int Sz> \
XprVector< \
XprBinOp< \
Fcnl_##NAME<T, typename E::value_type>, \
VectorConstReference<T, Sz>, \
VectorConstRef<T, Sz>, \
XprVector<E, Sz> \
>, \
Sz \
@ -137,7 +137,7 @@ template<class T, int Sz> \
XprVector< \
XprBinOp< \
Fcnl_##NAME< T, POD >, \
VectorConstReference<T, Sz>, \
VectorConstRef<T, Sz>, \
XprLiteral< POD > \
>, \
Sz \
@ -150,7 +150,7 @@ XprVector< \
XprBinOp< \
Fcnl_##NAME< POD, T>, \
XprLiteral< POD >, \
VectorConstReference<T, Sz> \
VectorConstRef<T, Sz> \
>, \
Sz \
> \
@ -187,7 +187,7 @@ template<class T, int Sz> \
XprVector< \
XprBinOp< \
Fcnl_##NAME< std::complex<T>, std::complex<T> >, \
VectorConstReference< std::complex<T>, Sz>, \
VectorConstRef< std::complex<T>, Sz>, \
XprLiteral< std::complex<T> > \
>, \
Sz \
@ -200,7 +200,7 @@ XprVector< \
XprBinOp< \
Fcnl_##NAME< std::complex<T>, std::complex<T> >, \
XprLiteral< std::complex<T> >, \
VectorConstReference< std::complex<T>, Sz> \
VectorConstRef< std::complex<T>, Sz> \
>, \
Sz \
> \
@ -231,7 +231,7 @@ template <class T, int Sz> \
XprVector< \
XprUnOp< \
Fcnl_##NAME<T>, \
VectorConstReference<T, Sz> \
VectorConstRef<T, Sz> \
>, \
Sz \
> \
@ -308,8 +308,8 @@ inline \
XprVector< \
XprBinOp< \
Fcnl_##NAME<T1, T2>, \
VectorConstReference<T1, Sz>, \
VectorConstReference<T2, Sz> \
VectorConstRef<T1, Sz>, \
VectorConstRef<T2, Sz> \
>, \
Sz \
> \
@ -323,7 +323,7 @@ XprVector< \
XprBinOp< \
Fcnl_##NAME<typename E::value_type, T>, \
XprVector<E, Sz>, \
VectorConstReference<T, Sz> \
VectorConstRef<T, Sz> \
>, \
Sz \
> \
@ -336,7 +336,7 @@ inline \
XprVector< \
XprBinOp< \
Fcnl_##NAME<T, typename E::value_type>, \
VectorConstReference<T, Sz>, \
VectorConstRef<T, Sz>, \
XprVector<E, Sz> \
>, \
Sz \
@ -366,7 +366,7 @@ inline \
XprVector< \
XprBinOp< \
Fcnl_##NAME< T, POD >, \
VectorConstReference<T, Sz>, \
VectorConstRef<T, Sz>, \
XprLiteral< POD > \
>, \
Sz \
@ -381,7 +381,7 @@ XprVector< \
XprBinOp< \
Fcnl_##NAME< POD, T>, \
XprLiteral< POD >, \
VectorConstReference<T, Sz> \
VectorConstRef<T, Sz> \
>, \
Sz \
> \
@ -420,7 +420,7 @@ inline \
XprVector< \
XprBinOp< \
Fcnl_##NAME< std::complex<T>, std::complex<T> >, \
VectorConstReference< std::complex<T>, Sz>, \
VectorConstRef< std::complex<T>, Sz>, \
XprLiteral< std::complex<T> > \
>, \
Sz \
@ -436,7 +436,7 @@ XprVector< \
XprBinOp< \
Fcnl_##NAME< std::complex<T>, std::complex<T> >, \
XprLiteral< std::complex<T> >, \
VectorConstReference< std::complex<T>, Sz> \
VectorConstRef< std::complex<T>, Sz> \
>, \
Sz \
> \
@ -470,16 +470,16 @@ inline \
XprVector< \
XprUnOp< \
Fcnl_##NAME<T>, \
VectorConstReference<T, Sz> \
VectorConstRef<T, Sz> \
>, \
Sz \
> \
operator OP (const Vector<T, Sz>& rhs) { \
typedef XprUnOp< \
Fcnl_##NAME<T>, \
VectorConstReference<T, Sz> \
VectorConstRef<T, Sz> \
> expr_type; \
return XprVector<expr_type, Sz>(expr_type(rhs.const_ref())); \
return XprVector<expr_type, Sz>(expr_type(rhs.constRef())); \
}
TVMET_IMPLEMENT_MACRO(neg, -)

View File

@ -40,7 +40,7 @@ template<class T, int Sz> \
XprVector< \
XprUnOp< \
Fcnl_##NAME< std::complex<T> >, \
VectorConstReference<std::complex<T>, Sz> \
VectorConstRef<std::complex<T>, Sz> \
>, \
Sz \
> \
@ -70,16 +70,16 @@ inline \
XprVector< \
XprUnOp< \
Fcnl_##NAME< std::complex<T> >, \
VectorConstReference<std::complex<T>, Sz> \
VectorConstRef<std::complex<T>, Sz> \
>, \
Sz \
> \
NAME(const Vector<std::complex<T>, Sz>& rhs) { \
typedef XprUnOp< \
Fcnl_##NAME< std::complex<T> >, \
VectorConstReference<std::complex<T>, Sz> \
VectorConstRef<std::complex<T>, Sz> \
> expr_type; \
return XprVector<expr_type, Sz>(expr_type(rhs.const_ref())); \
return XprVector<expr_type, Sz>(expr_type(rhs.constRef())); \
}
TVMET_IMPLEMENT_MACRO(real)

View File

@ -48,21 +48,13 @@ template <class T, int Rows, int Cols> class Matrix;
* actually implements the expression.
* \note leave the CCtors non-explicit to allow implicit type conversation.
*/
template<class E, int NRows, int NCols>
template<class E, int Rows, int Cols>
class XprMatrix
: public TvmetBase< XprMatrix<E, NRows, NCols> >
: public TvmetBase< XprMatrix<E, Rows, Cols> >
{
XprMatrix();
XprMatrix& operator=(const XprMatrix&);
public:
/** Dimensions. */
enum {
Rows = NRows, /**< Number of rows. */
Cols = NCols, /**< Number of cols. */
Size = Rows * Cols /**< Complete Size of Matrix. */
};
public:
/** Complexity counter. */
enum {

View File

@ -3,14 +3,14 @@ EXTRA_DIST = README t.cc
EXTRA_PROGRAMS = \
swap \
bad_temps \
bad_xpr_const_ref \
bad_xpr_constRef \
tvmet
AM_CXXFLAGS= -I$(top_srcdir)/include -I$(top_builddir)/include
swap_SOURCES = swap.cc
bad_temps_SOURCES = bad_temps.cc
bad_xpr_const_ref_SOURCES = bad_xpr_const_ref.cc
bad_xpr_constRef_SOURCES = bad_xpr_constRef.cc
tvmet_SOURCES = tvmet.cc
tests: $(EXTRA_PROGRAMS)

View File

@ -13,7 +13,7 @@
# PARTICULAR PURPOSE.
@SET_MAKE@
SOURCES = $(bad_temps_SOURCES) $(bad_xpr_const_ref_SOURCES) $(swap_SOURCES) $(tvmet_SOURCES)
SOURCES = $(bad_temps_SOURCES) $(bad_xpr_constRef_SOURCES) $(swap_SOURCES) $(tvmet_SOURCES)
srcdir = @srcdir@
top_srcdir = @top_srcdir@
@ -37,7 +37,7 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
host_triplet = @host@
EXTRA_PROGRAMS = swap$(EXEEXT) bad_temps$(EXEEXT) \
bad_xpr_const_ref$(EXEEXT) tvmet$(EXEEXT)
bad_xpr_constRef$(EXEEXT) tvmet$(EXEEXT)
subdir = tests
DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@ -63,9 +63,9 @@ CONFIG_CLEAN_FILES =
am_bad_temps_OBJECTS = bad_temps.$(OBJEXT)
bad_temps_OBJECTS = $(am_bad_temps_OBJECTS)
bad_temps_LDADD = $(LDADD)
am_bad_xpr_const_ref_OBJECTS = bad_xpr_const_ref.$(OBJEXT)
bad_xpr_const_ref_OBJECTS = $(am_bad_xpr_const_ref_OBJECTS)
bad_xpr_const_ref_LDADD = $(LDADD)
am_bad_xpr_constRef_OBJECTS = bad_xpr_constRef.$(OBJEXT)
bad_xpr_constRef_OBJECTS = $(am_bad_xpr_constRef_OBJECTS)
bad_xpr_constRef_LDADD = $(LDADD)
am_swap_OBJECTS = swap.$(OBJEXT)
swap_OBJECTS = $(am_swap_OBJECTS)
swap_LDADD = $(LDADD)
@ -76,7 +76,7 @@ DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/config
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
am__depfiles_maybe = depfiles
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/bad_temps.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/bad_xpr_const_ref.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/bad_xpr_constRef.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/swap.Po ./$(DEPDIR)/tvmet.Po
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
@ -86,9 +86,9 @@ LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \
CXXLD = $(CXX)
CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(bad_temps_SOURCES) $(bad_xpr_const_ref_SOURCES) \
SOURCES = $(bad_temps_SOURCES) $(bad_xpr_constRef_SOURCES) \
$(swap_SOURCES) $(tvmet_SOURCES)
DIST_SOURCES = $(bad_temps_SOURCES) $(bad_xpr_const_ref_SOURCES) \
DIST_SOURCES = $(bad_temps_SOURCES) $(bad_xpr_constRef_SOURCES) \
$(swap_SOURCES) $(tvmet_SOURCES)
ETAGS = etags
CTAGS = ctags
@ -208,7 +208,7 @@ EXTRA_DIST = README t.cc
AM_CXXFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include
swap_SOURCES = swap.cc
bad_temps_SOURCES = bad_temps.cc
bad_xpr_const_ref_SOURCES = bad_xpr_const_ref.cc
bad_xpr_constRef_SOURCES = bad_xpr_constRef.cc
tvmet_SOURCES = tvmet.cc
all: all-am
@ -246,9 +246,9 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
bad_temps$(EXEEXT): $(bad_temps_OBJECTS) $(bad_temps_DEPENDENCIES)
@rm -f bad_temps$(EXEEXT)
$(CXXLINK) $(bad_temps_LDFLAGS) $(bad_temps_OBJECTS) $(bad_temps_LDADD) $(LIBS)
bad_xpr_const_ref$(EXEEXT): $(bad_xpr_const_ref_OBJECTS) $(bad_xpr_const_ref_DEPENDENCIES)
@rm -f bad_xpr_const_ref$(EXEEXT)
$(CXXLINK) $(bad_xpr_const_ref_LDFLAGS) $(bad_xpr_const_ref_OBJECTS) $(bad_xpr_const_ref_LDADD) $(LIBS)
bad_xpr_constRef$(EXEEXT): $(bad_xpr_constRef_OBJECTS) $(bad_xpr_constRef_DEPENDENCIES)
@rm -f bad_xpr_constRef$(EXEEXT)
$(CXXLINK) $(bad_xpr_constRef_LDFLAGS) $(bad_xpr_constRef_OBJECTS) $(bad_xpr_constRef_LDADD) $(LIBS)
swap$(EXEEXT): $(swap_OBJECTS) $(swap_DEPENDENCIES)
@rm -f swap$(EXEEXT)
$(CXXLINK) $(swap_LDFLAGS) $(swap_OBJECTS) $(swap_LDADD) $(LIBS)
@ -263,7 +263,7 @@ distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bad_temps.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bad_xpr_const_ref.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bad_xpr_constRef.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swap.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tvmet.Po@am__quote@

View File

@ -127,9 +127,9 @@ private:
template<unsigned Rows, unsigned Cols,
unsigned RowStride, unsigned ColStride>
struct MatrixConstReference
struct MatrixConstRef
{
explicit MatrixConstReference(const Matrix<Rows, Cols>& rhs) : m_data(rhs.m_data) { }
explicit MatrixConstRef(const Matrix<Rows, Cols>& rhs) : m_data(rhs.m_data) { }
double operator()(unsigned i, unsigned j) const {
return m_data[i * RowStride + j * ColStride];
@ -157,8 +157,8 @@ struct Matrix
double operator()(unsigned i, unsigned j) const { return m_data[i * Cols + j]; }
MatrixConstReference<Rows,Cols,Cols,1> const_ref() const {
return MatrixConstReference<Rows,Cols,Cols,1>(*this);
MatrixConstRef<Rows,Cols,Cols,1> constRef() const {
return MatrixConstRef<Rows,Cols,Cols,1>(*this);
}
template <class E> Matrix& operator=(const XprMatrix<E, Rows, Cols>& rhs) {
@ -205,15 +205,15 @@ template<unsigned Rows, unsigned Cols>
inline
XprMatrix<
XprMatrixTranspose<
MatrixConstReference<Rows, Cols, Cols, 1>
MatrixConstRef<Rows, Cols, Cols, 1>
>,
Cols, Rows
>
trans(const Matrix<Rows, Cols>& rhs) {
typedef XprMatrixTranspose<
MatrixConstReference<Rows, Cols, Cols, 1>
MatrixConstRef<Rows, Cols, Cols, 1>
> expr_type;
return XprMatrix<expr_type, Cols, Rows>(expr_type(rhs.const_ref()));
return XprMatrix<expr_type, Cols, Rows>(expr_type(rhs.constRef()));
}

View File

@ -1,5 +1,5 @@
/*
* $Id: bad_xpr_const_ref.cc,v 1.1 2003/10/21 19:40:38 opetzold Exp $
* $Id: bad_xpr_constRef.cc,v 1.1 2003/10/21 19:40:38 opetzold Exp $
*
* This example shows the problem on holding references
* by expressions. On higher optimization levels all things
@ -64,9 +64,9 @@ struct XprVector
template<unsigned Sz, unsigned Stride=1>
struct VectorConstReference
struct VectorConstRef
{
explicit VectorConstReference(const Vector<Sz>& rhs) : m_data(rhs.m_data) { }
explicit VectorConstRef(const Vector<Sz>& rhs) : m_data(rhs.m_data) { }
double operator()(unsigned i) const {
return m_data[i * Stride];
@ -85,9 +85,9 @@ struct Vector
double operator()(unsigned i) const { return m_data[i]; }
typedef VectorConstReference<Sz, 1> ConstReference;
typedef VectorConstRef<Sz, 1> ConstRef;
ConstReference const_ref() const { return ConstReference(*this); }
ConstRef constRef() const { return ConstRef(*this); }
template<class Fcnl>
void assign_to(Vector& v, const Fcnl& fn) {
@ -125,19 +125,19 @@ inline
XprVector<
XprBinOp<
Fcnl_Add,
VectorConstReference<Sz>,
VectorConstReference<Sz>
VectorConstRef<Sz>,
VectorConstRef<Sz>
>,
Sz
>
add (const Vector<Sz>& lhs, const Vector<Sz>& rhs) {
typedef XprBinOp <
Fcnl_Add,
VectorConstReference<Sz>,
VectorConstReference<Sz>
VectorConstRef<Sz>,
VectorConstRef<Sz>
> expr_type;
return XprVector<expr_type, Sz>(
expr_type(lhs.const_ref(), rhs.const_ref()));
expr_type(lhs.constRef(), rhs.constRef()));
}

View File

@ -146,9 +146,9 @@ private:
template<unsigned Rows, unsigned Cols,
unsigned RowStride, unsigned ColStride>
struct MatrixConstReference
struct MatrixConstRef
{
explicit MatrixConstReference(const Matrix<Rows, Cols>& rhs) : m_data(rhs.m_data) { }
explicit MatrixConstRef(const Matrix<Rows, Cols>& rhs) : m_data(rhs.m_data) { }
double operator()(unsigned i, unsigned j) const {
return m_data[i * RowStride + j * ColStride];
@ -176,8 +176,8 @@ struct Matrix
double operator()(unsigned i, unsigned j) const { return m_data[i * Cols + j]; }
MatrixConstReference<Rows,Cols,Cols,1> const_ref() const {
return MatrixConstReference<Rows,Cols,Cols,1>(*this);
MatrixConstRef<Rows,Cols,Cols,1> constRef() const {
return MatrixConstRef<Rows,Cols,Cols,1>(*this);
}
Matrix& operator=(const Matrix<Rows, Cols>& rhs) {
@ -220,8 +220,8 @@ template<unsigned Rows1, unsigned Cols1,
inline
XprMatrix<
XprMMProduct<
MatrixConstReference<Rows1, Cols1, Cols1, 1>,
MatrixConstReference<Cols1, Cols2, Cols2, 1>,
MatrixConstRef<Rows1, Cols1, Cols1, 1>,
MatrixConstRef<Cols1, Cols2, Cols2, 1>,
Rows1, Cols1, // M1(Rows1, Cols1)
Cols2, // M2(Cols1, Cols2)
Cols1, 1, // Stride M1
@ -231,15 +231,15 @@ XprMatrix<
>
prod(const Matrix<Rows1, Cols1>& lhs, const Matrix<Cols1, Cols2>& rhs) {
typedef XprMMProduct<
MatrixConstReference<Rows1, Cols1, Cols1, 1>,
MatrixConstReference<Cols1, Cols2, Cols2, 1>,
MatrixConstRef<Rows1, Cols1, Cols1, 1>,
MatrixConstRef<Cols1, Cols2, Cols2, 1>,
Rows1, Cols1,
Cols2,
Cols1, 1,
Cols2, 1
> expr_type;
return XprMatrix<expr_type, Rows1, Cols2>(
expr_type(lhs.const_ref(), rhs.const_ref()));
expr_type(lhs.constRef(), rhs.constRef()));
}
template<class E1, unsigned Rows1, unsigned Cols1, unsigned Cols2>
@ -247,7 +247,7 @@ inline
XprMatrix<
XprMMProduct<
XprMatrix<E1, Rows1, Cols1>,
MatrixConstReference<Cols1, Cols2, Cols2, 1>,
MatrixConstRef<Cols1, Cols2, Cols2, 1>,
Rows1, Cols1, Cols2,
Cols1, 1, Cols2, 1
>,
@ -256,11 +256,11 @@ XprMatrix<
prod(const XprMatrix<E1, Rows1, Cols1>& lhs, const Matrix<Cols1, Cols2>& rhs) {
typedef XprMMProduct<
XprMatrix<E1, Rows1, Cols1>,
MatrixConstReference<Cols1, Cols2, Cols2, 1>,
MatrixConstRef<Cols1, Cols2, Cols2, 1>,
Rows1, Cols1, Cols2,
Cols1, 1, Cols2, 1
> expr_type;
return XprMatrix<expr_type, Rows1, Cols2>(expr_type(lhs, rhs.const_ref()));
return XprMatrix<expr_type, Rows1, Cols2>(expr_type(lhs, rhs.constRef()));
}
@ -268,15 +268,15 @@ template<unsigned Rows, unsigned Cols>
inline
XprMatrix<
XprMatrixTranspose<
MatrixConstReference<Rows, Cols, Cols, 1>
MatrixConstRef<Rows, Cols, Cols, 1>
>,
Cols, Rows
>
trans(const Matrix<Rows, Cols>& rhs) {
typedef XprMatrixTranspose<
MatrixConstReference<Rows, Cols, Cols, 1>
MatrixConstRef<Rows, Cols, Cols, 1>
> expr_type;
return XprMatrix<expr_type, Cols, Rows>(expr_type(rhs.const_ref()));
return XprMatrix<expr_type, Cols, Rows>(expr_type(rhs.constRef()));
}

View File

@ -10,10 +10,9 @@ INCLUDE_DIRECTORIES( ${QT_INCLUDE_DIR} )
SET(testsuite_SOURCES
main.cpp
selftest.cpp
testcommainitializer.cpp
testtraits.cpp
# TestTraits.h TestTraits.cc
# TestTraitsComplex.h TestTraitsComplex.cc
testconstructors.cpp
# TestConstruction.h TestConstruction.cc
# TestComplexMatrix.h TestComplexMatrix.cc
# TestComplexVector.h TestComplexVector.cc

View File

@ -1,34 +0,0 @@
/*
* 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: TestComplexMatrix.cc,v 1.1 2004/04/24 11:55:15 opetzold Exp $
*/
#include <iostream>
#include <TestComplexMatrix.h>
#include <cppunit/extensions/HelperMacros.h>
/****************************************************************************
* instance
****************************************************************************/
CPPUNIT_TEST_SUITE_REGISTRATION( TestComplexMatrix<double> );

View File

@ -1,136 +0,0 @@
/*
* 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: TestComplexMatrix.h,v 1.1 2004/04/24 11:55:15 opetzold Exp $
*/
#ifndef TEST_COMPLEX_MATRIX_H
#define TEST_COMPLEX_MATRIX_H
#include <limits>
#include <algorithm>
#include <complex>
#include <cppunit/extensions/HelperMacros.h>
#include <tvmet/Matrix.h>
#include <tvmet/util/General.h>
#include <tvmet/util/Incrementor.h>
template <class T>
class TestComplexMatrix : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE( TestComplexMatrix );
CPPUNIT_TEST( RealImag );
CPPUNIT_TEST( Abs );
CPPUNIT_TEST_SUITE_END();
private:
typedef T value_type;
typedef std::complex<T> complex_type;
typedef tvmet::Matrix<complex_type, 3, 3> complex_matrix;
typedef tvmet::Matrix<value_type, 3, 3> real_matrix;
public:
TestComplexMatrix()
{ }
public: // cppunit interface
/** cppunit hook for fixture set up. */
void setUp();
/** cppunit hook for fixture tear down. */
void tearDown();
protected:
void RealImag();
void Abs();
private:
complex_matrix m1;
private:
real_matrix m1_real;
};
/*****************************************************************************
* Implementation Part I (cppunit part)
****************************************************************************/
template <class T>
void TestComplexMatrix<T>::setUp() {
// real part is equal to complex part, ranging from 0 to N=Rows*Cols
std::generate(m1.begin(), m1.end(),
tvmet::util::Incrementor<typename complex_matrix::value_type>());
std::generate(m1_real.begin(), m1_real.end(),
tvmet::util::Incrementor<typename real_matrix::value_type>());
}
template <class T>
void TestComplexMatrix<T>::tearDown() { }
/*****************************************************************************
* Implementation Part II
****************************************************************************/
/*
* real and imaginary parts, real and imag parts are equal
*/
template <class T>
void
TestComplexMatrix<T>::RealImag() {
real_matrix r;
r = real(m1);
CPPUNIT_ASSERT( all_elements( r == m1_real ) );
r = imag(m1);
CPPUNIT_ASSERT( all_elements( r == m1_real ) );
}
/*
* abs
*/
template <class T>
void
TestComplexMatrix<T>::Abs() {
real_matrix m, r;
m = abs(m1);
r = sqrt(pow(real(m1), 2) + pow(imag(m1), 2));
// we do have a precision problem
// CPPUNIT_ASSERT( all_elements( m == r ) );
real_matrix eps(m - r);
CPPUNIT_ASSERT( all_elements( abs(eps) < std::numeric_limits<T>::epsilon() ) );
//std::cout << eps << std::endl;
}
#endif // TEST_COMPLEX_MATRIX_H
// Local Variables:
// mode:C++
// End:

View File

@ -1,34 +0,0 @@
/*
* 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: TestComplexVector.cc,v 1.1 2004/04/24 11:55:15 opetzold Exp $
*/
#include <iostream>
#include <TestComplexVector.h>
#include <cppunit/extensions/HelperMacros.h>
/****************************************************************************
* instance
****************************************************************************/
CPPUNIT_TEST_SUITE_REGISTRATION( TestComplexVector<double> );

View File

@ -1,136 +0,0 @@
/*
* 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: TestComplexVector.h,v 1.1 2004/04/24 11:55:15 opetzold Exp $
*/
#ifndef TEST_COMPLEX_MATRIX_H
#define TEST_COMPLEX_MATRIX_H
#include <limits>
#include <algorithm>
#include <complex>
#include <cppunit/extensions/HelperMacros.h>
#include <tvmet/Vector.h>
#include <tvmet/util/General.h>
#include <tvmet/util/Incrementor.h>
template <class T>
class TestComplexVector : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE( TestComplexVector );
CPPUNIT_TEST( RealImag );
CPPUNIT_TEST( Abs );
CPPUNIT_TEST_SUITE_END();
private:
typedef T value_type;
typedef std::complex<T> complex_type;
typedef tvmet::Vector<complex_type, 3> complex_vector;
typedef tvmet::Vector<value_type, 3> real_vector;
public:
TestComplexVector()
{ }
public: // cppunit interface
/** cppunit hook for fixture set up. */
void setUp();
/** cppunit hook for fixture tear down. */
void tearDown();
protected:
void RealImag();
void Abs();
private:
complex_vector v1;
private:
real_vector v1_real;
};
/*****************************************************************************
* Implementation Part I (cppunit part)
****************************************************************************/
template <class T>
void TestComplexVector<T>::setUp() {
// real part is equal to complex part, ranging from 0 to N=Sz
std::generate(v1.begin(), v1.end(),
tvmet::util::Incrementor<typename complex_vector::value_type>());
std::generate(v1_real.begin(), v1_real.end(),
tvmet::util::Incrementor<typename real_vector::value_type>());
}
template <class T>
void TestComplexVector<T>::tearDown() { }
/*****************************************************************************
* Implementation Part II
****************************************************************************/
/*
* real and imaginary parts, real and imag parts are equal
*/
template <class T>
void
TestComplexVector<T>::RealImag() {
real_vector r;
r = real(v1);
CPPUNIT_ASSERT( all_elements( r == v1_real ) );
r = imag(v1);
CPPUNIT_ASSERT( all_elements( r == v1_real ) );
}
/*
* abs
*/
template <class T>
void
TestComplexVector<T>::Abs() {
real_vector v, r;
v = abs(v1);
r = sqrt(pow(real(v1), 2) + pow(imag(v1), 2));
// we do have a precision problem
// CPPUNIT_ASSERT( all_elements( v == r ) );
real_vector eps(v - r);
CPPUNIT_ASSERT( all_elements( abs(eps) < std::numeric_limits<T>::epsilon() ) );
//std::cout << eps << std::endl;
}
#endif // TEST_COMPLEX_VECTOR_H
// Local Variables:
// mode:C++
// End:

View File

@ -1,40 +0,0 @@
/*
* 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: TestConstruction.cc,v 1.1 2004/04/24 11:55:15 opetzold Exp $
*/
#include <iostream>
#include <complex>
#include <TestConstruction.h>
#include <cppunit/extensions/HelperMacros.h>
/****************************************************************************
* instance
****************************************************************************/
CPPUNIT_TEST_SUITE_REGISTRATION( TestConstruction<double> );
CPPUNIT_TEST_SUITE_REGISTRATION( TestConstruction<int> );
#if defined(EIGEN_USE_COMPLEX)
CPPUNIT_TEST_SUITE_REGISTRATION( TestConstruction< std::complex<double> > );
#endif

View File

@ -1,40 +0,0 @@
/*
* 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: TestDimension.cc,v 1.1 2004/04/24 11:55:15 opetzold Exp $
*/
#include <iostream>
#include <complex>
#include <TestDimension.h>
#include <cppunit/extensions/HelperMacros.h>
/****************************************************************************
* instance
****************************************************************************/
CPPUNIT_TEST_SUITE_REGISTRATION( TestDimension<double> );
CPPUNIT_TEST_SUITE_REGISTRATION( TestDimension<int> );
#if defined(EIGEN_USE_COMPLEX)
CPPUNIT_TEST_SUITE_REGISTRATION( TestDimension< std::complex<double> > );
#endif

View File

@ -1,36 +0,0 @@
/*
* 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: TestMathOps.cc,v 1.1 2004/04/24 11:55:15 opetzold Exp $
*/
#include <iostream>
#include <complex>
#include <TestMathOps.h>
#include <cppunit/extensions/HelperMacros.h>
/****************************************************************************
* instance
****************************************************************************/
CPPUNIT_TEST_SUITE_REGISTRATION( TestMathOps<double> );
CPPUNIT_TEST_SUITE_REGISTRATION( TestMathOps<int> );

View File

@ -1,36 +0,0 @@
/*
* 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: TestMatrixElementwise.cc,v 1.1 2005/03/09 11:06:21 opetzold Exp $
*/
#include <iostream>
#include <complex>
#include <TestMatrixElementwise.h>
#include <cppunit/extensions/HelperMacros.h>
/****************************************************************************
* instance
****************************************************************************/
CPPUNIT_TEST_SUITE_REGISTRATION( TestMatrixElementwise<double> );
CPPUNIT_TEST_SUITE_REGISTRATION( TestMatrixElementwise<int> );

View File

@ -1,35 +0,0 @@
/*
* 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: TestMatrixEval.cc,v 1.1 2004/04/24 11:55:15 opetzold Exp $
*/
#include <iostream>
#include <TestMatrixEval.h>
#include <cppunit/extensions/HelperMacros.h>
/****************************************************************************
* instance
****************************************************************************/
CPPUNIT_TEST_SUITE_REGISTRATION( TestMatrixEval<double> );
CPPUNIT_TEST_SUITE_REGISTRATION( TestMatrixEval<int> );

View File

@ -1,35 +0,0 @@
/*
* 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: TestMatrixFunctions.cc,v 1.1 2004/04/24 11:55:15 opetzold Exp $
*/
#include <iostream>
#include <TestMatrixFunctions.h>
#include <cppunit/extensions/HelperMacros.h>
/****************************************************************************
* instance
****************************************************************************/
CPPUNIT_TEST_SUITE_REGISTRATION( TestMatrixFunctions<double> );
CPPUNIT_TEST_SUITE_REGISTRATION( TestMatrixFunctions<int> );

View File

@ -1,35 +0,0 @@
/*
* 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: TestMatrixOperators.cc,v 1.1 2004/04/24 11:55:15 opetzold Exp $
*/
#include <iostream>
#include <TestMatrixOperators.h>
#include <cppunit/extensions/HelperMacros.h>
/****************************************************************************
* instance
****************************************************************************/
CPPUNIT_TEST_SUITE_REGISTRATION( TestMatrixOperators<double> );
CPPUNIT_TEST_SUITE_REGISTRATION( TestMatrixOperators<int> );

View File

@ -1,35 +0,0 @@
/*
* 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: TestSTL.cc,v 1.1 2004/04/24 11:55:15 opetzold Exp $
*/
#include <iostream>
#include <TestSTL.h>
#include <cppunit/extensions/HelperMacros.h>
/****************************************************************************
* instance
****************************************************************************/
CPPUNIT_TEST_SUITE_REGISTRATION( TestSTL<double> );
CPPUNIT_TEST_SUITE_REGISTRATION( TestSTL<int> );

View File

@ -1,67 +0,0 @@
/*
* 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: TestUnFunc.cc,v 1.1 2004/04/24 11:55:15 opetzold Exp $
*/
#include <iostream>
#include <TestUnFunc.h>
#include <cppunit/extensions/HelperMacros.h>
/*****************************************************************************
* Implementation Part I (cppunit integer part)
****************************************************************************/
/*
* Is specialized for int, therefore it's like a normal class definition
* and can placed into a cc file.
*/
TestUnFunc<int>::TestUnFunc()
: vZero(0), vOne(1), vMinusOne(-1), vTwo(2)
, mZero(0), mOne(1), mMinusOne(-1), mTwo(2)
{ }
void TestUnFunc<int>::setUp() { }
void TestUnFunc<int>::tearDown() { }
/*****************************************************************************
* Implementation Part II (integer part)
****************************************************************************/
void TestUnFunc<int>::fn_abs() {
vector_type v;
matrix_type m;
// abs
v = abs(vMinusOne);
m = abs(mMinusOne);
CPPUNIT_ASSERT( all_elements(v == vOne) );
CPPUNIT_ASSERT( all_elements(m == mOne) );
}
/****************************************************************************
* instance
****************************************************************************/
CPPUNIT_TEST_SUITE_REGISTRATION( TestUnFunc<double> );
CPPUNIT_TEST_SUITE_REGISTRATION( TestUnFunc<int> );

View File

@ -1,36 +0,0 @@
/*
* 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: TestUnloops.cc,v 1.1 2004/04/24 11:55:15 opetzold Exp $
*/
#include <iostream>
#include <complex>
#include <TestUnloops.h>
#include <cppunit/extensions/HelperMacros.h>
/****************************************************************************
* instance
****************************************************************************/
CPPUNIT_TEST_SUITE_REGISTRATION( TestUnloops<double> );
CPPUNIT_TEST_SUITE_REGISTRATION( TestUnloops<int> );

View File

@ -1,36 +0,0 @@
/*
* 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: TestVectorEval.cc,v 1.1 2004/04/24 11:55:15 opetzold Exp $
*/
#include <iostream>
#include <complex>
#include <TestVectorEval.h>
#include <cppunit/extensions/HelperMacros.h>
/****************************************************************************
* instance
****************************************************************************/
CPPUNIT_TEST_SUITE_REGISTRATION( TestVectorEval<double> );
CPPUNIT_TEST_SUITE_REGISTRATION( TestVectorEval<int> );

View File

@ -1,35 +0,0 @@
/*
* 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: TestVectorFunctions.cc,v 1.1 2004/04/24 11:55:15 opetzold Exp $
*/
#include <iostream>
#include <TestVectorFunctions.h>
#include <cppunit/extensions/HelperMacros.h>
/****************************************************************************
* instance
****************************************************************************/
CPPUNIT_TEST_SUITE_REGISTRATION( TestVectorFunctions<double> );
CPPUNIT_TEST_SUITE_REGISTRATION( TestVectorFunctions<int> );

View File

@ -1,35 +0,0 @@
/*
* 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: TestVectorOperators.cc,v 1.1 2004/04/24 11:55:15 opetzold Exp $
*/
#include <iostream>
#include <TestVectorOperators.h>
#include <cppunit/extensions/HelperMacros.h>
/****************************************************************************
* instance
****************************************************************************/
CPPUNIT_TEST_SUITE_REGISTRATION( TestVectorOperators<double> );
CPPUNIT_TEST_SUITE_REGISTRATION( TestVectorOperators<int> );

View File

@ -1,35 +0,0 @@
/*
* 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: TestXpr.cc,v 1.1 2004/04/24 11:55:15 opetzold Exp $
*/
#include <iostream>
#include <TestXpr.h>
#include <cppunit/extensions/HelperMacros.h>
/****************************************************************************
* instance
****************************************************************************/
CPPUNIT_TEST_SUITE_REGISTRATION( TestXpr<double> );
CPPUNIT_TEST_SUITE_REGISTRATION( TestXpr<int> );

View File

@ -1,35 +0,0 @@
/*
* 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: TestXprMatrixFunctions.cc,v 1.1 2004/04/24 11:55:15 opetzold Exp $
*/
#include <iostream>
#include <TestXprMatrixFunctions.h>
#include <cppunit/extensions/HelperMacros.h>
/****************************************************************************
* instance
****************************************************************************/
CPPUNIT_TEST_SUITE_REGISTRATION( TestXprMatrixFunctions<double> );
CPPUNIT_TEST_SUITE_REGISTRATION( TestXprMatrixFunctions<int> );

View File

@ -1,35 +0,0 @@
/*
* 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: TestXprMatrixOperators.cc,v 1.1 2004/04/24 11:55:15 opetzold Exp $
*/
#include <iostream>
#include <TestXprMatrixOperators.h>
#include <cppunit/extensions/HelperMacros.h>
/****************************************************************************
* instance
****************************************************************************/
CPPUNIT_TEST_SUITE_REGISTRATION( TestXprMatrixOperators<double> );
CPPUNIT_TEST_SUITE_REGISTRATION( TestXprMatrixOperators<int> );

View File

@ -1,35 +0,0 @@
/*
* 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: TestXprVectorFunctions.cc,v 1.1 2004/04/24 11:55:15 opetzold Exp $
*/
#include <iostream>
#include <TestXprVectorFunctions.h>
#include <cppunit/extensions/HelperMacros.h>
/****************************************************************************
* instance
****************************************************************************/
CPPUNIT_TEST_SUITE_REGISTRATION( TestXprVectorFunctions<double> );
CPPUNIT_TEST_SUITE_REGISTRATION( TestXprVectorFunctions<int> );

View File

@ -1,35 +0,0 @@
/*
* 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: TestXprVectorOperators.cc,v 1.1 2004/04/24 11:55:15 opetzold Exp $
*/
#include <iostream>
#include <TestXprVectorOperators.h>
#include <cppunit/extensions/HelperMacros.h>
/****************************************************************************
* instance
****************************************************************************/
CPPUNIT_TEST_SUITE_REGISTRATION( TestXprVectorOperators<double> );
CPPUNIT_TEST_SUITE_REGISTRATION( TestXprVectorOperators<int> );

View File

@ -45,8 +45,9 @@ class TvmetTestSuite : public QObject
TvmetTestSuite() {};
private slots:
void selfTest();
void testCommaInitializer();
void testTraits();
void testConstructors();
};
#endif // EIGEN_TESTSUITE_MAIN_H

View File

@ -23,27 +23,7 @@
#include "main.h"
template<typename T, int n> static void basics1()
{
const Vector<T, n> vZero(0);
const Vector<T, n> vOne(1);
const Matrix<T, n, n> mZero(0);
const Matrix<T, n, n> mOne(1);
for(int i = 0; i < n; i++) {
QVERIFY(vZero(i) == T(0));
QVERIFY(vOne(i) == T(1));
}
for(int i = 0; i < n; i++) {
for(int j = 0; j < n; j++) {
QVERIFY(mZero(i,j) == T(0));
QVERIFY(mOne(i,j) == T(1));
}
}
}
template<typename T> static void basics2()
template<typename T> static void TestCommaInitializer()
{
// test the CommaInitializer
Vector<T, 3> v1;
@ -60,17 +40,10 @@ template<typename T> static void basics2()
m1(2,0) == T(3) && m1(2,1) == T(6) && m1(2,2) == T(9));
}
void TvmetTestSuite::selfTest()
void TvmetTestSuite::testCommaInitializer()
{
basics1<int, 1> ();
basics1<int, 3> ();
basics1<float, 4> ();
basics1<double, 4> ();
basics2<int> ();
basics2<double> ();
basics1<complex<float>, 4> ();
basics1<complex<double>, 4> ();
basics2<complex<int> > ();
basics2<complex<double> > ();
TestCommaInitializer<int> ();
TestCommaInitializer<double> ();
TestCommaInitializer<complex<int> > ();
TestCommaInitializer<complex<double> > ();
}

View File

@ -1,67 +0,0 @@
.TH tvmet 1 "August 2002"
.SH NAME
tvmet-config - script to get information about the installed version of tvmet
.SH SYNOPSIS
.B tvmet-config
[\-\-prefix\fI[=DIR]\fP] [\-\-exec\-prefix\fI[=DIR]\fP] [\-\-version] [\-\-libs] [\-\-cxxflags]
.SH DESCRIPTION
.PP
\fItvmet-config\fP is a tool that is used to configure to determine
the compiler and linker flags that should be used to compile and link
programs that use \fItvmet\fP. It is also used internally to the .m4
macros for GNU autoconf that are included with \fItvmet\fP.
.
.SH OPTIONS
.l
\fItvmet-config\fP accepts the following options:
.TP 8
.B \-\-version
Print the currently installed version of \fItvmet\fP on the standard
output.
.TP 8
.B \-\-libs
Print the linker flags that are necessary to link a \fItvmet\fP
program.
.TP 8
.B \-\-cxxflags
Print the compiler flags that are necessary to compile a \fItvmet\fP
program.
.TP 8
.B \-\-prefix
Print the prefix with which \fItvmet\fP was compiled.
.TP 8
.B \-\-prefix=PREFIX
If specified, use PREFIX instead of the installation prefix that
\fItvmet\fP was built with when computing the output for the
\-\-cflags and \-\-libs options. This option is also used for the exec
prefix if \-\-exec\-prefix was not specified. This option must be
specified before any \-\-libs or \-\-cflags options.
.TP 8
.B \-\-exec\-prefix
Print the exec\-prefix with which \fItvmet\fP was compiled.
.TP 8
.B \-\-exec\-prefix=PREFIX
If specified, use PREFIX instead of the installation exec prefix that
\fItvmet\fP was built with when computing the output for the
\-\-cflags and \-\-libs options. This option must be specified before
any \-\-libs or \-\-cflags options.
.SH COPYRIGHT
tvmet Copyright \(co 2001, 2001 by Olaf Petzold <opetzold@users.sourceforge.net>
.PP
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.
.PP
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.
.PP
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
.SH AUTHOR
This manpage is an almost word-for-word copy of the gtk-config
manpage, written by Owen Taylor. It was modified by Olaf Petzold
<opetzold@users.regiocom.net>

View File

@ -1,104 +0,0 @@
#!/bin/sh
# $Id: tvmet-config.in,v 1.2 2003/05/24 08:19:42 opetzold Exp $
prefix=@prefix@
exec_prefix=@exec_prefix@
exec_prefix_set=no
includedir=@includedir@
usage()
{
cat <<EOF
Usage: tvmet-config [OPTION] ...
Generic options
--version output tvmet version information.
--help display this help and exit.
Compilation support options
--cxxflags print pre-processor and compiler flags
--includes print include path
--libs print library linking information
Install directories tvmet was configured to
--prefix[=DIR]
--exec-prefix[=DIR]
EOF
exit $1
}
if test $# -eq 0; then
usage 1 1>&2
fi
while test $# -gt 0; do
case "$1" in
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac
case $1 in
--prefix=*)
prefix=$optarg
if test $exec_prefix_set = no ; then
exec_prefix=$optarg
fi
;;
--prefix)
echo_prefix=yes
;;
--exec-prefix=*)
exec_prefix=$optarg
exec_prefix_set=yes
;;
--exec-prefix)
echo_exec_prefix=yes
;;
--version)
echo @VERSION@
;;
--help)
usage 0
;;
--cxxflags)
echo_cxxflags=yes
;;
--includes)
echo_includes=yes
;;
--libs)
echo_libs=yes
;;
*)
usage 1 1>&2
;;
esac
shift
done
if test "$echo_prefix" = "yes"; then
echo $prefix
fi
if test "$echo_exec_prefix" = "yes"; then
echo $exec_prefix
fi
if test "$echo_includes" = "yes"; then
if test "$includedir" != "/usr/include" ; then
echo -I$includedir
fi
fi
if test "$echo_cxxflags" = "yes"; then
echo @CXXFLAGS@
fi
if test "$echo_libs" = "yes"; then
if test @libdir@ != /usr/lib ; then
echo "-L@libdir@"
fi
fi
exit 0

View File

@ -1,79 +0,0 @@
dnl $Id: tvmet.m4,v 1.3 2004/04/23 21:03:29 opetzold Exp $
dnl
dnl AM_PATH_TVMET([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl
AC_DEFUN([AM_PATH_TVMET],
[
AC_ARG_WITH(tvmet-prefix,[ --with-tvmet-prefix=PFX Prefix where tvmet is installed (optional)],
tvmet_config_prefix="$withval", tvmet_config_prefix="")
AC_ARG_WITH(tvmet-exec-prefix,[ --with-tvmet-exec-prefix=PFX Exec prefix where tvmet is installed (optional)],
tvmet_config_exec_prefix="$withval", tvmet_config_exec_prefix="")
if test x$tvmet_config_exec_prefix != x ; then
tvmet_config_args="$tvmet_config_args --exec-prefix=$tvmet_config_exec_prefix"
if test x${TVMET_CONFIG+set} != xset ; then
TVMET_CONFIG=$tvmet_config_exec_prefix/bin/tvmet-config
fi
fi
if test x$tvmet_config_prefix != x ; then
tvmet_config_args="$tvmet_config_args --prefix=$tvmet_config_prefix"
if test x${TVMET_CONFIG+set} != xset ; then
TVMET_CONFIG=$tvmet_config_prefix/bin/tvmet-config
fi
fi
AC_PATH_PROG(TVMET_CONFIG, tvmet-config, no)
tvmet_version_min=$1
AC_MSG_CHECKING(for tvmet - version >= $tvmet_version_min)
no_tvmet=""
if test "$TVMET_CONFIG" = "no" ; then
no_tvmet=yes
else
TVMET_CXXFLAGS=`$TVMET_CONFIG --cxxflags`
TVMET_LIBS=`$TVMET_CONFIG --libs`
tvmet_version=`$TVMET_CONFIG --version`
tvmet_major_version=`echo $tvmet_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
tvmet_minor_version=`echo $tvmet_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
tvmet_micro_version=`echo $tvmet_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
tvmet_major_min=`echo $tvmet_version_min | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
tvmet_minor_min=`echo $tvmet_version_min | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
tvmet_micro_min=`echo $tvmet_version_min | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
tvmet_version_proper=`expr \
$tvmet_major_version \> $tvmet_major_min \| \
$tvmet_major_version \= $tvmet_major_min \& \
$tvmet_minor_version \> $tvmet_minor_min \| \
$tvmet_major_version \= $tvmet_major_min \& \
$tvmet_minor_version \= $tvmet_minor_min \& \
$tvmet_micro_version \>= $tvmet_micro_min `
if test "$tvmet_version_proper" = "1" ; then
AC_MSG_RESULT([$tvmet_major_version.$tvmet_minor_version.$tvmet_micro_version])
else
AC_MSG_RESULT(no)
no_tvmet=yes
fi
fi
if test "x$no_tvmet" = x ; then
ifelse([$2], , :, [$2])
else
TVMET_CXXFLAGS=""
TVMET_LIBS=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(TVMET_CXXFLAGS)
AC_SUBST(TVMET_LIBS)
])

View File

@ -1,49 +0,0 @@
%define RELEASE 1
%define rel %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE}
%define lib_name tvmet
Name: tvmet
Version: 1.7.1
Release: %rel
Summary: Tiny Vector Matrix library using Expression Templates
Copyright: LGPL
Group: Development/Libraries
Vendor: The TVMET Project
Packager: Olaf Petzold
Url: http://tvmet.sourceforge.net/
Source: ftp://download.sourceforge.net/pub/sourceforge/tvmet/%name-%version.tar.gz
Prefix: %_prefix
BuildRoot: %_tmppath/%name-%version-root
%description
Tiny Template Matrix Library is an expression template matrix and vector
library for fast calculations in C++. This make it fast for small (tiny)
linear algebraic systems.
%prep
rm -rf $RPM_BUILD_ROOT
%setup
./configure --prefix=%{prefix} --enable-docs --enable-optimize
%build
make
%install
rm -rf $RPM_BUILD_ROOT
make prefix=$RPM_BUILD_ROOT%{prefix} install
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,755)
%doc AUTHORS COPYING LICENSE INSTALL NEWS README THANKS ChangeLog doc/html/*
%attr(755,root,root) %prefix/bin/tvmet-config
%prefix/include/tvmet/*
%prefix/man/*
%prefix/share/aclocal/

View File

@ -1,49 +0,0 @@
%define RELEASE 1
%define rel %{?CUSTOM_RELEASE} %{!?CUSTOM_RELEASE:%RELEASE}
%define lib_name tvmet
Name: @PACKAGE@
Version: @VERSION@
Release: %rel
Summary: Tiny Vector Matrix library using Expression Templates
Copyright: LGPL
Group: Development/Libraries
Vendor: The TVMET Project
Packager: Olaf Petzold
Url: http://tvmet.sourceforge.net/
Source: ftp://download.sourceforge.net/pub/sourceforge/tvmet/%name-%version.tar.gz
Prefix: %_prefix
BuildRoot: %_tmppath/%name-%version-root
%description
Tiny Template Matrix Library is an expression template matrix and vector
library for fast calculations in C++. This make it fast for small (tiny)
linear algebraic systems.
%prep
rm -rf $RPM_BUILD_ROOT
%setup
./configure --prefix=%{prefix} --enable-docs --enable-optimize
%build
make
%install
rm -rf $RPM_BUILD_ROOT
make prefix=$RPM_BUILD_ROOT%{prefix} install
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,755)
%doc AUTHORS COPYING LICENSE INSTALL NEWS README THANKS ChangeLog doc/html/*
%attr(755,root,root) %prefix/bin/tvmet-config
%prefix/include/tvmet/*
%prefix/man/*
%prefix/share/aclocal/