mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
restart Eigen2 development from scratch.
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
project(Eigen)
|
||||
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
|
||||
|
||||
OPTION(BUILD_TESTS "Build tests" OFF)
|
||||
OPTION(BUILD_EXAMPLES "Build examples" OFF)
|
||||
|
||||
@@ -16,4 +14,3 @@ endif (CMAKE_COMPILER_IS_GNUCXX)
|
||||
|
||||
include_directories( ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} )
|
||||
|
||||
add_subdirectory(tvmet-1.7.1)
|
||||
|
||||
47
TODO
47
TODO
@@ -1,47 +0,0 @@
|
||||
Eigen 2 business plan, aka TODO.
|
||||
|
||||
This is the work branch for Eigen2, eventually to supersede to Eigen 1 in
|
||||
/trunk/kdesupport/eigen.
|
||||
|
||||
Eigen2 starts as a fork of the orphaned code of Tvmet.
|
||||
|
||||
- Phase A: cleanup and reorganize Tvmet code.
|
||||
-- port from autotools to CMake (IN PROGRESS)
|
||||
-- Remove unneeded/obsolete configure checks (IN PROGRESS)
|
||||
-- Remove other unneeded defines and #ifdefs, like TVMET_DYNAMIC_MEMORY
|
||||
(we want to use fixed-size only at this stage).
|
||||
-- Make sure the test-suite compiles and succeeds.
|
||||
-- add a meta-header including all headers (requested by Andre)
|
||||
|
||||
- Phase B: Complete the fixed-size part of Eigen 2.
|
||||
-- Add to the Vector and Matrix classes all the useful methods from
|
||||
Eigen 1. Also implement the other useful features from Eigen 1, like
|
||||
projective geometry, linear regression, quaternions.
|
||||
Make sure all that works nicely with the expression templates.
|
||||
-- review the API for consistency, naming scheme etc.
|
||||
-- Make sure all the optimizations of Eigen 1 survive in Eigen 2. For
|
||||
instance, in Eigen 1 we hand-unroll most of the nested loops that GCC 4.1
|
||||
fails to unroll. This is most useful and we need to make sure that Eigen 2
|
||||
does it too.
|
||||
-- Extend the test-suite to cover everything.
|
||||
-- Rename consistently Tvmet to Eigen while giving credit (keep copyright
|
||||
lines, mention Tvmet in documentation, README, website, etc.)
|
||||
|
||||
- Phase C: Do the dynamic-size part of Eigen 2 (as a GMM++ wrapper).
|
||||
-- Import a SVN snapshot of GMM++ (there have been useful changes since the
|
||||
last stable release 2.0.2).
|
||||
-- Write the wrapping classes using the expression template mechanisms from
|
||||
Tvmet.
|
||||
-- Evaluate adding some methods/functions from Eigen 1, like those for linear
|
||||
regression.
|
||||
-- Review the whole API (fixed-size and dynamic-size) for consistency and
|
||||
add bridges between the fixed-size and dynamic-size classes: constructors,
|
||||
conversion operators, etc.
|
||||
-- In a perfect world we would be able to do dynamic-size matrices with
|
||||
fixed-size-matrix entries.
|
||||
-- give credit to GMM in the documentation, README, website, etc.
|
||||
|
||||
- Phase D: ??????
|
||||
|
||||
- Phase E: $$$ Profit!!! $$$
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
# This module checks if the C++ compiler supports
|
||||
# __attribute__((always_inline)).
|
||||
#
|
||||
# If yes, _RESULT is set to __attribute__((always_inline)).
|
||||
# If no, _RESULT is set to empty value.
|
||||
#
|
||||
# Copyright Benoit Jacob 2007 <jacob@math.jussieu.fr>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file in
|
||||
# kdelibs/cmake/modules.
|
||||
|
||||
INCLUDE(CheckCXXSourceCompiles)
|
||||
|
||||
MACRO (CHECK_ALWAYS_INLINE _RESULT)
|
||||
|
||||
SET(_CHECK_attribute_always_inline_SRC "
|
||||
|
||||
#ifdef __GNUC__
|
||||
# define ALL_IS_WELL
|
||||
#endif
|
||||
|
||||
#ifdef __INTEL_COMPILER
|
||||
# if (__INTEL_COMPILER == 800) || (__INTEL_COMPILER > 800)
|
||||
# define ALL_IS_WELL
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef ALL_IS_WELL
|
||||
# error I guess your compiler doesn't support __attribute__((always_inline))
|
||||
#endif
|
||||
|
||||
int main(int argc, char *argv[]) { return 0; }
|
||||
")
|
||||
|
||||
CHECK_CXX_SOURCE_COMPILES("${_CHECK_attribute_always_inline_SRC}"
|
||||
HAVE_attribute_always_inline)
|
||||
IF(HAVE_attribute_always_inline)
|
||||
SET(${_RESULT} "__attribute__((always_inline))")
|
||||
ELSE(HAVE_attribute_always_inline)
|
||||
SET(${_RESULT} ) # attribute always_inline unsupported
|
||||
ENDIF(HAVE_attribute_always_inline)
|
||||
|
||||
ENDMACRO (CHECK_ALWAYS_INLINE)
|
||||
@@ -1,87 +0,0 @@
|
||||
# This module checks if the C++ compiler supports the restrict keyword or
|
||||
# some variant of it. The following variants are checked for in that order:
|
||||
# 1. restrict (The standard C99 keyword, not yet in C++ standard)
|
||||
# 2. __restrict (G++ has it)
|
||||
# 3. __restrict__ (G++ has it too)
|
||||
# 4. _Restrict (seems to be used by Sun's compiler)
|
||||
# These four cases seem to cover all existing variants; however some C++
|
||||
# compilers don't support any variant, in which case the _RESULT variable is
|
||||
# set to empty value.
|
||||
#
|
||||
# Copyright Benoit Jacob 2007 <jacob@math.jussieu.fr>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file in
|
||||
# kdelibs/cmake/modules.
|
||||
|
||||
INCLUDE(CheckCXXSourceCompiles)
|
||||
|
||||
MACRO (CHECK_RESTRICT_KEYWORD _RESULT)
|
||||
|
||||
SET(_CHECK_restrict_KEYWORD_SRC "
|
||||
|
||||
char f( const char * restrict x )
|
||||
{
|
||||
return *x;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) { return 0; }
|
||||
")
|
||||
|
||||
SET(_CHECK___restrict_KEYWORD_SRC "
|
||||
|
||||
char f( const char * __restrict x )
|
||||
{
|
||||
return *x;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) { return 0; }
|
||||
")
|
||||
|
||||
SET(_CHECK___restrict___KEYWORD_SRC "
|
||||
|
||||
char f( const char * __restrict__ x )
|
||||
{
|
||||
return *x;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) { return 0; }
|
||||
")
|
||||
|
||||
SET(_CHECK__Restrict_KEYWORD_SRC "
|
||||
|
||||
char f( const char * _Restrict x )
|
||||
{
|
||||
return *x;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) { return 0; }
|
||||
")
|
||||
|
||||
CHECK_CXX_SOURCE_COMPILES("${_CHECK_restrict_KEYWORD_SRC}"
|
||||
HAVE_KEYWORD_restrict)
|
||||
IF(HAVE_KEYWORD_restrict)
|
||||
SET(${_RESULT} restrict)
|
||||
ELSE(HAVE_KEYWORD_restrict)
|
||||
CHECK_CXX_SOURCE_COMPILES("${_CHECK___restrict_KEYWORD_SRC}"
|
||||
HAVE_KEYWORD___restrict)
|
||||
IF(HAVE_KEYWORD___restrict)
|
||||
SET(${_RESULT} __restrict)
|
||||
ELSE(HAVE_KEYWORD___restrict)
|
||||
CHECK_CXX_SOURCE_COMPILES("${_CHECK___restrict___KEYWORD_SRC}"
|
||||
HAVE_KEYWORD___restrict__)
|
||||
IF(HAVE_KEYWORD___restrict__)
|
||||
SET(${_RESULT} __restrict__)
|
||||
ELSE(HAVE_KEYWORD___restrict__)
|
||||
CHECK_CXX_SOURCE_COMPILES("${_CHECK__Restrict_KEYWORD_SRC}"
|
||||
HAVE_KEYWORD__Restrict)
|
||||
IF(HAVE_KEYWORD__Restrict)
|
||||
SET(${_RESULT} _Restrict)
|
||||
ELSE(HAVE_KEYWORD__Restrict)
|
||||
SET(${_RESULT} ) # no variant of restrict keyword supported
|
||||
ENDIF(HAVE_KEYWORD__Restrict)
|
||||
ENDIF(HAVE_KEYWORD___restrict__)
|
||||
ENDIF(HAVE_KEYWORD___restrict)
|
||||
ENDIF(HAVE_KEYWORD_restrict)
|
||||
|
||||
ENDMACRO (CHECK_RESTRICT_KEYWORD)
|
||||
@@ -1 +0,0 @@
|
||||
Olaf Petzold <opetzold@users.sourceforge.net>
|
||||
@@ -1,2 +0,0 @@
|
||||
ADD_SUBDIRECTORY(include)
|
||||
ADD_SUBDIRECTORY(testsuite)
|
||||
@@ -1,504 +0,0 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
|
||||
@@ -1,229 +0,0 @@
|
||||
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This file is free documentation; the Free Software Foundation gives
|
||||
unlimited permission to copy, distribute and modify it.
|
||||
|
||||
Basic Installation
|
||||
==================
|
||||
|
||||
These are generic installation instructions.
|
||||
|
||||
The `configure' shell script attempts to guess correct values for
|
||||
various system-dependent variables used during compilation. It uses
|
||||
those values to create a `Makefile' in each directory of the package.
|
||||
It may also create one or more `.h' files containing system-dependent
|
||||
definitions. Finally, it creates a shell script `config.status' that
|
||||
you can run in the future to recreate the current configuration, and a
|
||||
file `config.log' containing compiler output (useful mainly for
|
||||
debugging `configure').
|
||||
|
||||
It can also use an optional file (typically called `config.cache'
|
||||
and enabled with `--cache-file=config.cache' or simply `-C') that saves
|
||||
the results of its tests to speed up reconfiguring. (Caching is
|
||||
disabled by default to prevent problems with accidental use of stale
|
||||
cache files.)
|
||||
|
||||
If you need to do unusual things to compile the package, please try
|
||||
to figure out how `configure' could check whether to do them, and mail
|
||||
diffs or instructions to the address given in the `README' so they can
|
||||
be considered for the next release. If you are using the cache, and at
|
||||
some point `config.cache' contains results you don't want to keep, you
|
||||
may remove or edit it.
|
||||
|
||||
The file `configure.ac' (or `configure.in') is used to create
|
||||
`configure' by a program called `autoconf'. You only need
|
||||
`configure.ac' if you want to change it or regenerate `configure' using
|
||||
a newer version of `autoconf'.
|
||||
|
||||
The simplest way to compile this package is:
|
||||
|
||||
1. `cd' to the directory containing the package's source code and type
|
||||
`./configure' to configure the package for your system. If you're
|
||||
using `csh' on an old version of System V, you might need to type
|
||||
`sh ./configure' instead to prevent `csh' from trying to execute
|
||||
`configure' itself.
|
||||
|
||||
Running `configure' takes awhile. While running, it prints some
|
||||
messages telling which features it is checking for.
|
||||
|
||||
2. Type `make' to compile the package.
|
||||
|
||||
3. Optionally, type `make check' to run any self-tests that come with
|
||||
the package.
|
||||
|
||||
4. Type `make install' to install the programs and any data files and
|
||||
documentation.
|
||||
|
||||
5. You can remove the program binaries and object files from the
|
||||
source code directory by typing `make clean'. To also remove the
|
||||
files that `configure' created (so you can compile the package for
|
||||
a different kind of computer), type `make distclean'. There is
|
||||
also a `make maintainer-clean' target, but that is intended mainly
|
||||
for the package's developers. If you use it, you may have to get
|
||||
all sorts of other programs in order to regenerate files that came
|
||||
with the distribution.
|
||||
|
||||
Compilers and Options
|
||||
=====================
|
||||
|
||||
Some systems require unusual options for compilation or linking that
|
||||
the `configure' script does not know about. Run `./configure --help'
|
||||
for details on some of the pertinent environment variables.
|
||||
|
||||
You can give `configure' initial values for configuration parameters
|
||||
by setting variables in the command line or in the environment. Here
|
||||
is an example:
|
||||
|
||||
./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
|
||||
|
||||
*Note Defining Variables::, for more details.
|
||||
|
||||
Compiling For Multiple Architectures
|
||||
====================================
|
||||
|
||||
You can compile the package for more than one kind of computer at the
|
||||
same time, by placing the object files for each architecture in their
|
||||
own directory. To do this, you must use a version of `make' that
|
||||
supports the `VPATH' variable, such as GNU `make'. `cd' to the
|
||||
directory where you want the object files and executables to go and run
|
||||
the `configure' script. `configure' automatically checks for the
|
||||
source code in the directory that `configure' is in and in `..'.
|
||||
|
||||
If you have to use a `make' that does not support the `VPATH'
|
||||
variable, you have to compile the package for one architecture at a
|
||||
time in the source code directory. After you have installed the
|
||||
package for one architecture, use `make distclean' before reconfiguring
|
||||
for another architecture.
|
||||
|
||||
Installation Names
|
||||
==================
|
||||
|
||||
By default, `make install' will install the package's files in
|
||||
`/usr/local/bin', `/usr/local/man', etc. You can specify an
|
||||
installation prefix other than `/usr/local' by giving `configure' the
|
||||
option `--prefix=PATH'.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
give `configure' the option `--exec-prefix=PATH', the package will use
|
||||
PATH as the prefix for installing programs and libraries.
|
||||
Documentation and other data files will still use the regular prefix.
|
||||
|
||||
In addition, if you use an unusual directory layout you can give
|
||||
options like `--bindir=PATH' to specify different values for particular
|
||||
kinds of files. Run `configure --help' for a list of the directories
|
||||
you can set and what kinds of files go in them.
|
||||
|
||||
If the package supports it, you can cause programs to be installed
|
||||
with an extra prefix or suffix on their names by giving `configure' the
|
||||
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||
|
||||
Optional Features
|
||||
=================
|
||||
|
||||
Some packages pay attention to `--enable-FEATURE' options to
|
||||
`configure', where FEATURE indicates an optional part of the package.
|
||||
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||
is something like `gnu-as' or `x' (for the X Window System). The
|
||||
`README' should mention any `--enable-' and `--with-' options that the
|
||||
package recognizes.
|
||||
|
||||
For packages that use the X Window System, `configure' can usually
|
||||
find the X include and library files automatically, but if it doesn't,
|
||||
you can use the `configure' options `--x-includes=DIR' and
|
||||
`--x-libraries=DIR' to specify their locations.
|
||||
|
||||
Specifying the System Type
|
||||
==========================
|
||||
|
||||
There may be some features `configure' cannot figure out
|
||||
automatically, but needs to determine by the type of machine the package
|
||||
will run on. Usually, assuming the package is built to be run on the
|
||||
_same_ architectures, `configure' can figure that out, but if it prints
|
||||
a message saying it cannot guess the machine type, give it the
|
||||
`--build=TYPE' option. TYPE can either be a short name for the system
|
||||
type, such as `sun4', or a canonical name which has the form:
|
||||
|
||||
CPU-COMPANY-SYSTEM
|
||||
|
||||
where SYSTEM can have one of these forms:
|
||||
|
||||
OS KERNEL-OS
|
||||
|
||||
See the file `config.sub' for the possible values of each field. If
|
||||
`config.sub' isn't included in this package, then this package doesn't
|
||||
need to know the machine type.
|
||||
|
||||
If you are _building_ compiler tools for cross-compiling, you should
|
||||
use the `--target=TYPE' option to select the type of system they will
|
||||
produce code for.
|
||||
|
||||
If you want to _use_ a cross compiler, that generates code for a
|
||||
platform different from the build platform, you should specify the
|
||||
"host" platform (i.e., that on which the generated programs will
|
||||
eventually be run) with `--host=TYPE'.
|
||||
|
||||
Sharing Defaults
|
||||
================
|
||||
|
||||
If you want to set default values for `configure' scripts to share,
|
||||
you can create a site shell script called `config.site' that gives
|
||||
default values for variables like `CC', `cache_file', and `prefix'.
|
||||
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||
`CONFIG_SITE' environment variable to the location of the site script.
|
||||
A warning: not all `configure' scripts look for a site script.
|
||||
|
||||
Defining Variables
|
||||
==================
|
||||
|
||||
Variables not defined in a site shell script can be set in the
|
||||
environment passed to `configure'. However, some packages may run
|
||||
configure again during the build, and the customized values of these
|
||||
variables may be lost. In order to avoid this problem, you should set
|
||||
them in the `configure' command line, using `VAR=value'. For example:
|
||||
|
||||
./configure CC=/usr/local2/bin/gcc
|
||||
|
||||
will cause the specified gcc to be used as the C compiler (unless it is
|
||||
overridden in the site shell script).
|
||||
|
||||
`configure' Invocation
|
||||
======================
|
||||
|
||||
`configure' recognizes the following options to control how it
|
||||
operates.
|
||||
|
||||
`--help'
|
||||
`-h'
|
||||
Print a summary of the options to `configure', and exit.
|
||||
|
||||
`--version'
|
||||
`-V'
|
||||
Print the version of Autoconf used to generate the `configure'
|
||||
script, and exit.
|
||||
|
||||
`--cache-file=FILE'
|
||||
Enable the cache: use and save the results of the tests in FILE,
|
||||
traditionally `config.cache'. FILE defaults to `/dev/null' to
|
||||
disable caching.
|
||||
|
||||
`--config-cache'
|
||||
`-C'
|
||||
Alias for `--cache-file=config.cache'.
|
||||
|
||||
`--quiet'
|
||||
`--silent'
|
||||
`-q'
|
||||
Do not print messages saying which checks are being made. To
|
||||
suppress all normal output, redirect it to `/dev/null' (any error
|
||||
messages will still be shown).
|
||||
|
||||
`--srcdir=DIR'
|
||||
Look for the package's source code in directory DIR. Usually
|
||||
`configure' can determine that directory automatically.
|
||||
|
||||
`configure' also accepts some other, not widely useful, options. Run
|
||||
`configure --help' for more details.
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ADDENDUM TO LICENSE
|
||||
Februar 2003
|
||||
|
||||
Copyright (C) 2003 Olaf Petzold
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license addendum document, but changing it is not allowed.
|
||||
|
||||
|
||||
tvmet License Agreement.
|
||||
|
||||
|
||||
0. tvmet ("The Library") is licensed under GNU Lesser General Public License
|
||||
as published by the Free Software Foundation, version 2.1 of the License, or
|
||||
(at your option) any later version, with the following additional conditions.
|
||||
The following conditions take precedence over any conditions or restrictions
|
||||
stipulated by the Lesser General Public License insofar as a conflict exists.
|
||||
|
||||
1. The tvmet License Agreement ("License") covers only tvmet ("The Library").
|
||||
Other libraries which the Library may use are covered by their own respective
|
||||
licenses.
|
||||
|
||||
2. Modification of the configure scripts, makefiles, or installation tools of
|
||||
the Library to support a specific platform does not constitute creating a
|
||||
modified or derivative work based on the Library.
|
||||
|
||||
3. Statically linking of a copy of the Library against any work using the
|
||||
Library, i.e. the inclusion of (parts of) the Library into a program or binary,
|
||||
is functionally equivalent to a work using the Library by linking to it
|
||||
dynamically, and therefore does not constitute creating a modified or derivative
|
||||
work based on the Library.
|
||||
|
||||
4. Otherwise, if the work is a derivative of the Library, you may distribute
|
||||
the object code for the work under the terms of the GNU Lesser General Public
|
||||
License. Any executables containing that work also may be distributed under
|
||||
the Lesser General Public License whether or not they are linked directly with
|
||||
the Library itself.
|
||||
|
||||
5. Programs or binaries linked with the Library must be identified as such by
|
||||
including, in the Documentation or by other means (for example in the About
|
||||
Box or Online Help), the following statement:
|
||||
|
||||
"This software uses tvmet (http://tvmet.sourceforge.net)."
|
||||
|
||||
|
||||
|
||||
|
||||
END OF ADDENDUM
|
||||
190
tvmet-1.7.1/NEWS
190
tvmet-1.7.1/NEWS
@@ -1,190 +0,0 @@
|
||||
* release 1.7.1
|
||||
|
||||
- major and minor bug fix release.
|
||||
- element wise operations on non square matrix expressions.
|
||||
does work as expected now.
|
||||
- tvmet compiles with gcc 3.4.3.
|
||||
- extended docs.
|
||||
- new regression tests.
|
||||
|
||||
* release 1.7.0
|
||||
|
||||
- support for Microsoft VC++ 7.1
|
||||
- several critical bug fixes.
|
||||
- docs enhanced and corrected; new chapter for VC++ 7.1.
|
||||
- conj for signed types disabled, since an unary minus operator
|
||||
applied to unsigned type will result unsigned type.
|
||||
- drem, hypot, jn, yn, cbrt and rint are inside the global namespace
|
||||
now.
|
||||
- some fixes for Makefile on creating pdf documentation.
|
||||
- header depencies limited.
|
||||
|
||||
* release 1.6.0
|
||||
|
||||
- major bug fix: tvmet did crash on zero matrix print (introduced
|
||||
with release 1.5.0, there was only a patch available).
|
||||
- corrected and extended docs.
|
||||
- new regressions added for traits.
|
||||
- some compiler specific optimizations for gcc and icc
|
||||
(compatibility mode) introduced, use it by defined TVMET_OPTIMIZE.
|
||||
This uses the gcc's __attribute__((always_inline)) wrapped by a
|
||||
macro - this allows to produce high optimized and inline code
|
||||
even on lower optimization levels, e.g. -O. This is enabled by
|
||||
configure process by --enable-optimize.
|
||||
- For pgCC 5.1 the TVMET_HAVE_LONG_DOUBLE has been disabled, since
|
||||
the support is incomplete imo. For icc some pragma are used
|
||||
to avoid warnings about 'operands are evaluated in unspecified
|
||||
order' since it concerns ostream printing only.
|
||||
- traits prepared to be an entry point of several functions
|
||||
used in the feature.
|
||||
- new functions c{matrix,vector}_ref to handle C style vectors
|
||||
and arrays as expressions - using inside the tvmet Matrix/Vector
|
||||
expressions as usual.
|
||||
- tvmet's syntax/naming convention more cleaner, code should be
|
||||
more readable now. Further more unused template parameter has
|
||||
been removed.
|
||||
- new function identity<>() to create identity matrices.
|
||||
- some cosmetic changes.
|
||||
|
||||
* release 1.5.0
|
||||
|
||||
- the build process is more compliant to the GNU standard.
|
||||
- alias function extended.
|
||||
- Matrix and Vector data printing improved, gives better output
|
||||
even by negative values/contents.
|
||||
- configure script supports different compiler better; users
|
||||
can specify --enable-optimize, --enable-debug and
|
||||
--enable-warnings for their needs.
|
||||
- the configure and build process has been improved generally;
|
||||
tvmet can be build in a separate build directory and passes
|
||||
the distcheck target successfully.
|
||||
|
||||
* release 1.4.1
|
||||
|
||||
- new function alias to solve the aliasing problem.
|
||||
- major bug fix: forgotten header tvmet/loop/Vector.h added
|
||||
and benchmark shows AtA and AAt graph with matrices
|
||||
less than 10x10 too - the BTL patch is updated.
|
||||
|
||||
* release 1.4.0
|
||||
|
||||
- major and minor bug fixes
|
||||
- Matrix/Vector and XprMatrix/XprVector uses an assign_to()
|
||||
function - this could be a way for pre-evaluate/caching
|
||||
nodes of the sub expressions for further releases.
|
||||
- an alternate way of computing matrix-matrix and matrix-vector
|
||||
products added: using meta templates or loops. Therefore some
|
||||
trigger are introduced which are not tuned yet. Using
|
||||
matrix-matrix products less than Rows*Cols 8*8 or
|
||||
matrix-vector products less than Sz=8 uses meta templates
|
||||
else loops.
|
||||
- regression tests added for loop products, as well as bugs
|
||||
fixed.
|
||||
- enums Rows, Cols and Size for Matrix and Vector are
|
||||
introduced.
|
||||
- expression level printing improved - more info's are shown
|
||||
- output format has been changed, the output is compatible
|
||||
to octave/matlab. To get the type and size info as before
|
||||
a new member function info() has been introduced which can
|
||||
be streamed to ostreams.
|
||||
- improved data printing, aligns output regarding of maximum
|
||||
element.
|
||||
- different members for expression and data printing.
|
||||
- BTL benchmark results added.
|
||||
|
||||
* release 1.3.0
|
||||
|
||||
- major and minor bug fixes - all users should update !
|
||||
- RVO problem/bug removed, chaining/composed expressions are
|
||||
working now. The problem was related on use of temporaries
|
||||
on composed functions, which gone out of scope.
|
||||
- sources compiled without optimizations, by -O0, doesn't crash
|
||||
any more. The Problem was related by holding expressions by
|
||||
references instead by value. At higher optimization levels
|
||||
there were no faults than.
|
||||
- better english documentation (spelling and grammar) as well
|
||||
some corrections and extensions.
|
||||
- benchmark removed from sources.
|
||||
- interface changes.
|
||||
- prodTrans renamed to trans_prod to follow the naming convention
|
||||
- boolean version of eval removed to avoid confusion, comparing
|
||||
is done using all_elements and any_elements.
|
||||
- support for complex<> slightly improved.
|
||||
|
||||
* release 1.2.1
|
||||
|
||||
- major and minor bug fixes.
|
||||
- corrected and extended docs.
|
||||
- tvmet's const correctness improved.
|
||||
|
||||
* release 1.2.0
|
||||
|
||||
- major and minor bug fixes
|
||||
- better gcc 2.95.3 support but, still problems
|
||||
- function naming convention from product to prod, transpose
|
||||
to trans etc. changed.
|
||||
- new functions add,sub,mul and div on element wise functions.
|
||||
- expressions used for row/col and diag vectors on matrices,
|
||||
prevents use of temporaries on expressions for pre-evaluation.
|
||||
- Vector access using braces () is default on internal use,
|
||||
brackets [] are still valid and supported.
|
||||
- better debug support.
|
||||
- regression test improved and more tests added, especially
|
||||
on expressions.
|
||||
- more functions and operators on functions.
|
||||
- better header file layout.
|
||||
|
||||
* release 1.1.0
|
||||
|
||||
- major and minor bug fixes
|
||||
- new meta templated functions for matrix operations for
|
||||
product(transpose(M), M), product(M, transpose(M)) and
|
||||
transpose(product(M,M)), namely MtM_product(), MMt_product
|
||||
as well as productTransposed().
|
||||
- productTranspose(M,V) renamed to Mtx_product(). In this
|
||||
function is a return dimension bug removed (working for non-
|
||||
square matrices too now).
|
||||
- Therefore, old productTransposed() functions doesn't have
|
||||
the old meaning any more!
|
||||
- a matrix expression can be transposed too.
|
||||
- new functions and operators for products of expression of
|
||||
matrices and vectors added - chaining of this should work
|
||||
now.
|
||||
- better support for non-square matrices and non-square
|
||||
matrix-matrix and matrix-vector functions/operations.
|
||||
- regression test improved and more tests added.
|
||||
- file and directory structure extended.
|
||||
|
||||
* release 1.0.1:
|
||||
|
||||
- minor bug fixes
|
||||
|
||||
* release 1.0.0:
|
||||
|
||||
- corrected and improved documents
|
||||
- new product(XprMatrix, Vector) and operator*(XprMatrix, Vector)
|
||||
as well as product(XprMatrix<>, XprVector<>),
|
||||
- more regression tests
|
||||
- better intel compiler support
|
||||
- extended include directory structure
|
||||
|
||||
* release 0.9.0:
|
||||
|
||||
- the benchmark is delayed.
|
||||
- new function product(XprMatrix<>,XprMatrix<>) and operator*
|
||||
(XprMatrix<>,XprMatrix<>), therefore concating of mathematical
|
||||
expressions are better supported now.
|
||||
- Addendum to the LGPL, static linking is explicit allowed.
|
||||
- regression tests for element wise operations added.
|
||||
- docs FAQ enhanced.
|
||||
- new function diag(Matrix<>) added.
|
||||
- autoconf 2.5x ready.
|
||||
- default distribution is tar.bz2 now.
|
||||
- tvmet-doc-xxx.prm target removed, docs are inside the rpm
|
||||
package self.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
%%% Local IspellDict: "english"
|
||||
@@ -1,9 +0,0 @@
|
||||
This tiny vector and matrix template libary uses meta templates and
|
||||
template expressions to evaluate results at compile time - to make
|
||||
it fast for low order systems. Temporaries are kicked off.
|
||||
|
||||
Nevertheless, this isn't a matlab or octave in C++!
|
||||
|
||||
For more informations please have a look into docs/html/ or to the
|
||||
project web page at http://tvmet.sourceforge.net
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
Thanks to:
|
||||
|
||||
- Alexei Sheplyakov reported a bug inside the matrix expressions
|
||||
using elementwise operations and others.
|
||||
|
||||
- Robi Carnecky for his report on success using MS VC 7.1 and
|
||||
reporting missing typename keyword inside CommaInitializer.h
|
||||
and others.
|
||||
|
||||
- Krzysiek Goj found a bug inside the swap functions and
|
||||
reported problems on calling functions in wrong namespace.
|
||||
|
||||
- Claudia Bertram for reporting a bug by printing a zero
|
||||
elements matrix.
|
||||
|
||||
- Julian Cummings for his help on supporting complex types and
|
||||
some other comments on tvmet.
|
||||
|
||||
- Alex V. Frolov found inconsistens on typepromotion used.
|
||||
|
||||
- David J. C. Beach, thanks! He checked the grammar and spelling
|
||||
of tvmet's documents. Further more, he gave me hints for
|
||||
any/all_elements and eval.
|
||||
|
||||
- David Sarrut for correction on the matrix column access bug.
|
||||
|
||||
- Holger Spiess, for his testing on real application (FEM), reporting
|
||||
problems and conversations.
|
||||
|
||||
- Erik Kruus, he found a bug inside tvmet.m4.
|
||||
|
||||
- George Schnurer for his suggestions and help concerning the licensing
|
||||
and the need to an addendum to it.
|
||||
|
||||
- Laurent Plagne, the author of the BTL, for his testing and comparing
|
||||
tvmet against other libs and others.
|
||||
|
||||
- Jörg Walter about using uBlas faster assuming alias free operations.
|
||||
Further more for his great conversation about benchmarking and others,
|
||||
thanks!
|
||||
|
||||
- Jörg Barfurth from de.compl.lang.iso-c++ for his help on instance
|
||||
problems with templates occoured on regressions test.
|
||||
|
||||
- Michael Kochetkov and Tom from comp.lang.c++ for help on namespace
|
||||
problems. Now I know more about Koenig lookup and the problems due
|
||||
too 8)
|
||||
|
||||
- Darin DeForest, he found a nasty bug inside the regression tests.
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,3 +0,0 @@
|
||||
# $Id: Makefile.am,v 1.4 2003/12/04 19:18:09 opetzold Exp $
|
||||
|
||||
EXTRA_DIST = BTL-20030124.patch
|
||||
@@ -1,338 +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.4 2003/12/04 19:18:09 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@
|
||||
subdir = benchmark
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/config/ac_c_long_long.m4 \
|
||||
$(top_srcdir)/config/ac_create_prefix_config_h.m4 \
|
||||
$(top_srcdir)/config/ac_cxx_have_complex.m4 \
|
||||
$(top_srcdir)/config/ac_cxx_have_complex_math1.m4 \
|
||||
$(top_srcdir)/config/ac_cxx_have_complex_math2.m4 \
|
||||
$(top_srcdir)/config/ac_cxx_have_ieee_math.m4 \
|
||||
$(top_srcdir)/config/ac_cxx_have_mutable.m4 \
|
||||
$(top_srcdir)/config/ac_cxx_have_namespaces.m4 \
|
||||
$(top_srcdir)/config/ac_cxx_have_sysv_math.m4 \
|
||||
$(top_srcdir)/config/ac_cxx_partial_specialization.m4 \
|
||||
$(top_srcdir)/config/ac_cxx_typename.m4 \
|
||||
$(top_srcdir)/config/ac_set_compiler.m4 \
|
||||
$(top_srcdir)/config/op_doxygen_doc.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(mkdir_p)
|
||||
CONFIG_HEADER = $(top_builddir)/config/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CONFIG_CPPUNIT_FALSE = @CONFIG_CPPUNIT_FALSE@
|
||||
CONFIG_CPPUNIT_TRUE = @CONFIG_CPPUNIT_TRUE@
|
||||
CONFIG_DOC_FALSE = @CONFIG_DOC_FALSE@
|
||||
CONFIG_DOC_TRUE = @CONFIG_DOC_TRUE@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
|
||||
CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
|
||||
CPPUNIT_LIBS = @CPPUNIT_LIBS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CXX_DEBUG_FLAGS = @CXX_DEBUG_FLAGS@
|
||||
CXX_OPTIMIZE_FLAGS = @CXX_OPTIMIZE_FLAGS@
|
||||
CXX_WARN_FLAGS = @CXX_WARN_FLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DOXYGEN = @DOXYGEN@
|
||||
DOXYGEN_HAVE_DOT = @DOXYGEN_HAVE_DOT@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LATEX_BATCHMODE = @LATEX_BATCHMODE@
|
||||
LATEX_MODE = @LATEX_MODE@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
|
||||
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
datadir = @datadir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
EXTRA_DIST = BTL-20030124.patch
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu benchmark/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu benchmark/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
-rm -f libtool
|
||||
uninstall-info-am:
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
ctags: CTAGS
|
||||
CTAGS:
|
||||
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkdir_p) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic distclean-libtool
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-info-am
|
||||
|
||||
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
|
||||
distclean distclean-generic distclean-libtool distdir dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-data install-data-am install-exec install-exec-am \
|
||||
install-info install-info-am install-man install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
||||
mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
|
||||
uninstall-info-am
|
||||
|
||||
# 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:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,218 +0,0 @@
|
||||
# $Id: Makefile.am,v 1.22 2004/09/16 08:12:13 opetzold Exp $
|
||||
|
||||
AM_CXXFLAGS = -O \
|
||||
-I@top_srcdir@/include -I@top_builddir@/include
|
||||
|
||||
DOXY_DOC = \
|
||||
benchmark.dox \
|
||||
build.dox \
|
||||
compiler.dox \
|
||||
faq.dox \
|
||||
intro.dox \
|
||||
license.dox \
|
||||
links.dox \
|
||||
misc.dox \
|
||||
notes.dox \
|
||||
projects.dox \
|
||||
usage.dox \
|
||||
works.dox
|
||||
|
||||
HTML_MISC = \
|
||||
tvmet.css \
|
||||
header.html footer.html.in
|
||||
|
||||
LTEX_MISC = \
|
||||
tvmet.sty.in
|
||||
|
||||
BENCH_FIG = \
|
||||
axpy.png \
|
||||
matrix_matrix.png \
|
||||
matrix_vector.png \
|
||||
aat.png \
|
||||
ata.png
|
||||
|
||||
EXTRA_DIST = \
|
||||
$(DOXY_DOC) \
|
||||
$(HTML_MISC) \
|
||||
$(LTEX_MISC) \
|
||||
$(BENCH_FIG)
|
||||
|
||||
DISTCLEANFILES = \
|
||||
Doxyfile doxygen-warning \
|
||||
footer.html tvmet.sty
|
||||
|
||||
# some depencies
|
||||
Doxyfile: Doxyfile.in
|
||||
footer.html: footer.html.in
|
||||
tvmet.sty: tvmet.sty.in
|
||||
|
||||
# non-install programs for generating doxygen files
|
||||
noinst_PROGRAMS = dox_operators dox_functions
|
||||
dox_operators_SOURCES = dox_operators.cc Util.h
|
||||
dox_functions_SOURCES = dox_functions.cc Util.h
|
||||
|
||||
#
|
||||
# rules for documentation, if ordered
|
||||
#
|
||||
if CONFIG_DOC
|
||||
|
||||
#
|
||||
# file created on the fly
|
||||
#
|
||||
DOXY_BUILD = \
|
||||
changelog.dox \
|
||||
news.dox \
|
||||
credits.dox \
|
||||
install.dox \
|
||||
operators.dox \
|
||||
functions.dox
|
||||
|
||||
DOXY_HTML_SRC = \
|
||||
$(DOXY_DOC) \
|
||||
$(DOXY_BUILD) \
|
||||
$(patsubst %.in, %, $(HTML_MISC))
|
||||
|
||||
DOXY_LTEX_SRC = \
|
||||
$(patsubst %.in, %, $(LTEX_MISC))
|
||||
|
||||
# file creating rules; not needed every time
|
||||
operators.dox: dox_operators
|
||||
./dox_operators > operators.dox
|
||||
|
||||
functions.dox: dox_functions
|
||||
./dox_functions > functions.dox
|
||||
|
||||
# file creating rules
|
||||
changelog.dox: @top_srcdir@/ChangeLog
|
||||
@echo "/** \page changelog ChangeLog" > $@
|
||||
@echo "\verbatim" >> $@
|
||||
cat $< >> $@
|
||||
@echo "\endverbatim" >> $@
|
||||
@echo "*/" >> $@
|
||||
|
||||
news.dox: @top_srcdir@/NEWS
|
||||
@echo "/** \page news News" > $@
|
||||
@echo "\verbatim" >> $@
|
||||
cat $< >> $@
|
||||
@echo "\endverbatim" >> $@
|
||||
@echo "*/" >> $@
|
||||
|
||||
credits.dox: @top_srcdir@/THANKS
|
||||
@echo "/** \page credits Credits" > $@
|
||||
@echo "\verbatim" >> $@
|
||||
cat $< >> $@
|
||||
@echo "\endverbatim" >> $@
|
||||
@echo "*/" >> $@
|
||||
|
||||
install.dox: @top_srcdir@/INSTALL
|
||||
@echo "/** \page basic_install INSTALL" > $@
|
||||
@echo "\verbatim" >> $@
|
||||
cat $< >> $@
|
||||
@echo "\endverbatim" >> $@
|
||||
@echo "*/" >> $@
|
||||
|
||||
|
||||
#
|
||||
# doxygen API
|
||||
#
|
||||
DOC_API_PDF = $(PACKAGE)-$(VERSION).pdf
|
||||
|
||||
all-local: doxygen-api
|
||||
|
||||
# need's LaTeX style, since we use an own style for LaTeX
|
||||
# which is required for generating formulas in HTML too.
|
||||
# Doxygen LaTeX batchmode doesn't solves the problem right here.
|
||||
doxygen-html-dir:
|
||||
@if test ! -d ./html; then mkdir ./html; fi
|
||||
|
||||
doxygen-api: doxygen-html-dir Doxyfile $(DOXY_HTML_SRC)
|
||||
@echo "Making HTML manual"
|
||||
@cp @builddir@/tvmet.sty ./html/
|
||||
@DOXYGEN@ $(DOXYGEN_OPTS)
|
||||
@$(RM) -f ./html/tvmet.sty
|
||||
|
||||
#
|
||||
# doxygen LaTeX API
|
||||
#
|
||||
TEXINPUTS_PATH=$(TEXINPUTS):$(top_builddir)
|
||||
|
||||
noinst_DATA = $(DOC_API_PDF)
|
||||
|
||||
all-local: $(noinst_DATA)
|
||||
|
||||
dvi-local:
|
||||
ps-local:
|
||||
pdf-local: $(DOC_API_PDF)
|
||||
|
||||
$(DOC_API_PDF): Doxyfile $(DOXY_LTEX_SRC)
|
||||
@if test -d ./latex; then \
|
||||
echo "Making PDF manual"; \
|
||||
if test -f $@; then \
|
||||
$(RM) $@; \
|
||||
fi; \
|
||||
TEXINPUTS=$(TEXINPUTS_PATH) $(MAKE) -C ./latex refman.pdf; \
|
||||
$(LN_S) ./latex/refman.pdf $@; \
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
# misc hooks
|
||||
#
|
||||
distclean-local:
|
||||
@rm -f $(DOXY_BUILD)
|
||||
@if test -f $(DOC_API_PDF); then \
|
||||
$(RM) -f $(DOC_API_PDF); \
|
||||
fi
|
||||
@if test -d html; then \
|
||||
$(RM) -rf html; \
|
||||
fi
|
||||
@if test -d latex; then \
|
||||
$(RM) -rf latex; \
|
||||
fi
|
||||
@if test -d rtf; then \
|
||||
$(RM) -rf rtf; \
|
||||
fi
|
||||
@if test -d man; then \
|
||||
$(RM) -rf man; \
|
||||
fi
|
||||
|
||||
doc-dist: doxygen-api
|
||||
echo "please wait while archiving the html docs."; \
|
||||
tar cf - -C ./html . | bzip2 --best -c > $(PACKAGE)-docs-$(VERSION).tar.bz2
|
||||
|
||||
# where to install all html documents
|
||||
TVMET_DOC_DIR = $(datadir)/doc/$(PACKAGE)-$(VERSION)
|
||||
|
||||
# Automake's "distcheck" is sensitive to having files left over
|
||||
# after "make uninstall", so we have to clean up the install hook.
|
||||
uninstall-local:
|
||||
@if test -d $(TVMET_DOC_DIR); then \
|
||||
rm -rf $(TVMET_DOC_DIR); \
|
||||
fi
|
||||
|
||||
# Install hooks
|
||||
make-install-dirs:
|
||||
@if test '!' -d $(TVMET_DOC_DIR); then \
|
||||
$(mkinstalldirs) $(TVMET_DOC_DIR); \
|
||||
fi
|
||||
|
||||
install-data-hook: make-install-dirs
|
||||
@echo Installing documentations into $(TVMET_DOC_DIR)
|
||||
@echo "install html"
|
||||
@$(INSTALL_DATA) @top_builddir@/doc/html/* $(TVMET_DOC_DIR)
|
||||
|
||||
else
|
||||
doc-dist:
|
||||
install-data-hook:
|
||||
endif # CONFIG_DOC
|
||||
|
||||
|
||||
# --------------------------------------------------------
|
||||
# in progress:
|
||||
# make refman twoside
|
||||
twoside:
|
||||
class=`cat latex/refman.tex | grep documentclass`
|
||||
newclass=`echo $$class | sed -e 's/twoside,//' -e 's/\[/\[twoside,/'`
|
||||
@echo "class:" $$class
|
||||
@echo "newclass:" $$newclass
|
||||
cat latex/refman.tex | sed 's/$$class/$$newclass/' >foo
|
||||
@@ -1,687 +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.22 2004/09/16 08:12:13 opetzold Exp $
|
||||
|
||||
|
||||
SOURCES = $(dox_functions_SOURCES) $(dox_operators_SOURCES)
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = ..
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = @INSTALL@
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_triplet = @host@
|
||||
noinst_PROGRAMS = dox_operators$(EXEEXT) dox_functions$(EXEEXT)
|
||||
subdir = doc
|
||||
DIST_COMMON = $(srcdir)/Doxyfile.in $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in $(srcdir)/footer.html.in \
|
||||
$(srcdir)/tvmet.sty.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/config/ac_c_long_long.m4 \
|
||||
$(top_srcdir)/config/ac_create_prefix_config_h.m4 \
|
||||
$(top_srcdir)/config/ac_cxx_have_complex.m4 \
|
||||
$(top_srcdir)/config/ac_cxx_have_complex_math1.m4 \
|
||||
$(top_srcdir)/config/ac_cxx_have_complex_math2.m4 \
|
||||
$(top_srcdir)/config/ac_cxx_have_ieee_math.m4 \
|
||||
$(top_srcdir)/config/ac_cxx_have_mutable.m4 \
|
||||
$(top_srcdir)/config/ac_cxx_have_namespaces.m4 \
|
||||
$(top_srcdir)/config/ac_cxx_have_sysv_math.m4 \
|
||||
$(top_srcdir)/config/ac_cxx_partial_specialization.m4 \
|
||||
$(top_srcdir)/config/ac_cxx_typename.m4 \
|
||||
$(top_srcdir)/config/ac_set_compiler.m4 \
|
||||
$(top_srcdir)/config/op_doxygen_doc.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(mkdir_p)
|
||||
CONFIG_HEADER = $(top_builddir)/config/config.h
|
||||
CONFIG_CLEAN_FILES = Doxyfile footer.html tvmet.sty
|
||||
PROGRAMS = $(noinst_PROGRAMS)
|
||||
am_dox_functions_OBJECTS = dox_functions.$(OBJEXT)
|
||||
dox_functions_OBJECTS = $(am_dox_functions_OBJECTS)
|
||||
dox_functions_LDADD = $(LDADD)
|
||||
am_dox_operators_OBJECTS = dox_operators.$(OBJEXT)
|
||||
dox_operators_OBJECTS = $(am_dox_operators_OBJECTS)
|
||||
dox_operators_LDADD = $(LDADD)
|
||||
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/config
|
||||
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/dox_functions.Po \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/dox_operators.Po
|
||||
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
|
||||
LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \
|
||||
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(AM_CXXFLAGS) $(CXXFLAGS)
|
||||
CXXLD = $(CXX)
|
||||
CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \
|
||||
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
SOURCES = $(dox_functions_SOURCES) $(dox_operators_SOURCES)
|
||||
DIST_SOURCES = $(dox_functions_SOURCES) $(dox_operators_SOURCES)
|
||||
DATA = $(noinst_DATA)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CONFIG_CPPUNIT_FALSE = @CONFIG_CPPUNIT_FALSE@
|
||||
CONFIG_CPPUNIT_TRUE = @CONFIG_CPPUNIT_TRUE@
|
||||
CONFIG_DOC_FALSE = @CONFIG_DOC_FALSE@
|
||||
CONFIG_DOC_TRUE = @CONFIG_DOC_TRUE@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
|
||||
CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
|
||||
CPPUNIT_LIBS = @CPPUNIT_LIBS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CXX_DEBUG_FLAGS = @CXX_DEBUG_FLAGS@
|
||||
CXX_OPTIMIZE_FLAGS = @CXX_OPTIMIZE_FLAGS@
|
||||
CXX_WARN_FLAGS = @CXX_WARN_FLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DOXYGEN = @DOXYGEN@
|
||||
DOXYGEN_HAVE_DOT = @DOXYGEN_HAVE_DOT@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LATEX_BATCHMODE = @LATEX_BATCHMODE@
|
||||
LATEX_MODE = @LATEX_MODE@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
|
||||
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
datadir = @datadir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
AM_CXXFLAGS = -O \
|
||||
-I@top_srcdir@/include -I@top_builddir@/include
|
||||
|
||||
DOXY_DOC = \
|
||||
benchmark.dox \
|
||||
build.dox \
|
||||
compiler.dox \
|
||||
faq.dox \
|
||||
intro.dox \
|
||||
license.dox \
|
||||
links.dox \
|
||||
misc.dox \
|
||||
notes.dox \
|
||||
projects.dox \
|
||||
usage.dox \
|
||||
works.dox
|
||||
|
||||
HTML_MISC = \
|
||||
tvmet.css \
|
||||
header.html footer.html.in
|
||||
|
||||
LTEX_MISC = \
|
||||
tvmet.sty.in
|
||||
|
||||
BENCH_FIG = \
|
||||
axpy.png \
|
||||
matrix_matrix.png \
|
||||
matrix_vector.png \
|
||||
aat.png \
|
||||
ata.png
|
||||
|
||||
EXTRA_DIST = \
|
||||
$(DOXY_DOC) \
|
||||
$(HTML_MISC) \
|
||||
$(LTEX_MISC) \
|
||||
$(BENCH_FIG)
|
||||
|
||||
DISTCLEANFILES = \
|
||||
Doxyfile doxygen-warning \
|
||||
footer.html tvmet.sty
|
||||
|
||||
dox_operators_SOURCES = dox_operators.cc Util.h
|
||||
dox_functions_SOURCES = dox_functions.cc Util.h
|
||||
|
||||
#
|
||||
# rules for documentation, if ordered
|
||||
#
|
||||
|
||||
#
|
||||
# file created on the fly
|
||||
#
|
||||
@CONFIG_DOC_TRUE@DOXY_BUILD = \
|
||||
@CONFIG_DOC_TRUE@ changelog.dox \
|
||||
@CONFIG_DOC_TRUE@ news.dox \
|
||||
@CONFIG_DOC_TRUE@ credits.dox \
|
||||
@CONFIG_DOC_TRUE@ install.dox \
|
||||
@CONFIG_DOC_TRUE@ operators.dox \
|
||||
@CONFIG_DOC_TRUE@ functions.dox
|
||||
|
||||
@CONFIG_DOC_TRUE@DOXY_HTML_SRC = \
|
||||
@CONFIG_DOC_TRUE@ $(DOXY_DOC) \
|
||||
@CONFIG_DOC_TRUE@ $(DOXY_BUILD) \
|
||||
@CONFIG_DOC_TRUE@ $(patsubst %.in, %, $(HTML_MISC))
|
||||
|
||||
@CONFIG_DOC_TRUE@DOXY_LTEX_SRC = \
|
||||
@CONFIG_DOC_TRUE@ $(patsubst %.in, %, $(LTEX_MISC))
|
||||
|
||||
|
||||
#
|
||||
# doxygen API
|
||||
#
|
||||
@CONFIG_DOC_TRUE@DOC_API_PDF = $(PACKAGE)-$(VERSION).pdf
|
||||
|
||||
#
|
||||
# doxygen LaTeX API
|
||||
#
|
||||
@CONFIG_DOC_TRUE@TEXINPUTS_PATH = $(TEXINPUTS):$(top_builddir)
|
||||
@CONFIG_DOC_TRUE@noinst_DATA = $(DOC_API_PDF)
|
||||
|
||||
# where to install all html documents
|
||||
@CONFIG_DOC_TRUE@TVMET_DOC_DIR = $(datadir)/doc/$(PACKAGE)-$(VERSION)
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .cc .lo .o .obj
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu doc/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
Doxyfile: $(top_builddir)/config.status $(srcdir)/Doxyfile.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
footer.html: $(top_builddir)/config.status $(srcdir)/footer.html.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
tvmet.sty: $(top_builddir)/config.status $(srcdir)/tvmet.sty.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
|
||||
clean-noinstPROGRAMS:
|
||||
@list='$(noinst_PROGRAMS)'; for p in $$list; do \
|
||||
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
|
||||
echo " rm -f $$p $$f"; \
|
||||
rm -f $$p $$f ; \
|
||||
done
|
||||
dox_functions$(EXEEXT): $(dox_functions_OBJECTS) $(dox_functions_DEPENDENCIES)
|
||||
@rm -f dox_functions$(EXEEXT)
|
||||
$(CXXLINK) $(dox_functions_LDFLAGS) $(dox_functions_OBJECTS) $(dox_functions_LDADD) $(LIBS)
|
||||
dox_operators$(EXEEXT): $(dox_operators_OBJECTS) $(dox_operators_DEPENDENCIES)
|
||||
@rm -f dox_operators$(EXEEXT)
|
||||
$(CXXLINK) $(dox_operators_LDFLAGS) $(dox_operators_OBJECTS) $(dox_operators_LDADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dox_functions.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dox_operators.Po@am__quote@
|
||||
|
||||
.cc.o:
|
||||
@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
|
||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
|
||||
|
||||
.cc.obj:
|
||||
@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
|
||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
|
||||
.cc.lo:
|
||||
@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
|
||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
-rm -f libtool
|
||||
uninstall-info-am:
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|
||||
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkdir_p) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(PROGRAMS) $(DATA) all-local
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
|
||||
mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-libtool distclean-local distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am: dvi-local
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
@$(NORMAL_INSTALL)
|
||||
$(MAKE) $(AM_MAKEFLAGS) install-data-hook
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am: pdf-local
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am: ps-local
|
||||
|
||||
uninstall-am: uninstall-info-am uninstall-local
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am all-local check check-am clean \
|
||||
clean-generic clean-libtool clean-noinstPROGRAMS ctags \
|
||||
distclean distclean-compile distclean-generic \
|
||||
distclean-libtool distclean-local distclean-tags distdir dvi \
|
||||
dvi-am dvi-local html html-am info info-am install install-am \
|
||||
install-data install-data-am install-exec install-exec-am \
|
||||
install-info install-info-am install-man install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am pdf-local \
|
||||
ps ps-am ps-local tags uninstall uninstall-am \
|
||||
uninstall-info-am uninstall-local
|
||||
|
||||
|
||||
# some depencies
|
||||
Doxyfile: Doxyfile.in
|
||||
footer.html: footer.html.in
|
||||
tvmet.sty: tvmet.sty.in
|
||||
|
||||
# file creating rules; not needed every time
|
||||
@CONFIG_DOC_TRUE@operators.dox: dox_operators
|
||||
@CONFIG_DOC_TRUE@ ./dox_operators > operators.dox
|
||||
|
||||
@CONFIG_DOC_TRUE@functions.dox: dox_functions
|
||||
@CONFIG_DOC_TRUE@ ./dox_functions > functions.dox
|
||||
|
||||
# file creating rules
|
||||
@CONFIG_DOC_TRUE@changelog.dox: @top_srcdir@/ChangeLog
|
||||
@CONFIG_DOC_TRUE@ @echo "/** \page changelog ChangeLog" > $@
|
||||
@CONFIG_DOC_TRUE@ @echo "\verbatim" >> $@
|
||||
@CONFIG_DOC_TRUE@ cat $< >> $@
|
||||
@CONFIG_DOC_TRUE@ @echo "\endverbatim" >> $@
|
||||
@CONFIG_DOC_TRUE@ @echo "*/" >> $@
|
||||
|
||||
@CONFIG_DOC_TRUE@news.dox: @top_srcdir@/NEWS
|
||||
@CONFIG_DOC_TRUE@ @echo "/** \page news News" > $@
|
||||
@CONFIG_DOC_TRUE@ @echo "\verbatim" >> $@
|
||||
@CONFIG_DOC_TRUE@ cat $< >> $@
|
||||
@CONFIG_DOC_TRUE@ @echo "\endverbatim" >> $@
|
||||
@CONFIG_DOC_TRUE@ @echo "*/" >> $@
|
||||
|
||||
@CONFIG_DOC_TRUE@credits.dox: @top_srcdir@/THANKS
|
||||
@CONFIG_DOC_TRUE@ @echo "/** \page credits Credits" > $@
|
||||
@CONFIG_DOC_TRUE@ @echo "\verbatim" >> $@
|
||||
@CONFIG_DOC_TRUE@ cat $< >> $@
|
||||
@CONFIG_DOC_TRUE@ @echo "\endverbatim" >> $@
|
||||
@CONFIG_DOC_TRUE@ @echo "*/" >> $@
|
||||
|
||||
@CONFIG_DOC_TRUE@install.dox: @top_srcdir@/INSTALL
|
||||
@CONFIG_DOC_TRUE@ @echo "/** \page basic_install INSTALL" > $@
|
||||
@CONFIG_DOC_TRUE@ @echo "\verbatim" >> $@
|
||||
@CONFIG_DOC_TRUE@ cat $< >> $@
|
||||
@CONFIG_DOC_TRUE@ @echo "\endverbatim" >> $@
|
||||
@CONFIG_DOC_TRUE@ @echo "*/" >> $@
|
||||
|
||||
@CONFIG_DOC_TRUE@all-local: doxygen-api
|
||||
|
||||
# need's LaTeX style, since we use an own style for LaTeX
|
||||
# which is required for generating formulas in HTML too.
|
||||
# Doxygen LaTeX batchmode doesn't solves the problem right here.
|
||||
@CONFIG_DOC_TRUE@doxygen-html-dir:
|
||||
@CONFIG_DOC_TRUE@ @if test ! -d ./html; then mkdir ./html; fi
|
||||
|
||||
@CONFIG_DOC_TRUE@doxygen-api: doxygen-html-dir Doxyfile $(DOXY_HTML_SRC)
|
||||
@CONFIG_DOC_TRUE@ @echo "Making HTML manual"
|
||||
@CONFIG_DOC_TRUE@ @cp @builddir@/tvmet.sty ./html/
|
||||
@CONFIG_DOC_TRUE@ @DOXYGEN@ $(DOXYGEN_OPTS)
|
||||
@CONFIG_DOC_TRUE@ @$(RM) -f ./html/tvmet.sty
|
||||
|
||||
@CONFIG_DOC_TRUE@all-local: $(noinst_DATA)
|
||||
|
||||
@CONFIG_DOC_TRUE@dvi-local:
|
||||
@CONFIG_DOC_TRUE@ps-local:
|
||||
@CONFIG_DOC_TRUE@pdf-local: $(DOC_API_PDF)
|
||||
|
||||
@CONFIG_DOC_TRUE@$(DOC_API_PDF): Doxyfile $(DOXY_LTEX_SRC)
|
||||
@CONFIG_DOC_TRUE@ @if test -d ./latex; then \
|
||||
@CONFIG_DOC_TRUE@ echo "Making PDF manual"; \
|
||||
@CONFIG_DOC_TRUE@ if test -f $@; then \
|
||||
@CONFIG_DOC_TRUE@ $(RM) $@; \
|
||||
@CONFIG_DOC_TRUE@ fi; \
|
||||
@CONFIG_DOC_TRUE@ TEXINPUTS=$(TEXINPUTS_PATH) $(MAKE) -C ./latex refman.pdf; \
|
||||
@CONFIG_DOC_TRUE@ $(LN_S) ./latex/refman.pdf $@; \
|
||||
@CONFIG_DOC_TRUE@ fi
|
||||
|
||||
#
|
||||
# misc hooks
|
||||
#
|
||||
@CONFIG_DOC_TRUE@distclean-local:
|
||||
@CONFIG_DOC_TRUE@ @rm -f $(DOXY_BUILD)
|
||||
@CONFIG_DOC_TRUE@ @if test -f $(DOC_API_PDF); then \
|
||||
@CONFIG_DOC_TRUE@ $(RM) -f $(DOC_API_PDF); \
|
||||
@CONFIG_DOC_TRUE@ fi
|
||||
@CONFIG_DOC_TRUE@ @if test -d html; then \
|
||||
@CONFIG_DOC_TRUE@ $(RM) -rf html; \
|
||||
@CONFIG_DOC_TRUE@ fi
|
||||
@CONFIG_DOC_TRUE@ @if test -d latex; then \
|
||||
@CONFIG_DOC_TRUE@ $(RM) -rf latex; \
|
||||
@CONFIG_DOC_TRUE@ fi
|
||||
@CONFIG_DOC_TRUE@ @if test -d rtf; then \
|
||||
@CONFIG_DOC_TRUE@ $(RM) -rf rtf; \
|
||||
@CONFIG_DOC_TRUE@ fi
|
||||
@CONFIG_DOC_TRUE@ @if test -d man; then \
|
||||
@CONFIG_DOC_TRUE@ $(RM) -rf man; \
|
||||
@CONFIG_DOC_TRUE@ fi
|
||||
|
||||
@CONFIG_DOC_TRUE@doc-dist: doxygen-api
|
||||
@CONFIG_DOC_TRUE@ echo "please wait while archiving the html docs."; \
|
||||
@CONFIG_DOC_TRUE@ tar cf - -C ./html . | bzip2 --best -c > $(PACKAGE)-docs-$(VERSION).tar.bz2
|
||||
|
||||
# Automake's "distcheck" is sensitive to having files left over
|
||||
# after "make uninstall", so we have to clean up the install hook.
|
||||
@CONFIG_DOC_TRUE@uninstall-local:
|
||||
@CONFIG_DOC_TRUE@ @if test -d $(TVMET_DOC_DIR); then \
|
||||
@CONFIG_DOC_TRUE@ rm -rf $(TVMET_DOC_DIR); \
|
||||
@CONFIG_DOC_TRUE@ fi
|
||||
|
||||
# Install hooks
|
||||
@CONFIG_DOC_TRUE@make-install-dirs:
|
||||
@CONFIG_DOC_TRUE@ @if test '!' -d $(TVMET_DOC_DIR); then \
|
||||
@CONFIG_DOC_TRUE@ $(mkinstalldirs) $(TVMET_DOC_DIR); \
|
||||
@CONFIG_DOC_TRUE@ fi
|
||||
|
||||
@CONFIG_DOC_TRUE@install-data-hook: make-install-dirs
|
||||
@CONFIG_DOC_TRUE@ @echo Installing documentations into $(TVMET_DOC_DIR)
|
||||
@CONFIG_DOC_TRUE@ @echo "install html"
|
||||
@CONFIG_DOC_TRUE@ @$(INSTALL_DATA) @top_builddir@/doc/html/* $(TVMET_DOC_DIR)
|
||||
|
||||
@CONFIG_DOC_FALSE@doc-dist:
|
||||
@CONFIG_DOC_FALSE@install-data-hook:
|
||||
|
||||
# --------------------------------------------------------
|
||||
# in progress:
|
||||
# make refman twoside
|
||||
twoside:
|
||||
class=`cat latex/refman.tex | grep documentclass`
|
||||
newclass=`echo $$class | sed -e 's/twoside,//' -e 's/\[/\[twoside,/'`
|
||||
@echo "class:" $$class
|
||||
@echo "newclass:" $$newclass
|
||||
cat latex/refman.tex | sed 's/$$class/$$newclass/' >foo
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
@@ -1,202 +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: Util.h,v 1.5 2003/12/19 18:01:37 opetzold Exp $
|
||||
*/
|
||||
|
||||
#ifndef TVMET_DOC_UTIL_H
|
||||
#define TVMET_DOC_UTIL_H
|
||||
|
||||
#include <vector>
|
||||
#include <tvmet/config.h>
|
||||
|
||||
struct Function {
|
||||
Function() { }
|
||||
virtual ~Function() { }
|
||||
virtual const char* name() const = 0;
|
||||
virtual const char* description() const = 0;
|
||||
virtual bool int_only() const = 0;
|
||||
static const char* group() { return "_function"; }
|
||||
static const char* group_unary() { return "_unary_function"; }
|
||||
static const char* group_binary() { return "_binary_function"; }
|
||||
template<class Stream> static Stream& doxy_groups(Stream& os) {
|
||||
os << "/**\n"
|
||||
<< " * \\defgroup " << group() << " Global Functions\n"
|
||||
<< " */\n\n";
|
||||
os << "/**\n"
|
||||
<< " * \\defgroup " << group_unary() << " Global Unary Functions\n"
|
||||
<< " * \\ingroup " << group() << "\n"
|
||||
<< " */\n\n";
|
||||
os << "/**\n"
|
||||
<< " * \\defgroup " << group_binary() << " Global Binary Functions\n"
|
||||
<< " * \\ingroup " << group() << "\n"
|
||||
<< " */\n\n";
|
||||
os << "/**\n"
|
||||
<< " * \\defgroup " << "_trinary_function" << " Global Trinary Functions\n"
|
||||
<< " * \\ingroup " << group() << "\n"
|
||||
<< " */\n\n";
|
||||
return os;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
class BinaryFunction : public Function {
|
||||
public:
|
||||
BinaryFunction(const char* s, const char* d, bool i = false)
|
||||
: m_name(s), m_description(d), m_int_only(i) { }
|
||||
const char* name() const { return m_name; }
|
||||
const char* description() const { return m_description; }
|
||||
const char* group() const { return group_binary(); }
|
||||
bool int_only() const { return m_int_only; }
|
||||
private:
|
||||
const char* m_name;
|
||||
const char* m_description;
|
||||
bool m_int_only;
|
||||
};
|
||||
|
||||
class UnaryFunction : public Function {
|
||||
public:
|
||||
UnaryFunction(const char* s, const char* d, bool i = false)
|
||||
: m_name(s), m_description(d), m_int_only(i) { }
|
||||
virtual ~UnaryFunction() { }
|
||||
const char* name() const { return m_name; }
|
||||
const char* description() const { return m_description; }
|
||||
const char* group() const { return group_unary(); }
|
||||
bool int_only() const { return m_int_only; }
|
||||
private:
|
||||
const char* m_name;
|
||||
const char* m_description;
|
||||
bool m_int_only;
|
||||
};
|
||||
|
||||
struct Operator {
|
||||
Operator() { }
|
||||
virtual ~Operator() { }
|
||||
virtual const char* symbol() const = 0;
|
||||
virtual const char* description() const = 0;
|
||||
virtual bool int_only() const = 0;
|
||||
static const char* group() { return "_operator"; }
|
||||
static const char* group_unary() { return "_unary_operator"; }
|
||||
static const char* group_binary() { return "_binary_operator"; }
|
||||
template<class Stream> static Stream& doxy_groups(Stream& os) {
|
||||
os << "/**\n"
|
||||
<< " * \\defgroup " << group() << " Global Operators\n"
|
||||
<< " */\n\n";
|
||||
os << "/**\n"
|
||||
<< " * \\defgroup " << group_binary() << " Global Binary Operators\n"
|
||||
<< " * \\ingroup " << group() << "\n"
|
||||
<< " */\n\n";
|
||||
os << "/**\n"
|
||||
<< " * \\defgroup " << group_unary() << " Global Unary Operators\n"
|
||||
<< " * \\ingroup " << group() << "\n"
|
||||
<< " */\n\n";
|
||||
return os;
|
||||
}
|
||||
};
|
||||
|
||||
class BinaryOperator : public Operator {
|
||||
public:
|
||||
BinaryOperator(const char* s, const char* d, bool i = false)
|
||||
: m_symbol(s), m_description(d), m_int_only(i) { }
|
||||
virtual ~BinaryOperator() { }
|
||||
const char* symbol() const { return m_symbol; }
|
||||
const char* description() const { return m_description; }
|
||||
const char* group() const { return group_binary(); }
|
||||
bool int_only() const { return m_int_only; }
|
||||
private:
|
||||
const char* m_symbol;
|
||||
const char* m_description;
|
||||
bool m_int_only;
|
||||
};
|
||||
|
||||
class UnaryOperator : public Operator {
|
||||
public:
|
||||
UnaryOperator(const char* s, const char* d, bool i = false)
|
||||
: m_symbol(s), m_description(d), m_int_only(i) { }
|
||||
virtual ~UnaryOperator() { }
|
||||
const char* symbol() const { return m_symbol; }
|
||||
const char* description() const { return m_description; }
|
||||
const char* group() const { return group_unary(); }
|
||||
bool int_only() const { return m_int_only; }
|
||||
private:
|
||||
const char* m_symbol;
|
||||
const char* m_description;
|
||||
bool m_int_only;
|
||||
};
|
||||
|
||||
class DataType {
|
||||
public:
|
||||
DataType(const char* s, const char* d, bool i = false)
|
||||
: m_name(s), m_description(d), m_is_int(i){ }
|
||||
const char* name() const { return m_name; }
|
||||
const char* description() const { return m_description; }
|
||||
bool is_int() const { return m_is_int; }
|
||||
private:
|
||||
const char* m_name;
|
||||
const char* m_description;
|
||||
bool m_is_int;
|
||||
};
|
||||
|
||||
class Type
|
||||
{
|
||||
public:
|
||||
Type() {
|
||||
datatypes.push_back( DataType("int", "int", true) );
|
||||
datatypes.push_back( DataType("float", "float") );
|
||||
datatypes.push_back( DataType("double", "double") );
|
||||
#ifdef TVMET_HAVE_LONG_DOUBLE
|
||||
datatypes.push_back( DataType("long double", "long double") );
|
||||
#endif // HAVE_LONG_DOUBLE
|
||||
#ifdef EIGEN_USE_COMPLEX
|
||||
datatypes.push_back( DataType("const std::complex<T>&", "std::complex<T>") );
|
||||
#endif // HAVE_COMPLEX
|
||||
}
|
||||
|
||||
virtual ~Type() { }
|
||||
|
||||
public:
|
||||
template<class Stream>
|
||||
Stream& header(Stream& os) const {
|
||||
os << "namespace tvmet {\n\n";
|
||||
return os;
|
||||
}
|
||||
|
||||
template<class Stream>
|
||||
Stream& footer(Stream& os) const {
|
||||
os << "\n} // namespace tvmet\n\n";
|
||||
return os;
|
||||
}
|
||||
|
||||
public:
|
||||
typedef std::vector< DataType >::const_iterator const_iterator;
|
||||
|
||||
public:
|
||||
const_iterator begin() const { return datatypes.begin(); }
|
||||
const_iterator end() const { return datatypes.end(); }
|
||||
|
||||
private:
|
||||
std::vector< DataType > datatypes;
|
||||
};
|
||||
|
||||
#endif // TVMET_DOC_UTIL_H
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 19 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 18 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 23 KiB |
@@ -1,52 +0,0 @@
|
||||
/*
|
||||
* $Id: benchmark.dox,v 1.8 2004/04/10 04:58:35 opetzold Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
\page benchmark Benchmark
|
||||
|
||||
Prior to version 0.8.0, tvmet had benchmark results listed here. Benchmarking
|
||||
isn't as easy as had been thought. The compiler's optimizer is very tricky -
|
||||
even more than I am. 8( To outwit the optimizer takes time - I would rather
|
||||
put the time into tvmet, itself.
|
||||
|
||||
Laurent Plagne has created some benchmarks using tvmet and other libraries,
|
||||
please have a look at
|
||||
<a href="http://www.opencascade.org/upload/87">opencascade</a>.
|
||||
|
||||
The following benchmarks are done on my
|
||||
Intel(R) Pentium(R) 4 CPU 2.40GHz
|
||||
Linux box:
|
||||
- \ref bench_axpy
|
||||
- \ref bench_matrix_matrix
|
||||
- \ref bench_matrix_vector
|
||||
- \ref bench_aat
|
||||
- \ref bench_ata
|
||||
|
||||
using a patched version of BTL 20030124. The patch is necessary to be able
|
||||
to compile tvmet due to the high inline level used here. The patch is
|
||||
distributed with the package.
|
||||
|
||||
\section bench_axpy axpy
|
||||
\image html axpy.png "axpy"
|
||||
|
||||
\section bench_matrix_matrix Matrix-Matrix
|
||||
\image html matrix_matrix.png "Matrix-Matrix"
|
||||
|
||||
\section bench_matrix_vector Matrix-Vector
|
||||
\image html matrix_vector.png "Matrix-Vector"
|
||||
|
||||
\section bench_aat MMt
|
||||
\image html aat.png "M M^t"
|
||||
|
||||
\section bench_ata MtM
|
||||
\image html ata.png "M^t M"
|
||||
|
||||
*/
|
||||
|
||||
|
||||
// Local Variables:
|
||||
// mode:c++
|
||||
// End:
|
||||
// LocalWords: BTL GHz Plagne
|
||||
@@ -1,199 +0,0 @@
|
||||
/*
|
||||
* $Id: build.dox,v 1.14 2005/04/07 15:59:19 opetzold Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
\page build Download, Configuration, Build and Installation of the library
|
||||
|
||||
<p>Contents:</p>
|
||||
- \ref download
|
||||
- \ref configure_unix
|
||||
- \ref install_unix
|
||||
- \ref install_win
|
||||
|
||||
|
||||
|
||||
|
||||
\section download Download tvmet
|
||||
|
||||
<p>
|
||||
You can download %tvmet <a href=http://sourceforge.net/project/showfiles.php?group_id=39733>here</a>.
|
||||
For the regression tests you will need <a href=http://sourceforge.net/projects/cppunit>CppUnit</a>.
|
||||
While these tests are not mandatory, they are recommended.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
For the API documentation you will also need <a href=http://www.doxygen.org>doxygen</a>,
|
||||
maybe you want a graphical class hierarchy, class graph etc you need
|
||||
the 'dot' tool of <a href="http://www.graphviz.org/">GraphViz</a>
|
||||
to draw the miscellaneous graphs.
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section configure_unix Configure tvmet on unix
|
||||
|
||||
See the \ref basic_install file for general informations.
|
||||
|
||||
<b>NEW</b> Starting with tvmet version 1.5.0 the configuration options
|
||||
has been changed!
|
||||
|
||||
<dl>
|
||||
<dt><tt>--enable-optimize</tt></dt>
|
||||
<dd>This affects the compiler optimization options. Machine specific
|
||||
compiler flags are switched on as well. The <code>TVMET_OPTIMIZE</code>
|
||||
symbol is defined, which uses the gcc's
|
||||
<code>__attribute__((always_inline))</code>.
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dt><tt>--enable-debug</tt></dt>
|
||||
<dd>Enables debugging mode for %tvmet. This affects the compiler
|
||||
options and preprocessor definitions. The <code>TVMET_DEBUG</code>
|
||||
symbol is defined. If you compile %tvmet from another source directory
|
||||
which defines <code>DEBUG</code>, then <code>TVMET_DEBUG</code> will be
|
||||
<b>not</b> defined (This behavior differs from release less than 0.6.0).
|
||||
Please have a look at the \ref debug section of the \ref faq.
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dt><tt>--enable-warnings</tt></dt>
|
||||
<dd>This affects the compiler warning options. The warning level is on
|
||||
a high level for default!</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dt><tt>--enable-docs</tt></dt>
|
||||
<dd>Enables generation of API documentation using <a href=http://www.doxygen.org>doxygen</a>.
|
||||
If the configure scripts founds the <a href="http://www.graphviz.org/">GraphViz</a>
|
||||
'dot' tool it will be used. Further more an PDF file of the API
|
||||
will be generated using doxygen too.
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dt><tt>--enable-verbose-latex</tt></dt>
|
||||
<dd>Uses LaTeX non-stop mode for generating the PDF file of tvmet's
|
||||
API documentation.
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dt><tt>--disable-cppunit</tt></dt>
|
||||
<dd>Disables the regression/unit test. For these tests you need an installed
|
||||
<a href="http://www.sourceforge.net/projects/cppunit">CppUnit</a>.
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dt><tt>--with-cxx=compiler</tt></dt>
|
||||
<dd>Set the C++ compiler to compiler and options. The known compiler are
|
||||
the GNU g++ (default), Intel icc, Kai C++ KCC, Portland Group C++ pgCC.
|
||||
Please have a look at the \ref compiler page.
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section install_unix Build and Installation of tvmet on unix
|
||||
|
||||
The build target for make are:
|
||||
|
||||
<dl>
|
||||
<dt><tt>all</tt></dt>
|
||||
<dd>Makes tvmet ready for installation.</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dt><tt>docs</tt></dt>
|
||||
<dd>Makes the documentation using doxygen. Depends on the options given
|
||||
to the configure script, the documentation are HTML and PDF/LaTeX.</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dt><tt>check</tt></dt>
|
||||
<dd>Build and run the regression tests (needs CppUnit).</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dt><tt>install</tt></dt>
|
||||
<dd>Installs tvmet.</dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
<dt><tt>uninstall</tt></dt>
|
||||
<dd>Do you really want this? :-)</dd>
|
||||
</dl>
|
||||
|
||||
Further more inside the <tt>examples</tt> directory there is the target:
|
||||
|
||||
<dl>
|
||||
<dt><tt>examples</tt></dt>
|
||||
<dd>Build tvmet's examples.
|
||||
|
||||
At this date the example directory contains simple examples
|
||||
for matrix, vector and matrix-vector operations. Further more
|
||||
some sources which shows the use for expression tree printing
|
||||
(expands the expression tree used).
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
Files will be installed in the following directories:
|
||||
|
||||
<ul>
|
||||
<li><tt>Executables -> ${prefix}/bin</tt></li>
|
||||
<li><tt>Docs -> ${prefix}/share/doc/tvmet-${version}</tt></li>
|
||||
<li><tt>Man pages -> ${prefix}/man</tt></li>
|
||||
<li><tt>Header file -> ${prefix}/include/tvmet</tt></li>
|
||||
</ul>
|
||||
|
||||
Default value for prefix is <tt>/usr/local</tt> but you may change it
|
||||
with <tt>--prefix</tt> option to the <tt>configure</tt> script (see above).
|
||||
|
||||
|
||||
|
||||
|
||||
\section install_win Build and Installation of tvmet on MS Windows
|
||||
|
||||
First, the windows version used doesn't matter - the compiler is your
|
||||
tool. The compiler has to understand the high level C++ style of
|
||||
tvmet.
|
||||
|
||||
Second, tvmet comes with pre-configured files for the windows compiler.
|
||||
Therefore you don't need to follow the configure and build procedure. An
|
||||
exception is the <a href="http://www.cygwin.com">cygwin</a> and
|
||||
<a href="http://www.mingw.org/">MinGW</a> environment
|
||||
since they emulate the unix environment on windows - they follow the
|
||||
unix style process therefore.
|
||||
|
||||
Well, simply copy the tvmet source tree complete or only the include
|
||||
directory to a location of your choice and include the path to your
|
||||
compiler environment. Thats all.
|
||||
|
||||
To build the regression tests it's on your own to build support for
|
||||
<a href="http://cppunit.sourceforge.net">cppunit</a> and create the
|
||||
appropriate sub-project. tvmet does not deliver Microsoft Visual Studio
|
||||
project files.
|
||||
|
||||
If of interest the config file for Visual Studio can be found on
|
||||
<tt>tvmet/config/config-vc71.h</tt>. There are all compiler quirks and
|
||||
defines needed.
|
||||
|
||||
|
||||
\sa \ref vc71
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
// Local Variables:
|
||||
// mode:c++
|
||||
// End:
|
||||
// LocalWords: CppUnit GraphViz doxygen
|
||||
@@ -1,375 +0,0 @@
|
||||
/*
|
||||
* $Id: compiler.dox,v 1.24 2005/03/09 12:05:19 opetzold Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
\page compiler Compiler Support
|
||||
|
||||
<p>Contents:</p>
|
||||
- \ref requirements
|
||||
- \ref gcc
|
||||
- \ref kcc
|
||||
- \ref pgCC
|
||||
- \ref intel
|
||||
- \ref vc71
|
||||
|
||||
\section requirements General compiler Requirements
|
||||
|
||||
This library is designed for portability - no compiler specific extensions
|
||||
are used. Nevertheless, there are a few requirements: (These are all a part
|
||||
of the C++ standard.)
|
||||
|
||||
- Support for the <tt>mutable</tt> keyword is required. This is used by the
|
||||
CommaInitializer only.
|
||||
|
||||
- The <tt>typename</tt> keyword is used exhaustively here.
|
||||
|
||||
- The namespace concept is required. The tvmet library is itself is a
|
||||
namespace. To avoid collisions of operators, there is also an element_wise
|
||||
namespace within tvmet.
|
||||
|
||||
- Partial specialization is needed for the extrema functions min and max
|
||||
to distinguish between vectors and matrices. This allows tvmet to return
|
||||
an object with a specific behavior. (The location of an extremum in a
|
||||
matrix has a (row, column) position whereas a vector extremum has only a
|
||||
single index for its position).
|
||||
|
||||
\section gcc The GNU Compiler Collection
|
||||
|
||||
The <a href=http://gcc.gnu.org>GNU compiler</a> collection is mainly used for
|
||||
developing this library. Moreover, it does compile the library the fastest.
|
||||
|
||||
\subsection gcc2953 GNU C++ Compiler v2.95.3
|
||||
|
||||
Gcc v2.95.3 is the last official release of the version 2 series from gnu.org.
|
||||
Since this compiler features the \ref requirements it does work, but only
|
||||
partial.
|
||||
|
||||
There are certain difficulties - see \ref ambiguous_overload (also, please
|
||||
read about \ref gcc296). Furthermore, there are problems with functions and
|
||||
operators declared in the namespace <code>element_wise</code> - the
|
||||
compiler doesn't seem to find them--even though the compiler does know
|
||||
about namespace tvmet. It appears to be a problem with nested namespaces and
|
||||
the compiler's ability to perform function/operator lookup, especially during
|
||||
regression tests: <code> matrix /= matrix </code> compiles inside a single
|
||||
file but not at the regression tests--which is a contradiction in terms.
|
||||
|
||||
Porting to gcc v2.95.3 requires a lot of knowledge and effort--unfortunately,
|
||||
I don't have enough of either. The examples do compile and the regression
|
||||
tests build partially.
|
||||
|
||||
Matrix and vector operators are working, but don't expect too much.
|
||||
|
||||
\subsection gcc296 GNU C++ Compiler v2.96 (Rh7.x, MD8.x)
|
||||
|
||||
This compiler isn't an official release of the GNU Compiler group but shipped
|
||||
by <a href=http://www.redhat.com>Red Hat</a> and Co.
|
||||
|
||||
Blitz++ is using a hasFastAccess() flag to perform a check for the use of
|
||||
_bz_meta_vecAssign::fastAssign (without bounds checking) or
|
||||
_bz_meta_vecAssign::assign (with bounds checking). This
|
||||
isn't really necessary for operations on blitz::TinyVector, since it's
|
||||
always true. Nevertheless, it is important for the produced asm code using
|
||||
the gcc-c++-2.96-0.48mdk. Generally the code for Blitz++ using the gcc-2.96
|
||||
is better than tvmet because of this (tested!).
|
||||
|
||||
I got into trouble with stl_relops.h where miscellaneous operators are defined. A
|
||||
simple define of __SGI_STL_INTERNAL_RELOPS in the config header doesn't solve
|
||||
the problem, only the commented out header version, see \ref
|
||||
ambiguous_overload. Because of this problem, the regression tests don't
|
||||
compile with this version. Projects with do not use the relational
|
||||
operators are not affected.
|
||||
|
||||
It seems that the inlining performed by this compiler collection isn't very
|
||||
smart. I got a lot of warnings: can't inline call to ... So, it would be
|
||||
best to use the \ref gcc30x and later compilers.
|
||||
|
||||
\subsection gcc30x GNU C++ Compiler v3.0.x
|
||||
|
||||
These compiler produce better code than the \ref gcc296! Even the problems
|
||||
with blitz++ fastAssign have vanished. And this compiler conforms to the
|
||||
standard. The regression tests does compile and run successfully.
|
||||
|
||||
Due to the nature of ET and MT there is a need for a high level of inlining.
|
||||
The v3.0.x seems to do this well as compared to the v2.9x compilers which
|
||||
produce inline warnings.
|
||||
|
||||
This compiler works great with the
|
||||
<a href=http://www.stlport.org">STLPort-4.5.3</a>
|
||||
implementation of the STL/C++ Library, Tiny Vector and Matrix template library
|
||||
and <a href=http://cppunit.sourceforge.net>cpp-unit</a>.
|
||||
|
||||
\subsection gcc31x GNU C++ Compiler v3.1
|
||||
|
||||
%tvmet does compile with this new GNU C++ compiler. The produced code looks
|
||||
as good as the code created by \ref gcc30x. (Does anyone have time to make
|
||||
a benchmark?)
|
||||
|
||||
The primary goal is conformance to the standard ISO/IEC 14882:1998.
|
||||
|
||||
\subsection gcc32x GNU C++ Compiler v3.2.x
|
||||
|
||||
The once again changed Application Binary Interface (ABI) doesn't affect
|
||||
tvmet since it isn't a binary library--it's only compiled templates inside
|
||||
the client code.
|
||||
|
||||
There are some problems with the GNU C++ compiler collection on the
|
||||
regression test due to some bugs (IMO), \sa \ref regressiontest_failed.
|
||||
|
||||
\subsection gcc33x GNU C++ Compiler v3.3
|
||||
|
||||
Tested and works fine. Only some warnings on failed inlining which doesn't
|
||||
concern tvmet directly.
|
||||
|
||||
Anyway, here the code from <tt>examples/ray.cc</tt> on gcc 3.3.3 using
|
||||
<tt>-O2 -DTVMET_OPTIMIZE</tt>
|
||||
|
||||
\par Assembler (IA-32 Intel® Architecture):
|
||||
\code
|
||||
movl 16(%ebp), %edx
|
||||
movl 12(%ebp), %ebx
|
||||
movl 8(%ebp), %esi
|
||||
fldl 8(%edx)
|
||||
fldl 16(%edx)
|
||||
fmull 16(%ebx)
|
||||
fxch %st(1)
|
||||
movl %ebx, -24(%ebp)
|
||||
fmull 8(%ebx)
|
||||
movl %edx, -32(%ebp)
|
||||
fldl (%edx)
|
||||
fmull (%ebx)
|
||||
fxch %st(1)
|
||||
movl %edx, -60(%ebp)
|
||||
movl %edx, -12(%ebp)
|
||||
faddp %st, %st(2)
|
||||
faddp %st, %st(1)
|
||||
fadd %st(0), %st
|
||||
fstpl -56(%ebp)
|
||||
movl -56(%ebp), %ecx
|
||||
movl -52(%ebp), %eax
|
||||
movl %ecx, -20(%ebp)
|
||||
movl %eax, -16(%ebp)
|
||||
movl %ecx, -40(%ebp)
|
||||
movl %eax, -36(%ebp)
|
||||
movl %ecx, -68(%ebp)
|
||||
movl %eax, -64(%ebp)
|
||||
fldl (%edx)
|
||||
fmull -20(%ebp)
|
||||
fsubrl (%ebx)
|
||||
fstpl (%esi)
|
||||
fldl 8(%edx)
|
||||
fmull -20(%ebp)
|
||||
fsubrl 8(%ebx)
|
||||
fstpl 8(%esi)
|
||||
fldl 16(%edx)
|
||||
fmull -20(%ebp)
|
||||
fsubrl 16(%ebx)
|
||||
fstpl 16(%esi)
|
||||
addl $64, %esp
|
||||
popl %ebx
|
||||
popl %esi
|
||||
popl %ebp
|
||||
ret
|
||||
\endcode
|
||||
|
||||
\subsection gcc34x GNU C++ Compiler v3.4.x
|
||||
|
||||
The compiler 3.4.3 works fine, starting with tvmet release 1.7.1. The problem is
|
||||
the correct syntax for the CommaInitializer template declaration and
|
||||
implementation.
|
||||
|
||||
There is no assembler output for our <tt>examples/ray.cc</tt>, since I don't
|
||||
have this compiler yet (yes, I need to update my linux system ;-)
|
||||
|
||||
|
||||
\section kcc Kai C++
|
||||
|
||||
This has not been tested. Unfortunately Kai's compiler is no longer shipped
|
||||
-- one should use the Intel compiler instead
|
||||
(see <a href=http://www.kai.com>here</a>).
|
||||
|
||||
If you have used it successfully including regression and/or benchmark tests,
|
||||
please give me an answer.
|
||||
|
||||
\section pgCC Portland Group Compiler Technology
|
||||
|
||||
\subsection pgCC32 Portland Group C++ 3.2
|
||||
|
||||
The <a href=http://www.pgroup.com>Portland Group</a> C++ compiler is shipped
|
||||
with the RogueWave Standard C++ Library which provides conformance to the
|
||||
standard. Unfortunately, the <cname> C library wrapper headers and the C++
|
||||
overloads of the math functions are not provided on all platforms, see
|
||||
<http://www.cug.com/roundup>. The download evaluation version 3.2-4 for
|
||||
Linux is affected for example. At first glance, it does compile with pgCC
|
||||
since it has has the great <a href=http://www.edg.com>EDG</a> front-end.
|
||||
|
||||
Maybe there is a solution with other standard library implementations like
|
||||
<a href=http://www.stlport.org>STLPort</a> (On a quick try the STL Port
|
||||
doesn't recognize the pgCC). If you know more about this, please let me know.
|
||||
|
||||
Anyway, the code produced is very poor even if I use high inlining levels
|
||||
like the command line option -Minline=levels:100 which increases the compile
|
||||
time dramatically! The benchmark tests have not been done. Unfortunately,
|
||||
my trial period has expired. I haven't any idea if this compiler will pass
|
||||
the regression tests.
|
||||
|
||||
\subsection pgCC51 Portland Group C++ 5.1
|
||||
|
||||
The <a href=http://www.pgroup.com>Portland Group</a> C++ compiler is shipped
|
||||
with the <a href=http://www.stlport.org>STLport</a> Standard C++ Library, cool!
|
||||
|
||||
The code produced isn't very compact compared with the intel or gnu compiler.
|
||||
Anyway it works, but the compiler time increases dramatically
|
||||
even on higher inline levels.
|
||||
|
||||
|
||||
\section intel Intel Compiler
|
||||
|
||||
\subsection icc5 Intel Compiler v5.0.1
|
||||
|
||||
This compiler complains even more than gcc-3.0.x regarding template
|
||||
specifiers (e.g. correct spaces for template arguments to std::complex are
|
||||
needed even when not instanced).
|
||||
|
||||
The produced code looks good but, I haven't done a benchmark to compare it
|
||||
with the gcc-3.0.x since the compile time increases for the benchmark test
|
||||
dramatically.
|
||||
|
||||
I have not run any regression tests due to the compile time needed by my
|
||||
AMD K6/400 Linux box ...
|
||||
|
||||
\subsection icc6 Intel Compiler v6.0.x
|
||||
|
||||
Should work, but I haven't tested it.
|
||||
|
||||
\subsection icc7 Intel Compiler v7.x
|
||||
|
||||
This compiler is well supported by tvmet and passes the regression tests
|
||||
without any failure - as opposed to the GNU C++ compiler collection.
|
||||
|
||||
\subsection icc8 Intel Compiler v8.x
|
||||
|
||||
No regression tests are done - reports are welcome. I'm not expecting
|
||||
problems. Anyway, this versions uses pure macros for IEEE math isnan and
|
||||
isinf. This prevents overwriting with tvmet's functions. Therefore
|
||||
this functions are disabled after tvmet release 1.4.1. The code produced
|
||||
is even on <tt>examples/ray.cc</tt> more compact than the \ref gcc33x.
|
||||
|
||||
Anyway, here the code from <tt>examples/ray.cc</tt> using
|
||||
<tt>-O2 -DTVMET_OPTIMIZE</tt>
|
||||
|
||||
\par Assembler (IA-32 Intel® Architecture):
|
||||
\code
|
||||
movl 4(%esp), %ecx
|
||||
movl 8(%esp), %edx
|
||||
movl 12(%esp), %eax
|
||||
fldl (%edx)
|
||||
fmull (%eax)
|
||||
fldl 8(%edx)
|
||||
fmull 8(%eax)
|
||||
fldl 16(%edx)
|
||||
fmull 16(%eax)
|
||||
faddp %st, %st(1)
|
||||
faddp %st, %st(1)
|
||||
fldl (%eax)
|
||||
fxch %st(1)
|
||||
fadd %st(0), %st
|
||||
fmul %st, %st(1)
|
||||
fxch %st(1)
|
||||
fsubrl (%edx)
|
||||
fstpl (%ecx)
|
||||
fldl 8(%eax)
|
||||
fmul %st(1), %st
|
||||
fsubrl 8(%edx)
|
||||
fstpl 8(%ecx)
|
||||
fldl 16(%eax)
|
||||
fmulp %st, %st(1)
|
||||
fsubrl 16(%edx)
|
||||
fstpl 16(%ecx)
|
||||
ret
|
||||
\endcode
|
||||
|
||||
|
||||
|
||||
|
||||
\section vc71 Microsoft Visual C++ v7.1
|
||||
|
||||
\htmlonly
|
||||
<script language="JavaScript">
|
||||
var m_name="blbounnejapny";
|
||||
var m_domain="hotmail.com";
|
||||
var m_text='<a href="mailto:'+m_name+'@'+m_domain+'?subject=tvmet and Microsoft VC++">';
|
||||
m_text+='Robi Carnecky</a>';
|
||||
document.write(m_text);
|
||||
</script>
|
||||
\endhtmlonly
|
||||
\latexonly
|
||||
Robi Carnecky <blbounnejapny@hotmail.com>
|
||||
\endlatexonly
|
||||
has reported the success on tvmet using Visual C++ v7.1. At this
|
||||
release of tvmet there are some warnings left - the work is on
|
||||
progress.
|
||||
|
||||
The <a href="http://msdn.microsoft.com/visualc/vctoolkit2003/">Microsoft Visual C++ Toolkit 2003</a>
|
||||
and Visual C++ prior 7.1 do not compile - you will get an undefined
|
||||
internal error unfortunally.
|
||||
|
||||
Anyway, here the code from <tt>examples/ray.cc</tt>:
|
||||
|
||||
\par Assembler (IA-32 Intel® Architecture, no SSE2):
|
||||
\code
|
||||
push ebp
|
||||
mov ebp, esp
|
||||
and esp, -8 ; fffffff8H
|
||||
sub esp, 28 ; 0000001cH
|
||||
mov eax, DWORD PTR _ray$[ebp]
|
||||
mov ecx, DWORD PTR _surfaceNormal$[ebp]
|
||||
fld QWORD PTR [eax+16]
|
||||
fmul QWORD PTR [ecx+16]
|
||||
push ebx
|
||||
fld QWORD PTR [eax+8]
|
||||
push esi
|
||||
fmul QWORD PTR [ecx+8]
|
||||
push edi
|
||||
mov edi, DWORD PTR $T35206[esp+52]
|
||||
faddp ST(1), ST(0)
|
||||
mov DWORD PTR $T35027[esp+60], edi
|
||||
fld QWORD PTR [eax]
|
||||
pop edi
|
||||
fmul QWORD PTR [ecx]
|
||||
faddp ST(1), ST(0)
|
||||
fadd ST(0), ST(0)
|
||||
fstp QWORD PTR $T35206[esp+36]
|
||||
mov esi, DWORD PTR $T35206[esp+40]
|
||||
mov edx, DWORD PTR $T35206[esp+36]
|
||||
mov ebx, DWORD PTR $T35265[esp+40]
|
||||
mov DWORD PTR $T35027[esp+44], edx
|
||||
mov edx, DWORD PTR _reflection$[ebp]
|
||||
mov DWORD PTR $T35027[esp+48], esi
|
||||
fld QWORD PTR $T35027[esp+44]
|
||||
fmul QWORD PTR [ecx]
|
||||
pop esi
|
||||
mov DWORD PTR $T35027[esp+36], ebx
|
||||
pop ebx
|
||||
fsubr QWORD PTR [eax]
|
||||
fstp QWORD PTR [edx]
|
||||
fld QWORD PTR $T35027[esp+36]
|
||||
fmul QWORD PTR [ecx+8]
|
||||
fsubr QWORD PTR [eax+8]
|
||||
fstp QWORD PTR [edx+8]
|
||||
fld QWORD PTR $T35027[esp+36]
|
||||
fmul QWORD PTR [ecx+16]
|
||||
fsubr QWORD PTR [eax+16]
|
||||
fstp QWORD PTR [edx+16]
|
||||
mov esp, ebp
|
||||
pop ebp
|
||||
\endcode
|
||||
|
||||
\sa \ref regressiontest_failed
|
||||
\sa \ref install_win
|
||||
*/
|
||||
|
||||
|
||||
// Local Variables:
|
||||
// mode:c++
|
||||
// End:
|
||||
@@ -1,448 +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: dox_functions.cc,v 1.8 2003/12/19 18:01:37 opetzold Exp $
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <tvmet/config.h>
|
||||
|
||||
#include "Util.h"
|
||||
|
||||
class FunctionBase
|
||||
{
|
||||
public:
|
||||
FunctionBase() {
|
||||
m_binary_functions.push_back( BinaryFunction("atan2", "arcus tangent of two variables") );
|
||||
m_binary_functions.push_back( BinaryFunction("drem", "floating-point remainder") );
|
||||
m_binary_functions.push_back( BinaryFunction("fmod", "floating-point remainder") );
|
||||
m_binary_functions.push_back( BinaryFunction("hypot", "Euclidean distance") );
|
||||
m_binary_functions.push_back( BinaryFunction("jn", "Bessel") );
|
||||
m_binary_functions.push_back( BinaryFunction("yn", "Bessel") );
|
||||
m_binary_functions.push_back( BinaryFunction("pow", "power") );
|
||||
|
||||
m_unary_functions.push_back( UnaryFunction("abs", "absolute value") );
|
||||
m_unary_functions.push_back( UnaryFunction("cbrt", "cube root") );
|
||||
m_unary_functions.push_back( UnaryFunction("floor", "round") );
|
||||
m_unary_functions.push_back( UnaryFunction("rint", "round") );
|
||||
m_unary_functions.push_back( UnaryFunction("sin", "sin") );
|
||||
m_unary_functions.push_back( UnaryFunction("sinh", "sinh") );
|
||||
m_unary_functions.push_back( UnaryFunction("cos", "cos") );
|
||||
m_unary_functions.push_back( UnaryFunction("cosh", "cosh") );
|
||||
m_unary_functions.push_back( UnaryFunction("asin", "asin") );
|
||||
m_unary_functions.push_back( UnaryFunction("acos", "acos") );
|
||||
m_unary_functions.push_back( UnaryFunction("atan", "atan") );
|
||||
m_unary_functions.push_back( UnaryFunction("exp", "exponential") );
|
||||
m_unary_functions.push_back( UnaryFunction("log", "logarithmic") );
|
||||
m_unary_functions.push_back( UnaryFunction("log10", "logarithmic") );
|
||||
m_unary_functions.push_back( UnaryFunction("sqrt", "sqrt") );
|
||||
#ifdef TVMET_HAVE_IEEE_MATH
|
||||
m_unary_functions.push_back( UnaryFunction("asinh", "IEEE Math asinh") );
|
||||
m_unary_functions.push_back( UnaryFunction("acosh", "IEEE Math acosh") );
|
||||
m_unary_functions.push_back( UnaryFunction("atanh", "IEEE Math atanh") );
|
||||
m_unary_functions.push_back( UnaryFunction("expm1", "IEEE Math expm1") );
|
||||
m_unary_functions.push_back( UnaryFunction("log1p", "IEEE Math log1p") );
|
||||
m_unary_functions.push_back( UnaryFunction("erf", "IEEE Math erf") );
|
||||
m_unary_functions.push_back( UnaryFunction("erfc", "IEEE Math erfc") );
|
||||
m_unary_functions.push_back( UnaryFunction("isnan", "IEEE Math isnan. "
|
||||
"Return nonzero value if X is a NaN.") );
|
||||
m_unary_functions.push_back( UnaryFunction("isinf", "IEEE Math isinf. "
|
||||
"Return nonzero value if X is positive or negative infinity.") );
|
||||
m_unary_functions.push_back( UnaryFunction("isfinite", "fIEEE Math isfinite. "
|
||||
"Return nonzero value if X is not +-Inf or NaN.") );
|
||||
m_unary_functions.push_back( UnaryFunction("j0", "IEEE Math Bessel") );
|
||||
m_unary_functions.push_back( UnaryFunction("j1", "IEEE Math Bessel") );
|
||||
m_unary_functions.push_back( UnaryFunction("y0", "IEEE Math Bessel") );
|
||||
m_unary_functions.push_back( UnaryFunction("y1", "IEEE Math Bessel") );
|
||||
m_unary_functions.push_back( UnaryFunction("lgamma", "IEEE Math lgamma") );
|
||||
#endif
|
||||
}
|
||||
|
||||
virtual ~FunctionBase() { }
|
||||
|
||||
public:
|
||||
template<class Stream>
|
||||
Stream& header(Stream& os) const {
|
||||
m_type.header(os);
|
||||
return os;
|
||||
}
|
||||
|
||||
template<class Stream>
|
||||
Stream& footer(Stream& os) const {
|
||||
m_type.footer(os);
|
||||
return os;
|
||||
}
|
||||
|
||||
template<class Stream>
|
||||
Stream& binary(Stream& os) const {
|
||||
return os;
|
||||
}
|
||||
|
||||
template<class Stream>
|
||||
Stream& unary(Stream& os) const {
|
||||
return os;
|
||||
}
|
||||
|
||||
public:
|
||||
typedef std::vector< BinaryFunction >::const_iterator bfun_iterator;
|
||||
typedef std::vector< UnaryFunction >::const_iterator ufun_iterator;
|
||||
|
||||
public:
|
||||
virtual const std::vector< BinaryFunction >& bfun() const { return m_binary_functions; }
|
||||
virtual const std::vector< UnaryFunction >& ufun() const { return m_unary_functions; }
|
||||
|
||||
protected:
|
||||
std::vector< BinaryFunction > m_binary_functions;
|
||||
std::vector< UnaryFunction > m_unary_functions;
|
||||
Type m_type;
|
||||
};
|
||||
|
||||
|
||||
|
||||
class XprFunctions : public FunctionBase
|
||||
{
|
||||
public:
|
||||
XprFunctions() { }
|
||||
|
||||
public:
|
||||
template<class Stream>
|
||||
Stream& operator()(Stream& os) const {
|
||||
header(os);
|
||||
|
||||
binary(os);
|
||||
binary2(os);
|
||||
unary(os);
|
||||
|
||||
footer(os);
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
public:
|
||||
template<class Stream>
|
||||
Stream& header(Stream& os) const {
|
||||
FunctionBase::header(os);
|
||||
os << "//\n"
|
||||
<< "// XprFunctions.h\n"
|
||||
<< "//\n\n";
|
||||
return os;
|
||||
}
|
||||
|
||||
// binary functions
|
||||
template<class Stream>
|
||||
Stream& binary(Stream& os) const {
|
||||
FunctionBase::binary(os);
|
||||
|
||||
for(bfun_iterator fun = bfun().begin(); fun != bfun().end(); ++fun) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn " << fun->name() << "(const XprVector<E1, Sz>& lhs, const XprVector<E2, Sz>& rhs)\n"
|
||||
<< " * \\brief " << fun->description() << " function for two XprVector.\n"
|
||||
<< " * \\ingroup " << fun->group() << "\n"
|
||||
<< " */\n\n";
|
||||
|
||||
os << "/**\n"
|
||||
<< " * \\fn " << fun->name() << "(const XprMatrix<E1, Rows, Cols>& lhs, const XprMatrix<E2, Rows, Cols>& rhs)\n"
|
||||
<< " * \\brief " << fun->description() << " function for two XprMatrix.\n"
|
||||
<< " * \\ingroup " << fun->group() << "\n"
|
||||
<< " */\n\n";
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
// binary functions with pod and std::complex<>
|
||||
template<class Stream>
|
||||
Stream& binary2(Stream& os) const {
|
||||
for(Type::const_iterator tp = m_type.begin(); tp != m_type.end(); ++tp) {
|
||||
for(bfun_iterator fun = bfun().begin(); fun != bfun().end(); ++fun) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn " << fun->name() << "(const XprVector<E, Sz>& lhs, " << tp->name() << " rhs)\n"
|
||||
<< " * \\brief " << fun->description() << " function between XprVector and " << tp->description() << ".\n"
|
||||
<< " * \\ingroup " << fun->group() << "\n"
|
||||
<< " */\n\n";
|
||||
|
||||
// os << "/**\n"
|
||||
// << " * \\fn " << fun->name() << "(" << tp->name() << " lhs, const XprVector<E, Sz>& rhs)\n"
|
||||
// << " * \\brief " << fun->description() << " function between " << tp->description() << " and XprVector.\n"
|
||||
// << " * \\ingroup " << fun->group() << "\n"
|
||||
// << " */\n\n";
|
||||
|
||||
os << "/**\n"
|
||||
<< " * \\fn " << fun->name() << "(const XprMatrix<E, Rows, Cols>& lhs, " << tp->name() << " rhs)\n"
|
||||
<< " * \\brief " << fun->description() << " function between XprMatrix and " << tp->description() << ".\n"
|
||||
<< " * \\ingroup " << fun->group() << "\n"
|
||||
<< " */\n\n";
|
||||
|
||||
// os << "/**\n"
|
||||
// << " * \\fn " << fun->name() << "(" << tp->name() << " lhs, const XprMatrix<E, Rows, Cols>& rhs)\n"
|
||||
// << " * \\brief " << fun->description() << " function between " << tp->description() << " and XprMatrix.\n"
|
||||
// << " * \\ingroup " << fun->group() << "\n"
|
||||
// << " */\n\n";
|
||||
}
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
// unary functions
|
||||
template<class Stream>
|
||||
Stream& unary(Stream& os) const {
|
||||
FunctionBase::unary(os);
|
||||
|
||||
for(ufun_iterator fun = ufun().begin(); fun != ufun().end(); ++fun) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn " << fun->name() << "(const XprVector<E, Sz>& rhs)\n"
|
||||
<< " * \\brief " << fun->description() << " function for XprVector\n"
|
||||
<< " * \\ingroup " << fun->group() << "\n"
|
||||
<< " */\n\n";
|
||||
|
||||
os << "/**\n"
|
||||
<< " * \\fn " << fun->name() << "(const XprMatrix<E, Rows, Cols>& rhs)\n"
|
||||
<< " * \\brief " << fun->description() << " function for XprMatrix.\n"
|
||||
<< " * \\ingroup " << fun->group() << "\n"
|
||||
<< " */\n\n";
|
||||
}
|
||||
return os;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
class VectorFunctions : public FunctionBase
|
||||
{
|
||||
public:
|
||||
VectorFunctions() { }
|
||||
|
||||
public:
|
||||
template<class Stream>
|
||||
Stream& operator()(Stream& os) const {
|
||||
header(os);
|
||||
|
||||
binary(os);
|
||||
binary2(os);
|
||||
binary3(os);
|
||||
unary(os);
|
||||
|
||||
footer(os);
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
public:
|
||||
template<class Stream>
|
||||
Stream& header(Stream& os) const {
|
||||
FunctionBase::header(os);
|
||||
|
||||
os << "//\n"
|
||||
<< "// VectorFunctions.h\n"
|
||||
<< "//\n\n";
|
||||
return os;
|
||||
}
|
||||
|
||||
// binary functions
|
||||
template<class Stream>
|
||||
Stream& binary(Stream& os) const {
|
||||
FunctionBase::binary(os);
|
||||
|
||||
for(bfun_iterator fun = bfun().begin(); fun != bfun().end(); ++fun) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn " << fun->name() << "(const Vector<T1, Sz>& lhs, const Vector<T2, Sz>& rhs)\n"
|
||||
<< " * \\brief " << fun->description() << " function for two Vector.\n"
|
||||
<< " * \\ingroup " << fun->group() << "\n"
|
||||
<< " */\n\n";
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
// binary functions with pod and std::complex<>
|
||||
template<class Stream>
|
||||
Stream& binary2(Stream& os) const {
|
||||
for(Type::const_iterator tp = m_type.begin(); tp != m_type.end(); ++tp) {
|
||||
for(bfun_iterator fun = bfun().begin(); fun != bfun().end(); ++fun) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn " << fun->name() << "(const Vector<T, Sz>& lhs, " << tp->name() << " rhs)\n"
|
||||
<< " * \\brief " << fun->description() << " function on Vector and " << tp->description() << ".\n"
|
||||
<< " * \\ingroup " << fun->group() << "\n"
|
||||
<< " */\n\n";
|
||||
|
||||
// os << "/**\n"
|
||||
// << " * \\fn " << fun->name() << "(" << tp->name() << " lhs, const Vector<T, Sz>& rhs)\n"
|
||||
// << " * \\brief " << fun->description() << " function on " << tp->description() << " and Vector.\n"
|
||||
// << " * \\ingroup " << fun->group() << "\n"
|
||||
// << " */\n\n";
|
||||
}
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
// binary functions with expressions
|
||||
template<class Stream>
|
||||
Stream& binary3(Stream& os) const {
|
||||
for(bfun_iterator fun = bfun().begin(); fun != bfun().end(); ++fun) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn " << fun->name() << "(const XprVector<E, Sz>& lhs, const Vector<T, Sz>& rhs)\n"
|
||||
<< " * \\brief " << fun->description() << " function on XprVector and Vector.\n"
|
||||
<< " * \\ingroup " << fun->group() << "\n"
|
||||
<< " */\n\n";
|
||||
|
||||
os << "/**\n"
|
||||
<< " * \\fn " << fun->name() << "(const Vector<T, Sz>& lhs, const XprVector<E, Sz>& rhs)\n"
|
||||
<< " * \\brief " << fun->description() << " function on Vector and XprVector.\n"
|
||||
<< " * \\ingroup " << fun->group() << "\n"
|
||||
<< " */\n\n";
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
// unary functions
|
||||
template<class Stream>
|
||||
Stream& unary(Stream& os) const {
|
||||
FunctionBase::unary(os);
|
||||
|
||||
for(ufun_iterator fun = ufun().begin(); fun != ufun().end(); ++fun) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn " << fun->name() << "(const Vector<T, Sz>& rhs)\n"
|
||||
<< " * \\brief " << fun->description() << " function on Vector.\n"
|
||||
<< " * \\ingroup " << fun->group() << "\n"
|
||||
<< " */\n\n";
|
||||
}
|
||||
return os;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
class MatrixFunctions : public FunctionBase
|
||||
{
|
||||
public:
|
||||
MatrixFunctions() { }
|
||||
|
||||
public:
|
||||
template<class Stream>
|
||||
Stream& operator()(Stream& os) const {
|
||||
header(os);
|
||||
|
||||
binary(os);
|
||||
binary2(os);
|
||||
binary3(os);
|
||||
unary(os);
|
||||
|
||||
footer(os);
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
public:
|
||||
template<class Stream>
|
||||
Stream& header(Stream& os) const {
|
||||
FunctionBase::header(os);
|
||||
|
||||
os << "//\n"
|
||||
<< "// MatrixFunctions.h\n"
|
||||
<< "//\n\n";
|
||||
return os;
|
||||
}
|
||||
|
||||
// binary functions
|
||||
template<class Stream>
|
||||
Stream& binary(Stream& os) const {
|
||||
FunctionBase::binary(os);
|
||||
|
||||
for(bfun_iterator fun = bfun().begin(); fun != bfun().end(); ++fun) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn " << fun->name() << "(const Matrix<T1, Rows, Cols>& lhs, const Matrix<T2, Cols, Cols>& rhs)\n"
|
||||
<< " * \\brief " << fun->description() << " function for two Matrizes.\n"
|
||||
<< " * \\ingroup " << fun->group() << "\n"
|
||||
<< " */\n\n";
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
// binary functions with pod and std::complex<>
|
||||
template<class Stream>
|
||||
Stream& binary2(Stream& os) const {
|
||||
for(Type::const_iterator tp = m_type.begin(); tp != m_type.end(); ++tp) {
|
||||
for(bfun_iterator fun = bfun().begin(); fun != bfun().end(); ++fun) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn " << fun->name() << "(const Matrix<T, Rows, Cols>& lhs, " << tp->name() << " rhs)\n"
|
||||
<< " * \\brief " << fun->description() << " function on Matrix and " << tp->description() << ".\n"
|
||||
<< " * \\ingroup " << fun->group() << "\n"
|
||||
<< " */\n\n";
|
||||
|
||||
// os << "/**\n"
|
||||
// << " * \\fn " << fun->name() << "(" << tp->name() << " lhs, const Matrix<T, Rows, Cols>& rhs)\n"
|
||||
// << " * \\brief " << fun->description() << " function on " << tp->description() << " and Matrix.\n"
|
||||
// << " * \\ingroup " << fun->group() << "\n"
|
||||
// << " */\n\n";
|
||||
}
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
// binary functions with expressions
|
||||
template<class Stream>
|
||||
Stream& binary3(Stream& os) const {
|
||||
for(bfun_iterator fun = bfun().begin(); fun != bfun().end(); ++fun) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn " << fun->name() << "(const XprMatrix<E, Rows, Cols>& lhs, const Matrix<T, Rows, Cols>& rhs)\n"
|
||||
<< " * \\brief " << fun->description() << " function on XprMatrix and Matrix.\n"
|
||||
<< " * \\ingroup " << fun->group() << "\n"
|
||||
<< " */\n\n";
|
||||
|
||||
os << "/**\n"
|
||||
<< " * \\fn " << fun->name() << "(const Matrix<T, Rows, Cols>& lhs, const XprMatrix<E, Rows, Cols>& rhs)\n"
|
||||
<< " * \\brief " << fun->description() << " function on Matrix and XprMatrix.\n"
|
||||
<< " * \\ingroup " << fun->group() << "\n"
|
||||
<< " */\n\n";
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
// unary functions
|
||||
template<class Stream>
|
||||
Stream& unary(Stream& os) const {
|
||||
FunctionBase::unary(os);
|
||||
|
||||
for(ufun_iterator fun = ufun().begin(); fun != ufun().end(); ++fun) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn " << fun->name() << "(const Matrix<T, Rows, Cols>& rhs)\n"
|
||||
<< " * \\brief " << fun->description() << " function on Matrix.\n"
|
||||
<< " * \\ingroup " << fun->group() << "\n"
|
||||
<< " */\n\n";
|
||||
}
|
||||
return os;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
XprFunctions xpr_fun;
|
||||
VectorFunctions vec_fun;
|
||||
MatrixFunctions mtx_fun;
|
||||
|
||||
Function::doxy_groups(std::cout);
|
||||
|
||||
xpr_fun(std::cout);
|
||||
vec_fun(std::cout);
|
||||
mtx_fun(std::cout);
|
||||
}
|
||||
@@ -1,425 +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: dox_operators.cc,v 1.6 2003/11/30 08:26:25 opetzold Exp $
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#include <tvmet/config.h>
|
||||
|
||||
#include "Util.h"
|
||||
|
||||
class OperatorBase
|
||||
{
|
||||
public:
|
||||
OperatorBase() {
|
||||
m_binary_operators.push_back( BinaryOperator("+", "Addition") );
|
||||
m_binary_operators.push_back( BinaryOperator("-", "Subtraction") );
|
||||
m_binary_operators.push_back( BinaryOperator("*", "Multliply") );
|
||||
m_binary_operators.push_back( BinaryOperator("/", "Division") );
|
||||
m_binary_operators.push_back( BinaryOperator("%", "Modulo", true) );
|
||||
m_binary_operators.push_back( BinaryOperator("^", "Exclusive OR", true) );
|
||||
m_binary_operators.push_back( BinaryOperator("&", "AND", true) );
|
||||
m_binary_operators.push_back( BinaryOperator("|", "OR", true) );
|
||||
m_binary_operators.push_back( BinaryOperator("<<", "Left Shift", true) );
|
||||
m_binary_operators.push_back( BinaryOperator(">>", "Right Shift", true) );
|
||||
m_binary_operators.push_back( BinaryOperator(">", "Bigger") );
|
||||
m_binary_operators.push_back( BinaryOperator("<", "Lesser") );
|
||||
m_binary_operators.push_back( BinaryOperator(">=", "Bigger Equal") );
|
||||
m_binary_operators.push_back( BinaryOperator("<=", "Less Equal") );
|
||||
m_binary_operators.push_back( BinaryOperator("==", "Equal") );
|
||||
m_binary_operators.push_back( BinaryOperator("!=", "Not Equal") );
|
||||
m_binary_operators.push_back( BinaryOperator("&&", "Logical AND", true) );
|
||||
m_binary_operators.push_back( BinaryOperator("||", "Logical OR", true) );
|
||||
|
||||
m_unary_operators.push_back( UnaryOperator("!", "Logical Not", true) );
|
||||
m_unary_operators.push_back( UnaryOperator("~", "Bitwise Not", true) );
|
||||
m_unary_operators.push_back( UnaryOperator("-", "Negate") );
|
||||
}
|
||||
|
||||
virtual ~OperatorBase() { }
|
||||
|
||||
public:
|
||||
template<class Stream>
|
||||
Stream& header(Stream& os) const {
|
||||
m_type.header(os);
|
||||
return os;
|
||||
}
|
||||
|
||||
template<class Stream>
|
||||
Stream& footer(Stream& os) const {
|
||||
m_type.footer(os);
|
||||
return os;
|
||||
}
|
||||
|
||||
template<class Stream>
|
||||
Stream& binary(Stream& os) const {
|
||||
return os;
|
||||
}
|
||||
|
||||
template<class Stream>
|
||||
Stream& unary(Stream& os) const {
|
||||
return os;
|
||||
}
|
||||
|
||||
public:
|
||||
typedef std::vector< BinaryOperator >::const_iterator bop_iterator;
|
||||
typedef std::vector< UnaryOperator >::const_iterator uop_iterator;
|
||||
|
||||
public:
|
||||
virtual const std::vector< BinaryOperator >& bop() const { return m_binary_operators; }
|
||||
virtual const std::vector< UnaryOperator >& uop() const { return m_unary_operators; }
|
||||
|
||||
protected:
|
||||
std::vector< BinaryOperator > m_binary_operators;
|
||||
std::vector< UnaryOperator > m_unary_operators;
|
||||
Type m_type;
|
||||
};
|
||||
|
||||
|
||||
class XprOperators : public OperatorBase
|
||||
{
|
||||
public:
|
||||
XprOperators() { }
|
||||
|
||||
public:
|
||||
template<class Stream>
|
||||
Stream& operator()(Stream& os) const {
|
||||
header(os);
|
||||
|
||||
binary(os);
|
||||
binary2(os);
|
||||
unary(os);
|
||||
|
||||
footer(os);
|
||||
return os;
|
||||
}
|
||||
|
||||
public:
|
||||
template<class Stream>
|
||||
Stream& header(Stream& os) const {
|
||||
OperatorBase::header(os);
|
||||
|
||||
os << "//\n"
|
||||
<< "// XprOperators.h\n"
|
||||
<< "//\n\n";
|
||||
return os;
|
||||
}
|
||||
|
||||
// global binary math, bitops and logical operators
|
||||
template<class Stream>
|
||||
Stream& binary(Stream& os) const {
|
||||
OperatorBase::binary(os);
|
||||
|
||||
for(bop_iterator op = bop().begin(); op != bop().end(); ++op) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(const XprVector<E1, Sz>& lhs, const XprVector<E2, Sz>& rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator for two XprVector\n"
|
||||
<< " * \\ingroup " << op->group() << "\n"
|
||||
<< " */\n\n";
|
||||
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(const XprMatrix<E1, Rows1, Cols1>& lhs, const XprMatrix<E2, Cols1, Cols2>& rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator for two XprMatrix.\n"
|
||||
<< " * \\ingroup " << op->group() << "\n"
|
||||
<< " */\n\n";
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
// global binary math, bitops and logical operators with pod and std::complex<>
|
||||
template<class Stream>
|
||||
Stream& binary2(Stream& os) const {
|
||||
for(Type::const_iterator tp = m_type.begin(); tp != m_type.end(); ++tp) {
|
||||
for(bop_iterator op = bop().begin(); op != bop().end(); ++op) {
|
||||
if(tp->is_int() && op->int_only()) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(const XprVector<E, Sz>& lhs, " << tp->name() << " rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator between XprVector and " << tp->description() << ".\n"
|
||||
<< " * \\ingroup " << op->group() << "\n"
|
||||
<< " */\n\n";
|
||||
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(" << tp->name() << " lhs, const XprVector<E, Sz>& rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator between " << tp->description() << " and XprVector.\n"
|
||||
<< " * \\ingroup " << op->group() << "\n"
|
||||
<< " */\n\n";
|
||||
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(const XprMatrix<E, Rows, Cols>& lhs, " << tp->name() << " rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator between XprMatrix and " << tp->description() << ".\n"
|
||||
<< " * \\ingroup " << op->group() << "\n"
|
||||
<< " */\n\n";
|
||||
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(" << tp->name() << " lhs, const XprMatrix<E, Rows, Cols>& rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator between " << tp->description() << " and XprMatrix.\n"
|
||||
<< " * \\ingroup " << op->group() << "\n"
|
||||
<< " */\n\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
// global unary operators
|
||||
template<class Stream>
|
||||
Stream& unary(Stream& os) const {
|
||||
OperatorBase::unary(os);
|
||||
|
||||
for(uop_iterator op = uop().begin(); op != uop().end(); ++op) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(const XprVector<E, Sz>& rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator for XprVector\n"
|
||||
<< " * \\ingroup " << op->group() << "\n"
|
||||
<< " */\n\n";
|
||||
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(const XprMatrix<E, Rows, Cols>& rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator for XprMatrix.\n"
|
||||
<< " * \\ingroup " << op->group() << "\n"
|
||||
<< " */\n\n";
|
||||
}
|
||||
return os;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class VectorOperators : public OperatorBase
|
||||
{
|
||||
public:
|
||||
VectorOperators() { }
|
||||
|
||||
public:
|
||||
template<class Stream>
|
||||
Stream& operator()(Stream& os) const {
|
||||
header(os);
|
||||
|
||||
binary(os);
|
||||
binary2(os);
|
||||
binary3(os);
|
||||
unary(os);
|
||||
|
||||
footer(os);
|
||||
}
|
||||
|
||||
public:
|
||||
template<class Stream>
|
||||
Stream& header(Stream& os) const {
|
||||
OperatorBase::header(os);
|
||||
|
||||
os << "//\n"
|
||||
<< "// VectorOperators.h\n"
|
||||
<< "//\n\n";
|
||||
return os;
|
||||
}
|
||||
|
||||
// global binary math, bitops and logical operators
|
||||
template<class Stream>
|
||||
Stream& binary(Stream& os) const {
|
||||
OperatorBase::binary(os);
|
||||
|
||||
for(bop_iterator op = bop().begin(); op != bop().end(); ++op) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(const Vector<T1, Sz>& lhs, const Vector<T2, Sz>& rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator for two Vector\n"
|
||||
<< " * \\ingroup " << op->group() << "\n"
|
||||
<< " */\n\n";
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
// global binary math, bitops and logical operators with pod and std::complex<>
|
||||
template<class Stream>
|
||||
Stream& binary2(Stream& os) const {
|
||||
for(Type::const_iterator tp = m_type.begin(); tp != m_type.end(); ++tp) {
|
||||
for(bop_iterator op = bop().begin(); op != bop().end(); ++op) {
|
||||
if(tp->is_int() && op->int_only()) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(const Vector<T, Sz>& lhs, " << tp->name() << " rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator between Vector and " << tp->description() << ".\n"
|
||||
<< " * \\ingroup _operators\n"
|
||||
<< " * \\ingroup " << op->group() << "\n";
|
||||
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(" << tp->name() << " lhs, const Vector<T, Sz>& rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator between " << tp->description() << " and Vector.\n"
|
||||
<< " * \\ingroup " << op->group() << "\n"
|
||||
<< " */\n\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
// global binary operations with expressions
|
||||
template<class Stream>
|
||||
Stream& binary3(Stream& os) const {
|
||||
for(bop_iterator op = bop().begin(); op != bop().end(); ++op) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(const XprVector<E, Sz>& lhs, const Vector<T, Sz>& rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator between XprVector and Vector\n"
|
||||
<< " * \\ingroup " << op->group() << "\n"
|
||||
<< " */\n\n";
|
||||
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(const Vector<T, Sz>& lhs, const XprVector<E, Sz>& rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator between Vector and XprVector\n"
|
||||
<< " * \\ingroup " << op->group() << "\n"
|
||||
<< " */\n\n";
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
// global unary operators
|
||||
template<class Stream>
|
||||
Stream& unary(Stream& os) const {
|
||||
OperatorBase::unary(os);
|
||||
|
||||
for(uop_iterator op = uop().begin(); op != uop().end(); ++op) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(const Vector<T, Sz>& rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator for Vector\n"
|
||||
<< " * \\ingroup " << op->group() << "\n"
|
||||
<< " */\n\n";
|
||||
}
|
||||
return os;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
class MatrixOperators : public OperatorBase
|
||||
{
|
||||
public:
|
||||
MatrixOperators() { }
|
||||
|
||||
public:
|
||||
template<class Stream>
|
||||
Stream& operator()(Stream& os) const {
|
||||
header(os);
|
||||
|
||||
binary(os);
|
||||
binary2(os);
|
||||
binary3(os);
|
||||
unary(os);
|
||||
|
||||
footer(os);
|
||||
}
|
||||
|
||||
public:
|
||||
template<class Stream>
|
||||
Stream& header(Stream& os) const {
|
||||
OperatorBase::header(os);
|
||||
|
||||
os << "//\n"
|
||||
<< "// MatrixOperators.h\n"
|
||||
<< "//\n\n";
|
||||
return os;
|
||||
}
|
||||
|
||||
// global binary math, bitops and logical operators
|
||||
template<class Stream>
|
||||
Stream& binary(Stream& os) const {
|
||||
OperatorBase::binary(os);
|
||||
|
||||
for(bop_iterator op = bop().begin(); op != bop().end(); ++op) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(const Matrix<T1, Rows1, Cols1>& lhs, const Matrix<T2, Cols1, Cols2>& rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator for two Matrizes\n"
|
||||
<< " * \\ingroup " << op->group() << "\n"
|
||||
<< " */\n\n";
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
// global binary math, bitops and logical operators with pod and std::complex<>
|
||||
template<class Stream>
|
||||
Stream& binary2(Stream& os) const {
|
||||
for(Type::const_iterator tp = m_type.begin(); tp != m_type.end(); ++tp) {
|
||||
for(bop_iterator op = bop().begin(); op != bop().end(); ++op) {
|
||||
if(tp->is_int() && op->int_only()) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(const Matrix<T, Rows, Cols>& lhs, " << tp->name() << " rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator between Vector and " << tp->description() << ".\n"
|
||||
<< " * \\ingroup " << op->group() << "\n"
|
||||
<< " */\n\n";
|
||||
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(" << tp->name() << " lhs, const Matrix<T, Rows, Cols>& rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator between " << tp->description() << " and Vector.\n"
|
||||
<< " * \\ingroup " << op->group() << "\n"
|
||||
<< " */\n\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
// global binary operations with expressions
|
||||
template<class Stream>
|
||||
Stream& binary3(Stream& os) const {
|
||||
for(bop_iterator op = bop().begin(); op != bop().end(); ++op) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(const XprMatrix<E, Rows, Cols>& lhs, const Matrix<T, Rows, Cols>& rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator between XprMatrix and Matrix\n"
|
||||
<< " * \\ingroup " << op->group() << "\n"
|
||||
<< " */\n\n";
|
||||
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(const Matrix<T, Rows, Cols>& lhs, const XprMatrix<E, Rows, Cols>& rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator between Matrix and XprMatrix\n"
|
||||
<< " * \\ingroup " << op->group() << "\n"
|
||||
<< " */\n\n";
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
// global unary operators
|
||||
template<class Stream>
|
||||
Stream& unary(Stream& os) const {
|
||||
OperatorBase::unary(os);
|
||||
|
||||
for(uop_iterator op = uop().begin(); op != uop().end(); ++op) {
|
||||
os << "/**\n"
|
||||
<< " * \\fn operator" << op->symbol() << "(const Matrix<T, Rows, Cols>& rhs)\n"
|
||||
<< " * \\brief " << op->description() << " operator for Matrix\n"
|
||||
<< " * \\ingroup " << op->group() << "\n"
|
||||
<< " */\n\n";
|
||||
}
|
||||
return os;
|
||||
}
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
XprOperators xpr_op;
|
||||
VectorOperators vec_op;
|
||||
MatrixOperators mtx_op;
|
||||
|
||||
Operator::doxy_groups(std::cout);
|
||||
|
||||
xpr_op(std::cout);
|
||||
//vec_op(std::cout);
|
||||
//mtx_op(std::cout);
|
||||
}
|
||||
@@ -1,295 +0,0 @@
|
||||
/**
|
||||
\page faq FAQ
|
||||
|
||||
<p>Contents:</p>
|
||||
-# \ref license_tvmet
|
||||
-# \ref commercial_tvmet
|
||||
-# \ref debug
|
||||
-# \ref optimize
|
||||
-# \ref ambiguous_overload
|
||||
-# \ref conversion_non_scalar
|
||||
-# \ref could_not_convert
|
||||
-# \ref assign_op
|
||||
-# \ref comma_initializer
|
||||
-# \ref no_match_operator
|
||||
-# \ref dimension_error
|
||||
-# \ref rtlx_kernel_crash
|
||||
-# \ref regressiontest_failed
|
||||
|
||||
Certain items on this page are also covered by the \ref usage and \ref notes
|
||||
pages!
|
||||
|
||||
|
||||
|
||||
\section license_tvmet How is tvmet licensed?
|
||||
|
||||
tvmet comes with completely free source code. tvmet is available under the
|
||||
terms of the GNU Lesser General Public License (LGPL).
|
||||
|
||||
I have amended the LGPL to explicitly allow statically linking tvmet (or any
|
||||
modified version of tvmet) to your software. The LGPL is not clear on this
|
||||
and I definitely want to allow it.
|
||||
|
||||
\sa \ref license
|
||||
|
||||
|
||||
|
||||
|
||||
\section commercial_tvmet Can I use it in commercial software products?
|
||||
|
||||
Yes, you can. The LGPL allows you to do this, and you do not need to release
|
||||
the source code to your software. You do need to release the source code for
|
||||
any modifications you make to tvmet itself. (We would hope you would send
|
||||
any improvements like these back to us anyways.)
|
||||
|
||||
|
||||
|
||||
|
||||
\section debug Debugging the code
|
||||
|
||||
Not all faults can be caught at compile time. Therefore, there is a need
|
||||
for runtime debugging by defining <code>TVMET_DEBUG</code> (e.g. index
|
||||
operators of <code>Vector::operator(i)</code> and
|
||||
<code>Matrix::operator(i,j)</code>). On defined TVMET_DEBUG a bounds checking
|
||||
is involved. Runtime errors are handled throwing an assertion failure using
|
||||
std::assert(). <code>TVMET_DEBUG</code> is <b>not</b> enabled by defining
|
||||
<code>DEBUG</code>. This behavior differs from release less than 0.6.0
|
||||
|
||||
If you don't get the expected result on certain operations you can try the
|
||||
\ref expr_print feature to check that the expression is being evaluated as
|
||||
you expect.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section optimize Optimizing the code
|
||||
|
||||
Starting after tvmet 1.5.0 there is a new define <code>TVMET_OPTIMIZE</code>.
|
||||
|
||||
If this is defined tvmet uses some compiler specific keywords.
|
||||
Mainly, this declares the functions using gcc's
|
||||
<tt>__attribute__((always_inline))</tt>. This allows the
|
||||
compiler to produce high efficient code even on less
|
||||
optimization levels, like gcc's -O2 or even -O!
|
||||
This is known to work with gcc v3.3.3 (and higher).
|
||||
Using icc's v8 gnuc compatibility mode this may work, I've read
|
||||
that it's using as an hint, this means you can have static inline
|
||||
functions inside left so you can't get the full power of this feature
|
||||
for circumstances.
|
||||
|
||||
|
||||
|
||||
|
||||
\section ambiguous_overload ambiguous overload for ... Compiler Error
|
||||
|
||||
When using gcc-2.96 you can get a compiler error like:
|
||||
|
||||
\code
|
||||
ambiguous overload for ...
|
||||
/usr/include/g++-3/stl_relops.h:42: candidates are: bool operator>
|
||||
...
|
||||
\endcode
|
||||
|
||||
I haven't any solution for this--even if I don't use it in the tvmet library.
|
||||
A simple define __SGI_STL_INTERNAL_RELOPS in the config header doesn't solve
|
||||
the problem. The easiest way (brute force method) is to comment out all
|
||||
operators in stl_reops.h. (The better way is to use the gcc-3.0.x and later,
|
||||
see \ref compiler.)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section conversion_non_scalar conversion from ... to non-scalar type ... Compiler Error
|
||||
|
||||
You get a compiler error like:
|
||||
|
||||
\code
|
||||
conversion from `tvmet::XprVector< ... >, Sz>' to non-scalar type
|
||||
`tvmet::Vector<T, Sz>' requested
|
||||
\endcode
|
||||
|
||||
Please read about \ref construct. You probably ignored or forgot the rules
|
||||
of using expression templates.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section could_not_convert could not convert `tvmet::operatorXX(...)' to `bool' ... Compiler Error
|
||||
|
||||
You get a compiler error like:
|
||||
|
||||
\code
|
||||
could not convert `tvmet::operator==( ... , ... )' to `bool'
|
||||
\endcode
|
||||
|
||||
In the example above, you did try (or hoped) to use a global operator==
|
||||
which doesn't return a bool. Please read \ref compare.
|
||||
|
||||
|
||||
|
||||
|
||||
\section assign_op no match for ?= operator
|
||||
|
||||
You get a compiler error like:
|
||||
|
||||
\code
|
||||
no match for `tvmet::Vector<...>& /= tvmet::Vector<...>&' operator
|
||||
\endcode
|
||||
|
||||
For element-wise operations, you need to use the element_wise namespace
|
||||
(found within tvmet). As the name suggests, all these operators are
|
||||
performed in an element wise fashion. (e.g. division of two vectors--not
|
||||
allowed from a mathematical perspective--element by element.) The following
|
||||
code snippet shows how to use it:
|
||||
|
||||
\code
|
||||
using namespace tvmet;
|
||||
Vector<double,3> v1, v2;
|
||||
|
||||
v1 = 1,2,3;
|
||||
v2 = v1;
|
||||
|
||||
cout << v1 << endl;
|
||||
{
|
||||
using namespace tvmet::element_wise;
|
||||
v1 /= v2;
|
||||
}
|
||||
cout << v1 << endl;
|
||||
\endcode
|
||||
|
||||
\sa \ref operators
|
||||
\sa \ref alias
|
||||
|
||||
|
||||
|
||||
|
||||
\section comma_initializer storage size of `ERROR_CommaInitializerList_is_too_long' isn't known
|
||||
|
||||
You get a compiler error like:
|
||||
|
||||
\code
|
||||
In member function `tvmet::CommaInitializer<Obj, LEN>::Initializer<T, (N + 1)> ....
|
||||
storage size of `ERROR_CommaInitializerList_is_too_long' isn't known
|
||||
\endcode
|
||||
|
||||
You have caused a forced compile time error. tvmet prevents you from
|
||||
overwriting foreign memory! In other words, your comma separated initializer
|
||||
list is too long, e.g. you wrote something like:
|
||||
|
||||
\code
|
||||
using namespace tvmet;
|
||||
Vector<double,3> v0;
|
||||
|
||||
v0 = 1,2,3,4,5,6,7,8,9;
|
||||
\endcode
|
||||
|
||||
You just tried to fill a %Vector of length 3 with 9 values, which would
|
||||
normally result in values being written off the end of the vector. tvmet
|
||||
prevents this with the compile time error you just saw.
|
||||
|
||||
|
||||
|
||||
|
||||
\section no_match_operator no match for `...' operator
|
||||
|
||||
You get a compiler error like:
|
||||
|
||||
\code
|
||||
no match for `tvmet::Matrix<T, Sz, Sz>& * tvmet::XprVector<tvmet::MatrixColVectorReference<T, Sz, Sz>, Sz>' operator
|
||||
include/tvmet/xpr/VectorOperators.h:123: candidates are:
|
||||
// a lot of candidates....
|
||||
\endcode
|
||||
|
||||
Perhaps you wrote code like:
|
||||
|
||||
\code
|
||||
Matrix<float,3,3> eigenvecs;
|
||||
Matrix<float,3,3> M;
|
||||
...
|
||||
|
||||
Vector<float,3> ev0( M * col(eigenvecs, 0) );
|
||||
\endcode
|
||||
|
||||
Using %tvmet prior to release 1.2.0 in this case: Obviously an operator
|
||||
is missing... but which one? Well, all arithmetic operators have a
|
||||
functional equivalent, in this case, prod(). Rewriting the code above
|
||||
using the function syntax will give you a more descriptive error message:
|
||||
|
||||
\code
|
||||
no matching function for call to
|
||||
`prod(tvmet::Matrix<float, 3, 3>&, tvmet::XprVector<tvmet::MatrixColVectorReference<float, 3, 3>, 3>)'
|
||||
\endcode
|
||||
|
||||
This says, I forgot to write a function with the appropriate operator.
|
||||
In this case, please give me a hint by writing a short example, used compiler
|
||||
and tvmet release.
|
||||
|
||||
\sa \ref dimension_error.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section dimension_error no match for `tvmet::Matrix<double, R, C>& * tvmet::Vector<double, Sz>&' operator
|
||||
|
||||
You get a compiler error like:
|
||||
|
||||
\code
|
||||
no match for `tvmet::Matrix<double, 4, 4>& * tvmet::Vector<double, 3>&' operator
|
||||
candidates are: T tvmet::operator*(const T&, ...) ...
|
||||
\endcode
|
||||
|
||||
This is a feature of tvmet. The compiler detects a mathematical problem:
|
||||
You tried call an operator between tvmet objects which had incompatible
|
||||
dimensions. For example, you attempted to multiply a matrix of dimension
|
||||
4x4 with a vector of size 3 - this isn't mathematically feasible.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section rtlx_kernel_crash Using with Linux Real-time Extensions crashes in kernel mode
|
||||
|
||||
Normally there should not be a problem on using tvmet inside Linux kernel
|
||||
space as a C++ kernel module. Unfortunately, code working in normal
|
||||
environment (e.g. Linux user space) crashes the Linux box by using linux
|
||||
real-time extensions, definitely on <a href=http://www.rtai.org>RTAI</a>.
|
||||
|
||||
I haven't found the reason yet, my knowledge of assembler and debugging is
|
||||
too limited.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section regressiontest_failed Failed regression tests
|
||||
|
||||
Well, this is a strange world. It can happen that some (especially the
|
||||
tan) regression test can fail. This is not a problem with the %tvmet library.
|
||||
After some hours I reduce the problem to:
|
||||
|
||||
\code
|
||||
cout << (std::tan(1.0) - std::tan(1.0)) << endl;
|
||||
\endcode
|
||||
|
||||
got <tt>6.17995e-17</tt> on my Linux Mandrake 8.2/9.1 box. It makes no
|
||||
difference if I take the tan function from namespace std or from the global
|
||||
namespace. This is especially a problem for g++ v3.2 and prior. The Intel
|
||||
compiler v7.0 isn't affected.
|
||||
|
||||
Especially on VC++ 7.1 you will get 2 failed tests for complex
|
||||
%Matrix and %Vector. The error is about <tt>8.88178e-016</tt> and
|
||||
<tt>1.77636e-015</tt>.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
// Local Variables:
|
||||
// mode:c++
|
||||
// End:
|
||||
// LocalWords: RTAI
|
||||
@@ -1,17 +0,0 @@
|
||||
<hr>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="20%" align="right" valign="center">
|
||||
Author:<br>
|
||||
<script language="JavaScript">
|
||||
var m_name="opetzold";
|
||||
var m_domain="users.sourceforge.net";
|
||||
var m_text='<a href="mailto:'+m_name+'@'+m_domain+'?subject=tvmet @VERSION@">';
|
||||
m_text+='Olaf Petzold</a>';
|
||||
document.write(m_text);
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,37 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html>
|
||||
<head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
|
||||
<title>
|
||||
Tiny Vector Matrix library using Expression Templates
|
||||
</title>
|
||||
<!-- This Tiny Vector and Matrix C++ template libary uses Meta Templates and
|
||||
Expression Templates to evaluate results at compile time - to make it fast
|
||||
for low order (tiny) systems. -->
|
||||
<META name="description" content="This Tiny Vector and Matrix C++ template
|
||||
libary uses Meta Templates and Expression Templates to evaluate results
|
||||
at compile time - to make it fast for low order (tiny) systems.">
|
||||
<META name="keywords" content="tiny, vector, matrix, fast, C++, STL, template, library,
|
||||
expression templates, meta templates, fixed size, fixed dimension,
|
||||
matrix-matrix, matrix-vector, vector-matrix, binary, unary, operations, operators,
|
||||
product, transpose, linear algebra, cross product, dot product, type promotion,
|
||||
exception, linux, kernel, embedded system, regression test, gcc, g++,
|
||||
blitz, blitz++, TinyVector, TinyMatrix, MTL, TNT,
|
||||
gnu compiler suite, portland group c++, kai c++, intel compiler, LGPL">
|
||||
<link href="tvmet.css" rel="stylesheet" type="text/css">
|
||||
</head>
|
||||
<body bgcolor="#ffffff">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="20%" align="left" valign="center">
|
||||
<a href="http://sourceforge.net/projects/tvmet">
|
||||
<img src="http://sourceforge.net/sflogo.php?group_id=39733&type=3" width="125" height="37" border="0" alt="SourceForge Logo"></a>
|
||||
</td>
|
||||
<td width="50%" align="center" valign="center">
|
||||
<b><big>T</big>iny <big>V</big>ector <big>M</big>atrix library using <big>E</big>xpression <big>T</big>emplates</b>
|
||||
</td>
|
||||
<td width="20%" align="right" valign="center">
|
||||
<a href="http://tvmet.sourceforge.net">Sourceforge Project Page</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr>
|
||||
@@ -1,140 +0,0 @@
|
||||
/*
|
||||
* $Id: intro.dox,v 1.12 2004/11/30 09:05:53 opetzold Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
\mainpage
|
||||
|
||||
\section intro_contents Contents
|
||||
- \ref introduction
|
||||
- \ref license
|
||||
- \ref news
|
||||
- \ref changelog
|
||||
- \ref benchmark
|
||||
- \ref build
|
||||
- \ref usage
|
||||
- \ref faq
|
||||
- \ref notes
|
||||
- \ref compiler
|
||||
- \ref works
|
||||
- \ref credits
|
||||
- \ref projects
|
||||
- \ref links
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
\page introduction Introduction
|
||||
|
||||
This Tiny %Vector and %Matrix template library uses
|
||||
<a href=http://extreme.indiana.edu/~tveldhui/papers/Template-Metaprograms/meta-art.html>Meta Templates</a>
|
||||
(MT) and <a href=http://extreme.indiana.edu/~tveldhui/papers/Expression-Templates/exprtmpl.html>
|
||||
Expression Templates</a> (ET) to evaluate results at compile time -- which
|
||||
makes it fast for low order (tiny) systems. "Tiny" is a subjective term,
|
||||
but typically means vectors and matrices of size ten (10) or less.
|
||||
|
||||
The technique used internally by tvmet is described by Todd Veldhuizen:
|
||||
|
||||
- <a href=http://osl.iu.edu/~tveldhui/papers/techniques/>
|
||||
Techniques for Scientific C++</a>
|
||||
- <a href=http://osl.iu.edu/~tveldhui/papers/Expression-Templates/exprtmpl.html>
|
||||
Expression Templates</a>
|
||||
- <a href=http://osl.iu.edu/~tveldhui/papers/Template-Metaprograms/meta-art.html>
|
||||
Template Metaprograms</a>
|
||||
|
||||
and is used by his <a href=http://oonumerics.org/blitz/>blitz++</a>, too.
|
||||
Therefore, the speed achieved by tvmet is similar to the speed of blitz++.
|
||||
Unfortunately, blitz++ isn't developed any more (year 2001, 2002)
|
||||
because of other interests being pursued by Todd Veldhuizen (like his Ph.D.).
|
||||
Furthermore, blitz++'s TinyVector is mainly developed for use by the blitz++
|
||||
Array class -- and not for minimalistic/tiny fast math support for which
|
||||
tvmet <b>is</b> designed. Because of this, the operators and functions are
|
||||
incomplete or not supported well. blitz::TinyMatrix supports a few lesser
|
||||
operators and functions (as with blitz::TinyVector). blitz++ doesn't conform
|
||||
to STL (e.g. Container<>::value_type isn't defined), it defines a T_numtype
|
||||
or, for blitz::TinyVector, it does have an iterator begin() - but the end()
|
||||
is missing (blitz::TinyMatrix doesn't have anything).
|
||||
|
||||
These were reasons why I developed tvmet. Still, tvmet is designed to be more
|
||||
than a mere rehashing of blitz++. The primary design goals are:
|
||||
|
||||
-# mathematical notation and correctness,
|
||||
-# high efficiency for small/tiny vector and matrices,
|
||||
-# functionality and wide range of supported operators and functions, and
|
||||
-# compatibility and portability.
|
||||
|
||||
The dimensions for vectors and matrices are statically bound at compile
|
||||
time using template arguments. The bounded dimensions feature a <b>compile
|
||||
time dimension check</b> to force adherence to proper dimensional sizes
|
||||
between operands (even in the night if you are sleepy). For example, you
|
||||
can't assign a %Vector or %Matrix with dimension = 3 to a %Vector or %Matrix
|
||||
of dimension = 4; nor can you create an expression using a binary operation
|
||||
between arguments with incompatible dimensions. This is a major difference
|
||||
between tvmet (which features this) and blitz++ (which does not prevent
|
||||
from this). Nevertheless, tvmet isn't a matlab, maple or octave for C++.
|
||||
|
||||
tvmet is a general purpose library and is not (yet) a linear algebra library.
|
||||
It does not have an interface to other numerical libraries as BLAS or LAPACK.
|
||||
<a href="http://sourceforge.net/projects/tvmet">Tiny Vector Matrix template
|
||||
library</a> offers these features:
|
||||
|
||||
-# Matrices and Vectors with fixed sizes (of course), the data is stored in
|
||||
a static array.
|
||||
-# compile time dimension check for Vectors and Matrices to preserve the
|
||||
mathematical meaning.
|
||||
-# vector, matrix, matrix-matrix and matrix-vector fast operations:
|
||||
- complete set of standard arithmetic operations for Vectors and Matrices
|
||||
(<a href=http://oonumerics.org/blitz/>blitz++</a> supports this only for
|
||||
TinyVector).
|
||||
- complete set of standard compare operations for Vectors and Matrices
|
||||
as well as ternary functions like <tt>a ? b : c</tt> (see eval for use).
|
||||
- binary and unary operations.
|
||||
- meta template use for %Matrix-Matrix-Product \f$M\,M\f$,
|
||||
%Matrix-Transpose \f$M^T\f$ and %Matrix-Vector-Product \f$M\,x\f$
|
||||
functions and operators.
|
||||
- meta template for special functions like
|
||||
\f$M^T\, x\f$, \f$M^T\,M\f$, \f$M\,M^T\f$ and \f$(M\,M)^T\f$
|
||||
functions, see \ref spec_meta_func.
|
||||
- simple %Matrix rows and column access as a %Vector.
|
||||
- chaining of matrix and vector expressions is possible and working.
|
||||
- %Vector inner and outer product (dot and cross product).
|
||||
-# special handling for the aliasing problem - see \ref alias.
|
||||
-# STL iterator interface. This opens the door to all sorts of great STL
|
||||
applications.
|
||||
-# type promotion (for handling Matrices and Vectors of differing types).
|
||||
-# works on self defined types such as the std::complex<> type.
|
||||
-# makes no use of exceptions. Therefore you can use it for embedded systems
|
||||
or in Linux kernel space.
|
||||
-# nice expression level printing for debugging purposes (print the expanded
|
||||
expression tree).
|
||||
-# good documentation with examples.
|
||||
-# regression tests for nearly all operations and functions.
|
||||
-# support for several compilers (see \ref compiler).
|
||||
-# written as a pure class and template library, no binary libraries and
|
||||
versioning are needed - designed to avoid code blot due to the use of
|
||||
templates.
|
||||
-# ISO/IEC 14882:1998 compliant.
|
||||
|
||||
Although there are many advantages and features, tvmet has some limitations.
|
||||
Due to the expression template and meta template programming, the compilation
|
||||
time increases for higher dimensional constructs. This can cause resource
|
||||
limitations, especially for memory (during compilation). On the other hand,
|
||||
the runtime performance will also decrease on higher order. Therefore only
|
||||
use tvmet only tiny (typically less than 10) sizes. (The maximum useful
|
||||
size/dimension depends on the operation, of course.) The \ref benchmark
|
||||
gives a good entry point about these problem.
|
||||
<a href=http://www.oonumerics.org/oon/#libraries>Other</a>
|
||||
general purpose libraries and linear algebra libraries will do a better job
|
||||
for larger matrix/vector problems.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
\bugs regression test TestUnFunc::Arc and TestUnFunc::Log fails due to
|
||||
precision errors.
|
||||
*/
|
||||
|
||||
// Local Variables:
|
||||
// mode:c++
|
||||
// End:
|
||||
@@ -1,677 +0,0 @@
|
||||
/*
|
||||
* $Id: license.dox,v 1.7 2004/06/08 12:11:15 opetzold Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
\page license License
|
||||
|
||||
<p>Contents:</p>
|
||||
- \ref tvmet_license
|
||||
- \ref addendum
|
||||
- \ref rationale
|
||||
|
||||
|
||||
|
||||
\section license tvmet's License
|
||||
|
||||
Copyright (C) 2001-2003 Olaf Petzold.
|
||||
|
||||
tvmet basically follows the standard GNU Lesser General Public License (LGPL).
|
||||
Because of repeated questions on this topic, it has become apparent that many
|
||||
people still had a number of uncertainties about licensing issues. Also, a
|
||||
number of stipulations in the GNU Lesser Public License statement have
|
||||
evidently been an impediment to truely wide-spread adoption of the tvmet
|
||||
Library.
|
||||
|
||||
Thus, the intent of the License Addendum has been to provide clarification
|
||||
of a number of obscure issues in the GNU Lesser General Public License, and
|
||||
to relax a few of its stipulations with an eye to solving a couple of
|
||||
practical issues.
|
||||
|
||||
Below follows the GNU Lesser Public License, followed by the tvmet Library
|
||||
License addendum.
|
||||
|
||||
Finally, detailed rationale behind the License Addendum is presented.
|
||||
|
||||
|
||||
|
||||
|
||||
\section tvmet_license The License
|
||||
<pre>
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Section 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Section 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
</pre>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section addendum Addendum to License
|
||||
|
||||
<pre>
|
||||
|
||||
ADDENDUM TO LICENSE
|
||||
February 2003
|
||||
|
||||
Copyright (C) 2003 Olaf Petzold
|
||||
|
||||
Everyone is permitted to create and distribute verbatim copies
|
||||
of this license addendum document, but changing it is not allowed.
|
||||
|
||||
|
||||
tvmet License Agreement:
|
||||
|
||||
|
||||
0. tvmet ("The Library") is licensed under GNU Lesser General Public License
|
||||
as published by the Free Software Foundation, version 2.1 of the License, or
|
||||
(at your option) any later version, with the following additional conditions.
|
||||
The following conditions take precedence over any conditions or restrictions
|
||||
stipulated by the Lesser General Public License insofar as a conflict exists.
|
||||
|
||||
1. The tvmet License Agreement ("License") covers only tvmet ("The Library").
|
||||
Other libraries which the Library may use are covered by their own respective
|
||||
licenses.
|
||||
|
||||
2. Modification of the configure scripts, makefiles, or installation tools of
|
||||
the Library to support a specific platform does not constitute creating a
|
||||
modified or derivative work based on the Library.
|
||||
|
||||
3. Statically linking of a copy of the Library against any work using the
|
||||
Library, i.e. the inclusion of (parts of) the Library into a program or
|
||||
binary, is functionally equivalent to a work using the Library by linking to
|
||||
it dynamically, and therefore does not constitute creating a modified or
|
||||
derivative work based on the Library.
|
||||
|
||||
4. Otherwise, if the work is a derivative of the Library, you may distribute
|
||||
the object code for the work under the terms of the GNU Lesser General Public
|
||||
License. Any executables containing that work also may be distributed under
|
||||
the Lesser General Public License whether or not they are linked directly
|
||||
with the Library itself.
|
||||
|
||||
5. Programs or binaries linked with the Library must be identified as such by
|
||||
including, in the Documentation or by other means (for example in the About
|
||||
Box or Online Help), the following statement:
|
||||
|
||||
"This software uses tvmet (http://tvmet.sourceforge.net)."
|
||||
|
||||
|
||||
|
||||
|
||||
END OF ADDENDUM
|
||||
</pre>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section rationale Rationale
|
||||
|
||||
We now launch into a point by point discussion of the License Addendum:
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
Point 0 says that whereever LGPL and tvmet License Addendum disagree, the tvmet
|
||||
License Addendum holds. In points not covered in the tvmet License Addendum,
|
||||
LGPL shall hold.
|
||||
</li>
|
||||
<li>
|
||||
Point 1 says we can not make any statements about anyone else's code; if your
|
||||
application must use other libraries (jpeg, png, tiff, glibc, and so on), then
|
||||
you must observe the licenses of these other libraries.
|
||||
</li>
|
||||
<li>
|
||||
Point 2 clarifies that when we're talking about derived works, we're not talking
|
||||
about making some minor changes to Makefiles or configuration scripts. However,
|
||||
it would still be nice to communicate them with the tvmet community so as to be
|
||||
able to support new platforms.
|
||||
</li>
|
||||
<li>
|
||||
Point 3 addresses the practical problem of linking tvmet statically into an
|
||||
application program or combined work. LGPL insists that the recipient of a
|
||||
distribution of a combined work i.e. a program linked with the Library, be
|
||||
allowed to relink; linking a program dynamically is usually the easiest way to
|
||||
comply with this stipulation. However, there are sometimes practical or
|
||||
logistical problems which make it difficult to comply with this requirement. We
|
||||
have taken the position that static linking is functionally equivalent to
|
||||
linking dynamically, and we're not really denying the recipient of a statically
|
||||
linked program any source code he or she wouldn't be able to obtain otherwise.
|
||||
</li>
|
||||
<li>
|
||||
Point 4 says that if you make a work based on the Library, then you may
|
||||
distribute this under the Lesser General Public License:- in other words, point
|
||||
4 applies only to a work using the Library being linked (statically or
|
||||
dynamically) to the Library. It is in the spirit of LGPL that the recipient of
|
||||
the combined work not be denied anything he or she would be able to receive with
|
||||
the regular LGPL. However, statically linking an application program with a work
|
||||
based on the Library, i.e. a modified copy would do just that! Point 5 says that
|
||||
the regular Lesser General Public License applies in that case.
|
||||
</li>
|
||||
<li>
|
||||
Point 5 requires you to identify your program as using the tvmet library. With
|
||||
static linking, there would be no way for a normal user to tell otherwise. We
|
||||
request that you include the given statement, and preferably a version number
|
||||
also. The motivation is two-fold:
|
||||
|
||||
-# A certain amount of publicity for tvmet :-)
|
||||
-# Some way for recipients of your program to know that (a) your program is
|
||||
linked to the tvmet Library, and (b) for them to verify that they have in fact
|
||||
not been denied anything they would have been able to obtain under LGPL, by
|
||||
visiting this page which details the license information (there are many GPL-
|
||||
vigilantes out there, and this might appease them).
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
This concludes our remarks on the License revision; please feel free to contact
|
||||
me if you have additional questions. The rationale section will likely be
|
||||
expanded when there are still questions left unanswered.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
// Local Variables:
|
||||
// mode:c++
|
||||
// End:
|
||||
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
* $Id: links.dox,v 1.3 2003/12/05 19:08:59 opetzold Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
\page links Links of Interest or Related Links
|
||||
|
||||
|
||||
|
||||
\section generell General Information on Numeric C++
|
||||
- <a href=http://osl.iu.edu/~tveldhui/papers/techniques/>Techniques for Scientific C++</a>
|
||||
- <a href=http://osl.iu.edu/~tveldhui/papers/Expression-Templates/exprtmpl.html>Expression Templates</a>
|
||||
- <a href=http://osl.iu.edu/~tveldhui/papers/Template-Metaprograms/meta-art.html>Template Metaprograms</a>
|
||||
- <a href=http://oonumerics.org/oon/>The Object-Oriented Numerics Page</a> - a very good entry point
|
||||
- <a href=http://www.openscience.org/links.php?section=103>The OpenScience Project > Mathematics > Linear Algebra</a>
|
||||
- <a href=http://sal.kachinatech.com/B/0/>SAL- Numerical Analysis - Miscellaneous Software</a>
|
||||
|
||||
\section numlibs Other ET and MT Vector and Matrix Libraries
|
||||
|
||||
- <a href=http://oonumerics.org/blitz/>blitz++</a>
|
||||
- <a href=http://www.genesys-e.org/ublas/>uBlas</a>
|
||||
- <a href=http://www.lsc.nd.edu/research/mtl>MTL</a>
|
||||
- <a href=http://sourceforge.net/projects/etsmo/>ETSMO</a> - no files released since over one year
|
||||
- <a href=http://met.sourceforge.net/>MET</a>
|
||||
- <a href=http://sourceforge.net/projects/metaet/>meta::Expr{T_emplate}</a>
|
||||
- <a href=http://www.acl.lanl.gov/pete/>PETE</a>
|
||||
- <a href=http://www.acl.lanl.gov/pooma/>POOMA</a>
|
||||
- <a href=http://math.nist.gov/tnt/>TNT</a> - Template Numerical Toolkit
|
||||
|
||||
This list isn't complete. For more freely available libraries please have
|
||||
a look <a href=http://www.oonumerics.org/oon/#libraries>here</a>.
|
||||
*/
|
||||
|
||||
|
||||
// Local Variables:
|
||||
// mode:c++
|
||||
// End:
|
||||
|
||||
// Local Variables:
|
||||
// mode:c++
|
||||
// End:
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 22 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 24 KiB |
@@ -1,8 +0,0 @@
|
||||
/*
|
||||
* $Id: misc.dox,v 1.1.1.1 2003/02/08 19:32:50 opetzold Exp $
|
||||
*/
|
||||
|
||||
|
||||
// Local Variables:
|
||||
// mode:c++
|
||||
// End:
|
||||
@@ -1,325 +0,0 @@
|
||||
/*
|
||||
* $Id: notes.dox,v 1.20 2004/04/11 01:29:41 opetzold Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
\page notes Some Notes ...
|
||||
|
||||
<p>Contents:</p>
|
||||
-# \ref optimizing
|
||||
-# \ref temporaries
|
||||
-# \ref operators
|
||||
-# \ref threads
|
||||
-# \ref expressions
|
||||
-# \ref adl
|
||||
-# \ref alias
|
||||
-# \ref spec_meta_func
|
||||
-# \ref mmv
|
||||
|
||||
|
||||
|
||||
|
||||
\section optimizing ... on optimizing
|
||||
|
||||
This depends heavily on compiler and the flags used. The code produced with
|
||||
-O could be better than with -O2 even on gcc-2.9x suite. To get the best
|
||||
results, you should examine the assembler code generated by your compiler.
|
||||
Maybe I will write a benchmark suite for different compiler options one day.
|
||||
(Maybe you could contribute?)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section temporaries ... on temporaries
|
||||
|
||||
The use of expression templates (ET) and meta templates (MT) allows the
|
||||
generated code to avoid the creation of many temporaries -- especially with
|
||||
standard mathematical and assignment operations. There are times that you
|
||||
have to use actual temporaries e.g. when swapping variables of type
|
||||
double -- with integer values you can use the XOR operator.
|
||||
|
||||
Some implementations are using a loop with temporaries even if there is a
|
||||
solution with ET. Than the loops are faster than MT.
|
||||
|
||||
\sa \ref mmv
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section operators ... on operators and namespace element_wise
|
||||
|
||||
Some operations on matrices and vectors are not available at first glance.
|
||||
These are defined in the namespace <code>element_wise</code> because they
|
||||
are element wise (and not strictly mathematical) operations.
|
||||
|
||||
But there is more: some functions do element wise operations per se (e.g.
|
||||
vector addition) and are NOT inside namespace element_wise. Furthermore,
|
||||
all comparison operators perform element wise operations.
|
||||
|
||||
\sa \ref compare
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section threads ... about Threads
|
||||
|
||||
This library is not thread safe. It's designed for small math operations where
|
||||
the overhead for locking policies is too great. If you require locking for
|
||||
a multi-threaded application, you will need to write a wrapper.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section expressions ... on expressions
|
||||
|
||||
The first versions of %tvmet had only one expression (Xpr) which was shared
|
||||
for both vectors and matrices. This was working fine, but limited tvmet's
|
||||
use for arithmetic expressions expressions on complex values. For this
|
||||
reason, I had to separate expression types for vectors and matrices. The
|
||||
same problem appeared when using the eval() function for evaluating these
|
||||
expressions. (Which index operator should handle it?) Unfortunately, the
|
||||
use of separate expression types vastly increases the number of operators
|
||||
and functions needed to make the library viable. Fortunately, most boundary
|
||||
checks are not necessary since they are done at compile time (such as those
|
||||
needed by the assignment operator, etc).
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section adl ... on namespaces and Koenig Lookup
|
||||
|
||||
IMO, the cleanest way would be to put all functions into their own
|
||||
namespace <code>Functional</code> instead of naming them with the
|
||||
<code>fncl_</code> prefix they currently have. (I did beforehand, and
|
||||
have thought better since). Unfortunately, this technique doesn't work well.
|
||||
I got compiler errors like:
|
||||
|
||||
\code
|
||||
template <class T> Functional::xyt<T>' is not a function
|
||||
conflict with `template <class E> xyz(Xpr<E>)' in call to `xyz'
|
||||
\endcode
|
||||
|
||||
when trying:
|
||||
|
||||
\code
|
||||
typedef Vector<double, 3> vector3d;
|
||||
vector3d t1(1,2,3);
|
||||
vector3d t2(t1);
|
||||
vector3d r;
|
||||
r = sqrt( t1 * t2 );
|
||||
\endcode
|
||||
|
||||
ADL (argument dependent lookup), aka Koenig Lookup, is causing the
|
||||
compiler to check for a match in namespace Functional, since the
|
||||
template instantiation is part of Functional (the Xpr stuff), it matches
|
||||
before the global namespace (the Vector stuff) is checked. Writing:
|
||||
|
||||
\code
|
||||
r = ::sqrt( t1 * t2 );
|
||||
\endcode
|
||||
|
||||
seems to solve the problem at first glance. However, to force the user of
|
||||
the library into this syntax is painful and could probably run cause other
|
||||
problems with other namespaces (I haven't checked this). Therefore, all
|
||||
"Functionals" have the prefix fncl_.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section alias ... about aliasing
|
||||
|
||||
tvmet assumes that all matrices and vectors are alias free. These means that
|
||||
source and destination memory layout of matrices and vectors never overlaps
|
||||
(during an operation).
|
||||
|
||||
This is very easy to understood if you see a matrix-vector product. Both
|
||||
contain different data in different (unique, non-overlapping) memory
|
||||
regions -- hence, they are alias free. Contrast this with a matrix-matrix
|
||||
multiply which maybe can have an aliasing, e.g. \f$A = A * B\f$.
|
||||
When source and destination memory regions are the same, the computed results
|
||||
may be wrong. (Probably they will be.) But, \f$C = A * B\f$ is alias free.
|
||||
|
||||
Let's see an example in detail:
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
Matrix<double,3,3> M1;
|
||||
M1 = 1,2,3,4,5,6,7,8,9;
|
||||
|
||||
cout << "M1 = " << M1 << endl;
|
||||
M1 = trans(M1);
|
||||
cout << "M1 = " << M1 << endl;
|
||||
\endcode
|
||||
|
||||
\par Output:
|
||||
\code
|
||||
M1 = Matrix<d, 3, 3> = [
|
||||
[1, 2, 3],
|
||||
[4, 5, 6],
|
||||
[7, 8, 9]
|
||||
]
|
||||
M1 = Matrix<d, 3, 3> = [
|
||||
[1, 4, 7],
|
||||
[4, 5, 8],
|
||||
[7, 8, 9]
|
||||
]
|
||||
\endcode
|
||||
|
||||
As you can see, the lower triangular matrix isn't what you expected due to
|
||||
the aliasing. These results depends on the compiler optimizations, too.
|
||||
|
||||
Unfortunately, to avoid the aliasing problem, you must use temporaries
|
||||
as shown here:
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
matrix_type temp_A(A);
|
||||
A = temp_A * B;
|
||||
cout << "matrix_type temp_A(A);\n"
|
||||
<< "A = temp_A * B = " << A << endl;
|
||||
\endcode
|
||||
|
||||
Anyway, it seems there is a small exception (no guarantee, since it's
|
||||
compiler dependent I assume) for element wise operations with matrices
|
||||
or vectors on right hand side.
|
||||
|
||||
Starting with tvmet release 1.4.1 there is a new function alias. These
|
||||
function use a proxy to call special member functions of the %Matrix/Vector
|
||||
class. These member functions introduce the temporary for you.
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
typedef tvmet::Matrix<double, 3, 3> matrix_type;
|
||||
matrix_type M;
|
||||
std::generate(M.begin(), M.end(),
|
||||
tvmet::util::Incrementor<matrix_type::value_type>());
|
||||
std::cout << "M = " << M << std::endl;
|
||||
|
||||
alias(M) = trans(M);
|
||||
std::cout << "M = " << M << std::endl;
|
||||
\endcode
|
||||
|
||||
with the expected
|
||||
|
||||
\par Output:
|
||||
\code
|
||||
M = [
|
||||
[1, 4, 7],
|
||||
[2, 5, 8],
|
||||
[3, 6, 9]
|
||||
]
|
||||
\endcode
|
||||
|
||||
These function/proxy will work for the element wise operators +=, -=, *= and /=
|
||||
with expressions, e.g. as trans() returns.
|
||||
|
||||
\sa \ref assign_op
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section spec_meta_func ... special Meta-Template Functions
|
||||
|
||||
From a principle point of view, there is no need for some special functions
|
||||
for %Matrix and %Vector functions, namely \f$M^T\, x\f$, \f$M^T\,M\f$,
|
||||
\f$M\,M^T\f$, and \f$(M\,M)^T\f$.
|
||||
|
||||
Unfortunately, the g++ compiler throws in the towel sometimes even on
|
||||
transposing matrices. Because of this, %tvmet offers specialized functions
|
||||
which speed up at runtime (about factor 2 ... 3) using meta templates.
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
using namespace tvmet;
|
||||
|
||||
Matrix<double, 6, 3> M1(0); // will be transposed to be conform to vector size
|
||||
Vector<double, 6> v1(0);
|
||||
Vector<double, 3> v2(0);
|
||||
|
||||
M1 = ...
|
||||
v1 = ...
|
||||
|
||||
v2 = Mtx_prod(M1, v1); // equal to: v2 = trans(M1)*v1;
|
||||
\endcode
|
||||
|
||||
BTW, the %Matrix-%Matrix \f$M\,M\f$ and %Matrix-%Vector \f$M\,x\f$
|
||||
products use Meta-Templates, too.
|
||||
|
||||
\sa \ref Mtx_prod
|
||||
\sa \ref MMt_prod
|
||||
\sa \ref MtM_prod
|
||||
\sa \ref trans_prod
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section mmv ... about Matrix-Matrix-Vector and Matrix-Matrix-Matrix-operations
|
||||
|
||||
The problem is related to the optimizer - due to the expression and meta
|
||||
templates used.
|
||||
|
||||
Internally, an expression template may contain other expression templates
|
||||
(meta templates inside as well as) too - the compiler will unroll all of
|
||||
these expression into a single resultant expression (which is a hard job).
|
||||
Sometimes the code generated from this is worse (from a performance point
|
||||
of view) than just using simple temporaries.
|
||||
|
||||
You can chain matrix-matrix and matrix-vector operations without writing
|
||||
temporaries by yourself (if this is what you want).
|
||||
|
||||
\par from examples/hspiess.cc:
|
||||
\code
|
||||
tvmet::Matrix<double,3,2> B;
|
||||
tvmet::Matrix<double,3,3> D;
|
||||
tvmet::Matrix<double,2,2> K;
|
||||
|
||||
B =
|
||||
-0.05, 0,
|
||||
0, 0.05,
|
||||
0.05, -0.05;
|
||||
D =
|
||||
2000, 1000, 0,
|
||||
1000, 2000, 0,
|
||||
0, 0, 500;
|
||||
|
||||
K = trans(B) * D * B;
|
||||
\endcode
|
||||
|
||||
The performance can be sub optimal due to the increasing complexity
|
||||
of operations. This can be reduced by a user specified temporary:
|
||||
|
||||
\par from examples/hspiess.cc:
|
||||
\code
|
||||
// as before
|
||||
|
||||
K = tvmet::Matrix<double,2,3>(trans(B) * D) * B;
|
||||
\endcode
|
||||
|
||||
or
|
||||
\code
|
||||
K = prod(tvmet::Matrix<double,2,3>(prod(trans(B), D)), B);
|
||||
\endcode
|
||||
|
||||
At this moment an intelligent cache and pre-evaluating strategy is
|
||||
missing by %tvmet.
|
||||
|
||||
\sa \ref spec_meta_func
|
||||
\sa some notes \ref temporaries
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
// Local Variables:
|
||||
// mode:c++
|
||||
// End:
|
||||
@@ -1,21 +0,0 @@
|
||||
/*
|
||||
* $Id: projects.dox,v 1.6 2004/04/09 05:48:16 opetzold Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
\page projects Projects using tvmet
|
||||
|
||||
|
||||
Please write me about projects using tvmet - I'm highly interested in !
|
||||
|
||||
-# Not really a project but, an interesting application is
|
||||
<a href=http://www.radiumsoftware.com/files/pathtrace.cxx.1.12.txt>here</a>.
|
||||
-# <a href=http://www.iplt.org>IPLT</a>, an image processing libary
|
||||
and toolbox for the electron microscopy community.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
// Local Variables:
|
||||
// mode:c++
|
||||
// End:
|
||||
@@ -1,225 +0,0 @@
|
||||
BODY {
|
||||
background: white;
|
||||
color: black;
|
||||
margin-right: 20px;
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
H1 {
|
||||
text-align: center;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
H2 {
|
||||
color: white;
|
||||
font-family: Geneva, Arial, Helvetica, sans-serif;
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
background-color: black;
|
||||
}
|
||||
|
||||
H3 {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
CAPTION {
|
||||
font-weight: bold
|
||||
}
|
||||
|
||||
DIV.qindex {
|
||||
width: 100%;
|
||||
background-color: #eeeeff;
|
||||
border: 4px solid #eeeeff;
|
||||
text-align: center;
|
||||
margin-bottom: 2px
|
||||
}
|
||||
|
||||
A.qindex {
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
color: #0000ee
|
||||
}
|
||||
|
||||
A.qindex:visited {
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
color: #0000ee
|
||||
}
|
||||
|
||||
A.qindex:hover {
|
||||
text-decoration: none;
|
||||
background-color: #ddddff
|
||||
}
|
||||
|
||||
A.qindexHL {
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
background-color: #6666cc;
|
||||
color: #ffffff
|
||||
}
|
||||
|
||||
A.qindexHL:hover { text-decoration: none; background-color: #6666cc; color: #ffffff }
|
||||
A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff }
|
||||
A.el { text-decoration: none; font-weight: bold }
|
||||
A.elRef { font-weight: bold }
|
||||
A.code { text-decoration: none; font-weight: normal; color: #4444ee }
|
||||
A.codeRef { font-weight: normal; color: #4444ee }
|
||||
A:hover { text-decoration: none; background-color: #f2f2ff }
|
||||
|
||||
DL.el { margin-left: -1cm }
|
||||
|
||||
DIV.fragment {
|
||||
width: 98%;
|
||||
border: 1px solid #CCCCCC;
|
||||
background-color: #f5f5f5;
|
||||
padding-left: 4px;
|
||||
margin: 4px;
|
||||
}
|
||||
|
||||
DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px }
|
||||
|
||||
TD.md { background-color: #f2f2ff; font-weight: bold; }
|
||||
TD.mdname1 { background-color: #f2f2ff; font-weight: bold; color: #602020; }
|
||||
TD.mdname { background-color: #f2f2ff; font-weight: bold; color: #602020; width: 600px; }
|
||||
|
||||
DIV.groupHeader { margin-left: 16px; margin-top: 12px; margin-bottom: 6px; font-weight: bold }
|
||||
DIV.groupText { margin-left: 16px; font-style: italic; font-size: smaller }
|
||||
|
||||
TD.indexkey {
|
||||
background-color: #eeeeff;
|
||||
font-weight: bold;
|
||||
padding-right : 10px;
|
||||
padding-top : 2px;
|
||||
padding-left : 10px;
|
||||
padding-bottom : 2px;
|
||||
margin-left : 0px;
|
||||
margin-right : 0px;
|
||||
margin-top : 2px;
|
||||
margin-bottom : 2px
|
||||
}
|
||||
|
||||
TD.indexvalue {
|
||||
background-color: #eeeeff;
|
||||
font-style: italic;
|
||||
padding-right : 10px;
|
||||
padding-top : 2px;
|
||||
padding-left : 10px;
|
||||
padding-bottom : 2px;
|
||||
margin-left : 0px;
|
||||
margin-right : 0px;
|
||||
margin-top : 2px;
|
||||
margin-bottom : 2px
|
||||
}
|
||||
|
||||
TR.memlist { background-color: #f0f0f0;}
|
||||
P.formulaDsp { text-align: center; }
|
||||
|
||||
IMG.formulaDsp { }
|
||||
IMG.formulaInl { vertical-align: middle; }
|
||||
|
||||
SPAN.keyword { color: #008000 }
|
||||
SPAN.keywordtype { color: #604020 }
|
||||
SPAN.keywordflow { color: #e08000 }
|
||||
SPAN.comment { color: #800000 }
|
||||
SPAN.preprocessor { color: #806020 }
|
||||
SPAN.stringliteral { color: #002080 }
|
||||
SPAN.charliteral { color: #008080 }
|
||||
|
||||
.mdTable {
|
||||
border: 1px solid #868686;
|
||||
background-color: #f2f2ff;
|
||||
}
|
||||
|
||||
.mdRow {
|
||||
padding: 8px 20px;
|
||||
}
|
||||
|
||||
.mdescLeft {
|
||||
font-size: smaller;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
background-color: #FAFAFA;
|
||||
padding-left: 8px;
|
||||
border-top: 1px none #E0E0E0;
|
||||
border-right: 1px none #E0E0E0;
|
||||
border-bottom: 1px none #E0E0E0;
|
||||
border-left: 1px none #E0E0E0;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.mdescRight {
|
||||
font-size: smaller;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-style: italic;
|
||||
background-color: #FAFAFA;
|
||||
padding-left: 4px;
|
||||
border-top: 1px none #E0E0E0;
|
||||
border-right: 1px none #E0E0E0;
|
||||
border-bottom: 1px none #E0E0E0;
|
||||
border-left: 1px none #E0E0E0;
|
||||
margin: 0px;
|
||||
padding-bottom: 0px;
|
||||
padding-right: 8px;
|
||||
}
|
||||
|
||||
.memItemLeft {
|
||||
padding: 1px 0px 0px 8px;
|
||||
margin: 4px;
|
||||
border-top-width: 1px;
|
||||
border-right-width: 1px;
|
||||
border-bottom-width: 1px;
|
||||
border-left-width: 1px;
|
||||
border-top-style: solid;
|
||||
border-top-color: #E0E0E0;
|
||||
border-right-color: #E0E0E0;
|
||||
border-bottom-color: #E0E0E0;
|
||||
border-left-color: #E0E0E0;
|
||||
border-right-style: none;
|
||||
border-bottom-style: none;
|
||||
border-left-style: none;
|
||||
background-color: #FAFAFA;
|
||||
font-family: Geneva, Arial, Helvetica, sans-serif;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.memItemRight {
|
||||
padding: 1px 0px 0px 8px;
|
||||
margin: 4px;
|
||||
border-top-width: 1px;
|
||||
border-right-width: 1px;
|
||||
border-bottom-width: 1px;
|
||||
border-left-width: 1px;
|
||||
border-top-style: solid;
|
||||
border-top-color: #E0E0E0;
|
||||
border-right-color: #E0E0E0;
|
||||
border-bottom-color: #E0E0E0;
|
||||
border-left-color: #E0E0E0;
|
||||
border-right-style: none;
|
||||
border-bottom-style: none;
|
||||
border-left-style: none;
|
||||
background-color: #FAFAFA;
|
||||
font-family: Geneva, Arial, Helvetica, sans-serif;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.search {
|
||||
color: #0000ee;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
FORM.search {
|
||||
margin-bottom: 0px;
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
INPUT.search {
|
||||
font-size: 75%;
|
||||
color: #000080;
|
||||
font-weight: normal;
|
||||
background-color: #eeeeff;
|
||||
}
|
||||
|
||||
TD.tiny {
|
||||
font-size: 75%;
|
||||
}
|
||||
@@ -1,111 +0,0 @@
|
||||
%% Version: $Id: tvmet.sty.in,v 1.2 2004/03/27 14:00:33 opetzold Exp $
|
||||
|
||||
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
|
||||
\def\@rcs@ $#1Date: #2 #3$$#4Revision: #5$ {
|
||||
\ProvidesPackage{tvmet}[#2 v#5tvmet doxygen latex style]}
|
||||
\@rcs@ $Date: 2004/03/27 14:00:33 $$Revision: 1.2 $
|
||||
|
||||
\DeclareOption{}{%%%
|
||||
}
|
||||
|
||||
%%\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{}}
|
||||
\ExecuteOptions{}
|
||||
\ProcessOptions
|
||||
|
||||
% elementary for pdflatex
|
||||
\newif\ifpdf
|
||||
\ifx\pdfoutput\undefined
|
||||
\pdffalse % no pdftex
|
||||
\else
|
||||
\pdfoutput=1 % running pdftex
|
||||
\pdftrue
|
||||
\fi
|
||||
|
||||
% Postscript fonts
|
||||
\RequirePackage[scaled=0.92]{helvet}
|
||||
\RequirePackage{courier}
|
||||
\RequirePackage{typearea} % from KOMA script
|
||||
|
||||
% doxygen need this; it includes the style for formulas too
|
||||
\RequirePackage{fancyhdr}
|
||||
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%% tvmet style %%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
%%
|
||||
%% page borders
|
||||
%%
|
||||
\areaset[2cm]% % binding border
|
||||
{16cm}{26cm} % text width and height
|
||||
|
||||
%%
|
||||
%% sans serif is default font
|
||||
%%
|
||||
\renewcommand{\familydefault}{\sfdefault}
|
||||
|
||||
%%
|
||||
%% overwrite doxygen's hyperref setup
|
||||
%%
|
||||
\ifpdf\hypersetup{
|
||||
baseurl={http://tvmet.sourceforge.net},
|
||||
pdftitle={@PACKAGE@ @VERSION@ Reference Manual},
|
||||
pdfauthor={\textcopyright\,Olaf Petzold},
|
||||
pdfsubject={%
|
||||
This Tiny Vector and Matrix C++ template
|
||||
libary uses Meta Templates and Expression Templates to evaluate results
|
||||
at compile time - to make it fast for low order (tiny) systems.
|
||||
},
|
||||
pdfkeywords={%
|
||||
tiny vector matrix fast C++ STL template library
|
||||
expression templates meta templates fixed size fixed dimension
|
||||
matrix-matrix matrix-vector vector-matrix binary unary operations operators
|
||||
product transpose linear algebra cross product dot product type promotion
|
||||
exception linux kernel embedded system regression test gcc g++
|
||||
blitz blitz++ TinyVector TinyMatrix MTL TNT
|
||||
gnu compiler suite portland group c++ kai c++ intel compiler LGPL
|
||||
},
|
||||
%
|
||||
bookmarks={true},
|
||||
bookmarksnumbered={true},
|
||||
bookmarksopen={true},
|
||||
pdfpagelabels={true},
|
||||
pdfmenubar={true},
|
||||
pdftoolbar={true},
|
||||
plainpages={false},
|
||||
pdfstartview={FitH},
|
||||
pdfpagemode={UseOutlines},
|
||||
pdfhighlight={/I}
|
||||
}
|
||||
\fi
|
||||
|
||||
%%
|
||||
%% overwrite fancyheadings
|
||||
%%
|
||||
\makeatletter
|
||||
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
|
||||
\hbox{}\vspace*{\fill}
|
||||
\thispagestyle{empty}
|
||||
\newpage
|
||||
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
|
||||
\makeatother
|
||||
\renewcommand{\sectionmark}[1]{%
|
||||
\markright{\thesection.\ #1}}
|
||||
\makeatletter
|
||||
\lhead[\textbf{@PACKAGE@ @VERSION@}]{\fancyplain{}{\bfseries\rightmark}}
|
||||
\rhead[\fancyplain{}{\bfseries\leftmark}]{\textbf{@PACKAGE@ @VERSION@}}
|
||||
\makeatother
|
||||
\chead{}
|
||||
\lfoot{}
|
||||
\cfoot{\bfseries --\ \thepage\ --}
|
||||
\rfoot{}
|
||||
\setlength{\headwidth}{0.0cm}
|
||||
\setlength{\headwidth}{\textwidth}
|
||||
|
||||
\endinput
|
||||
|
||||
%%% Local Variables:
|
||||
%%% mode: latex
|
||||
%%% TeX-auto-save: nil
|
||||
%%% TeX-auto-parse-length: 99999
|
||||
%%% ispell-local-dictionary: "american"
|
||||
%%% End:
|
||||
@@ -1,407 +0,0 @@
|
||||
/*
|
||||
* $Id: usage.dox,v 1.14 2004/07/03 17:09:23 opetzold Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
\page usage Usage
|
||||
|
||||
<p>Contents:</p>
|
||||
-# \ref include
|
||||
-# \ref construct
|
||||
-# \ref c_arrays
|
||||
-# \ref compare
|
||||
-# \ref pod
|
||||
-# \ref stl
|
||||
-# \ref matrix_access
|
||||
-# \ref expr_print
|
||||
|
||||
|
||||
|
||||
|
||||
\section include Include files
|
||||
|
||||
The Tiny %Vector and %Matrix template library has many include files spread
|
||||
throughout the %tvmet include directory. As a user, you need only include
|
||||
<tt><%tvmet/Vector></tt> for vector operations and/or
|
||||
<tt><%tvmet/Matrix></tt> for matrix operations.
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
#include <tvmet/Matrix.h>
|
||||
#include <tvmet/Vector.h>
|
||||
|
||||
using namespace tvmet;
|
||||
\endcode
|
||||
|
||||
Simple, isn't it? Don't forget to use the namespace tvmet, but keep in mind
|
||||
that using the using directive inside headers will pollute the namespace. If
|
||||
you write this in a header file, the namespace for all subsequent header
|
||||
files (those which include the one you're writing) will also be polluted.
|
||||
(This is not a %tvmet specific phenomenon.) Therefore, write the using
|
||||
statement in the C++ file.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section construct Construction and Initializing
|
||||
|
||||
Due to the nature of
|
||||
<a href=http://extreme.indiana.edu/~tveldhui/papers/Expression-Templates/exprtmpl.html>
|
||||
Expression Templates</a> (ET) you can't write code like
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
tvmet::Vector<double, 3> v1(1,2,3); // OK
|
||||
tvmet::Vector<double, 3> v2 = v1; // not possible
|
||||
\endcode
|
||||
|
||||
The operator= function assigns an expression to the Vector which means that
|
||||
the object must be constructed before you may assign something to it. The
|
||||
solution is to write this as:
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
using namespace tvmet;
|
||||
|
||||
Vector<double, 3> v1(1,2,3);
|
||||
Vector<double, 3> v2; // construct the Vector<T,Sz> object at first
|
||||
v2 = v1; // ... and assign the contents of v1 to v2
|
||||
Vector<double, 3> v3(v1); // ... or simple use the copy constructor
|
||||
|
||||
std::cout << v3 << std::endl;
|
||||
\endcode
|
||||
|
||||
since the object v2 needs to be constructed before the object's operator=()
|
||||
can be called.
|
||||
|
||||
The same rule applies to the Matrix class. You can only assign vectors and
|
||||
matrices of the same dimension or you will get a compile error. This also
|
||||
applies to the argument list for the constructor of the classes.
|
||||
|
||||
Initializing can be done as shown above or by using a comma separated list:
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
using namespace tvmet;
|
||||
|
||||
Matrix<double, 3, 2> m1; // yes, non-square matrices are possible as well
|
||||
m1 = 1, 4,
|
||||
2, 5,
|
||||
3, 6;
|
||||
\endcode
|
||||
|
||||
Matrix element initialization always performed column wise! If the length
|
||||
of the comma separated list is longer than the storage size, you will get
|
||||
a compile time error. (tvmet is designed to prevent this -- it will prevent
|
||||
you from accidentally overwriting memory which does not belong to the
|
||||
matrix you are initializing.) You can use a comma separated list to
|
||||
initialize vectors as well.
|
||||
|
||||
If you want a clean (zero-valued) vector or matrix you can simple write:
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
using namespace tvmet;
|
||||
|
||||
Vector<double, 3> v4(0);
|
||||
Matrix<double, 3, 4> m2(0);
|
||||
\endcode
|
||||
|
||||
All elements of v4 and m2 are initialized with zero (or whatever value you
|
||||
provide at construction time). Keep in mind that the uninitialized %Matrix
|
||||
and %Vector classes will have random data when the are created (since they
|
||||
use a static array for internal storage) unless you initialize them!
|
||||
|
||||
Another way to initialize a vector or matrix follows:
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
using namespace tvmet;
|
||||
|
||||
Vector<double, 3> v5(1,2,3);
|
||||
Vector<double, 3> v6(v5);
|
||||
Vector<double, 3> v7(v5+v6);
|
||||
\endcode
|
||||
|
||||
This is useful for temporary results. The result will be immediately
|
||||
assigned to the new vector elements using the expression passed to the
|
||||
constructor.
|
||||
|
||||
Yet another way of initializing a vector or matrix is similar to the above.
|
||||
We assign an expression to it:
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
using namespace tvmet;
|
||||
|
||||
Matrix<double, 3, 3> m3, m4, m5;
|
||||
m3 = 1, 2, 3,
|
||||
4, 5, 6,
|
||||
7, 8, 9;
|
||||
m4 = m3;
|
||||
m5 = m3 + m4;
|
||||
\endcode
|
||||
|
||||
If you have your data inside arrays you can use tvmet's iterator interface
|
||||
to initialize a vector or matrix with it:
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
T data[] = { 1,4,7,
|
||||
2,5,8,
|
||||
3,6,9 };
|
||||
|
||||
int sz = sizeof(data)/sizeof(T);
|
||||
T* first = data;
|
||||
T* last = data + sz;
|
||||
|
||||
tvmet::Matrix<double, 3, 3> m(first, last);
|
||||
\endcode
|
||||
|
||||
The data will be copied into the matrix itself. When the constructor has
|
||||
finished, there will be no stored reference to the array pointer.
|
||||
|
||||
Starting with tvmet release 1.6.0 you can create an identity matrix
|
||||
simply by using the function identity(). Note, we have to specify the
|
||||
matrix type, since ADL can't work here.
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
typedef Matrix<double,3,3> matrix_type;
|
||||
...
|
||||
matrix_type E( identity<matrix_type>() );
|
||||
\endcode
|
||||
|
||||
|
||||
|
||||
|
||||
\section c_arrays Use of C style Arrays with tvmet
|
||||
|
||||
Sometimes you have some data arranged in a C style array for matrices
|
||||
and vectors. As with tvmet release 1.6.0 you can wrap an expression
|
||||
around using the functions vector_ref(const T* mem) and
|
||||
matrix_ref(const T* mem) where mem is the pointer to the C array.
|
||||
|
||||
The returned expressions (XprVector or XprMatrix) can be used
|
||||
as usual like tvmet's vectors and matrices. This means, you
|
||||
can use all mathematical functions on it.
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
static float lhs[3][3] = {
|
||||
{-1, 0, 1}, { 1, 0, 1}, {-1, 0, -1}
|
||||
};
|
||||
static float rhs[3][3] = {
|
||||
{ 0, 1, 1}, { 0, 1, -1}, { 0, -1, 1}
|
||||
};
|
||||
...
|
||||
|
||||
typedef Matrix<float, 3, 3> matrix_type;
|
||||
|
||||
matrix_type M( prod(matrix_ref<float, 3, 3>(&lhs[0][0]),
|
||||
matrix_ref<float, 3, 3>(&rhs[0][0])) );
|
||||
\endcode
|
||||
|
||||
This allows to initialize tvmet's vectors and matrices by
|
||||
an alternative way as described at \ref construct.
|
||||
|
||||
|
||||
\section compare Compare Vectors and Matrices
|
||||
|
||||
If you expect to find global comparison operators for comparing Vectors
|
||||
and Matrices, you are right -- these are provided. But, the return
|
||||
value probably isn't what you expect: a boolean value. Instead, the operator
|
||||
returns an expression (e.g. XprVector<>). The contents of this expression
|
||||
type is a element wise logical operation (depends on the given operator
|
||||
like ==, <, >, etc...)! To get a boolean value you need to evaluate the
|
||||
expression using all_elements() or any_elements(), as follows:
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
using namespace tvmet;
|
||||
using namespace std;
|
||||
|
||||
Vector<double, 3> v1, v2, bv;
|
||||
|
||||
v1 = 1,2,3;
|
||||
v2 = 1,3,3;
|
||||
|
||||
bv = v1 == v2;
|
||||
|
||||
cout << bv << endl;
|
||||
cout << "v1 == v2 is "
|
||||
<< ( all_elements( v1 == v2 ) ? "true" : "false" )
|
||||
<< endl;
|
||||
\endcode
|
||||
|
||||
This gives
|
||||
|
||||
\par [continued]
|
||||
\code
|
||||
Vector<d, 3>[1, 0, 1]
|
||||
v1 == v2 is false
|
||||
\endcode
|
||||
|
||||
The reason for this is the element wise operation on all elements (for both
|
||||
Vectors and Matrices). Comparing two vectors will result in a "boolean Vector"
|
||||
expression. Using all_elements/any_elements evaluates the result into a
|
||||
single boolean by repeatedly applying the comparison for each element.
|
||||
|
||||
An other example on comparing is shown below:
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
if(all_elements(X == Y)) { cout << "matrices are identical" << endl; }
|
||||
if(any_elements(X == Y)) { cout << "at least one element is equal" << endl; }
|
||||
if(any_elements(X != Y)) { cout << "not all elements are equal" << endl; }
|
||||
\endcode
|
||||
|
||||
%tvmet prior release 1.2.1 did have a boolean version eval for comparing.
|
||||
The functional and semantic meaning were not clear at all. Therefore I
|
||||
decided to remove it.
|
||||
|
||||
\sa \ref operators
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section pod Data Types like std::complex<>
|
||||
|
||||
As we can see above we can use POD (plain old data) types like <tt>double</tt> and
|
||||
<tt>int</tt> as data type of a %Vector or %Matrix. However, we are not limited to
|
||||
this - we can use e.g. <tt>std::complex<></tt> as well:
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
using namespace tvmet;
|
||||
|
||||
Vector<std::complex<double>,3> v1, v2;
|
||||
Matrix<std::complex<double>,3,3> m1;
|
||||
\endcode
|
||||
|
||||
And operate on these...
|
||||
|
||||
\par [continued]
|
||||
\code
|
||||
v1 = 1,2,3;
|
||||
m1 = 1,4,7,
|
||||
2,5,8,
|
||||
3,6,9;
|
||||
v2 = m1 * v1;
|
||||
\endcode
|
||||
|
||||
Be careful. <tt>std::complex<></tt> isn't tested well on regression tests.
|
||||
|
||||
|
||||
|
||||
|
||||
\section stl STL support
|
||||
|
||||
Since version 0.2.0 %tvmet has supported an iterator interface conform to
|
||||
the STL and since version 0.5.0 reverse STL iterators have been supported,
|
||||
too.
|
||||
|
||||
With these, you can mix the %tvmet Vector and Matrix containers with the
|
||||
STL algorithms.
|
||||
|
||||
For example, if you don't like %tvmet's ostream operator, you can create
|
||||
your own implementation like this:
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
tvmet::Vector<double, 6> v(1,2,3,4,5,6);
|
||||
std::cout << v << std::endl;
|
||||
|
||||
std::cout << "The Vector is:" << std::endl;
|
||||
std::copy(v.begin(), v.end(), std::ostream_iterator<double>(std::cout, "\n"));
|
||||
\endcode
|
||||
|
||||
Or, you create a random matrix and print it as shown here:
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
tvmet::Matrix<double,6,6> m;
|
||||
|
||||
std::generate(m.begin(), m.end(), rand);
|
||||
std::cout << m << std::endl;
|
||||
\endcode
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section matrix_access Matrix access by rows and columns
|
||||
|
||||
If you need a specific row or column of a given matrix you can get access to
|
||||
it by using the functions row and col. They will return an XprVector<T>.
|
||||
Unfortunately, you do not get any write access to the vector elements - only
|
||||
reading is permitted due to the expression template concept used here. For
|
||||
write access, you have to use matrix indexing with the parentheses operator.
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
using namespace tvmet;
|
||||
|
||||
typedef Matrix<double 5, 3> matrix_type;
|
||||
typedef Vector<double, 5> matrix_rowvector;
|
||||
typedef Vector<double, 3> matrix_colvector;
|
||||
|
||||
matrix_type M;
|
||||
M = ....
|
||||
|
||||
matrix_rowvector row2 = row(M, 2);
|
||||
matrix_colvector col3 = col(M, 3);
|
||||
...
|
||||
\endcode
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\section expr_print Expression printing
|
||||
|
||||
Expression printing is a nice feature for debugging expressions. (For more
|
||||
about expression templates and expression tree please have a look
|
||||
<a href=http://extreme.indiana.edu/~tveldhui/papers/Expression-Templates/exprtmpl.html>here</a>).
|
||||
|
||||
You can write out a simple matrix-vector multiplication of a vector
|
||||
<tt>v1</tt> and a matrix <tt>m1</tt> of the dimension of 3 as follows:
|
||||
|
||||
\par Example:
|
||||
\code
|
||||
std::cout << m1 * v1 << std::endl;
|
||||
\endcode
|
||||
|
||||
which will be expanded to:
|
||||
|
||||
\par [continued]
|
||||
\code
|
||||
XprVector<
|
||||
XprMVProduct<
|
||||
d, 3, 3, 3, 1, d, 1
|
||||
>
|
||||
3
|
||||
>
|
||||
\endcode
|
||||
|
||||
The "d" is a g++ placeholder for double. (This may vary from compiler to
|
||||
compiler since it is an implementation detail of runtime type information
|
||||
[rtti] determined by the compiler's manufacturer). The purpose of this
|
||||
feature is to check the right evaluation of expressions into the tree on
|
||||
complicated mathematical expressions.
|
||||
|
||||
A rich source of examples are the regression tests. They show all of the
|
||||
supported operations and functions (if there is a regression test for this
|
||||
of course). Some examples are in the examples directory.
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
// Local Variables:
|
||||
// mode:c++
|
||||
// End:
|
||||
@@ -1,40 +0,0 @@
|
||||
/*
|
||||
* $Id: works.dox,v 1.5 2005/03/09 12:33:00 opetzold Exp $
|
||||
*/
|
||||
|
||||
/**
|
||||
\page works Future works
|
||||
|
||||
A good library is never complete. Here are some points which I hope to cover
|
||||
in the future:
|
||||
|
||||
-# more regression tests (bit operations are missing, not all functions and type
|
||||
promotion are tested) and examples (temporary the regression test can act
|
||||
as examples). The problems with the regression tests actually used is,
|
||||
that they does not follow mathematical, strong logical guide lines to cover all
|
||||
possible cases.
|
||||
-# write more examples, the regression test should not act as examples.
|
||||
-# better support for std::complex type.
|
||||
-# add functions like
|
||||
- matrix inverse using LUdecomposition and other matrix vector functions
|
||||
- meta functions for sin, cos etc.
|
||||
-# System V math support on linux seems to be incomplete
|
||||
-# better compiler support
|
||||
-# Interface to other numerical libraries as uBlas, BLAS, and LAPACK.
|
||||
|
||||
|
||||
Maybe, there will be a tvmet2. Some of the features mentioned above will
|
||||
require a redesign of tvmet. With this new design tvmet can better handle
|
||||
special matrices, like banded, symmetric or triangular matrices etc.
|
||||
Furthermore, sparse tiny vectors and matrices are easy to implement, as well
|
||||
as an allocator concept for re-sizable containers.
|
||||
|
||||
The priority depends on the \ref projects as well as the support from the
|
||||
community - please support %tvmet.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
// Local Variables:
|
||||
// mode:c++
|
||||
// End:
|
||||
@@ -1,59 +0,0 @@
|
||||
# $Id: Makefile.am,v 1.12 2004/04/28 21:59:40 opetzold Exp $
|
||||
|
||||
AM_CXXFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include
|
||||
|
||||
EXTRA_PROGRAMS = \
|
||||
xpr_print_v1 \
|
||||
xpr_print_v2 \
|
||||
xpr_print_v3 \
|
||||
xpr_print_v4 \
|
||||
xpr_print_m1 \
|
||||
xpr_print_m2 \
|
||||
xpr_print_m3 \
|
||||
xpr_print_m4 \
|
||||
xpr_print_mv1 \
|
||||
xpr_print_mv2 \
|
||||
mv \
|
||||
mm \
|
||||
cmv \
|
||||
cmm \
|
||||
matrix_col \
|
||||
diag \
|
||||
ray \
|
||||
hspiess \
|
||||
redwards \
|
||||
frob_matrix_norm \
|
||||
alias \
|
||||
aliasing
|
||||
|
||||
DISTCLEANFILES = $(EXTRA_PROGRAMS)
|
||||
|
||||
xpr_print_v1_SOURCES = xpr_print_v1.cc
|
||||
xpr_print_v2_SOURCES = xpr_print_v2.cc
|
||||
xpr_print_v3_SOURCES = xpr_print_v3.cc
|
||||
xpr_print_v4_SOURCES = xpr_print_v4.cc
|
||||
xpr_print_m1_SOURCES = xpr_print_m1.cc
|
||||
xpr_print_m2_SOURCES = xpr_print_m2.cc
|
||||
xpr_print_m3_SOURCES = xpr_print_m3.cc
|
||||
xpr_print_m4_SOURCES = xpr_print_m4.cc
|
||||
xpr_print_mv1_SOURCES = xpr_print_mv1.cc
|
||||
xpr_print_mv2_SOURCES = xpr_print_mv2.cc
|
||||
|
||||
mv_SOURCES = mv.cc
|
||||
mm_SOURCES = mm.cc
|
||||
cmv_SOURCES = cmv.cc
|
||||
cmm_SOURCES = cmm.cc
|
||||
matrix_col_SOURCES = matrix_col.cc
|
||||
diag_SOURCES = diag.cc
|
||||
|
||||
ray_SOURCES = ray.cc
|
||||
|
||||
redwards_SOURCES = redwards.cc
|
||||
hspiess_SOURCES = hspiess.cc
|
||||
|
||||
frob_matrix_norm_SOURCES = frob_matrix_norm.cc
|
||||
|
||||
alias_SOURCES = alias.cc
|
||||
aliasing_SOURCES = aliasing.cc
|
||||
|
||||
examples: $(EXTRA_PROGRAMS)
|
||||
@@ -1,651 +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.12 2004/04/28 21:59:40 opetzold Exp $
|
||||
SOURCES = $(alias_SOURCES) $(aliasing_SOURCES) $(cmm_SOURCES) $(cmv_SOURCES) $(diag_SOURCES) $(frob_matrix_norm_SOURCES) $(hspiess_SOURCES) $(matrix_col_SOURCES) $(mm_SOURCES) $(mv_SOURCES) $(ray_SOURCES) $(redwards_SOURCES) $(xpr_print_m1_SOURCES) $(xpr_print_m2_SOURCES) $(xpr_print_m3_SOURCES) $(xpr_print_m4_SOURCES) $(xpr_print_mv1_SOURCES) $(xpr_print_mv2_SOURCES) $(xpr_print_v1_SOURCES) $(xpr_print_v2_SOURCES) $(xpr_print_v3_SOURCES) $(xpr_print_v4_SOURCES)
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = ..
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = @INSTALL@
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_triplet = @host@
|
||||
EXTRA_PROGRAMS = xpr_print_v1$(EXEEXT) xpr_print_v2$(EXEEXT) \
|
||||
xpr_print_v3$(EXEEXT) xpr_print_v4$(EXEEXT) \
|
||||
xpr_print_m1$(EXEEXT) xpr_print_m2$(EXEEXT) \
|
||||
xpr_print_m3$(EXEEXT) xpr_print_m4$(EXEEXT) \
|
||||
xpr_print_mv1$(EXEEXT) xpr_print_mv2$(EXEEXT) mv$(EXEEXT) \
|
||||
mm$(EXEEXT) cmv$(EXEEXT) cmm$(EXEEXT) matrix_col$(EXEEXT) \
|
||||
diag$(EXEEXT) ray$(EXEEXT) hspiess$(EXEEXT) redwards$(EXEEXT) \
|
||||
frob_matrix_norm$(EXEEXT) alias$(EXEEXT) aliasing$(EXEEXT)
|
||||
subdir = examples
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/config/ac_c_long_long.m4 \
|
||||
$(top_srcdir)/config/ac_create_prefix_config_h.m4 \
|
||||
$(top_srcdir)/config/ac_cxx_have_complex.m4 \
|
||||
$(top_srcdir)/config/ac_cxx_have_complex_math1.m4 \
|
||||
$(top_srcdir)/config/ac_cxx_have_complex_math2.m4 \
|
||||
$(top_srcdir)/config/ac_cxx_have_ieee_math.m4 \
|
||||
$(top_srcdir)/config/ac_cxx_have_mutable.m4 \
|
||||
$(top_srcdir)/config/ac_cxx_have_namespaces.m4 \
|
||||
$(top_srcdir)/config/ac_cxx_have_sysv_math.m4 \
|
||||
$(top_srcdir)/config/ac_cxx_partial_specialization.m4 \
|
||||
$(top_srcdir)/config/ac_cxx_typename.m4 \
|
||||
$(top_srcdir)/config/ac_set_compiler.m4 \
|
||||
$(top_srcdir)/config/op_doxygen_doc.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(mkdir_p)
|
||||
CONFIG_HEADER = $(top_builddir)/config/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
am_alias_OBJECTS = alias.$(OBJEXT)
|
||||
alias_OBJECTS = $(am_alias_OBJECTS)
|
||||
alias_LDADD = $(LDADD)
|
||||
am_aliasing_OBJECTS = aliasing.$(OBJEXT)
|
||||
aliasing_OBJECTS = $(am_aliasing_OBJECTS)
|
||||
aliasing_LDADD = $(LDADD)
|
||||
am_cmm_OBJECTS = cmm.$(OBJEXT)
|
||||
cmm_OBJECTS = $(am_cmm_OBJECTS)
|
||||
cmm_LDADD = $(LDADD)
|
||||
am_cmv_OBJECTS = cmv.$(OBJEXT)
|
||||
cmv_OBJECTS = $(am_cmv_OBJECTS)
|
||||
cmv_LDADD = $(LDADD)
|
||||
am_diag_OBJECTS = diag.$(OBJEXT)
|
||||
diag_OBJECTS = $(am_diag_OBJECTS)
|
||||
diag_LDADD = $(LDADD)
|
||||
am_frob_matrix_norm_OBJECTS = frob_matrix_norm.$(OBJEXT)
|
||||
frob_matrix_norm_OBJECTS = $(am_frob_matrix_norm_OBJECTS)
|
||||
frob_matrix_norm_LDADD = $(LDADD)
|
||||
am_hspiess_OBJECTS = hspiess.$(OBJEXT)
|
||||
hspiess_OBJECTS = $(am_hspiess_OBJECTS)
|
||||
hspiess_LDADD = $(LDADD)
|
||||
am_matrix_col_OBJECTS = matrix_col.$(OBJEXT)
|
||||
matrix_col_OBJECTS = $(am_matrix_col_OBJECTS)
|
||||
matrix_col_LDADD = $(LDADD)
|
||||
am_mm_OBJECTS = mm.$(OBJEXT)
|
||||
mm_OBJECTS = $(am_mm_OBJECTS)
|
||||
mm_LDADD = $(LDADD)
|
||||
am_mv_OBJECTS = mv.$(OBJEXT)
|
||||
mv_OBJECTS = $(am_mv_OBJECTS)
|
||||
mv_LDADD = $(LDADD)
|
||||
am_ray_OBJECTS = ray.$(OBJEXT)
|
||||
ray_OBJECTS = $(am_ray_OBJECTS)
|
||||
ray_LDADD = $(LDADD)
|
||||
am_redwards_OBJECTS = redwards.$(OBJEXT)
|
||||
redwards_OBJECTS = $(am_redwards_OBJECTS)
|
||||
redwards_LDADD = $(LDADD)
|
||||
am_xpr_print_m1_OBJECTS = xpr_print_m1.$(OBJEXT)
|
||||
xpr_print_m1_OBJECTS = $(am_xpr_print_m1_OBJECTS)
|
||||
xpr_print_m1_LDADD = $(LDADD)
|
||||
am_xpr_print_m2_OBJECTS = xpr_print_m2.$(OBJEXT)
|
||||
xpr_print_m2_OBJECTS = $(am_xpr_print_m2_OBJECTS)
|
||||
xpr_print_m2_LDADD = $(LDADD)
|
||||
am_xpr_print_m3_OBJECTS = xpr_print_m3.$(OBJEXT)
|
||||
xpr_print_m3_OBJECTS = $(am_xpr_print_m3_OBJECTS)
|
||||
xpr_print_m3_LDADD = $(LDADD)
|
||||
am_xpr_print_m4_OBJECTS = xpr_print_m4.$(OBJEXT)
|
||||
xpr_print_m4_OBJECTS = $(am_xpr_print_m4_OBJECTS)
|
||||
xpr_print_m4_LDADD = $(LDADD)
|
||||
am_xpr_print_mv1_OBJECTS = xpr_print_mv1.$(OBJEXT)
|
||||
xpr_print_mv1_OBJECTS = $(am_xpr_print_mv1_OBJECTS)
|
||||
xpr_print_mv1_LDADD = $(LDADD)
|
||||
am_xpr_print_mv2_OBJECTS = xpr_print_mv2.$(OBJEXT)
|
||||
xpr_print_mv2_OBJECTS = $(am_xpr_print_mv2_OBJECTS)
|
||||
xpr_print_mv2_LDADD = $(LDADD)
|
||||
am_xpr_print_v1_OBJECTS = xpr_print_v1.$(OBJEXT)
|
||||
xpr_print_v1_OBJECTS = $(am_xpr_print_v1_OBJECTS)
|
||||
xpr_print_v1_LDADD = $(LDADD)
|
||||
am_xpr_print_v2_OBJECTS = xpr_print_v2.$(OBJEXT)
|
||||
xpr_print_v2_OBJECTS = $(am_xpr_print_v2_OBJECTS)
|
||||
xpr_print_v2_LDADD = $(LDADD)
|
||||
am_xpr_print_v3_OBJECTS = xpr_print_v3.$(OBJEXT)
|
||||
xpr_print_v3_OBJECTS = $(am_xpr_print_v3_OBJECTS)
|
||||
xpr_print_v3_LDADD = $(LDADD)
|
||||
am_xpr_print_v4_OBJECTS = xpr_print_v4.$(OBJEXT)
|
||||
xpr_print_v4_OBJECTS = $(am_xpr_print_v4_OBJECTS)
|
||||
xpr_print_v4_LDADD = $(LDADD)
|
||||
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/config
|
||||
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/alias.Po ./$(DEPDIR)/aliasing.Po \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/cmm.Po ./$(DEPDIR)/cmv.Po \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/diag.Po \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/frob_matrix_norm.Po \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/hspiess.Po ./$(DEPDIR)/matrix_col.Po \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/mm.Po ./$(DEPDIR)/mv.Po \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/ray.Po ./$(DEPDIR)/redwards.Po \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/xpr_print_m1.Po \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/xpr_print_m2.Po \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/xpr_print_m3.Po \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/xpr_print_m4.Po \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/xpr_print_mv1.Po \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/xpr_print_mv2.Po \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/xpr_print_v1.Po \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/xpr_print_v2.Po \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/xpr_print_v3.Po \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/xpr_print_v4.Po
|
||||
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
|
||||
LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \
|
||||
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(AM_CXXFLAGS) $(CXXFLAGS)
|
||||
CXXLD = $(CXX)
|
||||
CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
SOURCES = $(alias_SOURCES) $(aliasing_SOURCES) $(cmm_SOURCES) \
|
||||
$(cmv_SOURCES) $(diag_SOURCES) $(frob_matrix_norm_SOURCES) \
|
||||
$(hspiess_SOURCES) $(matrix_col_SOURCES) $(mm_SOURCES) \
|
||||
$(mv_SOURCES) $(ray_SOURCES) $(redwards_SOURCES) \
|
||||
$(xpr_print_m1_SOURCES) $(xpr_print_m2_SOURCES) \
|
||||
$(xpr_print_m3_SOURCES) $(xpr_print_m4_SOURCES) \
|
||||
$(xpr_print_mv1_SOURCES) $(xpr_print_mv2_SOURCES) \
|
||||
$(xpr_print_v1_SOURCES) $(xpr_print_v2_SOURCES) \
|
||||
$(xpr_print_v3_SOURCES) $(xpr_print_v4_SOURCES)
|
||||
DIST_SOURCES = $(alias_SOURCES) $(aliasing_SOURCES) $(cmm_SOURCES) \
|
||||
$(cmv_SOURCES) $(diag_SOURCES) $(frob_matrix_norm_SOURCES) \
|
||||
$(hspiess_SOURCES) $(matrix_col_SOURCES) $(mm_SOURCES) \
|
||||
$(mv_SOURCES) $(ray_SOURCES) $(redwards_SOURCES) \
|
||||
$(xpr_print_m1_SOURCES) $(xpr_print_m2_SOURCES) \
|
||||
$(xpr_print_m3_SOURCES) $(xpr_print_m4_SOURCES) \
|
||||
$(xpr_print_mv1_SOURCES) $(xpr_print_mv2_SOURCES) \
|
||||
$(xpr_print_v1_SOURCES) $(xpr_print_v2_SOURCES) \
|
||||
$(xpr_print_v3_SOURCES) $(xpr_print_v4_SOURCES)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CONFIG_CPPUNIT_FALSE = @CONFIG_CPPUNIT_FALSE@
|
||||
CONFIG_CPPUNIT_TRUE = @CONFIG_CPPUNIT_TRUE@
|
||||
CONFIG_DOC_FALSE = @CONFIG_DOC_FALSE@
|
||||
CONFIG_DOC_TRUE = @CONFIG_DOC_TRUE@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
|
||||
CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
|
||||
CPPUNIT_LIBS = @CPPUNIT_LIBS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CXX_DEBUG_FLAGS = @CXX_DEBUG_FLAGS@
|
||||
CXX_OPTIMIZE_FLAGS = @CXX_OPTIMIZE_FLAGS@
|
||||
CXX_WARN_FLAGS = @CXX_WARN_FLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DOXYGEN = @DOXYGEN@
|
||||
DOXYGEN_HAVE_DOT = @DOXYGEN_HAVE_DOT@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LATEX_BATCHMODE = @LATEX_BATCHMODE@
|
||||
LATEX_MODE = @LATEX_MODE@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
|
||||
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
datadir = @datadir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
AM_CXXFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include
|
||||
DISTCLEANFILES = $(EXTRA_PROGRAMS)
|
||||
xpr_print_v1_SOURCES = xpr_print_v1.cc
|
||||
xpr_print_v2_SOURCES = xpr_print_v2.cc
|
||||
xpr_print_v3_SOURCES = xpr_print_v3.cc
|
||||
xpr_print_v4_SOURCES = xpr_print_v4.cc
|
||||
xpr_print_m1_SOURCES = xpr_print_m1.cc
|
||||
xpr_print_m2_SOURCES = xpr_print_m2.cc
|
||||
xpr_print_m3_SOURCES = xpr_print_m3.cc
|
||||
xpr_print_m4_SOURCES = xpr_print_m4.cc
|
||||
xpr_print_mv1_SOURCES = xpr_print_mv1.cc
|
||||
xpr_print_mv2_SOURCES = xpr_print_mv2.cc
|
||||
mv_SOURCES = mv.cc
|
||||
mm_SOURCES = mm.cc
|
||||
cmv_SOURCES = cmv.cc
|
||||
cmm_SOURCES = cmm.cc
|
||||
matrix_col_SOURCES = matrix_col.cc
|
||||
diag_SOURCES = diag.cc
|
||||
ray_SOURCES = ray.cc
|
||||
redwards_SOURCES = redwards.cc
|
||||
hspiess_SOURCES = hspiess.cc
|
||||
frob_matrix_norm_SOURCES = frob_matrix_norm.cc
|
||||
alias_SOURCES = alias.cc
|
||||
aliasing_SOURCES = aliasing.cc
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .cc .lo .o .obj
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu examples/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
alias$(EXEEXT): $(alias_OBJECTS) $(alias_DEPENDENCIES)
|
||||
@rm -f alias$(EXEEXT)
|
||||
$(CXXLINK) $(alias_LDFLAGS) $(alias_OBJECTS) $(alias_LDADD) $(LIBS)
|
||||
aliasing$(EXEEXT): $(aliasing_OBJECTS) $(aliasing_DEPENDENCIES)
|
||||
@rm -f aliasing$(EXEEXT)
|
||||
$(CXXLINK) $(aliasing_LDFLAGS) $(aliasing_OBJECTS) $(aliasing_LDADD) $(LIBS)
|
||||
cmm$(EXEEXT): $(cmm_OBJECTS) $(cmm_DEPENDENCIES)
|
||||
@rm -f cmm$(EXEEXT)
|
||||
$(CXXLINK) $(cmm_LDFLAGS) $(cmm_OBJECTS) $(cmm_LDADD) $(LIBS)
|
||||
cmv$(EXEEXT): $(cmv_OBJECTS) $(cmv_DEPENDENCIES)
|
||||
@rm -f cmv$(EXEEXT)
|
||||
$(CXXLINK) $(cmv_LDFLAGS) $(cmv_OBJECTS) $(cmv_LDADD) $(LIBS)
|
||||
diag$(EXEEXT): $(diag_OBJECTS) $(diag_DEPENDENCIES)
|
||||
@rm -f diag$(EXEEXT)
|
||||
$(CXXLINK) $(diag_LDFLAGS) $(diag_OBJECTS) $(diag_LDADD) $(LIBS)
|
||||
frob_matrix_norm$(EXEEXT): $(frob_matrix_norm_OBJECTS) $(frob_matrix_norm_DEPENDENCIES)
|
||||
@rm -f frob_matrix_norm$(EXEEXT)
|
||||
$(CXXLINK) $(frob_matrix_norm_LDFLAGS) $(frob_matrix_norm_OBJECTS) $(frob_matrix_norm_LDADD) $(LIBS)
|
||||
hspiess$(EXEEXT): $(hspiess_OBJECTS) $(hspiess_DEPENDENCIES)
|
||||
@rm -f hspiess$(EXEEXT)
|
||||
$(CXXLINK) $(hspiess_LDFLAGS) $(hspiess_OBJECTS) $(hspiess_LDADD) $(LIBS)
|
||||
matrix_col$(EXEEXT): $(matrix_col_OBJECTS) $(matrix_col_DEPENDENCIES)
|
||||
@rm -f matrix_col$(EXEEXT)
|
||||
$(CXXLINK) $(matrix_col_LDFLAGS) $(matrix_col_OBJECTS) $(matrix_col_LDADD) $(LIBS)
|
||||
mm$(EXEEXT): $(mm_OBJECTS) $(mm_DEPENDENCIES)
|
||||
@rm -f mm$(EXEEXT)
|
||||
$(CXXLINK) $(mm_LDFLAGS) $(mm_OBJECTS) $(mm_LDADD) $(LIBS)
|
||||
mv$(EXEEXT): $(mv_OBJECTS) $(mv_DEPENDENCIES)
|
||||
@rm -f mv$(EXEEXT)
|
||||
$(CXXLINK) $(mv_LDFLAGS) $(mv_OBJECTS) $(mv_LDADD) $(LIBS)
|
||||
ray$(EXEEXT): $(ray_OBJECTS) $(ray_DEPENDENCIES)
|
||||
@rm -f ray$(EXEEXT)
|
||||
$(CXXLINK) $(ray_LDFLAGS) $(ray_OBJECTS) $(ray_LDADD) $(LIBS)
|
||||
redwards$(EXEEXT): $(redwards_OBJECTS) $(redwards_DEPENDENCIES)
|
||||
@rm -f redwards$(EXEEXT)
|
||||
$(CXXLINK) $(redwards_LDFLAGS) $(redwards_OBJECTS) $(redwards_LDADD) $(LIBS)
|
||||
xpr_print_m1$(EXEEXT): $(xpr_print_m1_OBJECTS) $(xpr_print_m1_DEPENDENCIES)
|
||||
@rm -f xpr_print_m1$(EXEEXT)
|
||||
$(CXXLINK) $(xpr_print_m1_LDFLAGS) $(xpr_print_m1_OBJECTS) $(xpr_print_m1_LDADD) $(LIBS)
|
||||
xpr_print_m2$(EXEEXT): $(xpr_print_m2_OBJECTS) $(xpr_print_m2_DEPENDENCIES)
|
||||
@rm -f xpr_print_m2$(EXEEXT)
|
||||
$(CXXLINK) $(xpr_print_m2_LDFLAGS) $(xpr_print_m2_OBJECTS) $(xpr_print_m2_LDADD) $(LIBS)
|
||||
xpr_print_m3$(EXEEXT): $(xpr_print_m3_OBJECTS) $(xpr_print_m3_DEPENDENCIES)
|
||||
@rm -f xpr_print_m3$(EXEEXT)
|
||||
$(CXXLINK) $(xpr_print_m3_LDFLAGS) $(xpr_print_m3_OBJECTS) $(xpr_print_m3_LDADD) $(LIBS)
|
||||
xpr_print_m4$(EXEEXT): $(xpr_print_m4_OBJECTS) $(xpr_print_m4_DEPENDENCIES)
|
||||
@rm -f xpr_print_m4$(EXEEXT)
|
||||
$(CXXLINK) $(xpr_print_m4_LDFLAGS) $(xpr_print_m4_OBJECTS) $(xpr_print_m4_LDADD) $(LIBS)
|
||||
xpr_print_mv1$(EXEEXT): $(xpr_print_mv1_OBJECTS) $(xpr_print_mv1_DEPENDENCIES)
|
||||
@rm -f xpr_print_mv1$(EXEEXT)
|
||||
$(CXXLINK) $(xpr_print_mv1_LDFLAGS) $(xpr_print_mv1_OBJECTS) $(xpr_print_mv1_LDADD) $(LIBS)
|
||||
xpr_print_mv2$(EXEEXT): $(xpr_print_mv2_OBJECTS) $(xpr_print_mv2_DEPENDENCIES)
|
||||
@rm -f xpr_print_mv2$(EXEEXT)
|
||||
$(CXXLINK) $(xpr_print_mv2_LDFLAGS) $(xpr_print_mv2_OBJECTS) $(xpr_print_mv2_LDADD) $(LIBS)
|
||||
xpr_print_v1$(EXEEXT): $(xpr_print_v1_OBJECTS) $(xpr_print_v1_DEPENDENCIES)
|
||||
@rm -f xpr_print_v1$(EXEEXT)
|
||||
$(CXXLINK) $(xpr_print_v1_LDFLAGS) $(xpr_print_v1_OBJECTS) $(xpr_print_v1_LDADD) $(LIBS)
|
||||
xpr_print_v2$(EXEEXT): $(xpr_print_v2_OBJECTS) $(xpr_print_v2_DEPENDENCIES)
|
||||
@rm -f xpr_print_v2$(EXEEXT)
|
||||
$(CXXLINK) $(xpr_print_v2_LDFLAGS) $(xpr_print_v2_OBJECTS) $(xpr_print_v2_LDADD) $(LIBS)
|
||||
xpr_print_v3$(EXEEXT): $(xpr_print_v3_OBJECTS) $(xpr_print_v3_DEPENDENCIES)
|
||||
@rm -f xpr_print_v3$(EXEEXT)
|
||||
$(CXXLINK) $(xpr_print_v3_LDFLAGS) $(xpr_print_v3_OBJECTS) $(xpr_print_v3_LDADD) $(LIBS)
|
||||
xpr_print_v4$(EXEEXT): $(xpr_print_v4_OBJECTS) $(xpr_print_v4_DEPENDENCIES)
|
||||
@rm -f xpr_print_v4$(EXEEXT)
|
||||
$(CXXLINK) $(xpr_print_v4_LDFLAGS) $(xpr_print_v4_OBJECTS) $(xpr_print_v4_LDADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alias.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aliasing.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmm.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmv.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diag.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/frob_matrix_norm.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hspiess.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matrix_col.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mm.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mv.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ray.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/redwards.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xpr_print_m1.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xpr_print_m2.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xpr_print_m3.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xpr_print_m4.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xpr_print_mv1.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xpr_print_mv2.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xpr_print_v1.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xpr_print_v2.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xpr_print_v3.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xpr_print_v4.Po@am__quote@
|
||||
|
||||
.cc.o:
|
||||
@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
|
||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
|
||||
|
||||
.cc.obj:
|
||||
@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
|
||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
|
||||
.cc.lo:
|
||||
@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
|
||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
-rm -f libtool
|
||||
uninstall-info-am:
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|
||||
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkdir_p) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-libtool distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-info-am
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libtool ctags distclean distclean-compile \
|
||||
distclean-generic distclean-libtool distclean-tags distdir dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-data install-data-am install-exec install-exec-am \
|
||||
install-info install-info-am install-man install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags uninstall uninstall-am uninstall-info-am
|
||||
|
||||
|
||||
examples: $(EXTRA_PROGRAMS)
|
||||
# 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:
|
||||
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
* $Id: alias.cc,v 1.1 2004/03/26 07:56:32 opetzold Exp $
|
||||
*
|
||||
* This example shows the solution of the problem with aliasing
|
||||
* mentioned at
|
||||
* http://tvmet.sourceforge.net/notes.html#alias
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
#include <tvmet/Matrix.h>
|
||||
#include <tvmet/Vector.h>
|
||||
#include <tvmet/util/Incrementor.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
typedef tvmet::Matrix<double, 3, 3> matrix_type;
|
||||
|
||||
matrix_type M;
|
||||
|
||||
std::generate(M.begin(), M.end(),
|
||||
tvmet::util::Incrementor<matrix_type::value_type>());
|
||||
|
||||
std::cout << "M = " << M << std::endl;
|
||||
|
||||
alias(M) = M * trans(M);
|
||||
|
||||
std::cout << M << std::endl;
|
||||
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
/*
|
||||
* $Id: aliasing.cc,v 1.2 2004/03/26 07:58:06 opetzold Exp $
|
||||
*
|
||||
* This example shows the problem with aliasing mentioned at
|
||||
* http://tvmet.sourceforge.net/notes.html#alias
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
#include <tvmet/Matrix.h>
|
||||
#include <tvmet/util/Incrementor.h>
|
||||
|
||||
using std::cout; using std::endl;
|
||||
using namespace tvmet;
|
||||
|
||||
typedef Matrix<double,3,3> matrix_type;
|
||||
|
||||
int main()
|
||||
{
|
||||
matrix_type A, B;
|
||||
matrix_type C;
|
||||
|
||||
std::generate(A.begin(), A.end(),
|
||||
tvmet::util::Incrementor<matrix_type::value_type>());
|
||||
std::generate(B.begin(), B.end(),
|
||||
tvmet::util::Incrementor<matrix_type::value_type>());
|
||||
|
||||
cout << "A = " << A << endl;
|
||||
cout << "B = " << B << endl;
|
||||
|
||||
// matrix prod without aliasing
|
||||
C = A * B;
|
||||
cout << "C = A * B = " << C << endl;
|
||||
|
||||
// work around for aliasing
|
||||
matrix_type temp_A(A);
|
||||
A = temp_A * B;
|
||||
cout << "matrix_type temp_A(A);\n"
|
||||
<< "A = temp_A * B = " << A << endl;
|
||||
|
||||
// this shows the aliasing problem
|
||||
A = A * B;
|
||||
cout << "A = A * B = " << A << endl;
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
#include <iostream>
|
||||
#include <complex>
|
||||
|
||||
#include <tvmet/Matrix.h>
|
||||
|
||||
using namespace tvmet;
|
||||
using std::cout;
|
||||
using std::endl;
|
||||
|
||||
typedef Matrix<std::complex<double>,3,3> matrix33d;
|
||||
|
||||
void testMM(matrix33d& res, const matrix33d& m1, const matrix33d& m2) {
|
||||
res = m1 * m2;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
matrix33d m1, m2, m3;
|
||||
|
||||
m1 = 1,4,7,
|
||||
2,5,8,
|
||||
3,6,9;
|
||||
m2 = m1;
|
||||
|
||||
testMM(m3, m1, m2);
|
||||
|
||||
cout << m1 << "\n*\n" << m2 << "\n=";
|
||||
cout << m3 << endl;
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
#include <iostream>
|
||||
#include <complex>
|
||||
|
||||
#include <tvmet/Matrix.h>
|
||||
#include <tvmet/Vector.h>
|
||||
|
||||
using namespace tvmet;
|
||||
using std::cout;
|
||||
using std::endl;
|
||||
|
||||
typedef Vector<std::complex<double>,3> vector3d;
|
||||
typedef Matrix<std::complex<double>,3,3> matrix33d;
|
||||
|
||||
#if (defined __ICC )
|
||||
#pragma warning(disable:1418) // external definition with no prior declaration
|
||||
#endif
|
||||
|
||||
void testMV(vector3d& res, const matrix33d& m, const vector3d& v) {
|
||||
res = m * v;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
vector3d v1, vr;
|
||||
matrix33d m1;
|
||||
|
||||
v1 = 1,2,3;
|
||||
m1 = 1,4,7,
|
||||
2,5,8,
|
||||
3,6,9;
|
||||
|
||||
testMV(vr, m1, v1);
|
||||
|
||||
cout << m1 << " * " << v1 << " =\n";
|
||||
cout << vr << endl;
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
/* Version: $Id: diag.cc,v 1.1 2003/02/12 19:03:48 opetzold Exp $ */
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include <tvmet/Matrix.h>
|
||||
#include <tvmet/Vector.h>
|
||||
|
||||
|
||||
using namespace std;
|
||||
using namespace tvmet;
|
||||
|
||||
typedef Matrix<double,3,3> matrix33d;
|
||||
typedef Vector<double,3> vector3d;
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
matrix33d m1, m2(0);
|
||||
vector3d v1, v2;
|
||||
|
||||
m1 = 1,4,7,
|
||||
2,5,8,
|
||||
3,6,9;
|
||||
v1 = diag(m1);
|
||||
|
||||
// not yet, since we need to assign an expression/scalar to an expression
|
||||
// diag(m2) = 1.0;
|
||||
|
||||
cout << "M1 = " << m1 << endl;
|
||||
cout << "diag(M1) = " << v1 << endl;
|
||||
cout << "identity(M2) = " << m2 << endl;
|
||||
}
|
||||
@@ -1,191 +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: frob_matrix_norm.cc,v 1.3 2003/11/30 08:26:25 opetzold Exp $
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <tvmet/Matrix.h>
|
||||
#include <tvmet/xpr/Vector.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
template<class T, int Rows, int Cols>
|
||||
double
|
||||
frob_norm(const tvmet::Matrix<T, Rows, Cols>& M) {
|
||||
return std::sqrt(M(0,0)*M(0,0) + M(1,0)*M(1,0) + M(2,0)*M(2,0)
|
||||
+ M(0,1)*M(0,1) + M(1,1)*M(1,1) + M(2,1)*M(2,1)
|
||||
+ M(0,2)*M(0,2) + M(1,2)*M(1,2) + M(2,2)*M(2,2));
|
||||
}
|
||||
|
||||
namespace tvmet {
|
||||
template<class T, int Rows, int Cols>
|
||||
typename Traits<T>::float_type
|
||||
norm(const Matrix<T, Rows, Cols>& M) {
|
||||
return std::sqrt( sum( diag( MtM_prod(M,M) ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
typedef tvmet::Matrix<double,3,3> matrix_type;
|
||||
|
||||
matrix_type M;
|
||||
|
||||
M = 1,2,3,4,5,6,7,8,9;
|
||||
cout << M << endl;
|
||||
|
||||
cout << "handopt norm = " << frob_norm(M) << endl;
|
||||
cout << "tvmet::norm = " << tvmet::norm(M) << endl;
|
||||
}
|
||||
|
||||
/*
|
||||
gcc 3.3 produce for the hand optimized frob_norm:
|
||||
|
||||
_Z9frob_normIdLj3ELj3EEdRKN5tvmet6MatrixIT_XT0_EXT1_EEE:
|
||||
.LFB3210:
|
||||
pushl %ebp
|
||||
.LCFI6:
|
||||
movl %esp, %ebp
|
||||
.LCFI7:
|
||||
subl $8, %esp
|
||||
.LCFI8:
|
||||
movl 8(%ebp), %eax
|
||||
fldl (%eax)
|
||||
fldl 24(%eax)
|
||||
fxch %st(1)
|
||||
fmul %st(0), %st
|
||||
fxch %st(1)
|
||||
fmul %st(0), %st
|
||||
faddp %st, %st(1)
|
||||
fldl 48(%eax)
|
||||
fmul %st(0), %st
|
||||
faddp %st, %st(1)
|
||||
fldl 8(%eax)
|
||||
fmul %st(0), %st
|
||||
faddp %st, %st(1)
|
||||
fldl 32(%eax)
|
||||
fmul %st(0), %st
|
||||
faddp %st, %st(1)
|
||||
fldl 56(%eax)
|
||||
fmul %st(0), %st
|
||||
faddp %st, %st(1)
|
||||
fldl 16(%eax)
|
||||
fmul %st(0), %st
|
||||
faddp %st, %st(1)
|
||||
fldl 40(%eax)
|
||||
fmul %st(0), %st
|
||||
faddp %st, %st(1)
|
||||
fldl 64(%eax)
|
||||
fmul %st(0), %st
|
||||
faddp %st, %st(1)
|
||||
fld %st(0)
|
||||
fsqrt
|
||||
fucom %st(0)
|
||||
fnstsw %ax
|
||||
sahf
|
||||
jp .L189
|
||||
jne .L189
|
||||
fstp %st(1)
|
||||
.L186:
|
||||
leave
|
||||
ret
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
gcc 3.3 produce the norm function using tvmet 1.3.0:
|
||||
|
||||
_ZN5tvmet4normIdLj3ELj3EEENS_13TraitsIT_E10float_typeERKNS_6MatrixIS2_XT0_EXT1_EEE:
|
||||
.LFB3252:
|
||||
.L194:
|
||||
.L198:
|
||||
.L203:
|
||||
.L207:
|
||||
.L212:
|
||||
.L225:
|
||||
.L238:
|
||||
.L251:
|
||||
pushl %ebp
|
||||
.LCFI9:
|
||||
movl %esp, %ebp
|
||||
.LCFI10:
|
||||
subl $56, %esp
|
||||
.LCFI11:
|
||||
movl 8(%ebp), %edx
|
||||
leal -24(%ebp), %eax
|
||||
movl %eax, -12(%ebp)
|
||||
leal -12(%ebp), %eax
|
||||
fldl 24(%edx)
|
||||
fldl 48(%edx)
|
||||
fldl (%edx)
|
||||
fxch %st(2)
|
||||
fmul %st(0), %st
|
||||
fxch %st(1)
|
||||
movl %eax, -28(%ebp)
|
||||
fmul %st(0), %st
|
||||
fxch %st(2)
|
||||
movl %edx, -24(%ebp)
|
||||
movl %edx, -20(%ebp)
|
||||
fmul %st(0), %st
|
||||
fldl 8(%edx)
|
||||
fxch %st(2)
|
||||
faddp %st, %st(3)
|
||||
fldl 56(%edx)
|
||||
fxch %st(2)
|
||||
fmul %st(0), %st
|
||||
fxch %st(1)
|
||||
faddp %st, %st(3)
|
||||
fldl 32(%edx)
|
||||
fxch %st(2)
|
||||
fmul %st(0), %st
|
||||
fxch %st(2)
|
||||
fmul %st(0), %st
|
||||
fldl 16(%edx)
|
||||
fxch %st(1)
|
||||
faddp %st, %st(3)
|
||||
fmul %st(0), %st
|
||||
fldl 64(%edx)
|
||||
fxch %st(2)
|
||||
faddp %st, %st(3)
|
||||
fldl 40(%edx)
|
||||
fxch %st(2)
|
||||
fmul %st(0), %st
|
||||
fxch %st(2)
|
||||
fmul %st(0), %st
|
||||
faddp %st, %st(2)
|
||||
faddp %st, %st(1)
|
||||
faddp %st, %st(1)
|
||||
faddp %st, %st(1)
|
||||
fld %st(0)
|
||||
fsqrt
|
||||
fucom %st(0)
|
||||
fnstsw %ax
|
||||
sahf
|
||||
jp .L265
|
||||
jne .L265
|
||||
fstp %st(1)
|
||||
.L261:
|
||||
fstpl -8(%ebp)
|
||||
fldl -8(%ebp)
|
||||
leave
|
||||
ret
|
||||
|
||||
*/
|
||||
@@ -1,37 +0,0 @@
|
||||
#include <iostream>
|
||||
|
||||
#include <tvmet/Matrix.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main()
|
||||
{
|
||||
tvmet::Matrix<double,3,2> B;
|
||||
tvmet::Matrix<double,3,3> D;
|
||||
|
||||
B =
|
||||
-0.05, 0,
|
||||
0, 0.05,
|
||||
0.05, -0.05;
|
||||
D =
|
||||
2000, 1000, 0,
|
||||
1000, 2000, 0,
|
||||
0, 0, 500;
|
||||
|
||||
cout << "B = " << B << endl;
|
||||
cout << "D = " << D << endl;
|
||||
|
||||
{
|
||||
tvmet::Matrix<double,2,2> K;
|
||||
|
||||
K = trans(B) * D * B;
|
||||
cout << "K = " << K << endl;
|
||||
}
|
||||
|
||||
{
|
||||
tvmet::Matrix<double,2,2> K;
|
||||
|
||||
K = tvmet::Matrix<double,2,3>(trans(B) * D) * B;
|
||||
cout << "K = " << K << endl;
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <algorithm>
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
#include <tvmet/Matrix.h>
|
||||
#include <tvmet/Vector.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace tvmet;
|
||||
|
||||
typedef Vector<double,3> vector3d;
|
||||
typedef Matrix<double,3,3> matrix33d;
|
||||
|
||||
int main()
|
||||
{
|
||||
matrix33d m1;
|
||||
|
||||
std::generate(m1.begin(), m1.end(), std::rand);
|
||||
|
||||
vector3d vc0( col(m1, 0) );
|
||||
vector3d vc1( col(m1, 1) );
|
||||
vector3d vc2( col(m1, 2) );
|
||||
|
||||
vector3d vr0( row(m1, 0) );
|
||||
vector3d vr1( row(m1, 1) );
|
||||
vector3d vr2( row(m1, 2) );
|
||||
|
||||
|
||||
cout << std::setw(12) << m1 << endl;
|
||||
|
||||
cout << "col vectors:" << endl;
|
||||
cout << vc0 << endl;
|
||||
cout << vc1 << endl;
|
||||
cout << vc2 << endl;
|
||||
|
||||
cout << "row vectors:" << endl;
|
||||
cout << vr0 << endl;
|
||||
cout << vr1 << endl;
|
||||
cout << vr2 << endl;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
#include <iostream>
|
||||
#include <tvmet/Matrix.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace tvmet;
|
||||
|
||||
typedef Matrix<double,3,3> matrix33d;
|
||||
|
||||
#if (defined __ICC )
|
||||
#pragma warning(disable:1418) // external definition with no prior declaration
|
||||
#endif
|
||||
|
||||
void testMM(matrix33d& res, const matrix33d& m1, const matrix33d& m2) {
|
||||
res = m1 * m2;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
matrix33d m1, m2, m3;
|
||||
|
||||
m1 = 1,4,7,
|
||||
2,5,8,
|
||||
3,6,9;
|
||||
m2 = m1;
|
||||
|
||||
testMM(m3, m1, m2);
|
||||
|
||||
cout << m1 << "\n*\n" << m2 << "\n=";
|
||||
cout << m3 << endl;
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <algorithm>
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
#include <tvmet/Matrix.h>
|
||||
#include <tvmet/Vector.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace tvmet;
|
||||
|
||||
typedef Vector<double,3> vector3d;
|
||||
typedef Matrix<double,3,3> matrix33d;
|
||||
|
||||
#if (defined __ICC )
|
||||
#pragma warning(disable:1418) // external definition with no prior declaration
|
||||
#endif
|
||||
|
||||
void testMV(vector3d& res, const matrix33d& m, const vector3d& v) {
|
||||
res = m * v;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
vector3d v1, vr;
|
||||
matrix33d m1;
|
||||
|
||||
std::generate(v1.begin(), v1.end(), std::rand);
|
||||
std::generate(m1.begin(), m1.end(), std::rand);
|
||||
|
||||
testMV(vr, m1, v1);
|
||||
|
||||
cout << std::setw(12) << m1 << " * " << std::setw(12) << v1 << " =\n";
|
||||
cout << std::setw(12) << vr << endl;
|
||||
}
|
||||
@@ -1,103 +0,0 @@
|
||||
#include <iostream>
|
||||
#include <cmath>
|
||||
|
||||
#include <tvmet/Vector.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace tvmet;
|
||||
|
||||
typedef Vector<double,3> vector3d;
|
||||
|
||||
void reflect(vector3d& reflection, const vector3d& ray, const vector3d& surfaceNormal)
|
||||
{
|
||||
// The surface normal must be unit length to use this equation.
|
||||
reflection = ray - 2 * dot(ray,surfaceNormal) * surfaceNormal;
|
||||
|
||||
// expression printing
|
||||
// cout << (ray - 2 * dot(ray,surfaceNormal) * surfaceNormal) << endl;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
vector3d x, y, z;
|
||||
|
||||
// y will be the incident ray
|
||||
y[0] = 1;
|
||||
y[1] = 0;
|
||||
y[2] = -1;
|
||||
|
||||
// z is the surface normal
|
||||
z[0] = 0;
|
||||
z[1] = 0;
|
||||
z[2] = 1;
|
||||
|
||||
reflect(x, y, z);
|
||||
|
||||
cout << "Reflected ray is: [ " << x[0] << " " << x[1] << " " << x[2]
|
||||
<< " ]" << endl;
|
||||
}
|
||||
|
||||
/*****************************************************************************************
|
||||
gcc 3.2.0 produce this code (i586) using tvmet 1.3.0:
|
||||
|
||||
_Z7reflectRN5tvmet6VectorIdLj3EEERKS1_S4_:
|
||||
.LFB2757:
|
||||
.L8:
|
||||
.L18:
|
||||
.L22:
|
||||
.L28:
|
||||
.L32:
|
||||
.L38:
|
||||
.L44:
|
||||
.L48:
|
||||
pushl %ebp
|
||||
.LCFI0:
|
||||
movl %esp, %ebp
|
||||
.LCFI1:
|
||||
leal -32(%ebp), %eax
|
||||
pushl %ebx
|
||||
.LCFI2:
|
||||
subl $52, %esp
|
||||
.LCFI3:
|
||||
movl 16(%ebp), %edx
|
||||
movl %eax, -24(%ebp)
|
||||
movl 12(%ebp), %ecx
|
||||
leal -36(%ebp), %eax
|
||||
movl %eax, -20(%ebp)
|
||||
movl 8(%ebp), %ebx
|
||||
leal -24(%ebp), %eax
|
||||
fldl 8(%edx)
|
||||
fldl 16(%edx)
|
||||
fmull 16(%ecx)
|
||||
fxch %st(1)
|
||||
movl %eax, -12(%ebp)
|
||||
leal -52(%ebp), %eax
|
||||
fmull 8(%ecx)
|
||||
movl %eax, -48(%ebp)
|
||||
leal -12(%ebp), %eax
|
||||
fldl (%edx)
|
||||
fmull (%ecx)
|
||||
fxch %st(1)
|
||||
movl %eax, -44(%ebp)
|
||||
faddp %st, %st(2)
|
||||
faddp %st, %st(1)
|
||||
fadd %st(0), %st
|
||||
fld %st(0)
|
||||
fstl -32(%ebp)
|
||||
fxch %st(1)
|
||||
fmull (%edx)
|
||||
fsubrl (%ecx)
|
||||
fstpl (%ebx)
|
||||
fld %st(0)
|
||||
fmull 8(%edx)
|
||||
fsubrl 8(%ecx)
|
||||
fstpl 8(%ebx)
|
||||
fmull 16(%edx)
|
||||
fsubrl 16(%ecx)
|
||||
fstpl 16(%ebx)
|
||||
addl $52, %esp
|
||||
popl %ebx
|
||||
popl %ebp
|
||||
ret
|
||||
|
||||
*****************************************************************************************/
|
||||
@@ -1,25 +0,0 @@
|
||||
/*
|
||||
* This is a reused case study used as example from Rusell Edwards.
|
||||
* Works only with > release-1-2-0 due to a missed
|
||||
* product/operator*(Matrix,XprVector) on releases prior.
|
||||
* It shows a possible use of chained expressions.
|
||||
*/
|
||||
#include <iostream>
|
||||
|
||||
#include <tvmet/Matrix.h>
|
||||
#include <tvmet/Vector.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace tvmet;
|
||||
|
||||
int main() {
|
||||
Matrix<float,3,3> eigenvecs;
|
||||
Matrix<float,3,3> M;
|
||||
|
||||
eigenvecs = 1,2,3,4,5,6,7,8,9;
|
||||
M = 10,20,30,40,50,60,70,80,90;
|
||||
|
||||
Vector<float,3> ev0( M * col(eigenvecs, 0));
|
||||
|
||||
cout << "ev0 = " << ev0 << endl;
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
#include <iostream>
|
||||
#include <tvmet/Matrix.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace tvmet;
|
||||
|
||||
int main() {
|
||||
// Matrix stuff I
|
||||
Matrix<double,3,3> m1, m2, m3;
|
||||
m1 = 1,2,3,
|
||||
4,5,6,
|
||||
7,8,9;
|
||||
m2 = trans(m1);
|
||||
|
||||
cout << "Xpr Level printing of "
|
||||
<< m1 << "\n*\n" << m2 <<"\nresults into:\n";
|
||||
cout << m1*m2 << endl;
|
||||
cout << "The result =\n";
|
||||
m3 = m1*m2;
|
||||
cout << m3 << endl << endl;
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
#include <iostream>
|
||||
#include <tvmet/Matrix.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace tvmet;
|
||||
|
||||
int main() {
|
||||
// Matrix stuff II (unary functions)
|
||||
Matrix<double,3,3> m1, m2, m3;
|
||||
m1 = 1,2,3,
|
||||
4,5,6,
|
||||
7,8,9;
|
||||
m2 = trans(m1);
|
||||
|
||||
cout << "Xpr Level printing of "
|
||||
<< "sqrt(\n" << m1 <<"):\n";
|
||||
cout << sqrt(m1) << endl;
|
||||
cout << "The result = \n";
|
||||
m3 = sqrt(m1);
|
||||
cout << m3 << endl << endl;
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
#include <iostream>
|
||||
#include <tvmet/Matrix.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace tvmet;
|
||||
|
||||
int main() {
|
||||
// Matrix stuff III (binary functions)
|
||||
Matrix<double,3,3> m1, m2, m3;
|
||||
m1 = 1,2,3,
|
||||
4,5,6,
|
||||
7,8,9;
|
||||
m2 = trans(m1);
|
||||
|
||||
cout << "Xpr Level printing of "
|
||||
<< "pow(\n" << m1 << ", " << m2 << "):\n";
|
||||
cout << pow(m1, m2) << endl;
|
||||
cout << "The result = \n";
|
||||
m3 = pow(m1, m2);
|
||||
cout << m3 << endl << endl;
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
#include <iostream>
|
||||
#include <tvmet/Matrix.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace tvmet;
|
||||
|
||||
int main() {
|
||||
// Matrix stuff IV (binary functions with pod)
|
||||
Matrix<double,3,3> m1, m2, m3;
|
||||
m1 = 1,2,3,
|
||||
4,5,6,
|
||||
7,8,9;
|
||||
m2 = trans(m1);
|
||||
|
||||
cout << "Xpr Level printing of "
|
||||
<< "pow(\n" << m1 << ", " << 3 << "):\n";
|
||||
cout << pow(m1, 3) << endl;
|
||||
cout << "The result = \n";
|
||||
m3 = pow(m1, 3);
|
||||
cout << m3 << endl << endl;
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
#include <iostream>
|
||||
#include <tvmet/Vector.h>
|
||||
#include <tvmet/Matrix.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace tvmet;
|
||||
|
||||
int main() {
|
||||
// Matrix Vector stuff I
|
||||
Vector<double,3> v1(1,2,3), v2(v1);
|
||||
Vector<double,3> v3(0);
|
||||
|
||||
Matrix<double,3,3> m1, m2, m3;
|
||||
m1 = 1,2,3,
|
||||
4,5,6,
|
||||
7,8,9;
|
||||
m2 = trans(m1);
|
||||
|
||||
cout << "Xpr Level printing of "
|
||||
<< m1 << "\n* " << v1 <<"\nresults into:\n";
|
||||
cout << m1*v1 << endl;
|
||||
cout << "The result =\n";
|
||||
v3 = m1*v1;
|
||||
cout << v3 << endl << endl;
|
||||
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
#include <iostream>
|
||||
#include <tvmet/Vector.h>
|
||||
#include <tvmet/Matrix.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace tvmet;
|
||||
|
||||
int main() {
|
||||
// Matrix Vector stuff II
|
||||
Vector<double,3> v1(1,2,3), v2(v1);
|
||||
Vector<double,3> v3(0);
|
||||
|
||||
Matrix<double,3,3> m1, m2, m3;
|
||||
m1 = 1,2,3,
|
||||
4,5,6,
|
||||
7,8,9;
|
||||
m2 = trans(m1);
|
||||
|
||||
cout << "Xpr Level printing of "
|
||||
<< "sqrt(\n" << m1 << "\n* " << v1 << ")\nresults into:\n";
|
||||
cout << sqrt(m1*v1) << endl;
|
||||
cout << "The result =\n";
|
||||
v3 = sqrt(m1*v1);
|
||||
cout << v3 << endl << endl;
|
||||
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
#include <iostream>
|
||||
#include <tvmet/Vector.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace tvmet;
|
||||
|
||||
int main() {
|
||||
// Vector stuff I
|
||||
Vector<double,3> v1(1,2,3), v2(v1);
|
||||
Vector<double,3> v3(0);
|
||||
|
||||
cout << "Xpr Level printing of "
|
||||
<< v1 << " * " << v2 <<":\n";
|
||||
cout << v1*v2 << endl;
|
||||
cout << "The result = \n";
|
||||
v3 = v1*v2;
|
||||
cout << v3 << endl << endl;
|
||||
}
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#include <iostream>
|
||||
#include <tvmet/Vector.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace tvmet;
|
||||
|
||||
int main() {
|
||||
// Vector stuff II (unary functions)
|
||||
Vector<double,3> v1(1,2,3), v2(v1);
|
||||
Vector<double,3> v3(0);
|
||||
|
||||
cout << "Xpr Level printing of "
|
||||
<< "sqrt(" << v1 <<"):\n";
|
||||
cout << sqrt(v1) << endl;
|
||||
cout << "The result = \n";
|
||||
v3 = sqrt(v1);
|
||||
cout << v3 << endl << endl;
|
||||
}
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#include <iostream>
|
||||
#include <tvmet/Vector.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace tvmet;
|
||||
|
||||
int main() {
|
||||
// Vector stuff III (binary functions)
|
||||
Vector<double,3> v1(1,2,3), v2(v1);
|
||||
Vector<double,3> v3(0);
|
||||
|
||||
cout << "Xpr Level printing of "
|
||||
<< "pow(" << v1 << ", " << v2 << "):\n";
|
||||
cout << pow(v1, v2) << endl;
|
||||
cout << "The result = \n";
|
||||
v3 = pow(v1, v2);
|
||||
cout << v3 << endl << endl;
|
||||
}
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#include <iostream>
|
||||
#include <tvmet/Vector.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace tvmet;
|
||||
|
||||
int main() {
|
||||
// Vector stuff IV (binary functions with pod)
|
||||
Vector<double,3> v1(1,2,3), v2(v1);
|
||||
Vector<double,3> v3(0);
|
||||
|
||||
cout << "Xpr Level printing of "
|
||||
<< "pow(" << v1 << ", " << 3 << "):\n";
|
||||
cout << pow(v1, 3) << endl;
|
||||
cout << "The result = \n";
|
||||
v3 = pow(v1, 3);
|
||||
cout << v3 << endl << endl;
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
ADD_SUBDIRECTORY(tvmet)
|
||||
@@ -1,127 +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: AliasProxy.h,v 1.4 2004/06/10 16:36:55 opetzold Exp $
|
||||
*/
|
||||
|
||||
#ifndef TVMET_ALIAS_PROXY_H
|
||||
#define TVMET_ALIAS_PROXY_H
|
||||
|
||||
namespace tvmet {
|
||||
|
||||
|
||||
/** forwards */
|
||||
template<class E> class AliasProxy;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Simplify syntax for alias Matrices and Vectors,
|
||||
* where aliasing left hand values appear in the
|
||||
* expression.
|
||||
* \par Example:
|
||||
* \code
|
||||
* typedef tvmet::Matrix<double, 10, 10> matrix_type;
|
||||
* matrix_type m;
|
||||
* ...
|
||||
* alias(m) += trans(m);
|
||||
* \endcode
|
||||
* \sa AliasProxy
|
||||
* \sa Some Notes \ref alias
|
||||
*/
|
||||
template<class E>
|
||||
AliasProxy<E> alias(E& expr) { return AliasProxy<E>(expr); }
|
||||
|
||||
|
||||
/**
|
||||
* \class AliasProxy AliasProxy.h "tvmet/AliasProxy.h"
|
||||
* \brief Assign proxy for alias Matrices and Vectors.
|
||||
*
|
||||
* A short lived object to provide simplified alias syntax.
|
||||
* Only the friend function alias is allowed to create
|
||||
* such a object. The proxy calls the appropriate member
|
||||
* alias_xyz() which have to use temporaries to avoid
|
||||
* overlapping memory regions.
|
||||
* \sa alias
|
||||
* \sa Some Notes \ref alias
|
||||
* \note Thanks to ublas-dev group, where the principle idea
|
||||
* comes from.
|
||||
*/
|
||||
template<class E>
|
||||
class AliasProxy
|
||||
{
|
||||
AliasProxy(const AliasProxy&);
|
||||
AliasProxy& operator=(const AliasProxy&);
|
||||
|
||||
friend AliasProxy<E> alias<>(E& expr);
|
||||
|
||||
public:
|
||||
AliasProxy(E& expr) : m_expr(expr) { }
|
||||
|
||||
|
||||
template<class E2>
|
||||
E& operator=(const E2& expr) {
|
||||
return m_expr.alias_assign(expr);
|
||||
}
|
||||
|
||||
template<class E2>
|
||||
E& operator+=(const E2& expr) {
|
||||
return m_expr.alias_add_eq(expr);
|
||||
}
|
||||
|
||||
template<class E2>
|
||||
E& operator-=(const E2& expr) {
|
||||
return m_expr.alias_sub_eq(expr);
|
||||
}
|
||||
|
||||
template<class E2>
|
||||
E& operator*=(const E2& expr) {
|
||||
return m_expr.alias_mul_eq(expr);
|
||||
}
|
||||
|
||||
template<class E2>
|
||||
E& operator/=(const E2& expr) {
|
||||
return m_expr.alias_div_eq(expr);
|
||||
}
|
||||
|
||||
private:
|
||||
E& m_expr;
|
||||
};
|
||||
|
||||
|
||||
#if 0
|
||||
namespace element_wise {
|
||||
// \todo to write
|
||||
template<class E, class E2>
|
||||
E& operator/=(AliasProxy<E>& proxy, const E2& rhs) {
|
||||
return proxy.div_upd(rhs);
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
} // namespace tvmet
|
||||
|
||||
|
||||
#endif /* TVMET_ALIAS_PROXY_H */
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
@@ -1,178 +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: BinaryFunctionals.h,v 1.19 2004/10/04 11:40:46 opetzold Exp $
|
||||
*/
|
||||
|
||||
#ifndef TVMET_BINARY_FUNCTIONAL_H
|
||||
#define TVMET_BINARY_FUNCTIONAL_H
|
||||
|
||||
namespace tvmet {
|
||||
|
||||
/**
|
||||
* \class Fcnl_assign BinaryFunctionals.h "tvmet/BinaryFunctionals.h"
|
||||
* \brief Binary operator for assign operations.
|
||||
*
|
||||
* Unfortunally we have sometimes to cast on assign operations e.g.,
|
||||
* on assign on different POD. So we avoid warnings.
|
||||
*/
|
||||
template <class T1, class T2>
|
||||
struct Fcnl_assign : public BinaryFunctional {
|
||||
static inline
|
||||
void apply_on(T1& _tvmet_restrict lhs, T2 rhs) {
|
||||
lhs = static_cast<T1>(rhs);
|
||||
}
|
||||
|
||||
static
|
||||
void print_xpr(std::ostream& os, int l=0) {
|
||||
os << IndentLevel(l) << "fcnl_assign<T1="
|
||||
<< typeid(T1).name() << ", T2=" << typeid(T2).name() << ">,"
|
||||
<< std::endl;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/** \class Fcnl_add_eq BinaryFunctionals.h "tvmet/BinaryFunctionals.h" */
|
||||
/** \class Fcnl_sub_eq BinaryFunctionals.h "tvmet/BinaryFunctionals.h" */
|
||||
/** \class Fcnl_mul_eq BinaryFunctionals.h "tvmet/BinaryFunctionals.h" */
|
||||
/** \class Fcnl_div_eq BinaryFunctionals.h "tvmet/BinaryFunctionals.h" */
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME, OP) \
|
||||
template <class T1, class T2> \
|
||||
struct Fcnl_##NAME : public BinaryFunctional { \
|
||||
typedef void value_type; \
|
||||
\
|
||||
static inline \
|
||||
void apply_on(T1& _tvmet_restrict lhs, T2 rhs) { \
|
||||
lhs OP rhs; \
|
||||
} \
|
||||
\
|
||||
static \
|
||||
void print_xpr(std::ostream& os, int l=0) { \
|
||||
os << IndentLevel(l) \
|
||||
<< "Fcnl_" << #NAME << "<T1=" \
|
||||
<< typeid(T1).name() << ", T2=" << typeid(T2).name() << ">," \
|
||||
<< std::endl; \
|
||||
} \
|
||||
};
|
||||
|
||||
TVMET_IMPLEMENT_MACRO(add_eq, +=)
|
||||
TVMET_IMPLEMENT_MACRO(sub_eq, -=)
|
||||
TVMET_IMPLEMENT_MACRO(mul_eq, *=)
|
||||
TVMET_IMPLEMENT_MACRO(div_eq, /=)
|
||||
|
||||
#undef TVMET_IMPLEMENT_MACRO
|
||||
|
||||
|
||||
/** \class Fcnl_add BinaryFunctionals.h "tvmet/BinaryFunctionals.h" */
|
||||
/** \class Fcnl_sub BinaryFunctionals.h "tvmet/BinaryFunctionals.h" */
|
||||
/** \class Fcnl_mul BinaryFunctionals.h "tvmet/BinaryFunctionals.h" */
|
||||
/** \class Fcnl_div BinaryFunctionals.h "tvmet/BinaryFunctionals.h" */
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME, OP) \
|
||||
template <class T1, class T2> \
|
||||
struct Fcnl_##NAME : public BinaryFunctional { \
|
||||
typedef typename PromoteTraits<T1, T2>::value_type value_type; \
|
||||
\
|
||||
static inline \
|
||||
value_type apply_on(T1 lhs, T2 rhs) { \
|
||||
return lhs OP rhs; \
|
||||
} \
|
||||
\
|
||||
static \
|
||||
void print_xpr(std::ostream& os, int l=0) { \
|
||||
os << IndentLevel(l) \
|
||||
<< "Fcnl_" << #NAME << "<T1=" \
|
||||
<< typeid(T1).name() << ", T2=" << typeid(T2).name() << ">," \
|
||||
<< std::endl; \
|
||||
} \
|
||||
};
|
||||
|
||||
TVMET_IMPLEMENT_MACRO(add, +)
|
||||
TVMET_IMPLEMENT_MACRO(sub, -)
|
||||
TVMET_IMPLEMENT_MACRO(mul, *)
|
||||
TVMET_IMPLEMENT_MACRO(div, /)
|
||||
|
||||
#undef TVMET_IMPLEMENT_MACRO
|
||||
|
||||
#if defined(EIGEN_USE_COMPLEX)
|
||||
/**
|
||||
* \class Fcnl_polar BinaryFunctionals.h "tvmet/BinaryFunctionals.h"
|
||||
* \brief %Functional for polar.
|
||||
*/
|
||||
template <class T1, class T2> struct Fcnl_polar : public BinaryFunctional { };
|
||||
|
||||
|
||||
/**
|
||||
* \class Fcnl_polar<T,T> BinaryFunctionals.h "tvmet/BinaryFunctionals.h"
|
||||
* \brief %Functional for polar.
|
||||
* \note This functional is partialy specialized due to the declaration
|
||||
* of %polar in namespace std <tt>complex<T> polar(T, T)</tt>.
|
||||
* This means especially that type promotion isn't avaible here.
|
||||
*/
|
||||
template <class T>
|
||||
struct Fcnl_polar<T,T> : public BinaryFunctional {
|
||||
typedef std::complex<T> value_type;
|
||||
|
||||
static inline
|
||||
value_type apply_on(T lhs, T rhs) {
|
||||
return std::polar(lhs, rhs);
|
||||
}
|
||||
|
||||
static
|
||||
void print_xpr(std::ostream& os, int l=0) {
|
||||
os << IndentLevel(l) << "Fcnl_polar<T1="
|
||||
<< typeid(T).name() << ", T2=" << typeid(T).name() << ">,"
|
||||
<< std::endl;
|
||||
}
|
||||
};
|
||||
#endif // defined(EIGEN_USE_COMPLEX)
|
||||
|
||||
|
||||
/**
|
||||
* \class Fcnl_swap BinaryFunctionals.h "tvmet/BinaryFunctionals.h"
|
||||
* \brief Binary operator for swapping values using temporaries.
|
||||
* \todo check for std::swap implementation; todo before LUdecomp
|
||||
*/
|
||||
template <class T1, class T2>
|
||||
struct Fcnl_swap : public BinaryFunctional {
|
||||
static inline
|
||||
void apply_on(T1& _tvmet_restrict lhs, T2& _tvmet_restrict rhs) {
|
||||
typedef typename PromoteTraits<T1, T2>::value_type temp_type;
|
||||
|
||||
temp_type temp(lhs);
|
||||
lhs = static_cast<T1>(rhs);
|
||||
rhs = static_cast<T2>(temp);
|
||||
}
|
||||
|
||||
static
|
||||
void print_xpr(std::ostream& os, int l=0) {
|
||||
os << IndentLevel(l) << "Fcnl_swap<T1="
|
||||
<< typeid(T1).name() << ", T2" << typeid(T2).name() << ">,"
|
||||
<< std::endl;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace tvmet
|
||||
|
||||
#endif // TVMET_BINARY_FUNCTIONAL_H
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
@@ -1,30 +0,0 @@
|
||||
INCLUDE (CheckIncludeFiles)
|
||||
INCLUDE (CheckRestrictKeyword)
|
||||
INCLUDE (CheckAlwaysInline)
|
||||
|
||||
FILE(GLOB tvmet_header_SRCS "*.h")
|
||||
|
||||
CHECK_INCLUDE_FILES (sys/time.h TVMET_HAVE_SYS_TIME_H)
|
||||
CHECK_INCLUDE_FILES (unistd.h TVMET_HAVE_UNISTD_H)
|
||||
CHECK_RESTRICT_KEYWORD (TVMET_RESTRICT_KEYWORD)
|
||||
CHECK_ALWAYS_INLINE (TVMET_ALWAYS_INLINE)
|
||||
|
||||
# the following are directories where stuff will be installed to
|
||||
SET(INCLUDE_INSTALL_DIR
|
||||
"${CMAKE_INSTALL_PREFIX}/include/tvmet"
|
||||
CACHE PATH
|
||||
"The subdirectory to the header prefix"
|
||||
FORCE)
|
||||
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake
|
||||
${INCLUDE_INSTALL_DIR}/config.h)
|
||||
|
||||
INSTALL(FILES
|
||||
${tvmet_header_SRCS}
|
||||
DESTINATION ${INCLUDE_INSTALL_DIR}
|
||||
)
|
||||
|
||||
ADD_SUBDIRECTORY(loop)
|
||||
ADD_SUBDIRECTORY(meta)
|
||||
ADD_SUBDIRECTORY(xpr)
|
||||
ADD_SUBDIRECTORY(util)
|
||||
@@ -1,130 +0,0 @@
|
||||
/* 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
|
||||
* 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: CommaInitializer.h,v 1.14 2005/03/02 12:14:22 opetzold Exp $
|
||||
*/
|
||||
|
||||
#ifndef TVMET_COMMA_INITIALIZER_H
|
||||
#define TVMET_COMMA_INITIALIZER_H
|
||||
|
||||
#include <tvmet/CompileTimeError.h>
|
||||
|
||||
namespace tvmet {
|
||||
|
||||
/**
|
||||
* \class CommaInitializer CommaInitializer.h "tvmet/CommaInitializer.h"
|
||||
* \brief Initialize classes using a comma separated lists.
|
||||
*
|
||||
* The comma operator is called when it appears next to an object of
|
||||
* the type the comma is defined for. However, "operator," is not called
|
||||
* for function argument lists, only for objects that are out in the open,
|
||||
* separated by commas (Thinking C++
|
||||
* <a href=http://www.ida.liu.se/~TDDA14/online/v1ticpp/Chapter12.html>
|
||||
* Ch.12: Operator comma</a>).
|
||||
*
|
||||
* This implementation uses the same technique as described in Todd Veldhuizen
|
||||
* Techniques for Scientific C++
|
||||
* <a href=http://extreme.indiana.edu/~tveldhui/papers/techniques/techniques01.html#l43>
|
||||
* chapter 1.11 Comma overloading</a>.
|
||||
*
|
||||
* The initializer list is avaible after instanciation of the object,
|
||||
* therefore use it like:
|
||||
* \code
|
||||
* vector3d t;
|
||||
* t = 1.0, 2.0, 3.0;
|
||||
* \endcode
|
||||
* It's evaluated to (((t = 1.0), 2.0), 3.0)
|
||||
*
|
||||
* For matrizes the initilization is done row wise.
|
||||
*
|
||||
* If the comma separted list of values longer then the size of the vector
|
||||
* or matrix a compile time error will occour. Otherwise the pending values
|
||||
* will be written random into the memory.
|
||||
*
|
||||
*/
|
||||
template<typename Obj, int LEN>
|
||||
class CommaInitializer
|
||||
{
|
||||
typedef typename Obj::value_type value_type;
|
||||
|
||||
/**
|
||||
* \class Initializer
|
||||
* \brief Helper fo recursive overloaded comma operator.
|
||||
*/
|
||||
template<int N> class Initializer
|
||||
{
|
||||
Initializer();
|
||||
Initializer& operator=(const Initializer&);
|
||||
|
||||
public:
|
||||
Initializer(Obj& obj, int index) : m_obj(obj), m_index(index) {}
|
||||
|
||||
/** Overloads the comma operator for recursive assign values from comma
|
||||
separated list. */
|
||||
Initializer<N+1> operator,(value_type rhs)
|
||||
{
|
||||
TVMET_CT_CONDITION(N < LEN, CommaInitializerList_is_too_long)
|
||||
m_obj.commaWrite(m_index, rhs);
|
||||
return Initializer<N+1>(m_obj, m_index+1);
|
||||
}
|
||||
|
||||
private:
|
||||
Obj& m_obj;
|
||||
int m_index;
|
||||
};
|
||||
|
||||
public:
|
||||
CommaInitializer(const CommaInitializer& rhs)
|
||||
: m_object(rhs.m_object),
|
||||
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)
|
||||
{}
|
||||
|
||||
/** 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. Therefore we call the %Initializer::operator,() for the list starting
|
||||
after the 2nd. */
|
||||
Initializer<2> operator,(value_type rhs)
|
||||
{
|
||||
m_object.commaWrite(0, m_data);
|
||||
m_object.commaWrite(1, rhs);
|
||||
return Initializer<2>(m_object, 2);
|
||||
}
|
||||
|
||||
private:
|
||||
Obj& m_object;
|
||||
value_type m_data;
|
||||
};
|
||||
|
||||
} // namespace tvmet
|
||||
|
||||
#endif // TVMET_COMMA_INITIALIZER_H
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
@@ -1,59 +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: CompileTimeError.h,v 1.7 2003/11/30 08:26:25 opetzold Exp $
|
||||
*/
|
||||
|
||||
#ifndef TVMET_COMPILE_TIME_ERROR_H
|
||||
#define TVMET_COMPILE_TIME_ERROR_H
|
||||
|
||||
namespace tvmet {
|
||||
|
||||
/**
|
||||
* \class CompileTimeError CompileTimeError.h "tvmet/CompileTimeError.h"
|
||||
* \brief Compile Time Assertation classes.
|
||||
*/
|
||||
template<bool> struct CompileTimeError;
|
||||
|
||||
/**
|
||||
* \class CompileTimeError<true> CompileTimeError.h "tvmet/CompileTimeError.h"
|
||||
* \brief Specialized Compile Time Assertation for successfully condition.
|
||||
* This results in a compiler pass.
|
||||
*/
|
||||
template<> struct CompileTimeError<true> { };
|
||||
|
||||
|
||||
/**
|
||||
* \def TVMET_CT_CONDITION(XPR, MSG)
|
||||
* \brief Simplify the Compile Time Assertation by using an expression
|
||||
* Xpr and an error message MSG.
|
||||
*/
|
||||
#define TVMET_CT_CONDITION(XPR, MSG) { \
|
||||
CompileTimeError<(XPR)> tvmet_ERROR_##MSG; \
|
||||
(void)tvmet_ERROR_##MSG; \
|
||||
}
|
||||
|
||||
} // namespace tvmet
|
||||
|
||||
#endif // TVMET_COMPILE_TIME_ERROR_H
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
@@ -1,107 +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: Extremum.h,v 1.6 2003/11/30 08:26:25 opetzold Exp $
|
||||
*/
|
||||
|
||||
#ifndef TVMET_EXTREMUM_H
|
||||
#define TVMET_EXTREMUM_H
|
||||
|
||||
namespace tvmet {
|
||||
|
||||
|
||||
/**
|
||||
* \class matrix_tag Extremum.h "tvmet/Extremum.h"
|
||||
* \brief For use with Extremum to simplify max handling.
|
||||
* This allows the min/max functions to return an Extremum object.
|
||||
*/
|
||||
struct matrix_tag { };
|
||||
|
||||
|
||||
/**
|
||||
* \class vector_tag Extremum.h "tvmet/Extremum.h"
|
||||
* \brief For use with Extremum to simplify max handling.
|
||||
* This allows the min/max functions to return an Extremum object.
|
||||
*/
|
||||
struct vector_tag { };
|
||||
|
||||
|
||||
/**
|
||||
* \class Extremum Extremum.h "tvmet/Extremum.h"
|
||||
* \brief Generell class for storing extremums determined by min/max.
|
||||
*/
|
||||
template<class T1, class T2, class Tag>
|
||||
class Extremum { };
|
||||
|
||||
|
||||
/**
|
||||
* \class Extremum<T1, T2, vector_tag> Extremum.h "tvmet/Extremum.h"
|
||||
* \brief Partial specialzed for vectors to store extremums by value and index.
|
||||
*/
|
||||
template<class T1, class T2>
|
||||
class Extremum<T1, T2, vector_tag>
|
||||
{
|
||||
public:
|
||||
typedef T1 value_type;
|
||||
typedef T2 index_type;
|
||||
|
||||
public:
|
||||
Extremum(value_type value, index_type index)
|
||||
: m_value(value), m_index(index) { }
|
||||
value_type value() const { return m_value; }
|
||||
index_type index() const { return m_index; }
|
||||
|
||||
private:
|
||||
value_type m_value;
|
||||
index_type m_index;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* \class Extremum<T1, T2, matrix_tag> Extremum.h "tvmet/Extremum.h"
|
||||
* \brief Partial specialzed for matrix to store extremums by value, row and column.
|
||||
*/
|
||||
template<class T1, class T2>
|
||||
class Extremum<T1, T2, matrix_tag>
|
||||
{
|
||||
public:
|
||||
typedef T1 value_type;
|
||||
typedef T2 index_type;
|
||||
|
||||
public:
|
||||
Extremum(value_type value, index_type row, index_type col)
|
||||
: m_value(value), m_row(row), m_col(col) { }
|
||||
value_type value() const { return m_value; }
|
||||
index_type row() const { return m_row; }
|
||||
index_type col() const { return m_col; }
|
||||
|
||||
private:
|
||||
value_type m_value;
|
||||
index_type m_row, m_col;
|
||||
};
|
||||
|
||||
|
||||
} // namespace tvmet
|
||||
|
||||
#endif // TVMET_EXTREMUM_H
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
@@ -1,87 +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: Functional.h,v 1.7 2004/09/16 09:14:18 opetzold Exp $
|
||||
*/
|
||||
|
||||
#ifndef TVMET_FUNCTIONAL_H
|
||||
#define TVMET_FUNCTIONAL_H
|
||||
|
||||
#include <tvmet/TypePromotion.h>
|
||||
|
||||
namespace tvmet {
|
||||
|
||||
|
||||
/**
|
||||
* \class Functional Functional.h "tvmet/Functional.h"
|
||||
* \brief Base class for all binary und unary functionals.
|
||||
*
|
||||
* All functional operators and functions have a static apply
|
||||
* member function for evaluating the expressions inside.
|
||||
*/
|
||||
struct Functional { };
|
||||
|
||||
|
||||
/**
|
||||
* \class BinaryFunctional Functional.h "tvmet/Functional.h"
|
||||
* \brief Base class for all binary functions.
|
||||
* \note Used for collecting classes for doxygen.
|
||||
*/
|
||||
struct BinaryFunctional : public Functional { };
|
||||
|
||||
|
||||
/**
|
||||
* \class UnaryFunctional Functional.h "tvmet/Functional.h"
|
||||
* \brief Base class for all unary functions.
|
||||
* \note Used for collecting classes for doxygen.
|
||||
*/
|
||||
struct UnaryFunctional : public Functional { };
|
||||
|
||||
|
||||
/*
|
||||
* some macro magic need below
|
||||
*/
|
||||
|
||||
/**
|
||||
* \def TVMET_STD_SCOPE(x)
|
||||
* \brief Simple macro to allow using macros for namespace std functions.
|
||||
*/
|
||||
#define TVMET_STD_SCOPE(x) std::x
|
||||
|
||||
|
||||
/**
|
||||
* \def TVMET_GLOBAL_SCOPE(x)
|
||||
* \brief Simple macro to allow using macros for global namespace functions.
|
||||
*/
|
||||
#define TVMET_GLOBAL_SCOPE(x) ::x
|
||||
|
||||
|
||||
} // namespace tvmet
|
||||
|
||||
|
||||
#include <tvmet/BinaryFunctionals.h>
|
||||
#include <tvmet/UnaryFunctionals.h>
|
||||
|
||||
|
||||
#endif // TVMET_FUNCTIONAL_H
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
@@ -1,306 +0,0 @@
|
||||
/* 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
|
||||
* 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: Matrix.h,v 1.54 2005/03/02 12:12:51 opetzold Exp $
|
||||
*/
|
||||
|
||||
#ifndef TVMET_MATRIX_H
|
||||
#define TVMET_MATRIX_H
|
||||
|
||||
#include <iterator> // reverse_iterator
|
||||
#include <cassert>
|
||||
|
||||
#include <tvmet/tvmet.h>
|
||||
#include <tvmet/TypePromotion.h>
|
||||
#include <tvmet/CommaInitializer.h>
|
||||
|
||||
#include <tvmet/xpr/Matrix.h>
|
||||
#include <tvmet/xpr/MatrixRow.h>
|
||||
#include <tvmet/xpr/MatrixCol.h>
|
||||
#include <tvmet/xpr/MatrixDiag.h>
|
||||
|
||||
namespace tvmet {
|
||||
|
||||
/* forwards */
|
||||
template<class T, int Rows, int Cols> class Matrix;
|
||||
|
||||
/**
|
||||
* \class MatrixConstRef Matrix.h "tvmet/Matrix.h"
|
||||
* \brief value iterator for ET
|
||||
*/
|
||||
template<class T, int Rows, int Cols>
|
||||
class MatrixConstRef
|
||||
: public TvmetBase < MatrixConstRef<T, Rows, Cols> >
|
||||
{
|
||||
|
||||
public:
|
||||
/** Complexity counter. */
|
||||
enum {
|
||||
ops = Rows * Cols
|
||||
};
|
||||
typedef T value_type;
|
||||
|
||||
private:
|
||||
MatrixConstRef();
|
||||
MatrixConstRef& operator=(const MatrixConstRef&);
|
||||
|
||||
public:
|
||||
/** Constructor. */
|
||||
explicit MatrixConstRef(const Matrix<T, Rows, Cols>& rhs)
|
||||
: m_array(rhs.array())
|
||||
{ }
|
||||
|
||||
/** Constructor by a given memory pointer. */
|
||||
explicit MatrixConstRef(const T* data)
|
||||
: m_array(data)
|
||||
{ }
|
||||
|
||||
/** access by index. */
|
||||
T operator()(int i, int j) const {
|
||||
assert(i >= 0 && j >= 0 && i < Rows && j < Cols);
|
||||
return m_array[i + j * Rows];
|
||||
}
|
||||
|
||||
/** debugging Xpr parse tree */
|
||||
void print_xpr(std::ostream& os, int l=0) const {
|
||||
os << IndentLevel(l)
|
||||
<< "MatrixConstRef[O=" << ops << "]<"
|
||||
<< "T=" << typeid(T).name() << ">,"
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
private:
|
||||
const T* _tvmet_restrict m_array;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* \class Matrix Matrix.h "tvmet/Matrix.h"
|
||||
* \brief A tiny matrix class.
|
||||
*
|
||||
* The array syntax A[j][j] isn't supported here. The reason is that
|
||||
* operator[] always takes exactly one parameter, but operator() can
|
||||
* take any number of parameters (in the case of a rectangular matrix,
|
||||
* 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 Rows, int Cols>
|
||||
class Matrix
|
||||
{
|
||||
public:
|
||||
|
||||
typedef T value_type;
|
||||
|
||||
/** Complexity counter. */
|
||||
enum {
|
||||
ops_assign = Rows * Cols,
|
||||
ops = ops_assign,
|
||||
use_meta = ops < TVMET_COMPLEXITY_M_ASSIGN_TRIGGER ? true : false
|
||||
};
|
||||
|
||||
/** The number of rows of the matrix. */
|
||||
static int rows() { return Rows; }
|
||||
|
||||
/** The number of columns of the matrix. */
|
||||
static int cols() { return Cols; }
|
||||
|
||||
public:
|
||||
/** Default Destructor. Does nothing. */
|
||||
~Matrix() {}
|
||||
|
||||
/** Default Constructor. Does nothing. The matrix entries are not initialized. */
|
||||
explicit Matrix() {}
|
||||
|
||||
/** Copy Constructor, not explicit! */
|
||||
Matrix(const Matrix& rhs)
|
||||
{
|
||||
*this = XprMatrix<ConstRef, Rows, Cols>(rhs.constRef());
|
||||
}
|
||||
|
||||
explicit Matrix(const value_type* array)
|
||||
{
|
||||
for(int i = 0; i < Rows * Cols; i++) m_array[i] = array[i];
|
||||
}
|
||||
|
||||
/** Construct a matrix by expression. */
|
||||
template<class E>
|
||||
explicit Matrix(const XprMatrix<E, Rows, Cols>& e)
|
||||
{
|
||||
*this = e;
|
||||
}
|
||||
|
||||
/** assign a T on array, this can be used for a single value
|
||||
or a comma separeted list of values. */
|
||||
CommaInitializer<Matrix, Rows * Cols> operator=(T rhs) {
|
||||
return CommaInitializer<Matrix, Rows * Cols>(*this, rhs);
|
||||
}
|
||||
|
||||
public: // access operators
|
||||
T* _tvmet_restrict array() { return m_array; }
|
||||
const T* _tvmet_restrict array() const { return m_array; }
|
||||
|
||||
public: // index access operators
|
||||
T& _tvmet_restrict operator()(int i, int j) {
|
||||
// Note: g++-2.95.3 does have problems on typedef reference
|
||||
assert(i >= 0 && j >= 0 && i < Rows && j < Cols);
|
||||
return m_array[i + j * Rows];
|
||||
}
|
||||
|
||||
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 MatrixConstRef<T, Rows, Cols> ConstRef;
|
||||
|
||||
/** Return a const Reference of the internal data */
|
||||
ConstRef constRef() const { return ConstRef(*this); }
|
||||
|
||||
/** Return the matrix as const expression. */
|
||||
XprMatrix<ConstRef, Rows, Cols> expr() const {
|
||||
return XprMatrix<ConstRef, Rows, Cols>(this->constRef());
|
||||
}
|
||||
|
||||
private:
|
||||
/** Wrapper for meta assign. */
|
||||
template<class Dest, class Src, class Assign>
|
||||
static inline
|
||||
void do_assign(dispatch<true>, Dest& dest, const Src& src, const Assign& assign_fn) {
|
||||
meta::Matrix<Rows, Cols, 0, 0>::assign(dest, src, assign_fn);
|
||||
}
|
||||
|
||||
/** Wrapper for loop assign. */
|
||||
template<class Dest, class Src, class Assign>
|
||||
static inline
|
||||
void do_assign(dispatch<false>, Dest& dest, const Src& src, const Assign& assign_fn) {
|
||||
loop::Matrix<Rows, Cols>::assign(dest, src, assign_fn);
|
||||
}
|
||||
|
||||
/** 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 {
|
||||
do_assign(dispatch<use_meta>(), dest, *this, assign_fn);
|
||||
}
|
||||
|
||||
public: // assign operations
|
||||
/** assign a given matrix of a different type T2 element wise
|
||||
to this matrix. The operator=(const Matrix&) is compiler
|
||||
generated. */
|
||||
template<class T2>
|
||||
Matrix& operator=(const Matrix<T2, Rows, Cols>& rhs) {
|
||||
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<T, typename E::value_type>());
|
||||
return *this;
|
||||
}
|
||||
|
||||
private:
|
||||
template<class Obj, int LEN> friend class CommaInitializer;
|
||||
|
||||
void commaWrite(int index, T rhs)
|
||||
{
|
||||
m_array[(index / Cols) + (index % Cols) * Rows] = rhs;
|
||||
}
|
||||
|
||||
public: // math operators with scalars
|
||||
Matrix& operator+=(T) _tvmet_always_inline;
|
||||
Matrix& operator-=(T) _tvmet_always_inline;
|
||||
Matrix& operator*=(T) _tvmet_always_inline;
|
||||
Matrix& operator/=(T) _tvmet_always_inline;
|
||||
|
||||
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;
|
||||
|
||||
public: // math operators with expressions
|
||||
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;
|
||||
|
||||
public: // aliased math operators with expressions
|
||||
template <class T2> Matrix& alias_assign(const Matrix<T2, Rows, Cols>&) _tvmet_always_inline;
|
||||
template <class T2> Matrix& alias_add_eq(const Matrix<T2, Rows, Cols>&) _tvmet_always_inline;
|
||||
template <class T2> Matrix& alias_sub_eq(const Matrix<T2, Rows, Cols>&) _tvmet_always_inline;
|
||||
template <class T2> Matrix& alias_mul_eq(const Matrix<T2, Rows, Cols>&) _tvmet_always_inline;
|
||||
template <class T2> Matrix& alias_div_eq(const Matrix<T2, Rows, Cols>&) _tvmet_always_inline;
|
||||
|
||||
template <class E> Matrix& alias_assign(const XprMatrix<E, Rows, Cols>&) _tvmet_always_inline;
|
||||
template <class E> Matrix& alias_add_eq(const XprMatrix<E, Rows, Cols>&) _tvmet_always_inline;
|
||||
template <class E> Matrix& alias_sub_eq(const XprMatrix<E, Rows, Cols>&) _tvmet_always_inline;
|
||||
template <class E> Matrix& alias_mul_eq(const XprMatrix<E, Rows, Cols>&) _tvmet_always_inline;
|
||||
template <class E> Matrix& alias_div_eq(const XprMatrix<E, Rows, Cols>&) _tvmet_always_inline;
|
||||
|
||||
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(T).name()
|
||||
<< ", R=" << Rows << ", C=" << Cols << ">";
|
||||
return os;
|
||||
}
|
||||
};
|
||||
|
||||
/** Get an info object of this matrix. */
|
||||
static Info info() { return Info(); }
|
||||
|
||||
/** Member function for expression level printing. */
|
||||
std::ostream& print_xpr(std::ostream& os, int l=0) const;
|
||||
|
||||
/** Member function for printing internal data. */
|
||||
std::ostream& print_on(std::ostream& os) const;
|
||||
|
||||
private:
|
||||
/** The data of matrix self. */
|
||||
T m_array[Rows * Cols];
|
||||
};
|
||||
|
||||
typedef Matrix<int, 2, 2> Matrix2i;
|
||||
typedef Matrix<int, 3, 3> Matrix3i;
|
||||
typedef Matrix<int, 4, 4> Matrix4i;
|
||||
typedef Matrix<float, 2, 2> Matrix2f;
|
||||
typedef Matrix<float, 3, 3> Matrix3f;
|
||||
typedef Matrix<float, 4, 4> Matrix4f;
|
||||
typedef Matrix<double, 2, 2> Matrix2d;
|
||||
typedef Matrix<double, 3, 3> Matrix3d;
|
||||
typedef Matrix<double, 4, 4> Matrix4d;
|
||||
|
||||
} // namespace tvmet
|
||||
|
||||
#include <tvmet/MatrixImpl.h>
|
||||
#include <tvmet/MatrixFunctions.h>
|
||||
#include <tvmet/MatrixUnaryFunctions.h>
|
||||
#include <tvmet/MatrixOperators.h>
|
||||
#include <tvmet/MatrixEval.h>
|
||||
#include <tvmet/AliasProxy.h>
|
||||
|
||||
#endif // TVMET_MATRIX_H
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
@@ -1,322 +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: MatrixEval.h,v 1.14 2004/06/10 16:36:55 opetzold Exp $
|
||||
*/
|
||||
|
||||
#ifndef TVMET_MATRIX_EVAL_H
|
||||
#define TVMET_MATRIX_EVAL_H
|
||||
|
||||
namespace tvmet {
|
||||
|
||||
/**
|
||||
* \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.
|
||||
* \ingroup _trinary_function
|
||||
* This eval is for the a?b:c syntax, since it's not allowed to overload
|
||||
* these operators.
|
||||
*/
|
||||
template<class E1, class T2, class T3, int Rows, int Cols>
|
||||
inline
|
||||
XprMatrix<
|
||||
XprEval<
|
||||
XprMatrix<E1, Rows, Cols>,
|
||||
MatrixConstRef<T2, Rows, Cols>,
|
||||
MatrixConstRef<T3, Rows, Cols>
|
||||
>,
|
||||
Rows, Cols
|
||||
>
|
||||
eval(const XprMatrix<E1, Rows, Cols>& e1,
|
||||
const Matrix<T2, Rows, Cols>& m2,
|
||||
const Matrix<T3, Rows, Cols>& m3) {
|
||||
typedef XprEval<
|
||||
XprMatrix<E1, Rows, Cols>,
|
||||
MatrixConstRef<T2, Rows, Cols>,
|
||||
MatrixConstRef<T3, Rows, Cols>
|
||||
> expr_type;
|
||||
return XprMatrix<expr_type, Rows, Cols>(
|
||||
expr_type(e1, m2.constRef(), m3.constRef()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \fn eval(const XprMatrix<E1, Rows, Cols>& e1, const Matrix<T2, Rows, Cols>& m2, const XprMatrix<E3, Rows, Cols>& e3)
|
||||
* \brief Evals the matrix expressions.
|
||||
* \ingroup _trinary_function
|
||||
* This eval is for the a?b:c syntax, since it's not allowed to overload
|
||||
* these operators.
|
||||
*/
|
||||
template<class E1, class T2, class E3, int Rows, int Cols>
|
||||
inline
|
||||
XprMatrix<
|
||||
XprEval<
|
||||
XprMatrix<E1, Rows, Cols>,
|
||||
MatrixConstRef<T2, Rows, Cols>,
|
||||
XprMatrix<E3, Rows, Cols>
|
||||
>,
|
||||
Rows, Cols
|
||||
>
|
||||
eval(const XprMatrix<E1, Rows, Cols>& e1,
|
||||
const Matrix<T2, Rows, Cols>& m2,
|
||||
const XprMatrix<E3, Rows, Cols>& e3) {
|
||||
typedef XprEval<
|
||||
XprMatrix<E1, Rows, Cols>,
|
||||
MatrixConstRef<T2, Rows, Cols>,
|
||||
XprMatrix<E3, Rows, Cols>
|
||||
> expr_type;
|
||||
return XprMatrix<expr_type, Rows, Cols>(
|
||||
expr_type(e1, m2.constRef(), e3));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \fn eval(const XprMatrix<E1, Rows, Cols>& e1, const XprMatrix<E2, Rows, Cols>& e2, const Matrix<T3, Rows, Cols>& m3)
|
||||
* \brief Evals the matrix expressions.
|
||||
* \ingroup _trinary_function
|
||||
* This eval is for the a?b:c syntax, since it's not allowed to overload
|
||||
* these operators.
|
||||
*/
|
||||
template<class E1, class E2, class T3, int Rows, int Cols>
|
||||
inline
|
||||
XprMatrix<
|
||||
XprEval<
|
||||
XprMatrix<E1, Rows, Cols>,
|
||||
XprMatrix<E2, Rows, Cols>,
|
||||
MatrixConstRef<T3, Rows, Cols>
|
||||
>,
|
||||
Rows, Cols
|
||||
>
|
||||
eval(const XprMatrix<E1, Rows, Cols>& e1,
|
||||
const XprMatrix<E2, Rows, Cols>& e2,
|
||||
const Matrix<T3, Rows, Cols>& m3) {
|
||||
typedef XprEval<
|
||||
XprMatrix<E1, Rows, Cols>,
|
||||
XprMatrix<E2, Rows, Cols>,
|
||||
MatrixConstRef<T3, Rows, Cols>
|
||||
> expr_type;
|
||||
return XprMatrix<expr_type, Rows, Cols>(
|
||||
expr_type(e1, e2, m3.constRef()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \fn eval(const XprMatrix<E1, Rows, Cols>& e1, const XprMatrix<E2, Rows, Cols>& e2, const XprMatrix<E3, Rows, Cols>& e3)
|
||||
* \brief Evals the matrix expressions.
|
||||
* \ingroup _trinary_function
|
||||
* This eval is for the a?b:c syntax, since it's not allowed to overload
|
||||
* these operators.
|
||||
*/
|
||||
template<class E1, class E2, class E3, int Rows, int Cols>
|
||||
inline
|
||||
XprMatrix<
|
||||
XprEval<
|
||||
XprMatrix<E1, Rows, Cols>,
|
||||
XprMatrix<E2, Rows, Cols>,
|
||||
XprMatrix<E3, Rows, Cols>
|
||||
>,
|
||||
Rows, Cols
|
||||
>
|
||||
eval(const XprMatrix<E1, Rows, Cols>& e1,
|
||||
const XprMatrix<E2, Rows, Cols>& e2,
|
||||
const XprMatrix<E3, Rows, Cols>& e3) {
|
||||
typedef XprEval<
|
||||
XprMatrix<E1, Rows, Cols>,
|
||||
XprMatrix<E2, Rows, Cols>,
|
||||
XprMatrix<E3, Rows, Cols>
|
||||
> expr_type;
|
||||
return XprMatrix<expr_type, Rows, Cols>(expr_type(e1, e2, e3));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* trinary evaluation functions with matrizes, xpr of and POD
|
||||
*
|
||||
* XprMatrix<E, Rows, Cols> ? POD1 : POD2
|
||||
* XprMatrix<E1, Rows, Cols> ? POD : XprMatrix<E3, Rows, Cols>
|
||||
* XprMatrix<E1, Rows, Cols> ? XprMatrix<E2, Rows, Cols> : POD
|
||||
*/
|
||||
#define TVMET_IMPLEMENT_MACRO(POD) \
|
||||
template<class E, int Rows, int Cols> \
|
||||
inline \
|
||||
XprMatrix< \
|
||||
XprEval< \
|
||||
XprMatrix<E, Rows, Cols>, \
|
||||
XprLiteral< POD >, \
|
||||
XprLiteral< POD > \
|
||||
>, \
|
||||
Rows, Cols \
|
||||
> \
|
||||
eval(const XprMatrix<E, Rows, Cols>& e, POD x2, POD x3) { \
|
||||
typedef XprEval< \
|
||||
XprMatrix<E, Rows, Cols>, \
|
||||
XprLiteral< POD >, \
|
||||
XprLiteral< POD > \
|
||||
> expr_type; \
|
||||
return XprMatrix<expr_type, Rows, Cols>( \
|
||||
expr_type(e, XprLiteral< POD >(x2), XprLiteral< POD >(x3))); \
|
||||
} \
|
||||
\
|
||||
template<class E1, class E3, int Rows, int Cols> \
|
||||
inline \
|
||||
XprMatrix< \
|
||||
XprEval< \
|
||||
XprMatrix<E1, Rows, Cols>, \
|
||||
XprLiteral< POD >, \
|
||||
XprMatrix<E3, Rows, Cols> \
|
||||
>, \
|
||||
Rows, Cols \
|
||||
> \
|
||||
eval(const XprMatrix<E1, Rows, Cols>& e1, POD x2, const XprMatrix<E3, Rows, Cols>& e3) { \
|
||||
typedef XprEval< \
|
||||
XprMatrix<E1, Rows, Cols>, \
|
||||
XprLiteral< POD >, \
|
||||
XprMatrix<E3, Rows, Cols> \
|
||||
> expr_type; \
|
||||
return XprMatrix<expr_type, Rows, Cols>( \
|
||||
expr_type(e1, XprLiteral< POD >(x2), e3)); \
|
||||
} \
|
||||
\
|
||||
template<class E1, class E2, int Rows, int Cols> \
|
||||
inline \
|
||||
XprMatrix< \
|
||||
XprEval< \
|
||||
XprMatrix<E1, Rows, Cols>, \
|
||||
XprMatrix<E2, Rows, Cols>, \
|
||||
XprLiteral< POD > \
|
||||
>, \
|
||||
Rows, Cols \
|
||||
> \
|
||||
eval(const XprMatrix<E1, Rows, Cols>& e1, const XprMatrix<E2, Rows, Cols>& e2, POD x3) { \
|
||||
typedef XprEval< \
|
||||
XprMatrix<E1, Rows, Cols>, \
|
||||
XprMatrix<E2, Rows, Cols>, \
|
||||
XprLiteral< POD > \
|
||||
> expr_type; \
|
||||
return XprMatrix<expr_type, Rows, Cols>( \
|
||||
expr_type(e1, e2, XprLiteral< POD >(x3))); \
|
||||
}
|
||||
|
||||
TVMET_IMPLEMENT_MACRO(int)
|
||||
TVMET_IMPLEMENT_MACRO(float)
|
||||
TVMET_IMPLEMENT_MACRO(double)
|
||||
|
||||
#undef TVMET_IMPLEMENT_MACRO
|
||||
|
||||
|
||||
/*
|
||||
* trinary evaluation functions with matrizes, xpr of and complex<> types
|
||||
*
|
||||
* XprMatrix<E, Rows, Cols> e, std::complex<T> z2, std::complex<T> z3
|
||||
* XprMatrix<E1, Rows, Cols> e1, std::complex<T> z2, XprMatrix<E3, Rows, Cols> e3
|
||||
* XprMatrix<E1, Rows, Cols> e1, XprMatrix<E2, Rows, Cols> e2, std::complex<T> z3
|
||||
*/
|
||||
#if defined(EIGEN_USE_COMPLEX)
|
||||
|
||||
/**
|
||||
* \fn eval(const XprMatrix<E, Rows, Cols>& e, const std::complex<T>& x2, const std::complex<T>& x3)
|
||||
* \brief Evals the matrix expressions.
|
||||
* \ingroup _trinary_function
|
||||
* This eval is for the a?b:c syntax, since it's not allowed to overload
|
||||
* these operators.
|
||||
*/
|
||||
template<class E, int Rows, int Cols, class T>
|
||||
inline
|
||||
XprMatrix<
|
||||
XprEval<
|
||||
XprMatrix<E, Rows, Cols>,
|
||||
XprLiteral< std::complex<T> >,
|
||||
XprLiteral< std::complex<T> >
|
||||
>,
|
||||
Rows, Cols
|
||||
>
|
||||
eval(const XprMatrix<E, Rows, Cols>& e, const std::complex<T>& x2, const std::complex<T>& x3) {
|
||||
typedef XprEval<
|
||||
XprMatrix<E, Rows, Cols>,
|
||||
XprLiteral< std::complex<T> >,
|
||||
XprLiteral< std::complex<T> >
|
||||
> expr_type;
|
||||
return XprMatrix<expr_type, Rows, Cols>(
|
||||
expr_type(e, XprLiteral< std::complex<T> >(x2), XprLiteral< std::complex<T> >(x3)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \fn eval(const XprMatrix<E1, Rows, Cols>& e1, const std::complex<T>& x2, const XprMatrix<E3, Rows, Cols>& e3)
|
||||
* \brief Evals the matrix expressions.
|
||||
* \ingroup _trinary_function
|
||||
* This eval is for the a?b:c syntax, since it's not allowed to overload
|
||||
* these operators.
|
||||
*/
|
||||
template<class E1, class E3, int Rows, int Cols, class T>
|
||||
inline
|
||||
XprMatrix<
|
||||
XprEval<
|
||||
XprMatrix<E1, Rows, Cols>,
|
||||
XprLiteral< std::complex<T> >,
|
||||
XprMatrix<E3, Rows, Cols>
|
||||
>,
|
||||
Rows, Cols
|
||||
>
|
||||
eval(const XprMatrix<E1, Rows, Cols>& e1, const std::complex<T>& x2, const XprMatrix<E3, Rows, Cols>& e3) {
|
||||
typedef XprEval<
|
||||
XprMatrix<E1, Rows, Cols>,
|
||||
XprLiteral< std::complex<T> >,
|
||||
XprMatrix<E3, Rows, Cols>
|
||||
> expr_type;
|
||||
return XprMatrix<expr_type, Rows, Cols>(
|
||||
expr_type(e1, XprLiteral< std::complex<T> >(x2), e3));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \fn eval(const XprMatrix<E1, Rows, Cols>& e1, const XprMatrix<E2, Rows, Cols>& e2, const std::complex<T>& x3)
|
||||
* \brief Evals the matrix expressions.
|
||||
* \ingroup _trinary_function
|
||||
* This eval is for the a?b:c syntax, since it's not allowed to overload
|
||||
* these operators.
|
||||
*/
|
||||
template<class E1, class E2, int Rows, int Cols, class T>
|
||||
inline
|
||||
XprMatrix<
|
||||
XprEval<
|
||||
XprMatrix<E1, Rows, Cols>,
|
||||
XprMatrix<E2, Rows, Cols>,
|
||||
XprLiteral< std::complex<T> >
|
||||
>,
|
||||
Rows, Cols
|
||||
>
|
||||
eval(const XprMatrix<E1, Rows, Cols>& e1, const XprMatrix<E2, Rows, Cols>& e2, const std::complex<T>& x3) {
|
||||
typedef XprEval<
|
||||
XprMatrix<E1, Rows, Cols>,
|
||||
XprMatrix<E2, Rows, Cols>,
|
||||
XprLiteral< std::complex<T> >
|
||||
> expr_type;
|
||||
return XprMatrix<expr_type, Rows, Cols>(
|
||||
expr_type(e1, e2, XprLiteral< std::complex<T> >(x3)));
|
||||
}
|
||||
#endif // defined(EIGEN_USE_COMPLEX)
|
||||
|
||||
} // namespace tvmet
|
||||
|
||||
#endif // TVMET_MATRIX_EVAL_H
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,173 +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: MatrixImpl.h,v 1.27 2004/06/10 16:36:55 opetzold Exp $
|
||||
*/
|
||||
|
||||
#ifndef TVMET_MATRIX_IMPL_H
|
||||
#define TVMET_MATRIX_IMPL_H
|
||||
|
||||
#include <iomanip> // setw
|
||||
|
||||
#include <tvmet/Functional.h>
|
||||
|
||||
namespace tvmet {
|
||||
|
||||
/*
|
||||
* member operators for i/o
|
||||
*/
|
||||
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 << ">,"
|
||||
<< IndentLevel(--l)
|
||||
<< std::endl;
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
template<class T, int Rows, int Cols>
|
||||
std::ostream& Matrix<T, Rows, Cols>::print_on(std::ostream& os) const
|
||||
{
|
||||
os << "[\n";
|
||||
for(int i = 0; i < Rows; ++i) {
|
||||
os << " [";
|
||||
for(int j = 0; j < (Cols - 1); ++j) {
|
||||
os << this->operator()(i, j) << ", ";
|
||||
}
|
||||
os << this->operator()(i, Cols - 1)
|
||||
<< (i != (Rows-1) ? "],\n" : "]\n");
|
||||
}
|
||||
os << "]";
|
||||
return os;
|
||||
}
|
||||
|
||||
/*
|
||||
* member operators with scalars, per se element wise
|
||||
*/
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME, OP) \
|
||||
template<class T, int Rows, int Cols> \
|
||||
inline \
|
||||
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; \
|
||||
}
|
||||
|
||||
TVMET_IMPLEMENT_MACRO(add_eq, +=)
|
||||
TVMET_IMPLEMENT_MACRO(sub_eq, -=)
|
||||
TVMET_IMPLEMENT_MACRO(mul_eq, *=)
|
||||
TVMET_IMPLEMENT_MACRO(div_eq, /=)
|
||||
#undef TVMET_IMPLEMENT_MACRO
|
||||
|
||||
/*
|
||||
* member functions (operators) with matrizes, for use with +=,-= ...
|
||||
*/
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME) \
|
||||
template<class T1, int Rows, int Cols> \
|
||||
template <class T2> \
|
||||
inline \
|
||||
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; \
|
||||
}
|
||||
|
||||
TVMET_IMPLEMENT_MACRO(add_eq)
|
||||
TVMET_IMPLEMENT_MACRO(sub_eq)
|
||||
TVMET_IMPLEMENT_MACRO(mul_eq)
|
||||
TVMET_IMPLEMENT_MACRO(div_eq)
|
||||
#undef TVMET_IMPLEMENT_MACRO
|
||||
|
||||
|
||||
/*
|
||||
* member functions (operators) with expressions, for use with +=,-= ...
|
||||
*/
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME) \
|
||||
template<class T, int Rows, int Cols> \
|
||||
template<class E> \
|
||||
inline \
|
||||
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; \
|
||||
}
|
||||
|
||||
TVMET_IMPLEMENT_MACRO(add_eq)
|
||||
TVMET_IMPLEMENT_MACRO(sub_eq)
|
||||
TVMET_IMPLEMENT_MACRO(mul_eq)
|
||||
TVMET_IMPLEMENT_MACRO(div_eq)
|
||||
#undef TVMET_IMPLEMENT_MACRO
|
||||
|
||||
/*
|
||||
* aliased member functions (operators) with matrizes,
|
||||
* for use with +=,-= ...
|
||||
*/
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME) \
|
||||
template<class T1, int Rows, int Cols> \
|
||||
template <class T2> \
|
||||
inline \
|
||||
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; \
|
||||
}
|
||||
|
||||
TVMET_IMPLEMENT_MACRO(assign)
|
||||
TVMET_IMPLEMENT_MACRO(add_eq)
|
||||
TVMET_IMPLEMENT_MACRO(sub_eq)
|
||||
TVMET_IMPLEMENT_MACRO(mul_eq)
|
||||
TVMET_IMPLEMENT_MACRO(div_eq)
|
||||
#undef TVMET_IMPLEMENT_MACRO
|
||||
|
||||
|
||||
/*
|
||||
* aliased member functions (operators) with expressions,
|
||||
* for use with +=,-= ... and aliased(),
|
||||
*/
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME) \
|
||||
template<class T, int Rows, int Cols> \
|
||||
template<class E> \
|
||||
inline \
|
||||
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; \
|
||||
}
|
||||
|
||||
TVMET_IMPLEMENT_MACRO(assign)
|
||||
TVMET_IMPLEMENT_MACRO(add_eq)
|
||||
TVMET_IMPLEMENT_MACRO(sub_eq)
|
||||
TVMET_IMPLEMENT_MACRO(mul_eq)
|
||||
TVMET_IMPLEMENT_MACRO(div_eq)
|
||||
#undef TVMET_IMPLEMENT_MACRO
|
||||
|
||||
|
||||
} // namespace tvmet
|
||||
|
||||
#endif // TVMET_MATRIX_IMPL_H
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
@@ -1,718 +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: MatrixOperators.h,v 1.33 2004/06/17 15:53:12 opetzold Exp $
|
||||
*/
|
||||
|
||||
#ifndef TVMET_MATRIX_OPERATORS_H
|
||||
#define TVMET_MATRIX_OPERATORS_H
|
||||
|
||||
namespace tvmet {
|
||||
|
||||
|
||||
/*********************************************************
|
||||
* PART I: DECLARATION
|
||||
*********************************************************/
|
||||
|
||||
|
||||
template<class T, int Rows, int Cols>
|
||||
std::ostream& operator<<(std::ostream& os,
|
||||
const Matrix<T, Rows, Cols>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
* Member operators (arithmetic and bit ops)
|
||||
*++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
|
||||
/*
|
||||
* update_operator(Matrix<T1, Rows, Cols>, Matrix<T2, Rows, Cols>)
|
||||
* update_operator(Matrix<T1, Rows, Cols>, XprMatrix<E, Rows, Cols> rhs)
|
||||
* Note: per se element wise
|
||||
* \todo: the operator*= can have element wise mul oder product, decide!
|
||||
*/
|
||||
#define TVMET_DECLARE_MACRO(NAME, OP) \
|
||||
template<class T1, class T2, int Rows, int Cols> \
|
||||
Matrix<T1, Rows, Cols>& \
|
||||
operator OP (Matrix<T1, Rows, Cols>& lhs, \
|
||||
const Matrix<T2, Rows, Cols>& rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class T, class E, int Rows, int Cols> \
|
||||
Matrix<T, Rows, Cols>& \
|
||||
operator OP (Matrix<T, Rows, Cols>& lhs, \
|
||||
const XprMatrix<E, Rows, Cols>& rhs) _tvmet_always_inline;
|
||||
|
||||
TVMET_DECLARE_MACRO(add_eq, +=) // per se element wise
|
||||
TVMET_DECLARE_MACRO(sub_eq, -=) // per se element wise
|
||||
namespace element_wise {
|
||||
TVMET_DECLARE_MACRO(mul_eq, *=) // see note
|
||||
TVMET_DECLARE_MACRO(div_eq, /=) // not defined for vectors
|
||||
}
|
||||
|
||||
#undef TVMET_DECLARE_MACRO
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
* Matrix arithmetic operators implemented by functions
|
||||
* add, sub, mul and div
|
||||
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
|
||||
/*
|
||||
* operator(Matrix<T1, Rows, Cols>, Matrix<T2, Rows, Cols>)
|
||||
* operator(XprMatrix<E, Rows, Cols>, Matrix<T, Rows, Cols>)
|
||||
* operator(Matrix<T, Rows, Cols>, XprMatrix<E, Rows, Cols>)
|
||||
* Note: per se element wise
|
||||
*/
|
||||
#define TVMET_DECLARE_MACRO(NAME, OP) \
|
||||
template<class T1, class T2, int Rows, int Cols> \
|
||||
XprMatrix< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<T1, T2>, \
|
||||
MatrixConstRef<T1, Rows, Cols>, \
|
||||
MatrixConstRef<T2, Rows, Cols> \
|
||||
>, \
|
||||
Rows, Cols \
|
||||
> \
|
||||
operator OP (const Matrix<T1, Rows, Cols>& lhs, \
|
||||
const Matrix<T2, Rows, Cols>& rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class E, class T, int Rows, int Cols> \
|
||||
XprMatrix< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<typename E::value_type, T>, \
|
||||
XprMatrix<E, Rows, Cols>, \
|
||||
MatrixConstRef<T, Rows, Cols> \
|
||||
>, \
|
||||
Rows, Cols \
|
||||
> \
|
||||
operator OP (const XprMatrix<E, Rows, Cols>& lhs, \
|
||||
const Matrix<T, Rows, Cols>& rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class T, class E, int Rows, int Cols> \
|
||||
XprMatrix< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<typename E::value_type, T>, \
|
||||
MatrixConstRef<T, Rows, Cols>, \
|
||||
XprMatrix<E, Rows, Cols> \
|
||||
>, \
|
||||
Rows, Cols \
|
||||
> \
|
||||
operator OP (const Matrix<T, Rows, Cols>& lhs, \
|
||||
const XprMatrix<E, Rows, Cols>& rhs) _tvmet_always_inline;
|
||||
|
||||
TVMET_DECLARE_MACRO(add, +) // per se element wise
|
||||
TVMET_DECLARE_MACRO(sub, -) // per se element wise
|
||||
namespace element_wise {
|
||||
TVMET_DECLARE_MACRO(mul, *) // see as prod()
|
||||
TVMET_DECLARE_MACRO(div, /) // not defined for matrizes
|
||||
}
|
||||
#undef TVMET_DECLARE_MACRO
|
||||
|
||||
|
||||
/*
|
||||
* operator(Matrix<T, Rows, Cols>, POD)
|
||||
* operator(POD, Matrix<T, Rows, Cols>)
|
||||
* Note: operations +,-,*,/ are per se element wise
|
||||
*/
|
||||
#define TVMET_DECLARE_MACRO(NAME, OP, POD) \
|
||||
template<class T, int Rows, int Cols> \
|
||||
XprMatrix< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<T, POD >, \
|
||||
MatrixConstRef<T, Rows, Cols>, \
|
||||
XprLiteral<POD > \
|
||||
>, \
|
||||
Rows, Cols \
|
||||
> \
|
||||
operator OP (const Matrix<T, Rows, Cols>& lhs, \
|
||||
POD rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class T, int Rows, int Cols> \
|
||||
XprMatrix< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME< POD, T>, \
|
||||
XprLiteral< POD >, \
|
||||
MatrixConstRef<T, Rows, Cols> \
|
||||
>, \
|
||||
Rows, Cols \
|
||||
> \
|
||||
operator OP (POD lhs, \
|
||||
const Matrix<T, Rows, Cols>& rhs) _tvmet_always_inline;
|
||||
|
||||
TVMET_DECLARE_MACRO(add, +, int)
|
||||
TVMET_DECLARE_MACRO(sub, -, int)
|
||||
TVMET_DECLARE_MACRO(mul, *, int)
|
||||
TVMET_DECLARE_MACRO(div, /, int)
|
||||
|
||||
TVMET_DECLARE_MACRO(add, +, float)
|
||||
TVMET_DECLARE_MACRO(sub, -, float)
|
||||
TVMET_DECLARE_MACRO(mul, *, float)
|
||||
TVMET_DECLARE_MACRO(div, /, float)
|
||||
|
||||
TVMET_DECLARE_MACRO(add, +, double)
|
||||
TVMET_DECLARE_MACRO(sub, -, double)
|
||||
TVMET_DECLARE_MACRO(mul, *, double)
|
||||
TVMET_DECLARE_MACRO(div, /, double)
|
||||
|
||||
#undef TVMET_DECLARE_MACRO
|
||||
|
||||
|
||||
#if defined(EIGEN_USE_COMPLEX)
|
||||
/*
|
||||
* operator(Matrix<T, Rows, Cols>, complex<T>)
|
||||
* operator(complex<T>, Matrix<T, Rows, Cols>)
|
||||
* Note: operations +,-,*,/ are per se element wise
|
||||
* \todo type promotion
|
||||
*/
|
||||
#define TVMET_DECLARE_MACRO(NAME, OP) \
|
||||
template<class T, int Rows, int Cols> \
|
||||
XprMatrix< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME< std::complex<T>, std::complex<T> >, \
|
||||
MatrixConstRef< std::complex<T>, Rows, Cols>, \
|
||||
XprLiteral<std::complex<T> > \
|
||||
>, \
|
||||
Rows, Cols \
|
||||
> \
|
||||
operator OP (const Matrix< std::complex<T>, Rows, Cols>& lhs, \
|
||||
const std::complex<T>& rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class T, int Rows, int Cols> \
|
||||
XprMatrix< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME< std::complex<T>, std::complex<T> >, \
|
||||
XprLiteral< std::complex<T> >, \
|
||||
MatrixConstRef< std::complex<T>, Rows, Cols> \
|
||||
>, \
|
||||
Rows, Cols \
|
||||
> \
|
||||
operator OP (const std::complex<T>& lhs, \
|
||||
const Matrix< std::complex<T>, Rows, Cols>& rhs) _tvmet_always_inline;
|
||||
|
||||
TVMET_DECLARE_MACRO(add, +)
|
||||
TVMET_DECLARE_MACRO(sub, -)
|
||||
TVMET_DECLARE_MACRO(mul, *)
|
||||
TVMET_DECLARE_MACRO(div, /)
|
||||
|
||||
#undef TVMET_DECLARE_MACRO
|
||||
|
||||
#endif // defined(EIGEN_USE_COMPLEX)
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
* matrix specific operator*() = prod() operations
|
||||
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
|
||||
template<class T1, int Rows1, int Cols1,
|
||||
class T2, int Cols2>
|
||||
XprMatrix<
|
||||
XprMMProduct<
|
||||
MatrixConstRef<T1, Rows1, Cols1>, Rows1, Cols1,
|
||||
MatrixConstRef<T2, Cols1, Cols2>, Cols2
|
||||
>,
|
||||
Rows1, Cols2
|
||||
>
|
||||
operator*(const Matrix<T1, Rows1, Cols1>& lhs,
|
||||
const Matrix<T2, Cols1, Cols2>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class E1, int Rows1, int Cols1,
|
||||
class T2, int Cols2>
|
||||
XprMatrix<
|
||||
XprMMProduct<
|
||||
XprMatrix<E1, Rows1, Cols1>, Rows1, Cols1,
|
||||
MatrixConstRef<T2, Cols1, Cols2>, Cols2
|
||||
>,
|
||||
Rows1, Cols2
|
||||
>
|
||||
operator*(const XprMatrix<E1, Rows1, Cols1>& lhs,
|
||||
const Matrix<T2, Cols1, Cols2>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T1, int Rows1, int Cols1,
|
||||
class E2, int Cols2>
|
||||
XprMatrix<
|
||||
XprMMProduct<
|
||||
MatrixConstRef<T1, Rows1, Cols1>, Rows1, Cols1,
|
||||
XprMatrix<E2, Cols1, Cols2>, Cols2
|
||||
>,
|
||||
Rows1, Cols2
|
||||
>
|
||||
operator*(const Matrix<T1, Rows1, Cols1>& lhs,
|
||||
const XprMatrix<E2, Cols1, Cols2>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
* matrix-vector specific prod( ... ) operators
|
||||
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
|
||||
template<class T1, int Rows, int Cols, class T2>
|
||||
XprVector<
|
||||
XprMVProduct<
|
||||
MatrixConstRef<T1, Rows, Cols>, Rows, Cols,
|
||||
VectorConstRef<T2, Cols>
|
||||
>,
|
||||
Rows
|
||||
>
|
||||
operator*(const Matrix<T1, Rows, Cols>& lhs,
|
||||
const Vector<T2, Cols>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T1, class E2, int Rows, int Cols>
|
||||
XprVector<
|
||||
XprMVProduct<
|
||||
MatrixConstRef<T1, Rows, Cols>, Rows, Cols,
|
||||
XprVector<E2, Cols>
|
||||
>,
|
||||
Rows
|
||||
>
|
||||
operator*(const Matrix<T1, Rows, Cols>& lhs,
|
||||
const XprVector<E2, Cols>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class E1, class T2, int Rows, int Cols>
|
||||
XprVector<
|
||||
XprMVProduct<
|
||||
XprMatrix<E1, Rows, Cols>, Rows, Cols,
|
||||
VectorConstRef<T2, Cols>
|
||||
>,
|
||||
Rows
|
||||
>
|
||||
operator*(const XprMatrix<E1, Rows, Cols>& lhs,
|
||||
const Vector<T2, Cols>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
* global unary operators
|
||||
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
|
||||
/*
|
||||
* unary_operator(Matrix<T, Rows, Cols>)
|
||||
* Note: per se element wise
|
||||
*/
|
||||
#define TVMET_DECLARE_MACRO(NAME, OP) \
|
||||
template <class T, int Rows, int Cols> \
|
||||
XprMatrix< \
|
||||
XprUnOp< \
|
||||
Fcnl_##NAME<T>, \
|
||||
MatrixConstRef<T, Rows, Cols> \
|
||||
>, \
|
||||
Rows, Cols \
|
||||
> \
|
||||
operator OP (const Matrix<T, Rows, Cols>& rhs) _tvmet_always_inline;
|
||||
|
||||
TVMET_DECLARE_MACRO(neg, -)
|
||||
#undef TVMET_DECLARE_MACRO
|
||||
|
||||
|
||||
/*********************************************************
|
||||
* PART II: IMPLEMENTATION
|
||||
*********************************************************/
|
||||
|
||||
|
||||
/**
|
||||
* \fn operator<<(std::ostream& os, const Matrix<T, Rows, Cols>& rhs)
|
||||
* \brief Overload operator for i/o
|
||||
* \ingroup _binary_operator
|
||||
*/
|
||||
template<class T, int Rows, int Cols>
|
||||
inline
|
||||
std::ostream& operator<<(std::ostream& os, const Matrix<T, Rows, Cols>& rhs) {
|
||||
return rhs.print_on(os);
|
||||
}
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
* Member operators (arithmetic and bit ops)
|
||||
*++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
|
||||
/*
|
||||
* update_operator(Matrix<T1, Rows, Cols>, Matrix<T2, Rows, Cols>)
|
||||
* update_operator(Matrix<T1, Rows, Cols>, XprMatrix<E, Rows, Cols> rhs)
|
||||
* Note: per se element wise
|
||||
* \todo: the operator*= can have element wise mul oder product, decide!
|
||||
*/
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME, OP) \
|
||||
template<class T1, class T2, int Rows, int Cols> \
|
||||
inline \
|
||||
Matrix<T1, Rows, Cols>& \
|
||||
operator OP (Matrix<T1, Rows, Cols>& lhs, const Matrix<T2, Rows, Cols>& rhs) { \
|
||||
return lhs.M_##NAME(rhs); \
|
||||
} \
|
||||
\
|
||||
template<class T, class E, int Rows, int Cols> \
|
||||
inline \
|
||||
Matrix<T, Rows, Cols>& \
|
||||
operator OP (Matrix<T, Rows, Cols>& lhs, const XprMatrix<E, Rows, Cols>& rhs) { \
|
||||
return lhs.M_##NAME(rhs); \
|
||||
}
|
||||
|
||||
TVMET_IMPLEMENT_MACRO(add_eq, +=) // per se element wise
|
||||
TVMET_IMPLEMENT_MACRO(sub_eq, -=) // per se element wise
|
||||
namespace element_wise {
|
||||
TVMET_IMPLEMENT_MACRO(mul_eq, *=) // see note
|
||||
TVMET_IMPLEMENT_MACRO(div_eq, /=) // not defined for vectors
|
||||
}
|
||||
|
||||
#undef TVMET_IMPLEMENT_MACRO
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
* Matrix arithmetic operators implemented by functions
|
||||
* add, sub, mul and div
|
||||
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
|
||||
/*
|
||||
* operator(Matrix<T1, Rows, Cols>, Matrix<T2, Rows, Cols>)
|
||||
* operator(XprMatrix<E, Rows, Cols>, Matrix<T, Rows, Cols>)
|
||||
* operator(Matrix<T, Rows, Cols>, XprMatrix<E, Rows, Cols>)
|
||||
* Note: per se element wise
|
||||
*/
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME, OP) \
|
||||
template<class T1, class T2, int Rows, int Cols> \
|
||||
inline \
|
||||
XprMatrix< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<T1, T2>, \
|
||||
MatrixConstRef<T1, Rows, Cols>, \
|
||||
MatrixConstRef<T2, Rows, Cols> \
|
||||
>, \
|
||||
Rows, Cols \
|
||||
> \
|
||||
operator OP (const Matrix<T1, Rows, Cols>& lhs, const Matrix<T2, Rows, Cols>& rhs) { \
|
||||
return NAME(lhs, rhs); \
|
||||
} \
|
||||
\
|
||||
template<class E, class T, int Rows, int Cols> \
|
||||
inline \
|
||||
XprMatrix< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<typename E::value_type, T>, \
|
||||
XprMatrix<E, Rows, Cols>, \
|
||||
MatrixConstRef<T, Rows, Cols> \
|
||||
>, \
|
||||
Rows, Cols \
|
||||
> \
|
||||
operator OP (const XprMatrix<E, Rows, Cols>& lhs, const Matrix<T, Rows, Cols>& rhs) { \
|
||||
return NAME(lhs, rhs); \
|
||||
} \
|
||||
\
|
||||
template<class T, class E, int Rows, int Cols> \
|
||||
inline \
|
||||
XprMatrix< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<typename E::value_type, T>, \
|
||||
MatrixConstRef<T, Rows, Cols>, \
|
||||
XprMatrix<E, Rows, Cols> \
|
||||
>, \
|
||||
Rows, Cols \
|
||||
> \
|
||||
operator OP (const Matrix<T, Rows, Cols>& lhs, const XprMatrix<E, Rows, Cols>& rhs) { \
|
||||
return NAME(lhs, rhs); \
|
||||
}
|
||||
|
||||
TVMET_IMPLEMENT_MACRO(add, +) // per se element wise
|
||||
TVMET_IMPLEMENT_MACRO(sub, -) // per se element wise
|
||||
namespace element_wise {
|
||||
TVMET_IMPLEMENT_MACRO(mul, *) // see as prod()
|
||||
TVMET_IMPLEMENT_MACRO(div, /) // not defined for matrizes
|
||||
}
|
||||
#undef TVMET_IMPLEMENT_MACRO
|
||||
|
||||
|
||||
/*
|
||||
* operator(Matrix<T, Rows, Cols>, POD)
|
||||
* operator(POD, Matrix<T, Rows, Cols>)
|
||||
* Note: operations +,-,*,/ are per se element wise
|
||||
*/
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME, OP, POD) \
|
||||
template<class T, int Rows, int Cols> \
|
||||
inline \
|
||||
XprMatrix< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<T, POD >, \
|
||||
MatrixConstRef<T, Rows, Cols>, \
|
||||
XprLiteral<POD > \
|
||||
>, \
|
||||
Rows, Cols \
|
||||
> \
|
||||
operator OP (const Matrix<T, Rows, Cols>& lhs, POD rhs) { \
|
||||
return NAME (lhs, rhs); \
|
||||
} \
|
||||
\
|
||||
template<class T, int Rows, int Cols> \
|
||||
inline \
|
||||
XprMatrix< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME< POD, T>, \
|
||||
XprLiteral< POD >, \
|
||||
MatrixConstRef<T, Rows, Cols> \
|
||||
>, \
|
||||
Rows, Cols \
|
||||
> \
|
||||
operator OP (POD lhs, const Matrix<T, Rows, Cols>& rhs) { \
|
||||
return NAME (lhs, rhs); \
|
||||
}
|
||||
|
||||
TVMET_IMPLEMENT_MACRO(add, +, int)
|
||||
TVMET_IMPLEMENT_MACRO(sub, -, int)
|
||||
TVMET_IMPLEMENT_MACRO(mul, *, int)
|
||||
TVMET_IMPLEMENT_MACRO(div, /, int)
|
||||
|
||||
TVMET_IMPLEMENT_MACRO(add, +, float)
|
||||
TVMET_IMPLEMENT_MACRO(sub, -, float)
|
||||
TVMET_IMPLEMENT_MACRO(mul, *, float)
|
||||
TVMET_IMPLEMENT_MACRO(div, /, float)
|
||||
|
||||
TVMET_IMPLEMENT_MACRO(add, +, double)
|
||||
TVMET_IMPLEMENT_MACRO(sub, -, double)
|
||||
TVMET_IMPLEMENT_MACRO(mul, *, double)
|
||||
TVMET_IMPLEMENT_MACRO(div, /, double)
|
||||
|
||||
#undef TVMET_IMPLEMENT_MACRO
|
||||
|
||||
|
||||
#if defined(EIGEN_USE_COMPLEX)
|
||||
/*
|
||||
* operator(Matrix<T, Rows, Cols>, complex<T>)
|
||||
* operator(complex<T>, Matrix<T, Rows, Cols>)
|
||||
* Note: operations +,-,*,/ are per se element wise
|
||||
* \todo type promotion
|
||||
*/
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME, OP) \
|
||||
template<class T, int Rows, int Cols> \
|
||||
inline \
|
||||
XprMatrix< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME< std::complex<T>, std::complex<T> >, \
|
||||
MatrixConstRef< std::complex<T>, Rows, Cols>, \
|
||||
XprLiteral<std::complex<T> > \
|
||||
>, \
|
||||
Rows, Cols \
|
||||
> \
|
||||
operator OP (const Matrix< std::complex<T>, Rows, Cols>& lhs, \
|
||||
const std::complex<T>& rhs) { \
|
||||
return NAME (lhs, rhs); \
|
||||
} \
|
||||
\
|
||||
template<class T, int Rows, int Cols> \
|
||||
inline \
|
||||
XprMatrix< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME< std::complex<T>, std::complex<T> >, \
|
||||
XprLiteral< std::complex<T> >, \
|
||||
MatrixConstRef< std::complex<T>, Rows, Cols> \
|
||||
>, \
|
||||
Rows, Cols \
|
||||
> \
|
||||
operator OP (const std::complex<T>& lhs, \
|
||||
const Matrix< std::complex<T>, Rows, Cols>& rhs) { \
|
||||
return NAME (lhs, rhs); \
|
||||
}
|
||||
|
||||
TVMET_IMPLEMENT_MACRO(add, +)
|
||||
TVMET_IMPLEMENT_MACRO(sub, -)
|
||||
TVMET_IMPLEMENT_MACRO(mul, *)
|
||||
TVMET_IMPLEMENT_MACRO(div, /)
|
||||
|
||||
#undef TVMET_IMPLEMENT_MACRO
|
||||
|
||||
#endif // defined(EIGEN_USE_COMPLEX)
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
* matrix specific operator*() = prod() operations
|
||||
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
|
||||
/**
|
||||
* \fn operator*(const Matrix<T1, Rows1, Cols1>& lhs, const Matrix<T2, Cols1, Cols2>& rhs)
|
||||
* \brief multiply two Matrices.
|
||||
* \ingroup _binary_operator
|
||||
* \note The rows2 has to be equal to cols1.
|
||||
* \sa prod(const Matrix<T1, Rows1, Cols1>& lhs, const Matrix<T2, Cols1, Cols2>& rhs)
|
||||
*/
|
||||
template<class T1, int Rows1, int Cols1,
|
||||
class T2, int Cols2>
|
||||
inline
|
||||
XprMatrix<
|
||||
XprMMProduct<
|
||||
MatrixConstRef<T1, Rows1, Cols1>, Rows1, Cols1,
|
||||
MatrixConstRef<T2, Cols1, Cols2>, Cols2
|
||||
>,
|
||||
Rows1, Cols2
|
||||
>
|
||||
operator*(const Matrix<T1, Rows1, Cols1>& lhs, const Matrix<T2, Cols1, Cols2>& rhs) {
|
||||
return prod(lhs, rhs);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \fn operator*(const XprMatrix<E1, Rows1, Cols1>& lhs, const Matrix<T2, Cols1, Cols2>& rhs)
|
||||
* \brief Evaluate the product of XprMatrix and Matrix.
|
||||
* \ingroup _binary_operator
|
||||
* \sa prod(const XprMatrix<E1, Rows1, Cols1>& lhs, const Matrix<T2, Cols1, Cols2>& rhs)
|
||||
*/
|
||||
template<class E1, int Rows1, int Cols1,
|
||||
class T2, int Cols2>
|
||||
inline
|
||||
XprMatrix<
|
||||
XprMMProduct<
|
||||
XprMatrix<E1, Rows1, Cols1>, Rows1, Cols1,
|
||||
MatrixConstRef<T2, Cols1, Cols2>, Cols2
|
||||
>,
|
||||
Rows1, Cols2
|
||||
>
|
||||
operator*(const XprMatrix<E1, Rows1, Cols1>& lhs, const Matrix<T2, Cols1, Cols2>& rhs) {
|
||||
return prod(lhs, rhs);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \fn operator*(const Matrix<T1, Rows1, Cols1>& lhs, const XprMatrix<E2, Cols1, Cols2>& rhs)
|
||||
* \brief Evaluate the product of Matrix and XprMatrix.
|
||||
* \ingroup _binary_operator
|
||||
* \sa prod(const Matrix<T, Rows1, Cols1>& lhs, const XprMatrix<E, Cols1, Cols2>& rhs)
|
||||
*/
|
||||
template<class T1, int Rows1, int Cols1,
|
||||
class E2, int Cols2>
|
||||
inline
|
||||
XprMatrix<
|
||||
XprMMProduct<
|
||||
MatrixConstRef<T1, Rows1, Cols1>, Rows1, Cols1,
|
||||
XprMatrix<E2, Cols1, Cols2>, Cols2
|
||||
>,
|
||||
Rows1, Cols2
|
||||
>
|
||||
operator*(const Matrix<T1, Rows1, Cols1>& lhs, const XprMatrix<E2, Cols1, Cols2>& rhs) {
|
||||
return prod(lhs, rhs);
|
||||
}
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
* matrix-vector specific prod( ... ) operators
|
||||
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
|
||||
/**
|
||||
* \fn operator*(const Matrix<T1, Rows, Cols>& lhs, const Vector<T2, Cols>& rhs)
|
||||
* \brief multiply a Matrix with a Vector.
|
||||
* \ingroup _binary_operator
|
||||
* \note The length of the Vector has to be equal to the number of Columns.
|
||||
* \sa prod(const Matrix<T1, Rows, Cols>& m, const Vector<T2, Cols>& v)
|
||||
*/
|
||||
template<class T1, int Rows, int Cols, class T2>
|
||||
inline
|
||||
XprVector<
|
||||
XprMVProduct<
|
||||
MatrixConstRef<T1, Rows, Cols>, Rows, Cols,
|
||||
VectorConstRef<T2, Cols>
|
||||
>,
|
||||
Rows
|
||||
>
|
||||
operator*(const Matrix<T1, Rows, Cols>& lhs, const Vector<T2, Cols>& rhs) {
|
||||
return prod(lhs, rhs);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \fn operator*(const Matrix<T1, Rows, Cols>& lhs, const XprVector<E2, Cols>& rhs)
|
||||
* \brief Function for the matrix-vector-product
|
||||
* \ingroup _binary_operator
|
||||
* \sa prod(const Matrix<T, Rows, Cols>& lhs, const XprVector<E, Cols>& rhs)
|
||||
*/
|
||||
template<class T1, class E2, int Rows, int Cols>
|
||||
inline
|
||||
XprVector<
|
||||
XprMVProduct<
|
||||
MatrixConstRef<T1, Rows, Cols>, Rows, Cols,
|
||||
XprVector<E2, Cols>
|
||||
>,
|
||||
Rows
|
||||
>
|
||||
operator*(const Matrix<T1, Rows, Cols>& lhs, const XprVector<E2, Cols>& rhs) {
|
||||
return prod(lhs, rhs);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \fn operator*(const XprMatrix<E1, Rows, Cols>& lhs, const Vector<T2, Cols>& rhs)
|
||||
* \brief Compute the product of an XprMatrix with a Vector.
|
||||
* \ingroup _binary_operator
|
||||
* \sa prod(const XprMatrix<E, Rows, Cols>& lhs, const Vector<T, Cols>& rhs)
|
||||
*/
|
||||
template<class E1, class T2, int Rows, int Cols>
|
||||
inline
|
||||
XprVector<
|
||||
XprMVProduct<
|
||||
XprMatrix<E1, Rows, Cols>, Rows, Cols,
|
||||
VectorConstRef<T2, Cols>
|
||||
>,
|
||||
Rows
|
||||
>
|
||||
operator*(const XprMatrix<E1, Rows, Cols>& lhs, const Vector<T2, Cols>& rhs) {
|
||||
return prod(lhs, rhs);
|
||||
}
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
* global unary operators
|
||||
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
|
||||
/*
|
||||
* unary_operator(Matrix<T, Rows, Cols>)
|
||||
* Note: per se element wise
|
||||
*/
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME, OP) \
|
||||
template <class T, int Rows, int Cols> \
|
||||
inline \
|
||||
XprMatrix< \
|
||||
XprUnOp< \
|
||||
Fcnl_##NAME<T>, \
|
||||
MatrixConstRef<T, Rows, Cols> \
|
||||
>, \
|
||||
Rows, Cols \
|
||||
> \
|
||||
operator OP (const Matrix<T, Rows, Cols>& rhs) { \
|
||||
typedef XprUnOp< \
|
||||
Fcnl_##NAME<T>, \
|
||||
MatrixConstRef<T, Rows, Cols> \
|
||||
> expr_type; \
|
||||
return XprMatrix<expr_type, Rows, Cols>(expr_type(rhs.constRef())); \
|
||||
}
|
||||
|
||||
TVMET_IMPLEMENT_MACRO(neg, -)
|
||||
#undef TVMET_IMPLEMENT_MACRO
|
||||
|
||||
|
||||
} // namespace tvmet
|
||||
|
||||
#endif // TVMET_MATRIX_OPERATORS_H
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
@@ -1,90 +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: MatrixUnaryFunctions.h,v 1.9 2004/06/10 16:36:55 opetzold Exp $
|
||||
*/
|
||||
|
||||
#ifndef TVMET_MATRIX_UNARY_FUNCTIONS_H
|
||||
#define TVMET_MATRIX_UNARY_FUNCTIONS_H
|
||||
|
||||
namespace tvmet {
|
||||
|
||||
/*
|
||||
* unary_function(Matrix<std::complex<T>, Rows, Cols>)
|
||||
*/
|
||||
#if defined(EIGEN_USE_COMPLEX)
|
||||
#define TVMET_DECLARE_MACRO(NAME) \
|
||||
template<class T, int Rows, int Cols> \
|
||||
inline \
|
||||
XprMatrix< \
|
||||
XprUnOp< \
|
||||
Fcnl_##NAME< std::complex<T> >, \
|
||||
MatrixConstRef<std::complex<T>, Rows, Cols> \
|
||||
>, \
|
||||
Rows, Cols \
|
||||
> \
|
||||
NAME(const Matrix<std::complex<T>, Rows, Cols>& rhs) _tvmet_always_inline;
|
||||
|
||||
TVMET_DECLARE_MACRO(real)
|
||||
TVMET_DECLARE_MACRO(imag)
|
||||
TVMET_DECLARE_MACRO(conj)
|
||||
|
||||
#undef TVMET_DECLARE_MACRO
|
||||
|
||||
#endif // defined(EIGEN_USE_COMPLEX)
|
||||
|
||||
/*
|
||||
* unary_function(Matrix<std::complex<T>, Rows, Cols>)
|
||||
*/
|
||||
#if defined(EIGEN_USE_COMPLEX)
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME) \
|
||||
template<class T, int Rows, int Cols> \
|
||||
inline \
|
||||
XprMatrix< \
|
||||
XprUnOp< \
|
||||
Fcnl_##NAME< std::complex<T> >, \
|
||||
MatrixConstRef<std::complex<T>, Rows, Cols> \
|
||||
>, \
|
||||
Rows, Cols \
|
||||
> \
|
||||
NAME(const Matrix<std::complex<T>, Rows, Cols>& rhs) { \
|
||||
typedef XprUnOp< \
|
||||
Fcnl_##NAME< std::complex<T> >, \
|
||||
MatrixConstRef<std::complex<T>, Rows, Cols> \
|
||||
> expr_type; \
|
||||
return XprMatrix<expr_type, Rows, Cols>(expr_type(rhs.constRef())); \
|
||||
}
|
||||
|
||||
TVMET_IMPLEMENT_MACRO(real)
|
||||
TVMET_IMPLEMENT_MACRO(imag)
|
||||
TVMET_IMPLEMENT_MACRO(conj)
|
||||
|
||||
#undef TVMET_IMPLEMENT_MACRO
|
||||
|
||||
#endif // defined(EIGEN_USE_COMPLEX)
|
||||
|
||||
|
||||
} // namespace tvmet
|
||||
|
||||
#endif // TVMET_MATRIX_UNARY_FUNCTIONS_H
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
@@ -1,122 +0,0 @@
|
||||
/* 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
|
||||
* 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: Traits.h,v 1.11 2004/11/04 18:10:35 opetzold Exp $
|
||||
*/
|
||||
|
||||
#ifndef TVMET_NUMERIC_TRAITS_H
|
||||
#define TVMET_NUMERIC_TRAITS_H
|
||||
|
||||
#if defined(EIGEN_USE_COMPLEX)
|
||||
# include <complex>
|
||||
#endif
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include <tvmet/TraitsBase.h>
|
||||
|
||||
namespace tvmet {
|
||||
|
||||
/**
|
||||
* \class Traits Traits.h "tvmet/Traits.h"
|
||||
* \brief Traits for standard types.
|
||||
*
|
||||
*/
|
||||
template<typename T>
|
||||
struct Traits : public TraitsBase<T>
|
||||
{
|
||||
typedef TraitsBase<T> Base;
|
||||
typedef typename Base::value_type value_type;
|
||||
typedef typename Base::real_type real_type;
|
||||
typedef typename Base::float_type float_type;
|
||||
typedef typename Base::argument_type argument_type;
|
||||
|
||||
using Base::isFloat;
|
||||
using Base::isComplex;
|
||||
using Base::epsilon;
|
||||
using Base::abs;
|
||||
using Base::real;
|
||||
using Base::imag;
|
||||
using Base::conj;
|
||||
using Base::sqrt;
|
||||
using Base::isLessThan_nonfuzzy;
|
||||
|
||||
static value_type random()
|
||||
{
|
||||
value_type x;
|
||||
pickRandom(x);
|
||||
return x;
|
||||
}
|
||||
/**
|
||||
* Short version: returns true if the absolute value of \a a is much smaller
|
||||
* than that of \a b.
|
||||
*
|
||||
* Full story: returns(abs(a) <= abs(b) * epsilon());
|
||||
*/
|
||||
static bool isNegligible(argument_type a, argument_type b)
|
||||
{
|
||||
if(isFloat())
|
||||
return(abs(a) <= abs(b) * epsilon());
|
||||
else
|
||||
return(a==static_cast<value_type>(0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Short version: returns true if \a a is approximately zero.
|
||||
*
|
||||
* Full story: returns isNegligible( a, static_cast<T>(1) );
|
||||
*/
|
||||
static bool isZero(argument_type a)
|
||||
{
|
||||
return isNegligible(a, static_cast<value_type>(1));
|
||||
}
|
||||
|
||||
/**
|
||||
* Short version: returns true if a is very close to b, false otherwise.
|
||||
*
|
||||
* Full story: returns abs( a - b ) <= min( abs(a), abs(b) ) * epsilon<T>.
|
||||
*/
|
||||
static bool isApprox(argument_type a, argument_type b)
|
||||
{
|
||||
if(isFloat())
|
||||
return(abs( a - b ) <= std::min(abs(a), abs(b)) * epsilon());
|
||||
else
|
||||
return(a==b);
|
||||
}
|
||||
|
||||
/**
|
||||
* Short version: returns true if a is smaller or approximately equalt to b, false otherwise.
|
||||
*
|
||||
* Full story: returns a <= b || isApprox(a, b);
|
||||
*/
|
||||
static bool isLessThan(argument_type a, argument_type b)
|
||||
{
|
||||
if(isFloat())
|
||||
return(isLessThan_nonfuzzy(a,b) || isApprox(a, b));
|
||||
else
|
||||
return(isLessThan_nonfuzzy(a,b));
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
} // namespace tvmet
|
||||
|
||||
#endif // TVMET_NUMERIC_TRAITS_H
|
||||
@@ -1,347 +0,0 @@
|
||||
/* 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
|
||||
* 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: TraitsBase.h,v 1.11 2004/11/04 18:10:35 opetzold Exp $
|
||||
*/
|
||||
|
||||
#ifndef TVMET_NUMERIC_TRAITS_BASE_H
|
||||
#define TVMET_NUMERIC_TRAITS_BASE_H
|
||||
|
||||
#if defined(EIGEN_USE_COMPLEX)
|
||||
# include <complex>
|
||||
#endif
|
||||
|
||||
#include <cmath>
|
||||
#include <cstdlib>
|
||||
|
||||
namespace tvmet {
|
||||
|
||||
/**
|
||||
* \class TraitsBase TraitsBase.h "tvmet/TraitsBase.h"
|
||||
* \brief Traits for standard types.
|
||||
*
|
||||
* In this base class goes the basic stuff that has to be implemented specifically
|
||||
* for each type.
|
||||
*/
|
||||
template<typename T>
|
||||
struct TraitsBase {
|
||||
typedef T real_type;
|
||||
typedef T value_type;
|
||||
typedef T float_type;
|
||||
typedef const T & argument_type;
|
||||
|
||||
static real_type real(argument_type x);
|
||||
static real_type imag(argument_type x);
|
||||
static value_type conj(argument_type x);
|
||||
static real_type abs(argument_type x);
|
||||
static value_type sqrt(argument_type x);
|
||||
static real_type epsilon();
|
||||
static bool isComplex();
|
||||
static bool isFloat();
|
||||
|
||||
static bool isLessThan_nonfuzzy(argument_type x, argument_type y);
|
||||
};
|
||||
|
||||
/*
|
||||
* numeric traits for built-in types
|
||||
*/
|
||||
|
||||
/**
|
||||
* \class TraitsBase<int> TraitsBase.h "tvmet/TraitsBase.h"
|
||||
* \brief Traits specialized for int.
|
||||
*/
|
||||
template<>
|
||||
struct TraitsBase<int> {
|
||||
typedef int value_type;
|
||||
typedef value_type real_type;
|
||||
typedef double float_type;
|
||||
typedef value_type argument_type;
|
||||
|
||||
static real_type real(argument_type x) { return x; }
|
||||
static real_type imag(argument_type x) { TVMET_UNUSED(x); return 0; }
|
||||
static value_type conj(argument_type x) { return x; }
|
||||
static value_type sqrt(argument_type x) {
|
||||
return static_cast<value_type>(std::sqrt(static_cast<float_type>(x)));
|
||||
}
|
||||
static real_type abs(argument_type x) {
|
||||
return std::abs(x);
|
||||
}
|
||||
static real_type epsilon() { return 0; }
|
||||
static bool isComplex() { return false; }
|
||||
static bool isFloat() { return false; }
|
||||
|
||||
/** Complexity on operations. */
|
||||
enum {
|
||||
ops_plus = 1, /**< Complexity on plus/minus ops. */
|
||||
ops_muls = 1 /**< Complexity on multiplications. */
|
||||
};
|
||||
|
||||
static bool isLessThan_nonfuzzy(argument_type x, argument_type y) {
|
||||
return x <= y;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* \class TraitsBase<float> TraitsBase.h "tvmet/TraitsBase.h"
|
||||
* \brief Traits specialized for float.
|
||||
*/
|
||||
template<>
|
||||
struct TraitsBase<float> {
|
||||
typedef float value_type;
|
||||
typedef value_type real_type;
|
||||
typedef value_type float_type;
|
||||
typedef value_type argument_type;
|
||||
|
||||
static real_type real(argument_type x) { return x; }
|
||||
static real_type imag(argument_type x) { TVMET_UNUSED(x); return 0; }
|
||||
static value_type conj(argument_type x) { return x; }
|
||||
static value_type sqrt(argument_type x) {
|
||||
return std::sqrt(x);
|
||||
}
|
||||
static real_type abs(argument_type x) {
|
||||
return std::abs(x);
|
||||
}
|
||||
static real_type epsilon() { return 1e-5f; }
|
||||
static bool isComplex() { return false; }
|
||||
static bool isFloat() { return true; }
|
||||
|
||||
/** Complexity on operations. */
|
||||
enum {
|
||||
ops_plus = 1, /**< Complexity on plus/minus ops. */
|
||||
ops_muls = 1 /**< Complexity on multiplications. */
|
||||
};
|
||||
|
||||
static bool isLessThan_nonfuzzy(argument_type x, argument_type y) {
|
||||
return x <= y;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* \class TraitsBase<double> TraitsBase.h "tvmet/TraitsBase.h"
|
||||
* \brief Traits specialized for double.
|
||||
*/
|
||||
template<>
|
||||
struct TraitsBase<double> {
|
||||
typedef double value_type;
|
||||
typedef value_type real_type;
|
||||
typedef value_type float_type;
|
||||
typedef value_type argument_type;
|
||||
|
||||
static real_type real(argument_type x) { return x; }
|
||||
static real_type imag(argument_type x) { TVMET_UNUSED(x); return 0; }
|
||||
static value_type conj(argument_type x) { return x; }
|
||||
static value_type sqrt(argument_type x) {
|
||||
return std::sqrt(x);
|
||||
}
|
||||
static real_type abs(argument_type x) {
|
||||
return std::abs(x);
|
||||
}
|
||||
static real_type epsilon() { return 1e-11; }
|
||||
static bool isComplex() { return false; }
|
||||
static bool isFloat() { return true; }
|
||||
|
||||
/** Complexity on operations. */
|
||||
enum {
|
||||
ops_plus = 1, /**< Complexity on plus/minus ops. */
|
||||
ops_muls = 1 /**< Complexity on multiplications. */
|
||||
};
|
||||
|
||||
static bool isLessThan_nonfuzzy(argument_type x, argument_type y) {
|
||||
return x <= y;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* numeric traits for complex types
|
||||
*/
|
||||
#if defined(EIGEN_USE_COMPLEX)
|
||||
|
||||
/**
|
||||
* \class TraitsBase< std::complex<int> > TraitsBase.h "tvmet/TraitsBase.h"
|
||||
* \brief Traits specialized for std::complex<int>.
|
||||
*/
|
||||
template<>
|
||||
struct TraitsBase< std::complex<int> >
|
||||
{
|
||||
typedef std::complex<int> value_type;
|
||||
typedef int real_type;
|
||||
typedef std::complex<float> float_type;
|
||||
typedef const value_type& argument_type;
|
||||
|
||||
static real_type real(argument_type z) { return std::real(z); }
|
||||
static real_type imag(argument_type z) { return std::imag(z); }
|
||||
static value_type conj(argument_type z) { return std::conj(z); }
|
||||
static real_type abs(argument_type x) {
|
||||
// the use of ceil() guarantees e.g. that abs(real(x)) <= abs(x),
|
||||
// and that abs(x)==0 if and only if x==0.
|
||||
return static_cast<int>(std::ceil(std::abs(float_type(x.real(),x.imag()))));
|
||||
}
|
||||
static value_type sqrt(argument_type x) {
|
||||
float_type y = std::sqrt(float_type(x.real(), x.imag()));
|
||||
int r = static_cast<int>(y.real());
|
||||
int i = static_cast<int>(y.imag());
|
||||
return value_type(r,i);
|
||||
}
|
||||
static real_type epsilon() { return 0; }
|
||||
static bool isComplex() { return true; }
|
||||
static bool isFloat() { return false; }
|
||||
|
||||
/** Complexity on operations. */
|
||||
enum {
|
||||
ops_plus = 2, /**< Complexity on plus/minus ops. */
|
||||
ops_muls = 6 /**< Complexity on multiplications. */
|
||||
};
|
||||
|
||||
static bool isLessThan_nonfuzzy(argument_type x, argument_type y) {
|
||||
TVMET_UNUSED(x);
|
||||
TVMET_UNUSED(y);
|
||||
return false;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* \class TraitsBase< std::complex<float> > TraitsBase.h "tvmet/TraitsBase.h"
|
||||
* \brief Traits specialized for std::complex<float>.
|
||||
*/
|
||||
template<>
|
||||
struct TraitsBase< std::complex<float> > {
|
||||
typedef std::complex<float> value_type;
|
||||
typedef float real_type;
|
||||
typedef value_type float_type;
|
||||
typedef const value_type& argument_type;
|
||||
|
||||
static real_type real(argument_type z) { return std::real(z); }
|
||||
static real_type imag(argument_type z) { return std::imag(z); }
|
||||
static value_type conj(argument_type z) { return std::conj(z); }
|
||||
static value_type sqrt(argument_type x) {
|
||||
return std::sqrt(x);
|
||||
}
|
||||
static real_type abs(argument_type x) {
|
||||
return std::abs(x);
|
||||
}
|
||||
static real_type epsilon() { return 1e-5f; }
|
||||
static bool isComplex() { return true; }
|
||||
static bool isFloat() { return true; }
|
||||
|
||||
/** Complexity on operations. */
|
||||
enum {
|
||||
ops_plus = 2, /**< Complexity on plus/minus ops. */
|
||||
ops_muls = 6 /**< Complexity on multiplications. */
|
||||
};
|
||||
|
||||
static bool isLessThan_nonfuzzy(argument_type x, argument_type y) {
|
||||
TVMET_UNUSED(x);
|
||||
TVMET_UNUSED(y);
|
||||
return false;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* \class TraitsBase< std::complex<double> > TraitsBase.h "tvmet/TraitsBase.h"
|
||||
* \brief Traits specialized for std::complex<double>.
|
||||
*/
|
||||
template<>
|
||||
struct TraitsBase< std::complex<double> > {
|
||||
typedef std::complex<double> value_type;
|
||||
typedef double real_type;
|
||||
typedef value_type float_type;
|
||||
typedef const value_type& argument_type;
|
||||
|
||||
static real_type real(argument_type z) { return std::real(z); }
|
||||
static real_type imag(argument_type z) { return std::imag(z); }
|
||||
static value_type conj(argument_type z) { return std::conj(z); }
|
||||
static value_type sqrt(argument_type x) {
|
||||
return std::sqrt(x);
|
||||
}
|
||||
static real_type abs(argument_type x) {
|
||||
return std::abs(x);
|
||||
}
|
||||
static real_type epsilon() { return 1e-11; }
|
||||
static bool isComplex() { return true; }
|
||||
static bool isFloat() { return true; }
|
||||
|
||||
/** Complexity on operations. */
|
||||
enum {
|
||||
ops_plus = 2, /**< Complexity on plus/minus ops. */
|
||||
ops_muls = 6 /**< Complexity on multiplications. */
|
||||
};
|
||||
|
||||
static bool isLessThan_nonfuzzy(argument_type x, argument_type y) {
|
||||
TVMET_UNUSED(x);
|
||||
TVMET_UNUSED(y);
|
||||
return false;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif // defined(EIGEN_USE_COMPLEX)
|
||||
|
||||
#ifdef __GNUC__
|
||||
# if __GNUC__>=4
|
||||
# define EIGEN_WITH_GCC_4_OR_LATER
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/** Stores in x a random int between -RAND_MAX/2 and RAND_MAX/2 */
|
||||
inline void pickRandom( int & x )
|
||||
{
|
||||
x = rand() - RAND_MAX / 2;
|
||||
}
|
||||
|
||||
/** Stores in x a random float between -1.0 and 1.0 */
|
||||
inline void pickRandom( float & x )
|
||||
{
|
||||
x = 2.0f * rand() / RAND_MAX - 1.0f;
|
||||
}
|
||||
|
||||
/** Stores in x a random double between -1.0 and 1.0 */
|
||||
inline void pickRandom( double & x )
|
||||
{
|
||||
x = 2.0 * rand() / RAND_MAX - 1.0;
|
||||
}
|
||||
|
||||
#ifdef EIGEN_USE_COMPLEX
|
||||
/** Stores in the real and imaginary parts of x
|
||||
* random values between -1.0 and 1.0 */
|
||||
template<typename T> void pickRandom( std::complex<T> & x )
|
||||
{
|
||||
#ifdef EIGEN_WITH_GCC_4_OR_LATER
|
||||
pickRandom( x.real() );
|
||||
pickRandom( x.imag() );
|
||||
#else // workaround by David Faure for MacOS 10.3 and GCC 3.3, commit 630812
|
||||
T r = x.real();
|
||||
T i = x.imag();
|
||||
pickRandom( r );
|
||||
pickRandom( i );
|
||||
x = std::complex<T>(r,i);
|
||||
#endif
|
||||
}
|
||||
#endif // EIGEN_USE_COMPLEX
|
||||
|
||||
} // namespace tvmet
|
||||
|
||||
#endif // TVMET_NUMERIC_TRAITS_BASE_H
|
||||
@@ -1,101 +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: TvmetBase.h,v 1.11 2004/06/10 16:36:55 opetzold Exp $
|
||||
*/
|
||||
|
||||
#ifndef TVMET_BASE_H
|
||||
#define TVMET_BASE_H
|
||||
|
||||
#include <iosfwd> // io streams forward declaration
|
||||
#include <typeinfo> // rtti: used by Xpr.h level printing
|
||||
#include <cmath> // unary and binary math
|
||||
#include <cstdlib> // labs
|
||||
|
||||
namespace tvmet {
|
||||
|
||||
|
||||
/**
|
||||
* \class TvmetBase TvmetBase.h "tvmet/TvmetBase.h"
|
||||
* \brief Base class
|
||||
* Used for static polymorph call of print_xpr
|
||||
*/
|
||||
template<class E> class TvmetBase { };
|
||||
|
||||
|
||||
/**
|
||||
* \class IndentLevel TvmetBase.h "tvmet/TvmetBase.h"
|
||||
* \brief Prints the level indent.
|
||||
*/
|
||||
class IndentLevel : public TvmetBase< IndentLevel >
|
||||
{
|
||||
public:
|
||||
IndentLevel(int level) : m_level(level) { }
|
||||
|
||||
std::ostream& print_xpr(std::ostream& os) const {
|
||||
for(int i = 0; i != m_level; ++i) os << " ";
|
||||
return os;
|
||||
}
|
||||
|
||||
private:
|
||||
int m_level;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* \fn operator<<(std::ostream& os, const TvmetBase<E>& e)
|
||||
* \brief overloaded ostream operator using static polymorphic.
|
||||
* \ingroup _binary_operator
|
||||
*/
|
||||
template<class E>
|
||||
inline
|
||||
std::ostream& operator<<(std::ostream& os, const TvmetBase<E>& e) {
|
||||
static_cast<const E&>(e).print_xpr(os);
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \class dispatch TvmetBase.h "tvmet/TvmetBase.h"
|
||||
* \brief Class helper to distuingish between e.g. meta
|
||||
* and loop strategy used.
|
||||
*/
|
||||
template<bool> struct dispatch;
|
||||
|
||||
/**
|
||||
* \class dispatch<true> TvmetBase.h "tvmet/TvmetBase.h"
|
||||
* \brief specialized.
|
||||
*/
|
||||
template<> struct dispatch<true> { };
|
||||
|
||||
/**
|
||||
* \class dispatch<false> TvmetBase.h "tvmet/TvmetBase.h"
|
||||
* \brief specialized.
|
||||
*/
|
||||
template<> struct dispatch<false> { };
|
||||
|
||||
|
||||
} // namespace tvmet
|
||||
|
||||
#endif // TVMET_BASE_H
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
@@ -1,176 +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: TypePromotion.h,v 1.6 2003/11/30 08:26:25 opetzold Exp $
|
||||
*/
|
||||
|
||||
#ifndef TVMET_TYPE_PROMOTION_H
|
||||
#define TVMET_TYPE_PROMOTION_H
|
||||
|
||||
namespace tvmet {
|
||||
|
||||
|
||||
/**
|
||||
* \class PrecisionTraits TypePromotion.h "tvmet/TypePromotion.h"
|
||||
* \brief Declaring ranks of types to avoid specializing
|
||||
*
|
||||
* All possible promoted types. For example, bool=1, int=2, float=3, double=4,
|
||||
* etc. We can use a traits class to map from a type such as float onto its
|
||||
* "precision rank". We will promote to whichever type has a higher
|
||||
* "precision rank". f there is no "precision rank" for a type, we'll
|
||||
* promote to whichever type requires more storage space
|
||||
* (and hopefully more precision).
|
||||
*/
|
||||
template<class T>
|
||||
struct PrecisionTraits {
|
||||
enum {
|
||||
rank = 0, /**< the rank of type. */
|
||||
known = 0 /**< true, if the rank is specialized = known. */
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
#define TVMET_PRECISION(T,R) \
|
||||
template<> \
|
||||
struct PrecisionTraits< T > { \
|
||||
enum { \
|
||||
rank = R, \
|
||||
known = 1 \
|
||||
}; \
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* pod types
|
||||
*/
|
||||
TVMET_PRECISION(int, 100)
|
||||
TVMET_PRECISION(float, 700)
|
||||
TVMET_PRECISION(double, 800)
|
||||
|
||||
/*
|
||||
* complex types
|
||||
*/
|
||||
#if defined(EIGEN_USE_COMPLEX)
|
||||
TVMET_PRECISION(std::complex<int>, 1000)
|
||||
TVMET_PRECISION(std::complex<float>, 1600)
|
||||
TVMET_PRECISION(std::complex<double>, 1700)
|
||||
#endif // defined(EIGEN_USE_COMPLEX)
|
||||
|
||||
|
||||
/** \class PrecisionTraits<int> TypePromotion.h "tvmet/TypePromotion.h" */
|
||||
/** \class PrecisionTraits<unsigned int> TypePromotion.h "tvmet/TypePromotion.h" */
|
||||
/** \class PrecisionTraits<long> TypePromotion.h "tvmet/TypePromotion.h" */
|
||||
/** \class PrecisionTraits<unsigned long> TypePromotion.h "tvmet/TypePromotion.h" */
|
||||
/** \class PrecisionTraits<long long> TypePromotion.h "tvmet/TypePromotion.h" */
|
||||
/** \class PrecisionTraits<unsigned long long> TypePromotion.h "tvmet/TypePromotion.h" */
|
||||
/** \class PrecisionTraits<float> TypePromotion.h "tvmet/TypePromotion.h" */
|
||||
/** \class PrecisionTraits<double> TypePromotion.h "tvmet/TypePromotion.h" */
|
||||
/** \class PrecisionTraits<long double> TypePromotion.h "tvmet/TypePromotion.h" */
|
||||
/** \class PrecisionTraits< std::complex<int> > TypePromotion.h "tvmet/TypePromotion.h" */
|
||||
/** \class PrecisionTraits< std::complex<unsigned int> > TypePromotion.h "tvmet/TypePromotion.h" */
|
||||
/** \class PrecisionTraits< std::complex<long> > TypePromotion.h "tvmet/TypePromotion.h" */
|
||||
/** \class PrecisionTraits< std::complex<unsigned long> > TypePromotion.h "tvmet/TypePromotion.h" */
|
||||
/** \class PrecisionTraits< std::complex<long long> > TypePromotion.h "tvmet/TypePromotion.h" */
|
||||
/** \class PrecisionTraits< std::complex<unsigned long long> > TypePromotion.h "tvmet/TypePromotion.h" */
|
||||
/** \class PrecisionTraits< std::complex<float> > TypePromotion.h "tvmet/TypePromotion.h" */
|
||||
/** \class PrecisionTraits< std::complex<double> > TypePromotion.h "tvmet/TypePromotion.h" */
|
||||
/** \class PrecisionTraits< std::complex<long double> > TypePromotion.h "tvmet/TypePromotion.h" */
|
||||
|
||||
#undef TVMET_PRECISION
|
||||
|
||||
|
||||
/**
|
||||
* \class AutopromoteTraits TypePromotion.h "tvmet/TypePromotion.h"
|
||||
* \brief The promoted types traits.
|
||||
*/
|
||||
template<class T>
|
||||
struct AutopromoteTraits {
|
||||
typedef T value_type;
|
||||
};
|
||||
|
||||
/**
|
||||
* \class promoteTo TypePromotion.h "tvmet/TypePromotion.h"
|
||||
* \brief Promote to T1.
|
||||
*/
|
||||
template<class T1, class T2, int promoteToT1>
|
||||
struct promoteTo {
|
||||
typedef T1 value_type;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* \class promoteTo<T1,T2,0> TypePromotion.h "tvmet/TypePromotion.h"
|
||||
* \brief Promote to T2
|
||||
*/
|
||||
template<class T1, class T2>
|
||||
struct promoteTo<T1,T2,0> {
|
||||
typedef T2 value_type;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* \class PromoteTraits TypePromotion.h "tvmet/TypePromotion.h"
|
||||
* \brief Promote type traits
|
||||
*/
|
||||
template<class T1org, class T2org>
|
||||
class PromoteTraits {
|
||||
// Handle promotion of small integers to int/unsigned int
|
||||
typedef typename AutopromoteTraits<T1org>::value_type T1;
|
||||
typedef typename AutopromoteTraits<T2org>::value_type T2;
|
||||
|
||||
enum {
|
||||
// True if T1 is higher ranked
|
||||
T1IsBetter = int(PrecisionTraits<T1>::rank) > int(PrecisionTraits<T2>::rank),
|
||||
|
||||
// True if we know ranks for both T1 and T2
|
||||
knowBothRanks = PrecisionTraits<T1>::known && PrecisionTraits<T2>::known,
|
||||
|
||||
// True if we know T1 but not T2
|
||||
knowT1butNotT2 = PrecisionTraits<T1>::known && !(PrecisionTraits<T2>::known),
|
||||
|
||||
// True if we know T2 but not T1
|
||||
knowT2butNotT1 = PrecisionTraits<T2>::known && !(PrecisionTraits<T1>::known),
|
||||
|
||||
// True if T1 is bigger than T2
|
||||
T1IsLarger = sizeof(T1) >= sizeof(T2),
|
||||
|
||||
// We know T1 but not T2: true
|
||||
// We know T2 but not T1: false
|
||||
// Otherwise, if T1 is bigger than T2: true
|
||||
defaultPromotion = knowT1butNotT2 ? false : (knowT2butNotT1 ? true : T1IsLarger),
|
||||
|
||||
// If we have both ranks, then use them.
|
||||
// If we have only one rank, then use the unknown type.
|
||||
// If we have neither rank, then promote to the larger type.
|
||||
promoteToT1 = (knowBothRanks ? T1IsBetter : defaultPromotion) ? 1 : 0
|
||||
};
|
||||
|
||||
public:
|
||||
typedef typename promoteTo<T1,T2,promoteToT1>::value_type value_type;
|
||||
};
|
||||
|
||||
|
||||
} // namespace tvmet
|
||||
|
||||
#endif // TVMET_TYPE_PROMOTION_H
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
@@ -1,119 +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: UnaryFunctionals.h,v 1.18 2004/10/04 11:44:42 opetzold Exp $
|
||||
*/
|
||||
|
||||
#ifndef TVMET_UNARY_FUNCTIONAL_H
|
||||
#define TVMET_UNARY_FUNCTIONAL_H
|
||||
|
||||
namespace tvmet {
|
||||
|
||||
/** \class Fcnl_compl UnaryFunctionals.h "tvmet/UnaryFunctionals.h" */
|
||||
/** \class Fcnl_neg UnaryFunctionals.h "tvmet/UnaryFunctionals.h" */
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME, OP) \
|
||||
template <class T> \
|
||||
struct Fcnl_##NAME : public UnaryFunctional { \
|
||||
typedef T value_type; \
|
||||
\
|
||||
static inline \
|
||||
value_type apply_on(value_type rhs) { \
|
||||
return OP rhs; \
|
||||
} \
|
||||
\
|
||||
static \
|
||||
void print_xpr(std::ostream& os, int l=0) { \
|
||||
os << IndentLevel(l) << "Fcnl_" << #NAME << "<T=" \
|
||||
<< typeid(T).name() << ">," \
|
||||
<< std::endl; \
|
||||
} \
|
||||
};
|
||||
|
||||
TVMET_IMPLEMENT_MACRO(neg, -)
|
||||
#undef TVMET_IMPLEMENT_MACRO
|
||||
|
||||
/*
|
||||
* complex support
|
||||
*/
|
||||
|
||||
|
||||
#if defined(EIGEN_USE_COMPLEX)
|
||||
|
||||
/**
|
||||
* \class Fcnl_conj< std::complex<T> > UnaryFunctionals.h "tvmet/UnaryFunctionals.h"
|
||||
* \brief %Functional for conj.
|
||||
*/
|
||||
template <class T> struct Fcnl_conj : public UnaryFunctional { };
|
||||
|
||||
|
||||
/** \class Fcnl_conj< std::complex<T> > UnaryFunctionals.h "tvmet/UnaryFunctionals.h" */
|
||||
template <class T>
|
||||
struct Fcnl_conj< std::complex<T> > : public UnaryFunctional {
|
||||
typedef std::complex<T> value_type;
|
||||
|
||||
static inline
|
||||
value_type apply_on(const std::complex<T>& rhs) {
|
||||
return std::conj(rhs);
|
||||
}
|
||||
|
||||
static
|
||||
void print_xpr(std::ostream& os, int l=0) {
|
||||
os << IndentLevel(l) << "Fcnl_conj<T="
|
||||
<< typeid(std::complex<T>).name() << ">,"
|
||||
<< std::endl;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/** \class Fcnl_real< std::complex<T> > UnaryFunctionals.h "tvmet/UnaryFunctionals.h" */
|
||||
/** \class Fcnl_imag< std::complex<T> > UnaryFunctionals.h "tvmet/UnaryFunctionals.h" */
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME) \
|
||||
template <class T> struct Fcnl_##NAME; \
|
||||
template <class T> \
|
||||
struct Fcnl_##NAME< std::complex<T> > : public UnaryFunctional { \
|
||||
typedef T value_type; \
|
||||
\
|
||||
static inline \
|
||||
value_type apply_on(const std::complex<T>& rhs) { \
|
||||
return TVMET_STD_SCOPE(NAME)(rhs); \
|
||||
} \
|
||||
\
|
||||
static \
|
||||
void print_xpr(std::ostream& os, int l=0) { \
|
||||
os << IndentLevel(l) << "Fcnl_" << #NAME << "<T=" \
|
||||
<< typeid(std::complex<T>).name() << ">," \
|
||||
<< std::endl; \
|
||||
} \
|
||||
};
|
||||
|
||||
TVMET_IMPLEMENT_MACRO(real)
|
||||
TVMET_IMPLEMENT_MACRO(imag)
|
||||
|
||||
#undef TVMET_IMPLEMENT_MACRO
|
||||
|
||||
#endif // defined(EIGEN_USE_COMPLEX)
|
||||
|
||||
} // namespace tvmet
|
||||
|
||||
#endif // TVMET_UNARY_FUNCTIONAL_H
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
@@ -1,317 +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: Vector.h,v 1.44 2004/09/16 09:14:18 opetzold Exp $
|
||||
*/
|
||||
|
||||
#ifndef TVMET_VECTOR_H
|
||||
#define TVMET_VECTOR_H
|
||||
|
||||
#include <iterator> // reverse_iterator
|
||||
#include <cassert>
|
||||
|
||||
#include <tvmet/tvmet.h>
|
||||
#include <tvmet/TypePromotion.h>
|
||||
#include <tvmet/CommaInitializer.h>
|
||||
|
||||
#include <tvmet/xpr/Vector.h>
|
||||
|
||||
namespace tvmet {
|
||||
|
||||
|
||||
/* forwards */
|
||||
template<class T, int Sz> class Vector;
|
||||
|
||||
|
||||
/**
|
||||
* \class VectorConstRef Vector.h "tvmet/Vector.h"
|
||||
* \brief Const value iterator for ET
|
||||
*/
|
||||
template<class T, int Sz>
|
||||
class VectorConstRef
|
||||
: public TvmetBase< VectorConstRef<T, Sz> >
|
||||
{
|
||||
public: // types
|
||||
typedef T value_type;
|
||||
typedef T* pointer;
|
||||
typedef const T* const_pointer;
|
||||
|
||||
public:
|
||||
/** Dimensions. */
|
||||
enum {
|
||||
Size = Sz /**< The size of the vector. */
|
||||
};
|
||||
|
||||
public:
|
||||
/** Complexity counter. */
|
||||
enum {
|
||||
ops = Size
|
||||
};
|
||||
|
||||
private:
|
||||
VectorConstRef();
|
||||
VectorConstRef& operator=(const VectorConstRef&);
|
||||
|
||||
public:
|
||||
/** Constructor. */
|
||||
explicit VectorConstRef(const Vector<T, Size>& rhs)
|
||||
: m_array(rhs.array())
|
||||
{ }
|
||||
|
||||
/** Constructor by a given memory pointer. */
|
||||
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_array[i];
|
||||
}
|
||||
|
||||
public: // debugging Xpr parse tree
|
||||
void print_xpr(std::ostream& os, int l=0) const {
|
||||
os << IndentLevel(l)
|
||||
<< "VectorConstRef[O=" << ops << "]<"
|
||||
<< "T=" << typeid(T).name() << ">,"
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
private:
|
||||
const_pointer _tvmet_restrict m_array;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* \class Vector Vector.h "tvmet/Vector.h"
|
||||
* \brief Compile time fixed length vector with evaluation on compile time.
|
||||
*/
|
||||
template<class T, int Size>
|
||||
class Vector
|
||||
{
|
||||
public:
|
||||
/** Data type of the tvmet::Vector. */
|
||||
typedef T value_type;
|
||||
|
||||
public:
|
||||
/** Complexity counter. */
|
||||
enum {
|
||||
ops_assign = Size,
|
||||
ops = ops_assign,
|
||||
use_meta = ops < TVMET_COMPLEXITY_V_ASSIGN_TRIGGER ? true : false
|
||||
};
|
||||
|
||||
public:
|
||||
/** Default Destructor */
|
||||
~Vector() {}
|
||||
|
||||
/** Default Constructor. Does nothing. */
|
||||
explicit Vector() {}
|
||||
|
||||
/** Copy Constructor, not explicit! */
|
||||
Vector(const Vector& rhs)
|
||||
{
|
||||
*this = XprVector<ConstRef, Size>(rhs.constRef());
|
||||
}
|
||||
|
||||
explicit Vector(const value_type* array)
|
||||
{
|
||||
for(int i = 0; i < Size; i++) m_array[i] = array[i];
|
||||
}
|
||||
|
||||
/** Construct a vector by expression. */
|
||||
template <class E>
|
||||
explicit Vector(const XprVector<E, Size>& e)
|
||||
{
|
||||
*this = e;
|
||||
}
|
||||
|
||||
/** Assign a value_type on array, this can be used for a single value
|
||||
or a comma separeted list of values. */
|
||||
CommaInitializer<Vector, Size> operator=(value_type rhs) {
|
||||
return CommaInitializer<Vector, Size>(*this, rhs);
|
||||
}
|
||||
|
||||
public: // access operators
|
||||
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_array[i];
|
||||
}
|
||||
|
||||
value_type operator()(int i) const {
|
||||
assert(i < Size);
|
||||
return m_array[i];
|
||||
}
|
||||
|
||||
value_type& _tvmet_restrict operator[](int i) {
|
||||
// Note: g++-2.95.3 does have problems on typedef reference
|
||||
return this->operator()(i);
|
||||
}
|
||||
|
||||
value_type operator[](int i) const {
|
||||
return this->operator()(i);
|
||||
}
|
||||
|
||||
public: // ET interface
|
||||
typedef VectorConstRef<T, Size> ConstRef;
|
||||
|
||||
/** Return a const Reference of the internal data */
|
||||
ConstRef constRef() const { return ConstRef(*this); }
|
||||
|
||||
/** Return the vector as const expression. */
|
||||
XprVector<ConstRef, Size> expr() const {
|
||||
return XprVector<ConstRef, Size>(this->constRef());
|
||||
}
|
||||
|
||||
private:
|
||||
/** Wrapper for meta assign. */
|
||||
template<class Dest, class Src, class Assign>
|
||||
static inline
|
||||
void do_assign(dispatch<true>, Dest& dest, const Src& src, const Assign& assign_fn) {
|
||||
meta::Vector<Size, 0>::assign(dest, src, assign_fn);
|
||||
}
|
||||
|
||||
/** Wrapper for loop assign. */
|
||||
template<class Dest, class Src, class Assign>
|
||||
static inline
|
||||
void do_assign(dispatch<false>, Dest& dest, const Src& src, const Assign& assign_fn) {
|
||||
loop::Vector<Size>::assign(dest, src, assign_fn);
|
||||
}
|
||||
|
||||
public:
|
||||
/** assign this to a vector expression using the functional assign_fn. */
|
||||
template<class T2, class Assign>
|
||||
void assign_to(Vector<T2, Size>& dest, const Assign& assign_fn) const {
|
||||
do_assign(dispatch<use_meta>(), dest, *this, assign_fn);
|
||||
}
|
||||
|
||||
public: // assign operations
|
||||
/** assign a given Vector element wise to this vector.
|
||||
The operator=(const Vector&) is compiler generated. */
|
||||
template<class T2>
|
||||
Vector& operator=(const Vector<T2, Size>& rhs) {
|
||||
rhs.assign_to(*this, Fcnl_assign<value_type, T2>());
|
||||
return *this;
|
||||
}
|
||||
|
||||
/** assign a given XprVector element wise to this vector. */
|
||||
template<class E>
|
||||
Vector& operator=(const XprVector<E, Size>& rhs) {
|
||||
rhs.assign_to(*this, Fcnl_assign<value_type, typename E::value_type>());
|
||||
return *this;
|
||||
}
|
||||
|
||||
private:
|
||||
template<class Obj, int LEN> friend class CommaInitializer;
|
||||
|
||||
void commaWrite(int index, T rhs)
|
||||
{
|
||||
m_array[index] = rhs;
|
||||
}
|
||||
|
||||
public: // math operators with scalars
|
||||
// NOTE: this meaning is clear - element wise ops even if not in ns element_wise
|
||||
Vector& operator+=(value_type) _tvmet_always_inline;
|
||||
Vector& operator-=(value_type) _tvmet_always_inline;
|
||||
Vector& operator*=(value_type) _tvmet_always_inline;
|
||||
Vector& operator/=(value_type) _tvmet_always_inline;
|
||||
|
||||
public: // math assign operators with vectors
|
||||
// NOTE: access using the operators in ns element_wise, since that's what is does
|
||||
template <class T2> Vector& M_add_eq(const Vector<T2, Size>&) _tvmet_always_inline;
|
||||
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;
|
||||
|
||||
public: // math operators with expressions
|
||||
// NOTE: access using the operators in ns element_wise, since that's what is does
|
||||
template <class E> Vector& M_add_eq(const XprVector<E, Size>&) _tvmet_always_inline;
|
||||
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;
|
||||
|
||||
public: // aliased math operators with expressions, used with proxy
|
||||
template <class T2> Vector& alias_assign(const Vector<T2, Size>&) _tvmet_always_inline;
|
||||
template <class T2> Vector& alias_add_eq(const Vector<T2, Size>&) _tvmet_always_inline;
|
||||
template <class T2> Vector& alias_sub_eq(const Vector<T2, Size>&) _tvmet_always_inline;
|
||||
template <class T2> Vector& alias_mul_eq(const Vector<T2, Size>&) _tvmet_always_inline;
|
||||
template <class T2> Vector& alias_div_eq(const Vector<T2, Size>&) _tvmet_always_inline;
|
||||
|
||||
template <class E> Vector& alias_assign(const XprVector<E, Size>&) _tvmet_always_inline;
|
||||
template <class E> Vector& alias_add_eq(const XprVector<E, Size>&) _tvmet_always_inline;
|
||||
template <class E> Vector& alias_sub_eq(const XprVector<E, Size>&) _tvmet_always_inline;
|
||||
template <class E> Vector& alias_mul_eq(const XprVector<E, Size>&) _tvmet_always_inline;
|
||||
template <class E> Vector& alias_div_eq(const XprVector<E, Size>&) _tvmet_always_inline;
|
||||
|
||||
public: // io
|
||||
/** Structure for info printing as Vector<T, Size>. */
|
||||
struct Info : public TvmetBase<Info> {
|
||||
std::ostream& print_xpr(std::ostream& os) const {
|
||||
os << "Vector<T=" << typeid(value_type).name()
|
||||
<< ", Sz=" << Size << ">";
|
||||
return os;
|
||||
}
|
||||
};
|
||||
|
||||
/** Get an info object of this vector. */
|
||||
static Info info() { return Info(); }
|
||||
|
||||
/** Member function for expression level printing. */
|
||||
std::ostream& print_xpr(std::ostream& os, int l=0) const;
|
||||
|
||||
/** Member function for printing internal data. */
|
||||
std::ostream& print_on(std::ostream& os) const;
|
||||
|
||||
private:
|
||||
/** The data of vector self. */
|
||||
|
||||
value_type m_array[Size];
|
||||
};
|
||||
|
||||
typedef Vector<int, 2> Vector2i;
|
||||
typedef Vector<int, 3> Vector3i;
|
||||
typedef Vector<int, 4> Vector4i;
|
||||
typedef Vector<float, 2> Vector2f;
|
||||
typedef Vector<float, 3> Vector3f;
|
||||
typedef Vector<float, 4> Vector4f;
|
||||
typedef Vector<double, 2> Vector2d;
|
||||
typedef Vector<double, 3> Vector3d;
|
||||
typedef Vector<double, 4> Vector4d;
|
||||
|
||||
} // namespace tvmet
|
||||
|
||||
#include <tvmet/VectorImpl.h>
|
||||
#include <tvmet/VectorFunctions.h>
|
||||
#include <tvmet/VectorUnaryFunctions.h>
|
||||
#include <tvmet/VectorOperators.h>
|
||||
#include <tvmet/VectorEval.h>
|
||||
#include <tvmet/AliasProxy.h>
|
||||
|
||||
#endif // TVMET_VECTOR_H
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
@@ -1,373 +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: VectorEval.h,v 1.14 2003/11/30 08:26:25 opetzold Exp $
|
||||
*/
|
||||
|
||||
#ifndef TVMET_VECTOR_EVAL_H
|
||||
#define TVMET_VECTOR_EVAL_H
|
||||
|
||||
namespace tvmet {
|
||||
|
||||
|
||||
/********************************************************************
|
||||
* functions all_elements/any_elements
|
||||
********************************************************************/
|
||||
|
||||
|
||||
/**
|
||||
* \fn bool all_elements(const XprVector<E, Sz>& e)
|
||||
* \brief check on statements for all elements
|
||||
* \ingroup _unary_function
|
||||
* This is for use with boolean operators like
|
||||
* \par Example:
|
||||
* \code
|
||||
* all_elements(vector > 0) {
|
||||
* // true branch
|
||||
* } else {
|
||||
* // false branch
|
||||
* }
|
||||
* \endcode
|
||||
* \sa \ref compare
|
||||
*/
|
||||
template<class E, int Sz>
|
||||
inline
|
||||
bool all_elements(const XprVector<E, Sz>& e) {
|
||||
return meta::Vector<Sz>::all_elements(e);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \fn bool any_elements(const XprVector<E, Sz>& e)
|
||||
* \brief check on statements for any elements
|
||||
* \ingroup _unary_function
|
||||
* This is for use with boolean operators like
|
||||
* \par Example:
|
||||
* \code
|
||||
* any_elements(vector > 0) {
|
||||
* // true branch
|
||||
* } else {
|
||||
* // false branch
|
||||
* }
|
||||
* \endcode
|
||||
* \sa \ref compare
|
||||
*/
|
||||
template<class E, int Sz>
|
||||
inline
|
||||
bool any_elements(const XprVector<E, Sz>& e) {
|
||||
return meta::Vector<Sz>::any_elements(e);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* trinary evaluation functions with vectors and xpr of
|
||||
* XprVector<E1, Sz> ? Vector<T2, Sz> : Vector<T3, Sz>
|
||||
* XprVector<E1, Sz> ? Vector<T2, Sz> : XprVector<E3, Sz>
|
||||
* XprVector<E1, Sz> ? XprVector<E2, Sz> : Vector<T3, Sz>
|
||||
* XprVector<E1, Sz> ? XprVector<E2, Sz> : XprVector<E3, Sz>
|
||||
*/
|
||||
|
||||
/**
|
||||
* eval(const XprVector<E1, Sz>& e1, const Vector<T2, Sz>& v2, const Vector<T3, Sz>& v3)
|
||||
* \brief Evals the vector expressions.
|
||||
* \ingroup _trinary_function
|
||||
* This eval is for the a?b:c syntax, since it's not allowed to overload
|
||||
* these operators.
|
||||
*/
|
||||
template<class E1, class T2, class T3, int Sz>
|
||||
inline
|
||||
XprVector<
|
||||
XprEval<
|
||||
XprVector<E1, 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>,
|
||||
VectorConstRef<T2, Sz>,
|
||||
VectorConstRef<T3, Sz>
|
||||
> expr_type;
|
||||
return XprVector<expr_type, Sz>(
|
||||
expr_type(e1, v2.constRef(), v3.constRef()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* eval(const XprVector<E1, Sz>& e1, const Vector<T2, Sz>& v2, const XprVector<E3, Sz>& e3)
|
||||
* \brief Evals the vector expressions.
|
||||
* \ingroup _trinary_function
|
||||
* This eval is for the a?b:c syntax, since it's not allowed to overload
|
||||
* these operators.
|
||||
*/
|
||||
template<class E1, class T2, class E3, int Sz>
|
||||
inline
|
||||
XprVector<
|
||||
XprEval<
|
||||
XprVector<E1, Sz>,
|
||||
VectorConstRef<T2, Sz>,
|
||||
XprVector<E3, Sz>
|
||||
>,
|
||||
Sz
|
||||
>
|
||||
eval(const XprVector<E1, Sz>& e1, const Vector<T2, Sz>& v2, const XprVector<E3, Sz>& e3) {
|
||||
typedef XprEval<
|
||||
XprVector<E1, Sz>,
|
||||
VectorConstRef<T2, Sz>,
|
||||
XprVector<E3, Sz>
|
||||
> expr_type;
|
||||
return XprVector<expr_type, Sz>(
|
||||
expr_type(e1, v2.constRef(), e3));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* eval(const XprVector<E1, Sz>& e1, const XprVector<E2, Sz>& e2, const Vector<T3, Sz>& v3)
|
||||
* \brief Evals the vector expressions.
|
||||
* \ingroup _trinary_function
|
||||
* This eval is for the a?b:c syntax, since it's not allowed to overload
|
||||
* these operators.
|
||||
*/
|
||||
template<class E1, class E2, class T3, int Sz>
|
||||
inline
|
||||
XprVector<
|
||||
XprEval<
|
||||
XprVector<E1, Sz>,
|
||||
XprVector<E2, Sz>,
|
||||
VectorConstRef<T3, Sz>
|
||||
>,
|
||||
Sz
|
||||
>
|
||||
eval(const XprVector<E1, Sz>& e1, const XprVector<E2, Sz>& e2, const Vector<T3, Sz>& v3) {
|
||||
typedef XprEval<
|
||||
XprVector<E1, Sz>,
|
||||
XprVector<E2, Sz>,
|
||||
VectorConstRef<T3, Sz>
|
||||
> expr_type;
|
||||
return XprVector<expr_type, Sz>(
|
||||
expr_type(e1, e2, v3.constRef()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* eval(const XprVector<E1, Sz>& e1, const XprVector<E2, Sz>& e2, const XprVector<E3, Sz>& e3)
|
||||
* \brief Evals the vector expressions.
|
||||
* \ingroup _trinary_function
|
||||
* This eval is for the a?b:c syntax, since it's not allowed to overload
|
||||
* these operators.
|
||||
*/
|
||||
template<class E1, class E2, class E3, int Sz>
|
||||
inline
|
||||
XprVector<
|
||||
XprEval<
|
||||
XprVector<E1, Sz>,
|
||||
XprVector<E2, Sz>,
|
||||
XprVector<E3, Sz>
|
||||
>,
|
||||
Sz
|
||||
>
|
||||
eval(const XprVector<E1, Sz>& e1, const XprVector<E2, Sz>& e2, const XprVector<E3, Sz>& e3) {
|
||||
typedef XprEval<
|
||||
XprVector<E1, Sz>,
|
||||
XprVector<E2, Sz>,
|
||||
XprVector<E3, Sz>
|
||||
> expr_type;
|
||||
return XprVector<expr_type, Sz>(expr_type(e1, e2, e3));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* trinary evaluation functions with vectors, xpr of and POD
|
||||
*
|
||||
* XprVector<E, Sz> ? POD1 : POD2
|
||||
* XprVector<E1, Sz> ? POD : XprVector<E3, Sz>
|
||||
* XprVector<E1, Sz> ? XprVector<E2, Sz> : POD
|
||||
*/
|
||||
#define TVMET_IMPLEMENT_MACRO(POD) \
|
||||
template<class E, int Sz> \
|
||||
inline \
|
||||
XprVector< \
|
||||
XprEval< \
|
||||
XprVector<E, Sz>, \
|
||||
XprLiteral< POD >, \
|
||||
XprLiteral< POD > \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
eval(const XprVector<E, Sz>& e, POD x2, POD x3) { \
|
||||
typedef XprEval< \
|
||||
XprVector<E, Sz>, \
|
||||
XprLiteral< POD >, \
|
||||
XprLiteral< POD > \
|
||||
> expr_type; \
|
||||
return XprVector<expr_type, Sz>( \
|
||||
expr_type(e, XprLiteral< POD >(x2), XprLiteral< POD >(x3))); \
|
||||
} \
|
||||
\
|
||||
template<class E1, class E3, int Sz> \
|
||||
inline \
|
||||
XprVector< \
|
||||
XprEval< \
|
||||
XprVector<E1, Sz>, \
|
||||
XprLiteral< POD >, \
|
||||
XprVector<E3, Sz> \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
eval(const XprVector<E1, Sz>& e1, POD x2, const XprVector<E3, Sz>& e3) { \
|
||||
typedef XprEval< \
|
||||
XprVector<E1, Sz>, \
|
||||
XprLiteral< POD >, \
|
||||
XprVector<E3, Sz> \
|
||||
> expr_type; \
|
||||
return XprVector<expr_type, Sz>( \
|
||||
expr_type(e1, XprLiteral< POD >(x2), e3)); \
|
||||
} \
|
||||
\
|
||||
template<class E1, class E2, int Sz> \
|
||||
inline \
|
||||
XprVector< \
|
||||
XprEval< \
|
||||
XprVector<E1, Sz>, \
|
||||
XprVector<E2, Sz>, \
|
||||
XprLiteral< POD > \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
eval(const XprVector<E1, Sz>& e1, const XprVector<E2, Sz>& e2, POD x3) { \
|
||||
typedef XprEval< \
|
||||
XprVector<E1, Sz>, \
|
||||
XprVector<E2, Sz>, \
|
||||
XprLiteral< POD > \
|
||||
> expr_type; \
|
||||
return XprVector<expr_type, Sz>( \
|
||||
expr_type(e1, e2, XprLiteral< POD >(x3))); \
|
||||
}
|
||||
|
||||
TVMET_IMPLEMENT_MACRO(int)
|
||||
|
||||
TVMET_IMPLEMENT_MACRO(float)
|
||||
TVMET_IMPLEMENT_MACRO(double)
|
||||
|
||||
#undef TVMET_IMPLEMENT_MACRO
|
||||
|
||||
|
||||
/*
|
||||
* trinary evaluation functions with vectors, xpr of and complex<> types
|
||||
*
|
||||
* XprVector<E, Sz> e, std::complex<T> z2, std::complex<T> z3
|
||||
* XprVector<E1, Sz> e1, std::complex<T> z2, XprVector<E3, Sz> e3
|
||||
* XprVector<E1, Sz> e1, XprVector<E2, Sz> e2, std::complex<T> z3
|
||||
*/
|
||||
#if defined(EIGEN_USE_COMPLEX)
|
||||
|
||||
|
||||
/**
|
||||
* eval(const XprVector<E, Sz>& e, std::complex<T> z2, std::complex<T> z3)
|
||||
* \brief Evals the vector expressions.
|
||||
* \ingroup _trinary_function
|
||||
* This eval is for the a?b:c syntax, since it's not allowed to overload
|
||||
* these operators.
|
||||
*/
|
||||
template<class E, int Sz, class T>
|
||||
inline
|
||||
XprVector<
|
||||
XprEval<
|
||||
XprVector<E, Sz>,
|
||||
XprLiteral< std::complex<T> >,
|
||||
XprLiteral< std::complex<T> >
|
||||
>,
|
||||
Sz
|
||||
>
|
||||
eval(const XprVector<E, Sz>& e, std::complex<T> z2, std::complex<T> z3) {
|
||||
typedef XprEval<
|
||||
XprVector<E, Sz>,
|
||||
XprLiteral< std::complex<T> >,
|
||||
XprLiteral< std::complex<T> >
|
||||
> expr_type;
|
||||
return XprVector<expr_type, Sz>(
|
||||
expr_type(e, XprLiteral< std::complex<T> >(z2), XprLiteral< std::complex<T> >(z3)));
|
||||
}
|
||||
|
||||
/**
|
||||
* eval(const XprVector<E1, Sz>& e1, std::complex<T> z2, const XprVector<E3, Sz>& e3)
|
||||
* \brief Evals the vector expressions.
|
||||
* \ingroup _trinary_function
|
||||
* This eval is for the a?b:c syntax, since it's not allowed to overload
|
||||
* these operators.
|
||||
*/
|
||||
template<class E1, class E3, int Sz, class T>
|
||||
inline
|
||||
XprVector<
|
||||
XprEval<
|
||||
XprVector<E1, Sz>,
|
||||
XprLiteral< std::complex<T> >,
|
||||
XprVector<E3, Sz>
|
||||
>,
|
||||
Sz
|
||||
>
|
||||
eval(const XprVector<E1, Sz>& e1, std::complex<T> z2, const XprVector<E3, Sz>& e3) {
|
||||
typedef XprEval<
|
||||
XprVector<E1, Sz>,
|
||||
XprLiteral< std::complex<T> >,
|
||||
XprVector<E3, Sz>
|
||||
> expr_type;
|
||||
return XprVector<expr_type, Sz>(
|
||||
expr_type(e1, XprLiteral< std::complex<T> >(z2), e3));
|
||||
}
|
||||
|
||||
/**
|
||||
* eval(const XprVector<E1, Sz>& e1, const XprVector<E2, Sz>& e2, std::complex<T> z3)
|
||||
* \brief Evals the vector expressions.
|
||||
* \ingroup _trinary_function
|
||||
* This eval is for the a?b:c syntax, since it's not allowed to overload
|
||||
* these operators.
|
||||
*/
|
||||
template<class E1, class E2, int Sz, class T>
|
||||
inline
|
||||
XprVector<
|
||||
XprEval<
|
||||
XprVector<E1, Sz>,
|
||||
XprVector<E2, Sz>,
|
||||
XprLiteral< std::complex<T> >
|
||||
>,
|
||||
Sz
|
||||
>
|
||||
eval(const XprVector<E1, Sz>& e1, const XprVector<E2, Sz>& e2, std::complex<T> z3) {
|
||||
typedef XprEval<
|
||||
XprVector<E1, Sz>,
|
||||
XprVector<E2, Sz>,
|
||||
XprLiteral< std::complex<T> >
|
||||
> expr_type;
|
||||
return XprVector<expr_type, Sz>(
|
||||
expr_type(e1, e2, XprLiteral< std::complex<T> >(z3)));
|
||||
}
|
||||
#endif // defined(EIGEN_USE_COMPLEX)
|
||||
|
||||
|
||||
} // namespace tvmet
|
||||
|
||||
#endif // TVMET_VECTOR_EVAL_H
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
@@ -1,854 +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: VectorFunctions.h,v 1.32 2004/07/06 09:45:54 opetzold Exp $
|
||||
*/
|
||||
|
||||
#ifndef TVMET_VECTOR_FUNCTIONS_H
|
||||
#define TVMET_VECTOR_FUNCTIONS_H
|
||||
|
||||
#include <tvmet/Extremum.h>
|
||||
|
||||
namespace tvmet {
|
||||
|
||||
|
||||
/*********************************************************
|
||||
* PART I: DECLARATION
|
||||
*********************************************************/
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
* Vector arithmetic functions add, sub, mul and div
|
||||
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
|
||||
/*
|
||||
* function(Vector<T1, Sz>, Vector<T2, Sz>)
|
||||
* function(Vector<T, Sz>, XprVector<E, Sz>)
|
||||
* function(XprVector<E, Sz>, Vector<T, Sz>)
|
||||
*/
|
||||
#define TVMET_DECLARE_MACRO(NAME) \
|
||||
template<class T1, class T2, int Sz> \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<T1, T2>, \
|
||||
VectorConstRef<T1, Sz>, \
|
||||
VectorConstRef<T2, Sz> \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
NAME (const Vector<T1, Sz>& lhs, \
|
||||
const Vector<T2, Sz>& rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class E, class T, int Sz> \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<typename E::value_type, T>, \
|
||||
XprVector<E, Sz>, \
|
||||
VectorConstRef<T, Sz> \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
NAME (const XprVector<E, Sz>& lhs, \
|
||||
const Vector<T, Sz>& rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class E, class T, int Sz> \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<T, typename E::value_type>, \
|
||||
VectorConstRef<T, Sz>, \
|
||||
XprVector<E, Sz> \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
NAME (const Vector<T, Sz>& lhs, \
|
||||
const XprVector<E, Sz>& rhs) _tvmet_always_inline;
|
||||
|
||||
TVMET_DECLARE_MACRO(add) // per se element wise
|
||||
TVMET_DECLARE_MACRO(sub) // per se element wise
|
||||
TVMET_DECLARE_MACRO(mul) // per se element wise
|
||||
namespace element_wise {
|
||||
TVMET_DECLARE_MACRO(div) // not defined for vectors
|
||||
}
|
||||
|
||||
#undef TVMET_DECLARE_MACRO
|
||||
|
||||
|
||||
/*
|
||||
* function(Vector<T, Sz>, POD)
|
||||
* function(POD, Vector<T, Sz>)
|
||||
* Note: - operations +,-,*,/ are per se element wise
|
||||
*/
|
||||
#define TVMET_DECLARE_MACRO(NAME, POD) \
|
||||
template<class T, int Sz> \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME< T, POD >, \
|
||||
VectorConstRef<T, Sz>, \
|
||||
XprLiteral< POD > \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
NAME (const Vector<T, Sz>& lhs, \
|
||||
POD rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class T, int Sz> \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME< POD, T>, \
|
||||
XprLiteral< POD >, \
|
||||
VectorConstRef<T, Sz> \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
NAME (POD lhs, \
|
||||
const Vector<T, Sz>& rhs) _tvmet_always_inline;
|
||||
|
||||
TVMET_DECLARE_MACRO(add, int)
|
||||
TVMET_DECLARE_MACRO(sub, int)
|
||||
TVMET_DECLARE_MACRO(mul, int)
|
||||
TVMET_DECLARE_MACRO(div, int)
|
||||
|
||||
TVMET_DECLARE_MACRO(add, float)
|
||||
TVMET_DECLARE_MACRO(sub, float)
|
||||
TVMET_DECLARE_MACRO(mul, float)
|
||||
TVMET_DECLARE_MACRO(div, float)
|
||||
|
||||
TVMET_DECLARE_MACRO(add, double)
|
||||
TVMET_DECLARE_MACRO(sub, double)
|
||||
TVMET_DECLARE_MACRO(mul, double)
|
||||
TVMET_DECLARE_MACRO(div, double)
|
||||
|
||||
#undef TVMET_DECLARE_MACRO
|
||||
|
||||
|
||||
#if defined(EIGEN_USE_COMPLEX)
|
||||
/*
|
||||
* function(Vector<std::complex<T>, Sz>, std::complex<T>)
|
||||
* function(std::complex<T>, Vector<std::complex<T>, Sz>)
|
||||
* Note: per se element wise
|
||||
* \todo type promotion
|
||||
*/
|
||||
#define TVMET_DECLARE_MACRO(NAME) \
|
||||
template<class T, int Sz> \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME< std::complex<T>, std::complex<T> >, \
|
||||
VectorConstRef< std::complex<T>, Sz>, \
|
||||
XprLiteral< std::complex<T> > \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
NAME (const Vector<std::complex<T>, Sz>& lhs, \
|
||||
const std::complex<T>& rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class T, int Sz> \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME< std::complex<T>, std::complex<T> >, \
|
||||
XprLiteral< std::complex<T> >, \
|
||||
VectorConstRef< std::complex<T>, Sz> \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
NAME (const std::complex<T>& lhs, \
|
||||
const Vector< std::complex<T>, Sz>& rhs) _tvmet_always_inline;
|
||||
|
||||
TVMET_DECLARE_MACRO(add)
|
||||
TVMET_DECLARE_MACRO(sub)
|
||||
TVMET_DECLARE_MACRO(mul)
|
||||
TVMET_DECLARE_MACRO(div)
|
||||
|
||||
#undef TVMET_DECLARE_MACRO
|
||||
|
||||
#endif // defined(EIGEN_USE_COMPLEX)
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
* vector specific functions
|
||||
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
|
||||
template<class T, int Sz>
|
||||
typename Traits<T>::sum_type
|
||||
sum(const Vector<T, Sz>& v) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T, int Sz>
|
||||
typename Traits<T>::sum_type
|
||||
product(const Vector<T, Sz>& v) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T1, class T2, int Sz>
|
||||
typename PromoteTraits<T1, T2>::value_type
|
||||
dot(const Vector<T1, Sz>& lhs,
|
||||
const Vector<T2, Sz>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T1, class T2>
|
||||
Vector<typename PromoteTraits<T1, T2>::value_type, 3>
|
||||
cross(const Vector<T1, 3>& lhs,
|
||||
const Vector<T2, 3>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T, int Sz>
|
||||
typename Traits<T>::sum_type
|
||||
norm1(const Vector<T, Sz>& v) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T, int Sz>
|
||||
typename Traits<T>::sum_type
|
||||
norm2(const Vector<T, Sz>& v) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T, int Sz>
|
||||
XprVector<
|
||||
XprBinOp<
|
||||
Fcnl_div<T, T>,
|
||||
VectorConstRef<T, Sz>,
|
||||
XprLiteral< T >
|
||||
>,
|
||||
Sz
|
||||
>
|
||||
normalize(const Vector<T, Sz>& v) _tvmet_always_inline;
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
* min/max unary functions
|
||||
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
template<class E, int Sz>
|
||||
Extremum<typename E::value_type, int, vector_tag>
|
||||
maximum(const XprVector<E, Sz>& e); // NOT _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T, int Sz>
|
||||
Extremum<T, int, vector_tag>
|
||||
maximum(const Vector<T, Sz>& v) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class E, int Sz>
|
||||
Extremum<typename E::value_type, int, vector_tag>
|
||||
minimum(const XprVector<E, Sz>& e); // NOT _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T, int Sz>
|
||||
Extremum<T, int, vector_tag>
|
||||
minimum(const Vector<T, Sz>& v) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class E, int Sz>
|
||||
typename E::value_type
|
||||
max(const XprVector<E, Sz>& e); // NOT _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T, int Sz>
|
||||
T max(const Vector<T, Sz>& v) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class E, int Sz>
|
||||
typename E::value_type
|
||||
min(const XprVector<E, Sz>& e); // NOT _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T, int Sz>
|
||||
T min(const Vector<T, Sz>& v) _tvmet_always_inline;
|
||||
|
||||
|
||||
template<class T, int Sz>
|
||||
XprVector<
|
||||
VectorConstRef<T, Sz>,
|
||||
Sz
|
||||
>
|
||||
cvector_ref(const T* mem) _tvmet_always_inline;
|
||||
|
||||
|
||||
/*********************************************************
|
||||
* PART II: IMPLEMENTATION
|
||||
*********************************************************/
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
* Vector arithmetic functions add, sub, mul and div
|
||||
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
|
||||
/*
|
||||
* function(Vector<T1, Sz>, Vector<T2, Sz>)
|
||||
* function(Vector<T, Sz>, XprVector<E, Sz>)
|
||||
* function(XprVector<E, Sz>, Vector<T, Sz>)
|
||||
*/
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME) \
|
||||
template<class T1, class T2, int Sz> \
|
||||
inline \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<T1, T2>, \
|
||||
VectorConstRef<T1, Sz>, \
|
||||
VectorConstRef<T2, Sz> \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
NAME (const Vector<T1, Sz>& lhs, const Vector<T2, Sz>& rhs) { \
|
||||
typedef XprBinOp < \
|
||||
Fcnl_##NAME<T1, T2>, \
|
||||
VectorConstRef<T1, Sz>, \
|
||||
VectorConstRef<T2, Sz> \
|
||||
> expr_type; \
|
||||
return XprVector<expr_type, Sz>( \
|
||||
expr_type(lhs.constRef(), rhs.constRef())); \
|
||||
} \
|
||||
\
|
||||
template<class E, class T, int Sz> \
|
||||
inline \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<typename E::value_type, T>, \
|
||||
XprVector<E, Sz>, \
|
||||
VectorConstRef<T, Sz> \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
NAME (const XprVector<E, Sz>& lhs, const Vector<T, Sz>& rhs) { \
|
||||
typedef XprBinOp< \
|
||||
Fcnl_##NAME<typename E::value_type, T>, \
|
||||
XprVector<E, Sz>, \
|
||||
VectorConstRef<T, Sz> \
|
||||
> expr_type; \
|
||||
return XprVector<expr_type, Sz>( \
|
||||
expr_type(lhs, rhs.constRef())); \
|
||||
} \
|
||||
\
|
||||
template<class E, class T, int Sz> \
|
||||
inline \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<T, typename E::value_type>, \
|
||||
VectorConstRef<T, Sz>, \
|
||||
XprVector<E, Sz> \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
NAME (const Vector<T, Sz>& lhs, const XprVector<E, Sz>& rhs) { \
|
||||
typedef XprBinOp< \
|
||||
Fcnl_##NAME<T, typename E::value_type>, \
|
||||
VectorConstRef<T, Sz>, \
|
||||
XprVector<E, Sz> \
|
||||
> expr_type; \
|
||||
return XprVector<expr_type, Sz>( \
|
||||
expr_type(lhs.constRef(), rhs)); \
|
||||
}
|
||||
|
||||
TVMET_IMPLEMENT_MACRO(add) // per se element wise
|
||||
TVMET_IMPLEMENT_MACRO(sub) // per se element wise
|
||||
TVMET_IMPLEMENT_MACRO(mul) // per se element wise
|
||||
namespace element_wise {
|
||||
TVMET_IMPLEMENT_MACRO(div) // not defined for vectors
|
||||
}
|
||||
|
||||
#undef TVMET_IMPLEMENT_MACRO
|
||||
|
||||
|
||||
/*
|
||||
* function(Vector<T, Sz>, POD)
|
||||
* function(POD, Vector<T, Sz>)
|
||||
* Note: - operations +,-,*,/ are per se element wise
|
||||
*/
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME, POD) \
|
||||
template<class T, int Sz> \
|
||||
inline \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME< T, POD >, \
|
||||
VectorConstRef<T, Sz>, \
|
||||
XprLiteral< POD > \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
NAME (const Vector<T, Sz>& lhs, POD rhs) { \
|
||||
typedef XprBinOp< \
|
||||
Fcnl_##NAME<T, POD >, \
|
||||
VectorConstRef<T, Sz>, \
|
||||
XprLiteral< POD > \
|
||||
> expr_type; \
|
||||
return XprVector<expr_type, Sz>( \
|
||||
expr_type(lhs.constRef(), XprLiteral< POD >(rhs))); \
|
||||
} \
|
||||
\
|
||||
template<class T, int Sz> \
|
||||
inline \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME< POD, T>, \
|
||||
XprLiteral< POD >, \
|
||||
VectorConstRef<T, Sz> \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
NAME (POD lhs, const Vector<T, Sz>& rhs) { \
|
||||
typedef XprBinOp< \
|
||||
Fcnl_##NAME< POD, T>, \
|
||||
XprLiteral< POD >, \
|
||||
VectorConstRef<T, Sz> \
|
||||
> expr_type; \
|
||||
return XprVector<expr_type, Sz>( \
|
||||
expr_type(XprLiteral< POD >(lhs), rhs.constRef())); \
|
||||
}
|
||||
|
||||
TVMET_IMPLEMENT_MACRO(add, int)
|
||||
TVMET_IMPLEMENT_MACRO(sub, int)
|
||||
TVMET_IMPLEMENT_MACRO(mul, int)
|
||||
TVMET_IMPLEMENT_MACRO(div, int)
|
||||
|
||||
TVMET_IMPLEMENT_MACRO(add, float)
|
||||
TVMET_IMPLEMENT_MACRO(sub, float)
|
||||
TVMET_IMPLEMENT_MACRO(mul, float)
|
||||
TVMET_IMPLEMENT_MACRO(div, float)
|
||||
|
||||
TVMET_IMPLEMENT_MACRO(add, double)
|
||||
TVMET_IMPLEMENT_MACRO(sub, double)
|
||||
TVMET_IMPLEMENT_MACRO(mul, double)
|
||||
TVMET_IMPLEMENT_MACRO(div, double)
|
||||
|
||||
#undef TVMET_IMPLEMENT_MACRO
|
||||
|
||||
|
||||
#if defined(EIGEN_USE_COMPLEX)
|
||||
/*
|
||||
* function(Vector<std::complex<T>, Sz>, std::complex<T>)
|
||||
* function(std::complex<T>, Vector<std::complex<T>, Sz>)
|
||||
* Note: per se element wise
|
||||
* \todo type promotion
|
||||
*/
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME) \
|
||||
template<class T, int Sz> \
|
||||
inline \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME< std::complex<T>, std::complex<T> >, \
|
||||
VectorConstRef< std::complex<T>, Sz>, \
|
||||
XprLiteral< std::complex<T> > \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
NAME (const Vector<std::complex<T>, Sz>& lhs, const std::complex<T>& rhs) { \
|
||||
typedef XprBinOp< \
|
||||
Fcnl_##NAME< std::complex<T>, std::complex<T> >, \
|
||||
VectorConstRef< std::complex<T>, Sz>, \
|
||||
XprLiteral< std::complex<T> > \
|
||||
> expr_type; \
|
||||
return XprVector<expr_type, Sz>( \
|
||||
expr_type(lhs.constRef(), XprLiteral< std::complex<T> >(rhs))); \
|
||||
} \
|
||||
\
|
||||
template<class T, int Sz> \
|
||||
inline \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME< std::complex<T>, std::complex<T> >, \
|
||||
XprLiteral< std::complex<T> >, \
|
||||
VectorConstRef< std::complex<T>, Sz> \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
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> >, \
|
||||
VectorConstRef< std::complex<T>, Sz> \
|
||||
> expr_type; \
|
||||
return XprVector<expr_type, Sz>( \
|
||||
expr_type(XprLiteral< std::complex<T> >(lhs), rhs.constRef())); \
|
||||
}
|
||||
|
||||
TVMET_IMPLEMENT_MACRO(add)
|
||||
TVMET_IMPLEMENT_MACRO(sub)
|
||||
TVMET_IMPLEMENT_MACRO(mul)
|
||||
TVMET_IMPLEMENT_MACRO(div)
|
||||
|
||||
#undef TVMET_IMPLEMENT_MACRO
|
||||
|
||||
#endif // defined(EIGEN_USE_COMPLEX)
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
* vector specific functions
|
||||
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
|
||||
/**
|
||||
* \fn sum(const Vector<T, Sz>& v)
|
||||
* \brief Compute the sum of the vector.
|
||||
* \ingroup _unary_function
|
||||
*
|
||||
* Simply compute the sum of the given vector as:
|
||||
* \f[
|
||||
* \sum_{i = 0}^{Sz-1} v[i]
|
||||
* \f]
|
||||
*/
|
||||
template<class T, int Sz>
|
||||
inline
|
||||
typename Traits<T>::sum_type
|
||||
sum(const Vector<T, Sz>& v) {
|
||||
return meta::Vector<Sz>::sum(v);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \fn product(const Vector<T, Sz>& v)
|
||||
* \brief Compute the product of the vector elements.
|
||||
* \ingroup _unary_function
|
||||
*
|
||||
* Simply computer the product of the given vector as:
|
||||
* \f[
|
||||
* \prod_{i = 0}^{Sz - 1} v[i]
|
||||
* \f]
|
||||
*/
|
||||
template<class T, int Sz>
|
||||
inline
|
||||
typename Traits<T>::sum_type
|
||||
product(const Vector<T, Sz>& v) {
|
||||
return meta::Vector<Sz>::product(v);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \fn dot(const Vector<T1, Sz>& lhs, const Vector<T2, Sz>& rhs)
|
||||
* \brief Compute the dot/inner product
|
||||
* \ingroup _binary_function
|
||||
*
|
||||
* Compute the dot product as:
|
||||
* \f[
|
||||
* \sum_{i = 0}^{Sz - 1} ( lhs[i] * rhs[i] )
|
||||
* \f]
|
||||
* where lhs is a column vector and rhs is a row vector, both vectors
|
||||
* have the same dimension.
|
||||
*/
|
||||
template<class T1, class T2, int Sz>
|
||||
inline
|
||||
typename PromoteTraits<T1, T2>::value_type
|
||||
dot(const Vector<T1, Sz>& lhs, const Vector<T2, Sz>& rhs) {
|
||||
return meta::Vector<Sz>::dot(lhs, rhs);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \fn cross(const Vector<T1, 3>& lhs, const Vector<T2, 3>& rhs)
|
||||
* \brief Compute the cross/outer product
|
||||
* \ingroup _binary_function
|
||||
* \note working only for vectors of size = 3
|
||||
* \todo Implement vector outer product as ET and MT, returning a XprVector
|
||||
*/
|
||||
template<class T1, class T2>
|
||||
inline
|
||||
Vector<typename PromoteTraits<T1, T2>::value_type, 3>
|
||||
cross(const Vector<T1, 3>& lhs, const Vector<T2, 3>& rhs) {
|
||||
typedef typename PromoteTraits<T1, T2>::value_type value_type;
|
||||
return Vector<value_type, 3>(lhs(1)*rhs(2) - rhs(1)*lhs(2),
|
||||
rhs(0)*lhs(2) - lhs(0)*rhs(2),
|
||||
lhs(0)*rhs(1) - rhs(0)*lhs(1));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \fn norm1(const Vector<T, Sz>& v)
|
||||
* \brief The \f$l_1\f$ norm of a vector v.
|
||||
* \ingroup _unary_function
|
||||
* The norm of any vector is just the square root of the dot product of
|
||||
* a vector with itself, or
|
||||
*
|
||||
* \f[
|
||||
* |Vector<T, Sz> v| = |v| = \sum_{i=0}^{Sz-1}\,|v[i]|
|
||||
* \f]
|
||||
*/
|
||||
template<class T, int Sz>
|
||||
inline
|
||||
typename Traits<T>::sum_type
|
||||
norm1(const Vector<T, Sz>& v) {
|
||||
return sum(abs(v));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \fn norm2(const Vector<T, Sz>& v)
|
||||
* \brief The euklidian norm (or \f$l_2\f$ norm) of a vector v.
|
||||
* \ingroup _unary_function
|
||||
* The norm of any vector is just the square root of the dot product of
|
||||
* a vector with itself, or
|
||||
*
|
||||
* \f[
|
||||
* |Vector<T, Sz> v| = |v| = \sqrt{ \sum_{i=0}^{Sz-1}\,v[i]^2 }
|
||||
* \f]
|
||||
*
|
||||
* \note The internal cast for Vector<int> avoids warnings on sqrt.
|
||||
*/
|
||||
template<class T, int Sz>
|
||||
inline
|
||||
typename Traits<T>::sum_type
|
||||
norm2(const Vector<T, Sz>& v) {
|
||||
return static_cast<T>( std::sqrt(static_cast<typename Traits<T>::float_type>(dot(v, v))) );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \fn normalize(const Vector<T, Sz>& v)
|
||||
* \brief Normalize the given vector.
|
||||
* \ingroup _unary_function
|
||||
* \sa norm2
|
||||
*
|
||||
* using the equation:
|
||||
* \f[
|
||||
* \frac{Vector<T, Sz> v}{\sqrt{ \sum_{i=0}^{Sz-1}\,v[i]^2 }}
|
||||
* \f]
|
||||
*/
|
||||
template<class T, int Sz>
|
||||
inline
|
||||
XprVector<
|
||||
XprBinOp<
|
||||
Fcnl_div<T, T>,
|
||||
VectorConstRef<T, Sz>,
|
||||
XprLiteral< T >
|
||||
>,
|
||||
Sz
|
||||
>
|
||||
normalize(const Vector<T, Sz>& v) {
|
||||
typedef XprBinOp<
|
||||
Fcnl_div<T, T>,
|
||||
VectorConstRef<T, Sz>,
|
||||
XprLiteral< T >
|
||||
> expr_type;
|
||||
return XprVector<expr_type, Sz>(
|
||||
expr_type(v.constRef(), XprLiteral< T >(norm2(v))));
|
||||
}
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
* min/max unary functions
|
||||
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
|
||||
/**
|
||||
* \fn maximum(const XprVector<E, Sz>& e)
|
||||
* \brief Find the maximum of a vector expression
|
||||
* \ingroup _unary_function
|
||||
*/
|
||||
template<class E, int Sz>
|
||||
inline
|
||||
Extremum<typename E::value_type, int, vector_tag>
|
||||
maximum(const XprVector<E, Sz>& e) {
|
||||
typedef typename E::value_type value_type;
|
||||
|
||||
value_type m_max(e(0));
|
||||
int m_idx(0);
|
||||
|
||||
// this loop is faster than meta templates!
|
||||
for(int i = 1; i != Sz; ++i) {
|
||||
if(e(i) > m_max) {
|
||||
m_max = e(i);
|
||||
m_idx = i;
|
||||
}
|
||||
}
|
||||
|
||||
return Extremum<value_type, int, vector_tag>(m_max, m_idx);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \fn maximum(const Vector<T, Sz>& v)
|
||||
* \brief Find the maximum of a vector
|
||||
* \ingroup _unary_function
|
||||
*/
|
||||
template<class T, int Sz>
|
||||
inline
|
||||
Extremum<T, int, vector_tag>
|
||||
maximum(const Vector<T, Sz>& v) { return maximum(v.expr()); }
|
||||
|
||||
|
||||
/**
|
||||
* \fn minimum(const XprVector<E, Sz>& e)
|
||||
* \brief Find the minimum of a vector expression
|
||||
* \ingroup _unary_function
|
||||
*/
|
||||
template<class E, int Sz>
|
||||
inline
|
||||
Extremum<typename E::value_type, int, vector_tag>
|
||||
minimum(const XprVector<E, Sz>& e) {
|
||||
typedef typename E::value_type value_type;
|
||||
|
||||
value_type m_min(e(0));
|
||||
int m_idx(0);
|
||||
|
||||
// this loop is faster than meta templates!
|
||||
for(int i = 1; i != Sz; ++i) {
|
||||
if(e(i) < m_min) {
|
||||
m_min = e(i);
|
||||
m_idx = i;
|
||||
}
|
||||
}
|
||||
|
||||
return Extremum<value_type, int, vector_tag>(m_min, m_idx);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \fn minimum(const Vector<T, Sz>& v)
|
||||
* \brief Find the minimum of a vector
|
||||
* \ingroup _unary_function
|
||||
*/
|
||||
template<class T, int Sz>
|
||||
inline
|
||||
Extremum<T, int, vector_tag>
|
||||
minimum(const Vector<T, Sz>& v) { return minimum(v.expr()); }
|
||||
|
||||
|
||||
/**
|
||||
* \fn max(const XprVector<E, Sz>& e)
|
||||
* \brief Find the maximum of a vector expression
|
||||
* \ingroup _unary_function
|
||||
*/
|
||||
template<class E, int Sz>
|
||||
inline
|
||||
typename E::value_type
|
||||
max(const XprVector<E, Sz>& e) {
|
||||
typedef typename E::value_type value_type;
|
||||
|
||||
value_type m_max(e(0));
|
||||
|
||||
// this loop is faster than meta templates!
|
||||
for(int i = 1; i != Sz; ++i)
|
||||
if(e(i) > m_max)
|
||||
m_max = e(i);
|
||||
|
||||
return m_max;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \fn max(const Vector<T, Sz>& v)
|
||||
* \brief Find the maximum of a vector
|
||||
* \ingroup _unary_function
|
||||
*/
|
||||
template<class T, int Sz>
|
||||
inline
|
||||
T max(const Vector<T, Sz>& v) {
|
||||
typedef T value_type;
|
||||
typedef typename Vector<T, Sz>::const_iterator const_iterator;
|
||||
|
||||
const_iterator iter(v.begin());
|
||||
const_iterator last(v.end());
|
||||
value_type temp(*iter);
|
||||
|
||||
for( ; iter != last; ++iter)
|
||||
if(*iter > temp)
|
||||
temp = *iter;
|
||||
|
||||
return temp;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \fn min(const XprVector<E, Sz>& e)
|
||||
* \brief Find the minimum of a vector expression
|
||||
* \ingroup _unary_function
|
||||
*/
|
||||
template<class E, int Sz>
|
||||
inline
|
||||
typename E::value_type
|
||||
min(const XprVector<E, Sz>& e) {
|
||||
typedef typename E::value_type value_type;
|
||||
|
||||
value_type m_min(e(0));
|
||||
|
||||
// this loop is faster than meta templates!
|
||||
for(int i = 1; i != Sz; ++i)
|
||||
if(e(i) < m_min)
|
||||
m_min = e(i);
|
||||
|
||||
return m_min;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \fn min(const Vector<T, Sz>& v)
|
||||
* \brief Find the minimum of a vector
|
||||
* \ingroup _unary_function
|
||||
*/
|
||||
template<class T, int Sz>
|
||||
inline
|
||||
T min(const Vector<T, Sz>& v) {
|
||||
typedef T value_type;
|
||||
typedef typename Vector<T, Sz>::const_iterator const_iterator;
|
||||
|
||||
const_iterator iter(v.begin());
|
||||
const_iterator last(v.end());
|
||||
value_type temp(*iter);
|
||||
|
||||
for( ; iter != last; ++iter)
|
||||
if(*iter < temp)
|
||||
temp = *iter;
|
||||
|
||||
return temp;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \fn cvector_ref(const T* mem)
|
||||
* \brief Creates an expression wrapper for a C like vector arrays.
|
||||
* \ingroup _unary_function
|
||||
*
|
||||
* This is like creating a vector of external data, as described
|
||||
* at \ref construct. With this function you wrap an expression
|
||||
* around a C style vector array and you can operate directly with it
|
||||
* as usual.
|
||||
*
|
||||
* \par Example:
|
||||
* \code
|
||||
* static float vertices[N][3] = {
|
||||
* {-1, 0, 1}, { 1, 0, 1}, ...
|
||||
* };
|
||||
* ...
|
||||
* typedef Vector<float, 3> vector_type;
|
||||
* ...
|
||||
* vector_type V( cross(cvector_ref<float, 3>(&vertices[0][0]),
|
||||
* cvector_ref<float, 3>(&vertices[1][0])) );
|
||||
* \endcode
|
||||
*
|
||||
* \since release 1.6.0
|
||||
*/
|
||||
template<class T, int Sz>
|
||||
inline
|
||||
XprVector<
|
||||
VectorConstRef<T, Sz>,
|
||||
Sz
|
||||
>
|
||||
cvector_ref(const T* mem) {
|
||||
typedef VectorConstRef<T, Sz> expr_type;
|
||||
|
||||
return XprVector<expr_type, Sz>(expr_type(mem));
|
||||
};
|
||||
|
||||
|
||||
} // namespace tvmet
|
||||
|
||||
#endif // TVMET_VECTOR_FUNCTIONS_H
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
@@ -1,169 +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: VectorImpl.h,v 1.27 2004/06/10 16:36:55 opetzold Exp $
|
||||
*/
|
||||
|
||||
#ifndef TVMET_VECTOR_IMPL_H
|
||||
#define TVMET_VECTOR_IMPL_H
|
||||
|
||||
#include <iomanip> // setw
|
||||
|
||||
#include <tvmet/Functional.h>
|
||||
|
||||
namespace tvmet {
|
||||
|
||||
/*
|
||||
* member operators for i/o
|
||||
*/
|
||||
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 << ">,"
|
||||
<< IndentLevel(--l)
|
||||
<< std::endl;
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
template<class T, int Size>
|
||||
std::ostream& Vector<T, Size>::print_on(std::ostream& os) const
|
||||
{
|
||||
os << "[\n ";
|
||||
for(int i = 0; i < (Size - 1); ++i) {
|
||||
os << m_array[i] << ", ";
|
||||
}
|
||||
os << m_array[Size - 1] << "\n]";
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* member operators with scalars, per se element wise
|
||||
*/
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME, OP) \
|
||||
template<class T, int Size> \
|
||||
inline \
|
||||
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; \
|
||||
}
|
||||
|
||||
TVMET_IMPLEMENT_MACRO(add_eq, +=)
|
||||
TVMET_IMPLEMENT_MACRO(sub_eq, -=)
|
||||
TVMET_IMPLEMENT_MACRO(mul_eq, *=)
|
||||
TVMET_IMPLEMENT_MACRO(div_eq, /=)
|
||||
#undef TVMET_IMPLEMENT_MACRO
|
||||
|
||||
|
||||
/*
|
||||
* member functions (operators) with vectors, for use with +=,-= ... <<=
|
||||
*/
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME) \
|
||||
template<class T1, int Size> \
|
||||
template <class T2> \
|
||||
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; \
|
||||
}
|
||||
|
||||
TVMET_IMPLEMENT_MACRO(add_eq)
|
||||
TVMET_IMPLEMENT_MACRO(sub_eq)
|
||||
TVMET_IMPLEMENT_MACRO(mul_eq)
|
||||
TVMET_IMPLEMENT_MACRO(div_eq)
|
||||
#undef TVMET_IMPLEMENT_MACRO
|
||||
|
||||
|
||||
/*
|
||||
* member functions (operators) with expressions, for use with +=,-= ... <<=
|
||||
*/
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME) \
|
||||
template<class T, int Size> \
|
||||
template <class E> \
|
||||
inline \
|
||||
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; \
|
||||
}
|
||||
|
||||
TVMET_IMPLEMENT_MACRO(add_eq)
|
||||
TVMET_IMPLEMENT_MACRO(sub_eq)
|
||||
TVMET_IMPLEMENT_MACRO(mul_eq)
|
||||
TVMET_IMPLEMENT_MACRO(div_eq)
|
||||
#undef TVMET_IMPLEMENT_MACRO
|
||||
|
||||
|
||||
/*
|
||||
* aliased member functions (operators) with vectors,
|
||||
* for use with +=,-= ... <<=
|
||||
*/
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME) \
|
||||
template<class T1, int Size> \
|
||||
template <class T2> \
|
||||
inline \
|
||||
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; \
|
||||
}
|
||||
|
||||
TVMET_IMPLEMENT_MACRO(assign)
|
||||
TVMET_IMPLEMENT_MACRO(add_eq)
|
||||
TVMET_IMPLEMENT_MACRO(sub_eq)
|
||||
TVMET_IMPLEMENT_MACRO(mul_eq)
|
||||
TVMET_IMPLEMENT_MACRO(div_eq)
|
||||
#undef TVMET_IMPLEMENT_MACRO
|
||||
|
||||
|
||||
/*
|
||||
* aliased member functions (operators) with expressions,
|
||||
* for use with +=,-= ... <<=
|
||||
*/
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME) \
|
||||
template<class T, int Size> \
|
||||
template <class E> \
|
||||
inline \
|
||||
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; \
|
||||
}
|
||||
|
||||
TVMET_IMPLEMENT_MACRO(assign)
|
||||
TVMET_IMPLEMENT_MACRO(add_eq)
|
||||
TVMET_IMPLEMENT_MACRO(sub_eq)
|
||||
TVMET_IMPLEMENT_MACRO(mul_eq)
|
||||
TVMET_IMPLEMENT_MACRO(div_eq)
|
||||
#undef TVMET_IMPLEMENT_MACRO
|
||||
|
||||
|
||||
} // namespace tvmet
|
||||
|
||||
#endif // TVMET_VECTOR_IMPL_H
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
@@ -1,496 +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: VectorOperators.h,v 1.14 2004/06/10 16:36:55 opetzold Exp $
|
||||
*/
|
||||
|
||||
#ifndef TVMET_VECTOR_OPERATORS_H
|
||||
#define TVMET_VECTOR_OPERATORS_H
|
||||
|
||||
namespace tvmet {
|
||||
|
||||
|
||||
/*********************************************************
|
||||
* PART I: DECLARATION
|
||||
*********************************************************/
|
||||
|
||||
|
||||
template<class T, int Sz>
|
||||
inline
|
||||
std::ostream& operator<<(std::ostream& os,
|
||||
const Vector<T, Sz>& rhs) _tvmet_always_inline;
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
* Member operators (arithmetic and bit ops)
|
||||
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
|
||||
/*
|
||||
* update_operator(Vector<T1, Sz>, Vector<T2, Sz>)
|
||||
* update_operator(Vector<T1, Sz>, XprVector<E, Sz>)
|
||||
* Note: per se element wise
|
||||
*/
|
||||
#define TVMET_DECLARE_MACRO(NAME, OP) \
|
||||
template<class T1, class T2, int Sz> \
|
||||
Vector<T1, Sz>& \
|
||||
operator OP (Vector<T1, Sz>& lhs, \
|
||||
const Vector<T2, Sz>& rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class T, class E, int Sz> \
|
||||
Vector<T, Sz>& \
|
||||
operator OP (Vector<T, Sz>& lhs, \
|
||||
const XprVector<E, Sz>& rhs) _tvmet_always_inline;
|
||||
|
||||
TVMET_DECLARE_MACRO(add_eq, +=) // per se element wise
|
||||
TVMET_DECLARE_MACRO(sub_eq, -=) // per se element wise
|
||||
TVMET_DECLARE_MACRO(mul_eq, *=) // per se element wise
|
||||
namespace element_wise {
|
||||
TVMET_DECLARE_MACRO(div_eq, /=) // not defined for vectors
|
||||
}
|
||||
|
||||
#undef TVMET_DECLARE_MACRO
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
* Vector arithmetic operators implemented by functions
|
||||
* add, sub, mul and div
|
||||
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
|
||||
/*
|
||||
* operator(Vector<T1, Sz>, Vector<T2, Sz>)
|
||||
* operator(Vector<T1, Sz>, XprVector<E, Sz>)
|
||||
* operator(XprVector<E, Sz>, Vector<T1, Sz>)
|
||||
*/
|
||||
#define TVMET_DECLARE_MACRO(NAME, OP) \
|
||||
template<class T1, class T2, int Sz> \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<T1, T2>, \
|
||||
VectorConstRef<T1, Sz>, \
|
||||
VectorConstRef<T2, Sz> \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
operator OP (const Vector<T1, Sz>& lhs, \
|
||||
const Vector<T2, Sz>& rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class E, class T, int Sz> \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<typename E::value_type, T>, \
|
||||
XprVector<E, Sz>, \
|
||||
VectorConstRef<T, Sz> \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
operator OP (const XprVector<E, Sz>& lhs, \
|
||||
const Vector<T, Sz>& rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class E, class T, int Sz> \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<T, typename E::value_type>, \
|
||||
VectorConstRef<T, Sz>, \
|
||||
XprVector<E, Sz> \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
operator OP (const Vector<T, Sz>& lhs, \
|
||||
const XprVector<E, Sz>& rhs) _tvmet_always_inline;
|
||||
|
||||
TVMET_DECLARE_MACRO(add, +) // per se element wise
|
||||
TVMET_DECLARE_MACRO(sub, -) // per se element wise
|
||||
TVMET_DECLARE_MACRO(mul, *) // per se element wise
|
||||
namespace element_wise {
|
||||
TVMET_DECLARE_MACRO(div, /) // not defined for vectors
|
||||
}
|
||||
|
||||
#undef TVMET_DECLARE_MACRO
|
||||
|
||||
|
||||
/*
|
||||
* operator(Vector<T, Sz>, POD)
|
||||
* operator(POD, Vector<T, Sz>)
|
||||
* Note: operations +,-,*,/ are per se element wise
|
||||
*/
|
||||
#define TVMET_DECLARE_MACRO(NAME, OP, POD) \
|
||||
template<class T, int Sz> \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME< T, POD >, \
|
||||
VectorConstRef<T, Sz>, \
|
||||
XprLiteral< POD > \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
operator OP (const Vector<T, Sz>& lhs, \
|
||||
POD rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class T, int Sz> \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME< POD, T>, \
|
||||
XprLiteral< POD >, \
|
||||
VectorConstRef<T, Sz> \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
operator OP (POD lhs, \
|
||||
const Vector<T, Sz>& rhs) _tvmet_always_inline;
|
||||
|
||||
TVMET_DECLARE_MACRO(add, +, int)
|
||||
TVMET_DECLARE_MACRO(sub, -, int)
|
||||
TVMET_DECLARE_MACRO(mul, *, int)
|
||||
TVMET_DECLARE_MACRO(div, /, int)
|
||||
|
||||
TVMET_DECLARE_MACRO(add, +, float)
|
||||
TVMET_DECLARE_MACRO(sub, -, float)
|
||||
TVMET_DECLARE_MACRO(mul, *, float)
|
||||
TVMET_DECLARE_MACRO(div, /, float)
|
||||
|
||||
TVMET_DECLARE_MACRO(add, +, double)
|
||||
TVMET_DECLARE_MACRO(sub, -, double)
|
||||
TVMET_DECLARE_MACRO(mul, *, double)
|
||||
TVMET_DECLARE_MACRO(div, /, double)
|
||||
|
||||
#undef TVMET_DECLARE_MACRO
|
||||
|
||||
|
||||
#if defined(EIGEN_USE_COMPLEX)
|
||||
/*
|
||||
* operator(Vector<std::complex<T>, Sz>, std::complex<T>)
|
||||
* operator(std::complex<T>, Vector<std::complex<T>, Sz>)
|
||||
* Note: operations +,-,*,/ are per se element wise
|
||||
* \todo type promotion
|
||||
*/
|
||||
#define TVMET_DECLARE_MACRO(NAME, OP) \
|
||||
template<class T, int Sz> \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME< std::complex<T>, std::complex<T> >, \
|
||||
VectorConstRef< std::complex<T>, Sz>, \
|
||||
XprLiteral< std::complex<T> > \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
operator OP (const Vector<std::complex<T>, Sz>& lhs, \
|
||||
const std::complex<T>& rhs) _tvmet_always_inline; \
|
||||
\
|
||||
template<class T, int Sz> \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME< std::complex<T>, std::complex<T> >, \
|
||||
XprLiteral< std::complex<T> >, \
|
||||
VectorConstRef< std::complex<T>, Sz> \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
operator OP (const std::complex<T>& lhs, \
|
||||
const Vector< std::complex<T>, Sz>& rhs) _tvmet_always_inline;
|
||||
|
||||
TVMET_DECLARE_MACRO(add, +) // per se element wise
|
||||
TVMET_DECLARE_MACRO(sub, -) // per se element wise
|
||||
TVMET_DECLARE_MACRO(mul, *) // per se element wise
|
||||
TVMET_DECLARE_MACRO(div, /) // per se element wise
|
||||
#undef TVMET_DECLARE_MACRO
|
||||
|
||||
#endif // defined(EIGEN_USE_COMPLEX)
|
||||
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
* global unary operators
|
||||
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
|
||||
/*
|
||||
* unary_operator(Vector<T, Sz>)
|
||||
* Note: per se element wise
|
||||
*/
|
||||
#define TVMET_DECLARE_MACRO(NAME, OP) \
|
||||
template <class T, int Sz> \
|
||||
XprVector< \
|
||||
XprUnOp< \
|
||||
Fcnl_##NAME<T>, \
|
||||
VectorConstRef<T, Sz> \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
operator OP (const Vector<T, Sz>& rhs) _tvmet_always_inline;
|
||||
|
||||
TVMET_DECLARE_MACRO(neg, -)
|
||||
#undef TVMET_DECLARE_MACRO
|
||||
|
||||
|
||||
/*********************************************************
|
||||
* PART II: IMPLEMENTATION
|
||||
*********************************************************/
|
||||
|
||||
|
||||
/**
|
||||
* \fn operator<<(std::ostream& os, const Vector<T, Sz>& rhs)
|
||||
* \brief Overload operator for i/o
|
||||
* \ingroup _binary_operator
|
||||
*/
|
||||
template<class T, int Sz>
|
||||
inline
|
||||
std::ostream& operator<<(std::ostream& os, const Vector<T, Sz>& rhs) {
|
||||
return rhs.print_on(os);
|
||||
}
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
* Member operators (arithmetic and bit ops)
|
||||
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
|
||||
/*
|
||||
* update_operator(Vector<T1, Sz>, Vector<T2, Sz>)
|
||||
* update_operator(Vector<T1, Sz>, XprVector<E, Sz>)
|
||||
* Note: per se element wise
|
||||
*/
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME, OP) \
|
||||
template<class T1, class T2, int Sz> \
|
||||
inline Vector<T1, Sz>& \
|
||||
operator OP (Vector<T1, Sz>& lhs, const Vector<T2, Sz>& rhs) { \
|
||||
return lhs.M_##NAME(rhs); \
|
||||
} \
|
||||
\
|
||||
template<class T, class E, int Sz> \
|
||||
inline Vector<T, Sz>& \
|
||||
operator OP (Vector<T, Sz>& lhs, const XprVector<E, Sz>& rhs) { \
|
||||
return lhs.M_##NAME(rhs); \
|
||||
}
|
||||
|
||||
TVMET_IMPLEMENT_MACRO(add_eq, +=) // per se element wise
|
||||
TVMET_IMPLEMENT_MACRO(sub_eq, -=) // per se element wise
|
||||
TVMET_IMPLEMENT_MACRO(mul_eq, *=) // per se element wise
|
||||
namespace element_wise {
|
||||
TVMET_IMPLEMENT_MACRO(div_eq, /=) // not defined for vectors
|
||||
}
|
||||
|
||||
#undef TVMET_IMPLEMENT_MACRO
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
* Vector arithmetic operators implemented by functions
|
||||
* add, sub, mul and div
|
||||
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
|
||||
/*
|
||||
* operator(Vector<T1, Sz>, Vector<T2, Sz>)
|
||||
* operator(Vector<T1, Sz>, XprVector<E, Sz>)
|
||||
* operator(XprVector<E, Sz>, Vector<T1, Sz>)
|
||||
*/
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME, OP) \
|
||||
template<class T1, class T2, int Sz> \
|
||||
inline \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<T1, T2>, \
|
||||
VectorConstRef<T1, Sz>, \
|
||||
VectorConstRef<T2, Sz> \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
operator OP (const Vector<T1, Sz>& lhs, const Vector<T2, Sz>& rhs) { \
|
||||
return NAME (lhs, rhs); \
|
||||
} \
|
||||
\
|
||||
template<class E, class T, int Sz> \
|
||||
inline \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<typename E::value_type, T>, \
|
||||
XprVector<E, Sz>, \
|
||||
VectorConstRef<T, Sz> \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
operator OP (const XprVector<E, Sz>& lhs, const Vector<T, Sz>& rhs) { \
|
||||
return NAME (lhs, rhs); \
|
||||
} \
|
||||
\
|
||||
template<class E, class T, int Sz> \
|
||||
inline \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME<T, typename E::value_type>, \
|
||||
VectorConstRef<T, Sz>, \
|
||||
XprVector<E, Sz> \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
operator OP (const Vector<T, Sz>& lhs, const XprVector<E, Sz>& rhs) { \
|
||||
return NAME (lhs, rhs); \
|
||||
}
|
||||
|
||||
TVMET_IMPLEMENT_MACRO(add, +) // per se element wise
|
||||
TVMET_IMPLEMENT_MACRO(sub, -) // per se element wise
|
||||
TVMET_IMPLEMENT_MACRO(mul, *) // per se element wise
|
||||
namespace element_wise {
|
||||
TVMET_IMPLEMENT_MACRO(div, /) // not defined for vectors
|
||||
}
|
||||
|
||||
#undef TVMET_IMPLEMENT_MACRO
|
||||
|
||||
|
||||
/*
|
||||
* operator(Vector<T, Sz>, POD)
|
||||
* operator(POD, Vector<T, Sz>)
|
||||
* Note: operations +,-,*,/ are per se element wise
|
||||
*/
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME, OP, POD) \
|
||||
template<class T, int Sz> \
|
||||
inline \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME< T, POD >, \
|
||||
VectorConstRef<T, Sz>, \
|
||||
XprLiteral< POD > \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
operator OP (const Vector<T, Sz>& lhs, POD rhs) { \
|
||||
return NAME (lhs, rhs); \
|
||||
} \
|
||||
\
|
||||
template<class T, int Sz> \
|
||||
inline \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME< POD, T>, \
|
||||
XprLiteral< POD >, \
|
||||
VectorConstRef<T, Sz> \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
operator OP (POD lhs, const Vector<T, Sz>& rhs) { \
|
||||
return NAME (lhs, rhs); \
|
||||
}
|
||||
|
||||
TVMET_IMPLEMENT_MACRO(add, +, int)
|
||||
TVMET_IMPLEMENT_MACRO(sub, -, int)
|
||||
TVMET_IMPLEMENT_MACRO(mul, *, int)
|
||||
TVMET_IMPLEMENT_MACRO(div, /, int)
|
||||
|
||||
TVMET_IMPLEMENT_MACRO(add, +, float)
|
||||
TVMET_IMPLEMENT_MACRO(sub, -, float)
|
||||
TVMET_IMPLEMENT_MACRO(mul, *, float)
|
||||
TVMET_IMPLEMENT_MACRO(div, /, float)
|
||||
|
||||
TVMET_IMPLEMENT_MACRO(add, +, double)
|
||||
TVMET_IMPLEMENT_MACRO(sub, -, double)
|
||||
TVMET_IMPLEMENT_MACRO(mul, *, double)
|
||||
TVMET_IMPLEMENT_MACRO(div, /, double)
|
||||
|
||||
#undef TVMET_IMPLEMENT_MACRO
|
||||
|
||||
|
||||
#if defined(EIGEN_USE_COMPLEX)
|
||||
/*
|
||||
* operator(Vector<std::complex<T>, Sz>, std::complex<T>)
|
||||
* operator(std::complex<T>, Vector<std::complex<T>, Sz>)
|
||||
* Note: operations +,-,*,/ are per se element wise
|
||||
* \todo type promotion
|
||||
*/
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME, OP) \
|
||||
template<class T, int Sz> \
|
||||
inline \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME< std::complex<T>, std::complex<T> >, \
|
||||
VectorConstRef< std::complex<T>, Sz>, \
|
||||
XprLiteral< std::complex<T> > \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
operator OP (const Vector<std::complex<T>, Sz>& lhs, \
|
||||
const std::complex<T>& rhs) { \
|
||||
return NAME (lhs, rhs); \
|
||||
} \
|
||||
\
|
||||
template<class T, int Sz> \
|
||||
inline \
|
||||
XprVector< \
|
||||
XprBinOp< \
|
||||
Fcnl_##NAME< std::complex<T>, std::complex<T> >, \
|
||||
XprLiteral< std::complex<T> >, \
|
||||
VectorConstRef< std::complex<T>, Sz> \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
operator OP (const std::complex<T>& lhs, \
|
||||
const Vector< std::complex<T>, Sz>& rhs) { \
|
||||
return NAME (lhs, rhs); \
|
||||
}
|
||||
|
||||
TVMET_IMPLEMENT_MACRO(add, +) // per se element wise
|
||||
TVMET_IMPLEMENT_MACRO(sub, -) // per se element wise
|
||||
TVMET_IMPLEMENT_MACRO(mul, *) // per se element wise
|
||||
TVMET_IMPLEMENT_MACRO(div, /) // per se element wise
|
||||
|
||||
#undef TVMET_IMPLEMENT_MACRO
|
||||
|
||||
#endif // defined(EIGEN_USE_COMPLEX)
|
||||
|
||||
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
* global unary operators
|
||||
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
|
||||
/*
|
||||
* unary_operator(Vector<T, Sz>)
|
||||
* Note: per se element wise
|
||||
*/
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME, OP) \
|
||||
template <class T, int Sz> \
|
||||
inline \
|
||||
XprVector< \
|
||||
XprUnOp< \
|
||||
Fcnl_##NAME<T>, \
|
||||
VectorConstRef<T, Sz> \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
operator OP (const Vector<T, Sz>& rhs) { \
|
||||
typedef XprUnOp< \
|
||||
Fcnl_##NAME<T>, \
|
||||
VectorConstRef<T, Sz> \
|
||||
> expr_type; \
|
||||
return XprVector<expr_type, Sz>(expr_type(rhs.constRef())); \
|
||||
}
|
||||
|
||||
TVMET_IMPLEMENT_MACRO(neg, -)
|
||||
|
||||
#undef TVMET_IMPLEMENT_MACRO
|
||||
|
||||
|
||||
} // namespace tvmet
|
||||
|
||||
#endif // TVMET_VECTOR_OPERATORS_H
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
@@ -1,100 +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: VectorUnaryFunctions.h,v 1.9 2004/06/10 16:36:55 opetzold Exp $
|
||||
*/
|
||||
|
||||
#ifndef TVMET_VECTOR_UNARY_FUNCTIONS_H
|
||||
#define TVMET_VECTOR_UNARY_FUNCTIONS_H
|
||||
|
||||
namespace tvmet {
|
||||
|
||||
|
||||
/*********************************************************
|
||||
* PART I: DECLARATION
|
||||
*********************************************************/
|
||||
|
||||
/*
|
||||
* unary_function(Vector<std::complex<T>, Sz>)
|
||||
*/
|
||||
#if defined(EIGEN_USE_COMPLEX)
|
||||
#define TVMET_DECLARE_MACRO(NAME) \
|
||||
template<class T, int Sz> \
|
||||
XprVector< \
|
||||
XprUnOp< \
|
||||
Fcnl_##NAME< std::complex<T> >, \
|
||||
VectorConstRef<std::complex<T>, Sz> \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
NAME(const Vector<std::complex<T>, Sz>& rhs) _tvmet_always_inline;
|
||||
|
||||
TVMET_DECLARE_MACRO(real)
|
||||
TVMET_DECLARE_MACRO(imag)
|
||||
TVMET_DECLARE_MACRO(conj)
|
||||
|
||||
#undef TVMET_DECLARE_MACRO
|
||||
|
||||
#endif // defined(EIGEN_USE_COMPLEX)
|
||||
|
||||
|
||||
/*********************************************************
|
||||
* PART II: IMPLEMENTATION
|
||||
*********************************************************/
|
||||
|
||||
|
||||
/*
|
||||
* unary_function(Vector<std::complex<T>, Sz>)
|
||||
*/
|
||||
#if defined(EIGEN_USE_COMPLEX)
|
||||
#define TVMET_IMPLEMENT_MACRO(NAME) \
|
||||
template<class T, int Sz> \
|
||||
inline \
|
||||
XprVector< \
|
||||
XprUnOp< \
|
||||
Fcnl_##NAME< std::complex<T> >, \
|
||||
VectorConstRef<std::complex<T>, Sz> \
|
||||
>, \
|
||||
Sz \
|
||||
> \
|
||||
NAME(const Vector<std::complex<T>, Sz>& rhs) { \
|
||||
typedef XprUnOp< \
|
||||
Fcnl_##NAME< std::complex<T> >, \
|
||||
VectorConstRef<std::complex<T>, Sz> \
|
||||
> expr_type; \
|
||||
return XprVector<expr_type, Sz>(expr_type(rhs.constRef())); \
|
||||
}
|
||||
|
||||
TVMET_IMPLEMENT_MACRO(real)
|
||||
TVMET_IMPLEMENT_MACRO(imag)
|
||||
TVMET_IMPLEMENT_MACRO(conj)
|
||||
|
||||
#undef TVMET_IMPLEMENT_MACRO
|
||||
|
||||
#endif // defined(EIGEN_USE_COMPLEX)
|
||||
|
||||
|
||||
} // namespace tvmet
|
||||
|
||||
#endif // TVMET_VECTOR_UNARY_FUNCTIONS_H
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
@@ -1,15 +0,0 @@
|
||||
#ifndef _INCLUDE_TVMET_CONFIG_H
|
||||
#define _INCLUDE_TVMET_CONFIG_H
|
||||
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
#cmakedefine TVMET_HAVE_SYS_TIME_H 1
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#cmakedefine TVMET_HAVE_UNISTD_H 1
|
||||
|
||||
#define _tvmet_restrict @TVMET_RESTRICT_KEYWORD@
|
||||
|
||||
#define _tvmet_always_inline @TVMET_ALWAYS_INLINE@
|
||||
|
||||
/* _INCLUDE_TVMET_CONFIG_H */
|
||||
#endif
|
||||
@@ -1,6 +0,0 @@
|
||||
FILE(GLOB tvmet_loop_header_SRCS "*.h")
|
||||
|
||||
INSTALL(FILES
|
||||
${tvmet_loop_header_SRCS}
|
||||
DESTINATION ${INCLUDE_INSTALL_DIR}/loop
|
||||
)
|
||||
@@ -1,114 +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: Gemm.h,v 1.8 2004/06/16 09:30:07 opetzold Exp $
|
||||
*/
|
||||
|
||||
#ifndef TVMET_LOOP_GEMM_H
|
||||
#define TVMET_LOOP_GEMM_H
|
||||
|
||||
namespace tvmet {
|
||||
|
||||
namespace loop {
|
||||
|
||||
|
||||
/**
|
||||
* \class gemm Gemm.h "tvmet/loop/Gemm.h"
|
||||
* \brief class for matrix-matrix product using loop unrolling.
|
||||
* using formula
|
||||
* \f[
|
||||
* M_1\,M_2
|
||||
* \f]
|
||||
* \par Example:
|
||||
* \code
|
||||
* template<class T, int Rows1, int Cols1, int Cols2>
|
||||
* inline
|
||||
* void
|
||||
* prod(const Matrix<T, Rows1, Cols1>& lhs, const Matrix<T, Cols1, Cols2>& rhs,
|
||||
* Matrix<T, Rows1, Cols2>& dest)
|
||||
* {
|
||||
* for (int i = 0; i != Rows1; ++i) {
|
||||
* for (int j = 0; j != Cols2; ++j) {
|
||||
* dest(i, j) = tvmet::loop::gemm<Rows1, Cols1, Cols2>().prod(lhs, rhs, i, j);
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* \endcode
|
||||
* \note The number of rows of rhs matrix have to be equal to cols of lhs matrix.
|
||||
* The result is a (Rows1 x Cols2) matrix.
|
||||
*/
|
||||
template<int Rows1, int Cols1,
|
||||
int Cols2>
|
||||
class gemm
|
||||
{
|
||||
gemm(const gemm&);
|
||||
gemm& operator=(const gemm&);
|
||||
|
||||
private:
|
||||
enum {
|
||||
count = Cols1,
|
||||
N = (count+7)/8
|
||||
};
|
||||
|
||||
public:
|
||||
gemm() { }
|
||||
|
||||
public:
|
||||
template<class E1, class E2>
|
||||
static inline
|
||||
typename PromoteTraits<
|
||||
typename E1::value_type,
|
||||
typename E2::value_type
|
||||
>::value_type
|
||||
prod(const E1& lhs, const E2& rhs, int i, int j) {
|
||||
typename PromoteTraits<
|
||||
typename E1::value_type,
|
||||
typename E2::value_type
|
||||
>::value_type sum(0);
|
||||
int k(0);
|
||||
int n(N);
|
||||
|
||||
// Duff's device
|
||||
switch(count % 8) {
|
||||
case 0: do { sum += lhs(i, k) * rhs(k, j); ++k;
|
||||
case 7: sum += lhs(i, k) * rhs(k, j); ++k;
|
||||
case 6: sum += lhs(i, k) * rhs(k, j); ++k;
|
||||
case 5: sum += lhs(i, k) * rhs(k, j); ++k;
|
||||
case 4: sum += lhs(i, k) * rhs(k, j); ++k;
|
||||
case 3: sum += lhs(i, k) * rhs(k, j); ++k;
|
||||
case 2: sum += lhs(i, k) * rhs(k, j); ++k;
|
||||
case 1: sum += lhs(i, k) * rhs(k, j); ++k;
|
||||
} while(--n != 0);
|
||||
}
|
||||
|
||||
return sum;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace loop
|
||||
|
||||
} // namespace tvmet
|
||||
|
||||
#endif /* TVMET_LOOP_GEMM_H */
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
@@ -1,114 +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: Gemmt.h,v 1.5 2004/06/16 09:30:07 opetzold Exp $
|
||||
*/
|
||||
|
||||
#ifndef TVMET_LOOP_GEMMT_H
|
||||
#define TVMET_LOOP_GEMMT_H
|
||||
|
||||
namespace tvmet {
|
||||
|
||||
namespace loop {
|
||||
|
||||
|
||||
/**
|
||||
* \class gemmt Gemmt.h "tvmet/loop/Gemmt.h"
|
||||
* \brief class for for product matrix-transpose(matrix) operations.
|
||||
* using formula
|
||||
* \f[
|
||||
* M_1\,M_2^{T}
|
||||
* \f]
|
||||
* \par Example:
|
||||
* \code
|
||||
* template<class T, int Rows1, int Cols1, int Cols2>
|
||||
* inline
|
||||
* void
|
||||
* prod(const Matrix<T, Rows1, Cols1>& lhs, const Matrix<T, Rows2, Cols1>& rhs,
|
||||
* Matrix<T, Rows1, Rows2>& dest)
|
||||
* {
|
||||
* for (int i = 0; i != Rows1; ++i) {
|
||||
* for (int j = 0; j != Rows2; ++j) {
|
||||
* dest(i, j) = tvmet::loop::gemmt<Rows1, Cols1, Cols1>().prod(lhs, rhs, i, j);
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* \endcode
|
||||
* \note The number of cols of rhs matrix have to be equal to cols of rhs matrix.
|
||||
* The result is a (Rows1 x Rows2) matrix.
|
||||
*/
|
||||
template<int Rows1, int Cols1,
|
||||
int Cols2 /* unused */>
|
||||
class gemmt
|
||||
{
|
||||
gemmt(const gemmt&);
|
||||
gemmt& operator=(const gemmt&);
|
||||
|
||||
private:
|
||||
enum {
|
||||
count = Cols1,
|
||||
N = (count+7)/8
|
||||
};
|
||||
|
||||
public:
|
||||
gemmt() { }
|
||||
|
||||
public:
|
||||
template<class E1, class E2>
|
||||
static inline
|
||||
typename PromoteTraits<
|
||||
typename E1::value_type,
|
||||
typename E2::value_type
|
||||
>::value_type
|
||||
prod(const E1& lhs, const E2& rhs, int i, int j) {
|
||||
typename PromoteTraits<
|
||||
typename E1::value_type,
|
||||
typename E2::value_type
|
||||
>::value_type sum(0);
|
||||
int k(0);
|
||||
int n(N);
|
||||
|
||||
// Duff's device
|
||||
switch(count % 8) {
|
||||
case 0: do { sum += lhs(i, k) * rhs(j, k); ++k;
|
||||
case 7: sum += lhs(i, k) * rhs(j, k); ++k;
|
||||
case 6: sum += lhs(i, k) * rhs(j, k); ++k;
|
||||
case 5: sum += lhs(i, k) * rhs(j, k); ++k;
|
||||
case 4: sum += lhs(i, k) * rhs(j, k); ++k;
|
||||
case 3: sum += lhs(i, k) * rhs(j, k); ++k;
|
||||
case 2: sum += lhs(i, k) * rhs(j, k); ++k;
|
||||
case 1: sum += lhs(i, k) * rhs(j, k); ++k;
|
||||
} while(--n != 0);
|
||||
}
|
||||
|
||||
return sum;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace loop
|
||||
|
||||
} // namespace tvmet
|
||||
|
||||
#endif /* TVMET_LOOP_GEMMT_H */
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
@@ -1,115 +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: Gemtm.h,v 1.5 2004/06/16 09:30:07 opetzold Exp $
|
||||
*/
|
||||
|
||||
#ifndef TVMET_LOOP_GEMTM_H
|
||||
#define TVMET_LOOP_GEMTM_H
|
||||
|
||||
namespace tvmet {
|
||||
|
||||
namespace loop {
|
||||
|
||||
|
||||
/**
|
||||
* \class gemtm Gemtm.h "tvmet/loop/Gemtm.h"
|
||||
* \brief class for matrix-matrix product using loop unrolling.
|
||||
* using formula
|
||||
* \f[
|
||||
* M_1^{T}\,M_2
|
||||
* \f]
|
||||
* \par Example:
|
||||
* \code
|
||||
* template<class T, int Rows1, int Cols1, int Cols2>
|
||||
* inline
|
||||
* void
|
||||
* prod(const Matrix<T, Rows1, Cols1>& lhs, const Matrix<T, Rows1, Cols2>& rhs,
|
||||
* Matrix<T, Cols2, Cols1>& dest)
|
||||
* {
|
||||
* for (int i = 0; i != Cols1; ++i) {
|
||||
* for (int j = 0; j != Cols2; ++j) {
|
||||
* dest(i, j) = tvmet::loop::gemtm<Rows1, Cols1, Cols2>::prod(lhs, rhs, i, j);
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* \endcode
|
||||
* \note The number of rows of rhs matrix have to be equal rows of rhs matrix,
|
||||
* since lhs matrix 1 is transposed.
|
||||
* The result is a (Cols1 x Cols2) matrix.
|
||||
*/
|
||||
template<int Rows1, int Cols1,
|
||||
int Cols2>
|
||||
class gemtm
|
||||
{
|
||||
gemtm(const gemtm&);
|
||||
gemtm& operator=(const gemtm&);
|
||||
|
||||
private:
|
||||
enum {
|
||||
count = Cols1,
|
||||
N = (count+7)/8
|
||||
};
|
||||
|
||||
public:
|
||||
gemtm() { }
|
||||
|
||||
public:
|
||||
template<class E1, class E2>
|
||||
static inline
|
||||
typename PromoteTraits<
|
||||
typename E1::value_type,
|
||||
typename E2::value_type
|
||||
>::value_type
|
||||
prod(const E1& lhs, const E2& rhs, int i, int j) {
|
||||
typename PromoteTraits<
|
||||
typename E1::value_type,
|
||||
typename E2::value_type
|
||||
>::value_type sum(0);
|
||||
int k(0);
|
||||
int n(N);
|
||||
|
||||
// Duff's device
|
||||
switch(count % 8) {
|
||||
case 0: do { sum += lhs(k, i) * rhs(k, j); ++k;
|
||||
case 7: sum += lhs(k, i) * rhs(k, j); ++k;
|
||||
case 6: sum += lhs(k, i) * rhs(k, j); ++k;
|
||||
case 5: sum += lhs(k, i) * rhs(k, j); ++k;
|
||||
case 4: sum += lhs(k, i) * rhs(k, j); ++k;
|
||||
case 3: sum += lhs(k, i) * rhs(k, j); ++k;
|
||||
case 2: sum += lhs(k, i) * rhs(k, j); ++k;
|
||||
case 1: sum += lhs(k, i) * rhs(k, j); ++k;
|
||||
} while(--n != 0);
|
||||
}
|
||||
|
||||
return sum;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace loop
|
||||
|
||||
} // namespace tvmet
|
||||
|
||||
#endif /* TVMET_LOOP_GEMTM_H */
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
@@ -1,109 +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: Gemtv.h,v 1.3 2004/06/16 09:30:07 opetzold Exp $
|
||||
*/
|
||||
|
||||
#ifndef TVMET_LOOP_GEMTV_H
|
||||
#define TVMET_LOOP_GEMTV_H
|
||||
|
||||
namespace tvmet {
|
||||
|
||||
namespace loop {
|
||||
|
||||
|
||||
/**
|
||||
* \class gemtv Gemtv.h "tvmet/loop/Gemtv.h"
|
||||
* \brief class for transposed(matrix)-vector product using loop unrolling.
|
||||
* using formula
|
||||
* \f[
|
||||
* M^T\,v
|
||||
* \f]
|
||||
* \par Example:
|
||||
* \code
|
||||
* template<class T, int Rows, int Cols>
|
||||
* inline
|
||||
* void
|
||||
* prod(const Matrix<T, Rows, Cols>& lhs, const Vector<T, Rows>& rhs,
|
||||
* Vector<T, Cols>& dest)
|
||||
* {
|
||||
* for (int i = 0; i != Cols; ++i) {
|
||||
* dest(i) = tvmet::loop::gemtv<Rows, Cols>().prod(lhs, rhs, i);
|
||||
* }
|
||||
* }
|
||||
* \endcode
|
||||
*/
|
||||
template<int Rows, int Cols>
|
||||
class gemtv
|
||||
{
|
||||
gemtv(const gemtv&);
|
||||
gemtv& operator=(const gemtv&);
|
||||
|
||||
private:
|
||||
enum {
|
||||
count = Rows,
|
||||
N = (count+7)/8
|
||||
};
|
||||
|
||||
public:
|
||||
gemtv() { }
|
||||
|
||||
public:
|
||||
template<class E1, class E2>
|
||||
static inline
|
||||
typename PromoteTraits<
|
||||
typename E1::value_type,
|
||||
typename E2::value_type
|
||||
>::value_type
|
||||
prod(const E1& lhs, const E2& rhs, int i) {
|
||||
typename PromoteTraits<
|
||||
typename E1::value_type,
|
||||
typename E2::value_type
|
||||
>::value_type sum(0);
|
||||
int j(0);
|
||||
int n(N);
|
||||
|
||||
// Duff's device
|
||||
switch(count % 8) {
|
||||
case 0: do { sum += lhs(j, i) * rhs(j); ++j;
|
||||
case 7: sum += lhs(j, i) * rhs(j); ++j;
|
||||
case 6: sum += lhs(j, i) * rhs(j); ++j;
|
||||
case 5: sum += lhs(j, i) * rhs(j); ++j;
|
||||
case 4: sum += lhs(j, i) * rhs(j); ++j;
|
||||
case 3: sum += lhs(j, i) * rhs(j); ++j;
|
||||
case 2: sum += lhs(j, i) * rhs(j); ++j;
|
||||
case 1: sum += lhs(j, i) * rhs(j); ++j;
|
||||
} while(--n != 0);
|
||||
}
|
||||
|
||||
return sum;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace loop
|
||||
|
||||
} // namespace tvmet
|
||||
|
||||
#endif /* TVMET_LOOP_GEMTV_H */
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
@@ -1,109 +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: Gemv.h,v 1.3 2004/06/16 09:30:07 opetzold Exp $
|
||||
*/
|
||||
|
||||
#ifndef TVMET_LOOP_GEMV_H
|
||||
#define TVMET_LOOP_GEMV_H
|
||||
|
||||
namespace tvmet {
|
||||
|
||||
namespace loop {
|
||||
|
||||
|
||||
/**
|
||||
* \class gemv Gemv.h "tvmet/loop/Gemv.h"
|
||||
* \brief class for matrix-vector product using loop unrolling.
|
||||
* using formula
|
||||
* \f[
|
||||
* M\,v
|
||||
* \f]
|
||||
* \par Example:
|
||||
* \code
|
||||
* template<class T, int Rows, int Cols>
|
||||
* inline
|
||||
* void
|
||||
* prod(const Matrix<T, Rows, Cols>& lhs, const Vector<T, Cols>& rhs,
|
||||
* Vector<T, Rows>& dest)
|
||||
* {
|
||||
* for (int i = 0; i != Rows; ++i) {
|
||||
* dest(i) = tvmet::loop::gemv<Rows, Cols>().prod(lhs, rhs, i);
|
||||
* }
|
||||
* }
|
||||
* \endcode
|
||||
*/
|
||||
template<int Rows, int Cols>
|
||||
class gemv
|
||||
{
|
||||
gemv(const gemv&);
|
||||
gemv& operator=(const gemv&);
|
||||
|
||||
private:
|
||||
enum {
|
||||
count = Cols,
|
||||
N = (count+7)/8
|
||||
};
|
||||
|
||||
public:
|
||||
gemv() { }
|
||||
|
||||
public:
|
||||
template<class E1, class E2>
|
||||
static inline
|
||||
typename PromoteTraits<
|
||||
typename E1::value_type,
|
||||
typename E2::value_type
|
||||
>::value_type
|
||||
prod(const E1& lhs, const E2& rhs, int i) {
|
||||
typename PromoteTraits<
|
||||
typename E1::value_type,
|
||||
typename E2::value_type
|
||||
>::value_type sum(0);
|
||||
int j(0);
|
||||
int n(N);
|
||||
|
||||
// Duff's device
|
||||
switch(count % 8) {
|
||||
case 0: do { sum += lhs(i, j) * rhs(j); ++j;
|
||||
case 7: sum += lhs(i, j) * rhs(j); ++j;
|
||||
case 6: sum += lhs(i, j) * rhs(j); ++j;
|
||||
case 5: sum += lhs(i, j) * rhs(j); ++j;
|
||||
case 4: sum += lhs(i, j) * rhs(j); ++j;
|
||||
case 3: sum += lhs(i, j) * rhs(j); ++j;
|
||||
case 2: sum += lhs(i, j) * rhs(j); ++j;
|
||||
case 1: sum += lhs(i, j) * rhs(j); ++j;
|
||||
} while(--n != 0);
|
||||
}
|
||||
|
||||
return sum;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace loop
|
||||
|
||||
} // namespace tvmet
|
||||
|
||||
#endif /* TVMET_LOOP_GEMV_H */
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
@@ -1,65 +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: Matrix.h,v 1.7 2004/06/27 20:32:55 opetzold Exp $
|
||||
*/
|
||||
|
||||
#ifndef TVMET_LOOP_MATRIX_H
|
||||
#define TVMET_LOOP_MATRIX_H
|
||||
|
||||
namespace tvmet {
|
||||
|
||||
namespace loop {
|
||||
|
||||
|
||||
/**
|
||||
* \class Matrix Matrix.h "tvmet/loop/Matrix.h"
|
||||
* \brief Loop %Matrix class using expression and loop templates.
|
||||
*/
|
||||
template<int Rows, int Cols>
|
||||
class Matrix
|
||||
{
|
||||
Matrix(const Matrix&);
|
||||
Matrix& operator=(const Matrix&);
|
||||
|
||||
public:
|
||||
Matrix() { }
|
||||
|
||||
public:
|
||||
/** assign an expression on columns on given row using the functional fn. */
|
||||
template<class E1, class E2, class Assign>
|
||||
static inline
|
||||
void assign(E1& lhs, const E2& rhs, const Assign& assign_fn) {
|
||||
for(int i = 0; i != Rows; ++i)
|
||||
for(int j = 0; j != Cols; ++j)
|
||||
assign_fn.apply_on(lhs(i, j), rhs(i, j));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace loop
|
||||
|
||||
} // namespace tvmet
|
||||
|
||||
#endif /* TVMET_LOOP_MATRIX_H */
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
@@ -1,64 +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: Vector.h,v 1.5 2004/06/27 20:32:55 opetzold Exp $
|
||||
*/
|
||||
|
||||
#ifndef TVMET_LOOP_VECTOR_H
|
||||
#define TVMET_LOOP_VECTOR_H
|
||||
|
||||
namespace tvmet {
|
||||
|
||||
namespace loop {
|
||||
|
||||
|
||||
/**
|
||||
* \class Vector Vector.h "tvmet/loop/Vector.h"
|
||||
* \brief Loop %Vector class using expression and loop templates.
|
||||
*/
|
||||
template<int Sz>
|
||||
class Vector
|
||||
{
|
||||
Vector(const Vector&);
|
||||
Vector& operator=(const Vector&);
|
||||
|
||||
public:
|
||||
Vector() { }
|
||||
|
||||
public:
|
||||
/** assign an expression on columns on given row using the functional fn. */
|
||||
template<class E1, class E2, class Assign>
|
||||
static inline
|
||||
void assign(E1& lhs, const E2& rhs, const Assign& assign_fn) {
|
||||
for(int i = 0; i != Sz; ++i)
|
||||
assign_fn.apply_on(lhs(i), rhs(i));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace loop
|
||||
|
||||
} // namespace tvmet
|
||||
|
||||
#endif /* TVMET_LOOP_VECTOR_H */
|
||||
|
||||
// Local Variables:
|
||||
// mode:C++
|
||||
// End:
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user