diff options
167 files changed, 0 insertions, 34603 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 6d304f9b4..f33b7a2b8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) @@ -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!!! $$$ - diff --git a/cmake/modules/CheckAlwaysInline.cmake b/cmake/modules/CheckAlwaysInline.cmake deleted file mode 100644 index ab5ceb0ac..000000000 --- a/cmake/modules/CheckAlwaysInline.cmake +++ /dev/null @@ -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) diff --git a/cmake/modules/CheckRestrictKeyword.cmake b/cmake/modules/CheckRestrictKeyword.cmake deleted file mode 100644 index d3fcbda90..000000000 --- a/cmake/modules/CheckRestrictKeyword.cmake +++ /dev/null @@ -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) diff --git a/tvmet-1.7.1/AUTHORS b/tvmet-1.7.1/AUTHORS deleted file mode 100644 index 726223309..000000000 --- a/tvmet-1.7.1/AUTHORS +++ /dev/null @@ -1 +0,0 @@ -Olaf Petzold <opetzold@users.sourceforge.net> diff --git a/tvmet-1.7.1/CMakeLists.txt b/tvmet-1.7.1/CMakeLists.txt deleted file mode 100644 index de32e4420..000000000 --- a/tvmet-1.7.1/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -ADD_SUBDIRECTORY(include) -ADD_SUBDIRECTORY(testsuite)
\ No newline at end of file diff --git a/tvmet-1.7.1/COPYING b/tvmet-1.7.1/COPYING deleted file mode 100644 index b1e3f5a26..000000000 --- a/tvmet-1.7.1/COPYING +++ /dev/null @@ -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! - - diff --git a/tvmet-1.7.1/INSTALL b/tvmet-1.7.1/INSTALL deleted file mode 100644 index 54caf7c19..000000000 --- a/tvmet-1.7.1/INSTALL +++ /dev/null @@ -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. - diff --git a/tvmet-1.7.1/LICENSE b/tvmet-1.7.1/LICENSE deleted file mode 100644 index c29dde6d3..000000000 --- a/tvmet-1.7.1/LICENSE +++ /dev/null @@ -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 diff --git a/tvmet-1.7.1/NEWS b/tvmet-1.7.1/NEWS deleted file mode 100644 index 0216d9c9b..000000000 --- a/tvmet-1.7.1/NEWS +++ /dev/null @@ -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" diff --git a/tvmet-1.7.1/README b/tvmet-1.7.1/README deleted file mode 100644 index f26f71ae7..000000000 --- a/tvmet-1.7.1/README +++ /dev/null @@ -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 - diff --git a/tvmet-1.7.1/THANKS b/tvmet-1.7.1/THANKS deleted file mode 100644 index dffebb116..000000000 --- a/tvmet-1.7.1/THANKS +++ /dev/null @@ -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. diff --git a/tvmet-1.7.1/benchmark/BTL-20030124.patch b/tvmet-1.7.1/benchmark/BTL-20030124.patch deleted file mode 100644 index 2488198c2..000000000 --- a/tvmet-1.7.1/benchmark/BTL-20030124.patch +++ /dev/null @@ -1,3887 +0,0 @@ -diff -Nur BTL-20030124/actions/action_aat_product.hh BTL/actions/action_aat_product.hh ---- BTL-20030124/actions/action_aat_product.hh 2002-12-02 14:57:49.000000000 +0100 -+++ BTL/actions/action_aat_product.hh 2003-11-12 19:06:26.000000000 +0100 -@@ -1,14 +1,14 @@ - //===================================================== - // File : action_aat_product.hh --// Author : L. Plagne <laurent.plagne@edf.fr)> -+// Author : L. Plagne <laurent.plagne@edf.fr)> - // Copyright (C) EDF R&D, lun sep 30 14:23:19 CEST 2002 - //===================================================== --// -+// - // This program is free software; you can redistribute it and/or - // modify it under the terms of the GNU General Public License - // as published by the Free Software Foundation; either version 2 - // of the License, or (at your option) any later version. --// -+// - // This program is distributed in the hope that it will be useful, - // but WITHOUT ANY WARRANTY; without even the implied warranty of - // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -@@ -16,7 +16,7 @@ - // You should have received a copy of the GNU General Public License - // along with this program; if not, write to the Free Software - // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --// -+// - #ifndef ACTION_AAT_PRODUCT - #define ACTION_AAT_PRODUCT - #include "utilities.h" -@@ -26,103 +26,39 @@ - #include "init/init_vector.hh" - #include "init/init_matrix.hh" - --using namespace std; -- - template<class Interface> --class Action_aat_product { -+class Action_aat_product -+{ -+ Action_aat_product(const Action_aat_product &); - - public : -- - // Ctor -- -- Action_aat_product( int size ):_size(size) -- { -- MESSAGE("Action_aat_product Ctor"); -- -- // STL matrix and vector initialization -- -- init_matrix<pseudo_random>(A_stl,_size); -- init_matrix<null_function>(X_stl,_size); -- init_matrix<null_function>(resu_stl,_size); -- -- // generic matrix and vector initialization -- -- Interface::matrix_from_stl(A_ref,A_stl); -- Interface::matrix_from_stl(X_ref,X_stl); -- -- Interface::matrix_from_stl(A,A_stl); -- Interface::matrix_from_stl(X,X_stl); -- -- } -- -- // invalidate copy ctor -- -- Action_aat_product( const Action_aat_product & ) -- { -- INFOS("illegal call to Action_aat_product Copy Ctor"); -- exit(0); -- } -+ Action_aat_product(int size); - - // Dtor -+ ~Action_aat_product(); - -- ~Action_aat_product( void ){ -- -- MESSAGE("Action_aat_product Dtor"); -- -- // deallocation -- -- Interface::free_matrix(A,_size); -- Interface::free_matrix(X,_size); -- -- Interface::free_matrix(A_ref,_size); -- Interface::free_matrix(X_ref,_size); -- -- } -- - // action name -- -- static inline std::string name( void ) -- { -- return "aat_"+Interface::name(); -+ static inline std::string name() { -+ return "aat_" + Interface::name(); - } - -- double nb_op_base( void ){ -+ double nb_op_base() { - return 2.0*_size*_size*_size; - } - -- inline void initialize( void ){ -- -+ void initialize() { - Interface::copy_matrix(A_ref,A,_size); - Interface::copy_matrix(X_ref,X,_size); -- - } - -- inline void calculate( void ) { -- -- Interface::aat_product(A,X,_size); -- -+ void calculate( void ) { -+ Interface::aat_product(A,X,_size); - } - -- void check_result( void ){ -- -- // calculation check -- -- Interface::matrix_to_stl(X,resu_stl); -- -- STL_interface<typename Interface::real_type>::aat_product(A_stl,X_stl,_size); -- -- typename Interface::real_type error= -- STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl); -- -- if (error>1.e-6){ -- INFOS("WRONG CALCULATION...residual=" << error); -- exit(0); -- } -- -- } -- --private : -+ void check_result(); - -+private : - typename Interface::stl_matrix A_stl; - typename Interface::stl_matrix X_stl; - typename Interface::stl_matrix resu_stl; -@@ -133,13 +69,61 @@ - typename Interface::gene_matrix A; - typename Interface::gene_matrix X; - -- - int _size; -- - }; -- - --#endif - -+/* -+ * Implementation -+ */ -+template<class Interface> -+Action_aat_product<Interface>::Action_aat_product(int size) -+ : _size(size) -+{ -+ MESSAGE("Action_aat_product Ctor"); -+ -+ // STL matrix and vector initialization -+ init_matrix<pseudo_random>(A_stl,_size); -+ init_matrix<null_function>(X_stl,_size); -+ init_matrix<null_function>(resu_stl,_size); -+ -+ // generic matrix and vector initialization -+ Interface::matrix_from_stl(A_ref,A_stl); -+ Interface::matrix_from_stl(X_ref,X_stl); -+ -+ Interface::matrix_from_stl(A,A_stl); -+ Interface::matrix_from_stl(X,X_stl); -+} -+ -+template<class Interface> -+Action_aat_product<Interface>::~Action_aat_product() -+{ -+ MESSAGE("Action_aat_product Dtor"); -+ -+ // deallocation -+ Interface::free_matrix(A,_size); -+ Interface::free_matrix(X,_size); -+ -+ Interface::free_matrix(A_ref,_size); -+ Interface::free_matrix(X_ref,_size); -+} -+ -+template<class Interface> -+void Action_aat_product<Interface>::check_result() -+{ -+ // calculation check -+ -+ Interface::matrix_to_stl(X,resu_stl); - -+ STL_interface<typename Interface::real_type>::aat_product(A_stl,X_stl,_size); - -+ typename Interface::real_type error= -+ STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl); -+ -+ if (error>1.e-6){ -+ INFOS("WRONG CALCULATION...residual=" << error); -+ exit(0); -+ } -+} -+ -+#endif -diff -Nur BTL-20030124/actions/action_ata_product.hh BTL/actions/action_ata_product.hh ---- BTL-20030124/actions/action_ata_product.hh 2002-12-02 14:58:14.000000000 +0100 -+++ BTL/actions/action_ata_product.hh 2003-11-12 19:13:07.000000000 +0100 -@@ -1,14 +1,14 @@ - //===================================================== - // File : action_ata_product.hh --// Author : L. Plagne <laurent.plagne@edf.fr)> -+// Author : L. Plagne <laurent.plagne@edf.fr)> - // Copyright (C) EDF R&D, lun sep 30 14:23:19 CEST 2002 - //===================================================== --// -+// - // This program is free software; you can redistribute it and/or - // modify it under the terms of the GNU General Public License - // as published by the Free Software Foundation; either version 2 - // of the License, or (at your option) any later version. --// -+// - // This program is distributed in the hope that it will be useful, - // but WITHOUT ANY WARRANTY; without even the implied warranty of - // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -@@ -16,7 +16,7 @@ - // You should have received a copy of the GNU General Public License - // along with this program; if not, write to the Free Software - // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --// -+// - #ifndef ACTION_ATA_PRODUCT - #define ACTION_ATA_PRODUCT - #include "utilities.h" -@@ -26,103 +26,39 @@ - #include "init/init_vector.hh" - #include "init/init_matrix.hh" - --using namespace std; -- - template<class Interface> --class Action_ata_product { -+class Action_ata_product -+{ -+ Action_ata_product(const Action_ata_product &); - - public : -- - // Ctor -- -- Action_ata_product( int size ):_size(size) -- { -- MESSAGE("Action_ata_product Ctor"); -- -- // STL matrix and vector initialization -- -- init_matrix<pseudo_random>(A_stl,_size); -- init_matrix<null_function>(X_stl,_size); -- init_matrix<null_function>(resu_stl,_size); -- -- // generic matrix and vector initialization -- -- Interface::matrix_from_stl(A_ref,A_stl); -- Interface::matrix_from_stl(X_ref,X_stl); -- -- Interface::matrix_from_stl(A,A_stl); -- Interface::matrix_from_stl(X,X_stl); -- -- } -- -- // invalidate copy ctor -- -- Action_ata_product( const Action_ata_product & ) -- { -- INFOS("illegal call to Action_ata_product Copy Ctor"); -- exit(0); -- } -+ Action_ata_product(int size); - - // Dtor -+ ~Action_ata_product(); - -- ~Action_ata_product( void ){ -- -- MESSAGE("Action_ata_product Dtor"); -- -- // deallocation -- -- Interface::free_matrix(A,_size); -- Interface::free_matrix(X,_size); -- -- Interface::free_matrix(A_ref,_size); -- Interface::free_matrix(X_ref,_size); -- -- } -- - // action name -- -- static inline std::string name( void ) -- { -- return "ata_"+Interface::name(); -+ static inline std::string name() { -+ return "ata_" + Interface::name(); - } - -- double nb_op_base( void ){ -+ double nb_op_base() { - return 2.0*_size*_size*_size; - } - -- inline void initialize( void ){ -- -+ void initialize() { - Interface::copy_matrix(A_ref,A,_size); - Interface::copy_matrix(X_ref,X,_size); -- - } - - inline void calculate( void ) { -- -- Interface::ata_product(A,X,_size); -- -+ Interface::ata_product(A,X,_size); - } - -- void check_result( void ){ -- -- // calculation check -- -- Interface::matrix_to_stl(X,resu_stl); -- -- STL_interface<typename Interface::real_type>::ata_product(A_stl,X_stl,_size); -- -- typename Interface::real_type error= -- STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl); -- -- if (error>1.e-6){ -- INFOS("WRONG CALCULATION...residual=" << error); -- exit(0); -- } -- -- } -- --private : -+ void check_result(); - -+private : - typename Interface::stl_matrix A_stl; - typename Interface::stl_matrix X_stl; - typename Interface::stl_matrix resu_stl; -@@ -133,13 +69,60 @@ - typename Interface::gene_matrix A; - typename Interface::gene_matrix X; - -- - int _size; -- - }; -- - --#endif - -+/* -+ * Implementation -+ */ -+template<class Interface> -+Action_ata_product<Interface>::Action_ata_product(int size) -+ : _size(size) -+{ -+ MESSAGE("Action_ata_product Ctor"); -+ -+ // STL matrix and vector initialization -+ init_matrix<pseudo_random>(A_stl,_size); -+ init_matrix<null_function>(X_stl,_size); -+ init_matrix<null_function>(resu_stl,_size); -+ -+ // generic matrix and vector initialization -+ Interface::matrix_from_stl(A_ref,A_stl); -+ Interface::matrix_from_stl(X_ref,X_stl); -+ -+ Interface::matrix_from_stl(A,A_stl); -+ Interface::matrix_from_stl(X,X_stl); -+} -+ -+template<class Interface> -+Action_ata_product<Interface>::~Action_ata_product() -+{ -+ MESSAGE("Action_ata_product Dtor"); -+ -+ // deallocation -+ Interface::free_matrix(A,_size); -+ Interface::free_matrix(X,_size); -+ -+ Interface::free_matrix(A_ref,_size); -+ Interface::free_matrix(X_ref,_size); -+} -+ -+template<class Interface> -+void Action_ata_product<Interface>::check_result() -+{ -+ // calculation check -+ Interface::matrix_to_stl(X,resu_stl); - -+ STL_interface<typename Interface::real_type>::ata_product(A_stl,X_stl,_size); - -+ typename Interface::real_type error= -+ STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl); -+ -+ if (error>1.e-6){ -+ INFOS("WRONG CALCULATION...residual=" << error); -+ exit(0); -+ } -+} -+ -+#endif -diff -Nur BTL-20030124/actions/action_axpy.hh BTL/actions/action_axpy.hh ---- BTL-20030124/actions/action_axpy.hh 2003-01-08 11:11:35.000000000 +0100 -+++ BTL/actions/action_axpy.hh 2003-11-12 19:07:44.000000000 +0100 -@@ -1,14 +1,14 @@ - //===================================================== - // File : action_axpy.hh --// Author : L. Plagne <laurent.plagne@edf.fr)> -+// Author : L. Plagne <laurent.plagne@edf.fr)> - // Copyright (C) EDF R&D, lun sep 30 14:23:19 CEST 2002 - //===================================================== --// -+// - // This program is free software; you can redistribute it and/or - // modify it under the terms of the GNU General Public License - // as published by the Free Software Foundation; either version 2 - // of the License, or (at your option) any later version. --// -+// - // This program is distributed in the hope that it will be useful, - // but WITHOUT ANY WARRANTY; without even the implied warranty of - // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -@@ -16,7 +16,7 @@ - // You should have received a copy of the GNU General Public License - // along with this program; if not, write to the Free Software - // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --// -+// - #ifndef ACTION_AXPY - #define ACTION_AXPY - #include "utilities.h" -@@ -26,106 +26,39 @@ - #include "init/init_vector.hh" - #include "init/init_matrix.hh" - --using namespace std; -- - template<class Interface> --class Action_axpy { -- --public : -+class Action_axpy -+{ -+ Action_axpy(const Action_axpy &); - -+public: - // Ctor -- -- Action_axpy( int size ):_size(size),_coef(1.0) -- { -- MESSAGE("Action_axpy Ctor"); -- -- // STL vector initialization -- -- init_vector<pseudo_random>(X_stl,_size); -- init_vector<pseudo_random>(Y_stl,_size); -- init_vector<null_function>(resu_stl,_size); -- -- // generic matrix and vector initialization -- -- Interface::vector_from_stl(X_ref,X_stl); -- Interface::vector_from_stl(Y_ref,Y_stl); -- -- Interface::vector_from_stl(X,X_stl); -- Interface::vector_from_stl(Y,Y_stl); -- -- -- } -- -- // invalidate copy ctor -- -- Action_axpy( const Action_axpy & ) -- { -- INFOS("illegal call to Action_axpy Copy Ctor"); -- exit(0); -- } -+ Action_axpy(int size); - - // Dtor -+ ~Action_axpy(); - -- ~Action_axpy( void ){ -- -- MESSAGE("Action_axpy Dtor"); -- -- // deallocation -- -- Interface::free_vector(X_ref); -- Interface::free_vector(Y_ref); -- -- Interface::free_vector(X); -- Interface::free_vector(Y); -- -- -- } -- - // action name -- -- static inline std::string name( void ) -- { -- return "axpy_"+Interface::name(); -+ static inline std::string name() { -+ return "axpy_" + Interface::name(); - } - -- double nb_op_base( void ){ -+ double nb_op_base() { - return 2.0*_size; - } - -- inline void initialize( void ){ -- -+ void initialize() { - Interface::copy_vector(X_ref,X,_size); - Interface::copy_vector(Y_ref,Y,_size); -- - } - -- inline void calculate( void ) { -- -- Interface::axpy(_coef,X,Y,_size); -- -+ void calculate() { -+ Interface::axpy(_coef,X,Y,_size); - } - -+ void check_result(); - -- void check_result( void ){ -- -- // calculation check -- -- Interface::vector_to_stl(Y,resu_stl); -- -- STL_interface<typename Interface::real_type>::axpy(_coef,X_stl,Y_stl,_size); -- -- typename Interface::real_type error= -- STL_interface<typename Interface::real_type>::norm_diff(Y_stl,resu_stl); -- -- if (error>1.e-6){ -- INFOS("WRONG CALCULATION...residual=" << error); -- exit(0); -- } -- -- } -- --private : -- -+private : - typename Interface::stl_vector X_stl; - typename Interface::stl_vector Y_stl; - typename Interface::stl_vector resu_stl; -@@ -139,13 +72,59 @@ - typename Interface::real_type _coef; - - int _size; -+}; - -- - --}; -- -+/* -+ * Implementation -+ */ -+template<class Interface> -+Action_axpy<Interface>::Action_axpy(int size) -+ : _coef(1.0), _size(size) -+{ -+ MESSAGE("Action_axpy Ctor"); -+ -+ // STL vector initialization -+ init_vector<pseudo_random>(X_stl,_size); -+ init_vector<pseudo_random>(Y_stl,_size); -+ init_vector<null_function>(resu_stl,_size); -+ -+ // generic matrix and vector initialization -+ Interface::vector_from_stl(X_ref,X_stl); -+ Interface::vector_from_stl(Y_ref,Y_stl); -+ -+ Interface::vector_from_stl(X,X_stl); -+ Interface::vector_from_stl(Y,Y_stl); -+} - --#endif -+template<class Interface> -+Action_axpy<Interface>::~Action_axpy() -+{ -+ MESSAGE("Action_axpy Dtor"); -+ -+ // deallocation -+ Interface::free_vector(X_ref); -+ Interface::free_vector(Y_ref); -+ -+ Interface::free_vector(X); -+ Interface::free_vector(Y); -+} -+ -+template<class Interface> -+void Action_axpy<Interface>::check_result() -+{ -+ // calculation check -+ Interface::vector_to_stl(Y,resu_stl); - -+ STL_interface<typename Interface::real_type>::axpy(_coef,X_stl,Y_stl,_size); - -+ typename Interface::real_type error= -+ STL_interface<typename Interface::real_type>::norm_diff(Y_stl,resu_stl); - -+ if (error>1.e-6){ -+ INFOS("WRONG CALCULATION...residual=" << error); -+ exit(0); -+ } -+} -+ -+#endif -diff -Nur BTL-20030124/actions/action_matrix_matrix_product.hh BTL/actions/action_matrix_matrix_product.hh ---- BTL-20030124/actions/action_matrix_matrix_product.hh 2002-12-02 14:57:27.000000000 +0100 -+++ BTL/actions/action_matrix_matrix_product.hh 2003-11-12 19:49:11.000000000 +0100 -@@ -1,14 +1,14 @@ - //===================================================== - // File : action_matrix_matrix_product.hh --// Author : L. Plagne <laurent.plagne@edf.fr)> -+// Author : L. Plagne <laurent.plagne@edf.fr)> - // Copyright (C) EDF R&D, lun sep 30 14:23:19 CEST 2002 - //===================================================== --// -+// - // This program is free software; you can redistribute it and/or - // modify it under the terms of the GNU General Public License - // as published by the Free Software Foundation; either version 2 - // of the License, or (at your option) any later version. --// -+// - // This program is distributed in the hope that it will be useful, - // but WITHOUT ANY WARRANTY; without even the implied warranty of - // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -@@ -16,7 +16,7 @@ - // You should have received a copy of the GNU General Public License - // along with this program; if not, write to the Free Software - // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --// -+// - #ifndef ACTION_MATRIX_MATRIX_PRODUCT - #define ACTION_MATRIX_MATRIX_PRODUCT - #include "utilities.h" -@@ -26,109 +26,40 @@ - #include "init/init_vector.hh" - #include "init/init_matrix.hh" - --using namespace std; -- - template<class Interface> --class Action_matrix_matrix_product { -- --public : -+class Action_matrix_matrix_product -+{ -+ Action_matrix_matrix_product(const Action_matrix_matrix_product &); - -+public: - // Ctor -- -- Action_matrix_matrix_product( int size ):_size(size) -- { -- MESSAGE("Action_matrix_matrix_product Ctor"); -- -- // STL matrix and vector initialization -- -- init_matrix<pseudo_random>(A_stl,_size); -- init_matrix<pseudo_random>(B_stl,_size); -- init_matrix<null_function>(X_stl,_size); -- init_matrix<null_function>(resu_stl,_size); -- -- // generic matrix and vector initialization -- -- Interface::matrix_from_stl(A_ref,A_stl); -- Interface::matrix_from_stl(B_ref,B_stl); -- Interface::matrix_from_stl(X_ref,X_stl); -- -- Interface::matrix_from_stl(A,A_stl); -- Interface::matrix_from_stl(B,B_stl); -- Interface::matrix_from_stl(X,X_stl); -- -- } -- -- // invalidate copy ctor -- -- Action_matrix_matrix_product( const Action_matrix_matrix_product & ) -- { -- INFOS("illegal call to Action_matrix_matrix_product Copy Ctor"); -- exit(0); -- } -+ Action_matrix_matrix_product(int size); - - // Dtor -+ ~Action_matrix_matrix_product(); - -- ~Action_matrix_matrix_product( void ){ -- -- MESSAGE("Action_matrix_matrix_product Dtor"); -- -- // deallocation -- -- Interface::free_matrix(A,_size); -- Interface::free_matrix(B,_size); -- Interface::free_matrix(X,_size); -- -- Interface::free_matrix(A_ref,_size); -- Interface::free_matrix(B_ref,_size); -- Interface::free_matrix(X_ref,_size); -- -- } -- - // action name -- -- static inline std::string name( void ) -- { -- return "matrix_matrix_"+Interface::name(); -+ static inline std::string name() { -+ return "matrix_matrix_" + Interface::name(); - } - -- double nb_op_base( void ){ -+ double nb_op_base() { - return 2.0*_size*_size*_size; - } - -- inline void initialize( void ){ -- -+ void initialize() { - Interface::copy_matrix(A_ref,A,_size); - Interface::copy_matrix(B_ref,B,_size); - Interface::copy_matrix(X_ref,X,_size); -- - } - -- inline void calculate( void ) { -- -- Interface::matrix_matrix_product(A,B,X,_size); -- -+ inline void calculate() { -+ Interface::matrix_matrix_product(A,B,X,_size); - } - -- void check_result( void ){ -- -- // calculation check -- -- Interface::matrix_to_stl(X,resu_stl); -- -- STL_interface<typename Interface::real_type>::matrix_matrix_product(A_stl,B_stl,X_stl,_size); -- -- typename Interface::real_type error= -- STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl); -- -- if (error>1.e-6){ -- INFOS("WRONG CALCULATION...residual=" << error); -- exit(0); -- } -- -- } -- --private : -+ void check_result(); - -+private : - typename Interface::stl_matrix A_stl; - typename Interface::stl_matrix B_stl; - typename Interface::stl_matrix X_stl; -@@ -142,13 +73,66 @@ - typename Interface::gene_matrix B; - typename Interface::gene_matrix X; - -- - int _size; -- - }; -- - --#endif - -+/* -+ * Implementation -+ */ -+template<class Interface> -+Action_matrix_matrix_product<Interface>::Action_matrix_matrix_product(int size) -+ : _size(size) -+{ -+ MESSAGE("Action_matrix_matrix_product Ctor"); -+ -+ // STL matrix and vector initialization -+ init_matrix<pseudo_random>(A_stl,_size); -+ init_matrix<pseudo_random>(B_stl,_size); -+ init_matrix<null_function>(X_stl,_size); -+ init_matrix<null_function>(resu_stl,_size); -+ -+ // generic matrix and vector initialization -+ Interface::matrix_from_stl(A_ref,A_stl); -+ Interface::matrix_from_stl(B_ref,B_stl); -+ Interface::matrix_from_stl(X_ref,X_stl); -+ -+ Interface::matrix_from_stl(A,A_stl); -+ Interface::matrix_from_stl(B,B_stl); -+ Interface::matrix_from_stl(X,X_stl); -+} - -+template<class Interface> -+Action_matrix_matrix_product<Interface>::~Action_matrix_matrix_product() -+{ -+ MESSAGE("Action_matrix_matrix_product Dtor"); -+ -+ // deallocation -+ Interface::free_matrix(A,_size); -+ Interface::free_matrix(B,_size); -+ Interface::free_matrix(X,_size); -+ -+ Interface::free_matrix(A_ref,_size); -+ Interface::free_matrix(B_ref,_size); -+ Interface::free_matrix(X_ref,_size); - -+} -+ -+template<class Interface> -+void Action_matrix_matrix_product<Interface>::check_result() -+{ -+ // calculation check -+ Interface::matrix_to_stl(X,resu_stl); -+ -+ STL_interface<typename Interface::real_type>::matrix_matrix_product(A_stl,B_stl,X_stl,_size); -+ -+ typename Interface::real_type error= -+ STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl); -+ -+ if (error>1.e-6){ -+ INFOS("WRONG CALCULATION...residual=" << error); -+ exit(0); -+ } -+} -+ -+#endif -diff -Nur BTL-20030124/actions/action_matrix_vector_product.hh BTL/actions/action_matrix_vector_product.hh ---- BTL-20030124/actions/action_matrix_vector_product.hh 2002-12-02 14:58:57.000000000 +0100 -+++ BTL/actions/action_matrix_vector_product.hh 2003-11-12 19:08:45.000000000 +0100 -@@ -1,14 +1,14 @@ - //===================================================== - // File : action_matrix_vector_product.hh --// Author : L. Plagne <laurent.plagne@edf.fr)> -+// Author : L. Plagne <laurent.plagne@edf.fr)> - // Copyright (C) EDF R&D, lun sep 30 14:23:19 CEST 2002 - //===================================================== --// -+// - // This program is free software; you can redistribute it and/or - // modify it under the terms of the GNU General Public License - // as published by the Free Software Foundation; either version 2 - // of the License, or (at your option) any later version. --// -+// - // This program is distributed in the hope that it will be useful, - // but WITHOUT ANY WARRANTY; without even the implied warranty of - // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -@@ -16,7 +16,7 @@ - // You should have received a copy of the GNU General Public License - // along with this program; if not, write to the Free Software - // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --// -+// - #ifndef ACTION_MATRIX_VECTOR_PRODUCT - #define ACTION_MATRIX_VECTOR_PRODUCT - #include "utilities.h" -@@ -26,109 +26,40 @@ - #include "init/init_vector.hh" - #include "init/init_matrix.hh" - --using namespace std; -- - template<class Interface> --class Action_matrix_vector_product { -+class Action_matrix_vector_product -+{ -+ Action_matrix_vector_product(const Action_matrix_vector_product &); - - public : -- - // Ctor -- -- Action_matrix_vector_product( int size ):_size(size) -- { -- MESSAGE("Action_matrix_vector_product Ctor"); -- -- // STL matrix and vector initialization -- -- init_matrix<pseudo_random>(A_stl,_size); -- init_vector<pseudo_random>(B_stl,_size); -- init_vector<null_function>(X_stl,_size); -- init_vector<null_function>(resu_stl,_size); -- -- // generic matrix and vector initialization -- -- Interface::matrix_from_stl(A_ref,A_stl); -- Interface::vector_from_stl(B_ref,B_stl); -- Interface::vector_from_stl(X_ref,X_stl); -- -- Interface::matrix_from_stl(A,A_stl); -- Interface::vector_from_stl(B,B_stl); -- Interface::vector_from_stl(X,X_stl); -- -- } -- -- // invalidate copy ctor -- -- Action_matrix_vector_product( const Action_matrix_vector_product & ) -- { -- INFOS("illegal call to Action_matrix_vector_product Copy Ctor"); -- exit(0); -- } -+ Action_matrix_vector_product(int size); - - // Dtor -+ ~Action_matrix_vector_product(); - -- ~Action_matrix_vector_product( void ){ -- -- MESSAGE("Action_matrix_vector_product Dtor"); -- -- // deallocation -- -- Interface::free_matrix(A,_size); -- Interface::free_vector(B); -- Interface::free_vector(X); -- -- Interface::free_matrix(A_ref,_size); -- Interface::free_vector(B_ref); -- Interface::free_vector(X_ref); -- -- } -- - // action name -- -- static inline std::string name( void ) -- { -- return "matrix_vector_"+Interface::name(); -+ static inline std::string name() { -+ return "matrix_vector_" + Interface::name(); - } - -- double nb_op_base( void ){ -+ double nb_op_base(){ - return 2.0*_size*_size; - } - -- inline void initialize( void ){ -- -+ void initialize() { - Interface::copy_matrix(A_ref,A,_size); - Interface::copy_vector(B_ref,B,_size); - Interface::copy_vector(X_ref,X,_size); -- -- } -- -- inline void calculate( void ) { -- -- Interface::matrix_vector_product(A,B,X,_size); -- - } - -- void check_result( void ){ -- -- // calculation check -- -- Interface::vector_to_stl(X,resu_stl); -- -- STL_interface<typename Interface::real_type>::matrix_vector_product(A_stl,B_stl,X_stl,_size); -- -- typename Interface::real_type error= -- STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl); -- -- if (error>1.e-6){ -- INFOS("WRONG CALCULATION...residual=" << error); -- exit(0); -- } -- -+ inline void calculate() { -+ Interface::matrix_vector_product(A,B,X,_size); - } - --private : -+ void check_result(); - -+private: - typename Interface::stl_matrix A_stl; - typename Interface::stl_vector B_stl; - typename Interface::stl_vector X_stl; -@@ -142,13 +73,71 @@ - typename Interface::gene_vector B; - typename Interface::gene_vector X; - -- - int _size; -- - }; -- - --#endif - -+/* -+ * Implementation -+ */ -+template<class Interface> -+Action_matrix_vector_product<Interface>::Action_matrix_vector_product( int size ) -+ : _size(size) -+{ -+ MESSAGE("Action_matrix_vector_product Ctor"); -+ -+ // STL matrix and vector initialization -+ -+ init_matrix<pseudo_random>(A_stl,_size); -+ init_vector<pseudo_random>(B_stl,_size); -+ init_vector<null_function>(X_stl,_size); -+ init_vector<null_function>(resu_stl,_size); -+ -+ // generic matrix and vector initialization -+ -+ Interface::matrix_from_stl(A_ref,A_stl); -+ Interface::vector_from_stl(B_ref,B_stl); -+ Interface::vector_from_stl(X_ref,X_stl); -+ -+ Interface::matrix_from_stl(A,A_stl); -+ Interface::vector_from_stl(B,B_stl); -+ Interface::vector_from_stl(X,X_stl); -+ -+} -+ -+template<class Interface> -+Action_matrix_vector_product<Interface>::~Action_matrix_vector_product() -+{ -+ -+ MESSAGE("Action_matrix_vector_product Dtor"); -+ -+ // deallocation -+ -+ Interface::free_matrix(A,_size); -+ Interface::free_vector(B); -+ Interface::free_vector(X); -+ -+ Interface::free_matrix(A_ref,_size); -+ Interface::free_vector(B_ref); -+ Interface::free_vector(X_ref); -+ -+} -+ -+template<class Interface> -+void Action_matrix_vector_product<Interface>::check_result() -+{ -+ // calculation check -+ Interface::vector_to_stl(X,resu_stl); -+ -+ STL_interface<typename Interface::real_type>::matrix_vector_product(A_stl,B_stl,X_stl,_size); -+ -+ typename Interface::real_type error= -+ STL_interface<typename Interface::real_type>::norm_diff(X_stl,resu_stl); - -+ if (error>1.e-6){ -+ INFOS("WRONG CALCULATION...residual=" << error); -+ exit(0); -+ } -+} - -+#endif -diff -Nur BTL-20030124/data/aat.hh BTL/data/aat.hh ---- BTL-20030124/data/aat.hh 2002-12-04 15:06:08.000000000 +0100 -+++ BTL/data/aat.hh 2003-12-07 19:31:27.000000000 +0100 -@@ -1,21 +1,21 @@ - #!/usr/bin/gnuplot -persist - # --# -+# - # G N U P L O T - # Linux version 3.7 - # patchlevel 0 - # last modified Thu Jan 14 19:34:53 BST 1999 --# -+# - # Copyright(C) 1986 - 1993, 1998, 1999 - # Thomas Williams, Colin Kelley and many others --# -+# - # Type `help` to access the on-line reference manual - # The gnuplot FAQ is available from - # <http://www.uni-karlsruhe.de/~ig25/gnuplot-faq/> --# -+# - # Send comments and requests for help to <info-gnuplot@dartmouth.edu> - # Send bugs, suggestions and mods to <bug-gnuplot@dartmouth.edu> --# -+# - # set terminal postscript landscape noenhanced monochrome dashed defaultplex "Helvetica" 14 - # set output 'bench_gcc.ps' - set noclip points -@@ -76,9 +76,9 @@ - set mytics default - set mx2tics default - set my2tics default --set xtics border mirror norotate autofreq --set ytics border mirror norotate autofreq --set ztics border nomirror norotate autofreq -+set xtics border mirror norotate autofreq -+set ytics border mirror norotate autofreq -+set ztics border nomirror norotate autofreq - set nox2tics - set noy2tics - set title "A x At product " 0.000000,0.000000 "" -@@ -104,5 +104,5 @@ - set rmargin -1 - set tmargin -1 - set locale "C" --set xrange [10:1000] -+set xrange [1:100] - ##set yrange [0:400] -diff -Nur BTL-20030124/data/ata.hh BTL/data/ata.hh ---- BTL-20030124/data/ata.hh 2002-12-04 15:06:08.000000000 +0100 -+++ BTL/data/ata.hh 2003-12-07 19:31:36.000000000 +0100 -@@ -1,21 +1,21 @@ - #!/usr/bin/gnuplot -persist - # --# -+# - # G N U P L O T - # Linux version 3.7 - # patchlevel 0 - # last modified Thu Jan 14 19:34:53 BST 1999 --# -+# - # Copyright(C) 1986 - 1993, 1998, 1999 - # Thomas Williams, Colin Kelley and many others --# -+# - # Type `help` to access the on-line reference manual - # The gnuplot FAQ is available from - # <http://www.uni-karlsruhe.de/~ig25/gnuplot-faq/> --# -+# - # Send comments and requests for help to <info-gnuplot@dartmouth.edu> - # Send bugs, suggestions and mods to <bug-gnuplot@dartmouth.edu> --# -+# - # set terminal postscript landscape noenhanced monochrome dashed defaultplex "Helvetica" 14 - # set output 'bench_gcc.ps' - set noclip points -@@ -76,9 +76,9 @@ - set mytics default - set mx2tics default - set my2tics default --set xtics border mirror norotate autofreq --set ytics border mirror norotate autofreq --set ztics border nomirror norotate autofreq -+set xtics border mirror norotate autofreq -+set ytics border mirror norotate autofreq -+set ztics border nomirror norotate autofreq - set nox2tics - set noy2tics - set title "At x A product " 0.000000,0.000000 "" -@@ -104,5 +104,5 @@ - set rmargin -1 - set tmargin -1 - set locale "C" --set xrange [10:1000] -+set xrange [1:100] - ##set yrange [0:400] -diff -Nur BTL-20030124/data/axpy.hh BTL/data/axpy.hh ---- BTL-20030124/data/axpy.hh 2003-01-06 11:07:11.000000000 +0100 -+++ BTL/data/axpy.hh 2003-11-15 07:06:46.000000000 +0100 -@@ -1,21 +1,21 @@ - #!/usr/bin/gnuplot -persist - # --# -+# - # G N U P L O T - # Linux version 3.7 - # patchlevel 0 - # last modified Thu Jan 14 19:34:53 BST 1999 --# -+# - # Copyright(C) 1986 - 1993, 1998, 1999 - # Thomas Williams, Colin Kelley and many others --# -+# - # Type `help` to access the on-line reference manual - # The gnuplot FAQ is available from - # <http://www.uni-karlsruhe.de/~ig25/gnuplot-faq/> --# -+# - # Send comments and requests for help to <info-gnuplot@dartmouth.edu> - # Send bugs, suggestions and mods to <bug-gnuplot@dartmouth.edu> --# -+# - # set terminal postscript landscape noenhanced monochrome dashed defaultplex "Helvetica" 14 - # set output 'bench_gcc.ps' - set noclip points -@@ -76,9 +76,9 @@ - set mytics default - set mx2tics default - set my2tics default --set xtics border mirror norotate autofreq --set ytics border mirror norotate autofreq --set ztics border nomirror norotate autofreq -+set xtics border mirror norotate autofreq -+set ytics border mirror norotate autofreq -+set ztics border nomirror norotate autofreq - set nox2tics - set noy2tics - set title "Y+=alpha*X " 0.000000,0.000000 "" -@@ -104,5 +104,5 @@ - set rmargin -1 - set tmargin -1 - set locale "C" --set xrange [1:1000000] -+set xrange [1:100] - ##set yrange [0:550] -diff -Nur BTL-20030124/data/matrix_matrix.hh BTL/data/matrix_matrix.hh ---- BTL-20030124/data/matrix_matrix.hh 2003-01-06 11:08:38.000000000 +0100 -+++ BTL/data/matrix_matrix.hh 2003-11-15 07:06:16.000000000 +0100 -@@ -1,21 +1,21 @@ - #!/usr/bin/gnuplot -persist - # --# -+# - # G N U P L O T - # Linux version 3.7 - # patchlevel 0 - # last modified Thu Jan 14 19:34:53 BST 1999 --# -+# - # Copyright(C) 1986 - 1993, 1998, 1999 - # Thomas Williams, Colin Kelley and many others --# -+# - # Type `help` to access the on-line reference manual - # The gnuplot FAQ is available from - # <http://www.uni-karlsruhe.de/~ig25/gnuplot-faq/> --# -+# - # Send comments and requests for help to <info-gnuplot@dartmouth.edu> - # Send bugs, suggestions and mods to <bug-gnuplot@dartmouth.edu> --# -+# - # set terminal postscript landscape noenhanced monochrome dashed defaultplex "Helvetica" 14 - # set output 'bench_gcc.ps' - set noclip points -@@ -76,9 +76,9 @@ - set mytics default - set mx2tics default - set my2tics default --set xtics border mirror norotate autofreq --set ytics border mirror norotate autofreq --set ztics border nomirror norotate autofreq -+set xtics border mirror norotate autofreq -+set ytics border mirror norotate autofreq -+set ztics border nomirror norotate autofreq - set nox2tics - set noy2tics - set title "matrix matrix product " 0.000000,0.000000 "" -@@ -104,5 +104,5 @@ - set rmargin -1 - set tmargin -1 - set locale "C" --set xrange [1:1000] -+set xrange [1:100] - ##set yrange [0:400] -diff -Nur BTL-20030124/data/matrix_vector.hh BTL/data/matrix_vector.hh ---- BTL-20030124/data/matrix_vector.hh 2003-01-06 11:08:29.000000000 +0100 -+++ BTL/data/matrix_vector.hh 2003-11-15 07:06:24.000000000 +0100 -@@ -1,21 +1,21 @@ - #!/usr/bin/gnuplot -persist - # --# -+# - # G N U P L O T - # Linux version 3.7 - # patchlevel 0 - # last modified Thu Jan 14 19:34:53 BST 1999 --# -+# - # Copyright(C) 1986 - 1993, 1998, 1999 - # Thomas Williams, Colin Kelley and many others --# -+# - # Type `help` to access the on-line reference manual - # The gnuplot FAQ is available from - # <http://www.uni-karlsruhe.de/~ig25/gnuplot-faq/> --# -+# - # Send comments and requests for help to <info-gnuplot@dartmouth.edu> - # Send bugs, suggestions and mods to <bug-gnuplot@dartmouth.edu> --# -+# - # set terminal postscript landscape noenhanced monochrome dashed defaultplex "Helvetica" 14 - # set output 'bench_gcc.ps' - set noclip points -@@ -76,9 +76,9 @@ - set mytics default - set mx2tics default - set my2tics default --set xtics border mirror norotate autofreq --set ytics border mirror norotate autofreq --set ztics border nomirror norotate autofreq -+set xtics border mirror norotate autofreq -+set ytics border mirror norotate autofreq -+set ztics border nomirror norotate autofreq - set nox2tics - set noy2tics - set title "matrix vector product " 0.000000,0.000000 "" -@@ -104,5 +104,5 @@ - set rmargin -1 - set tmargin -1 - set locale "C" --set xrange [1:1000] -+set xrange [1:100] - ##set yrange [0:400] -diff -Nur BTL-20030124/data/mk_gnuplot_script.sh BTL/data/mk_gnuplot_script.sh ---- BTL-20030124/data/mk_gnuplot_script.sh 2003-01-10 11:52:01.000000000 +0100 -+++ BTL/data/mk_gnuplot_script.sh 2003-11-30 14:56:49.000000000 +0100 -@@ -26,8 +26,8 @@ - BASE=${LAST##*/} ; BASE=${FILE##*/} ; AVANT=bench_${WHAT}_ ; REDUC=${BASE##*$AVANT} ; TITLE=${REDUC%.dat} - echo "'"$LAST"'" title "'"$TITLE"'" >> $WHAT.gnuplot - --#echo set term postscript color >> $WHAT.gnuplot --#echo set output "'"$WHAT.ps"'" >> $WHAT.gnuplot -+echo set term postscript color >> $WHAT.gnuplot -+echo set output "'"$WHAT.ps"'" >> $WHAT.gnuplot - echo set term pbm small color >> $WHAT.gnuplot - echo set output "'"$WHAT.ppm"'" >> $WHAT.gnuplot - echo plot \\ >> $WHAT.gnuplot -@@ -62,7 +62,3 @@ - gnuplot -persist < $WHAT.gnuplot - - rm $WHAT.gnuplot -- -- -- -- -diff -Nur BTL-20030124/data/mk_mean_script.sh BTL/data/mk_mean_script.sh ---- BTL-20030124/data/mk_mean_script.sh 2003-01-21 16:57:53.000000000 +0100 -+++ BTL/data/mk_mean_script.sh 2003-11-30 15:10:01.000000000 +0100 -@@ -10,7 +10,7 @@ - mkdir $WORK_DIR - - DATA_FILE=`find $DIR -name "*.dat" | grep _${WHAT}` --echo -+echo - for FILE in $DATA_FILE - do - ##echo hello world -@@ -19,7 +19,7 @@ - - ##echo "mk_mean_script1" ${TITLE} - cp $FILE ${WORK_DIR}/${TITLE} -- -+ - done - - cd $WORK_DIR -@@ -29,11 +29,3 @@ - cd .. - - rm -R $WORK_DIR -- -- -- -- -- -- -- -- -diff -Nur BTL-20030124/data/mk_new_gnuplot.sh BTL/data/mk_new_gnuplot.sh ---- BTL-20030124/data/mk_new_gnuplot.sh 2003-01-10 12:02:58.000000000 +0100 -+++ BTL/data/mk_new_gnuplot.sh 2003-11-30 15:58:09.000000000 +0100 -@@ -5,6 +5,7 @@ - - DATA_FILE=`cat ../order_lib` - -+echo set grid xtics ytics mxtics mytics >> $WHAT.gnuplot - echo plot \\ >> $WHAT.gnuplot - - for FILE in $DATA_FILE -@@ -12,7 +13,21 @@ - LAST=$FILE - done - -+# GUI plot -+for FILE in $DATA_FILE -+do -+ if [ $FILE != $LAST ] -+ then -+ echo "'"$FILE"'" ",\\" >> $WHAT.gnuplot -+ fi -+done -+echo "'"$LAST"'" >> $WHAT.gnuplot - -+# postscript plot -+echo set size 2,1.412 >> $WHAT.gnuplot -+echo set terminal postscript eps color \"Arial\" 24 >> $WHAT.gnuplot -+echo set output "'"../${DIR}/$WHAT.eps"'" >> $WHAT.gnuplot -+echo plot \\ >> $WHAT.gnuplot - for FILE in $DATA_FILE - do - if [ $FILE != $LAST ] -@@ -22,10 +37,9 @@ - done - echo "'"$LAST"'" >> $WHAT.gnuplot - --echo set term postscript color >> $WHAT.gnuplot --echo set output "'"../${DIR}/$WHAT.ps"'" >> $WHAT.gnuplot --#echo set term pbm color >> $WHAT.gnuplot --#echo set output "'"../${DIR}/$WHAT.ppm"'" >> $WHAT.gnuplot -+# png plot -+echo set terminal png small color >> $WHAT.gnuplot -+echo set output "'"../${DIR}/$WHAT.png"'" >> $WHAT.gnuplot - echo plot \\ >> $WHAT.gnuplot - for FILE in $DATA_FILE - do -@@ -39,7 +53,3 @@ - gnuplot -persist < $WHAT.gnuplot - - rm $WHAT.gnuplot -- -- -- -- -diff -Nur BTL-20030124/data/order_lib BTL/data/order_lib ---- BTL-20030124/data/order_lib 1970-01-01 01:00:00.000000000 +0100 -+++ BTL/data/order_lib 2003-12-07 19:31:44.000000000 +0100 -@@ -0,0 +1,7 @@ -+ATLAS -+C -+ublas -+f77 -+tvmet -+STL -+blitz -diff -Nur BTL-20030124/generic_bench/bench.hh BTL/generic_bench/bench.hh ---- BTL-20030124/generic_bench/bench.hh 2003-03-08 22:40:23.000000000 +0100 -+++ BTL/generic_bench/bench.hh 2003-11-12 19:57:27.000000000 +0100 -@@ -1,14 +1,14 @@ - //===================================================== - // File : bench.hh --// Author : L. Plagne <laurent.plagne@edf.fr)> -+// Author : L. Plagne <laurent.plagne@edf.fr)> - // Copyright (C) EDF R&D, lun sep 30 14:23:16 CEST 2002 - //===================================================== --// -+// - // This program is free software; you can redistribute it and/or - // modify it under the terms of the GNU General Public License - // as published by the Free Software Foundation; either version 2 - // of the License, or (at your option) any later version. --// -+// - // This program is distributed in the hope that it will be useful, - // but WITHOUT ANY WARRANTY; without even the implied warranty of - // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -@@ -16,7 +16,7 @@ - // You should have received a copy of the GNU General Public License - // along with this program; if not, write to the Free Software - // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --// -+// - #ifndef BENCH_HH - #define BENCH_HH - #include "bench_parameter.hh" -@@ -31,58 +31,47 @@ - //#include "timers/x86_perf_analyzer.hh" - //#include "timers/STL_perf_analyzer.hh" - --using namespace std; -- --template <template<class> class Perf_Analyzer, class Action> --void bench( int size_min, int size_max, int nb_point ){ -- -- // bench name -- -- string filename="bench_"+Action::name()+".dat"; -+template < -+ template<class> class Perf_Analyzer, -+ class Action -+> -+void bench(int size_min, int size_max, int nb_point) { -+ // bench name -+ std::string filename="bench_" + Action::name() + ".dat"; - - INFOS("starting " <<filename); - -- // utilities -- -+ // utilities - std::vector<double> tab_mflops(nb_point); - std::vector<int> tab_sizes(nb_point); - - // matrices and vector size calculations -- -- size_lin_log(nb_point,size_min,size_max,tab_sizes); -+ size_lin_log(nb_point, size_min, size_max, tab_sizes); - - // loop on matrix size -- - Perf_Analyzer<Action> perf_action; - -- for (int i=nb_point-1;i>=0;i--){ -- -+ for (int i = nb_point-1; i >= 0; i--) { - INFOS("size=" <<tab_sizes[i]<<" ("<<nb_point-i<<"/"<<nb_point<<")"); - tab_mflops[i]= perf_action.eval_mflops(tab_sizes[i]); -- - } - - // dump the result in a file : -- - dump_file_x_y(tab_sizes,tab_mflops,filename); -- - } - - // default Perf Analyzer -- - template <class Action> --void bench( int size_min, int size_max, int nb_point ){ -+void bench(int size_min, int size_max, int nb_point) { - - // if the rdtsc is not available : -- bench<Portable_Perf_Analyzer,Action>(size_min,size_max,nb_point); -+ bench<Portable_Perf_Analyzer,Action>(size_min, size_max, nb_point); - // if the rdtsc is available : -- // bench<Mixed_Perf_Analyzer,Action>(size_min,size_max,nb_point); -- -+ // bench<Mixed_Perf_Analyzer,Action>(size_min,size_max,nb_point); - - // Only for small problem size. Otherwize it will be too long -- //bench<X86_Perf_Analyzer,Action>(size_min,size_max,nb_point); -- //bench<STL_Perf_Analyzer,Action>(size_min,size_max,nb_point); -- -+ // bench<X86_Perf_Analyzer,Action>(size_min,size_max,nb_point); -+ // bench<STL_Perf_Analyzer,Action>(size_min,size_max,nb_point); - } - - #endif -diff -Nur BTL-20030124/generic_bench/bench.hh~ BTL/generic_bench/bench.hh~ ---- BTL-20030124/generic_bench/bench.hh~ 2003-03-13 15:36:19.000000000 +0100 -+++ BTL/generic_bench/bench.hh~ 1970-01-01 01:00:00.000000000 +0100 -@@ -1,88 +0,0 @@ --//===================================================== --// File : bench.hh --// Author : L. Plagne <laurent.plagne@edf.fr)> --// Copyright (C) EDF R&D, lun sep 30 14:23:16 CEST 2002 --//===================================================== --// --// This program is free software; you can redistribute it and/or --// modify it under the terms of the GNU General Public License --// as published by the Free Software Foundation; either version 2 --// of the License, or (at your option) any later version. --// --// This program is distributed in the hope that it will be useful, --// but WITHOUT ANY WARRANTY; without even the implied warranty of --// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --// GNU General Public License for more details. --// You should have received a copy of the GNU General Public License --// along with this program; if not, write to the Free Software --// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --// --#ifndef BENCH_HH --#define BENCH_HH --#include "bench_parameter.hh" --#include <iostream> --#include "utilities.h" --#include "size_lin_log.hh" --#include "dump_file_x_y.hh" --#include <vector> --#include <string> --#include "timers/portable_perf_analyzer.hh" --#include "timers/mixed_perf_analyzer.hh" --#include "timers/x86_perf_analyzer.hh" --#include "timers/STL_perf_analyzer.hh" -- --using namespace std; -- --template <template<class> class Perf_Analyzer, class Action> --void bench( int size_min, int size_max, int nb_point ){ -- -- // bench name -- -- string filename="bench_"+Action::name()+".dat"; -- -- INFOS("starting " <<filename); -- -- // utilities -- -- std::vector<double> tab_mflops(nb_point); -- std::vector<int> tab_sizes(nb_point); -- -- // matrices and vector size calculations -- -- size_lin_log(nb_point,size_min,size_max,tab_sizes); -- -- // loop on matrix size -- -- Perf_Analyzer<Action> perf_action; -- -- for (int i=nb_point-1;i>=0;i--){ -- -- INFOS("size=" <<tab_sizes[i]<<" ("<<nb_point-i<<"/"<<nb_point<<")"); -- tab_mflops[i]= perf_action.eval_mflops(tab_sizes[i]); -- -- } -- -- // dump the result in a file : -- -- dump_file_x_y(tab_sizes,tab_mflops,filename); -- --} -- --// default Perf Analyzer -- --template <class Action> --void bench( int size_min, int size_max, int nb_point ){ -- -- // if the rdtsc is not available : -- //bench<Portable_Perf_Analyzer,Action>(size_min,size_max,nb_point); -- // if the rdtsc is available : -- bench<Mixed_Perf_Analyzer,Action>(size_min,size_max,nb_point); -- -- -- // Only for small problem size. Otherwize it will be too long -- //bench<X86_Perf_Analyzer,Action>(size_min,size_max,nb_point); -- //bench<STL_Perf_Analyzer,Action>(size_min,size_max,nb_point); -- --} -- --#endif -diff -Nur BTL-20030124/generic_bench/bench_parameter.hh BTL/generic_bench/bench_parameter.hh ---- BTL-20030124/generic_bench/bench_parameter.hh 2003-03-17 14:42:37.000000000 +0100 -+++ BTL/generic_bench/bench_parameter.hh 2003-11-13 21:37:12.000000000 +0100 -@@ -1,14 +1,14 @@ - //===================================================== - // File : bench_parameter.hh --// Author : L. Plagne <laurent.plagne@edf.fr)> -+// Author : L. Plagne <laurent.plagne@edf.fr)> - // Copyright (C) EDF R&D, lun sep 30 14:23:16 CEST 2002 - //===================================================== --// -+// - // This program is free software; you can redistribute it and/or - // modify it under the terms of the GNU General Public License - // as published by the Free Software Foundation; either version 2 - // of the License, or (at your option) any later version. --// -+// - // This program is distributed in the hope that it will be useful, - // but WITHOUT ANY WARRANTY; without even the implied warranty of - // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -@@ -16,34 +16,34 @@ - // You should have received a copy of the GNU General Public License - // along with this program; if not, write to the Free Software - // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --// -+// - #ifndef BENCH_PARAMETER_HH - #define BENCH_PARAMETER_HH - - // minimal time for each measurement - #define REAL_TYPE double - // minimal time for each measurement --#define MIN_TIME 2.0 -+#define MIN_TIME 2.0 - // nb of point on bench curves --#define NB_POINT 100 -+#define NB_POINT 20 - // min vector size for axpy bench - #define MIN_AXPY 20 - // max vector size for axpy bench --#define MAX_AXPY 1000000 -+#define MAX_AXPY 100 - // min matrix size for matrix vector product bench --#define MIN_MV 10 -+#define MIN_MV 1 - // max matrix size for matrix vector product bench --#define MAX_MV 1000 -+#define MAX_MV 100 - // min matrix size for matrix matrix product bench --#define MIN_MM 10 -+#define MIN_MM 1 - // max matrix size for matrix matrix product bench --#define MAX_MM 1000 -+#define MAX_MM 100 - // min matrix size for LU bench --#define MIN_LU 10 -+#define MIN_LU 1 - // max matrix size for LU bench --#define MAX_LU 1000 -+#define MAX_LU 100 - // max size for tiny vector and matrix --#define TINY_MV_MAX_SIZE 5 -+#define TINY_MV_MAX_SIZE 10 - // default nb_sample for x86 timer - #define DEFAULT_NB_SAMPLE 1000 - -diff -Nur BTL-20030124/generic_bench/bench_parameter.hh~ BTL/generic_bench/bench_parameter.hh~ ---- BTL-20030124/generic_bench/bench_parameter.hh~ 2003-03-08 22:39:52.000000000 +0100 -+++ BTL/generic_bench/bench_parameter.hh~ 1970-01-01 01:00:00.000000000 +0100 -@@ -1,52 +0,0 @@ --//===================================================== --// File : bench_parameter.hh --// Author : L. Plagne <laurent.plagne@edf.fr)> --// Copyright (C) EDF R&D, lun sep 30 14:23:16 CEST 2002 --//===================================================== --// --// This program is free software; you can redistribute it and/or --// modify it under the terms of the GNU General Public License --// as published by the Free Software Foundation; either version 2 --// of the License, or (at your option) any later version. --// --// This program is distributed in the hope that it will be useful, --// but WITHOUT ANY WARRANTY; without even the implied warranty of --// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --// GNU General Public License for more details. --// You should have received a copy of the GNU General Public License --// along with this program; if not, write to the Free Software --// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --// --#ifndef BENCH_PARAMETER_HH --#define BENCH_PARAMETER_HH -- --// minimal time for each measurement --#define REAL_TYPE double --// minimal time for each measurement --#define MIN_TIME 2.0 --// nb of point on bench curves --#define NB_POINT 100 --// min vector size for axpy bench --#define MIN_AXPY 20 --// max vector size for axpy bench --#define MAX_AXPY 1000000 --// min matrix size for matrix vector product bench --#define MIN_MV 10 --// max matrix size for matrix vector product bench --#define MAX_MV 1000 --// min matrix size for matrix matrix product bench --#define MIN_MM 10 --// max matrix size for matrix matrix product bench --#define MAX_MM 1000 --// min matrix size for LU bench --#define MIN_LU 10 --// max matrix size for LU bench --#define MAX_LU 1000 --// max size for tiny vector and matrix --#define TINY_MV_MAX_SIZE 10 --// default nb_sample for x86 timer --#define DEFAULT_NB_SAMPLE 1000 -- -- -- --#endif -diff -Nur BTL-20030124/generic_bench/init/init_function.hh BTL/generic_bench/init/init_function.hh ---- BTL-20030124/generic_bench/init/init_function.hh 2002-11-21 16:04:06.000000000 +0100 -+++ BTL/generic_bench/init/init_function.hh 2003-10-31 21:41:10.000000000 +0100 -@@ -1,14 +1,14 @@ - //===================================================== - // File : init_function.hh --// Author : L. Plagne <laurent.plagne@edf.fr)> -+// Author : L. Plagne <laurent.plagne@edf.fr)> - // Copyright (C) EDF R&D, lun sep 30 14:23:18 CEST 2002 - //===================================================== --// -+// - // This program is free software; you can redistribute it and/or - // modify it under the terms of the GNU General Public License - // as published by the Free Software Foundation; either version 2 - // of the License, or (at your option) any later version. --// -+// - // This program is distributed in the hope that it will be useful, - // but WITHOUT ANY WARRANTY; without even the implied warranty of - // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -@@ -16,7 +16,7 @@ - // You should have received a copy of the GNU General Public License - // along with this program; if not, write to the Free Software - // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --// -+// - #ifndef INIT_FUNCTION_HH - #define INIT_FUNCTION_HH - -@@ -30,24 +30,24 @@ - return index_i+index_j; - } - --double pseudo_random(int index) -+double pseudo_random(int /* index */) - { - // INFOS("random="<<(std::rand()/double(RAND_MAX))); - return std::rand()/double(RAND_MAX); - } - --double pseudo_random(int index_i, int index_j) -+double pseudo_random(int /* index_i */, int /* index_j */) - { - return std::rand()/double(RAND_MAX); - } - - --double null_function(int index) -+double null_function(int /* index */) - { - return 0.0; - } - --double null_function(int index_i, int index_j) -+double null_function(int /* index_i */, int /* index_j */) - { - return 0.0; - } -diff -Nur BTL-20030124/generic_bench/init/init_matrix.hh BTL/generic_bench/init/init_matrix.hh ---- BTL-20030124/generic_bench/init/init_matrix.hh 2002-11-21 16:04:06.000000000 +0100 -+++ BTL/generic_bench/init/init_matrix.hh 2003-11-02 11:44:15.000000000 +0100 -@@ -1,14 +1,14 @@ - //===================================================== - // File : init_matrix.hh --// Author : L. Plagne <laurent.plagne@edf.fr)> -+// Author : L. Plagne <laurent.plagne@edf.fr)> - // Copyright (C) EDF R&D, lun sep 30 14:23:19 CEST 2002 - //===================================================== --// -+// - // This program is free software; you can redistribute it and/or - // modify it under the terms of the GNU General Public License - // as published by the Free Software Foundation; either version 2 - // of the License, or (at your option) any later version. --// -+// - // This program is distributed in the hope that it will be useful, - // but WITHOUT ANY WARRANTY; without even the implied warranty of - // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -@@ -16,7 +16,7 @@ - // You should have received a copy of the GNU General Public License - // along with this program; if not, write to the Free Software - // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --// -+// - #ifndef INIT_MATRIX_HH - #define INIT_MATRIX_HH - -@@ -29,7 +29,7 @@ - - X.resize(size); - -- for (int j=0;j<X.size();j++){ -+ for (unsigned j=0;j<X.size();j++){ - X[j]=typename Vector::value_type(init_function(row,j)); - } - } -@@ -43,11 +43,11 @@ - void init_matrix(Vector & A, int size){ - - A.resize(size); -- for (int row=0; row<A.size() ; row++){ -+ for (unsigned row=0; row<A.size() ; row++){ - init_row<init_function>(A[row],size,row); - } -- -- -+ -+ - } - - #endif -diff -Nur BTL-20030124/generic_bench/init/init_vector.hh BTL/generic_bench/init/init_vector.hh ---- BTL-20030124/generic_bench/init/init_vector.hh 2002-11-21 16:04:06.000000000 +0100 -+++ BTL/generic_bench/init/init_vector.hh 2003-11-11 19:30:52.000000000 +0100 -@@ -1,14 +1,14 @@ - //===================================================== - // File : init_vector.hh --// Author : L. Plagne <laurent.plagne@edf.fr)> -+// Author : L. Plagne <laurent.plagne@edf.fr)> - // Copyright (C) EDF R&D, lun sep 30 14:23:18 CEST 2002 - //===================================================== --// -+// - // This program is free software; you can redistribute it and/or - // modify it under the terms of the GNU General Public License - // as published by the Free Software Foundation; either version 2 - // of the License, or (at your option) any later version. --// -+// - // This program is distributed in the hope that it will be useful, - // but WITHOUT ANY WARRANTY; without even the implied warranty of - // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -@@ -16,7 +16,7 @@ - // You should have received a copy of the GNU General Public License - // along with this program; if not, write to the Free Software - // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --// -+// - #ifndef INIT_VECTOR_HH - #define INIT_VECTOR_HH - -@@ -29,7 +29,7 @@ - - X.resize(size); - -- for (int i=0;i<X.size();i++){ -+ for (unsigned i=0;i<X.size();i++){ - X[i]=typename Vector::value_type(init_function(i)); - } - } -diff -Nur BTL-20030124/generic_bench/static/bench_static.hh BTL/generic_bench/static/bench_static.hh ---- BTL-20030124/generic_bench/static/bench_static.hh 2003-01-24 16:22:02.000000000 +0100 -+++ BTL/generic_bench/static/bench_static.hh 2003-11-13 21:10:29.000000000 +0100 -@@ -1,14 +1,14 @@ - //===================================================== - // File : bench_static.hh --// Author : L. Plagne <laurent.plagne@edf.fr)> -+// Author : L. Plagne <laurent.plagne@edf.fr)> - // Copyright (C) EDF R&D, lun sep 30 14:23:16 CEST 2002 - //===================================================== --// -+// - // This program is free software; you can redistribute it and/or - // modify it under the terms of the GNU General Public License - // as published by the Free Software Foundation; either version 2 - // of the License, or (at your option) any later version. --// -+// - // This program is distributed in the hope that it will be useful, - // but WITHOUT ANY WARRANTY; without even the implied warranty of - // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -@@ -16,7 +16,7 @@ - // You should have received a copy of the GNU General Public License - // along with this program; if not, write to the Free Software - // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --// -+// - #ifndef BENCH_STATIC_HH - #define BENCH_STATIC_HH - #include "bench_parameter.hh" -@@ -28,51 +28,41 @@ - #include "timers/mixed_perf_analyzer.hh" - #include "timers/x86_perf_analyzer.hh" - --using namespace std; -- -- --template <template<class> class Perf_Analyzer, template<class> class Action, template<class,int> class Interface> --void bench_static( void ){ -- -- string filename="bench_"+Action<Interface<REAL_TYPE,10> >::name()+".dat"; -+template < -+ template<class> class Perf_Analyzer, -+ template<class> class Action, -+ template<class, int> class Interface, -+ unsigned Sz -+> -+void bench_static() -+{ -+ std::string filename="bench_" + Action<Interface<REAL_TYPE,10> >::name() + ".dat"; - - INFOS("starting " <<filename); - -- const int max_size=TINY_MV_MAX_SIZE; -- - std::vector<double> tab_mflops; - std::vector<double> tab_sizes; - -- static_size_generator<max_size,Perf_Analyzer,Action,Interface>::go(tab_sizes,tab_mflops); -- -- dump_file_x_y(tab_sizes,tab_mflops,filename); -+ static_size_generator<Sz, Perf_Analyzer, Action, Interface>::go(tab_sizes, tab_mflops); - -+ dump_file_x_y(tab_sizes, tab_mflops, filename); - } - - // default Perf Analyzer -+template < -+ template<class> class Action, -+ template<class, int> class Interface, -+ unsigned Sz -+> -+void bench_static() -+{ -+ // if the rdtsc is not available : -+ bench_static<Portable_Perf_Analyzer, Action, Interface, Sz>(); -+ // if the rdtsc is available : -+ // bench_static<Mixed_Perf_Analyzer,Action,Interface, Sz>(); - --template <template<class> class Action, template<class,int> class Interface> --void bench_static( void ){ -- -- bench_static<Portable_Perf_Analyzer,Action,Interface>(); -- //bench_static<Mixed_Perf_Analyzer,Action,Interface>(); -- //bench_static<X86_Perf_Analyzer,Action,Interface>(); -- -+ // Only for small problem size. Otherwize it will be too long -+ // bench_static<X86_Perf_Analyzer,Action,Interface, Sz>(); - } - - #endif -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -diff -Nur BTL-20030124/generic_bench/static/static_size_generator.hh BTL/generic_bench/static/static_size_generator.hh ---- BTL-20030124/generic_bench/static/static_size_generator.hh 2003-01-09 14:33:50.000000000 +0100 -+++ BTL/generic_bench/static/static_size_generator.hh 2003-11-12 18:26:52.000000000 +0100 -@@ -1,14 +1,14 @@ - //===================================================== - // File : static_size_generator.hh --// Author : L. Plagne <laurent.plagne@edf.fr)> -+// Author : L. Plagne <laurent.plagne@edf.fr)> - // Copyright (C) EDF R&D, mar déc 3 18:59:36 CET 2002 - //===================================================== --// -+// - // This program is free software; you can redistribute it and/or - // modify it under the terms of the GNU General Public License - // as published by the Free Software Foundation; either version 2 - // of the License, or (at your option) any later version. --// -+// - // This program is distributed in the hope that it will be useful, - // but WITHOUT ANY WARRANTY; without even the implied warranty of - // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -@@ -16,41 +16,47 @@ - // You should have received a copy of the GNU General Public License - // along with this program; if not, write to the Free Software - // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --// -+// - #ifndef _STATIC_SIZE_GENERATOR_HH - #define _STATIC_SIZE_GENERATOR_HH --#include <vector> - --using namespace std; -+#include <vector> - - //recursive generation of statically defined matrix and vector sizes -- --template <int SIZE,template<class> class Perf_Analyzer, template<class> class Action, template<class,int> class Interface> --struct static_size_generator{ -- static void go(vector<double> & tab_sizes, vector<double> & tab_mflops) -+template < -+ int SIZE, -+ template<class> class Perf_Analyzer, -+ template<class> class Action, -+ template<class, int> class Interface -+> -+struct static_size_generator -+{ -+ static void go(std::vector<double>& tab_sizes, std::vector<double>& tab_mflops) - { - tab_sizes.push_back(SIZE); - - Perf_Analyzer<Action<Interface<REAL_TYPE,SIZE> > > perf_action; - tab_mflops.push_back(perf_action.eval_mflops(SIZE)); -- static_size_generator<SIZE-1,Perf_Analyzer,Action,Interface>::go(tab_sizes,tab_mflops); -+ -+ static_size_generator<SIZE-1, Perf_Analyzer, Action, Interface>::go(tab_sizes,tab_mflops); - }; - }; - - //recursion end -- --template <template<class> class Perf_Analyzer, template<class> class Action, template<class,int> class Interface> --struct static_size_generator<1,Perf_Analyzer,Action,Interface>{ -- static void go(vector<double> & tab_sizes, vector<double> & tab_mflops) -+template < -+ template<class> class Perf_Analyzer, -+ template<class> class Action, -+ template<class, int> class Interface -+> -+struct static_size_generator<1, Perf_Analyzer, Action, Interface> -+{ -+ static void go(std::vector<double>& tab_sizes, std::vector<double>& tab_mflops) - { - tab_sizes.push_back(1); -+ - Perf_Analyzer<Action<Interface<REAL_TYPE,1> > > perf_action; - tab_mflops.push_back(perf_action.eval_mflops(1)); - }; - }; - - #endif -- -- -- -- -diff -Nur BTL-20030124/generic_bench/timers/portable_perf_analyzer.hh BTL/generic_bench/timers/portable_perf_analyzer.hh ---- BTL-20030124/generic_bench/timers/portable_perf_analyzer.hh 2003-01-15 11:06:09.000000000 +0100 -+++ BTL/generic_bench/timers/portable_perf_analyzer.hh 2003-11-12 20:09:14.000000000 +0100 -@@ -1,14 +1,14 @@ - //===================================================== - // File : portable_perf_analyzer.hh --// Author : L. Plagne <laurent.plagne@edf.fr)> -+// Author : L. Plagne <laurent.plagne@edf.fr)> - // Copyright (C) EDF R&D, mar déc 3 18:59:35 CET 2002 - //===================================================== --// -+// - // This program is free software; you can redistribute it and/or - // modify it under the terms of the GNU General Public License - // as published by the Free Software Foundation; either version 2 - // of the License, or (at your option) any later version. --// -+// - // This program is distributed in the hope that it will be useful, - // but WITHOUT ANY WARRANTY; without even the implied warranty of - // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -@@ -16,7 +16,7 @@ - // You should have received a copy of the GNU General Public License - // along with this program; if not, write to the Free Software - // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --// -+// - #ifndef _PORTABLE_PERF_ANALYZER_HH - #define _PORTABLE_PERF_ANALYZER_HH - -@@ -24,111 +24,118 @@ - #include "timers/portable_timer.hh" - - template <class Action> --class Portable_Perf_Analyzer{ --public: -- Portable_Perf_Analyzer( void ):_nb_calc(1),_nb_init(1),_chronos(){ -- MESSAGE("Portable_Perf_Analyzer Ctor"); -- }; -- Portable_Perf_Analyzer( const Portable_Perf_Analyzer & ){ -- INFOS("Copy Ctor not implemented"); -- exit(0); -- }; -- ~Portable_Perf_Analyzer( void ){ -- MESSAGE("Portable_Perf_Analyzer Dtor"); -- }; -- -- -- -- inline double eval_mflops(int size) -- { -- -- Action action(size); -- -- double time_baseline=time_init(action); -- -- while (time_baseline < MIN_TIME) { -- -- _nb_init*=2; -- time_baseline=time_init(action); -- } -- -- time_baseline=time_baseline/(double(_nb_init)); -- -- double time_action=time_calculate(action); -- -- while (time_action < MIN_TIME) { -- -- _nb_calc*=2; -- time_action=time_calculate(action); -- } -- -- // INFOS("size="<<size); --// INFOS("_nb_init="<<_nb_init); --// INFOS("_nb_calc="<<_nb_calc); -- -- -- time_action=time_action/(double(_nb_calc)); -- -- action.check_result(); -- --// INFOS("time_baseline="<<time_baseline); --// INFOS("time_action="<<time_action); -- -- -- time_action=time_action-time_baseline; -- --// INFOS("time_corrected="<<time_action); -- -- return action.nb_op_base()/(time_action*1000000.0); -- } -+class Portable_Perf_Analyzer -+{ -+ Portable_Perf_Analyzer(const Portable_Perf_Analyzer&); - -- inline double time_init(Action & action) -- { -- -- // time measurement -- -- _chronos.start(); -- -- for (int ii=0;ii<_nb_init;ii++){ -- -- action.initialize(); -- -- } -- -- _chronos.stop(); -+public: -+ Portable_Perf_Analyzer(); - -- return _chronos.user_time(); -- } -+ ~Portable_Perf_Analyzer(); - -+ double eval_mflops(int size); - -- inline double time_calculate(Action & action){ -- -- // time measurement -- -- _chronos.start(); -- -- for (int ii=0;ii<_nb_calc;ii++){ -- -- action.initialize(); -- action.calculate(); -- -- } -- -- _chronos.stop(); -- -- return _chronos.user_time(); -- } -+ double time_init(Action& action); - -- unsigned long long get_nb_calc( void ){ -+ double time_calculate(Action& action); -+ -+ unsigned long long get_nb_calc() { - return _nb_calc; - } - -- - private: - unsigned long long _nb_calc; - unsigned long long _nb_init; - Portable_Timer _chronos; -- - }; - -+ -+/* -+ * Implementation -+ */ -+template <class Action> -+Portable_Perf_Analyzer<Action>::Portable_Perf_Analyzer() -+ : _nb_calc(1), _nb_init(1), _chronos() -+{ -+ MESSAGE("Portable_Perf_Analyzer Ctor"); -+}; -+ -+template <class Action> -+Portable_Perf_Analyzer<Action>::~Portable_Perf_Analyzer() -+{ -+ MESSAGE("Portable_Perf_Analyzer Dtor"); -+}; -+ -+template <class Action> -+double Portable_Perf_Analyzer<Action>::time_init(Action& action) -+{ -+ // time measurement -+ _chronos.start(); -+ -+ for (unsigned ii = 0; ii < _nb_init; ii++){ -+ action.initialize(); -+ } -+ -+ _chronos.stop(); -+ -+ return _chronos.user_time(); -+} -+ -+template <class Action> -+double Portable_Perf_Analyzer<Action>::time_calculate(Action& action) -+{ -+ // time measurement -+ _chronos.start(); -+ -+ for (unsigned ii = 0; ii <_nb_calc; ii++) { -+ // the measured bench self -+ action.initialize(); -+ action.calculate(); -+ } -+ -+ _chronos.stop(); -+ -+ return _chronos.user_time(); -+} -+ -+template <class Action> -+double Portable_Perf_Analyzer<Action>::eval_mflops(int size) -+{ -+ Action action(size); -+ -+ double time_baseline = time_init(action); -+ -+ while (time_baseline < MIN_TIME) { -+ _nb_init*=2; -+ time_baseline=time_init(action); -+ } -+ -+ time_baseline=time_baseline/(double(_nb_init)); -+ -+ // perform the benchmark timing -+ double time_action=time_calculate(action); -+ -+ while (time_action < MIN_TIME) { -+ _nb_calc*=2; -+ time_action=time_calculate(action); -+ } -+ -+ // INFOS("size="<<size); -+ // INFOS("_nb_init="<<_nb_init); -+ // INFOS("_nb_calc="<<_nb_calc); -+ -+ time_action=time_action/(double(_nb_calc)); -+ -+ action.check_result(); -+ -+ // INFOS("time_baseline="<<time_baseline); -+ // INFOS("time_action="<<time_action); -+ -+ time_action=time_action-time_baseline; -+ -+ // INFOS("time_corrected="<<time_action); -+ -+ return action.nb_op_base()/(time_action*1000000.0); -+} -+ - #endif //_PORTABLE_PERF_ANALYZER_HH -diff -Nur BTL-20030124/generic_bench/timers/portable_timer.hh~ BTL/generic_bench/timers/portable_timer.hh~ ---- BTL-20030124/generic_bench/timers/portable_timer.hh~ 2002-12-03 19:01:18.000000000 +0100 -+++ BTL/generic_bench/timers/portable_timer.hh~ 1970-01-01 01:00:00.000000000 +0100 -@@ -1,103 +0,0 @@ --//===================================================== --// File : portable_timer.hh --// Author : L. Plagne <laurent.plagne@edf.fr)> from boost lib --// Copyright (C) EDF R&D, lun sep 30 14:23:17 CEST 2002 --//===================================================== --// --// This program is free software; you can redistribute it and/or --// modify it under the terms of the GNU General Public License --// as published by the Free Software Foundation; either version 2 --// of the License, or (at your option) any later version. --// --// This program is distributed in the hope that it will be useful, --// but WITHOUT ANY WARRANTY; without even the implied warranty of --// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --// GNU General Public License for more details. --// You should have received a copy of the GNU General Public License --// along with this program; if not, write to the Free Software --// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --// --// simple_time extracted from the boost library --// --#ifndef _PORTABLE_TIMER_HH --#define _PORTABLE_TIMER_HH -- --#include <time.h> --#include <sys/time.h> --#include <sys/resource.h> --#include <unistd.h> --#include <sys/times.h> -- --#define USEC_IN_SEC 1000000 -- -- --// timer -------------------------------------------------------------------// -- --// A timer object measures CPU time. -- --class Portable_Timer --{ -- public: -- -- Portable_Timer( void ):_utime_sec_start(-1), -- _utime_usec_start(-1), -- _utime_sec_stop(-1), -- _utime_usec_stop(-1) -- { -- } -- -- -- void start() -- { -- -- int status=getrusage(RUSAGE_SELF, &resourcesUsage) ; -- -- _start_time = std::clock(); -- -- _utime_sec_start = resourcesUsage.ru_utime.tv_sec ; -- _utime_usec_start = resourcesUsage.ru_utime.tv_usec ; -- -- } -- -- void stop() -- { -- -- int status=getrusage(RUSAGE_SELF, &resourcesUsage) ; -- -- _stop_time = std::clock(); -- -- _utime_sec_stop = resourcesUsage.ru_utime.tv_sec ; -- _utime_usec_stop = resourcesUsage.ru_utime.tv_usec ; -- -- } -- -- double elapsed() -- { -- return double(_stop_time - _start_time) / CLOCKS_PER_SEC; -- } -- -- double user_time() -- { -- long tot_utime_sec=_utime_sec_stop-_utime_sec_start; -- long tot_utime_usec=_utime_usec_stop-_utime_usec_start; -- return double(tot_utime_sec)+ double(tot_utime_usec)/double(USEC_IN_SEC) ; -- } -- -- --private: -- -- struct rusage resourcesUsage ; -- -- long _utime_sec_start ; -- long _utime_usec_start ; -- -- long _utime_sec_stop ; -- long _utime_usec_stop ; -- -- std::clock_t _start_time; -- std::clock_t _stop_time; -- --}; // Portable_Timer -- -- --#endif // PORTABLE_TIMER_HPP -diff -Nur BTL-20030124/generic_bench/timers/x86_timer.hh BTL/generic_bench/timers/x86_timer.hh ---- BTL-20030124/generic_bench/timers/x86_timer.hh 2003-01-21 12:51:35.000000000 +0100 -+++ BTL/generic_bench/timers/x86_timer.hh 2003-10-30 19:10:04.000000000 +0100 -@@ -1,14 +1,14 @@ - //===================================================== - // File : x86_timer.hh --// Author : L. Plagne <laurent.plagne@edf.fr)> -+// Author : L. Plagne <laurent.plagne@edf.fr)> - // Copyright (C) EDF R&D, mar déc 3 18:59:35 CET 2002 - //===================================================== --// -+// - // This program is free software; you can redistribute it and/or - // modify it under the terms of the GNU General Public License - // as published by the Free Software Foundation; either version 2 - // of the License, or (at your option) any later version. --// -+// - // This program is distributed in the hope that it will be useful, - // but WITHOUT ANY WARRANTY; without even the implied warranty of - // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -@@ -16,7 +16,7 @@ - // You should have received a copy of the GNU General Public License - // along with this program; if not, write to the Free Software - // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --// -+// - #ifndef _X86_TIMER_HH - #define _X86_TIMER_HH - -@@ -46,7 +46,7 @@ - - X86_Timer( void ):_frequency(FREQUENCY),_nb_sample(0) - { -- MESSAGE("X86_Timer Default Ctor"); -+ MESSAGE("X86_Timer Default Ctor"); - } - - inline void start( void ){ -@@ -61,7 +61,7 @@ - rdtsc(_click_stop.n32[0],_click_stop.n32[1]); - - } -- -+ - - inline double frequency( void ){ - return _frequency; -@@ -72,13 +72,13 @@ - return (_click_stop.n64-_click_start.n64)/double(FREQUENCY); - - -- } -+ } - - unsigned long long get_click( void ){ -- -+ - return (_click_stop.n64-_click_start.n64); - -- } -+ } - - inline void find_frequency( void ){ - -@@ -103,70 +103,70 @@ - // INFOS("fine grained time : "<< get_elapsed_time_in_second()); - // INFOS("coarse grained time : "<< final-initial); - _frequency=_frequency*get_elapsed_time_in_second()/double(final-initial); -- /// INFOS("CPU frequency : "<< _frequency); -+ /// INFOS("CPU frequency : "<< _frequency); - - } - - void add_get_click( void ){ -- -+ - _nb_sample++; - _counted_clicks[get_click()]++; - fill_history_clicks(); - -- } -+ } - - void dump_statistics(string filemane){ -- -+ - ofstream outfile (filemane.c_str(),ios::out) ; - - std::map<unsigned long long , unsigned long long>::iterator itr; - for(itr=_counted_clicks.begin() ; itr!=_counted_clicks.end() ; itr++) -- { -- outfile << (*itr).first << " " << (*itr).second << endl ; -- } -- -+ { -+ outfile << (*itr).first << " " << (*itr).second << endl ; -+ } -+ - outfile.close(); - - } - - void dump_history(string filemane){ -- -+ - ofstream outfile (filemane.c_str(),ios::out) ; - - - -- for(int i=0 ; i<_history_mean_clicks.size() ; i++) -- { -- outfile << i << " " -- << _history_mean_clicks[i] << " " -- << _history_shortest_clicks[i] << " " -+ for(unsigned i=0 ; i<_history_mean_clicks.size() ; i++) -+ { -+ outfile << i << " " -+ << _history_mean_clicks[i] << " " -+ << _history_shortest_clicks[i] << " " - << _history_most_occured_clicks[i] << endl ; -- } -- -+ } -+ - outfile.close(); - - } -- -+ - - - double get_mean_clicks( void ){ -- -+ - std::map<unsigned long long,unsigned long long>::iterator itr; -- -+ - unsigned long long mean_clicks=0; - - for(itr=_counted_clicks.begin() ; itr!=_counted_clicks.end() ; itr++) -- { -- -+ { -+ - mean_clicks+=(*itr).second*(*itr).first; -- } -+ } - - return mean_clicks/double(_nb_sample); - - } - - double get_shortest_clicks( void ){ -- -+ - return double((*_counted_clicks.begin()).first); - - } -@@ -188,18 +188,18 @@ - std::map<unsigned long long,unsigned long long>::iterator itr; - - for(itr=_counted_clicks.begin() ; itr!=_counted_clicks.end() ; itr++) -- { -- -+ { -+ - if (max_occurence<=(*itr).second){ - max_occurence=(*itr).second; - moc=(*itr).first; - } -- } -- -- return double(moc); -+ } -+ -+ return double(moc); - - } -- -+ - void clear( void ) - { - _counted_clicks.clear(); -@@ -212,9 +212,9 @@ - } - - -- -+ - private : -- -+ - union - { - unsigned long int n32[2] ; -@@ -237,7 +237,7 @@ - - unsigned long long _nb_sample; - -- -+ - - }; - -diff -Nur BTL-20030124/generic_bench/timers/x86_timer.hh~ BTL/generic_bench/timers/x86_timer.hh~ ---- BTL-20030124/generic_bench/timers/x86_timer.hh~ 2003-01-07 17:31:58.000000000 +0100 -+++ BTL/generic_bench/timers/x86_timer.hh~ 1970-01-01 01:00:00.000000000 +0100 -@@ -1,245 +0,0 @@ --//===================================================== --// File : x86_timer.hh --// Author : L. Plagne <laurent.plagne@edf.fr)> --// Copyright (C) EDF R&D, mar déc 3 18:59:35 CET 2002 --//===================================================== --// --// This program is free software; you can redistribute it and/or --// modify it under the terms of the GNU General Public License --// as published by the Free Software Foundation; either version 2 --// of the License, or (at your option) any later version. --// --// This program is distributed in the hope that it will be useful, --// but WITHOUT ANY WARRANTY; without even the implied warranty of --// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --// GNU General Public License for more details. --// You should have received a copy of the GNU General Public License --// along with this program; if not, write to the Free Software --// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --// --#ifndef _X86_TIMER_HH --#define _X86_TIMER_HH -- --#include <sys/time.h> --#include <sys/resource.h> --#include <unistd.h> --#include <sys/times.h> --//#include "system_time.h" --#include <asm/msr.h> --#include "utilities.h" --#include <map> --#include <fstream> --#include <string> --#include <iostream> -- --// frequence de la becanne en Hz --//#define FREQUENCY 648000000 --//#define FREQUENCY 1400000000 --#define FREQUENCY 1695000000 -- --using namespace std; -- -- --class X86_Timer { -- --public : -- -- X86_Timer( void ):_frequency(FREQUENCY),_nb_sample(0) -- { -- MESSAGE("X86_Timer Default Ctor"); -- } -- -- inline void start( void ){ -- -- rdtsc(_click_start.n32[0],_click_start.n32[1]); -- -- } -- -- -- inline void stop( void ){ -- -- rdtsc(_click_stop.n32[0],_click_stop.n32[1]); -- -- } -- -- -- inline double frequency( void ){ -- return _frequency; -- } -- -- double get_elapsed_time_in_second( void ){ -- -- return (_click_stop.n64-_click_start.n64)/double(FREQUENCY); -- -- -- } -- -- unsigned long long get_click( void ){ -- -- return (_click_stop.n64-_click_start.n64); -- -- } -- -- inline void find_frequency( void ){ -- -- time_t initial, final; -- int dummy=2; -- -- initial = time(0); -- start(); -- do { -- dummy+=2; -- } -- while(time(0)==initial); -- // On est au debut d'un cycle d'une seconde !!! -- initial = time(0); -- start(); -- do { -- dummy+=2; -- } -- while(time(0)==initial); -- final=time(0); -- stop(); -- INFOS("fine grained time : "<< get_elapsed_time_in_second()); -- INFOS("coarse grained time : "<< final-initial); -- _frequency=_frequency*get_elapsed_time_in_second()/double(final-initial); -- INFOS("CPU frequency : "<< _frequency); -- -- } -- -- void add_get_click( void ){ -- -- _nb_sample++; -- _counted_clicks[get_click()]++; -- fill_history_clicks(); -- -- } -- -- void dump_statistics(string filemane){ -- -- ofstream outfile (filemane.c_str(),ios::out) ; -- -- std::map<unsigned long long , unsigned long long>::iterator itr; -- for(itr=_counted_clicks.begin() ; itr!=_counted_clicks.end() ; itr++) -- { -- outfile << (*itr).first << " " << (*itr).second << endl ; -- } -- -- outfile.close(); -- -- } -- -- void dump_history(string filemane){ -- -- ofstream outfile (filemane.c_str(),ios::out) ; -- -- -- -- for(int i=0 ; i<_history_mean_clicks.size() ; i++) -- { -- outfile << i << " " -- << _history_mean_clicks[i] << " " -- << _history_shortest_clicks[i] << " " -- << _history_most_occured_clicks[i] << endl ; -- } -- -- outfile.close(); -- -- } -- -- -- -- double get_mean_clicks( void ){ -- -- std::map<unsigned long long,unsigned long long>::iterator itr; -- -- unsigned long long mean_clicks=0; -- -- for(itr=_counted_clicks.begin() ; itr!=_counted_clicks.end() ; itr++) -- { -- -- mean_clicks+=(*itr).second*(*itr).first; -- } -- -- return mean_clicks/double(_nb_sample); -- -- } -- -- double get_shortest_clicks( void ){ -- -- return double((*_counted_clicks.begin()).first); -- -- } -- -- void fill_history_clicks( void ){ -- -- _history_mean_clicks.push_back(get_mean_clicks()); -- _history_shortest_clicks.push_back(get_shortest_clicks()); -- _history_most_occured_clicks.push_back(get_most_occured_clicks()); -- -- } -- -- -- double get_most_occured_clicks( void ){ -- -- unsigned long long moc=0; -- unsigned long long max_occurence=0; -- -- std::map<unsigned long long,unsigned long long>::iterator itr; -- -- for(itr=_counted_clicks.begin() ; itr!=_counted_clicks.end() ; itr++) -- { -- -- if (max_occurence<=(*itr).second){ -- max_occurence=(*itr).second; -- moc=(*itr).first; -- } -- } -- -- return double(moc); -- -- } -- -- void clear( void ) -- { -- _counted_clicks.clear(); -- -- _history_mean_clicks.clear(); -- _history_shortest_clicks.clear(); -- _history_most_occured_clicks.clear(); -- -- _nb_sample=0; -- } -- -- -- --private : -- -- union -- { -- unsigned long int n32[2] ; -- unsigned long long n64 ; -- } _click_start; -- -- union -- { -- unsigned long int n32[2] ; -- unsigned long long n64 ; -- } _click_stop; -- -- double _frequency ; -- -- map<unsigned long long,unsigned long long> _counted_clicks; -- -- vector<double> _history_mean_clicks; -- vector<double> _history_shortest_clicks; -- vector<double> _history_most_occured_clicks; -- -- unsigned long long _nb_sample; -- -- -- --}; -- -- --#endif -diff -Nur BTL-20030124/generic_bench/utils/dump_file_x_y.hh BTL/generic_bench/utils/dump_file_x_y.hh ---- BTL-20030124/generic_bench/utils/dump_file_x_y.hh 2002-11-21 16:04:06.000000000 +0100 -+++ BTL/generic_bench/utils/dump_file_x_y.hh 2003-11-12 19:53:23.000000000 +0100 -@@ -1,14 +1,14 @@ - //===================================================== - // File : dump_file_x_y.hh --// Author : L. Plagne <laurent.plagne@edf.fr)> -+// Author : L. Plagne <laurent.plagne@edf.fr)> - // Copyright (C) EDF R&D, lun sep 30 14:23:20 CEST 2002 - //===================================================== --// -+// - // This program is free software; you can redistribute it and/or - // modify it under the terms of the GNU General Public License - // as published by the Free Software Foundation; either version 2 - // of the License, or (at your option) any later version. --// -+// - // This program is distributed in the hope that it will be useful, - // but WITHOUT ANY WARRANTY; without even the implied warranty of - // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -@@ -16,9 +16,10 @@ - // You should have received a copy of the GNU General Public License - // along with this program; if not, write to the Free Software - // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --// -+// - #ifndef DUMP_FILE_X_Y_HH - #define DUMP_FILE_X_Y_HH -+ - #include <fstream> - #include <string> - -@@ -27,21 +28,17 @@ - // [] operator for seting element - // the vector element must have the << operator define - --using namespace std; -- - template<class Vector_A, class Vector_B> --void dump_file_x_y(const Vector_A & X, const Vector_B & Y, const std::string & filename){ -- -- ofstream outfile (filename.c_str(),ios::out) ; -- int size=X.size(); -- -- for (int i=0;i<size;i++){ -+void dump_file_x_y(const Vector_A& X, const Vector_B& Y, const std::string& filename) { - -- outfile << X[i] << " " << Y[i] << endl ; -+ std::ofstream outfile (filename.c_str(), std::ios::out) ; -+ unsigned size=X.size(); - -+ for (unsigned i = 0; i < size; i++) { -+ outfile << X[i] << " " << Y[i] << std::endl; - } - - outfile.close(); --} -+} - - #endif -diff -Nur BTL-20030124/generic_bench/utils/size_lin_log.hh BTL/generic_bench/utils/size_lin_log.hh ---- BTL-20030124/generic_bench/utils/size_lin_log.hh 2003-01-14 19:52:59.000000000 +0100 -+++ BTL/generic_bench/utils/size_lin_log.hh 2003-11-12 19:55:23.000000000 +0100 -@@ -1,14 +1,14 @@ - //===================================================== - // File : size_lin_log.hh --// Author : L. Plagne <laurent.plagne@edf.fr)> -+// Author : L. Plagne <laurent.plagne@edf.fr)> - // Copyright (C) EDF R&D, mar déc 3 18:59:37 CET 2002 - //===================================================== --// -+// - // This program is free software; you can redistribute it and/or - // modify it under the terms of the GNU General Public License - // as published by the Free Software Foundation; either version 2 - // of the License, or (at your option) any later version. --// -+// - // This program is distributed in the hope that it will be useful, - // but WITHOUT ANY WARRANTY; without even the implied warranty of - // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -@@ -16,7 +16,7 @@ - // You should have received a copy of the GNU General Public License - // along with this program; if not, write to the Free Software - // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --// -+// - #ifndef SIZE_LIN_LOG - #define SIZE_LIN_LOG - -@@ -30,41 +30,27 @@ - - X.resize(nb_point); - -- if (nb_point>ten){ -- -- for (int i=0;i<nine;i++){ -- -- X[i]=i+1; -- -+ if(nb_point > ten) { -+ for (int i = 0; i < nine; i++) { -+ X[i] = i+1; - } - - Vector log_size; -- size_log(nb_point-nine,ten,size_max,log_size); - -- for (int i=0;i<nb_point-nine;i++){ -- -- X[i+nine]=log_size[i]; -+ size_log(nb_point-nine, ten, size_max, log_size); - -+ for (int i = 0; i < nb_point-nine; i++) { -+ X[i+nine] = log_size[i]; - } -- } -- else{ -- -- for (int i=0;i<nb_point;i++){ -- -- X[i]=i+1; -- -+ } else{ -+ for (int i = 0; i < nb_point; i++) { -+ X[i] = i+1; - } - } - -- // for (int i=0;i<nb_point;i++){ -- --// INFOS("computed sizes : X["<<i<<"]="<<X[i]); -- --// } -- -+ // for (int i=0;i<nb_point;i++){ -+ // INFOS("computed sizes : X["<<i<<"]="<<X[i]); -+ // } - } -- --#endif -- -- - -+#endif -diff -Nur BTL-20030124/generic_bench/utils/size_log.hh BTL/generic_bench/utils/size_log.hh ---- BTL-20030124/generic_bench/utils/size_log.hh 2002-12-02 19:54:46.000000000 +0100 -+++ BTL/generic_bench/utils/size_log.hh 2003-10-30 19:56:14.000000000 +0100 -@@ -1,14 +1,14 @@ - //===================================================== - // File : size_log.hh --// Author : L. Plagne <laurent.plagne@edf.fr)> -+// Author : L. Plagne <laurent.plagne@edf.fr)> - // Copyright (C) EDF R&D, lun sep 30 14:23:17 CEST 2002 - //===================================================== --// -+// - // This program is free software; you can redistribute it and/or - // modify it under the terms of the GNU General Public License - // as published by the Free Software Foundation; either version 2 - // of the License, or (at your option) any later version. --// -+// - // This program is distributed in the hope that it will be useful, - // but WITHOUT ANY WARRANTY; without even the implied warranty of - // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -@@ -16,7 +16,7 @@ - // You should have received a copy of the GNU General Public License - // along with this program; if not, write to the Free Software - // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --// -+// - #ifndef SIZE_LOG - #define SIZE_LOG - -@@ -42,8 +42,8 @@ - for (int i=0;i<nb_point;i++){ - - ls = ls_min + float(i)*delta_ls ; -- -- size=int(exp(ls)); -+ -+ size=int(exp(ls)); - - X[i]=size; - } -diff -Nur BTL-20030124/libs/ATLAS/Makefile BTL/libs/ATLAS/Makefile ---- BTL-20030124/libs/ATLAS/Makefile 2002-11-21 16:04:06.000000000 +0100 -+++ BTL/libs/ATLAS/Makefile 2003-11-15 07:31:10.000000000 +0100 -@@ -1,10 +1,10 @@ --include $(BENCH_BASE)/Makefile.in -+include $(BENCH_BASE)/Makefile.in - - INCLUDES=$(INCLUDES_BASE) -I$(FORTRAN_DIR) -I$(ATLAS_BLAS_INCLUDE) -I$(ATLAS_BLAS_INCLUDE2) - OPTIM=$(OPTIM_BASE) - DEBUG=$(DEBUG_BASE) - --CXXFLAGS = $(OPTIM) $(INCLUDES) -+CXXFLAGS = $(OPTIM) $(INCLUDES) -DDREAL - - LIBS=$(LIBS_BASE) -L$(ATLAS_BLAS_LIB) -llapack -lcblas -latlas - -@@ -12,12 +12,10 @@ - - all : $(DEPEND_BASE) main - --main: Makefile main.o -- $(CXX) -o main main.o $(LIBS) -+main: Makefile main.o -+ $(CXX) -o main main.o $(LIBS) - - - ########################################################################### - - main.o : $(DEPEND_BASE) main.cpp ATLAS_interface.hh -- -- -diff -Nur BTL-20030124/libs/tiny_blitz/main.cpp BTL/libs/tiny_blitz/main.cpp ---- BTL-20030124/libs/tiny_blitz/main.cpp 2003-01-21 13:03:40.000000000 +0100 -+++ BTL/libs/tiny_blitz/main.cpp 2003-11-13 21:11:52.000000000 +0100 -@@ -1,14 +1,14 @@ - //===================================================== - // File : main.cpp --// Author : L. Plagne <laurent.plagne@edf.fr)> -+// Author : L. Plagne <laurent.plagne@edf.fr)> - // Copyright (C) EDF R&D, lun sep 30 14:23:30 CEST 2002 - //===================================================== --// -+// - // This program is free software; you can redistribute it and/or - // modify it under the terms of the GNU General Public License - // as published by the Free Software Foundation; either version 2 - // of the License, or (at your option) any later version. --// -+// - // This program is distributed in the hope that it will be useful, - // but WITHOUT ANY WARRANTY; without even the implied warranty of - // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -@@ -16,7 +16,7 @@ - // You should have received a copy of the GNU General Public License - // along with this program; if not, write to the Free Software - // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --// -+// - #include "utilities.h" - #include "tiny_blitz_interface.hh" - #include "static/bench_static.hh" -@@ -27,11 +27,9 @@ - - int main() - { -- bench_static<Action_axpy,tiny_blitz_interface>(); -- bench_static<Action_matrix_matrix_product,tiny_blitz_interface>(); -- bench_static<Action_matrix_vector_product,tiny_blitz_interface>(); -+ bench_static<Action_axpy,tiny_blitz_interface, TINY_MV_MAX_SIZE>(); -+ bench_static<Action_matrix_matrix_product,tiny_blitz_interface, TINY_MV_MAX_SIZE>(); -+ bench_static<Action_matrix_vector_product,tiny_blitz_interface, TINY_MV_MAX_SIZE>(); - - return 0; - } -- -- -diff -Nur BTL-20030124/libs/tvmet/main.cpp BTL/libs/tvmet/main.cpp ---- BTL-20030124/libs/tvmet/main.cpp 2003-01-21 13:05:17.000000000 +0100 -+++ BTL/libs/tvmet/main.cpp 2003-11-14 13:29:57.000000000 +0100 -@@ -1,14 +1,14 @@ - //===================================================== - // File : main.cpp --// Author : L. Plagne <laurent.plagne@edf.fr)> -+// Author : L. Plagne <laurent.plagne@edf.fr)> - // Copyright (C) EDF R&D, lun sep 30 14:23:30 CEST 2002 - //===================================================== --// -+// - // This program is free software; you can redistribute it and/or - // modify it under the terms of the GNU General Public License - // as published by the Free Software Foundation; either version 2 - // of the License, or (at your option) any later version. --// -+// - // This program is distributed in the hope that it will be useful, - // but WITHOUT ANY WARRANTY; without even the implied warranty of - // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -@@ -16,21 +16,24 @@ - // You should have received a copy of the GNU General Public License - // along with this program; if not, write to the Free Software - // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --// -+// - #include "utilities.h" - #include "tvmet_interface.hh" - #include "static/bench_static.hh" - #include "action_matrix_vector_product.hh" - #include "action_matrix_matrix_product.hh" - #include "action_axpy.hh" -+#include "action_ata_product.hh" -+#include "action_aat_product.hh" -+ - - int main() - { -- bench_static<Action_axpy,tvmet_interface>(); -- bench_static<Action_matrix_matrix_product,tvmet_interface>(); -- bench_static<Action_matrix_vector_product,tvmet_interface>(); -+ bench_static<Action_axpy,tvmet_interface, TINY_MV_MAX_SIZE>(); -+ bench_static<Action_matrix_vector_product,tvmet_interface, MAX_MV>(); -+ bench_static<Action_matrix_matrix_product,tvmet_interface, MAX_MM>(); -+ bench_static<Action_ata_product,tvmet_interface, MAX_MM>(); -+ bench_static<Action_aat_product,tvmet_interface, MAX_MM>(); - - return 0; - } -- -- -diff -Nur BTL-20030124/libs/tvmet/Makefile BTL/libs/tvmet/Makefile ---- BTL-20030124/libs/tvmet/Makefile 2003-01-21 11:38:53.000000000 +0100 -+++ BTL/libs/tvmet/Makefile 2003-10-30 19:02:08.000000000 +0100 -@@ -1,8 +1,8 @@ --include $(BENCH_BASE)/Makefile.in -+include $(BENCH_BASE)/Makefile.in - --LIBS=$(LIBS_BASE) --INCLUDES=-I. $(INCLUDES_BASE) -I$(TVMET_INCLUDES) --OPTIM=$(OPTIM_BASE) -+LIBS=$(LIBS_BASE) -+INCLUDES=-I. $(INCLUDES_BASE) -I$(TVMET_ROOT)/include -+OPTIM=$(shell echo `$(TVMET_ROOT)/tvmet-config --cxxflags`) - DEBUG=$(DEBUG_BASE) - - CXXFLAGS = $(OPTIM) $(INCLUDES) -@@ -13,8 +13,8 @@ - - all : $(DEPEND_BASE) main - --main: Makefile main.o -- $(CXX) -o main main.o $(LIBS) -+main: Makefile main.o -+ $(CXX) -o main main.o $(LIBS) - - - ########################################################################### -diff -Nur BTL-20030124/libs/tvmet/tvmet_interface.hh BTL/libs/tvmet/tvmet_interface.hh ---- BTL-20030124/libs/tvmet/tvmet_interface.hh 2003-01-21 12:05:19.000000000 +0100 -+++ BTL/libs/tvmet/tvmet_interface.hh 2003-11-13 18:20:13.000000000 +0100 -@@ -1,14 +1,14 @@ - //===================================================== - // File : tvmet_interface.hh --// Author : L. Plagne <laurent.plagne@edf.fr)> -+// Author : L. Plagne <laurent.plagne@edf.fr)> - // Copyright (C) EDF R&D, lun sep 30 14:23:30 CEST 2002 - //===================================================== --// -+// - // This program is free software; you can redistribute it and/or - // modify it under the terms of the GNU General Public License - // as published by the Free Software Foundation; either version 2 - // of the License, or (at your option) any later version. --// -+// - // This program is distributed in the hope that it will be useful, - // but WITHOUT ANY WARRANTY; without even the implied warranty of - // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -@@ -16,7 +16,7 @@ - // You should have received a copy of the GNU General Public License - // along with this program; if not, write to the Free Software - // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --// -+// - #ifndef TVMET_INTERFACE_HH - #define TVMET_INTERFACE_HH - -@@ -25,117 +25,98 @@ - - #include <vector> - --using namespace tvmet; -- - template<class real, int SIZE> --class tvmet_interface{ -- -+class tvmet_interface -+{ - public : -- -+ - typedef real real_type ; - - typedef std::vector<real> stl_vector; - typedef std::vector<stl_vector > stl_matrix; -- -- typedef Vector<real,SIZE> gene_vector; -- typedef Matrix<real,SIZE,SIZE> gene_matrix; - -- static inline std::string name( void ) -- { -+ typedef tvmet::Vector<real, SIZE> gene_vector; -+ typedef tvmet::Matrix<real, SIZE, SIZE> gene_matrix; -+ -+ static inline std::string name() { - return "tvmet"; - } -- -- -- static void free_matrix(gene_matrix & A, int N){ -- -- return ; -- } -- -- static void free_vector(gene_vector & B){ -- -- return ; -- -- } -- -- static inline void matrix_from_stl(gene_matrix & A, stl_matrix & A_stl){ -- -- for (int i=0; i<A_stl.size() ; i++){ -- for (int j=0; j<A_stl[i].size() ; j++){ -- A(i,j)=A_stl[i][j]; -+ -+ static void free_matrix(gene_matrix& A, int N) { -+ return; -+ } -+ -+ static void free_vector(gene_vector& B) { -+ return; -+ } -+ -+ static inline void matrix_from_stl(gene_matrix& A, stl_matrix& A_stl) { -+ for (unsigned i = 0; i < A_stl.size(); i++){ -+ for (unsigned j = 0; j < A_stl[i].size(); j++) { -+ A(i,j) = A_stl[i][j]; - } -- - } - } -- -- static inline void vector_from_stl(gene_vector & B, stl_vector & B_stl){ -- -- for (int i=0; i<B_stl.size() ; i++){ -- B[i]=B_stl[i]; -+ -+ static inline void vector_from_stl(gene_vector& B, stl_vector& B_stl) { -+ for (unsigned i = 0; i < B_stl.size(); i++) { -+ B[i] = B_stl[i]; - } - } -- -- static inline void vector_to_stl(gene_vector & B, stl_vector & B_stl){ -- -- for (int i=0; i<B_stl.size() ; i++){ -- B_stl[i]=B[i]; -+ -+ static inline void vector_to_stl(gene_vector& B, stl_vector& B_stl) { -+ for (unsigned i = 0; i < B_stl.size(); i++) { -+ B_stl[i] = B[i]; - } - } - -- static inline void matrix_to_stl(gene_matrix & A, stl_matrix & A_stl){ -- -- int N=A_stl.size(); -- -- for (int i=0;i<N;i++){ -+ static inline void matrix_to_stl(gene_matrix& A, stl_matrix& A_stl) { -+ unsigned N = A_stl.size(); -+ -+ for (unsigned i = 0;i < N;i++) { - A_stl[i].resize(N); -- for (int j=0;j<N;j++){ -- A_stl[i][j]=A(i,j); -+ for (unsigned j = 0;j < N;j++) { -+ A_stl[i][j] = A(i,j); - } - } -- - } - -- -- static inline void copy_matrix(const gene_matrix & source, gene_matrix & cible, int N) -- { -- -- for (int i=0;i<N;i++){ -- for (int j=0;j<N;j++){ -- cible(i,j)=source(i,j); -+ static inline void copy_matrix(const gene_matrix& source, gene_matrix& cible, unsigned N) { -+ for (unsigned i = 0;i < N;i++) { -+ for (unsigned j = 0;j < N;j++) { -+ cible(i,j) = source(i,j); - } - } -- - } - -- static inline void copy_vector(const gene_vector & source, gene_vector & cible, int N) -- { -- -- for (int i=0;i<N;i++){ -- cible[i]=source[i]; -+ static inline void copy_vector(const gene_vector& source, gene_vector& cible, unsigned N) { -+ for (unsigned i = 0;i < N;i++) { -+ cible[i] = source[i]; - } -- -- } -- -- -- -- static inline void matrix_matrix_product(const gene_matrix & A, const gene_matrix & B, gene_matrix & X, int N) -- { -- X=product(A,B); - } - -+ static inline void matrix_matrix_product(const gene_matrix& A, const gene_matrix& B, gene_matrix& X, unsigned N) { -+ X = prod(A,B); -+ } - -- static inline void matrix_vector_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N) -- { -- X=product(A,B); -- -+ static inline void matrix_vector_product(gene_matrix& A, gene_vector& B, gene_vector& X, unsigned N) { -+ X = prod(A,B); - } - -- static inline void axpy(const real coef, const gene_vector & X, gene_vector & Y, int N) -- { -- Y+=coef*X; -+ static inline void axpy(const real coef, const gene_vector& X, gene_vector& Y, unsigned N) { -+ Y += coef*X; - } - -+ static inline void ata_product(gene_matrix& A, gene_matrix& X, unsigned N) { -+ //X = prod(trans(A),A); -+ X = MtM_prod(A, A); -+ } - -+ static inline void aat_product(gene_matrix& A, gene_matrix& X, unsigned N) { -+ //X = prod(A,trans(A)); -+ X = MMt_prod(A, A); -+ } - }; - -- -+ - #endif -diff -Nur BTL-20030124/libs/ublas/main.cpp BTL/libs/ublas/main.cpp ---- BTL-20030124/libs/ublas/main.cpp 2002-11-21 16:04:06.000000000 +0100 -+++ BTL/libs/ublas/main.cpp 2003-11-13 21:57:42.000000000 +0100 -@@ -1,14 +1,14 @@ - //===================================================== - // File : main.cpp --// Author : L. Plagne <laurent.plagne@edf.fr)> -+// Author : L. Plagne <laurent.plagne@edf.fr)> - // Copyright (C) EDF R&D, lun sep 30 14:23:27 CEST 2002 - //===================================================== --// -+// - // This program is free software; you can redistribute it and/or - // modify it under the terms of the GNU General Public License - // as published by the Free Software Foundation; either version 2 - // of the License, or (at your option) any later version. --// -+// - // This program is distributed in the hope that it will be useful, - // but WITHOUT ANY WARRANTY; without even the implied warranty of - // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -@@ -16,7 +16,7 @@ - // You should have received a copy of the GNU General Public License - // along with this program; if not, write to the Free Software - // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --// -+// - #include "utilities.h" - #include "ublas_interface.hh" - #include "bench.hh" -@@ -26,14 +26,16 @@ - #include "action_ata_product.hh" - #include "action_aat_product.hh" - -+using namespace std; -+ - int main() - { -- bench<Action_axpy<ublas_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT); -+ bench<Action_axpy<ublas_interface<REAL_TYPE> > >(MIN_AXPY,MAX_AXPY,NB_POINT); -+ -+ bench<Action_matrix_vector_product<ublas_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT); - -- bench<Action_matrix_vector_product<ublas_interface<REAL_TYPE> > >(MIN_MV,MAX_MV,NB_POINT); -+ bench<Action_matrix_matrix_product<ublas_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); - -- bench<Action_matrix_matrix_product<ublas_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); -- - bench<Action_ata_product<ublas_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); - - bench<Action_aat_product<ublas_interface<REAL_TYPE> > >(MIN_MM,MAX_MM,NB_POINT); -@@ -41,5 +43,3 @@ - - return 0; - } -- -- -diff -Nur BTL-20030124/libs/ublas/ublas_interface.hh BTL/libs/ublas/ublas_interface.hh ---- BTL-20030124/libs/ublas/ublas_interface.hh 2002-11-29 16:43:28.000000000 +0100 -+++ BTL/libs/ublas/ublas_interface.hh 2003-11-13 21:58:08.000000000 +0100 -@@ -1,14 +1,14 @@ - //===================================================== - // File : ublas_interface.hh --// Author : L. Plagne <laurent.plagne@edf.fr)> -+// Author : L. Plagne <laurent.plagne@edf.fr)> - // Copyright (C) EDF R&D, lun sep 30 14:23:27 CEST 2002 - //===================================================== --// -+// - // This program is free software; you can redistribute it and/or - // modify it under the terms of the GNU General Public License - // as published by the Free Software Foundation; either version 2 - // of the License, or (at your option) any later version. --// -+// - // This program is distributed in the hope that it will be useful, - // but WITHOUT ANY WARRANTY; without even the implied warranty of - // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -@@ -16,7 +16,7 @@ - // You should have received a copy of the GNU General Public License - // along with this program; if not, write to the Free Software - // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --// -+// - #ifndef UBLAS_INTERFACE_HH - #define UBLAS_INTERFACE_HH - -@@ -29,7 +29,6 @@ - #include <boost/numeric/ublas/concepts.hpp> - #include <boost/numeric/ublas/storage.hpp> - -- - template <class real> - class ublas_interface{ - -@@ -45,65 +44,65 @@ - //typedef numerics::vector<real,numerics::unbounded_array<real> > gene_vector; - typedef typename boost::numeric::ublas::matrix<real> gene_matrix; - typedef typename boost::numeric::ublas::vector<real> gene_vector; -- -+ - static inline std::string name( void ) - { - return "ublas"; - } - - -- -+ - - static void free_matrix(gene_matrix & A, int N){ -- -+ - return ; - } -- -+ - static void free_vector(gene_vector & B){ -- -+ - return ; -- -+ - } -- -+ - static inline void matrix_from_stl(gene_matrix & A, stl_matrix & A_stl){ -- -+ - A.resize(A_stl.size(),A_stl[0].size()); -- -+ - for (int i=0; i<A_stl.size() ; i++){ - for (int j=0; j<A_stl[i].size() ; j++){ - A(i,j)=A_stl[i][j]; - } -- -+ - } - } -- -+ - static inline void vector_from_stl(gene_vector & B, stl_vector & B_stl){ -- -+ - B.resize(B_stl.size()); -- -+ - for (int i=0; i<B_stl.size() ; i++){ - B(i)=B_stl[i]; - } - } -- -+ - static inline void vector_to_stl(gene_vector & B, stl_vector & B_stl){ -- -+ - for (int i=0; i<B_stl.size() ; i++){ - B_stl[i]=B(i); - } - } - - static inline void matrix_to_stl(gene_matrix & A, stl_matrix & A_stl){ -- -+ - int N=A_stl.size(); -- -+ - for (int i=0;i<N;i++){ - A_stl[i].resize(N); - for (int j=0;j<N;j++){ - A_stl[i][j]=A(i,j); - } - } -- -+ - } - - static inline void copy_vector(const gene_vector & source, gene_vector & cible, int N){ -@@ -119,19 +118,19 @@ - } - } - } -- -+ - static inline void matrix_vector_product_slow(gene_matrix & A, gene_vector & B, gene_vector & X, int N) - { -- X = prod(A,B); -+ X = prod(A,B); - } - - static inline void matrix_matrix_product_slow(gene_matrix & A, gene_matrix & B, gene_matrix & X, int N) - { -- X = prod(A,B); -+ X = prod(A,B); - } - - static inline void axpy_slow(const real coef, const gene_vector & X, gene_vector & Y, int N) -- { -+ { - Y+=coef*X; - } - -@@ -139,16 +138,16 @@ - - static inline void matrix_vector_product(gene_matrix & A, gene_vector & B, gene_vector & X, int N) - { -- X.assign(prod(A,B)); -+ X.assign(prod(A,B)); - } - - static inline void matrix_matrix_product(gene_matrix & A, gene_matrix & B, gene_matrix & X, int N) - { -- X.assign(prod(A,B)); -+ X.assign(prod(A,B)); - } - - static inline void axpy(const real coef, const gene_vector & X, gene_vector & Y, int N) -- { -+ { - Y.plus_assign(coef*X); - } - -@@ -166,7 +165,7 @@ - - - -- -+ - }; - - #endif -diff -Nur BTL-20030124/Makefile BTL/Makefile ---- BTL-20030124/Makefile 2003-01-21 17:41:55.000000000 +0100 -+++ BTL/Makefile 2003-11-15 07:09:13.000000000 +0100 -@@ -2,42 +2,43 @@ - - BENCH_LIB=$(BENCH_BASE)/libs - --all : C STL f77 blitz ATLAS MTL ublas INTEL_BLAS STL_algo tiny_blitz tvmet##C_BLAS -+#all : C STL f77 blitz ATLAS MTL ublas INTEL_BLAS STL_algo tiny_blitz tvmet##C_BLAS -+all : C STL f77 blitz ATLAS ublas STL_algo tiny_blitz tvmet - --blitz : test_conf -+blitz : test_conf - ( cd $(BENCH_LIB)/blitz ; make ) - --MTL : test_conf -+MTL : test_conf - (cd $(BENCH_LIB)/MTL ; make ) - --f77 : test_conf -+f77 : test_conf - (cd $(BENCH_LIB)/f77 ; make ) - --C : test_conf -+C : test_conf - (cd $(BENCH_LIB)/C ; make ) - --STL : test_conf -+STL : test_conf - (cd $(BENCH_LIB)/STL ; make ) - --ATLAS : test_conf -+ATLAS : test_conf - (cd $(BENCH_LIB)/ATLAS ; make ) - --ublas : test_conf -+ublas : test_conf - (cd $(BENCH_LIB)/ublas ; make ) - --C_BLAS : test_conf -+C_BLAS : test_conf - (cd $(BENCH_LIB)/C_BLAS ; make ) - --INTEL_BLAS : test_conf -+INTEL_BLAS : test_conf - (cd $(BENCH_LIB)/INTEL_BLAS ; make ) - --STL_algo : test_conf -+STL_algo : test_conf - (cd $(BENCH_LIB)/STL_algo ; make ) - --tiny_blitz : test_conf -+tiny_blitz : test_conf - (cd $(BENCH_LIB)/tiny_blitz ; make ) - --tvmet : test_conf -+tvmet : test_conf - (cd $(BENCH_LIB)/tvmet ; make ) - - -@@ -62,5 +63,3 @@ - echo done ;\ - )\ - done -- -- -diff -Nur BTL-20030124/Makefile.in BTL/Makefile.in ---- BTL-20030124/Makefile.in 2003-01-21 12:02:16.000000000 +0100 -+++ BTL/Makefile.in 2003-11-13 21:15:23.000000000 +0100 -@@ -1,44 +1,37 @@ --## TVMET -- --TVMET_INCLUDES=/home01/lplagne/public/tvmet-0.7.0/include -+## TVMET >1.3.0 -+TVMET_ROOT=/home/opetzold/work/tvmet - - ## UBLAS -- --BOOST_ROOT=/home01/lplagne/public/boost/boost_1_28_0 -+BOOST_ROOT=/usr/include/boost - - ## BLITZ -- --##BLITZ_ROOT=/home01/lplagne/public/blitz/blitz-20001213 --BLITZ_ROOT=/home01/lplagne/public/blitz/blitz-0.6 -+BLITZ_ROOT=/home/opetzold/work/blitz++-0.7 - - ## MTL --MTL_ROOT=/home01/lplagne/public/MTL/include -+##MTL_ROOT=/home01/lplagne/public/MTL/include - ##MTL_ROOT=/home01/lplagne/public/MTL/mtl-2.1.2-20 - ##MTL_PATCH=/home01/lplagne/mtl_patch/mtl-spec-1.0 - ##ITL_ROOT=/home01/lplagne/public/MTL/ITL/itl-4.0.0-1 - - ## ATLAS -- --ATLAS_BLAS_LIB=/home01/lplagne/public/atlas/ATLAS/lib/Linux_PIIISSE1 --ATLAS_BLAS_INCLUDE2=/home01/lplagne/public/atlas/ATLAS/include/Linux_PIIISSE1 --ATLAS_BLAS_INCLUDE=/home01/lplagne/public/atlas/ATLAS/include -+ATLAS_BLAS_LIB=/usr/local/lib -+ATLAS_BLAS_INCLUDE2=/usr/local/include/atlas/Linux_P4SSE2 -+ATLAS_BLAS_INCLUDE=/usr/local/include/atlas - - ## C_BLAS -- --C_BLAS_INCLUDE=/home01/lplagne/public/blas_netlib/CBLAS/src --C_BLAS_LIB=/home01/lplagne/public/blas_netlib/CBLAS/lib/LINUX/cblas_LINUX.a --F77_BLAS_LIB=/home01/lplagne/public/blas_netlib/f77_blas/libblas.a -+#C_BLAS_INCLUDE=/home01/lplagne/public/blas_netlib/CBLAS/src -+#C_BLAS_LIB=/home01/lplagne/public/blas_netlib/CBLAS/lib/LINUX/cblas_LINUX.a -+#F77_BLAS_LIB=/home01/lplagne/public/blas_netlib/f77_blas/libblas.a - - ## INTEL_BLAS -- --INTEL_BLAS_INCLUDE=/opt/intel/mkl/include --IBLIB=/opt/intel/mkl/lib/32 --INTEL_BLAS_LIB=$(IBLIB)/libmkl_lapack.a $(IBLIB)/libmkl_p3.a $(IBLIB)/libmkl_p4.a $(IBLIB)/libguide.a $(IBLIB)/libmkl_def.a -lg2c -lpthread --##INTEL_BLAS_LIB=-L/opt/intel/mkl/lib/32 -lmkl_lapack64 -lmkl_lapack32 -lmkl_p4 -lmkl_p3 -lguide -lmkl_def -lg2c -+#INTEL_BLAS_INCLUDE=/opt/intel/mkl/include -+#IBLIB=/opt/intel/mkl/lib/32 -+#INTEL_BLAS_LIB=$(IBLIB)/libmkl_lapack.a $(IBLIB)/libmkl_p3.a $(IBLIB)/libmkl_p4.a $(IBLIB)/libguide.a $(IBLIB)/libmkl_def.a -lg2c -lpthread -+##INTEL_BLAS_LIB=-L/opt/intel/mkl/lib/32 -lmkl_lapack64 -lmkl_lapack32 -lmkl_p4 -lmkl_p3 -lguide -lmkl_def -lg2c - - - --## INCLUDES -+## INCLUDES - - ACTIONS=$(BENCH_BASE)/actions - -@@ -52,13 +45,13 @@ - INCLUDES_BASE= -I$(BENCH_BASE)/includes -I$(STL) -I$(GENERIC) -I$(ACTIONS) -I$(BENCH_UTILS) - - --## LIBS -+## LIBS - --LIBS_BASE = -lm -+LIBS_BASE = -lm - - ##CXX = KCC - --DEFINED_VAR= -+DEFINED_VAR= - CXX=g++ $(DEFINED_VAR) - MAKE_LIB= ar cr - -@@ -78,7 +71,7 @@ - - ########################################################################### - --.SUFFIXES: .o .cpp -+.SUFFIXES: .o .cpp - - .cpp.o: - $(CXX) $(CXXFLAGS) -c $< -@@ -86,14 +79,14 @@ - ########################################################################### - ########################################################################### - --.SUFFIXES: .o .cxx -+.SUFFIXES: .o .cxx - - .cxx.o: - $(CXX) $(CXXFLAGS) -c $< - - ########################################################################### - --default: -+default: - make all - - test_conf : -@@ -105,5 +98,3 @@ - clean: - rm -f *.o *.ii *.int.c *.s *~ \#* main core rm *.dat *.a - rm -rf ti_files -- -- diff --git a/tvmet-1.7.1/benchmark/Makefile.am b/tvmet-1.7.1/benchmark/Makefile.am deleted file mode 100644 index 45e405a9b..000000000 --- a/tvmet-1.7.1/benchmark/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -# $Id: Makefile.am,v 1.4 2003/12/04 19:18:09 opetzold Exp $ - -EXTRA_DIST = BTL-20030124.patch diff --git a/tvmet-1.7.1/benchmark/Makefile.in b/tvmet-1.7.1/benchmark/Makefile.in deleted file mode 100644 index 4e3ec26c3..000000000 --- a/tvmet-1.7.1/benchmark/Makefile.in +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/doc/Doxyfile.in b/tvmet-1.7.1/doc/Doxyfile.in deleted file mode 100644 index b98c263b4..000000000 --- a/tvmet-1.7.1/doc/Doxyfile.in +++ /dev/null @@ -1,1120 +0,0 @@ -# $Id: Doxyfile.in,v 1.14 2004/11/30 09:51:06 opetzold Exp $ -# Doxyfile 1.3.5 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project -# -# All text after a hash (#) is considered a comment and will be ignored -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = @PACKAGE@ - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = "Version @VERSION@" - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, -# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en -# (Japanese with English messages), Korean, Norwegian, Polish, Portuguese, -# Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. - -OUTPUT_LANGUAGE = English - -# This tag can be used to specify the encoding used in the generated output. -# The encoding is not always determined by the language that is chosen, -# but also whether or not the output is meant for Windows or non-Windows users. -# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES -# forces the Windows encoding (this is the default for the Windows binary), -# whereas setting the tag to NO uses a Unix-style encoding (the default for -# all platforms other than Windows). - -USE_WINDOWS_ENCODING = NO - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is used -# as the annotated text. Otherwise, the brief description is used as-is. If left -# blank, the following values are used ("$name" is automatically replaced with the -# name of the entity): "The $name class" "The $name widget" "The $name file" -# "is" "provides" "specifies" "contains" "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = YES - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited -# members of a class in the documentation of that class as if those members were -# ordinary class members. Constructors, destructors and assignment operators of -# the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = YES - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. It is allowed to use relative paths in the argument list. -# -# doxygen BUG: Obviously doxygen takes only the first path and ignores the 2nd - -STRIP_FROM_PATH = @top_srcdir@/ @top_builddir@/ - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like the Qt-style comments (thus requiring an -# explicit @brief command for a brief description. - -JAVADOC_AUTOBRIEF = YES - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the DETAILS_AT_TOP tag is set to YES then Doxygen -# will output the detailed description near the top, like JavaDoc. -# If set to NO, the detailed description appears after the member -# documentation. - -DETAILS_AT_TOP = YES - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = YES - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 2 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = "docme=\todo\nDoc me!" - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources -# only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources -# only. Doxygen will then generate output that is more tailored for Java. -# For instance, namespaces will be presented as packages, qualified scopes -# will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = YES - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = YES - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = YES - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = YES - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = YES - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# users are advised to set this option to NO. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = YES - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = NO - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = doxygen-warning - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = \ - @top_srcdir@/include/ \ - @top_srcdir@/doc \ - @top_builddir@/doc \ - @top_builddir@/include/tvmet/config.h \ - @top_builddir@/include/tvmet/config/config-vc71.h - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp -# *.h++ *.idl *.odl *.cs *.php *.php3 *.inc - -FILE_PATTERNS = \ - *.h \ - *.dox - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. - -EXCLUDE = \ - @top_srcdir@/doc/Util.h \ - @top_srcdir@/doc/dox_functions.cc \ - @top_srcdir@/doc/dox_operators.cc - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories -# that are symbolic links (a Unix filesystem feature) are excluded from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. - -EXCLUDE_PATTERNS = CVS \ - stamp* \ - *.in - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = @top_srcdir@/examples - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = *.cc \ - *.h - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = @top_srcdir@/doc - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command <filter> <input-file>, where <filter> -# is the value of the INPUT_FILTER tag, and <input-file> is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. - -INPUT_FILTER = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = NO - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES (the default) -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = YES - -# If the REFERENCES_RELATION tag is set to YES (the default) -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = YES - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = YES - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 2 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -#GENERATE_HTML = @enable_html_docs@ -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. - -HTML_HEADER = @srcdir@/header.html - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = footer.html - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = @srcdir@/tvmet.css - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. - -DISABLE_INDEX = NO - -# This tag can be used to set the number of enum values (range [1..20]) -# that doxygen will group on one line in the generated HTML documentation. - -ENUM_VALUES_PER_LINE = 4 - -# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be -# generated containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, -# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are -# probably better off using the HTML help feature. - -GENERATE_TREEVIEW = NO - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -#GENERATE_LATEX = @enable_latex_docs@ -GENERATE_LATEX = YES - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = YES - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, a4wide, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4 - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = tvmet - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = YES - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = YES - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = @LATEX_BATCHMODE@ - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. This is useful -# if you want to understand what is going on. On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = YES - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_PREDEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# in the INCLUDE_PATH (see below) will be search if a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = @top_srcdir@/include \ - @top_builddir@/include - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. - -PREDEFINED = DOXYGEN_SKIP_THIS \ - TVMET_HAVE_LONG_DOUBLE \ - EIGEN_USE_COMPLEX \ - TVMET_HAVE_IEEE_MATH - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all function-like macros that are alone -# on a line, have an all uppercase name, and do not end with a semicolon. Such -# function macros are typically used for boiler-plate code, and will confuse the -# parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::addtions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# Note that each tag file must have a unique name -# (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen -# is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = html/@PACKAGE@-@VERSION@.tag - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base or -# super classes. Setting the tag to NO turns the diagrams off. Note that this -# option is superseded by the HAVE_DOT option below. This is only a fallback. It is -# recommended to install and use dot, since it yields more powerful graphs. - -CLASS_DIAGRAMS = YES - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = @DOXYGEN_HAVE_DOT@ - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# the CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = YES - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will -# generate a call dependency graph for every global function or class method. -# Note that enabling this option will significantly increase the time of a run. -# So in most cases it will be better to enable call graphs for selected -# functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are png, jpg, or gif -# If left blank png will be used. - -DOT_IMAGE_FORMAT = png - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found on the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width -# (in pixels) of the graphs generated by dot. If a graph becomes larger than -# this value, doxygen will try to truncate the graph, so that it fits within -# the specified constraint. Beware that most browsers cannot cope with very -# large images. - -MAX_DOT_GRAPH_WIDTH = 1024 - -# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height -# (in pixels) of the graphs generated by dot. If a graph becomes larger than -# this value, doxygen will try to truncate the graph, so that it fits within -# the specified constraint. Beware that most browsers cannot cope with very -# large images. - -MAX_DOT_GRAPH_HEIGHT = 1024 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes that -# lay further from the root node will be omitted. Note that setting this option to -# 1 or 2 may greatly reduce the computation time needed for large code bases. Also -# note that a graph may be further truncated if the graph's image dimensions are -# not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH and MAX_DOT_GRAPH_HEIGHT). -# If 0 is used for the depth value (the default), the graph is not depth-constrained. - -MAX_DOT_GRAPH_DEPTH = 0 - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES - -#--------------------------------------------------------------------------- -# Configuration::addtions related to the search engine -#--------------------------------------------------------------------------- - -# The SEARCHENGINE tag specifies whether or not a search engine should be -# used. If set to NO the values of all tags below this one will be ignored. - -SEARCHENGINE = YES diff --git a/tvmet-1.7.1/doc/Makefile.am b/tvmet-1.7.1/doc/Makefile.am deleted file mode 100644 index 05b0c62dd..000000000 --- a/tvmet-1.7.1/doc/Makefile.am +++ /dev/null @@ -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 diff --git a/tvmet-1.7.1/doc/Makefile.in b/tvmet-1.7.1/doc/Makefile.in deleted file mode 100644 index 1615e41bf..000000000 --- a/tvmet-1.7.1/doc/Makefile.in +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/doc/Util.h b/tvmet-1.7.1/doc/Util.h deleted file mode 100644 index db38b4ee6..000000000 --- a/tvmet-1.7.1/doc/Util.h +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/doc/aat.png b/tvmet-1.7.1/doc/aat.png Binary files differdeleted file mode 100644 index 2e2a536ad..000000000 --- a/tvmet-1.7.1/doc/aat.png +++ /dev/null diff --git a/tvmet-1.7.1/doc/ata.png b/tvmet-1.7.1/doc/ata.png Binary files differdeleted file mode 100644 index 0e4d52fbd..000000000 --- a/tvmet-1.7.1/doc/ata.png +++ /dev/null diff --git a/tvmet-1.7.1/doc/axpy.png b/tvmet-1.7.1/doc/axpy.png Binary files differdeleted file mode 100644 index d537720c6..000000000 --- a/tvmet-1.7.1/doc/axpy.png +++ /dev/null diff --git a/tvmet-1.7.1/doc/benchmark.dox b/tvmet-1.7.1/doc/benchmark.dox deleted file mode 100644 index fa60b48a7..000000000 --- a/tvmet-1.7.1/doc/benchmark.dox +++ /dev/null @@ -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 diff --git a/tvmet-1.7.1/doc/build.dox b/tvmet-1.7.1/doc/build.dox deleted file mode 100644 index 51946daf4..000000000 --- a/tvmet-1.7.1/doc/build.dox +++ /dev/null @@ -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 diff --git a/tvmet-1.7.1/doc/compiler.dox b/tvmet-1.7.1/doc/compiler.dox deleted file mode 100644 index 4bcd90081..000000000 --- a/tvmet-1.7.1/doc/compiler.dox +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/doc/dox_functions.cc b/tvmet-1.7.1/doc/dox_functions.cc deleted file mode 100644 index ac85787e4..000000000 --- a/tvmet-1.7.1/doc/dox_functions.cc +++ /dev/null @@ -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); -} diff --git a/tvmet-1.7.1/doc/dox_operators.cc b/tvmet-1.7.1/doc/dox_operators.cc deleted file mode 100644 index 7c4da40b3..000000000 --- a/tvmet-1.7.1/doc/dox_operators.cc +++ /dev/null @@ -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); -} diff --git a/tvmet-1.7.1/doc/faq.dox b/tvmet-1.7.1/doc/faq.dox deleted file mode 100644 index 78c59e255..000000000 --- a/tvmet-1.7.1/doc/faq.dox +++ /dev/null @@ -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 diff --git a/tvmet-1.7.1/doc/footer.html.in b/tvmet-1.7.1/doc/footer.html.in deleted file mode 100644 index 962f834da..000000000 --- a/tvmet-1.7.1/doc/footer.html.in +++ /dev/null @@ -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> diff --git a/tvmet-1.7.1/doc/header.html b/tvmet-1.7.1/doc/header.html deleted file mode 100644 index b71b879ee..000000000 --- a/tvmet-1.7.1/doc/header.html +++ /dev/null @@ -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> diff --git a/tvmet-1.7.1/doc/intro.dox b/tvmet-1.7.1/doc/intro.dox deleted file mode 100644 index aac830d2d..000000000 --- a/tvmet-1.7.1/doc/intro.dox +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/doc/license.dox b/tvmet-1.7.1/doc/license.dox deleted file mode 100644 index ae03f4aa9..000000000 --- a/tvmet-1.7.1/doc/license.dox +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/doc/links.dox b/tvmet-1.7.1/doc/links.dox deleted file mode 100644 index 8d6a70825..000000000 --- a/tvmet-1.7.1/doc/links.dox +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/doc/matrix_matrix.png b/tvmet-1.7.1/doc/matrix_matrix.png Binary files differdeleted file mode 100644 index 737a91ad1..000000000 --- a/tvmet-1.7.1/doc/matrix_matrix.png +++ /dev/null diff --git a/tvmet-1.7.1/doc/matrix_vector.png b/tvmet-1.7.1/doc/matrix_vector.png Binary files differdeleted file mode 100644 index 08aa47399..000000000 --- a/tvmet-1.7.1/doc/matrix_vector.png +++ /dev/null diff --git a/tvmet-1.7.1/doc/misc.dox b/tvmet-1.7.1/doc/misc.dox deleted file mode 100644 index b4a1fec1d..000000000 --- a/tvmet-1.7.1/doc/misc.dox +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/doc/notes.dox b/tvmet-1.7.1/doc/notes.dox deleted file mode 100644 index 2b07ed4a5..000000000 --- a/tvmet-1.7.1/doc/notes.dox +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/doc/projects.dox b/tvmet-1.7.1/doc/projects.dox deleted file mode 100644 index 2b56afbf9..000000000 --- a/tvmet-1.7.1/doc/projects.dox +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/doc/tvmet.css b/tvmet-1.7.1/doc/tvmet.css deleted file mode 100644 index f2a42aeaf..000000000 --- a/tvmet-1.7.1/doc/tvmet.css +++ /dev/null @@ -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%; -} diff --git a/tvmet-1.7.1/doc/tvmet.sty.in b/tvmet-1.7.1/doc/tvmet.sty.in deleted file mode 100644 index 0379e99b5..000000000 --- a/tvmet-1.7.1/doc/tvmet.sty.in +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/doc/usage.dox b/tvmet-1.7.1/doc/usage.dox deleted file mode 100644 index 4bbc446ff..000000000 --- a/tvmet-1.7.1/doc/usage.dox +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/doc/works.dox b/tvmet-1.7.1/doc/works.dox deleted file mode 100644 index 07edf8a18..000000000 --- a/tvmet-1.7.1/doc/works.dox +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/examples/Makefile.am b/tvmet-1.7.1/examples/Makefile.am deleted file mode 100644 index 6d0c25234..000000000 --- a/tvmet-1.7.1/examples/Makefile.am +++ /dev/null @@ -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) diff --git a/tvmet-1.7.1/examples/Makefile.in b/tvmet-1.7.1/examples/Makefile.in deleted file mode 100644 index ce43f3ac7..000000000 --- a/tvmet-1.7.1/examples/Makefile.in +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/examples/alias.cc b/tvmet-1.7.1/examples/alias.cc deleted file mode 100644 index 01f02eccc..000000000 --- a/tvmet-1.7.1/examples/alias.cc +++ /dev/null @@ -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; - -} diff --git a/tvmet-1.7.1/examples/aliasing.cc b/tvmet-1.7.1/examples/aliasing.cc deleted file mode 100644 index 4ba87d8d3..000000000 --- a/tvmet-1.7.1/examples/aliasing.cc +++ /dev/null @@ -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; -} diff --git a/tvmet-1.7.1/examples/cmm.cc b/tvmet-1.7.1/examples/cmm.cc deleted file mode 100644 index bd470aacd..000000000 --- a/tvmet-1.7.1/examples/cmm.cc +++ /dev/null @@ -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; -} diff --git a/tvmet-1.7.1/examples/cmv.cc b/tvmet-1.7.1/examples/cmv.cc deleted file mode 100644 index 4ea55ad13..000000000 --- a/tvmet-1.7.1/examples/cmv.cc +++ /dev/null @@ -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; -} diff --git a/tvmet-1.7.1/examples/diag.cc b/tvmet-1.7.1/examples/diag.cc deleted file mode 100644 index 40a4c1825..000000000 --- a/tvmet-1.7.1/examples/diag.cc +++ /dev/null @@ -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; -} diff --git a/tvmet-1.7.1/examples/frob_matrix_norm.cc b/tvmet-1.7.1/examples/frob_matrix_norm.cc deleted file mode 100644 index eb26e4161..000000000 --- a/tvmet-1.7.1/examples/frob_matrix_norm.cc +++ /dev/null @@ -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 - -*/ diff --git a/tvmet-1.7.1/examples/hspiess.cc b/tvmet-1.7.1/examples/hspiess.cc deleted file mode 100644 index 129c4f0c0..000000000 --- a/tvmet-1.7.1/examples/hspiess.cc +++ /dev/null @@ -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; - } -} diff --git a/tvmet-1.7.1/examples/matrix_col.cc b/tvmet-1.7.1/examples/matrix_col.cc deleted file mode 100644 index a807dbb5f..000000000 --- a/tvmet-1.7.1/examples/matrix_col.cc +++ /dev/null @@ -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; - -} - diff --git a/tvmet-1.7.1/examples/mm.cc b/tvmet-1.7.1/examples/mm.cc deleted file mode 100644 index f251e6133..000000000 --- a/tvmet-1.7.1/examples/mm.cc +++ /dev/null @@ -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; -} diff --git a/tvmet-1.7.1/examples/mv.cc b/tvmet-1.7.1/examples/mv.cc deleted file mode 100644 index 9665409e4..000000000 --- a/tvmet-1.7.1/examples/mv.cc +++ /dev/null @@ -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; -} diff --git a/tvmet-1.7.1/examples/ray.cc b/tvmet-1.7.1/examples/ray.cc deleted file mode 100644 index 6ab07b926..000000000 --- a/tvmet-1.7.1/examples/ray.cc +++ /dev/null @@ -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 - -*****************************************************************************************/ diff --git a/tvmet-1.7.1/examples/redwards.cc b/tvmet-1.7.1/examples/redwards.cc deleted file mode 100644 index 46a525d6e..000000000 --- a/tvmet-1.7.1/examples/redwards.cc +++ /dev/null @@ -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; -} diff --git a/tvmet-1.7.1/examples/xpr_print_m1.cc b/tvmet-1.7.1/examples/xpr_print_m1.cc deleted file mode 100644 index f48fe10fe..000000000 --- a/tvmet-1.7.1/examples/xpr_print_m1.cc +++ /dev/null @@ -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; -} diff --git a/tvmet-1.7.1/examples/xpr_print_m2.cc b/tvmet-1.7.1/examples/xpr_print_m2.cc deleted file mode 100644 index c9151fdc3..000000000 --- a/tvmet-1.7.1/examples/xpr_print_m2.cc +++ /dev/null @@ -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; -} diff --git a/tvmet-1.7.1/examples/xpr_print_m3.cc b/tvmet-1.7.1/examples/xpr_print_m3.cc deleted file mode 100644 index 69f6451be..000000000 --- a/tvmet-1.7.1/examples/xpr_print_m3.cc +++ /dev/null @@ -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; -} diff --git a/tvmet-1.7.1/examples/xpr_print_m4.cc b/tvmet-1.7.1/examples/xpr_print_m4.cc deleted file mode 100644 index a2499813a..000000000 --- a/tvmet-1.7.1/examples/xpr_print_m4.cc +++ /dev/null @@ -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; -} diff --git a/tvmet-1.7.1/examples/xpr_print_mv1.cc b/tvmet-1.7.1/examples/xpr_print_mv1.cc deleted file mode 100644 index c48629586..000000000 --- a/tvmet-1.7.1/examples/xpr_print_mv1.cc +++ /dev/null @@ -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; - -} diff --git a/tvmet-1.7.1/examples/xpr_print_mv2.cc b/tvmet-1.7.1/examples/xpr_print_mv2.cc deleted file mode 100644 index 4d51e5401..000000000 --- a/tvmet-1.7.1/examples/xpr_print_mv2.cc +++ /dev/null @@ -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; - -} diff --git a/tvmet-1.7.1/examples/xpr_print_v1.cc b/tvmet-1.7.1/examples/xpr_print_v1.cc deleted file mode 100644 index 98a64b5d1..000000000 --- a/tvmet-1.7.1/examples/xpr_print_v1.cc +++ /dev/null @@ -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; -} - diff --git a/tvmet-1.7.1/examples/xpr_print_v2.cc b/tvmet-1.7.1/examples/xpr_print_v2.cc deleted file mode 100644 index f670beb0f..000000000 --- a/tvmet-1.7.1/examples/xpr_print_v2.cc +++ /dev/null @@ -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; -} - diff --git a/tvmet-1.7.1/examples/xpr_print_v3.cc b/tvmet-1.7.1/examples/xpr_print_v3.cc deleted file mode 100644 index 40167b3e2..000000000 --- a/tvmet-1.7.1/examples/xpr_print_v3.cc +++ /dev/null @@ -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; -} - diff --git a/tvmet-1.7.1/examples/xpr_print_v4.cc b/tvmet-1.7.1/examples/xpr_print_v4.cc deleted file mode 100644 index 1253db814..000000000 --- a/tvmet-1.7.1/examples/xpr_print_v4.cc +++ /dev/null @@ -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; -} - diff --git a/tvmet-1.7.1/include/CMakeLists.txt b/tvmet-1.7.1/include/CMakeLists.txt deleted file mode 100644 index ba566de2e..000000000 --- a/tvmet-1.7.1/include/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -ADD_SUBDIRECTORY(tvmet)
\ No newline at end of file diff --git a/tvmet-1.7.1/include/tvmet/AliasProxy.h b/tvmet-1.7.1/include/tvmet/AliasProxy.h deleted file mode 100644 index ff6fa5c4b..000000000 --- a/tvmet-1.7.1/include/tvmet/AliasProxy.h +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/include/tvmet/BinaryFunctionals.h b/tvmet-1.7.1/include/tvmet/BinaryFunctionals.h deleted file mode 100644 index b09cf9045..000000000 --- a/tvmet-1.7.1/include/tvmet/BinaryFunctionals.h +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/include/tvmet/CMakeLists.txt b/tvmet-1.7.1/include/tvmet/CMakeLists.txt deleted file mode 100644 index fb75aac19..000000000 --- a/tvmet-1.7.1/include/tvmet/CMakeLists.txt +++ /dev/null @@ -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)
\ No newline at end of file diff --git a/tvmet-1.7.1/include/tvmet/CommaInitializer.h b/tvmet-1.7.1/include/tvmet/CommaInitializer.h deleted file mode 100644 index 6ec605c3b..000000000 --- a/tvmet-1.7.1/include/tvmet/CommaInitializer.h +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/include/tvmet/CompileTimeError.h b/tvmet-1.7.1/include/tvmet/CompileTimeError.h deleted file mode 100644 index 9be1bb12a..000000000 --- a/tvmet-1.7.1/include/tvmet/CompileTimeError.h +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/include/tvmet/Extremum.h b/tvmet-1.7.1/include/tvmet/Extremum.h deleted file mode 100644 index f0b5f05ea..000000000 --- a/tvmet-1.7.1/include/tvmet/Extremum.h +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/include/tvmet/Functional.h b/tvmet-1.7.1/include/tvmet/Functional.h deleted file mode 100644 index 3aa7579d2..000000000 --- a/tvmet-1.7.1/include/tvmet/Functional.h +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/include/tvmet/Matrix.h b/tvmet-1.7.1/include/tvmet/Matrix.h deleted file mode 100644 index 070bc0c14..000000000 --- a/tvmet-1.7.1/include/tvmet/Matrix.h +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/include/tvmet/MatrixEval.h b/tvmet-1.7.1/include/tvmet/MatrixEval.h deleted file mode 100644 index fa382a8ba..000000000 --- a/tvmet-1.7.1/include/tvmet/MatrixEval.h +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/include/tvmet/MatrixFunctions.h b/tvmet-1.7.1/include/tvmet/MatrixFunctions.h deleted file mode 100644 index 293c3d4ac..000000000 --- a/tvmet-1.7.1/include/tvmet/MatrixFunctions.h +++ /dev/null @@ -1,1169 +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: MatrixFunctions.h,v 1.59 2004/11/04 16:21:17 opetzold Exp $ - */ - -#ifndef TVMET_MATRIX_FUNCTIONS_H -#define TVMET_MATRIX_FUNCTIONS_H - -#include <tvmet/Extremum.h> - -namespace tvmet { - -/* forwards */ -template<class T, int Sz> class Vector; -template<class T, int Sz> class VectorConstRef; - - -/********************************************************* - * PART I: DECLARATION - *********************************************************/ - - -/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * Vector arithmetic functions add, sub, mul and div - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -/* - * function(Matrix<T1, Rows, Cols>, Matrix<T2, Rows, Cols>) - * function(XprMatrix<E, Rows, Cols>, Matrix<T, Rows, Cols>) - * function(Matrix<T, Rows, Cols>, XprMatrix<E, Rows, Cols>) - */ -#define TVMET_DECLARE_MACRO(NAME) \ -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 \ -> \ -NAME (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 \ -> \ -NAME (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 \ -> \ -NAME (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) // not defined for matrizes - TVMET_DECLARE_MACRO(div) // not defined for matrizes -} - -#undef TVMET_DECLARE_MACRO - - -/* - * function(Matrix<T, Rows, Cols>, POD) - * function(POD, Matrix<T, Rows, Cols>) - * Note: - operations +,-,*,/ are per se element wise - */ -#define TVMET_DECLARE_MACRO(NAME, POD) \ -template<class T, int Rows, int Cols> \ -XprMatrix< \ - XprBinOp< \ - Fcnl_##NAME<T, POD >, \ - MatrixConstRef<T, Rows, Cols>, \ - XprLiteral<POD > \ - >, \ - Rows, Cols \ -> \ -NAME (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 \ -> \ -NAME (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) -/* - * function(Matrix<T, Rows, Cols>, complex<T>) - * function(complex<T>, Matrix<T, Rows, Cols>) - * Note: - operations +,-,*,/ are per se element wise - * \todo type promotion - */ -#define TVMET_DECLARE_MACRO(NAME) \ -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 \ -> \ -NAME (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 \ -> \ -NAME (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 prod( ... ) functions - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -template<class T1, int Rows1, int Cols1, - class T2, int Cols2> -XprMatrix< - XprMMProduct< - MatrixConstRef<T1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1) - MatrixConstRef<T2, Cols1, Cols2>, Cols2 // M2(Cols1, Cols2) - >, - Rows1, Cols2 // return Dim -> -prod(const Matrix<T1, Rows1, Cols1>& lhs, - const Matrix<T2, Cols1, Cols2>& rhs) _tvmet_always_inline; - - -template<class E1, int Rows1, int Cols1, - class T2, int Cols2> -XprMatrix< - XprMMProduct< - XprMatrix<E1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1) - MatrixConstRef<T2, Cols1, Cols2>, Cols2 // M2(Cols1, Cols2) - >, - Rows1, Cols2 // return Dim -> -prod(const XprMatrix<E1, Rows1, Cols1>& lhs, - const Matrix<T2, Cols1, Cols2>& rhs) _tvmet_always_inline; - - -template<class T1, int Rows1, int Cols1, - class E2, int Cols2> -XprMatrix< - XprMMProduct< - MatrixConstRef<T1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1) - XprMatrix<E2, Cols1, Cols2>, Cols2 // M2(Cols1, Cols2) - >, - Rows1, Cols2 // return Dim -> -prod(const Matrix<T1, Rows1, Cols1>& lhs, - const XprMatrix<E2, Cols1, Cols2>& rhs) _tvmet_always_inline; - - -template<class T1, int Rows1, int Cols1, - class T2, int Cols2> -XprMatrix< - XprMMProductTransposed< - MatrixConstRef<T1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1) - MatrixConstRef<T2, Cols1, Cols2>, Cols2 // M2(Cols1, Cols2) - >, - Cols2, Rows1 // return Dim -> -trans_prod(const Matrix<T1, Rows1, Cols1>& lhs, - const Matrix<T2, Cols1, Cols2>& rhs) _tvmet_always_inline; - - -template<class T1, int Rows1, int Cols1, - class T2, int Cols2> // Rows2 = Rows1 -XprMatrix< - XprMtMProduct< - MatrixConstRef<T1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1) - MatrixConstRef<T2, Rows1, Cols2>, Cols2 // M2(Rows1, Cols2) - >, - Cols1, Cols2 // return Dim -> -MtM_prod(const Matrix<T1, Rows1, Cols1>& lhs, - const Matrix<T2, Rows1, Cols2>& rhs) _tvmet_always_inline; - - -template<class T1, int Rows1, int Cols1, - class T2, int Rows2> -XprMatrix< - XprMMtProduct< - MatrixConstRef<T1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1) - MatrixConstRef<T2, Rows2, Cols1>, Cols1 // M2(Rows2, Cols1) - >, - Rows1, Rows2 // return Dim -> -MMt_prod(const Matrix<T1, Rows1, Cols1>& lhs, - const Matrix<T2, Rows2, Cols1>& rhs) _tvmet_always_inline; - - -/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * matrix-vector specific prod( ... ) functions - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -template<class T1, class T2, int Rows, int Cols> -XprVector< - XprMVProduct< - MatrixConstRef<T1, Rows, Cols>, Rows, Cols, // M(Rows, Cols) - VectorConstRef<T2, Cols> // V - >, - Rows -> -prod(const Matrix<T1, Rows, Cols>& lhs, - const Vector<T2, Cols>& rhs) _tvmet_always_inline; - - -template<class T1, class E2, int Rows, int Cols> -XprVector< - XprMVProduct< - MatrixConstRef<T1, Rows, Cols>, Rows, Cols, - XprVector<E2, Cols> - >, - Rows -> -prod(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, // M(Rows, Cols) - VectorConstRef<T2, Cols> // V - >, - Rows -> -prod(const XprMatrix<E1, Rows, Cols>& lhs, - const Vector<T2, Cols>& rhs) _tvmet_always_inline; - - -template<class T1, class T2, int Rows, int Cols> -XprVector< - XprMtVProduct< - MatrixConstRef<T1, Rows, Cols>, Rows, Cols, // M(Rows, Cols) - VectorConstRef<T2, Rows> // V - >, - Cols -> -Mtx_prod(const Matrix<T1, Rows, Cols>& lhs, - const Vector<T2, Rows>& rhs) _tvmet_always_inline; - - -/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * matrix specific functions - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -template<class T, int Rows, int Cols> -XprMatrix< - XprMatrixTranspose< - MatrixConstRef<T, Rows, Cols> - >, - Cols, Rows -> -trans(const Matrix<T, Rows, Cols>& rhs) _tvmet_always_inline; - - -template<class T, int Sz> -typename Traits<T>::sum_type -trace(const Matrix<T, Sz, Sz>& m) _tvmet_always_inline; - - -template<class T, int Rows, int Cols> -XprVector< - XprMatrixRow< - MatrixConstRef<T, Rows, Cols>, - Rows, Cols - >, - Cols -> -row(const Matrix<T, Rows, Cols>& m, - int no) _tvmet_always_inline; - - -template<class T, int Rows, int Cols> -XprVector< - XprMatrixCol< - MatrixConstRef<T, Rows, Cols>, - Rows, Cols - >, - Rows -> -col(const Matrix<T, Rows, Cols>& m, - int no) _tvmet_always_inline; - - -template<class T, int Sz> -XprVector< - XprMatrixDiag< - MatrixConstRef<T, Sz, Sz>, - Sz - >, - Sz -> -diag(const Matrix<T, Sz, Sz>& m) _tvmet_always_inline; - - -/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * min/max unary functions - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -template<class E, int Rows, int Cols> -Extremum<typename E::value_type, int, matrix_tag> -maximum(const XprMatrix<E, Rows, Cols>& e); // NOT _tvmet_always_inline; - - -template<class T, int Rows, int Cols> -Extremum<T, int, matrix_tag> -maximum(const Matrix<T, Rows, Cols>& m) _tvmet_always_inline; - - -template<class E, int Rows, int Cols> -Extremum<typename E::value_type, int, matrix_tag> -minimum(const XprMatrix<E, Rows, Cols>& e); // NOT _tvmet_always_inline; - - -template<class T, int Rows, int Cols> -Extremum<T, int, matrix_tag> -minimum(const Matrix<T, Rows, Cols>& m) _tvmet_always_inline; - - -template<class E, int Rows, int Cols> -typename E::value_type -max(const XprMatrix<E, Rows, Cols>& e); // NOT _tvmet_always_inline; - - -template<class T, int Rows, int Cols> -T max(const Matrix<T, Rows, Cols>& m) _tvmet_always_inline; - - -template<class E, int Rows, int Cols> -typename E::value_type -min(const XprMatrix<E, Rows, Cols>& e); // NOT _tvmet_always_inline; - - -template<class T, int Rows, int Cols> -T min(const Matrix<T, Rows, Cols>& m) _tvmet_always_inline; - - -/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * other unary functions - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -template<class T, int Rows, int Cols> -XprMatrix< - XprIdentity<T, Rows, Cols>, - Rows, Cols -> -identity() _tvmet_always_inline; - - -template<class M> -XprMatrix< - XprIdentity< - typename M::value_type, - M::Rows, M::Cols>, - M::Rows, M::Cols -> -identity() _tvmet_always_inline; - - -template<class T, int Rows, int Cols> -XprMatrix< - MatrixConstRef<T, Rows, Cols>, - Rows, Cols -> -cmatrix_ref(const T* mem) _tvmet_always_inline; - - -/********************************************************* - * PART II: IMPLEMENTATION - *********************************************************/ - - -/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * Vector arithmetic functions add, sub, mul and div - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -/* - * function(Matrix<T1, Rows, Cols>, Matrix<T2, Rows, Cols>) - * function(XprMatrix<E, Rows, Cols>, Matrix<T, Rows, Cols>) - * function(Matrix<T, Rows, Cols>, XprMatrix<E, Rows, Cols>) - */ -#define TVMET_IMPLEMENT_MACRO(NAME) \ -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 \ -> \ -NAME (const Matrix<T1, Rows, Cols>& lhs, const Matrix<T2, Rows, Cols>& rhs) { \ - typedef XprBinOp < \ - Fcnl_##NAME<T1, T2>, \ - MatrixConstRef<T1, Rows, Cols>, \ - MatrixConstRef<T2, Rows, Cols> \ - > expr_type; \ - return XprMatrix<expr_type, Rows, Cols>( \ - expr_type(lhs.constRef(), rhs.constRef())); \ -} \ - \ -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 \ -> \ -NAME (const XprMatrix<E, Rows, Cols>& lhs, const Matrix<T, Rows, Cols>& rhs) { \ - typedef XprBinOp< \ - Fcnl_##NAME<typename E::value_type, T>, \ - XprMatrix<E, Rows, Cols>, \ - MatrixConstRef<T, Rows, Cols> \ - > expr_type; \ - return XprMatrix<expr_type, Rows, Cols>( \ - expr_type(lhs, rhs.constRef())); \ -} \ - \ -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 \ -> \ -NAME (const Matrix<T, Rows, Cols>& lhs, const XprMatrix<E, Rows, Cols>& rhs) { \ - typedef XprBinOp< \ - Fcnl_##NAME<T, typename E::value_type>, \ - MatrixConstRef<T, Rows, Cols>, \ - XprMatrix<E, Rows, Cols> \ - > expr_type; \ - return XprMatrix<expr_type, Rows, Cols>( \ - expr_type(lhs.constRef(), rhs)); \ -} - -TVMET_IMPLEMENT_MACRO(add) // per se element wise -TVMET_IMPLEMENT_MACRO(sub) // per se element wise -namespace element_wise { - TVMET_IMPLEMENT_MACRO(mul) // not defined for matrizes - TVMET_IMPLEMENT_MACRO(div) // not defined for matrizes -} - -#undef TVMET_IMPLEMENT_MACRO - - -/* - * function(Matrix<T, Rows, Cols>, POD) - * function(POD, Matrix<T, Rows, Cols>) - * Note: - operations +,-,*,/ are per se element wise - */ -#define TVMET_IMPLEMENT_MACRO(NAME, POD) \ -template<class T, int Rows, int Cols> \ -inline \ -XprMatrix< \ - XprBinOp< \ - Fcnl_##NAME<T, POD >, \ - MatrixConstRef<T, Rows, Cols>, \ - XprLiteral<POD > \ - >, \ - Rows, Cols \ -> \ -NAME (const Matrix<T, Rows, Cols>& lhs, POD rhs) { \ - typedef XprBinOp< \ - Fcnl_##NAME<T, POD >, \ - MatrixConstRef<T, Rows, Cols>, \ - XprLiteral< POD > \ - > expr_type; \ - return XprMatrix<expr_type, Rows, Cols>( \ - expr_type(lhs.constRef(), XprLiteral< POD >(rhs))); \ -} \ - \ -template<class T, int Rows, int Cols> \ -inline \ -XprMatrix< \ - XprBinOp< \ - Fcnl_##NAME< POD, T>, \ - XprLiteral< POD >, \ - MatrixConstRef<T, Rows, Cols> \ - >, \ - Rows, Cols \ -> \ -NAME (POD lhs, const Matrix<T, Rows, Cols>& rhs) { \ - typedef XprBinOp< \ - Fcnl_##NAME< POD, T>, \ - XprLiteral< POD >, \ - MatrixConstRef<T, Rows, Cols> \ - > expr_type; \ - return XprMatrix<expr_type, Rows, Cols>( \ - 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(Matrix<T, Rows, Cols>, complex<T>) - * function(complex<T>, Matrix<T, Rows, Cols>) - * Note: - operations +,-,*,/ are per se element wise - * \todo type promotion - */ -#define TVMET_IMPLEMENT_MACRO(NAME) \ -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 \ -> \ -NAME (const Matrix< std::complex<T>, Rows, Cols>& lhs, \ - const std::complex<T>& rhs) { \ - typedef XprBinOp< \ - Fcnl_##NAME< std::complex<T>, std::complex<T> >, \ - MatrixConstRef< std::complex<T>, Rows, Cols>, \ - XprLiteral< std::complex<T> > \ - > expr_type; \ - return XprMatrix<expr_type, Rows, Cols>( \ - expr_type(lhs.constRef(), XprLiteral< std::complex<T> >(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 \ -> \ -NAME (const std::complex<T>& lhs, \ - const Matrix< std::complex<T>, Rows, Cols>& rhs) { \ - typedef XprBinOp< \ - Fcnl_##NAME< std::complex<T>, std::complex<T> >, \ - XprLiteral< std::complex<T> >, \ - MatrixConstRef<T, Rows, Cols> \ - > expr_type; \ - return XprMatrix<expr_type, Rows, Cols>( \ - 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) - - -/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * matrix specific prod( ... ) functions - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -/** - * \fn prod(const Matrix<T1, Rows1, Cols1>& lhs, const Matrix<T2, Cols1, Cols2>& rhs) - * \brief Function for the matrix-matrix-product. - * \ingroup _binary_function - * \note The rows2 has to be equal to cols1. - */ -template<class T1, int Rows1, int Cols1, - class T2, int Cols2> -inline -XprMatrix< - XprMMProduct< - MatrixConstRef<T1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1) - MatrixConstRef<T2, Cols1, Cols2>, Cols2 // M2(Cols1, Cols2) - >, - Rows1, Cols2 // return Dim -> -prod(const Matrix<T1, Rows1, Cols1>& lhs, const Matrix<T2, Cols1, Cols2>& rhs) { - typedef XprMMProduct< - MatrixConstRef<T1, Rows1, Cols1>, Rows1, Cols1, - MatrixConstRef<T2, Cols1, Cols2>, Cols2 - > expr_type; - return XprMatrix<expr_type, Rows1, Cols2>( - expr_type(lhs.constRef(), rhs.constRef())); -} - - -/** - * \fn prod(const XprMatrix<E1, Rows1, Cols1>& lhs, const Matrix<T2, Cols1, Cols2>& rhs) - * \brief Evaluate the product of XprMatrix and Matrix. - * \ingroup _binary_function - */ -template<class E1, int Rows1, int Cols1, - class T2, int Cols2> -inline -XprMatrix< - XprMMProduct< - XprMatrix<E1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1) - MatrixConstRef<T2, Cols1, Cols2>, Cols2 // M2(Cols1, Cols2) - >, - Rows1, Cols2 // return Dim -> -prod(const XprMatrix<E1, Rows1, Cols1>& lhs, const Matrix<T2, Cols1, Cols2>& rhs) { - typedef XprMMProduct< - XprMatrix<E1, Rows1, Cols1>, Rows1, Cols1, - MatrixConstRef<T2, Cols1, Cols2>, Cols2 - > expr_type; - return XprMatrix<expr_type, Rows1, Cols2>( - expr_type(lhs, rhs.constRef())); -} - - -/** - * \fn prod(const Matrix<T1, Rows1, Cols1>& lhs, const XprMatrix<E2, Cols1, Cols2>& rhs) - * \brief Evaluate the product of Matrix and XprMatrix. - * \ingroup _binary_function - */ -template<class T1, int Rows1, int Cols1, - class E2, int Cols2> -inline -XprMatrix< - XprMMProduct< - MatrixConstRef<T1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1) - XprMatrix<E2, Cols1, Cols2>, Cols2 // M2(Cols1, Cols2) - >, - Rows1, Cols2 // return Dim -> -prod(const Matrix<T1, Rows1, Cols1>& lhs, const XprMatrix<E2, Cols1, Cols2>& rhs) { - typedef XprMMProduct< - MatrixConstRef<T1, Rows1, Cols1>, Rows1, Cols1, - XprMatrix<E2, Cols1, Cols2>, Cols2 - > expr_type; - return XprMatrix<expr_type, Rows1, Cols2>( - expr_type(lhs.constRef(), rhs)); -} - - -/** - * \fn trans_prod(const Matrix<T1, Rows1, Cols1>& lhs, const Matrix<T2, Cols1, Cols2>& rhs) - * \brief Function for the trans(matrix-matrix-product) - * \ingroup _binary_function - * Perform on given Matrix M1 and M2: - * \f[ - * (M_1\,M_2)^T - * \f] - */ -template<class T1, int Rows1, int Cols1, - class T2, int Cols2> -inline -XprMatrix< - XprMMProductTransposed< - MatrixConstRef<T1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1) - MatrixConstRef<T2, Cols1, Cols2>, Cols2 // M2(Cols1, Cols2) - >, - Cols2, Rows1 // return Dim -> -trans_prod(const Matrix<T1, Rows1, Cols1>& lhs, const Matrix<T2, Cols1, Cols2>& rhs) { - typedef XprMMProductTransposed< - MatrixConstRef<T1, Rows1, Cols1>, Rows1, Cols1, - MatrixConstRef<T2, Cols1, Cols2>, Cols2 - > expr_type; - return XprMatrix<expr_type, Cols2, Rows1>( - expr_type(lhs.constRef(), rhs.constRef())); -} - - -/** - * \fn MtM_prod(const Matrix<T1, Rows1, Cols1>& lhs, const Matrix<T2, Rows1, Cols2>& rhs) - * \brief Function for the trans(matrix)-matrix-product. - * \ingroup _binary_function - * using formula - * \f[ - * M_1^{T}\,M_2 - * \f] - * \note The number of cols of matrix 2 have to be equal to number of rows of - * matrix 1, since matrix 1 is trans - the result is a (Cols1 x Cols2) - * matrix. - */ -template<class T1, int Rows1, int Cols1, - class T2, int Cols2> // Rows2 = Rows1 -inline -XprMatrix< - XprMtMProduct< - MatrixConstRef<T1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1) - MatrixConstRef<T2, Rows1, Cols2>, Cols2 // M2(Rows1, Cols2) - >, - Cols1, Cols2 // return Dim -> -MtM_prod(const Matrix<T1, Rows1, Cols1>& lhs, const Matrix<T2, Rows1, Cols2>& rhs) { - typedef XprMtMProduct< - MatrixConstRef<T1, Rows1, Cols1>, Rows1, Cols1, - MatrixConstRef<T2, Rows1, Cols2>, Cols2 - > expr_type; - return XprMatrix<expr_type, Cols1, Cols2>( - expr_type(lhs.constRef(), rhs.constRef())); -} - - -/** - * \fn MMt_prod(const Matrix<T1, Rows1, Cols1>& lhs, const Matrix<T2, Rows2, Cols1>& rhs) - * \brief Function for the matrix-trans(matrix)-product. - * \ingroup _binary_function - * \note The Cols2 has to be equal to Cols1. - */ -template<class T1, int Rows1, int Cols1, - class T2, int Rows2> -inline -XprMatrix< - XprMMtProduct< - MatrixConstRef<T1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1) - MatrixConstRef<T2, Rows2, Cols1>, Cols1 // M2(Rows2, Cols1) - >, - Rows1, Rows2 // return Dim -> -MMt_prod(const Matrix<T1, Rows1, Cols1>& lhs, const Matrix<T2, Rows2, Cols1>& rhs) { - typedef XprMMtProduct< - MatrixConstRef<T1, Rows1, Cols1>, Rows1, Cols1, - MatrixConstRef<T2, Rows2, Cols1>, Cols1 - > expr_type; - return XprMatrix<expr_type, Rows1, Rows2>( - expr_type(lhs.constRef(), rhs.constRef())); -} - - -/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * matrix-vector specific prod( ... ) functions - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -/** - * \fn prod(const Matrix<T1, Rows, Cols>& lhs, const Vector<T2, Cols>& rhs) - * \brief Function for the matrix-vector-product - * \ingroup _binary_function - */ -template<class T1, class T2, int Rows, int Cols> -inline -XprVector< - XprMVProduct< - MatrixConstRef<T1, Rows, Cols>, Rows, Cols, // M(Rows, Cols) - VectorConstRef<T2, Cols> // V - >, - Rows -> -prod(const Matrix<T1, Rows, Cols>& lhs, const Vector<T2, Cols>& rhs) { - typedef XprMVProduct< - MatrixConstRef<T1, Rows, Cols>, Rows, Cols, - VectorConstRef<T2, Cols> - > expr_type; - return XprVector<expr_type, Rows>( - expr_type(lhs.constRef(), rhs.constRef())); -} - - -/** - * \fn prod(const Matrix<T1, Rows, Cols>& lhs, const XprVector<E2, Cols>& rhs) - * \brief Function for the matrix-vector-product - * \ingroup _binary_function - */ -template<class T1, class E2, int Rows, int Cols> -inline -XprVector< - XprMVProduct< - MatrixConstRef<T1, Rows, Cols>, Rows, Cols, - XprVector<E2, Cols> - >, - Rows -> -prod(const Matrix<T1, Rows, Cols>& lhs, const XprVector<E2, Cols>& rhs) { - typedef XprMVProduct< - MatrixConstRef<T1, Rows, Cols>, Rows, Cols, - XprVector<E2, Cols> - > expr_type; - return XprVector<expr_type, Rows>( - expr_type(lhs.constRef(), rhs)); -} - - -/* - * \fn prod(const XprMatrix<E, Rows, Cols>& lhs, const Vector<T, Cols>& rhs) - * \brief Compute the product of an XprMatrix with a Vector. - * \ingroup _binary_function - */ -template<class E1, class T2, int Rows, int Cols> -inline -XprVector< - XprMVProduct< - XprMatrix<E1, Rows, Cols>, Rows, Cols, // M(Rows, Cols) - VectorConstRef<T2, Cols> // V - >, - Rows -> -prod(const XprMatrix<E1, Rows, Cols>& lhs, const Vector<T2, Cols>& rhs) { - typedef XprMVProduct< - XprMatrix<E1, Rows, Cols>, Rows, Cols, - VectorConstRef<T2, Cols> - > expr_type; - return XprVector<expr_type, Rows>( - expr_type(lhs, rhs.constRef())); -} - - -/** - * \fn Mtx_prod(const Matrix<T1, Rows, Cols>& matrix, const Vector<T2, Rows>& vector) - * \brief Function for the trans(matrix)-vector-product - * \ingroup _binary_function - * Perform on given Matrix M and vector x: - * \f[ - * M^T\, x - * \f] - */ -template<class T1, class T2, int Rows, int Cols> -inline -XprVector< - XprMtVProduct< - MatrixConstRef<T1, Rows, Cols>, Rows, Cols, // M(Rows, Cols) - VectorConstRef<T2, Rows> // V - >, - Cols -> -Mtx_prod(const Matrix<T1, Rows, Cols>& lhs, const Vector<T2, Rows>& rhs) { - typedef XprMtVProduct< - MatrixConstRef<T1, Rows, Cols>, Rows, Cols, - VectorConstRef<T2, Rows> - > expr_type; - return XprVector<expr_type, Cols>( - expr_type(lhs.constRef(), rhs.constRef())); -} - - -/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * matrix specific functions - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -/** - * \fn trans(const Matrix<T, Rows, Cols>& rhs) - * \brief Transpose the matrix - * \ingroup _unary_function - */ -template<class T, int Rows, int Cols> -inline -XprMatrix< - XprMatrixTranspose< - MatrixConstRef<T, Rows, Cols> - >, - Cols, Rows -> -trans(const Matrix<T, Rows, Cols>& rhs) { - typedef XprMatrixTranspose< - MatrixConstRef<T, Rows, Cols> - > expr_type; - return XprMatrix<expr_type, Cols, Rows>( - expr_type(rhs.constRef())); -} - - -/* - * \fn trace(const Matrix<T, Sz, Sz>& m) - * \brief Compute the trace of a square matrix. - * \ingroup _unary_function - * - * Simply compute the trace of the given matrix as: - * \f[ - * \sum_{k = 0}^{Sz-1} m(k, k) - * \f] - */ -template<class T, int Sz> -inline -typename Traits<T>::sum_type -trace(const Matrix<T, Sz, Sz>& m) { - return meta::Matrix<Sz, Sz, 0, 0>::trace(m); -} - - -/** - * \fn row(const Matrix<T, Rows, Cols>& m, int no) - * \brief Returns a row vector of the given matrix. - * \ingroup _binary_function - */ -template<class T, int Rows, int Cols> -inline -XprVector< - XprMatrixRow< - MatrixConstRef<T, Rows, Cols>, - Rows, Cols - >, - Cols -> -row(const Matrix<T, Rows, Cols>& m, int no) { - typedef XprMatrixRow< - MatrixConstRef<T, Rows, Cols>, - Rows, Cols - > expr_type; - return XprVector<expr_type, Cols>(expr_type(m.constRef(), no)); -} - - -/** - * \fn col(const Matrix<T, Rows, Cols>& m, int no) - * \brief Returns a column vector of the given matrix. - * \ingroup _binary_function - */ -template<class T, int Rows, int Cols> -inline -XprVector< - XprMatrixCol< - MatrixConstRef<T, Rows, Cols>, - Rows, Cols - >, - Rows -> -col(const Matrix<T, Rows, Cols>& m, int no) { - typedef XprMatrixCol< - MatrixConstRef<T, Rows, Cols>, - Rows, Cols - > expr_type; - return XprVector<expr_type, Rows>(expr_type(m.constRef(), no)); -} - - -/** - * \fn diag(const Matrix<T, Sz, Sz>& m) - * \brief Returns the diagonal vector of the given square matrix. - * \ingroup _unary_function - */ -template<class T, int Sz> -inline -XprVector< - XprMatrixDiag< - MatrixConstRef<T, Sz, Sz>, - Sz - >, - Sz -> -diag(const Matrix<T, Sz, Sz>& m) { - typedef XprMatrixDiag< - MatrixConstRef<T, Sz, Sz>, - Sz - > expr_type; - return XprVector<expr_type, Sz>(expr_type(m.constRef())); -} - -/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * other unary functions - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - -/** - * \fn XprMatrix<XprIdentity<typename M::value_type, M::Rows, M::Cols>, M::Rows, M::Cols>identity() - * \brief Fill a matrix to an identity matrix. - * \ingroup _unary_function - * - * \note The matrix doesn't need to be square. Only the elements - * where the current number of rows are equal to columns - * will be set to 1, else to 0. - * - * \par Usage: - * \code - * typedef Matrix<double,3,3> matrix_type; - * ... - * matrix_type E( identity<double, 3, 3>() ); - * \endcode - * - * Note, we have to specify the type, number of rows and columns - * since ADL can't work here. - * - * - * - * \since release 1.6.0 - */ -template<class T, int Rows, int Cols> -inline -XprMatrix< - XprIdentity<T, Rows, Cols>, - Rows, Cols -> -identity() { - typedef XprIdentity<T, Rows, Cols> expr_type; - - return XprMatrix<expr_type, Rows, Cols>(expr_type()); -} - -/** - * \fn XprMatrix<XprIdentity<typename M::value_type, M::Rows, M::Cols>, M::Rows, M::Cols>identity() - * \brief Fill a matrix to an identity matrix (convenience wrapper - * for matrix typedefs). - * \ingroup _unary_function - * - * \note The matrix doesn't need to be square. Only the elements - * where the current number of rows are equal to columns - * will be set to 1, else to 0. - * - * \par Usage: - * \code - * typedef Matrix<double,3,3> matrix_type; - * ... - * matrix_type E( identity<matrix_type>() ); - * \endcode - * - * Note, we have to specify the matrix type, since ADL can't work here. - * - * \since release 1.6.0 - */ -template<class M> -inline -XprMatrix< - XprIdentity< - typename M::value_type, - M::Rows, M::Cols>, - M::Rows, M::Cols -> -identity() { - return identity<typename M::value_type, M::Rows, M::Cols>(); -} - - -/** - * \fn cmatrix_ref(const T* mem) - * \brief Creates an expression wrapper for a C like matrices. - * \ingroup _unary_function - * - * This is like creating a matrix of external data, as described - * at \ref construct. With this function you wrap an expression - * around a C style matrix and you can operate directly with it - * as usual. - * - * \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( cmatrix_ref<float, 3, 3>(&lhs[0][0]) - * * cmatrix_ref<float, 3, 3>(&rhs[0][0]) ); - * \endcode - * - * \since release 1.6.0 - */ -template<class T, int Rows, int Cols> -inline -XprMatrix< - MatrixConstRef<T, Rows, Cols>, - Rows, Cols -> -cmatrix_ref(const T* mem) { - typedef MatrixConstRef<T, Rows, Cols> expr_type; - - return XprMatrix<expr_type, Rows, Cols>(expr_type(mem)); -}; - - -} // namespace tvmet - -#endif // TVMET_MATRIX_FUNCTIONS_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/include/tvmet/MatrixImpl.h b/tvmet-1.7.1/include/tvmet/MatrixImpl.h deleted file mode 100644 index 10b9a85f5..000000000 --- a/tvmet-1.7.1/include/tvmet/MatrixImpl.h +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/include/tvmet/MatrixOperators.h b/tvmet-1.7.1/include/tvmet/MatrixOperators.h deleted file mode 100644 index 958fc0d22..000000000 --- a/tvmet-1.7.1/include/tvmet/MatrixOperators.h +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/include/tvmet/MatrixUnaryFunctions.h b/tvmet-1.7.1/include/tvmet/MatrixUnaryFunctions.h deleted file mode 100644 index 7cb09d1d0..000000000 --- a/tvmet-1.7.1/include/tvmet/MatrixUnaryFunctions.h +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/include/tvmet/Traits.h b/tvmet-1.7.1/include/tvmet/Traits.h deleted file mode 100644 index ceb4f03eb..000000000 --- a/tvmet-1.7.1/include/tvmet/Traits.h +++ /dev/null @@ -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 diff --git a/tvmet-1.7.1/include/tvmet/TraitsBase.h b/tvmet-1.7.1/include/tvmet/TraitsBase.h deleted file mode 100644 index 16c958baf..000000000 --- a/tvmet-1.7.1/include/tvmet/TraitsBase.h +++ /dev/null @@ -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 diff --git a/tvmet-1.7.1/include/tvmet/TvmetBase.h b/tvmet-1.7.1/include/tvmet/TvmetBase.h deleted file mode 100644 index 262f860d4..000000000 --- a/tvmet-1.7.1/include/tvmet/TvmetBase.h +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/include/tvmet/TypePromotion.h b/tvmet-1.7.1/include/tvmet/TypePromotion.h deleted file mode 100644 index 3bed8bf76..000000000 --- a/tvmet-1.7.1/include/tvmet/TypePromotion.h +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/include/tvmet/UnaryFunctionals.h b/tvmet-1.7.1/include/tvmet/UnaryFunctionals.h deleted file mode 100644 index 3ba35f2e3..000000000 --- a/tvmet-1.7.1/include/tvmet/UnaryFunctionals.h +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/include/tvmet/Vector.h b/tvmet-1.7.1/include/tvmet/Vector.h deleted file mode 100644 index 275355f3e..000000000 --- a/tvmet-1.7.1/include/tvmet/Vector.h +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/include/tvmet/VectorEval.h b/tvmet-1.7.1/include/tvmet/VectorEval.h deleted file mode 100644 index 47a7cf6b2..000000000 --- a/tvmet-1.7.1/include/tvmet/VectorEval.h +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/include/tvmet/VectorFunctions.h b/tvmet-1.7.1/include/tvmet/VectorFunctions.h deleted file mode 100644 index 2e34ab466..000000000 --- a/tvmet-1.7.1/include/tvmet/VectorFunctions.h +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/include/tvmet/VectorImpl.h b/tvmet-1.7.1/include/tvmet/VectorImpl.h deleted file mode 100644 index 1eb85d816..000000000 --- a/tvmet-1.7.1/include/tvmet/VectorImpl.h +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/include/tvmet/VectorOperators.h b/tvmet-1.7.1/include/tvmet/VectorOperators.h deleted file mode 100644 index f513bb19a..000000000 --- a/tvmet-1.7.1/include/tvmet/VectorOperators.h +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/include/tvmet/VectorUnaryFunctions.h b/tvmet-1.7.1/include/tvmet/VectorUnaryFunctions.h deleted file mode 100644 index dbe1a2c59..000000000 --- a/tvmet-1.7.1/include/tvmet/VectorUnaryFunctions.h +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/include/tvmet/config.h.cmake b/tvmet-1.7.1/include/tvmet/config.h.cmake deleted file mode 100644 index 707370c45..000000000 --- a/tvmet-1.7.1/include/tvmet/config.h.cmake +++ /dev/null @@ -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 diff --git a/tvmet-1.7.1/include/tvmet/loop/CMakeLists.txt b/tvmet-1.7.1/include/tvmet/loop/CMakeLists.txt deleted file mode 100644 index db60d4ce1..000000000 --- a/tvmet-1.7.1/include/tvmet/loop/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -FILE(GLOB tvmet_loop_header_SRCS "*.h") - -INSTALL(FILES - ${tvmet_loop_header_SRCS} - DESTINATION ${INCLUDE_INSTALL_DIR}/loop - ) diff --git a/tvmet-1.7.1/include/tvmet/loop/Gemm.h b/tvmet-1.7.1/include/tvmet/loop/Gemm.h deleted file mode 100644 index 41ec66a64..000000000 --- a/tvmet-1.7.1/include/tvmet/loop/Gemm.h +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/include/tvmet/loop/Gemmt.h b/tvmet-1.7.1/include/tvmet/loop/Gemmt.h deleted file mode 100644 index 045773072..000000000 --- a/tvmet-1.7.1/include/tvmet/loop/Gemmt.h +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/include/tvmet/loop/Gemtm.h b/tvmet-1.7.1/include/tvmet/loop/Gemtm.h deleted file mode 100644 index a91caa011..000000000 --- a/tvmet-1.7.1/include/tvmet/loop/Gemtm.h +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/include/tvmet/loop/Gemtv.h b/tvmet-1.7.1/include/tvmet/loop/Gemtv.h deleted file mode 100644 index 1584ab6a3..000000000 --- a/tvmet-1.7.1/include/tvmet/loop/Gemtv.h +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/include/tvmet/loop/Gemv.h b/tvmet-1.7.1/include/tvmet/loop/Gemv.h deleted file mode 100644 index 01118a93d..000000000 --- a/tvmet-1.7.1/include/tvmet/loop/Gemv.h +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/include/tvmet/loop/Matrix.h b/tvmet-1.7.1/include/tvmet/loop/Matrix.h deleted file mode 100644 index beea9f5fe..000000000 --- a/tvmet-1.7.1/include/tvmet/loop/Matrix.h +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/include/tvmet/loop/Vector.h b/tvmet-1.7.1/include/tvmet/loop/Vector.h deleted file mode 100644 index 5462ad7a1..000000000 --- a/tvmet-1.7.1/include/tvmet/loop/Vector.h +++ /dev/null @@ -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: diff --git a/tvmet-1.7.1/include/tvmet/meta/CMakeLists.txt b/tvmet-1.7.1/include/tvmet/meta/CMakeLists.txt deleted file mode 100644 index 0f65437c3..000000000 --- a/tvmet-1.7.1/include/tvmet/meta/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -FILE(GLOB tvmet_meta_header_SRCS "*.h") - -INSTALL(FILES - ${tvmet_meta_header_SRCS} - DESTINATION ${INCLUDE_INSTALL_DIR}/meta - ) diff --git a/tvmet-1.7.1/include/tvmet/meta/Gemm.h b/tvmet-1.7.1/include/tvmet/meta/Gemm.h deleted file mode 100644 index 7aad8e354..000000000 --- a/tvmet-1.7.1/include/tvmet/meta/Gemm.h +++ /dev/null @@ -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: Gemm.h,v 1.11 2004/06/17 15:53:12 opetzold Exp $ - */ - -#ifndef TVMET_META_GEMM_H -#define TVMET_META_GEMM_H - -#include <tvmet/xpr/Null.h> - -namespace tvmet { - -namespace meta { - - -/** - * \class gemm Gemm.h "tvmet/meta/Gemm.h" - * \brief Meta class for matrix-matrix operations, like product - * using formula - * \f[ - * M_1\,M_2 - * \f] - * \note The rows of matrix 2 have to be equal to cols of matrix 1. - */ -template<int Rows1, int Cols1, - int Cols2, - int K> -class gemm -{ - gemm(); - gemm(const gemm&); - gemm& operator=(const gemm&); - -private: - enum { - doIt = (K != Cols1 - 1) /**< recursive counter */ - }; - -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) { - return lhs(i, K) * rhs(K, j) - + gemm<Rows1 * doIt, Cols1 * doIt, - Cols2 * doIt, - (K+1) * doIt>::prod(lhs, rhs, i, j); - } -}; - - -/** - * \class gemm<0,0,0,0> Gemm.h "tvmet/meta/Gemm.h" - * \brief gemm Specialized for recursion. - */ -template<> -class gemm<0,0,0,0> -{ - gemm(); - gemm(const gemm&); - gemm& operator=(const gemm&); - -public: - template<class E1, class E2> - static inline - XprNull prod(const E1&, const E2&, int, int) { - return XprNull(); - } -}; - - -} // namespace meta - -} // namespace tvmet - -#endif /* TVMET_META_GEMM_H */ - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/include/tvmet/meta/Gemmt.h b/tvmet-1.7.1/include/tvmet/meta/Gemmt.h deleted file mode 100644 index a3669be5c..000000000 --- a/tvmet-1.7.1/include/tvmet/meta/Gemmt.h +++ /dev/null @@ -1,102 +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.9 2004/06/17 15:53:12 opetzold Exp $ - */ - -#ifndef TVMET_META_GEMMT_H -#define TVMET_META_GEMMT_H - -#include <tvmet/xpr/Null.h> - -namespace tvmet { - -namespace meta { - - -/** - * \class gemmt Gemmt.h "tvmet/meta/Gemmt.h" - * \brief Meta class for product matrix-transpose(matrix) operations. - * using formula - * \f[ - * M_1\,M_2^{T} - * \f] - * \note The rows of matrix 2 have to be equal to cols of matrix 1. The result - * is a rows1 * cols2 matrix. - */ -template<int Rows1, int Cols1, - int Cols2, - int K> -class gemmt -{ - gemmt(); - gemmt(const gemmt&); - gemmt& operator=(const gemmt&); - -private: - enum { - doIt = (K != Cols2 - 1) /**< recursive counter */ - }; - -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) { - return lhs(i, K) * rhs(j, K) - + gemmt<Rows1 * doIt, Cols1 * doIt, - Cols2 * doIt, - (K+1) * doIt>::prod(lhs, rhs, i, j); - } -}; - - -/** - * \class gemmt<0,0,0,0> Gemmt.h "tvmet/meta/Gemmt.h" - * \brief gemmt Specialized for recursion. - */ -template<> -class gemmt<0,0,0,0> -{ - gemmt(); - gemmt(const gemmt&); - gemmt& operator=(const gemmt&); - -public: - template<class E1, class E2> - static inline - XprNull prod(const E1&, const E2&, int, int) { - return XprNull(); - } -}; - - -} // namespace meta - -} // namespace tvmet - -#endif /* TVMET_META_GEMMT_H */ - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/include/tvmet/meta/Gemtm.h b/tvmet-1.7.1/include/tvmet/meta/Gemtm.h deleted file mode 100644 index 815175d43..000000000 --- a/tvmet-1.7.1/include/tvmet/meta/Gemtm.h +++ /dev/null @@ -1,105 +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.8 2004/06/17 15:53:12 opetzold Exp $ - */ - -#ifndef TVMET_META_GEMTM_H -#define TVMET_META_GEMTM_H - -#include <tvmet/xpr/Null.h> - -namespace tvmet { - -namespace meta { - - -/** - * \class gemtm Gemtm.h "tvmet/meta/Gemtm.h" - * \brief Meta class for trans(matrix)-matrix operations, like product. - * using formula - * \f[ - * M_1^{T}\,M_2 - * \f] - * \note The number of cols of matrix 2 have to be equal to number of rows of - * matrix 1, since matrix 1 is transposed - the result is a (Cols1 x Cols2) - * matrix. - */ - -template<int Rows1, int Cols1, - int Cols2, - int K> -class gemtm -{ -private: - gemtm(); - gemtm(const gemtm&); - gemtm& operator=(const gemtm&); - -private: - enum { - doIt = (K != Rows1 - 1) /**< recursive counter */ - }; - -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) { - return lhs(K, i) * rhs(K, j) - + gemtm<Rows1 * doIt, Cols1 * doIt, - Cols2 * doIt, - (K+1) * doIt>::prod(lhs, rhs, i, j); - } -}; - - -/** - * \class gemtm<0,0,0,0> Gemtm.h "tvmet/meta/Gemtm.h" - * \brief gemtm Specialized for recursion. - */ -template<> -class gemtm<0,0,0,0> -{ - gemtm(); - gemtm(const gemtm&); - gemtm& operator=(const gemtm&); - -public: - template<class E1, class E2> - static inline - XprNull prod(const E1&, const E2&, int, int) { - return XprNull(); - } -}; - - -} // namespace meta - -} // namespace tvmet - -#endif /* TVMET_META_GEMTM_H */ - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/include/tvmet/meta/Gemtv.h b/tvmet-1.7.1/include/tvmet/meta/Gemtv.h deleted file mode 100644 index 93c333687..000000000 --- a/tvmet-1.7.1/include/tvmet/meta/Gemtv.h +++ /dev/null @@ -1,99 +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.4 2004/06/17 15:53:12 opetzold Exp $ - */ - -#ifndef TVMET_META_GEMTV_H -#define TVMET_META_GEMTV_H - -#include <tvmet/xpr/Null.h> - -namespace tvmet { - -namespace meta { - - -/** - * \class gemtv Gemtv.h "tvmet/meta/Gemtv.h" - * \brief Meta class for matrix-transpose-vector operations. - * using formula - * \f[ - * M^T\,v - * \f] - */ -template<int Rows, int Cols, - int I> -class gemtv -{ - gemtv(); - gemtv(const gemtv&); - gemtv& operator=(const gemtv&); - -private: - enum { - doIt = I < (Rows-1) /**< recursive counter */ - }; - -public: - /** Meta template for %Matrix lhs %Vector rhs product. */ - 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 j) { - return lhs(I, j) * rhs(I) - + gemtv<Rows * doIt, Cols * doIt, - (I+1)* doIt>::prod(lhs, rhs, j); - } -}; - - -/** - * \class gemtv<0,0,0> Gemtv.h "tvmet/meta/Gemtv.h" - * \brief gemtv Specialized for recursion - */ -template<> -class gemtv<0,0,0> -{ - gemtv(); - gemtv(const gemtv&); - gemtv& operator=(const gemtv&); - -public: - template<class E1, class E2> - static inline - XprNull prod(const E1&, const E2&, int) { - return XprNull(); - } -}; - - -} // namespace meta - -} // namespace tvmet - -#endif /* TVMET_META_GEMTV_H */ - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/include/tvmet/meta/Gemv.h b/tvmet-1.7.1/include/tvmet/meta/Gemv.h deleted file mode 100644 index fda045f71..000000000 --- a/tvmet-1.7.1/include/tvmet/meta/Gemv.h +++ /dev/null @@ -1,99 +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.9 2004/06/17 15:53:12 opetzold Exp $ - */ - -#ifndef TVMET_META_GEMV_H -#define TVMET_META_GEMV_H - -#include <tvmet/xpr/Null.h> - -namespace tvmet { - -namespace meta { - - -/** - * \class gemv Gemv.h "tvmet/meta/Gemv.h" - * \brief Meta class for matrix-vector operations. - * using formula - * \f[ - * M\,v - * \f] - */ -template<int Rows, int Cols, - int J> -class gemv -{ - gemv(); - gemv(const gemv&); - gemv& operator=(const gemv&); - -private: - enum { - doIt = J < (Cols-1) /**< recursive counter */ - }; - -public: - /** Meta template for %Matrix lhs %Vector rhs product. */ - 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) { - return lhs(i, J) * rhs(J) - + gemv<Rows * doIt, Cols * doIt, - (J+1)* doIt>::prod(lhs, rhs, i); - } -}; - - -/** - * \class gemv<0,0,0> Gemv.h "tvmet/meta/Gemv.h" - * \brief gemv Specialized for recursion - */ -template<> -class gemv<0,0,0> -{ - gemv(); - gemv(const gemv&); - gemv& operator=(const gemv&); - -public: - template<class E1, class E2> - static inline - XprNull prod(const E1&, const E2&, int) { - return XprNull(); - } -}; - - -} // namespace meta - -} // namespace tvmet - -#endif /* TVMET_META_GEMV_H */ - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/include/tvmet/meta/Matrix.h b/tvmet-1.7.1/include/tvmet/meta/Matrix.h deleted file mode 100644 index b6b4014dc..000000000 --- a/tvmet-1.7.1/include/tvmet/meta/Matrix.h +++ /dev/null @@ -1,165 +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.15 2004/09/16 09:14:18 opetzold Exp $ - */ - -#ifndef TVMET_META_MATRIX_H -#define TVMET_META_MATRIX_H - -#include <tvmet/Traits.h> -#include <tvmet/xpr/Null.h> - -namespace tvmet { - -namespace meta { - - -/** - * \class Matrix Matrix.h "tvmet/meta/Matrix.h" - * \brief Meta %Matrix class using expression and meta templates. - */ -template<int Rows, int Cols, - int M=0, int N=0> -class Matrix -{ - Matrix(); - Matrix(const Matrix&); - Matrix& operator=(const Matrix&); - -private: - enum { - doRows = (M < Rows - 1) ? 1 : 0, /**< recursive counter Rows. */ - doCols = (N < Cols - 1) ? 1 : 0 /**< recursive counter Cols. */ - }; - -public: - /** assign an expression on columns on given row using the functional assign_fn. */ - template<class Dest, class Src, class Assign> - static inline - void assign2(Dest& lhs, const Src& rhs, const Assign& assign_fn) { - assign_fn.apply_on(lhs(M, N), rhs(M, N)); - Matrix<Rows * doCols, Cols * doCols, - M * doCols, (N+1) * doCols>::assign2(lhs, rhs, assign_fn); - } - - /** assign an expression on row-wise using the functional assign_fn. */ - template<class Dest, class Src, class Assign> - static inline - void assign(Dest& lhs, const Src& rhs, const Assign& assign_fn) { - Matrix<Rows, Cols, - M, 0>::assign2(lhs, rhs, assign_fn); - Matrix<Rows * doRows, Cols * doRows, - (M+1) * doRows, 0>::assign(lhs, rhs, assign_fn); - } - - /** evaluate a given matrix expression, column wise. */ - template<class E> - static inline - bool all_elements2(const E& e) { - if(!e(M, N)) return false; - return Matrix<Rows * doCols, Cols * doCols, - M * doCols, (N+1) * doCols>::all_elements2(e); - } - - /** evaluate a given matrix expression, row wise. */ - template<class E> - static inline - bool all_elements(const E& e) { - if(!Matrix<Rows, Cols, M, 0>::all_elements2(e) ) return false; - return Matrix<Rows * doRows, Cols * doRows, - (M+1) * doRows, 0>::all_elements(e); - } - - /** evaluate a given matrix expression, column wise. */ - template<class E> - static inline - bool any_elements2(const E& e) { - if(e(M, N)) return true; - return Matrix<Rows * doCols, Cols * doCols, - M * doCols, (N+1) * doCols>::any_elements2(e); - } - - /** evaluate a given matrix expression, row wise. */ - template<class E> - static inline - bool any_elements(const E& e) { - if(Matrix<Rows, Cols, M, 0>::any_elements2(e) ) return true; - return Matrix<Rows * doRows, Cols * doRows, - (M+1) * doRows, 0>::any_elements(e); - } - - /** trace a given matrix expression. */ - template<class E> - static inline - typename E::value_type - trace(const E& e) { - return e(M, N) - + Matrix<Rows * doCols, Cols * doCols, - (M+1) * doCols, (N+1) * doCols>::trace(e); - } - -}; - - -/** - * \class Matrix<0, 0, 0, 0> Matrix.h "tvmet/meta/Matrix.h" - * \brief Meta %Matrix specialized for recursion. - */ -template<> -class Matrix<0, 0, 0, 0> -{ - Matrix(); - Matrix(const Matrix&); - Matrix& operator=(const Matrix&); - -public: - template<class Dest, class Src, class Assign> - static inline void assign2(Dest&, const Src&, const Assign&) { } - - template<class Dest, class Src, class Assign> - static inline void assign(Dest&, const Src&, const Assign&) { } - - template<class E> - static inline bool all_elements2(const E&) { return true; } - - template<class E> - static inline bool all_elements(const E&) { return true; } - - template<class E> - static inline bool any_elements2(const E&) { return false; } - - template<class E> - static inline bool any_elements(const E&) { return false; } - - template<class E> - static inline XprNull trace(const E&) { return XprNull(); } -}; - - -} // namespace meta - -} // namespace tvmet - -#endif /* TVMET_META_MATRIX_H */ - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/include/tvmet/meta/Vector.h b/tvmet-1.7.1/include/tvmet/meta/Vector.h deleted file mode 100644 index 02888c4cb..000000000 --- a/tvmet-1.7.1/include/tvmet/meta/Vector.h +++ /dev/null @@ -1,154 +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.20 2004/09/16 09:14:18 opetzold Exp $ - */ - -#ifndef TVMET_META_VECTOR_H -#define TVMET_META_VECTOR_H - -#include <tvmet/Traits.h> -#include <tvmet/xpr/Null.h> - -namespace tvmet { - -/* forwards */ -template<class T, int Sz> class Vector; - - -namespace meta { - - -/** - * \class Vector Vector.h "tvmet/meta/Vector.h" - * \brief Meta %Vector class using expression templates - */ -template<int Sz, int K=0> -class Vector -{ - Vector(); - Vector(const Vector&); - Vector& operator=(const Vector&); - -private: - enum { - doIt = (K < (Sz-1)) ? 1 : 0 /**< recursive counter */ - }; - -public: - /** assign an expression expr using the functional assign_fn. */ - template <class Dest, class Src, class Assign> - static inline - void assign(Dest& lhs, const Src& rhs, const Assign& assign_fn) { - assign_fn.apply_on(lhs(K), rhs(K)); - meta::Vector<Sz * doIt, (K+1) * doIt>::assign(lhs, rhs, assign_fn); - } - - /** build the sum of the vector. */ - template<class E> - static inline - typename E::value_type - sum(const E& e) { - return e(K) + meta::Vector<Sz * doIt, (K+1) * doIt>::sum(e); - } - - /** build the product of the vector. */ - template<class E> - static inline - typename Traits< - typename E::value_type - >::sum_type - product(const E& e) { - return e(K) * meta::Vector<Sz * doIt, (K+1) * doIt>::product(e); - } - - /** build the dot product of the vector. */ - template<class Dest, class Src> - static inline - typename PromoteTraits< - typename Dest::value_type, - typename Src::value_type - >::value_type - dot(const Dest& lhs, const Src& rhs) { - return lhs(K) * rhs(K) - + meta::Vector<Sz * doIt, (K+1) * doIt>::dot(lhs, rhs); - } - - /** check for all elements */ - template<class E> - static inline - bool - all_elements(const E& e) { - if(!e(K)) return false; - return meta::Vector<Sz * doIt, (K+1) * doIt>::all_elements(e); - } - - /** check for any elements */ - template<class E> - static inline - bool - any_elements(const E& e) { - if(e(K)) return true; - return meta::Vector<Sz * doIt, (K+1) * doIt>::any_elements(e); - } -}; - - -/** - * \class Vector<0,0> Vector.h "tvmet/meta/Vector.h" - * \brief Meta %Vector Specialized for recursion - */ -template<> -class Vector<0,0> -{ - Vector(); - Vector(const Vector&); - Vector& operator=(const Vector&); - -public: - template <class Dest, class Src, class Assign> - static inline void assign(Dest&, const Src&, const Assign&) { } - - template<class E> - static inline XprNull sum(const E&) { return XprNull(); } - - template<class E> - static inline XprNull product(const E&) { return XprNull(); } - - template<class Dest, class Src> - static inline XprNull dot(const Dest&, const Src&) { return XprNull(); } - - template<class E> - static inline bool all_elements(const E&) { return true; } - - template<class E> - static inline bool any_elements(const E&) { return false; } -}; - - -} // namespace meta - -} // namespace tvmet - -#endif /* TVMET_META_VECTOR_H */ - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/include/tvmet/tvmet.h b/tvmet-1.7.1/include/tvmet/tvmet.h deleted file mode 100644 index 9af49498a..000000000 --- a/tvmet-1.7.1/include/tvmet/tvmet.h +++ /dev/null @@ -1,140 +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: tvmet.h,v 1.17 2004/11/04 16:28:32 opetzold Exp $ - */ - -#ifndef TVMET_H -#define TVMET_H - -#include <tvmet/config.h> - -// this might not work on all platforms. Specifically, Qt uses a -// slightly different solution in the case when compiler==intel && -// os != windows. See in Qt's source code, the definition of Q_UNUSED -// in src/corelib/global/qglobal.h -#define TVMET_UNUSED(x) (void)x - -/* - * Complexity triggers, compiler and architecture specific. - * If not defined, use defaults. - */ - -/** - * \def TVMET_COMPLEXITY_DEFAULT_TRIGGER - * \brief Trigger for changing the matrix-product strategy. - */ -#if !defined(TVMET_COMPLEXITY_DEFAULT_TRIGGER) -# define TVMET_COMPLEXITY_DEFAULT_TRIGGER 1000 -#endif - -/** - * \def TVMET_COMPLEXITY_M_ASSIGN_TRIGGER - * \brief Trigger for changing the matrix assign strategy. - */ -#if !defined(TVMET_COMPLEXITY_M_ASSIGN_TRIGGER) -# define TVMET_COMPLEXITY_M_ASSIGN_TRIGGER 8*8 -#endif - -/** - * \def TVMET_COMPLEXITY_MM_TRIGGER - * \brief Trigger for changing the matrix-matrix-product strategy. - * One strategy to build the matrix-matrix-product is to use - * meta templates. The other to use looping. - */ -#if !defined(TVMET_COMPLEXITY_MM_TRIGGER) -# define TVMET_COMPLEXITY_MM_TRIGGER 8*8 -#endif - -/** - * \def TVMET_COMPLEXITY_V_ASSIGN_TRIGGER - * \brief Trigger for changing the vector assign strategy. - */ -#if !defined(TVMET_COMPLEXITY_V_ASSIGN_TRIGGER) -# define TVMET_COMPLEXITY_V_ASSIGN_TRIGGER 8 -#endif - -/** - * \def TVMET_COMPLEXITY_MV_TRIGGER - * \brief Trigger for changing the matrix-vector strategy. - * One strategy to build the matrix-vector-product is to use - * meta templates. The other to use looping. - */ -#if !defined(TVMET_COMPLEXITY_MV_TRIGGER) -# define TVMET_COMPLEXITY_MV_TRIGGER 8*8 -#endif - -/*********************************************************************** - * Namespaces - ***********************************************************************/ - -/** - * \namespace std - * \brief Imported ISO/IEC 14882:1998 functions from std namespace. - */ - -/** - * \namespace tvmet - * \brief The namespace for the Tiny %Vector %Matrix using Expression Templates Libary. - */ - -/** - * \namespace tvmet::meta - * \brief Meta stuff inside here. - */ - -/** - * \namespace tvmet::loop - * \brief Loop stuff inside here. - */ - -/** - * \namespace tvmet::element_wise - * \brief Operators inside this namespace does elementwise operations. - */ - -/** - * \namespace tvmet::util - * \brief Miscellaneous utility functions used. - */ - - -/*********************************************************************** - * forwards - ***********************************************************************/ -#if defined(EIGEN_USE_COMPLEX) -namespace std { - template<class T> class complex; -} -#endif - - -/*********************************************************************** - * other stuff - ***********************************************************************/ -#include <tvmet/TvmetBase.h> - - -#endif // TVMET_H - -// Local Variables: -// mode:C++ -// End: -// LocalWords: gnuc gcc's icc's std diff --git a/tvmet-1.7.1/include/tvmet/util/General.h b/tvmet-1.7.1/include/tvmet/util/General.h deleted file mode 100644 index f6247d4b8..000000000 --- a/tvmet-1.7.1/include/tvmet/util/General.h +++ /dev/null @@ -1,125 +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: General.h,v 1.9 2004/09/16 09:14:18 opetzold Exp $ - */ - -#ifndef TVMET_UTIL_GENERAL_H -#define TVMET_UTIL_GENERAL_H - - -/** forward */ -namespace tvmet { -template<class T, int Rows, int Cols> class Matrix; -template<class T, int Sz> class Vector; -} - -namespace tvmet { - -namespace util { - -/* - * \defgroup _util_function - * \brief Usefull utility functions - */ - -/** - * \fn Gemm(const Matrix<T, Rows, Cols>& m1, const Matrix<T, Rows, Cols>& m2, Matrix<T, Rows, Cols>& m3) - * \brief General matrix matrix multiplication using loops. - * \ingroup _util_function - */ -template<class T, int Rows, int Cols> -inline -void -Gemm(const Matrix<T, Rows, Cols>& m1, const Matrix<T, Rows, Cols>& m2, - Matrix<T, Rows, Cols>& m3) -{ - for (int i = 0; i < Rows; ++i) { - for (int j = 0; j < Cols; ++j) { - T sum(0); - for (int k = 0; k < Cols; ++k) { - sum += m1(i,k) * m2(k,j); - } - m3(i,j) = sum; - } - } -} - - -/** - * \fn Gemv(const Matrix<T, Rows, Cols>& m, const Vector<T, Cols>& v, Vector<T, Cols>& v2) - * \brief General matrix vector multiplication using loops. - * \ingroup _util_function - */ -template<class T, int Rows, int Cols> -inline -void -Gemv(const Matrix<T, Rows, Cols>& m, const Vector<T, Cols>& v, - Vector<T, Cols>& v2) -{ - for (int i = 0; i < Rows; ++i){ - v2(i) = T(0); // clean up before use - for (int j = 0; j < Cols; ++j) { - v2(i) += m(i,j) * v(j); - } - } -} - - -/** - * \fn Gevvmul(const Vector<T, Sz>& v1, const Vector<T, Sz>& v2, Vector<T, Sz>& v3) - * \brief General vector vector elementwise multiplication using loop. - * \ingroup _util_function - */ -template<class T, int Sz> -inline -void -Gevvmul(const Vector<T, Sz>& v1, const Vector<T, Sz>& v2, - Vector<T, Sz>& v3) -{ - for(int i = 0; i < Sz; ++i) - v3(i) = v1(i) * v2(i); -} - - -/** - * \fn Gevvadd(const Vector<T, Sz>& v1, const Vector<T, Sz>& v2, Vector<T, Sz>& v3) - * \brief General vector vector elementwise multiplication using loop. - * \ingroup _util_function - */ -template<class T, int Sz> -inline -void -Gevvadd(const Vector<T, Sz>& v1, const Vector<T, Sz>& v2, - Vector<T, Sz>& v3) -{ - for(int i = 0; i < Sz; ++i) - v3(i) = v1(i) + v2(i); -} - -} // namespace util - -} // namespace tvmet - -#endif // TVMET_UTIL_GENERAL_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/include/tvmet/util/Incrementor.h b/tvmet-1.7.1/include/tvmet/util/Incrementor.h deleted file mode 100644 index 809865de7..000000000 --- a/tvmet-1.7.1/include/tvmet/util/Incrementor.h +++ /dev/null @@ -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: Incrementor.h,v 1.3 2004/09/16 09:14:18 opetzold Exp $ - */ - -#ifndef TVMET_UTIL_INCREMENTOR_H -#define TVMET_UTIL_INCREMENTOR_H - -namespace tvmet { - -namespace util { - - -/** - * \class Incrementor Incrementor.h "tvmet/util/Incrementor.h" - * \brief A simple incrementor class. - * The start value is given at construction time. After - * each access the class increments the internal counter. - * \ingroup _util_function - * - * \par Example: - * \code - * #include <algorithm> - * - * using namespace tvmet; - * - * ... - * - * std::generate(m1.begin(), m1.end(), - * util::Incrementor<typename matrix_type::value_type>()); - * \endcode - */ -template<class T> -struct Incrementor -{ - Incrementor(T start=0) : m_inc(start) { } - T operator()() { m_inc+=1; return m_inc; } - -private: - T m_inc; -}; - - -#if defined(EIGEN_USE_COMPLEX) -/** - * \class Incrementor< std::complex<T> > Incrementor.h "tvmet/util/Incrementor.h" - * \brief Specialized Incrementor class. - * \ingroup _util_function - */ -template<class T> -struct Incrementor< std::complex<T> > { - Incrementor(const std::complex<T>& start=0) - : m_inc(start) { } - std::complex<T> operator()() { - m_inc += std::complex<T>(1,1); - return m_inc; - } -private: - std::complex<T> m_inc; -}; -#endif // defined(EIGEN_USE_COMPLEX) - - -} // namespace util - -} // namespace tvmet - -#endif // TVMET_UTIL_INCREMENTOR_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/include/tvmet/xpr/BinOperator.h b/tvmet-1.7.1/include/tvmet/xpr/BinOperator.h deleted file mode 100644 index 11ade5eb3..000000000 --- a/tvmet-1.7.1/include/tvmet/xpr/BinOperator.h +++ /dev/null @@ -1,104 +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: BinOperator.h,v 1.15 2004/09/16 09:14:18 opetzold Exp $ - */ - -#ifndef TVMET_XPR_BINOPERATOR_H -#define TVMET_XPR_BINOPERATOR_H - -#include <tvmet/TypePromotion.h> - -namespace tvmet { - - -/** - * \class XprBinOp BinOperator.h "tvmet/xpr/BinOperator.h" - * \brief Binary operators working on two sub expressions. - * - * On acessing using the index operator() the binary operation will be - * evaluated at compile time. - */ -template<class BinOp, class E1, class E2> -class XprBinOp - : public TvmetBase< XprBinOp<BinOp, E1, E2> > -{ - XprBinOp(); - XprBinOp& operator=(const XprBinOp&); - -public: - typedef typename BinOp::value_type value_type; - -public: - /** Complexity counter. */ - enum { - ops_lhs = E1::ops, - ops_rhs = E2::ops, - ops = 2 * (ops_lhs + ops_rhs) // lhs op rhs - }; - -public: - /** Constructor for two expressions. */ - explicit XprBinOp(const E1& lhs, const E2& rhs) - : m_lhs(lhs), m_rhs(rhs) - { } - - /** Copy Constructor. Not explicit! */ -#if defined(TVMET_OPTIMIZE_XPR_MANUAL_CCTOR) - XprBinOp(const XprBinOp& e) - : m_lhs(e.m_lhs), m_rhs(e.m_rhs) - { } -#endif - - /** Index operator, evaluates the expression inside. */ - value_type operator()(int i) const { - return BinOp::apply_on(m_lhs(i), m_rhs(i)); - } - - /** Index operator for arrays/matrices */ - value_type operator()(int i, int j) const { - return BinOp::apply_on(m_lhs(i, j), m_rhs(i, j)); - } - -public: // debugging Xpr parse tree - void print_xpr(std::ostream& os, int l=0) const { - os << IndentLevel(l++) - << "XprBinOp[O="<< ops << ", (O1=" << ops_lhs << ", O2=" << ops_rhs << ")]<" - << std::endl; - BinOp::print_xpr(os, l); - m_lhs.print_xpr(os, l); - m_rhs.print_xpr(os, l); - os << IndentLevel(--l) - << ">," << std::endl; - } - -private: - const E1 m_lhs; - const E2 m_rhs; -}; - - -} // namespace tvmet - -#endif // TVMET_XPR_BINOPERATOR_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/include/tvmet/xpr/CMakeLists.txt b/tvmet-1.7.1/include/tvmet/xpr/CMakeLists.txt deleted file mode 100644 index 06cf78c0c..000000000 --- a/tvmet-1.7.1/include/tvmet/xpr/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -FILE(GLOB tvmet_xpr_header_SRCS "*.h") - -INSTALL(FILES - ${tvmet_xpr_header_SRCS} - DESTINATION ${INCLUDE_INSTALL_DIR}/xpr - ) diff --git a/tvmet-1.7.1/include/tvmet/xpr/Eval.h b/tvmet-1.7.1/include/tvmet/xpr/Eval.h deleted file mode 100644 index 7ed92161b..000000000 --- a/tvmet-1.7.1/include/tvmet/xpr/Eval.h +++ /dev/null @@ -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: Eval.h,v 1.9 2003/11/30 18:35:17 opetzold Exp $ - */ - -#ifndef TVMET_XPR_EVAL_H -#define TVMET_XPR_EVAL_H - -namespace tvmet { - - -/** - * \class XprEval Eval.h "tvmet/xpr/Eval.h" - * \brief evaluate the expression - * - * Since we can't overwrite the ? operator we have to write a wrapper - * for expression like return v1>v2 ? true : false - */ -template<class E1, class E2, class E3> -class XprEval - : public TvmetBase< XprEval<E1, E2, E3> > -{ -public: - typedef E1 expr1_type; - typedef E2 expr2_type; - typedef E3 expr3_type; - - typedef typename expr2_type::value_type value2_type; - typedef typename expr3_type::value_type value3_type; - - typedef typename - PromoteTraits<value2_type, value3_type>::value_type value_type; - -public: - /** Complexity Counter */ - enum { - ops_expr1 = E1::ops, - ops_expr2 = E2::ops, - ops_expr3 = E3::ops, - ops = ops_expr1 // only (e1 op e2) are evaluated - }; - -private: - XprEval(); - XprEval& operator=(const XprEval<expr1_type, expr2_type, expr3_type>&); - -public: - /** Constructor */ - explicit XprEval(const expr1_type& e1, const expr2_type& e2, const expr3_type& e3) - : m_expr1(e1), m_expr2(e2), m_expr3(e3) - { } - - /** Copy Constructor. Not explicit! */ -#if defined(TVMET_OPTIMIZE_XPR_MANUAL_CCTOR) - XprEval(const XprEval& rhs) - : m_expr1(rhs.m_expr1), m_expr2(rhs.m_expr2), m_expr3(rhs.m_expr3) - { } -#endif - -public: //access - /** index operator for vectors. */ - value_type operator()(int i) const { - return m_expr1(i) ? m_expr2(i) : m_expr3(i); - } - - /** index operator for matrizes. */ - value_type operator()(int i, int j) const { - return m_expr1(i, j) ? m_expr2(i, j) : m_expr3(i, j); - } - -public: // debugging Xpr parse tree - void print_xpr(std::ostream& os, int l=0) const { - os << IndentLevel(l++) - << "XprEval[" << ops << ", (" - << ops_expr1 << ", " << ops_expr2 << ", " << ops_expr3 << ")]<" - << std::endl; - m_expr1.print_xpr(os, l); - m_expr2.print_xpr(os, l); - m_expr3.print_xpr(os, l); - os << IndentLevel(--l) - << ">," << std::endl; - } - -private: - const expr1_type m_expr1; - const expr2_type m_expr2; - const expr3_type m_expr3; -}; - - -} // namespace tvmet - -#endif // TVMET_XPR_EVAL_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/include/tvmet/xpr/Identity.h b/tvmet-1.7.1/include/tvmet/xpr/Identity.h deleted file mode 100644 index 7b13fa6b6..000000000 --- a/tvmet-1.7.1/include/tvmet/xpr/Identity.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * $Id: Identity.h,v 1.3 2004/09/16 09:14:18 opetzold Exp $ - */ - -#ifndef TVMET_XPR_IDENTITY_H -#define TVMET_XPR_IDENTITY_H - - -namespace tvmet { - - -/** - * \class XprIdentity Identity.h "tvmet/xpr/Identity.h" - * \brief Expression for the identity matrix. - * - * This expression doesn't hold any other expression, it - * simply returns 1 or 0 depends where the row and column - * element excess is done. - * - * \since release 1.6.0 - * \sa identity - */ -template<class T, int Rows, int Cols> -struct XprIdentity - : public TvmetBase< XprIdentity<T, Rows, Cols> > -{ - XprIdentity& operator=(const XprIdentity&); - -public: - typedef T value_type; - -public: - /** Complexity counter. */ - enum { - ops_assign = Rows * Cols, - ops = ops_assign - }; - -public: - /** access by index. */ - value_type operator()(int i, int j) const { - return i==j ? 1 : 0; - } - -public: // debugging Xpr parse tree - void print_xpr(std::ostream& os, int l=0) const { - os << IndentLevel(l++) - << "XprIdentity[O="<< ops << ")]<" - << std::endl; - os << IndentLevel(l) - << typeid(T).name() << "," - << "R=" << Rows << ", C=" << Cols << std::endl; - os << IndentLevel(--l) << ">" - << ((l != 0) ? "," : "") << std::endl; - } -}; - - -} // namespace tvmet - - -#endif // TVMET_XPR_IDENTITY_H - - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/include/tvmet/xpr/Literal.h b/tvmet-1.7.1/include/tvmet/xpr/Literal.h deleted file mode 100644 index 85d9c79c0..000000000 --- a/tvmet-1.7.1/include/tvmet/xpr/Literal.h +++ /dev/null @@ -1,89 +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: Literal.h,v 1.9 2003/11/30 18:35:17 opetzold Exp $ - */ - -#ifndef TVMET_XPR_LITERAL_H -#define TVMET_XPR_LITERAL_H - -namespace tvmet { - - -/** - * \class XprLiteral Literal.h "tvmet/xpr/Literal.h" - * \brief Specify literals like scalars into the expression. - * This expression is used for vectors and matrices - the - * decision is done by the access operator. - */ -template<class T> -class XprLiteral - : public TvmetBase< XprLiteral<T> > -{ - XprLiteral(); - XprLiteral& operator=(const XprLiteral&); - -public: - typedef T value_type; - -public: - /** Complexity counter. */ - enum { - ops = 1 - }; - -public: - /** Constructor by value for literals . */ - explicit XprLiteral(value_type value) - : m_data(value) - { } - - /** Copy Constructor. Not explicit! */ -#if defined(TVMET_OPTIMIZE_XPR_MANUAL_CCTOR) - XprLiteral(const XprLiteral& e) - : m_data(e.m_data) - { } -#endif - - /** Index operator, gives the value for vectors. */ - value_type operator()(int) const { return m_data; } - - /** Index operator for arrays/matrices. */ - value_type operator()(int, int) const { return m_data; } - -public: // debugging Xpr parse tree - void print_xpr(std::ostream& os, int l=0) const { - os << IndentLevel(l++) << "XprLiteral[O=" << ops << "]<T=" - << typeid(value_type).name() - << ">," << std::endl; - } - -private: - const value_type m_data; -}; - - -} // namespace tvmet - -#endif // TVMET_XPR_LITERAL_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/include/tvmet/xpr/MMProduct.h b/tvmet-1.7.1/include/tvmet/xpr/MMProduct.h deleted file mode 100644 index 0d165ea8c..000000000 --- a/tvmet-1.7.1/include/tvmet/xpr/MMProduct.h +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Tiny Vector Matrix Library - * Dense Vector Matrix Libary of Tiny size using Expression Templates - * - * Copyright (C) 2001 - 2003 Olaf Petzold <opetzold@users.sourceforge.net> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id: MMProduct.h,v 1.20 2004/09/16 09:14:18 opetzold Exp $ - */ - -#ifndef TVMET_XPR_MMPRODUCT_H -#define TVMET_XPR_MMPRODUCT_H - -#include <cassert> - -#include <tvmet/meta/Gemm.h> -#include <tvmet/loop/Gemm.h> - -namespace tvmet { - - -/** - * \class XprMMProduct MMProduct.h "tvmet/xpr/MMProduct.h" - * \brief Expression for matrix-matrix product. - * Using formula: - * \f[ - * M_1\,M_2 - * \f] - * \note The Rows2 has to be equal to Cols1. - */ -template<class E1, int Rows1, int Cols1, - class E2, int Cols2> -class XprMMProduct - : public TvmetBase< XprMMProduct<E1, Rows1, Cols1, E2, Cols2> > -{ -private: - XprMMProduct(); - XprMMProduct& operator=(const XprMMProduct&); - -public: - typedef typename PromoteTraits< - typename E1::value_type, - typename E2::value_type - >::value_type value_type; - -public: - /** Complexity counter. */ - enum { - ops_lhs = E1::ops, - ops_rhs = E2::ops, - M = Rows1 * Cols1 * Cols2, - N = Rows1 * (Cols1 - 1) * Cols2, - ops_plus = M * Traits<value_type>::ops_plus, - ops_muls = N * Traits<value_type>::ops_muls, - ops = ops_plus + ops_muls, - use_meta = Rows1*Cols2 < TVMET_COMPLEXITY_MM_TRIGGER ? true : false - }; - -public: - /** Constructor. */ - explicit XprMMProduct(const E1& lhs, const E2& rhs) - : m_lhs(lhs), m_rhs(rhs) - { } - - /** Copy Constructor. Not explicit! */ -#if defined(TVMET_OPTIMIZE_XPR_MANUAL_CCTOR) - XprMMProduct(const XprMMProduct& e) - : m_lhs(e.m_lhs), m_rhs(e.m_rhs) - { } -#endif - -private: - /** Wrapper for meta gemm. */ - static inline - value_type do_gemm(dispatch<true>, const E1& lhs, const E2& rhs, int i, int j) { - return meta::gemm<Rows1, Cols1, - Cols2, - 0>::prod(lhs, rhs, i, j); - } - - /** Wrapper for loop gemm. */ - static inline - value_type do_gemm(dispatch<false>, const E1& lhs, const E2& rhs, int i, int j) { - return loop::gemm<Rows1, Cols1, Cols2>::prod(lhs, rhs, i, j); - } - -public: - /** index operator for arrays/matrices */ - value_type operator()(int i, int j) const { - assert((i < Rows1) && (j < Cols2)); - return do_gemm(dispatch<use_meta>(), m_lhs, m_rhs, i, j); - } - -public: // debugging Xpr parse tree - void print_xpr(std::ostream& os, int l=0) const { - os << IndentLevel(l++) - << "XprMMProduct[" - << (use_meta ? "M" : "L") << ", O=" << ops - << ", (O1=" << ops_lhs << ", O2=" << ops_rhs << ")]<" - << std::endl; - m_lhs.print_xpr(os, l); - os << IndentLevel(l) - << "R1=" << Rows1 << ", C1=" << Cols1 << ",\n"; - m_rhs.print_xpr(os, l); - os << IndentLevel(l) - << "C2=" << Cols2 << ",\n"; - os << IndentLevel(--l) - << ">," << std::endl; - } - -private: - const E1 m_lhs; - const E2 m_rhs; -}; - - -} // namespace tvmet - -#endif // TVMET_XPR_MMPRODUCT_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/include/tvmet/xpr/MMProductTransposed.h b/tvmet-1.7.1/include/tvmet/xpr/MMProductTransposed.h deleted file mode 100644 index d869e3af8..000000000 --- a/tvmet-1.7.1/include/tvmet/xpr/MMProductTransposed.h +++ /dev/null @@ -1,138 +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: MMProductTransposed.h,v 1.16 2004/09/16 09:14:18 opetzold Exp $ - */ - -#ifndef TVMET_XPR_MMPRODUCT_TRANSPOSED_H -#define TVMET_XPR_MMPRODUCT_TRANSPOSED_H - -#include <cassert> - -#include <tvmet/meta/Gemm.h> -#include <tvmet/loop/Gemm.h> - -namespace tvmet { - - -/** - * \class XprMMProductTransposed MMProductTransposed.h "tvmet/xpr/MMProductTransposed.h" - * \brief Expression for transpose(matrix-matrix product). - * Using formula: - * \f[ - * (M_1\,M_2)^T - * \f] - * \note The Rows2 has to be equal to Cols1. - * The result is a (Cols2 x Rows1) matrix. - */ -template<class E1, int Rows1, int Cols1, - class E2, int Cols2> -class XprMMProductTransposed - : public TvmetBase< XprMMProductTransposed<E1, Rows1, Cols1, E2, Cols2> > -{ -private: - XprMMProductTransposed(); - XprMMProductTransposed& operator=(const XprMMProductTransposed&); - -public: - typedef typename PromoteTraits< - typename E1::value_type, - typename E2::value_type - >::value_type value_type; - -public: - /** Complexity counter. */ - enum { - ops_lhs = E1::ops, - ops_rhs = E2::ops, - M = Rows1 * Cols1 * Cols2, - N = Rows1 * (Cols1-1) * Cols2, - ops_plus = M * Traits<value_type>::ops_plus, - ops_muls = N * Traits<value_type>::ops_muls, - ops = ops_plus + ops_muls, - use_meta = Cols2*Rows1 < TVMET_COMPLEXITY_MM_TRIGGER ? true : false - }; - -public: - /** Constructor. */ - explicit XprMMProductTransposed(const E1& lhs, const E2& rhs) - : m_lhs(lhs), m_rhs(rhs) { } - - /** Copy Constructor. Not explicit! */ -#if defined(TVMET_OPTIMIZE_XPR_MANUAL_CCTOR) - XprMMProductTransposed(const XprMMProductTransposed& e) - : m_lhs(e.m_lhs), m_rhs(e.m_rhs) - { } -#endif - -private: - /** Wrapper for meta gemm. */ - static inline - value_type do_gemm(dispatch<true>, const E1& lhs, const E2& rhs, int i, int j) { - return meta::gemm<Rows1, Cols1, - Cols2, - 0>::prod(lhs, rhs, i, j); - } - - /** Wrapper for loop gemm. */ - static inline - value_type do_gemm(dispatch<false>, const E1& lhs, const E2& rhs, int i, int j) { - return loop::gemm<Rows1, Cols1, Cols2>::prod(lhs, rhs, i, j); - } - -public: - /** index operator for arrays/matrices */ - value_type operator()(int i, int j) const { - assert((i < Cols2) && (j < Rows1)); - return do_gemm(dispatch<use_meta>(), m_lhs, m_rhs, j, i); - } - -public: // debugging Xpr parse tree - void print_xpr(std::ostream& os, int l=0) const { - os << IndentLevel(l++) - << "XprMMProductTransposed[" - << (use_meta ? "M" : "L") << ", O=" << ops - << ", (O1=" << ops_lhs << ", O2=" << ops_rhs << ")]<" - << std::endl; - m_lhs.print_xpr(os, l); - os << IndentLevel(l) - << "R1=" << Rows1 << ", C1=" << Cols1 << ",\n"; - m_rhs.print_xpr(os, l); - os << IndentLevel(l) - << "C2=" << Cols2 << ",\n" - << IndentLevel(l) - << "\n" - << IndentLevel(--l) - << ">," << std::endl; - } - -private: - const E1 m_lhs; - const E2 m_rhs; -}; - - -} // namespace tvmet - -#endif // TVMET_XPR_MMPRODUCT_TRANSPOSED_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/include/tvmet/xpr/MMtProduct.h b/tvmet-1.7.1/include/tvmet/xpr/MMtProduct.h deleted file mode 100644 index 71c6dda63..000000000 --- a/tvmet-1.7.1/include/tvmet/xpr/MMtProduct.h +++ /dev/null @@ -1,139 +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: MMtProduct.h,v 1.16 2004/09/16 09:14:18 opetzold Exp $ - */ - -#ifndef TVMET_XPR_MMTPRODUCT_H -#define TVMET_XPR_MMTPRODUCT_H - -#include <cassert> - -#include <tvmet/meta/Gemmt.h> -#include <tvmet/loop/Gemmt.h> - -namespace tvmet { - - -/** - * \class XprMMtProduct MMtProduct.h "tvmet/xpr/MMtProduct.h" - * \brief Expression for matrix-matrix product. - * Using formula: - * \f[ - * M_1\,M_2^T - * \f] - * \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<class E1, int Rows1, int Cols1, - class E2, int Cols2> -class XprMMtProduct - : public TvmetBase< XprMMtProduct<E1, Rows1, Cols1, E2, Cols2> > -{ -private: - XprMMtProduct(); - XprMMtProduct& operator=(const XprMMtProduct&); - -public: - typedef typename PromoteTraits< - typename E1::value_type, - typename E2::value_type - >::value_type value_type; - -public: - /** Complexity counter. */ - enum { - ops_lhs = E1::ops, - ops_rhs = E2::ops, - Rows2 = Cols1, - M = Rows1 * Cols1 * Rows1, - N = Rows1 * (Cols1 - 1) * Rows2, - ops_plus = M * Traits<value_type>::ops_plus, - ops_muls = N * Traits<value_type>::ops_muls, - ops = ops_plus + ops_muls, - use_meta = Rows1*Rows2 < TVMET_COMPLEXITY_MM_TRIGGER ? true : false - }; - -public: - /** Constructor. */ - explicit XprMMtProduct(const E1& lhs, const E2& rhs) - : m_lhs(lhs), m_rhs(rhs) - { } - - /** Copy Constructor. Not explicit! */ -#if defined(TVMET_OPTIMIZE_XPR_MANUAL_CCTOR) - XprMMtProduct(const XprMMtProduct& e) - : m_lhs(e.m_lhs), m_rhs(e.m_rhs) - { } -#endif - -private: - /** Wrapper for meta gemm. */ - static inline - value_type do_gemmt(dispatch<true>, const E1& lhs, const E2& rhs, int i, int j) { - return meta::gemmt<Rows1, Cols1, - Cols2, - 0>::prod(lhs, rhs, i, j); - } - - /** Wrapper for loop gemm. */ - static inline - value_type do_gemmt(dispatch<false>, const E1& lhs, const E2& rhs, int i, int j) { - return loop::gemmt<Rows1, Cols1, Cols1>::prod(lhs, rhs, i, j); - } - -public: - /** index operator for arrays/matrices */ - value_type operator()(int i, int j) const { - assert((i < Rows1) && (j < Rows2)); - return do_gemmt(dispatch<use_meta>(), m_lhs, m_rhs, i, j); - } - -public: // debugging Xpr parse tree - void print_xpr(std::ostream& os, int l=0) const { - os << IndentLevel(l++) - << "XprMMtProduct[" - << (use_meta ? "M" : "L") << ", O=" << ops - << ", (O1=" << ops_lhs << ", O2=" << ops_rhs << ")]<" - << std::endl; - m_lhs.print_xpr(os, l); - os << IndentLevel(l) - << "R1=" << Rows1 << ", C1=" << Cols1 << ",\n"; - m_rhs.print_xpr(os, l); - os << IndentLevel(l) - << "C2=" << Cols2 << ",\n" - << "\n" - << IndentLevel(--l) - << ">," << std::endl; - } - -private: - const E1 m_lhs; - const E2 m_rhs; -}; - - -} // namespace tvmet - -#endif // TVMET_XPR_MMTPRODUCT_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/include/tvmet/xpr/MVProduct.h b/tvmet-1.7.1/include/tvmet/xpr/MVProduct.h deleted file mode 100644 index 0b9202f15..000000000 --- a/tvmet-1.7.1/include/tvmet/xpr/MVProduct.h +++ /dev/null @@ -1,132 +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: MVProduct.h,v 1.17 2004/09/16 09:14:18 opetzold Exp $ - */ - -#ifndef TVMET_XPR_MVPRODUCT_H -#define TVMET_XPR_MVPRODUCT_H - -#include <cassert> - -#include <tvmet/meta/Gemv.h> -#include <tvmet/loop/Gemv.h> - -namespace tvmet { - - -/** - * \class XprMVProduct MVProduct.h "tvmet/xpr/MVProduct.h" - * \brief Expression for matrix-vector product - * using formula - * \f[ - * M\,v - * \f] - */ -template<class E1, int Rows, int Cols, - class E2> -class XprMVProduct - : public TvmetBase< XprMVProduct<E1, Rows, Cols, E2> > -{ - XprMVProduct(); - XprMVProduct& operator=(const XprMVProduct&); - -public: - typedef typename PromoteTraits< - typename E1::value_type, - typename E2::value_type - >::value_type value_type; - -public: - /** Complexity counter. */ - enum { - ops_lhs = E1::ops, - ops_rhs = E2::ops, - M = Rows * Cols, - N = Rows * (Cols - 1), - ops_plus = M * Traits<value_type>::ops_plus, - ops_muls = N * Traits<value_type>::ops_muls, - ops = ops_plus + ops_muls, - use_meta = Rows*Cols < TVMET_COMPLEXITY_MV_TRIGGER ? true : false - }; - -public: - /** Constructor. */ - explicit XprMVProduct(const E1& lhs, const E2& rhs) - : m_lhs(lhs), m_rhs(rhs) - { } - - /** Copy Constructor. Not explicit! */ -#if defined(TVMET_OPTIMIZE_XPR_MANUAL_CCTOR) - XprMVProduct(const XprMVProduct& e) - : m_lhs(e.m_lhs), m_rhs(e.m_rhs) - { } -#endif - -private: - /** Wrapper for meta gemm. */ - static inline - value_type do_gemv(dispatch<true>, const E1& lhs, const E2& rhs, int j) { - return meta::gemv<Rows, Cols, - 0>::prod(lhs, rhs, j); - } - - /** Wrapper for loop gemm. */ - static inline - value_type do_gemv(dispatch<false>, const E1& lhs, const E2& rhs, int j) { - return loop::gemv<Rows, Cols>::prod(lhs, rhs, j); - } - -public: - /** index operator, returns the expression by index. This is the vector - style since a matrix*vector gives a vector. */ - value_type operator()(int j) const { - assert(j < Rows); - return do_gemv(dispatch<use_meta>(), m_lhs, m_rhs, j); - } - -public: // debugging Xpr parse tree - void print_xpr(std::ostream& os, int l=0) const { - os << IndentLevel(l++) - << "XprMVProduct[" - << (use_meta ? "M" : "L") << ", O=" << ops - << ", (O1=" << ops_lhs << ", O2=" << ops_rhs << ")]<" - << std::endl; - m_lhs.print_xpr(os, l); - os << IndentLevel(l) - << "R=" << Rows << ", C=" << Cols << ",\n"; - m_rhs.print_xpr(os, l); - os << IndentLevel(--l) - << ">," << std::endl; - } - -private: - const E1 m_lhs; - const E2 m_rhs; -}; - - -} // namespace tvmet - -#endif // TVMET_XPR_MVPRODUCT_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/include/tvmet/xpr/Matrix.h b/tvmet-1.7.1/include/tvmet/xpr/Matrix.h deleted file mode 100644 index d10176f89..000000000 --- a/tvmet-1.7.1/include/tvmet/xpr/Matrix.h +++ /dev/null @@ -1,156 +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.22 2004/09/16 09:14:18 opetzold Exp $ - */ - -#ifndef TVMET_XPR_MATRIX_H -#define TVMET_XPR_MATRIX_H - -#include <cassert> - -#include <tvmet/meta/Matrix.h> -#include <tvmet/loop/Matrix.h> - -namespace tvmet { - - -/* forwards */ -template <class T, int Rows, int Cols> class Matrix; - -/** - * \class XprMatrix Matrix.h "tvmet/xpr/Matrix.h" - * \brief Represents the expression for vectors at any node in the parse tree. - * - * Specifically, XprMatrix is the class that wraps the expression, and the - * expression itself is represented by the template parameter E. The - * class XprMatrix is known as an anonymizing expression wrapper because - * it can hold any subexpression of arbitrary complexity, allowing - * clients to work with any expression by holding on to it via the - * wrapper, without having to know the name of the type object that - * actually implements the expression. - * \note leave the CCtors non-explicit to allow implicit type conversation. - */ -template<class E, int Rows, int Cols> -class XprMatrix - : public TvmetBase< XprMatrix<E, Rows, Cols> > -{ - XprMatrix(); - XprMatrix& operator=(const XprMatrix&); - -public: - /** Complexity counter. */ - enum { - ops_assign = Rows * Cols, - ops = E::ops, - use_meta = ops_assign < TVMET_COMPLEXITY_M_ASSIGN_TRIGGER ? true : false - }; - -public: - typedef typename E::value_type value_type; - -public: - /** Constructor. */ - explicit XprMatrix(const E& e) - : m_expr(e) - { } - - /** Copy Constructor. Not explicit! */ -#if defined(TVMET_OPTIMIZE_XPR_MANUAL_CCTOR) - XprMatrix(const XprMatrix& rhs) - : m_expr(rhs.m_expr) - { } -#endif - - /** access by index. */ - value_type operator()(int i, int j) const { - assert((i < Rows) && (j < Cols)); - return m_expr(i, j); - } - -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); - } - -public: - /** assign this expression to Matrix dest. */ - template<class Dest, class Assign> - void assign_to(Dest& dest, const Assign& assign_fn) const { - /* here is a way for caching, since each complex 'Node' - is of type XprMatrix. */ - do_assign(dispatch<use_meta>(), dest, *this, assign_fn); - } - -public: // debugging Xpr parse tree - void print_xpr(std::ostream& os, int l=0) const { - os << IndentLevel(l++) - << "XprMatrix[" - << (use_meta ? "M" : "L") << ", O=" << ops << "]<" - << std::endl; - m_expr.print_xpr(os, l); - os << IndentLevel(l) - << "R=" << Rows << ", C=" << Cols << std::endl; - os << IndentLevel(--l) << ">" - << ((l != 0) ? "," : "") << std::endl; - } - -private: - const E m_expr; -}; - - -} // namespace tvmet - -#include <tvmet/Functional.h> - -#include <tvmet/xpr/BinOperator.h> -#include <tvmet/xpr/UnOperator.h> -#include <tvmet/xpr/Literal.h> - -#include <tvmet/xpr/Identity.h> - -#include <tvmet/xpr/MMProduct.h> -#include <tvmet/xpr/MMProductTransposed.h> -#include <tvmet/xpr/MMtProduct.h> -#include <tvmet/xpr/MtMProduct.h> -#include <tvmet/xpr/MVProduct.h> -#include <tvmet/xpr/MtVProduct.h> -#include <tvmet/xpr/MatrixTranspose.h> - -#include <tvmet/xpr/MatrixFunctions.h> -#include <tvmet/xpr/MatrixOperators.h> -#include <tvmet/xpr/Eval.h> - -#endif // TVMET_XPR_MATRIX_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/include/tvmet/xpr/MatrixCol.h b/tvmet-1.7.1/include/tvmet/xpr/MatrixCol.h deleted file mode 100644 index 47e2554b8..000000000 --- a/tvmet-1.7.1/include/tvmet/xpr/MatrixCol.h +++ /dev/null @@ -1,97 +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: MatrixCol.h,v 1.15 2004/09/16 09:14:18 opetzold Exp $ - */ - -#include <cassert> - -#ifndef TVMET_XPR_MATRIX_COL_H -#define TVMET_XPR_MATRIX_COL_H - -namespace tvmet { - - -/** - * \class XprMatrixCol MatrixCol.h "tvmet/xpr/MatrixCol.h" - * \brief Expression on matrix used for access on the column vector. - */ -template<class E, int Rows, int Cols> -class XprMatrixCol - : public TvmetBase< XprMatrixCol<E, Rows, Cols> > -{ - XprMatrixCol(); - XprMatrixCol& operator=(const XprMatrixCol&); - -public: - typedef typename E::value_type value_type; - -public: - /** Complexity counter. */ - enum { - ops_expr = E::ops, - ops = ops_expr/Cols // equal Row accesses - }; - -public: - /** Constructor. */ - explicit XprMatrixCol(const E& e, int no) - : m_expr(e), m_col(no) - { - assert(no < Cols); - } - - /** Copy Constructor. Not explicit! */ -#if defined(TVMET_OPTIMIZE_XPR_MANUAL_CCTOR) - XprMatrixCol(const XprMatrixCol& e) - : m_expr(e.m_expr), m_col(e.m_col) - { } -#endif - - value_type operator()(int i) const { - assert(i < Rows); - return m_expr(i, m_col); - } - -public: // debugging Xpr parse tree - void print_xpr(std::ostream& os, int l=0) const { - os << IndentLevel(l++) - << "XprMatrixCol[O=" << ops << ", (O=" << ops_expr << ")]<" - << std::endl; - m_expr.print_xpr(os, l); - os << IndentLevel(l) - << "R=" << Rows << ", C=" << Cols << std::endl - << IndentLevel(--l) << ">" - << ((l != 0) ? "," : "") << std::endl; - } - -private: - const E m_expr; - const int m_col; -}; - - -} - -#endif // TVMET_XPR_MATRIX_COL_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/include/tvmet/xpr/MatrixDiag.h b/tvmet-1.7.1/include/tvmet/xpr/MatrixDiag.h deleted file mode 100644 index 4a8a080ac..000000000 --- a/tvmet-1.7.1/include/tvmet/xpr/MatrixDiag.h +++ /dev/null @@ -1,95 +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: MatrixDiag.h,v 1.13 2004/09/16 09:14:18 opetzold Exp $ - */ - -#include <cassert> - -#ifndef TVMET_XPR_MATRIX_DIAG_H -#define TVMET_XPR_MATRIX_DIAG_H - -namespace tvmet { - - -/** - * \class XprMatrixDiag MatrixDiag.h "tvmet/xpr/MatrixDiag.h" - * \brief Expression on matrix used for access on the diagonal vector. - */ -template<class E, int Sz> -class XprMatrixDiag - : public TvmetBase< XprMatrixDiag<E, Sz> > -{ - XprMatrixDiag(); - XprMatrixDiag& operator=(const XprMatrixDiag<E, Sz>&); - -public: - typedef typename E::value_type value_type; - -public: - /** Complexity counter. */ - enum { - ops_expr = E::ops, - ops = ops_expr/Sz - }; - -public: - /** Constructor. */ - explicit XprMatrixDiag(const E& e) - : m_expr(e) - { } - - /** Copy Constructor. Not explicit! */ -#if defined(TVMET_OPTIMIZE_XPR_MANUAL_CCTOR) - XprMatrixDiag(const XprMatrixDiag& e) - : m_expr(e.m_expr) - { } -#endif - - /** index operator for arrays/matrizes */ - value_type operator()(int i) const { - assert(i < Sz); - return m_expr(i, i); - } - -public: // debugging Xpr parse tree - void print_xpr(std::ostream& os, int l=0) const { - os << IndentLevel(l++) - << "XprMatrixDiag[O=" << ops << ", (O=" << ops_expr << ")]<" - << std::endl; - m_expr.print_xpr(os, l); - os << IndentLevel(l) - << "Sz=" << Sz << std::endl - << IndentLevel(--l) << ">" - << ((l != 0) ? "," : "") << std::endl; - } - -private: - const E m_expr; -}; - - -} // namespace tvmet - -#endif // TVMET_XPR_MATRIX_DIAG_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/include/tvmet/xpr/MatrixFunctions.h b/tvmet-1.7.1/include/tvmet/xpr/MatrixFunctions.h deleted file mode 100644 index 54f02c08d..000000000 --- a/tvmet-1.7.1/include/tvmet/xpr/MatrixFunctions.h +++ /dev/null @@ -1,736 +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: MatrixFunctions.h,v 1.39 2004/07/06 05:49:22 opetzold Exp $ - */ - -#ifndef TVMET_XPR_MATRIX_FUNCTIONS_H -#define TVMET_XPR_MATRIX_FUNCTIONS_H - -namespace tvmet { - - -/* forwards */ -template<class T, int Rows, int Cols> class Matrix; -template<class T, int Sz> class Vector; -template<class E, int Sz> class XprVector; -template<class E> class XprMatrixTranspose; -template<class E, int Sz> class XprMatrixDiag; -template<class E, int Rows, int Cols> class XprMatrixRow; -template<class E, int Rows, int Cols> class XprMatrixCol; - - -/********************************************************* - * PART I: DECLARATION - *********************************************************/ - - -/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * Matrix arithmetic functions add, sub, mul and div - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -/* - * function(XprMatrix<E1, Rows, Cols>, XprMatrix<E2, Rows, Cols>) - */ -#define TVMET_DECLARE_MACRO(NAME) \ -template<class E1, class E2, int Rows, int Cols> \ -XprMatrix< \ - XprBinOp< \ - Fcnl_##NAME<typename E1::value_type, typename E2::value_type>, \ - XprMatrix<E1, Rows, Cols>, \ - XprMatrix<E2, Rows, Cols> \ - >, \ - Rows, Cols \ -> \ -NAME (const XprMatrix<E1, Rows, Cols>& lhs, \ - const XprMatrix<E2, 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) // not defined for matrizes - TVMET_DECLARE_MACRO(div) // not defined for matrizes -} - -#undef TVMET_DECLARE_MACRO - - -/* - * function(XprMatrix<E, Rows, Cols>, POD) - * function(POD, XprMatrix<E, Rows, Cols>) - * Note: - operations +,-,*,/ are per se element wise - */ -#define TVMET_DECLARE_MACRO(NAME, POD) \ -template<class E, int Rows, int Cols> \ -XprMatrix< \ - XprBinOp< \ - Fcnl_##NAME<typename E::value_type, POD >, \ - XprMatrix<E, Rows, Cols>, \ - XprLiteral< POD > \ - >, \ - Rows, Cols \ -> \ -NAME (const XprMatrix<E, Rows, Cols>& lhs, \ - POD rhs) _tvmet_always_inline; \ - \ -template<class E, int Rows, int Cols> \ -XprMatrix< \ - XprBinOp< \ - Fcnl_##NAME< POD, typename E::value_type>, \ - XprLiteral< POD >, \ - XprMatrix<E, Rows, Cols> \ - >, \ - Rows, Cols \ -> \ -NAME (POD lhs, \ - const XprMatrix<E, 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) -/* - * function(XprMatrix<E, Rows, Cols>, complex<T>) - * function(complex<T>, XprMatrix<E, Rows, Cols>) - * Note: - operations +,-,*,/ are per se element wise - * \todo type promotion - */ -#define TVMET_DECLARE_MACRO(NAME) \ -template<class E, class T, int Rows, int Cols> \ -XprMatrix< \ - XprBinOp< \ - Fcnl_##NAME<typename E::value_type, std::complex<T> >, \ - XprMatrix<E, Rows, Cols>, \ - XprLiteral< std::complex<T> > \ - >, \ - Rows, Cols \ -> \ -NAME (const XprMatrix<E, Rows, Cols>& lhs, \ - const std::complex<T>& rhs) _tvmet_always_inline; \ - \ -template<class T, class E, int Rows, int Cols> \ -XprMatrix< \ - XprBinOp< \ - Fcnl_##NAME< std::complex<T>, typename E::value_type>, \ - XprLiteral< std::complex<T> >, \ - XprMatrix<E, Rows, Cols> \ - >, \ - Rows, Cols \ -> \ -NAME (const std::complex<T>& lhs, \ - const XprMatrix<E, 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 prod( ... ) functions - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -template<class E1, int Rows1, int Cols1, - class E2, int Cols2> -XprMatrix< - XprMMProduct< - XprMatrix<E1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1) - XprMatrix<E2, Cols1, Cols2>, Cols2 - >, - Rows1, Cols2 // return Dim -> -prod(const XprMatrix<E1, Rows1, Cols1>& lhs, - const XprMatrix<E2, Cols1, Cols2>& rhs) _tvmet_always_inline; - - -template<class E1, int Rows1, int Cols1, - class E2, int Cols2> -XprMatrix< - XprMMProductTransposed< - XprMatrix<E1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1) - XprMatrix<E2, Cols1, Cols2>, Cols2 // M2(Cols1, Cols2) - >, - Cols2, Rows1 // return Dim -> -trans_prod(const XprMatrix<E1, Rows1, Cols1>& lhs, - const XprMatrix<E2, Cols1, Cols2>& rhs) _tvmet_always_inline; - - -template<class E1, int Rows1, int Cols1, - class E2, int Cols2> // Rows2 = Rows1 -XprMatrix< - XprMtMProduct< - XprMatrix<E1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1) - XprMatrix<E2, Rows1, Cols2>, Cols2 // M2(Rows1, Cols2) - >, - Cols1, Cols2 // return Dim -> -MtM_prod(const XprMatrix<E1, Rows1, Cols1>& lhs, - const XprMatrix<E2, Rows1, Cols2>& rhs) _tvmet_always_inline; - - -template<class E1, int Rows1, int Cols1, - class E2, int Rows2> // Cols2 = Cols1 -XprMatrix< - XprMMtProduct< - XprMatrix<E1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1) - XprMatrix<E2, Rows2, Cols1>, Cols1 // M2(Rows2, Cols1) - >, - Rows1, Rows2 // return Dim -> -MMt_prod(const XprMatrix<E1, Rows1, Cols1>& lhs, - const XprMatrix<E2, Rows2, Cols1>& rhs) _tvmet_always_inline; - - -/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * matrix-vector specific prod( ... ) functions - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -template<class E1, int Rows, int Cols, - class E2> -XprVector< - XprMVProduct< - XprMatrix<E1, Rows, Cols>, Rows, Cols, - XprVector<E2, Cols> - >, - Rows -> -prod(const XprMatrix<E1, Rows, Cols>& lhs, - const XprVector<E2, Cols>& rhs) _tvmet_always_inline; - - -/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * matrix specific functions - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -template<class E, int Rows, int Cols> -XprMatrix< - XprMatrixTranspose< - XprMatrix<E, Rows, Cols> - >, - Cols, Rows -> -trans(const XprMatrix<E, Rows, Cols>& rhs) _tvmet_always_inline; - - -#if 0 // XXX needs declaration of meta::Matrix<Sz, Sz, 0, 0>::trace -template<class E, int Sz> -typename Traits<typename E::value_type>::sum_type -trace(const XprMatrix<E, Sz, Sz>& m)_tvmet_always_inline; -#endif - - -template<class E, int Rows, int Cols> -XprVector< - XprMatrixRow< - XprMatrix<E, Rows, Cols>, - Rows, Cols - >, - Cols -> -row(const XprMatrix<E, Rows, Cols>& m, - int no) _tvmet_always_inline; - - -template<class E, int Rows, int Cols> -XprVector< - XprMatrixCol< - XprMatrix<E, Rows, Cols>, - Rows, Cols - >, - Rows -> -col(const XprMatrix<E, Rows, Cols>& m, int no) _tvmet_always_inline; - - -template<class E, int Sz> -XprVector< - XprMatrixDiag< - XprMatrix<E, Sz, Sz>, - Sz - >, - Sz -> -diag(const XprMatrix<E, Sz, Sz>& m) _tvmet_always_inline; - - -/********************************************************* - * PART II: IMPLEMENTATION - *********************************************************/ - - -/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * Matrix arithmetic functions add, sub, mul and div - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -/* - * function(XprMatrix<E1, Rows, Cols>, XprMatrix<E2, Rows, Cols>) - */ -#define TVMET_IMPLEMENT_MACRO(NAME) \ -template<class E1, class E2, int Rows, int Cols> \ -inline \ -XprMatrix< \ - XprBinOp< \ - Fcnl_##NAME<typename E1::value_type, typename E2::value_type>, \ - XprMatrix<E1, Rows, Cols>, \ - XprMatrix<E2, Rows, Cols> \ - >, \ - Rows, Cols \ -> \ -NAME (const XprMatrix<E1, Rows, Cols>& lhs, \ - const XprMatrix<E2, Rows, Cols>& rhs) { \ - typedef XprBinOp< \ - Fcnl_##NAME<typename E1::value_type, typename E2::value_type>, \ - XprMatrix<E1, Rows, Cols>, \ - XprMatrix<E2, Rows, Cols> \ - > expr_type; \ - return XprMatrix<expr_type, Rows, Cols>(expr_type(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) // not defined for matrizes - TVMET_IMPLEMENT_MACRO(div) // not defined for matrizes -} - -#undef TVMET_IMPLEMENT_MACRO - - -/* - * function(XprMatrix<E, Rows, Cols>, POD) - * function(POD, XprMatrix<E, Rows, Cols>) - * Note: - operations +,-,*,/ are per se element wise - */ -#define TVMET_IMPLEMENT_MACRO(NAME, POD) \ -template<class E, int Rows, int Cols> \ -inline \ -XprMatrix< \ - XprBinOp< \ - Fcnl_##NAME<typename E::value_type, POD >, \ - XprMatrix<E, Rows, Cols>, \ - XprLiteral< POD > \ - >, \ - Rows, Cols \ -> \ -NAME (const XprMatrix<E, Rows, Cols>& lhs, POD rhs) { \ - typedef XprBinOp< \ - Fcnl_##NAME<typename E::value_type, POD >, \ - XprMatrix<E, Rows, Cols>, \ - XprLiteral< POD > \ - > expr_type; \ - return XprMatrix<expr_type, Rows, Cols>( \ - expr_type(lhs, XprLiteral< POD >(rhs))); \ -} \ - \ -template<class E, int Rows, int Cols> \ -inline \ -XprMatrix< \ - XprBinOp< \ - Fcnl_##NAME< POD, typename E::value_type>, \ - XprLiteral< POD >, \ - XprMatrix<E, Rows, Cols> \ - >, \ - Rows, Cols \ -> \ -NAME (POD lhs, const XprMatrix<E, Rows, Cols>& rhs) { \ - typedef XprBinOp< \ - Fcnl_##NAME< POD, typename E::value_type>, \ - XprLiteral< POD >, \ - XprMatrix<E, Rows, Cols> \ - > expr_type; \ - return XprMatrix<expr_type, Rows, Cols>( \ - expr_type(XprLiteral< POD >(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) -/* - * function(XprMatrix<E, Rows, Cols>, complex<T>) - * function(complex<T>, XprMatrix<E, Rows, Cols>) - * Note: - operations +,-,*,/ are per se element wise - * \todo type promotion - */ -#define TVMET_IMPLEMENT_MACRO(NAME) \ -template<class E, class T, int Rows, int Cols> \ -inline \ -XprMatrix< \ - XprBinOp< \ - Fcnl_##NAME<typename E::value_type, std::complex<T> >, \ - XprMatrix<E, Rows, Cols>, \ - XprLiteral< std::complex<T> > \ - >, \ - Rows, Cols \ -> \ -NAME (const XprMatrix<E, Rows, Cols>& lhs, \ - const std::complex<T>& rhs) { \ - typedef XprBinOp< \ - Fcnl_##NAME<typename E::value_type, std::complex<T> >, \ - XprMatrix<E, Rows, Cols>, \ - XprLiteral< std::complex<T> > \ - > expr_type; \ - return XprMatrix<expr_type, Rows, Cols>( \ - expr_type(lhs, XprLiteral< std::complex<T> >(rhs))); \ -} \ - \ -template<class T, class E, int Rows, int Cols> \ -inline \ -XprMatrix< \ - XprBinOp< \ - Fcnl_##NAME< std::complex<T>, typename E::value_type>, \ - XprLiteral< std::complex<T> >, \ - XprMatrix<E, Rows, Cols> \ - >, \ - Rows, Cols \ -> \ -NAME (const std::complex<T>& lhs, \ - const XprMatrix<E, Rows, Cols>& rhs) { \ - typedef XprBinOp< \ - Fcnl_##NAME< std::complex<T>, typename E::value_type>, \ - XprLiteral< std::complex<T> >, \ - XprMatrix<E, Rows, Cols> \ - > expr_type; \ - return XprMatrix<expr_type, Rows, Cols>( \ - expr_type(XprLiteral< std::complex<T> >(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 prod( ... ) functions - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -/** - * \fn prod(const XprMatrix<E1, Rows1, Cols1>& lhs, const XprMatrix<E2, Cols1, Cols2>& rhs) - * \brief Evaluate the product of two XprMatrix. - * Perform on given Matrix M1 and M2: - * \f[ - * M_1\,M_2 - * \f] - * \note The numer of Rows2 has to be equal to Cols1. - * \ingroup _binary_function - */ -template<class E1, int Rows1, int Cols1, - class E2, int Cols2> -inline -XprMatrix< - XprMMProduct< - XprMatrix<E1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1) - XprMatrix<E2, Cols1, Cols2>, Cols2 - >, - Rows1, Cols2 // return Dim -> -prod(const XprMatrix<E1, Rows1, Cols1>& lhs, const XprMatrix<E2, Cols1, Cols2>& rhs) { - typedef XprMMProduct< - XprMatrix<E1, Rows1, Cols1>, Rows1, Cols1, - XprMatrix<E2, Cols1, Cols2>, Cols2 - > expr_type; - return XprMatrix<expr_type, Rows1, Cols2>(expr_type(lhs, rhs)); -} - - -/** - * \fn trans_prod(const XprMatrix<E1, Rows1, Cols1>& lhs, const XprMatrix<E2, Cols1, Cols2>& rhs) - * \brief Function for the trans(matrix-matrix-product) - * Perform on given Matrix M1 and M2: - * \f[ - * (M_1\,M_2)^T - * \f] - * \note The numer of Rows2 has to be equal to Cols1. - * \ingroup _binary_function - */ -template<class E1, int Rows1, int Cols1, - class E2, int Cols2> -inline -XprMatrix< - XprMMProductTransposed< - XprMatrix<E1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1) - XprMatrix<E2, Cols1, Cols2>, Cols2 // M2(Cols1, Cols2) - >, - Cols2, Rows1 // return Dim -> -trans_prod(const XprMatrix<E1, Rows1, Cols1>& lhs, const XprMatrix<E2, Cols1, Cols2>& rhs) { - typedef XprMMProductTransposed< - XprMatrix<E1, Rows1, Cols1>, Rows1, Cols1, - XprMatrix<E2, Cols1, Cols2>, Cols2 - > expr_type; - return XprMatrix<expr_type, Cols2, Rows1>(expr_type(lhs, rhs)); -} - - -/** - * \fn MtM_prod(const XprMatrix<E1, Rows1, Cols1>& lhs, const XprMatrix<E2, Rows1, Cols2>& rhs) - * \brief Function for the trans(matrix)-matrix-product. - * using formula - * \f[ - * M_1^{T}\,M_2 - * \f] - * \note The number of cols of matrix 2 have to be equal to number of rows of - * matrix 1, since matrix 1 is trans - the result is a (Cols1 x Cols2) - * matrix. - * \ingroup _binary_function - */ -template<class E1, int Rows1, int Cols1, - class E2, int Cols2> // Rows2 = Rows1 -inline -XprMatrix< - XprMtMProduct< - XprMatrix<E1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1) - XprMatrix<E2, Rows1, Cols2>, Cols2 // M2(Rows1, Cols2) - >, - Cols1, Cols2 // return Dim -> -MtM_prod(const XprMatrix<E1, Rows1, Cols1>& lhs, const XprMatrix<E2, Rows1, Cols2>& rhs) { - typedef XprMtMProduct< - XprMatrix<E1, Rows1, Cols1>, Rows1, Cols1, - XprMatrix<E2, Rows1, Cols2>, Cols2 - > expr_type; - return XprMatrix<expr_type, Cols1, Cols2>(expr_type(lhs, rhs)); -} - - -/** - * \fn MMt_prod(const XprMatrix<E1, Rows1, Cols1>& lhs, const XprMatrix<E2, Rows2, Cols1>& rhs) - * \brief Function for the matrix-trans(matrix)-product. - * \ingroup _binary_function - * \note The cols2 has to be equal to cols1. - */ -template<class E1, int Rows1, int Cols1, - class E2, int Rows2> // Cols2 = Cols1 -inline -XprMatrix< - XprMMtProduct< - XprMatrix<E1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1) - XprMatrix<E2, Rows2, Cols1>, Cols1 // M2(Rows2, Cols1) - >, - Rows1, Rows2 // return Dim -> -MMt_prod(const XprMatrix<E1, Rows1, Cols1>& lhs, const XprMatrix<E2, Rows2, Cols1>& rhs) { - typedef XprMMtProduct< - XprMatrix<E1, Rows1, Cols1>, Rows1, Cols1, - XprMatrix<E2, Rows2, Cols1>, Cols1 - > expr_type; - return XprMatrix<expr_type, Rows1, Rows2>(expr_type(lhs, rhs)); -} - - -/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * matrix-vector specific prod( ... ) functions - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -/** - * \fn prod(const XprMatrix<E1, Rows, Cols>& lhs, const XprVector<E2, Cols>& rhs) - * \brief Evaluate the product of XprMatrix and XprVector. - * \ingroup _binary_function - */ -template<class E1, int Rows, int Cols, - class E2> -inline -XprVector< - XprMVProduct< - XprMatrix<E1, Rows, Cols>, Rows, Cols, - XprVector<E2, Cols> - >, - Rows -> -prod(const XprMatrix<E1, Rows, Cols>& lhs, const XprVector<E2, Cols>& rhs) { - typedef XprMVProduct< - XprMatrix<E1, Rows, Cols>, Rows, Cols, - XprVector<E2, Cols> - > expr_type; - return XprVector<expr_type, Rows>(expr_type(lhs, rhs)); -} - - -/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * matrix specific functions - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -/** - * \fn trans(const XprMatrix<E, Rows, Cols>& rhs) - * \brief Transpose an expression matrix. - * \ingroup _unary_function - */ -template<class E, int Rows, int Cols> -inline -XprMatrix< - XprMatrixTranspose< - XprMatrix<E, Rows, Cols> - >, - Cols, Rows -> -trans(const XprMatrix<E, Rows, Cols>& rhs) { - typedef XprMatrixTranspose< - XprMatrix<E, Rows, Cols> - > expr_type; - return XprMatrix<expr_type, Cols, Rows>(expr_type(rhs)); -} - - -#if 0 // XXX needs declaration of meta::Matrix<Sz, Sz, 0, 0>::trace -/* - * \fn trace(const XprMatrix<E, Sz, Sz>& m) - * \brief Compute the trace of a square matrix. - * \ingroup _unary_function - * - * Simply compute the trace of the given matrix as: - * \f[ - * \sum_{k = 0}^{Sz-1} m(k, k) - * \f] - */ -template<class E, int Sz> -inline -typename Traits<typename E::value_type>::sum_type -trace(const XprMatrix<E, Sz, Sz>& m) { - return meta::Matrix<Sz, Sz, 0, 0>::trace(m); -} -#endif - - -/** - * \fn row(const XprMatrix<E, Rows, Cols>& m, int no) - * \brief Returns a row vector of the given matrix. - * \ingroup _binary_function - */ -template<class E, int Rows, int Cols> -inline -XprVector< - XprMatrixRow< - XprMatrix<E, Rows, Cols>, - Rows, Cols - >, - Cols -> -row(const XprMatrix<E, Rows, Cols>& m, int no) { - typedef XprMatrixRow< - XprMatrix<E, Rows, Cols>, - Rows, Cols - > expr_type; - - return XprVector<expr_type, Cols>(expr_type(m, no)); -} - - -/** - * \fn col(const XprMatrix<E, Rows, Cols>& m, int no) - * \brief Returns a column vector of the given matrix. - * \ingroup _binary_function - */ -template<class E, int Rows, int Cols> -inline -XprVector< - XprMatrixCol< - XprMatrix<E, Rows, Cols>, - Rows, Cols - >, - Rows -> -col(const XprMatrix<E, Rows, Cols>& m, int no) { - typedef XprMatrixCol< - XprMatrix<E, Rows, Cols>, - Rows, Cols - > expr_type; - - return XprVector<expr_type, Cols>(expr_type(m, no)); -} - - -/** - * \fn diag(const XprMatrix<E, Sz, Sz>& m) - * \brief Returns the diagonal vector of the given square matrix. - * \ingroup _unary_function - */ -template<class E, int Sz> -inline -XprVector< - XprMatrixDiag< - XprMatrix<E, Sz, Sz>, - Sz - >, - Sz -> -diag(const XprMatrix<E, Sz, Sz>& m) { - typedef XprMatrixDiag< - XprMatrix<E, Sz, Sz>, - Sz> expr_type; - - return XprVector<expr_type, Sz>(expr_type(m)); -} - - -} // namespace tvmet - -#endif // TVMET_XPR_MATRIX_FUNCTIONS_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/include/tvmet/xpr/MatrixOperators.h b/tvmet-1.7.1/include/tvmet/xpr/MatrixOperators.h deleted file mode 100644 index 6f31d88f4..000000000 --- a/tvmet-1.7.1/include/tvmet/xpr/MatrixOperators.h +++ /dev/null @@ -1,471 +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.19 2005/03/09 09:48:03 opetzold Exp $ - */ - -#ifndef TVMET_XPR_MATRIX_OPERATORS_H -#define TVMET_XPR_MATRIX_OPERATORS_H - -namespace tvmet { - - -/********************************************************* - * PART I: DECLARATION - *********************************************************/ - - -/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * Matrix arithmetic operators implemented by functions - * add, sub, mul and div - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -/* - * operator(const XprMatrix<E1, Rows1, Cols1>& lhs, const XprMatrix<E2, Cols1,Cols2>& rhs) - * - * Note: operations +,-,*,/ are per se element wise. Further more, - * element wise operations make sense only for matrices of the same - * size [varg]. - */ -#define TVMET_DECLARE_MACRO(NAME, OP) \ -template<class E1, int Rows1, int Cols1, \ - class E2> \ -XprMatrix< \ - XprBinOp< \ - Fcnl_##NAME<typename E1::value_type, typename E2::value_type>, \ - XprMatrix<E1, Rows1, Cols1>, \ - XprMatrix<E2, Rows1, Cols1> \ - >, \ - Rows1, Cols1 \ -> \ -operator OP (const XprMatrix<E1, Rows1, Cols1>& lhs, \ - const XprMatrix<E2, Rows1, Cols1>& 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, must be element_wise -} -#undef TVMET_DECLARE_MACRO - - -/* - * operator(XprMatrix<E, Rows, Cols>, POD) - * operator(POD, XprMatrix<E, Rows, Cols>) - * Note: operations +,-,*,/ are per se element wise - */ -#define TVMET_DECLARE_MACRO(NAME, OP, POD) \ -template<class E, int Rows, int Cols> \ -XprMatrix< \ - XprBinOp< \ - Fcnl_##NAME<typename E::value_type, POD >, \ - XprMatrix<E, Rows, Cols>, \ - XprLiteral< POD > \ - >, \ - Rows, Cols \ -> \ -operator OP (const XprMatrix<E, Rows, Cols>& lhs, \ - POD rhs) _tvmet_always_inline; \ - \ -template<class E,int Rows, int Cols> \ -XprMatrix< \ - XprBinOp< \ - Fcnl_##NAME<POD, typename E::value_type>, \ - XprLiteral< POD >, \ - XprMatrix<E, Rows, Cols> \ - >, \ - Rows, Cols \ -> \ -operator OP (POD lhs, \ - const XprMatrix<E, 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(XprMatrix<E, Rows, Cols>, complex<>) - * operator(complex<>, XprMatrix<E, Rows, Cols>) - * Note: operations +,-,*,/ are per se element wise - * \todo type promotion - */ -#define TVMET_DECLARE_MACRO(NAME, OP) \ -template<class E, int Rows, int Cols, class T> \ -XprMatrix< \ - XprBinOp< \ - Fcnl_##NAME<typename E::value_type, std::complex<T> >, \ - XprMatrix<E, Rows, Cols>, \ - XprLiteral< std::complex<T> > \ - >, \ - Rows, Cols \ -> \ -operator OP (const XprMatrix<E, Rows, Cols>& lhs, \ - const std::complex<T>& rhs) _tvmet_always_inline; \ - \ -template<class E, int Rows, int Cols, class T> \ -XprMatrix< \ - XprBinOp< \ - Fcnl_##NAME<std::complex<T>, typename E::value_type>, \ - XprLiteral< std::complex<T> >, \ - XprMatrix<E, Rows, Cols> \ - >, \ - Rows, Cols \ -> \ -operator OP (const std::complex<T>& lhs, \ - const XprMatrix<E, 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 - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -/** - * \fn operator*(const XprMatrix<E1, Rows1, Cols1>& lhs, const XprMatrix<E2, Cols1, Cols2>& rhs) - * \brief Evaluate the product of two XprMatrix. - * \ingroup _binary_operator - * \sa prod(XprMatrix<E1, Rows1, Cols1> lhs, XprMatrix<E2, Cols1, Cols2> rhs) - */ -template<class E1, int Rows1, int Cols1, - class E2, int Cols2> -XprMatrix< - XprMMProduct< - XprMatrix<E1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1) - XprMatrix<E2, Cols1, Cols2>, Cols2 // M2(Cols1, Cols2) - >, - Rows1, Cols2 -> -operator*(const XprMatrix<E1, Rows1, Cols1>& lhs, - const XprMatrix<E2, Cols1, Cols2>& rhs) _tvmet_always_inline; - - -/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * matrix-vector specific prod( ... ) operators - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -/** - * \fn operator*(const XprMatrix<E1, Rows, Cols>& lhs, const XprVector<E2, Cols>& rhs) - * \brief Evaluate the product of XprMatrix and XprVector. - * \ingroup _binary_operator - * \sa prod(XprMatrix<E1, Rows, Cols> lhs, XprVector<E2, Cols> rhs) - */ -template<class E1, int Rows, int Cols, - class E2> -XprVector< - XprMVProduct< - XprMatrix<E1, Rows, Cols>, Rows, Cols, - XprVector<E2, Cols> - >, - Rows -> -operator*(const XprMatrix<E1, Rows, Cols>& lhs, - const XprVector<E2, Cols>& rhs) _tvmet_always_inline; - - - -/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * global unary operators - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -/* - * unary_operator(const XprMatrix<E, Rows, Cols>& m) - * Note: per se element wise - */ -#define TVMET_DECLARE_MACRO(NAME, OP) \ -template <class E, int Rows, int Cols> \ -XprMatrix< \ - XprUnOp< \ - Fcnl_##NAME<typename E::value_type>, \ - XprMatrix<E, Rows, Cols> \ - >, \ - Rows, Cols \ -> \ -operator OP (const XprMatrix<E, Rows, Cols>& m) _tvmet_always_inline; - -TVMET_DECLARE_MACRO(neg, -) - -#undef TVMET_DECLARE_MACRO - - -/********************************************************* - * PART II: IMPLEMENTATION - *********************************************************/ - - - -/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * Matrix arithmetic operators implemented by functions - * add, sub, mul and div - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -/* - * operator(const XprMatrix<E1, Rows1, Cols1>& lhs, const XprMatrix<E2, Cols1,Cols2>& rhs) - * - * Note: operations +,-,*,/ are per se element wise. Further more, - * element wise operations make sense only for matrices of the same - * size [varg]. - */ -#define TVMET_IMPLEMENT_MACRO(NAME, OP) \ -template<class E1, int Rows1, int Cols1, \ - class E2> \ -inline \ -XprMatrix< \ - XprBinOp< \ - Fcnl_##NAME<typename E1::value_type, typename E2::value_type>, \ - XprMatrix<E1, Rows1, Cols1>, \ - XprMatrix<E2, Rows1, Cols1> \ - >, \ - Rows1, Cols1 \ -> \ -operator OP (const XprMatrix<E1, Rows1, Cols1>& lhs, \ - const XprMatrix<E2, Rows1, Cols1>& 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, must be element_wise -} -#undef TVMET_IMPLEMENT_MACRO - - -/* - * operator(XprMatrix<E, Rows, Cols>, POD) - * operator(POD, XprMatrix<E, Rows, Cols>) - * Note: operations +,-,*,/ are per se element wise - */ -#define TVMET_IMPLEMENT_MACRO(NAME, OP, POD) \ -template<class E, int Rows, int Cols> \ -inline \ -XprMatrix< \ - XprBinOp< \ - Fcnl_##NAME<typename E::value_type, POD >, \ - XprMatrix<E, Rows, Cols>, \ - XprLiteral< POD > \ - >, \ - Rows, Cols \ -> \ -operator OP (const XprMatrix<E, Rows, Cols>& lhs, POD rhs) { \ - return NAME (lhs, rhs); \ -} \ - \ -template<class E,int Rows, int Cols> \ -inline \ -XprMatrix< \ - XprBinOp< \ - Fcnl_##NAME<POD, typename E::value_type>, \ - XprLiteral< POD >, \ - XprMatrix<E, Rows, Cols> \ - >, \ - Rows, Cols \ -> \ -operator OP (POD lhs, const XprMatrix<E, 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(XprMatrix<E, Rows, Cols>, complex<>) - * operator(complex<>, XprMatrix<E, Rows, Cols>) - * Note: operations +,-,*,/ are per se element wise - * \todo type promotion - */ -#define TVMET_IMPLEMENT_MACRO(NAME, OP) \ -template<class E, int Rows, int Cols, class T> \ -inline \ -XprMatrix< \ - XprBinOp< \ - Fcnl_##NAME<typename E::value_type, std::complex<T> >, \ - XprMatrix<E, Rows, Cols>, \ - XprLiteral< std::complex<T> > \ - >, \ - Rows, Cols \ -> \ -operator OP (const XprMatrix<E, Rows, Cols>& lhs, \ - const std::complex<T>& rhs) { \ - return NAME (lhs, rhs); \ -} \ - \ -template<class E, int Rows, int Cols, class T> \ -inline \ -XprMatrix< \ - XprBinOp< \ - Fcnl_##NAME<std::complex<T>, typename E::value_type>, \ - XprLiteral< std::complex<T> >, \ - XprMatrix<E, Rows, Cols> \ - >, \ - Rows, Cols \ -> \ -operator OP (const std::complex<T>& lhs, \ - const XprMatrix<E, 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 XprMatrix<E1, Rows1, Cols1>& lhs, const XprMatrix<E2, Cols1, Cols2>& rhs) - * \brief Evaluate the product of two XprMatrix. - * \ingroup _binary_operator - * \sa prod(XprMatrix<E1, Rows1, Cols1> lhs, XprMatrix<E2, Cols1, Cols2> rhs) - */ -template<class E1, int Rows1, int Cols1, - class E2, int Cols2> -inline -XprMatrix< - XprMMProduct< - XprMatrix<E1, Rows1, Cols1>, Rows1, Cols1, // M1(Rows1, Cols1) - XprMatrix<E2, Cols1, Cols2>, Cols2 // M2(Cols1, Cols2) - >, - Rows1, Cols2 -> -operator*(const XprMatrix<E1, Rows1, Cols1>& lhs, const XprMatrix<E2, Cols1, Cols2>& rhs) { - return prod(lhs, rhs); -} - - -/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * matrix-vector specific prod( ... ) operators - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -/** - * \fn operator*(const XprMatrix<E1, Rows, Cols>& lhs, const XprVector<E2, Cols>& rhs) - * \brief Evaluate the product of XprMatrix and XprVector. - * \ingroup _binary_operator - * \sa prod(XprMatrix<E1, Rows, Cols> lhs, XprVector<E2, Cols> rhs) - */ -template<class E1, int Rows, int Cols, - class E2> -inline -XprVector< - XprMVProduct< - XprMatrix<E1, Rows, Cols>, Rows, Cols, - XprVector<E2, Cols> - >, - Rows -> -operator*(const XprMatrix<E1, Rows, Cols>& lhs, const XprVector<E2, Cols>& rhs) { - return prod(lhs, rhs); -} - - - -/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * global unary operators - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -/* - * unary_operator(const XprMatrix<E, Rows, Cols>& m) - * Note: per se element wise - */ -#define TVMET_IMPLEMENT_MACRO(NAME, OP) \ -template <class E, int Rows, int Cols> \ -inline \ -XprMatrix< \ - XprUnOp< \ - Fcnl_##NAME<typename E::value_type>, \ - XprMatrix<E, Rows, Cols> \ - >, \ - Rows, Cols \ -> \ -operator OP (const XprMatrix<E, Rows, Cols>& m) { \ - typedef XprUnOp< \ - Fcnl_##NAME<typename E::value_type>, \ - XprMatrix<E, Rows, Cols> \ - > expr_type; \ - return XprMatrix<expr_type, Rows, Cols>(expr_type(m)); \ -} - -TVMET_IMPLEMENT_MACRO(neg, -) - -#undef TVMET_IMPLEMENT_MACRO - - -} // namespace tvmet - -#endif // TVMET_XPR_MATRIX_OPERATORS_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/include/tvmet/xpr/MatrixRow.h b/tvmet-1.7.1/include/tvmet/xpr/MatrixRow.h deleted file mode 100644 index d8a796858..000000000 --- a/tvmet-1.7.1/include/tvmet/xpr/MatrixRow.h +++ /dev/null @@ -1,97 +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: MatrixRow.h,v 1.14 2004/09/16 09:14:18 opetzold Exp $ - */ - -#include <cassert> - -#ifndef TVMET_XPR_MATRIX_ROW_H -#define TVMET_XPR_MATRIX_ROW_H - -namespace tvmet { - - -/** - * \class XprMatrixRow MatrixRow.h "tvmet/xpr/MatrixRow.h" - * \brief Expression on matrix used for access on the row vector. - */ -template<class E, int Rows, int Cols> -class XprMatrixRow - : public TvmetBase< XprMatrixRow<E, Rows, Cols> > -{ - XprMatrixRow(); - XprMatrixRow& operator=(const XprMatrixRow&); - -public: - typedef typename E::value_type value_type; - -public: - /** Complexity counter. */ - enum { - ops_expr = E::ops, - ops = ops_expr/Rows // equal Col accesses - }; - -public: - /** Constructor. */ - explicit XprMatrixRow(const E& e, int no) - : m_expr(e), m_row(no) - { - assert(no < Rows); - } - - /** Copy Constructor. Not explicit! */ -#if defined(TVMET_OPTIMIZE_XPR_MANUAL_CCTOR) - XprMatrixRow(const XprMatrixRow& rhs) - : m_expr(rhs.m_expr), m_row(rhs.m_row) - { } -#endif - - value_type operator()(int j) const { - assert(j < Cols); - return m_expr(m_row, j); - } - -public: // debugging Xpr parse tree - void print_xpr(std::ostream& os, int l=0) const { - os << IndentLevel(l++) - << "XprMatrixRow[O=" << ops << ", (O=" << ops_expr << ")]<" - << std::endl; - m_expr.print_xpr(os, l); - os << IndentLevel(l) - << "R=" << Rows << ", C=" << Cols << std::endl - << IndentLevel(--l) << ">" - << ((l != 0) ? "," : "") << std::endl; - } - -private: - const E m_expr; - const int m_row; -}; - - -} - -#endif // TVMET_XPR_MATRIX_ROW_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/include/tvmet/xpr/MatrixTranspose.h b/tvmet-1.7.1/include/tvmet/xpr/MatrixTranspose.h deleted file mode 100644 index c51df513e..000000000 --- a/tvmet-1.7.1/include/tvmet/xpr/MatrixTranspose.h +++ /dev/null @@ -1,88 +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: MatrixTranspose.h,v 1.11 2004/06/10 16:36:55 opetzold Exp $ - */ - -#ifndef TVMET_XPR_MATRIX_TRANSPOSE_H -#define TVMET_XPR_MATRIX_TRANSPOSE_H - -namespace tvmet { - - -/** - * \class XprMatrixTranspose MatrixTranspose.h "tvmet/xpr/MatrixTranspose.h" - * \brief Expression for transpose matrix - */ -template<class E> -class XprMatrixTranspose - : public TvmetBase< XprMatrixTranspose<E> > -{ - XprMatrixTranspose(); - XprMatrixTranspose& operator=(const XprMatrixTranspose&); - -public: - typedef typename E::value_type value_type; - - /** Complexity counter. */ - enum { - ops_expr = E::ops, - ops = 1 * ops_expr - }; - -public: - /** Constructor. */ - explicit XprMatrixTranspose(const E& e) - : m_expr(e) - { } - - /** Copy Constructor. Not explicit! */ -#if defined(TVMET_OPTIMIZE_XPR_MANUAL_CCTOR) - XprMatrixTranspose(const XprMatrixTranspose& e) - : m_expr(e.m_expr) - { } -#endif - - /** index operator for arrays/matrices. This simple swap the index - access for transpose. */ - value_type operator()(int i, int j) const { return m_expr(j, i); } - -public: // debugging Xpr parse tree - void print_xpr(std::ostream& os, int l=0) const { - os << IndentLevel(l++) - << "XprMatrixTranspose[O=" << ops << ", (O=" << ops_expr << ")]<" - << std::endl; - m_expr.print_xpr(os, l); - os << IndentLevel(--l) - << ">," << std::endl; - } - -private: - const E m_expr; -}; - - -} // namespace tvmet - -#endif // TVMET_XPR_MATRIX_TRANSPOSE_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/include/tvmet/xpr/MtMProduct.h b/tvmet-1.7.1/include/tvmet/xpr/MtMProduct.h deleted file mode 100644 index 6d657d086..000000000 --- a/tvmet-1.7.1/include/tvmet/xpr/MtMProduct.h +++ /dev/null @@ -1,140 +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: MtMProduct.h,v 1.15 2004/09/16 09:14:18 opetzold Exp $ - */ - -#ifndef TVMET_XPR_MTMPRODUCT_H -#define TVMET_XPR_MTMPRODUCT_H - -#include <cassert> - -#include <tvmet/meta/Gemtm.h> -#include <tvmet/loop/Gemtm.h> - -namespace tvmet { - - -/** - * \class XprMtMProduct MtMProduct.h "tvmet/xpr/MtMProduct.h" - * \brief Expression for product of transposed(matrix)-matrix product. - * using formula - * \f[ - * M_1^{T}\,M_2 - * \f] - * \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<class E1, int Rows1, int Cols1, - class E2, int Cols2> -class XprMtMProduct - : public TvmetBase< XprMtMProduct<E1, Rows1, Cols1, E2, Cols2> > -{ -private: - XprMtMProduct(); - XprMtMProduct& operator=(const XprMtMProduct&); - -public: - typedef typename PromoteTraits< - typename E1::value_type, - typename E2::value_type - >::value_type value_type; - -public: - /** Complexity counter. */ - enum { - ops_lhs = E1::ops, - ops_rhs = E2::ops, - M = Rows1 * Cols1 * Cols2, - N = (Rows1-1) * Cols1 * Cols2, - ops_plus = M * Traits<value_type>::ops_plus, - ops_muls = N * Traits<value_type>::ops_muls, - ops = ops_plus + ops_muls, - use_meta = Cols1*Cols2 < TVMET_COMPLEXITY_MM_TRIGGER ? true : false - }; - -public: - /** Constructor. */ - explicit XprMtMProduct(const E1& lhs, const E2& rhs) - : m_lhs(lhs), m_rhs(rhs) - { } - - /** Copy Constructor. Not explicit! */ -#if defined(TVMET_OPTIMIZE_XPR_MANUAL_CCTOR) - XprMtMProduct(const XprMtMProduct& e) - : m_lhs(e.m_lhs), m_rhs(e.m_rhs) { } -#endif - -private: - /** Wrapper for meta gemm. */ - static inline - value_type do_gemtm(dispatch<true>, const E1& lhs, const E2& rhs, int i, int j) { - return meta::gemtm<Rows1, Cols1, - Cols2, - 0>::prod(lhs, rhs, i, j); - } - - /** Wrapper for loop gemm. */ - static inline - value_type do_gemtm(dispatch<false>, const E1& lhs, const E2& rhs, int i, int j) { - return loop::gemtm<Rows1, Cols1, - Cols2>::prod(lhs, rhs, i, j); - } - -public: - /** index operator for arrays/matrices */ - value_type operator()(int i, int j) const { - assert((i < Cols1) && (j < Cols2)); - return do_gemtm(dispatch<use_meta>(), m_lhs, m_rhs, i, j); - } - -public: // debugging Xpr parse tree - void print_xpr(std::ostream& os, int l=0) const { - os << IndentLevel(l++) - << "XprMtMProduct[" - << (use_meta ? "M" : "L") << ", O=" << ops - << ", (O1=" << ops_lhs << ", O2=" << ops_rhs << ")]<" - << std::endl; - m_lhs.print_xpr(os, l); - os << IndentLevel(l) - << "R1=" << Rows1 << ", C1=" << Cols1 << ",\n"; - m_rhs.print_xpr(os, l); - os << IndentLevel(l) - << "C2=" << Cols2 << ",\n" - << IndentLevel(l) - << "\n" - << IndentLevel(--l) - << ">," << std::endl; - } - -private: - const E1 m_lhs; - const E2 m_rhs; -}; - - -} // namespace tvmet - -#endif // TVMET_XPR_MTMPRODUCT_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/include/tvmet/xpr/MtVProduct.h b/tvmet-1.7.1/include/tvmet/xpr/MtVProduct.h deleted file mode 100644 index a50bacc97..000000000 --- a/tvmet-1.7.1/include/tvmet/xpr/MtVProduct.h +++ /dev/null @@ -1,129 +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: MtVProduct.h,v 1.10 2004/09/16 09:14:18 opetzold Exp $ - */ - -#ifndef TVMET_XPR_MTVPRODUCT_H -#define TVMET_XPR_MTVPRODUCT_H - -#include <cassert> - -#include <tvmet/meta/Gemtv.h> -#include <tvmet/loop/Gemtv.h> - -namespace tvmet { - - -/** - * \class XprMtVProduct MtVProduct.h "tvmet/xpr/MtVProduct.h" - * \brief Expression for matrix-transposed vector product - * using formula - * \f[ - * M^T\,v - * \f] - */ -template<class E1, int Rows, int Cols, - class E2> -class XprMtVProduct - : public TvmetBase< XprMtVProduct<E1, Rows, Cols, E2> > -{ - XprMtVProduct(); - XprMtVProduct& operator=(const XprMtVProduct&); - -public: - typedef typename PromoteTraits< - typename E1::value_type, - typename E2::value_type - >::value_type value_type; - -public: - /** Complexity counter. */ - enum { - ops_lhs = E1::ops, - ops_rhs = E2::ops, - M = Cols * Rows, - N = Cols * (Rows - 1), - ops_plus = M * Traits<value_type>::ops_plus, - ops_muls = N * Traits<value_type>::ops_muls, - ops = ops_plus + ops_muls, - use_meta = Rows*Cols < TVMET_COMPLEXITY_MV_TRIGGER ? true : false - }; - -public: - /** Constructor. */ - explicit XprMtVProduct(const E1& lhs, const E2& rhs) - : m_lhs(lhs), m_rhs(rhs) - { } - - /** Copy Constructor. Not explicit! */ -#if defined(TVMET_OPTIMIZE_XPR_MANUAL_CCTOR) - XprMtVProduct(const XprMtVProduct& e) - : m_lhs(e.m_lhs), m_rhs(e.m_rhs) - { } -#endif - -private: - /** Wrapper for meta gemm. */ - static inline - value_type do_gemtv(dispatch<true>, const E1& lhs, const E2& rhs, int i) { - return meta::gemtv<Rows, Cols, 0>::prod(lhs, rhs, i); - } - - /** Wrapper for loop gemm. */ - static inline - value_type do_gemtv(dispatch<false>, const E1& lhs, const E2& rhs, int i) { - return loop::gemtv<Rows, Cols>::prod(lhs, rhs, i); - } - -public: - /** index operator, returns the expression by index. This is the vector - style since a matrix*vector gives a vector. */ - value_type operator()(int j) const { - assert(j < Cols); - return do_gemtv(dispatch<use_meta>(), m_lhs, m_rhs, j); - } - -public: // debugging Xpr parse tree - void print_xpr(std::ostream& os, int l=0) const { - os << IndentLevel(l++) - << "XprMtVProduct[O=" << ops << ", (O1=" << ops_lhs << ", O2=" << ops_rhs << ")]<" - << std::endl; - m_lhs.print_xpr(os, l); - os << IndentLevel(l) - << "R=" << Rows << ", C=" << Cols << ",\n"; - m_rhs.print_xpr(os, l); - os << IndentLevel(--l) - << ">," << std::endl; - } - -private: - const E1 m_lhs; - const E2 m_rhs; -}; - - -} // namespace tvmet - -#endif // TVMET_XPR_MTVPRODUCT_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/include/tvmet/xpr/Null.h b/tvmet-1.7.1/include/tvmet/xpr/Null.h deleted file mode 100644 index 68396f445..000000000 --- a/tvmet-1.7.1/include/tvmet/xpr/Null.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Tiny Vector Matrix Library - * Dense Vector Matrix Libary of Tiny size using Expression Templates - * - * Copyright (C) 2001 - 2003 Olaf Petzold <opetzold@users.sourceforge.net> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id: Null.h,v 1.7 2003/11/30 18:35:17 opetzold Exp $ - */ - -#ifndef TVMET_XPR_NULL_H -#define TVMET_XPR_NULL_H - -namespace tvmet { - - -/** - * \class XprNull Null.h "tvmet/xpr/Null.h" - * \brief Null object design pattern - */ -class XprNull - : public TvmetBase< XprNull > -{ - XprNull& operator=(const XprNull&); - -public: - explicit XprNull() { } - -public: // debugging Xpr parse tree - void print_xpr(std::ostream& os, int l=0) const { - os << IndentLevel(l) << "XprNull[O=0]" << std::endl; - } -}; - - -#define TVMET_BINARY_OPERATOR(OP) \ -template< class T > \ -inline \ -T operator OP (const T& lhs, XprNull) { return lhs; } - -TVMET_BINARY_OPERATOR(+) -TVMET_BINARY_OPERATOR(-) -TVMET_BINARY_OPERATOR(*) -TVMET_BINARY_OPERATOR(/) - -#undef TVMET_BINARY_OPERATOR - - -} // namespace tvmet - -#endif // TVMET_XPR_NULL_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/include/tvmet/xpr/UnOperator.h b/tvmet-1.7.1/include/tvmet/xpr/UnOperator.h deleted file mode 100644 index 3c4b87f49..000000000 --- a/tvmet-1.7.1/include/tvmet/xpr/UnOperator.h +++ /dev/null @@ -1,98 +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: UnOperator.h,v 1.13 2003/11/30 18:35:17 opetzold Exp $ - */ - -#ifndef TVMET_XPR_UNOPERATOR_H -#define TVMET_XPR_UNOPERATOR_H - -namespace tvmet { - - -/** - * \class XprUnOp UnOperator.h "tvmet/xpr/UnOperator.h" - * \brief Unary operator working on one subexpression. - * - * Using the access operator() the unary operation will be evaluated. - */ -template<class UnOp, class E> -class XprUnOp - : public TvmetBase< XprUnOp<UnOp, E> > -{ - XprUnOp(); - XprUnOp& operator=(const XprUnOp&); - -public: - typedef typename UnOp::value_type value_type; - -public: - /** Complexity counter. */ - enum { - ops_expr = E::ops, - ops = 1 * ops_expr - }; - -public: - /** Constructor for an expressions. */ - explicit XprUnOp(const E& e) - : m_expr(e) - { } - - /** Copy Constructor. Not explicit! */ -#if defined(TVMET_OPTIMIZE_XPR_MANUAL_CCTOR) - XprUnOp(const XprUnOp& e) - : m_expr(e.m_expr) - { } -#endif - - /** Index operator, evaluates the expression inside. */ - value_type operator()(int i) const { - return UnOp::apply_on(m_expr(i)); - } - - /** index operator for arrays/matrices. */ - value_type operator()(int i, int j) const { - return UnOp::apply_on(m_expr(i, j)); - } - -public: // debugging Xpr parse tree - void print_xpr(std::ostream& os, int l=0) const { - os << IndentLevel(l++) - << "XprUnOp[O="<< ops << ", (O=" << ops_expr << ")]<" - << std::endl; - UnOp::print_xpr(os, l); - m_expr.print_xpr(os, l); - os << IndentLevel(--l) - << ">," << std::endl; - } - -private: - const E m_expr; -}; - - -} // namespace tvmet - -#endif // TVMET_XPR_UNOPERATOR_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/include/tvmet/xpr/Vector.h b/tvmet-1.7.1/include/tvmet/xpr/Vector.h deleted file mode 100644 index 65db2a1f1..000000000 --- a/tvmet-1.7.1/include/tvmet/xpr/Vector.h +++ /dev/null @@ -1,154 +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.24 2004/09/16 09:14:18 opetzold Exp $ - */ - -#ifndef TVMET_XPR_VECTOR_H -#define TVMET_XPR_VECTOR_H - -#include <tvmet/meta/Vector.h> -#include <tvmet/loop/Vector.h> - -namespace tvmet { - - -/* forwards */ -template <class T, int Sz> class Vector; - -/** - * \class XprVector Vector.h "tvmet/xpr/Vector.h" - * \brief Represents the expression for vectors at any node in the parse tree. - * - * Specifically, XprVector is the class that wraps the expression, and the - * expression itself is represented by the template parameter E. The - * class XprVector is known as an anonymizing expression wrapper because - * it can hold any subexpression of arbitrary complexity, allowing - * clients to work with any expression by holding on to it via the - * wrapper, without having to know the name of the type object that - * actually implements the expression. - * \note leave the Ctors non-explicit to allow implicit type conversation. - */ -template<class E, int Sz> -class XprVector : public TvmetBase< XprVector<E, Sz> > -{ - XprVector(); - XprVector& operator=(const XprVector&); - -public: - typedef typename E::value_type value_type; - -public: - /** Dimensions. */ - enum { - Size = Sz /**< The size of the vector. */ - }; - -public: - /** Complexity counter */ - enum { - ops_assign = Size, - ops = E::ops, - use_meta = ops_assign < TVMET_COMPLEXITY_V_ASSIGN_TRIGGER ? true : false - }; - -public: - /** Constructor. */ - explicit XprVector(const E& e) - : m_expr(e) - { } - - /** Copy Constructor. Not explicit! */ -#if defined(TVMET_OPTIMIZE_XPR_MANUAL_CCTOR) - XprVector(const XprVector& e) - : m_expr(e.m_expr) - { } -#endif - - /** const index operator for vectors. */ - value_type operator()(int i) const { - assert(i < Size); - return m_expr(i); - } - - /** const index operator for vectors. */ - value_type operator[](int i) const { - return this->operator()(i); - } - -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 expression to Vector dest. */ - template<class Dest, class Assign> - void assign_to(Dest& dest, const Assign& assign_fn) const { - /* here is a way for caching, since each complex 'Node' - is of type XprVector. */ - do_assign(dispatch<use_meta>(), dest, *this, assign_fn); - } - -public: // debugging Xpr parse tree - void print_xpr(std::ostream& os, int l=0) const { - os << IndentLevel(l++) - << "XprVector[" - << (use_meta ? "M" : "L") << ", O=" << ops << "]<" - << std::endl; - m_expr.print_xpr(os, l); - os << IndentLevel(l) - << "Sz=" << Size << std::endl; - os << IndentLevel(--l) << ">" - << ((l != 0) ? "," : "") << std::endl; - } - -private: - const E m_expr; -}; - - -} // namespace tvmet - -#include <tvmet/Functional.h> - -#include <tvmet/xpr/BinOperator.h> -#include <tvmet/xpr/UnOperator.h> -#include <tvmet/xpr/Literal.h> - -#include <tvmet/xpr/VectorFunctions.h> -#include <tvmet/xpr/VectorOperators.h> -#include <tvmet/xpr/Eval.h> - -#endif // TVMET_XPR_VECTOR_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/include/tvmet/xpr/VectorFunctions.h b/tvmet-1.7.1/include/tvmet/xpr/VectorFunctions.h deleted file mode 100644 index 172ed7ab2..000000000 --- a/tvmet-1.7.1/include/tvmet/xpr/VectorFunctions.h +++ /dev/null @@ -1,655 +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.17 2005/03/25 07:11:29 opetzold Exp $ - */ - -#ifndef TVMET_XPR_VECTOR_FUNCTIONS_H -#define TVMET_XPR_VECTOR_FUNCTIONS_H - -namespace tvmet { - - -/* forwards */ -template<class T, int Sz> class Vector; - - -/********************************************************* - * PART I: DECLARATION - *********************************************************/ - - -/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * Vector arithmetic functions add, sub, mul and div - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -/* - * function(XprVector<E1, Sz>, XprVector<E2, Sz>) - */ -#define TVMET_DECLARE_MACRO(NAME) \ -template<class E1, class E2, int Sz> \ -XprVector< \ - XprBinOp< \ - Fcnl_##NAME<typename E1::value_type, typename E2::value_type>, \ - XprVector<E1, Sz>, \ - XprVector<E2, Sz> \ - >, \ - Sz \ -> \ -NAME (const XprVector<E1, Sz>& lhs, \ - const XprVector<E2, 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(XprVector<E, Sz>, POD) - * function(POD, XprVector<E, Sz>) - * Note: - operations +,-,*,/ are per se element wise - */ -#define TVMET_DECLARE_MACRO(NAME, POD) \ -template<class E, int Sz> \ -XprVector< \ - XprBinOp< \ - Fcnl_##NAME< typename E::value_type, POD >, \ - XprVector<E, Sz>, \ - XprLiteral< POD > \ - >, \ - Sz \ -> \ -NAME (const XprVector<E, Sz>& lhs, \ - POD rhs) _tvmet_always_inline; \ - \ -template<class E, int Sz> \ -XprVector< \ - XprBinOp< \ - Fcnl_##NAME< POD, typename E::value_type>, \ - XprLiteral< POD >, \ - XprVector<E, Sz> \ - >, \ - Sz \ -> \ -NAME (POD lhs, \ - const XprVector<E, 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(XprMatrix<E, Rows, Cols>, complex<T>) - * function(complex<T>, XprMatrix<E, Rows, Cols>) - * Note: - operations +,-,*,/ are per se element wise - * \todo type promotion - */ -#define TVMET_DECLARE_MACRO(NAME) \ -template<class E, int Sz, class T> \ -XprVector< \ - XprBinOp< \ - Fcnl_##NAME< typename E::value_type, std::complex<T> >, \ - XprVector<E, Sz>, \ - XprLiteral< std::complex<T> > \ - >, \ - Sz \ -> \ -NAME (const XprVector<E, Sz>& lhs, \ - const std::complex<T>& rhs) _tvmet_always_inline; \ - \ -template<class E, int Sz, class T> \ -XprVector< \ - XprBinOp< \ - Fcnl_##NAME< std::complex<T>, typename E::value_type>, \ - XprLiteral< std::complex<T> >, \ - XprVector<E, Sz> \ - >, \ - Sz \ -> \ -NAME (const std::complex<T>& lhs, \ - const XprVector<E, 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 E, int Sz> -typename Traits<typename E::value_type>::sum_type -sum(const XprVector<E, Sz>& v) _tvmet_always_inline; - - -template<class E, int Sz> -typename Traits<typename E::value_type>::sum_type -product(const XprVector<E, Sz>& v) _tvmet_always_inline; - - -template<class E1, class E2, int Sz> -typename PromoteTraits< - typename E1::value_type, - typename E2::value_type ->::value_type -dot(const XprVector<E1, Sz>& lhs, - const XprVector<E2, Sz>& rhs) _tvmet_always_inline; - - -template<class T, class E, int Sz> -typename PromoteTraits<T, typename E::value_type>::value_type -dot(const Vector<T, Sz>& lhs, - const XprVector<E, Sz>& rhs) _tvmet_always_inline; - - -template<class E, class T, int Sz> -typename PromoteTraits<T, typename E::value_type>::value_type -dot(const XprVector<E, Sz>& lhs, - const Vector<T, Sz>& rhs) _tvmet_always_inline; - - -template<class E1, class E2> -Vector< - typename PromoteTraits< - typename E1::value_type, - typename E2::value_type - >::value_type, - 3 -> -cross(const XprVector<E1, 3>& lhs, - const XprVector<E2, 3>& rhs) _tvmet_always_inline; - - -template<class T, class E> -Vector< - typename PromoteTraits<T, typename E::value_type>::value_type, 3> -cross(const Vector<T, 3>& lhs, - const XprVector<E, 3>& rhs) _tvmet_always_inline; - - -template<class E, class T> -Vector< - typename PromoteTraits<T, typename E::value_type>::value_type, 3> -cross(const XprVector<E, 3>& lhs, - const Vector<T, 3>& rhs) _tvmet_always_inline; - - -template<class E, int Sz> -typename Traits<typename E::value_type>::sum_type -norm1(const XprVector<E, Sz>& v) _tvmet_always_inline; - - -template<class E, int Sz> -typename Traits<typename E::value_type>::sum_type -norm2(const XprVector<E, Sz>& v) _tvmet_always_inline; - - -template<class E, int Sz> -XprVector< - XprBinOp< - Fcnl_div<typename E::value_type, typename E::value_type>, - XprVector<E, Sz>, - XprLiteral<typename E::value_type> - >, - Sz -> -normalize(const XprVector<E, Sz>& v) _tvmet_always_inline; - - -/********************************************************* - * PART II: IMPLEMENTATION - *********************************************************/ - - -/* - * function(XprVector<E1, Sz>, XprVector<E2, Sz>) - */ -#define TVMET_IMPLEMENT_MACRO(NAME) \ -template<class E1, class E2, int Sz> \ -inline \ -XprVector< \ - XprBinOp< \ - Fcnl_##NAME<typename E1::value_type, typename E2::value_type>, \ - XprVector<E1, Sz>, \ - XprVector<E2, Sz> \ - >, \ - Sz \ -> \ -NAME (const XprVector<E1, Sz>& lhs, const XprVector<E2, Sz>& rhs) { \ - typedef XprBinOp< \ - Fcnl_##NAME<typename E1::value_type, typename E2::value_type>, \ - XprVector<E1, Sz>, \ - XprVector<E2, Sz> \ - > expr_type; \ - return XprVector<expr_type, Sz>(expr_type(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 - - -/* - * function(XprVector<E, Sz>, POD) - * function(POD, XprVector<E, Sz>) - * Note: - operations +,-,*,/ are per se element wise - */ -#define TVMET_IMPLEMENT_MACRO(NAME, POD) \ -template<class E, int Sz> \ -inline \ -XprVector< \ - XprBinOp< \ - Fcnl_##NAME< typename E::value_type, POD >, \ - XprVector<E, Sz>, \ - XprLiteral< POD > \ - >, \ - Sz \ -> \ -NAME (const XprVector<E, Sz>& lhs, POD rhs) { \ - typedef XprBinOp< \ - Fcnl_##NAME< typename E::value_type, POD >, \ - XprVector<E, Sz>, \ - XprLiteral< POD > \ - > expr_type; \ - return XprVector<expr_type, Sz>( \ - expr_type(lhs, XprLiteral< POD >(rhs))); \ -} \ - \ -template<class E, int Sz> \ -inline \ -XprVector< \ - XprBinOp< \ - Fcnl_##NAME< POD, typename E::value_type>, \ - XprLiteral< POD >, \ - XprVector<E, Sz> \ - >, \ - Sz \ -> \ -NAME (POD lhs, const XprVector<E, Sz>& rhs) { \ - typedef XprBinOp< \ - Fcnl_##NAME< POD, typename E::value_type>, \ - XprLiteral< POD >, \ - XprVector<E, Sz> \ - > expr_type; \ - return XprVector<expr_type, Sz>( \ - expr_type(XprLiteral< POD >(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) -/* - * function(XprMatrix<E, Rows, Cols>, complex<T>) - * function(complex<T>, XprMatrix<E, Rows, Cols>) - * Note: - operations +,-,*,/ are per se element wise - * \todo type promotion - */ -#define TVMET_IMPLEMENT_MACRO(NAME) \ -template<class E, int Sz, class T> \ -inline \ -XprVector< \ - XprBinOp< \ - Fcnl_##NAME< typename E::value_type, std::complex<T> >, \ - XprVector<E, Sz>, \ - XprLiteral< std::complex<T> > \ - >, \ - Sz \ -> \ -NAME (const XprVector<E, Sz>& lhs, const std::complex<T>& rhs) { \ - typedef XprBinOp< \ - Fcnl_##NAME< typename E::value_type, std::complex<T> >, \ - XprVector<E, Sz>, \ - XprLiteral< std::complex<T> > \ - > expr_type; \ - return XprVector<expr_type, Sz>( \ - expr_type(lhs, XprLiteral< std::complex<T> >(rhs))); \ -} \ - \ -template<class E, int Sz, class T> \ -inline \ -XprVector< \ - XprBinOp< \ - Fcnl_##NAME< std::complex<T>, typename E::value_type>, \ - XprLiteral< std::complex<T> >, \ - XprVector<E, Sz> \ - >, \ - Sz \ -> \ -NAME (const std::complex<T>& lhs, const XprVector<E, Sz>& rhs) { \ - typedef XprBinOp< \ - Fcnl_##NAME< std::complex<T>, typename E::value_type>, \ - XprLiteral< std::complex<T> >, \ - XprVector<E, Sz> \ - > expr_type; \ - return XprVector<expr_type, Sz>( \ - expr_type(XprLiteral< std::complex<T> >(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) - - -/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * vector specific functions - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -/** - * \fn sum(const XprVector<E, Sz>& v) - * \brief Compute the sum of the vector expression. - * \ingroup _unary_function - * - * Simply compute the sum of the given vector as: - * \f[ - * \sum_{i = 0}^{Sz-1} v[i] - * \f] - */ -template<class E, int Sz> -inline -typename Traits<typename E::value_type>::sum_type -sum(const XprVector<E, Sz>& v) { - return meta::Vector<Sz>::sum(v); -} - - -/** - * \fn product(const XprVector<E, Sz>& v) - * \brief Compute the product of the vector elements. - * \ingroup _unary_function - * - * Simply computer the product of the given vector expression as: - * \f[ - * \prod_{i = 0}^{Sz - 1} v[i] - * \f] - */ -template<class E, int Sz> -inline -typename Traits<typename E::value_type>::sum_type -product(const XprVector<E, Sz>& v) { - return meta::Vector<Sz>::product(v); -} - - -/** - * \fn dot(const XprVector<E1, Sz>& lhs, const XprVector<E2, 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 E1, class E2, int Sz> -inline -typename PromoteTraits< - typename E1::value_type, - typename E2::value_type ->::value_type -dot(const XprVector<E1, Sz>& lhs, const XprVector<E2, Sz>& rhs) { - return meta::Vector<Sz>::dot(lhs, rhs); -} - - -/** - * \fn dot(const Vector<T, Sz>& lhs, const XprVector<E, 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 T, class E, int Sz> -inline -typename PromoteTraits<T, typename E::value_type>::value_type -dot(const Vector<T, Sz>& lhs, const XprVector<E, Sz>& rhs) { - return meta::Vector<Sz>::dot(lhs, rhs); -} - - -/** - * \fn dot(const XprVector<E, Sz>& lhs, const Vector<T, 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 E, class T, int Sz> -inline -typename PromoteTraits<T, typename E::value_type>::value_type -dot(const XprVector<E, Sz>& lhs, const Vector<T, Sz>& rhs) { - return meta::Vector<Sz>::dot(lhs, rhs); -} - - -/** - * \fn cross(const XprVector<E1, 3>& lhs, const XprVector<E2, 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 E1, class E2> -inline -Vector< - typename PromoteTraits< - typename E1::value_type, - typename E2::value_type - >::value_type, - 3 -> -cross(const XprVector<E1, 3>& lhs, const XprVector<E2, 3>& rhs) { - typedef typename PromoteTraits< - typename E1::value_type, - typename E2::value_type - >::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 cross(const XprVector<E, 3>& lhs, const Vector<T, 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 E, class T> -inline -Vector< - typename PromoteTraits<T, typename E::value_type>::value_type, 3> -cross(const XprVector<E, 3>& lhs, const Vector<T, 3>& rhs) { - typedef typename PromoteTraits< - typename E::value_type, T>::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 cross(const Vector<T, 3>& lhs, const XprVector<E, 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 E2> -inline -Vector< - typename PromoteTraits<T1, typename E2::value_type>::value_type, 3> -cross(const Vector<T1, 3>& lhs, const XprVector<E2, 3>& rhs) { - typedef typename PromoteTraits< - typename E2::value_type, T1>::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 XprVector<E, Sz>& v) - * \brief The \f$l_1\f$ norm of a vector expression. - * \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 E, int Sz> -inline -typename Traits<typename E::value_type>::sum_type -norm1(const XprVector<E, Sz>& v) { - return sum(abs(v)); -} - - -/** - * \fn norm2(const XprVector<E, Sz>& v) - * \brief The euklidian norm (or \f$l_2\f$ norm) of a vector expression. - * \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 E, int Sz> -inline -typename Traits<typename E::value_type>::sum_type -norm2(const XprVector<E, Sz>& v) { - typedef typename E::value_type value_type; - return static_cast<value_type>( std::sqrt(static_cast<value_type>(dot(v, v))) ); -} - - -/** - * \fn normalize(const XprVector<E, Sz>& v) - * \brief Normalize the given vector expression. - * \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 E, int Sz> -inline -XprVector< - XprBinOp< - Fcnl_div<typename E::value_type, typename E::value_type>, - XprVector<E, Sz>, - XprLiteral<typename E::value_type> - >, - Sz -> -normalize(const XprVector<E, Sz>& v) { - typedef typename E::value_type value_type; - typedef XprBinOp< - Fcnl_div<value_type, value_type>, - XprVector<E, Sz>, - XprLiteral<value_type> - > expr_type; - return XprVector<expr_type, Sz>( - expr_type(v, XprLiteral< value_type >(norm2(v)))); -} - - -} // namespace tvmet - -#endif // TVMET_XPR_VECTOR_FUNCTIONS_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/include/tvmet/xpr/VectorOperators.h b/tvmet-1.7.1/include/tvmet/xpr/VectorOperators.h deleted file mode 100644 index 5f5bf6803..000000000 --- a/tvmet-1.7.1/include/tvmet/xpr/VectorOperators.h +++ /dev/null @@ -1,362 +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.13 2004/06/10 16:36:55 opetzold Exp $ - */ - -#ifndef TVMET_XPR_VECTOR_OPERATORS_H -#define TVMET_XPR_VECTOR_OPERATORS_H - -namespace tvmet { - - -/********************************************************* - * PART I: DECLARATION - *********************************************************/ - - -/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * Vector arithmetic operators implemented by functions - * add, sub, mul and div - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -/* - * operator(XprVector<E1, Sz>, XprVector<E2, Sz>) - */ -#define TVMET_DECLARE_MACRO(NAME, OP) \ -template<class E1, class E2, int Sz> \ -inline \ -XprVector< \ - XprBinOp< \ - Fcnl_##NAME<typename E1::value_type, typename E2::value_type>, \ - XprVector<E1, Sz>, \ - XprVector<E2, Sz> \ - >, \ - Sz \ -> \ -operator OP (const XprVector<E1, Sz>& lhs, \ - const XprVector<E2, 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(XprVector<E, Sz>, POD) - * operator(POD, XprVector<E, Sz>) - * Note: operations +,-,*,/ are per se element wise - */ -#define TVMET_DECLARE_MACRO(NAME, OP, POD) \ -template<class E, int Sz> \ -inline \ -XprVector< \ - XprBinOp< \ - Fcnl_##NAME<typename E::value_type, POD >, \ - XprVector<E, Sz>, \ - XprLiteral< POD > \ - >, \ - Sz \ -> \ -operator OP (const XprVector<E, Sz>& lhs, \ - POD rhs) _tvmet_always_inline; \ - \ -template<class E, int Sz> \ -inline \ -XprVector< \ - XprBinOp< \ - Fcnl_##NAME< POD, typename E::value_type >, \ - XprLiteral< POD >, \ - XprVector< E, Sz> \ - >, \ - Sz \ -> \ -operator OP (POD lhs, \ - const XprVector<E, 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(XprVector<E, Sz>, complex<T>) - * operator(complex<T>, XprVector<E, Sz>) - * Note: operations +,-,*,/ are per se element wise - */ -#define TVMET_DECLARE_MACRO(NAME, OP) \ -template<class E, int Sz, class T> \ -inline \ -XprVector< \ - XprBinOp< \ - Fcnl_##NAME<typename E::value_type, std::complex<T> >, \ - XprVector<E, Sz>, \ - XprLiteral< std::complex<T> > \ - >, \ - Sz \ -> \ -operator OP (const XprVector<E, Sz>& lhs, \ - const std::complex<T>& rhs) _tvmet_always_inline; \ - \ -template<class E, int Sz, class T> \ -inline \ -XprVector< \ - XprBinOp< \ - Fcnl_##NAME< std::complex<T>, typename E::value_type >, \ - XprLiteral< std::complex<T> >, \ - XprVector< E, Sz> \ - >, \ - Sz \ -> \ -operator OP (const std::complex<T>& 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 -TVMET_DECLARE_MACRO(div, /) // per se element wise - -#undef TVMET_DECLARE_MACRO - -#endif // defined(EIGEN_USE_COMPLEX) - - -/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * global unary operators - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -/* - * Unary Operator on XprVector<E, Sz> - */ -#define TVMET_DECLARE_MACRO(NAME, OP) \ -template <class E, int Sz> \ -inline \ -XprVector< \ - XprUnOp< \ - Fcnl_##NAME<typename E::value_type>, \ - XprVector<E, Sz> \ - >, \ - Sz \ -> \ -operator OP (const XprVector<E, Sz>& rhs) _tvmet_always_inline; - -TVMET_DECLARE_MACRO(neg, -) - -#undef TVMET_DECLARE_MACRO - - -/********************************************************* - * PART II: IMPLEMENTATION - *********************************************************/ - - -/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * Vector arithmetic operators implemented by functions - * add, sub, mul and div - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -/* - * operator(XprVector<E1, Sz>, XprVector<E2, Sz>) - */ -#define TVMET_IMPLEMENT_MACRO(NAME, OP) \ -template<class E1, class E2, int Sz> \ -inline \ -XprVector< \ - XprBinOp< \ - Fcnl_##NAME<typename E1::value_type, typename E2::value_type>, \ - XprVector<E1, Sz>, \ - XprVector<E2, Sz> \ - >, \ - Sz \ -> \ -operator OP (const XprVector<E1, Sz>& lhs, \ - const XprVector<E2, 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(XprVector<E, Sz>, POD) - * operator(POD, XprVector<E, Sz>) - * Note: operations +,-,*,/ are per se element wise - */ -#define TVMET_IMPLEMENT_MACRO(NAME, OP, POD) \ -template<class E, int Sz> \ -inline \ -XprVector< \ - XprBinOp< \ - Fcnl_##NAME<typename E::value_type, POD >, \ - XprVector<E, Sz>, \ - XprLiteral< POD > \ - >, \ - Sz \ -> \ -operator OP (const XprVector<E, Sz>& lhs, POD rhs) { \ - return NAME (lhs, rhs); \ -} \ - \ -template<class E, int Sz> \ -inline \ -XprVector< \ - XprBinOp< \ - Fcnl_##NAME< POD, typename E::value_type >, \ - XprLiteral< POD >, \ - XprVector< E, Sz> \ - >, \ - Sz \ -> \ -operator OP (POD lhs, const XprVector<E, 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(XprVector<E, Sz>, complex<T>) - * operator(complex<T>, XprVector<E, Sz>) - * Note: operations +,-,*,/ are per se element wise - */ -#define TVMET_IMPLEMENT_MACRO(NAME, OP) \ -template<class E, int Sz, class T> \ -inline \ -XprVector< \ - XprBinOp< \ - Fcnl_##NAME<typename E::value_type, std::complex<T> >, \ - XprVector<E, Sz>, \ - XprLiteral< std::complex<T> > \ - >, \ - Sz \ -> \ -operator OP (const XprVector<E, Sz>& lhs, \ - const std::complex<T>& rhs) { \ - return NAME (lhs, rhs); \ -} \ - \ -template<class E, int Sz, class T> \ -inline \ -XprVector< \ - XprBinOp< \ - Fcnl_##NAME< std::complex<T>, typename E::value_type >, \ - XprLiteral< std::complex<T> >, \ - XprVector< E, Sz> \ - >, \ - Sz \ -> \ -operator OP (const std::complex<T>& 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 -TVMET_IMPLEMENT_MACRO(div, /) // per se element wise - -#undef TVMET_IMPLEMENT_MACRO - -#endif // defined(EIGEN_USE_COMPLEX) - - -/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * global unary operators - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - -/* - * Unary Operator on XprVector<E, Sz> - */ -#define TVMET_IMPLEMENT_MACRO(NAME, OP) \ -template <class E, int Sz> \ -inline \ -XprVector< \ - XprUnOp< \ - Fcnl_##NAME<typename E::value_type>, \ - XprVector<E, Sz> \ - >, \ - Sz \ -> \ -operator OP (const XprVector<E, Sz>& rhs) { \ - typedef XprUnOp< \ - Fcnl_##NAME<typename E::value_type>, \ - XprVector<E, Sz> \ - > expr_type; \ - return XprVector<expr_type, Sz>(expr_type(rhs)); \ -} - -TVMET_IMPLEMENT_MACRO(neg, -) - -#undef TVMET_IMPLEMENT_MACRO - - -} // namespace tvmet - -#endif // TVMET_XPR_VECTOR_OPERATORS_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/tests/Makefile.am b/tvmet-1.7.1/tests/Makefile.am deleted file mode 100644 index 225f3ce5f..000000000 --- a/tvmet-1.7.1/tests/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -EXTRA_DIST = README t.cc - -EXTRA_PROGRAMS = \ - swap \ - bad_temps \ - bad_xpr_constRef \ - tvmet - -AM_CXXFLAGS= -I$(top_srcdir)/include -I$(top_builddir)/include - -swap_SOURCES = swap.cc -bad_temps_SOURCES = bad_temps.cc -bad_xpr_constRef_SOURCES = bad_xpr_constRef.cc -tvmet_SOURCES = tvmet.cc - -tests: $(EXTRA_PROGRAMS) diff --git a/tvmet-1.7.1/tests/Makefile.in b/tvmet-1.7.1/tests/Makefile.in deleted file mode 100644 index fcc0aa5bd..000000000 --- a/tvmet-1.7.1/tests/Makefile.in +++ /dev/null @@ -1,470 +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@ -SOURCES = $(bad_temps_SOURCES) $(bad_xpr_constRef_SOURCES) $(swap_SOURCES) $(tvmet_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 = swap$(EXEEXT) bad_temps$(EXEEXT) \ - bad_xpr_constRef$(EXEEXT) tvmet$(EXEEXT) -subdir = tests -DIST_COMMON = README $(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_bad_temps_OBJECTS = bad_temps.$(OBJEXT) -bad_temps_OBJECTS = $(am_bad_temps_OBJECTS) -bad_temps_LDADD = $(LDADD) -am_bad_xpr_constRef_OBJECTS = bad_xpr_constRef.$(OBJEXT) -bad_xpr_constRef_OBJECTS = $(am_bad_xpr_constRef_OBJECTS) -bad_xpr_constRef_LDADD = $(LDADD) -am_swap_OBJECTS = swap.$(OBJEXT) -swap_OBJECTS = $(am_swap_OBJECTS) -swap_LDADD = $(LDADD) -am_tvmet_OBJECTS = tvmet.$(OBJEXT) -tvmet_OBJECTS = $(am_tvmet_OBJECTS) -tvmet_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)/bad_temps.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/bad_xpr_constRef.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/swap.Po ./$(DEPDIR)/tvmet.Po -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -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 = $(bad_temps_SOURCES) $(bad_xpr_constRef_SOURCES) \ - $(swap_SOURCES) $(tvmet_SOURCES) -DIST_SOURCES = $(bad_temps_SOURCES) $(bad_xpr_constRef_SOURCES) \ - $(swap_SOURCES) $(tvmet_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@ -EXTRA_DIST = README t.cc -AM_CXXFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -swap_SOURCES = swap.cc -bad_temps_SOURCES = bad_temps.cc -bad_xpr_constRef_SOURCES = bad_xpr_constRef.cc -tvmet_SOURCES = tvmet.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 tests/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu tests/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 -bad_temps$(EXEEXT): $(bad_temps_OBJECTS) $(bad_temps_DEPENDENCIES) - @rm -f bad_temps$(EXEEXT) - $(CXXLINK) $(bad_temps_LDFLAGS) $(bad_temps_OBJECTS) $(bad_temps_LDADD) $(LIBS) -bad_xpr_constRef$(EXEEXT): $(bad_xpr_constRef_OBJECTS) $(bad_xpr_constRef_DEPENDENCIES) - @rm -f bad_xpr_constRef$(EXEEXT) - $(CXXLINK) $(bad_xpr_constRef_LDFLAGS) $(bad_xpr_constRef_OBJECTS) $(bad_xpr_constRef_LDADD) $(LIBS) -swap$(EXEEXT): $(swap_OBJECTS) $(swap_DEPENDENCIES) - @rm -f swap$(EXEEXT) - $(CXXLINK) $(swap_LDFLAGS) $(swap_OBJECTS) $(swap_LDADD) $(LIBS) -tvmet$(EXEEXT): $(tvmet_OBJECTS) $(tvmet_DEPENDENCIES) - @rm -f tvmet$(EXEEXT) - $(CXXLINK) $(tvmet_LDFLAGS) $(tvmet_OBJECTS) $(tvmet_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bad_temps.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bad_xpr_constRef.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swap.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tvmet.Po@am__quote@ - -.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) - -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 - - -tests: $(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: diff --git a/tvmet-1.7.1/tests/README b/tvmet-1.7.1/tests/README deleted file mode 100644 index 7b62c118d..000000000 --- a/tvmet-1.7.1/tests/README +++ /dev/null @@ -1,2 +0,0 @@ -This directory contains files only for the developer to check new features. -Therefore not all is working/compiling here. diff --git a/tvmet-1.7.1/tests/bad_temps.cc b/tvmet-1.7.1/tests/bad_temps.cc deleted file mode 100644 index b3569f8dd..000000000 --- a/tvmet-1.7.1/tests/bad_temps.cc +++ /dev/null @@ -1,243 +0,0 @@ -/* - * This acts as an example on how to not introduce temporaries - * for evaluating expressions. The problem is related to the - * prod() function, where the temps are going out of scope. - */ -extern "C" int printf(const char*, ...); - -#ifndef restrict -#define restrict __restrict__ -#endif - -template<unsigned Rows, unsigned Cols> class Matrix; - -struct XprNull { explicit XprNull() { } }; - -static inline -double operator+(const double& lhs, XprNull) { return lhs; } - - -struct fcnl_Assign { static inline void applyOn(double& restrict lhs, double rhs) { lhs = rhs; } }; - - -template<unsigned Rows, unsigned Cols, - unsigned RowStride, unsigned ColStride> -struct MetaMatrix -{ - enum { - doRows = (RowStride < Rows - 1) ? 1 : 0, - doCols = (ColStride < Cols - 1) ? 1 : 0 - }; - - template<class Mtrx, class E, class Fcnl> - static inline - void assign2(Mtrx& mat, const E& expr, const Fcnl& fn) { - fn.applyOn(mat(RowStride, ColStride), expr(RowStride, ColStride)); - MetaMatrix<Rows * doCols, Cols * doCols, RowStride * doCols, (ColStride+1) * doCols>::assign2(mat, expr, fn); - } - - template<class Mtrx, class E, class Fcnl> - static inline - void assign(Mtrx& mat, const E& expr, const Fcnl& fn) { - MetaMatrix<Rows, Cols, RowStride, 0>::assign2(mat, expr, fn); - MetaMatrix<Rows * doRows, Cols * doRows, (RowStride+1) * doRows, 0>::assign(mat, expr, fn); - } -}; - -template<> -struct MetaMatrix<0, 0, 0, 0> -{ - template<class Mtrx, class E, class Fcnl> - static inline void assign2(Mtrx&, const E&, const Fcnl&) { } - - template<class Mtrx, class E, class Fcnl> - static inline void assign(Mtrx&, const E&, const Fcnl&) { } -}; - - -template<unsigned Rows1, unsigned Cols1, - unsigned Cols2, - unsigned RowStride1, unsigned ColStride1, - unsigned RowStride2, unsigned ColStride2, - unsigned K> -struct MetaGemm -{ - enum { doIt = (K != Cols1 - 1) }; - - static inline - double prod(const double* restrict lhs, const double* restrict rhs, unsigned i, unsigned j) { - return lhs[i * RowStride1 + K * ColStride1] * rhs[K * RowStride2 + j * ColStride2] - + MetaGemm<Rows1 * doIt, Cols1 * doIt, - Cols2 * doIt, RowStride1 * doIt, ColStride1 * doIt, - RowStride2 * doIt, ColStride2 * doIt, (K+1) * doIt>::prod(lhs, rhs, i, j); - } -}; - -template<> -struct MetaGemm<0,0,0,0,0,0,0,0> -{ - static inline XprNull prod(const void*, const void*, unsigned, unsigned) { return XprNull(); } -}; - - -template<unsigned Rows1, unsigned Cols1, - unsigned Cols2, - unsigned RowStride1, unsigned ColStride1, - unsigned RowStride2, unsigned ColStride2> -struct XprMMProduct -{ - explicit XprMMProduct(const double* restrict lhs, const double* restrict rhs) : m_lhs(lhs), m_rhs(rhs) { } - - double operator()(unsigned i, unsigned j) const { - return MetaGemm<Rows1, Cols1, - Cols2, - RowStride1, ColStride1, - RowStride2, ColStride2, 0>::prod(m_lhs, m_rhs, i, j); - } - -private: - const double* restrict m_lhs; - const double* restrict m_rhs; -}; - - -template<class E> -struct XprMatrixTranspose -{ - explicit XprMatrixTranspose(const E& e) : m_expr(e) { } - - double operator()(unsigned i, unsigned j) const { return m_expr(j, i); } - -private: - const E& restrict m_expr; -}; - - -template<class E, unsigned Rows, unsigned Cols> -struct XprMatrix -{ - explicit XprMatrix(const E& e) : m_expr(e) { } - - double operator()(unsigned i, unsigned j) const { return m_expr(i, j); } - -private: - const E& restrict m_expr; -}; - - -template<unsigned Rows, unsigned Cols, - unsigned RowStride, unsigned ColStride> -struct MatrixConstRef -{ - explicit MatrixConstRef(const Matrix<Rows, Cols>& rhs) : m_data(rhs.m_data) { } - - double operator()(unsigned i, unsigned j) const { - return m_data[i * RowStride + j * ColStride]; - } - -private: - const double* restrict m_data; -}; - - -template<unsigned Rows, unsigned Cols> -struct Matrix -{ - explicit Matrix() { m_data = new double [Rows*Cols]; } - - template<class E> - explicit Matrix(const XprMatrix<E, Rows, Cols>& rhs) { - m_data = new double [Rows*Cols]; - MetaMatrix<Rows, Cols, 0, 0>::assign(*this, rhs, fcnl_Assign()); - } - - ~Matrix() { delete [] m_data; } - - double& restrict operator()(unsigned i, unsigned j) { return m_data[i * Cols + j]; } - - double operator()(unsigned i, unsigned j) const { return m_data[i * Cols + j]; } - - MatrixConstRef<Rows,Cols,Cols,1> constRef() const { - return MatrixConstRef<Rows,Cols,Cols,1>(*this); - } - - template <class E> Matrix& operator=(const XprMatrix<E, Rows, Cols>& rhs) { - MetaMatrix<Rows, Cols, 0, 0>::assign(*this, rhs, fcnl_Assign()); - return *this; - } - - void print() const { - printf("[\n"); - for(unsigned i = 0; i != Rows; ++i) { - printf("\t["); - for(unsigned j = 0; j != Cols; ++j) - printf("\t%+4.2f", this->operator()(i, j)); - printf("]\n"); - } - printf("]\n"); - } - -// private: - double* m_data; -}; - - -template<class E1, unsigned Rows1, unsigned Cols1, unsigned Cols2> -inline -XprMatrix< - XprMMProduct< - Rows1, Cols1, Cols2, - Cols1, 1, Cols2, 1 - >, - Rows1, Cols2 -> -prod(const XprMatrix<E1, Rows1, Cols1>& lhs, const Matrix<Cols1, Cols2>& rhs) { - typedef XprMMProduct< - Rows1, Cols1, Cols2, - Cols1, 1, Cols2, 1 - > expr_type; - Matrix<Rows1, Cols1> temp_lhs(lhs); - - return XprMatrix<expr_type, Rows1, Cols2>(expr_type(temp_lhs.m_data, rhs.m_data)); -} - -template<unsigned Rows, unsigned Cols> -inline -XprMatrix< - XprMatrixTranspose< - MatrixConstRef<Rows, Cols, Cols, 1> - >, - Cols, Rows -> -trans(const Matrix<Rows, Cols>& rhs) { - typedef XprMatrixTranspose< - MatrixConstRef<Rows, Cols, Cols, 1> - > expr_type; - return XprMatrix<expr_type, Cols, Rows>(expr_type(rhs.constRef())); -} - - -/** - * Test driver - */ -using namespace std; - -int main() -{ - Matrix<3,2> B; - Matrix<3,3> D; - Matrix<2,2> K; - - B(0,0) = -0.05; B(0,1) = 0; - B(1,0) = 0; B(1,1) = 0.05; - B(2,0) = 0.05; B(2,1) = -0.05; - - D(0,0) = 2000; D(0,1) = 1000; D(0,2) = 0; - D(1,0) = 1000; D(1,1) = 2000; D(1,2) = 0; - D(2,0) = 0; D(2,1) = 0; D(2,2) = 500; - - K = prod(prod(trans(B), D), B); - - printf("K = "); - K.print(); // wrong result, should be symetric -} diff --git a/tvmet-1.7.1/tests/bad_xpr_const_ref.cc b/tvmet-1.7.1/tests/bad_xpr_const_ref.cc deleted file mode 100644 index e56ae8d3c..000000000 --- a/tvmet-1.7.1/tests/bad_xpr_const_ref.cc +++ /dev/null @@ -1,164 +0,0 @@ -/* - * $Id: bad_xpr_constRef.cc,v 1.1 2003/10/21 19:40:38 opetzold Exp $ - * - * This example shows the problem on holding references - * by expressions. On higher optimization levels all things - * are good. Without optimizations it crashs. - */ - -extern "C" int printf(const char*, ...); - -#ifndef restrict -#define restrict __restrict__ -#endif - -template<unsigned Sz> class Vector; - -struct Fcnl_Assign { - static inline void apply_on(double& restrict lhs, double rhs) { lhs = rhs; } -}; - -struct Fcnl_Add { - static inline double apply_on(double lhs, double rhs) { return lhs + rhs; } -}; - -template<unsigned Sz, unsigned Stride=0> -struct MetaVector -{ - enum { - doIt = (Stride < (Sz-1)) ? 1 : 0 - }; - - template <class E1, class E2, class Fcnl> - static inline - void assign(E1& lhs, const E2& rhs, const Fcnl& fn) { - fn.apply_on(lhs(Stride), rhs(Stride)); - MetaVector<Sz * doIt, (Stride+1) * doIt>::assign(lhs, rhs, fn); - } -}; - -template<> -struct MetaVector<0,0> -{ - template <class E1, class E2, class Fcnl> - static inline void assign(E1&, const E2&, const Fcnl&) { } -}; - - -template<class E, unsigned Sz> -struct XprVector -{ - explicit XprVector(const E& e) : m_expr(e) { } - - double operator()(unsigned i) const { - return m_expr(i); - } - - template<class E2, class Fcnl> - void assign_to(E2& e, const Fcnl& fn) const { - MetaVector<Sz, 0>::assign(e, *this, fn); - } - - const E m_expr; -}; - - -template<unsigned Sz, unsigned Stride=1> -struct VectorConstRef -{ - explicit VectorConstRef(const Vector<Sz>& rhs) : m_data(rhs.m_data) { } - - double operator()(unsigned i) const { - return m_data[i * Stride]; - } - - const double* restrict m_data; -}; - - -template<unsigned Sz> -struct Vector -{ - explicit Vector() { } - - double& restrict operator()(unsigned i) { return m_data[i]; } - - double operator()(unsigned i) const { return m_data[i]; } - - typedef VectorConstRef<Sz, 1> ConstRef; - - ConstRef constRef() const { return ConstRef(*this); } - - template<class Fcnl> - void assign_to(Vector& v, const Fcnl& fn) { - MetaVector<Sz, 0>::assign(v, *this, fn); - } - - template<class E> - Vector& operator=(const XprVector<E, Sz>& rhs) { - rhs.assign_to(*this, Fcnl_Assign()); - return *this; - } - - double m_data[Sz]; -}; - - -template<class BinOp, class E1, class E2> -struct XprBinOp -{ - explicit XprBinOp(const E1& lhs, const E2& rhs) - : m_lhs(lhs), m_rhs(rhs) - { } - - double operator()(unsigned i) const { - return BinOp::apply_on(m_lhs(i), m_rhs(i)); - } - - const E1& m_lhs; - const E2& m_rhs; -}; - - -template<unsigned Sz> -inline -XprVector< - XprBinOp< - Fcnl_Add, - VectorConstRef<Sz>, - VectorConstRef<Sz> - >, - Sz -> -add (const Vector<Sz>& lhs, const Vector<Sz>& rhs) { - typedef XprBinOp < - Fcnl_Add, - VectorConstRef<Sz>, - VectorConstRef<Sz> - > expr_type; - return XprVector<expr_type, Sz>( - expr_type(lhs.constRef(), rhs.constRef())); -} - - -int main() -{ - - Vector<5> v, v1,v2; - - v1(0) = 1; - v1(1) = 2; - v1(2) = 3; - v1(3) = 4; - v1(4) = 5; - - v2(0) = 1; - v2(1) = 2; - v2(2) = 3; - v2(3) = 4; - v2(4) = 5; - - v = add(v1, v2); - - printf("v(0) = %f\n", v(0)); -} diff --git a/tvmet-1.7.1/tests/swap.cc b/tvmet-1.7.1/tests/swap.cc deleted file mode 100644 index 85003f2d1..000000000 --- a/tvmet-1.7.1/tests/swap.cc +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Test file for checking meta swap feature. - * - * Swapping using std::swap is faster than meta template implementation. - */ - -#include <iostream> -#include <algorithm> // min, max - -#include <tvmet/Matrix.h> -#include <tvmet/Vector.h> - - -using namespace tvmet; -using namespace std; - -NS_TVMET_BEGIN - -template<int Sz, int Idx=0> -class MetaSwap // later, should be MetaVector -{ -private: - enum { - doIt = (Idx < (Sz-1)) ? 1 : 0 /**< recursive counter */ - }; - -public: - template<class E1, class E2> - static inline - void - swap(E1& e1, E2& e2) { - // XXX BUG: const problem?, we have to use the operator() for Vectors - fcnl_Swap<typename E1::value_type, typename E2::value_type>::applyOn(e1(Idx), e2(Idx)); - MetaSwap<Sz * doIt, (Idx+1) * doIt>::swap(e1, e2); - } -}; - -template<> -class MetaSwap<0, 0> -{ -public: - template<class E1, class E2> static inline void swap(E1&, E2&) { } -}; - - -/** - * \fun swap - * \brief swaps to vector expressions XprVector<E, Sz> - */ -template<class E1, class E2, int Sz> -inline -void swap(XprVector<E1, Sz> e1, XprVector<E2, Sz> e2) { - MetaSwap<Sz>::swap(e1, e2); -} - -/** - * \fun swap - * \brief swaps to vector - */ -template<class T1, class T2, int Sz> -inline -void swap(Vector<T1, Sz>& lhs, Vector<T2, Sz>& rhs) { - swap(lhs.asXpr(), rhs.asXpr()); -} - - -/** - * \fun swap2 - * \brief swaps to vector expressions XprVector<E, Sz> - */ -template<class E1, class E2, int Sz> -inline -void swap2(XprVector<E1, Sz> e1, XprVector<E2, Sz> e2) { - // loops are faster than meta templates - for(int i = 0; i < Sz; ++i) - std::swap(e1[i], e2[i]); -} - -/** - * \fun swap2 - * \brief swaps to vector - */ -template<class T1, class T2, int Sz> -inline -void swap2(Vector<T1, Sz>& lhs, Vector<T2, Sz>& rhs) { - // loops are faster than meta templates - for(int i = 0; i < Sz; ++i) - std::swap(lhs[i], rhs[i]); -} - - -NS_TVMET_END - - - - -template<class V1, class V2> -void test_meta_swap(V1& v1, V2& v2) { - tvmet::swap(v1, v2); -} - -template<class V1, class V2> -void test_loop_swap(V1& v1, V2& v2) { - tvmet::swap2(v1, v2); -} - - - -template<class M1, class M2> -void test_meta_mswap(M1& m1, M2& m2) { - tvmet::swap2(row(m1, 0), row(m2, 0)); - tvmet::swap2(col(m1, 0), col(m2, 0)); -} - - -#define LOOPS 1000000 - -int main() { - typedef Matrix<double, 4, 4> matrix_type; - typedef Vector<double, 4> vector_type; - - //---------------------------------------------------------------- - vector_type v1(1); - vector_type v2(4); - - cout << "\nSwap Vectors\n\n"; - cout << v1 << endl; - cout << v2 << endl; - for(int i = 0; i < LOOPS; ++i) - test_meta_swap(v1, v2); - cout << v1 << endl; - cout << v2 << endl; - for(int i = 0; i < LOOPS; ++i) - test_loop_swap(v1, v2); - cout << v1 << endl; - cout << v2 << endl; - - //---------------------------------------------------------------- - matrix_type m1, m2; - vector_type rv; - - m1 = 1,2,3,4, - 5,6,7,8, - 9,10,11,12, - 13,14,15,16; - m2 = transpose(m1); - - cout << "\nSwap Matrix\n\n"; - cout << m1 << endl; - cout << m2 << endl; - test_meta_mswap(m1, m2); - cout << m1 << endl; - cout << m2 << endl; -} diff --git a/tvmet-1.7.1/tests/t.cc b/tvmet-1.7.1/tests/t.cc deleted file mode 100644 index 7c97618a1..000000000 --- a/tvmet-1.7.1/tests/t.cc +++ /dev/null @@ -1,414 +0,0 @@ -#include <iostream> -#include <tvmet/Vector.h> -#include <tvmet/Matrix.h> - -using std::cout; -using std::endl; - -struct separator { - std::ostream& print_on(std::ostream& os) const { - for(int i = 0; i < 63; ++i) os << "-"; - return os; - } -}; - -std::ostream& operator<<(std::ostream& os, const separator& s) { - return s.print_on(os); -} - -template<class T1, class T2 = T1> -class TestBase -{ -public: - typedef T1 value_type; - typedef T2 value_type2; - - typedef tvmet::Vector<value_type, 3> vector_type; - typedef tvmet::Matrix<value_type, 3, 3> matrix_type; - typedef tvmet::Vector<value_type2, 3> vector_type2; - typedef tvmet::Matrix<value_type2, 3, 3> matrix_type2; - -private: - vector_type v0; - matrix_type M0; - -protected: - vector_type v1, v2, v3; - matrix_type M1, M2, M3; - -protected: - TestBase() - { - v0 = 1,2,3; - M0 = 1,4,7,2,5,8,3,6,9; - reset(); - } - - ~TestBase() { } - - void reset() - { - v1 = v0; v2 = v0; v3 = v0; - M1 = M0; M2 = M0; M3 = M0; - } - -public: - void show_v1(const std::string& op) { - cout << separator() << endl - << op << " = " - << v1 << endl - << separator() << endl; - } - - void show_v2(const std::string& op) { - cout << separator() << endl - << op << " = " - << v2 << endl - << separator() << endl; - } - - void show_v3(const std::string& op) { - cout << separator() << endl - << op << " = " - << v3 << endl - << separator() << endl; - } - - void show_v() { - cout << separator() << endl; - cout << "v1 = " << v1 << endl - << "v2 = " << v2 << endl - << "v3 = " << v3 << endl; - cout << separator() << endl; - } - - void show_M1(const std::string& op) { - cout << separator() << endl - << op << " = " - << M1 << endl - << separator() << endl; - } - - void show_M2(const std::string& op) { - cout << separator() << endl - << op << " = " - << M2 << endl - << separator() << endl; - } - - void show_M3(const std::string& op) { - cout << separator() << endl - << op << " = " - << M3 << endl - << separator() << endl; - } - - void show_M() { - cout << separator() << endl; - cout << "M1 = " << M1 << endl - << "M2 = " << M2 << endl - << "M3 = " << M3 << endl; - cout << separator() << endl; - } -}; - - - - -/* - * Vector - */ -class TestV : public TestBase<double> -{ -public: - TestV() { } - -public: - void case1() { - reset(); - - v1 = v2 + v2 + v3; - - show_v1("v2 + v2 + v3"); - } - void case2() { - reset(); - - v1 = sin( (v2 + v2) * v2 ); - - show_v1("sin( (v2 + v2) * v2 )"); - } - void case3() { - reset(); - - v1 = (v2 + v2) * (v2 + v2); - - show_v1("(v2 + v2) * (v2 + v2)"); - } - void case4() { - reset(); - - v1 = (v2 + v2) * (v2 + v2) / 4; - - show_v1("(v2 + v2) * (v2 + v2) / 4"); - } - void case5() { - reset(); - - } -}; - -/* - * Matrix - */ -class TestM : public TestBase<double> -{ -public: - TestM() { } - -public: - void case1() { - reset(); - - M1 = M2 + M3; - - show_M1("M2 + M3"); - } - void case2() { - reset(); - - M1 = M2 + M2 + M2 + M2; - - show_M1("M2 + M2 + M2 + M2"); - } - void case3() { - reset(); - - /* - XXX: missing feature element_wise XprMatrix * Xprmatrix - - M1 = ( M2 + M2 ) * ( M2 + M2 ); - - M1 = tvmet::element_wise::product( M2 + M2, M2 + M2 ); - - show_M1("empty"); - */ - } - void case4() { - reset(); - - M1 = sin(M2 + M2); // UFUNC(XprMatrix) - - show_M1("sin(M2 + M2)"); - } - void case5() { - reset(); - - M1 = trans(M2); // = XprMatrix - - show_M1("trans(M2)"); - } - void case6() { - reset(); - - M1 = trans(M2) + M2; // XprMatrix + Matrix - - show_M1("trans(M2) + M2"); - } - void case7() { - reset(); - - M1 = M2 + trans(M2); // Matrix + XprMatrix - - show_M1("M2 + trans(M2)"); - } - void case8() { - reset(); - - /* - * WRONG results, should be: - * 120 264 408 - * 144 324 504 - * 168 384 600 - * there seems to be a side effect!! - */ - - M1 = prod((M2 + M2), (M2 + M2)); // XprMatrix * XprMatrix - - show_M1("prod((M2 + M2), (M2 + M2))"); - } - void case9() { - reset(); - - M1 = (M2 + M2) * (M2 + M2); // XprMatrix * XprMatrix - - show_M1("(M2 + M2) * (M2 + M2)"); - } - void case10() { - reset(); - - } -}; - -/* - * Matrix-Vector - */ -class TestMV : public TestBase<double> -{ -public: - TestMV() { } - -public: - void case1() { - reset(); - - v1 = M1 * v2; - - show_v1("M1 * v2"); - } - void case2() { - reset(); - - v1 = (M1 * v2) + v2; - - show_v1("(M1 * v2) + v2"); - } - void case3() { - reset(); - - v1 = (M1 * v2) + (M1 * v2); - - show_v1("(M1 * v2) + (M1 * v2)"); - } - void case4() { - reset(); - - v1 = (M1 * v2) * (M1 * v2); // element wise: XprVector * XprVector - - show_v1("element_wise: (M1 * v2) * (M1 * v2)"); - } - void case5() { - reset(); - - using namespace tvmet::element_wise; - v1 = (M1 * v2) / (M1 * v2); // element_wise: XprVector / XprVector - - show_v1("element_wise: (M1 * v2) / (M1 * v2)"); - } - void case6() { - reset(); - - v1 = prod(M1, v2); - - show_v1("trans_prod(M1, v2)"); - } - void case7() { - reset(); - - v1 = prod(M1, v2) + v2;// XprVector + Vector - - show_v1("prod(M1, v2) + v2"); - } - void case8() { - reset(); - - using namespace tvmet::element_wise; - v1 += prod(M1, v2) / v2;// element_wise: XprVector + Vector - - show_v1("v1 += prod(M1, v2) / v2"); - } - void case9() { - reset(); - - v1 = prod(M1, v2) + prod(M1, v2);// element wise: XprVector * XprVector - - show_v1("prod(M1, v2) + prod(M1, v2)"); - } - void case10() { - reset(); - - using namespace tvmet::element_wise; - v1 = prod(M1, v2) / prod(M1, v2);// element_wise: XprVector / XprVector - - all_elements( v1 == 1 ); - - show_v1("prod(M1, v2) / prod(M1, v2)"); - } - void case11() { - reset(); - - v1 = M1 * (v1+v1); - - show_v1("M1 * (v1+v1)"); - } - void case12() { - reset(); - - v1 = M1 * prod(M1, v2); - - show_v1("M1 * prod(M1, v2)"); - } -}; - - - - - -/* - * Main - */ -int main() -{ - tvmet::Matrix<double, 3,3> MM; - MM = 1,2,3,4,5,6,7,8,9; - tvmet::Matrix<double, 3,3> MM2( MM ); - - TestV v; - TestM M; - TestMV Mv; - - v.show_v(); - M.show_M(); - - cout << "*****************************************************************" << endl; - -#if 1 - v.case1(); - v.case2(); - v.case3(); - v.case4(); - v.case5(); - - cout << "*****************************************************************" << endl; -#endif - -#if 1 - M.case1(); - M.case2(); - M.case3(); - M.case4(); - M.case5(); - M.case6(); - M.case7(); - M.case8(); - M.case9(); - M.case10(); - - cout << "*****************************************************************" << endl; -#endif - -#if 1 - Mv.case1(); - Mv.case2(); - Mv.case3(); - Mv.case4(); - Mv.case5(); -#endif - Mv.case6(); - Mv.case7(); - Mv.case8(); - Mv.case9(); - Mv.case10(); - Mv.case11(); - Mv.case12(); -} diff --git a/tvmet-1.7.1/tests/tvmet.cc b/tvmet-1.7.1/tests/tvmet.cc deleted file mode 100644 index 98a879ee5..000000000 --- a/tvmet-1.7.1/tests/tvmet.cc +++ /dev/null @@ -1,312 +0,0 @@ -/* - * $Id: tvmet.cc,v 1.3 2003/10/21 19:37:06 opetzold Exp $ - * - * This file shows the basic principle used by tvmet. Therefore - * you will not find promotion etc. here. - */ - -extern "C" int printf(const char*, ...); - -#ifndef restrict -#define restrict __restrict__ -#endif - -template<unsigned Rows, unsigned Cols> class Matrix; - -struct XprNull { explicit XprNull() { } }; - -static inline -double operator+(const double& lhs, XprNull) { return lhs; } - - -struct Fcnl_Assign { static inline void apply_on(double& restrict lhs, double rhs) { lhs = rhs; } }; - - -template<unsigned Rows, unsigned Cols, - unsigned RowStride, unsigned ColStride> -struct MetaMatrix -{ - enum { - doRows = (RowStride < Rows - 1) ? 1 : 0, - doCols = (ColStride < Cols - 1) ? 1 : 0 - }; - - template<class E1, class E2, class Fcnl> - static inline - void assign2(E1& lhs, const E2& rhs, const Fcnl& fn) { - fn.apply_on( lhs(RowStride, ColStride), rhs(RowStride, ColStride) ); - MetaMatrix<Rows * doCols, Cols * doCols, RowStride * doCols, (ColStride+1) * doCols>::assign2(lhs, rhs, fn); - } - - template<class E1, class E2, class Fcnl> - static inline - void assign(E1& lhs, const E2& rhs, const Fcnl& fn) { - MetaMatrix<Rows, Cols, RowStride, 0>::assign2(lhs, rhs, fn); - MetaMatrix<Rows * doRows, Cols * doRows, (RowStride+1) * doRows, 0>::assign(lhs, rhs, fn); - } -}; - -template<> -struct MetaMatrix<0, 0, 0, 0> -{ - template<class E1, class E2, class Fcnl> - static inline void assign2(E1&, const E2&, const Fcnl&) { } - - template<class E1, class E2, class Fcnl> - static inline void assign(E1&, const E2&, const Fcnl&) { } -}; - - -template<unsigned Rows1, unsigned Cols1, - unsigned Cols2, - unsigned RowStride1, unsigned ColStride1, - unsigned RowStride2, unsigned ColStride2, - unsigned K> -struct MetaGemm -{ - enum { doIt = (K != Cols1 - 1) }; - - template<class E1, class E2> - static inline - double prod(const E1& lhs, const E2& rhs, unsigned i, unsigned j) { - return lhs(i, K) * rhs(K, j) - + MetaGemm<Rows1 * doIt, Cols1 * doIt, - Cols2 * doIt, RowStride1 * doIt, ColStride1 * doIt, - RowStride2 * doIt, ColStride2 * doIt, (K+1) * doIt>::prod(lhs, rhs, i, j); - } -}; - -template<> -struct MetaGemm<0,0,0,0,0,0,0,0> -{ - template<class E1, class E2> - static inline XprNull prod(const E1&, const E2&, unsigned, unsigned) { return XprNull(); } -}; - - -template<class E1, class E2, - unsigned Rows1, unsigned Cols1, - unsigned Cols2, - unsigned RowStride1, unsigned ColStride1, - unsigned RowStride2, unsigned ColStride2> -struct XprMMProduct -{ - explicit XprMMProduct(const E1& lhs, const E2& rhs) : m_lhs(lhs), m_rhs(rhs) { } - - double operator()(unsigned i, unsigned j) const { - return MetaGemm< - Rows1, Cols1, - Cols2, - RowStride1, ColStride1, - RowStride2, ColStride2, 0>::prod(m_lhs, m_rhs, i, j); - } - -// void assign_to(Matrix<Rows1, Cols2>& rhs) const { -// MetaMatrix<Rows1, Cols2, 0, 0>::assign(rhs, *this, Fcnl_Assign()); -// } - -private: - const E1 m_lhs; - const E2 m_rhs; -}; - - -template<class E> -struct XprMatrixTranspose -{ - explicit XprMatrixTranspose(const E& e) : m_expr(e) { } - - double operator()(unsigned i, unsigned j) const { return m_expr(j, i); } - -// template<unsigned Rows, unsigned Cols> -// void assign_to(Matrix<Rows, Cols>& rhs) const { -// MetaMatrix<Rows, Cols, 0, 0>::assign(rhs, *this, Fcnl_Assign()); -// } - -private: - const E m_expr; -}; - - -template<class E, unsigned Rows, unsigned Cols> -struct XprMatrix -{ - explicit XprMatrix(const E& e) : m_expr(e) { } - - double operator()(unsigned i, unsigned j) const { return m_expr(i, j); } - - void assign_to(Matrix<Rows, Cols>& rhs) const { - MetaMatrix<Rows, Cols, 0, 0>::assign(rhs, *this, Fcnl_Assign()); - } - -private: - const E m_expr; -}; - - -template<unsigned Rows, unsigned Cols, - unsigned RowStride, unsigned ColStride> -struct MatrixConstRef -{ - explicit MatrixConstRef(const Matrix<Rows, Cols>& rhs) : m_data(rhs.m_data) { } - - double operator()(unsigned i, unsigned j) const { - return m_data[i * RowStride + j * ColStride]; - } - -private: - const double* restrict m_data; -}; - - -template<unsigned Rows, unsigned Cols> -struct Matrix -{ - explicit Matrix() { m_data = new double [Rows*Cols]; } - - template<class E> - explicit Matrix(const XprMatrix<E, Rows, Cols>& rhs) { - m_data = new double [Rows*Cols]; - MetaMatrix<Rows, Cols, 0, 0>::assign(*this, rhs, Fcnl_Assign()); - } - - ~Matrix() { delete [] m_data; } - - double& restrict operator()(unsigned i, unsigned j) { return m_data[i * Cols + j]; } - - double operator()(unsigned i, unsigned j) const { return m_data[i * Cols + j]; } - - MatrixConstRef<Rows,Cols,Cols,1> constRef() const { - return MatrixConstRef<Rows,Cols,Cols,1>(*this); - } - - Matrix& operator=(const Matrix<Rows, Cols>& rhs) { - rhs.assign_to(*this); - return *this; - } - - void assign_to(Matrix<Rows, Cols>& rhs) const { - MetaMatrix<Rows, Cols, 0, 0>::assign(rhs, *this, Fcnl_Assign()); - } - - template <class E> - Matrix& operator=(const XprMatrix<E, Rows, Cols>& rhs) { - rhs.assign_to(*this); - return *this; - } - - template <class E> - void assign_to(XprMatrix<E, Rows, Cols>& rhs) const { - MetaMatrix<Rows, Cols, 0, 0>::assign(rhs, *this, Fcnl_Assign()); - } - - void print() const { - printf("[\n"); - for(unsigned i = 0; i != Rows; ++i) { - printf("\t["); - for(unsigned j = 0; j != Cols; ++j) - printf("\t%+4.2f", this->operator()(i, j)); - printf("]\n"); - } - printf("]\n"); - } - - double* m_data; -}; - - -template<unsigned Rows1, unsigned Cols1, - unsigned Cols2> -inline -XprMatrix< - XprMMProduct< - MatrixConstRef<Rows1, Cols1, Cols1, 1>, - MatrixConstRef<Cols1, Cols2, Cols2, 1>, - Rows1, Cols1, // M1(Rows1, Cols1) - Cols2, // M2(Cols1, Cols2) - Cols1, 1, // Stride M1 - Cols2, 1 // Stride M2 - >, - Rows1, Cols2 // return Dim -> -prod(const Matrix<Rows1, Cols1>& lhs, const Matrix<Cols1, Cols2>& rhs) { - typedef XprMMProduct< - MatrixConstRef<Rows1, Cols1, Cols1, 1>, - MatrixConstRef<Cols1, Cols2, Cols2, 1>, - Rows1, Cols1, - Cols2, - Cols1, 1, - Cols2, 1 - > expr_type; - return XprMatrix<expr_type, Rows1, Cols2>( - expr_type(lhs.constRef(), rhs.constRef())); -} - -template<class E1, unsigned Rows1, unsigned Cols1, unsigned Cols2> -inline -XprMatrix< - XprMMProduct< - XprMatrix<E1, Rows1, Cols1>, - MatrixConstRef<Cols1, Cols2, Cols2, 1>, - Rows1, Cols1, Cols2, - Cols1, 1, Cols2, 1 - >, - Rows1, Cols2 - > -prod(const XprMatrix<E1, Rows1, Cols1>& lhs, const Matrix<Cols1, Cols2>& rhs) { - typedef XprMMProduct< - XprMatrix<E1, Rows1, Cols1>, - MatrixConstRef<Cols1, Cols2, Cols2, 1>, - Rows1, Cols1, Cols2, - Cols1, 1, Cols2, 1 - > expr_type; - return XprMatrix<expr_type, Rows1, Cols2>(expr_type(lhs, rhs.constRef())); -} - - -template<unsigned Rows, unsigned Cols> -inline -XprMatrix< - XprMatrixTranspose< - MatrixConstRef<Rows, Cols, Cols, 1> - >, - Cols, Rows -> -trans(const Matrix<Rows, Cols>& rhs) { - typedef XprMatrixTranspose< - MatrixConstRef<Rows, Cols, Cols, 1> - > expr_type; - return XprMatrix<expr_type, Cols, Rows>(expr_type(rhs.constRef())); -} - - -/** - * Test driver - */ -int main() -{ - Matrix<3,2> B; - Matrix<3,3> D; - - B(0,0) = -0.05; B(0,1) = 0; - B(1,0) = 0; B(1,1) = 0.05; - B(2,0) = 0.05; B(2,1) = -0.05; - - D(0,0) = 2000; D(0,1) = 1000; D(0,2) = 0; - D(1,0) = 1000; D(1,1) = 2000; D(1,2) = 0; - D(2,0) = 0; D(2,1) = 0; D(2,2) = 500; - - printf("B = "); - B.print(); - printf("D = "); - D.print(); - printf("\n***********************************************\n"); - - Matrix<2,2> K; - - K = prod(prod(trans(B), D), B); - - printf("Check: (equal prod(prod(trans(B), D), B)\n"); - printf(" K = "); - K.print(); -} diff --git a/tvmet-1.7.1/testsuite/CMakeLists.txt b/tvmet-1.7.1/testsuite/CMakeLists.txt deleted file mode 100644 index 176cc4db6..000000000 --- a/tvmet-1.7.1/testsuite/CMakeLists.txt +++ /dev/null @@ -1,50 +0,0 @@ -INCLUDE(CheckIncludeFiles) - -IF(BUILD_TESTS) - -ENABLE_TESTING() - -FIND_PACKAGE(Qt4 REQUIRED) - -INCLUDE_DIRECTORIES( ${QT_INCLUDE_DIR} ) - -SET(testsuite_SOURCES - main.cpp - testcommainitializer.cpp - testtraits.cpp - testconstructors.cpp -# TestConstruction.h TestConstruction.cc -# TestComplexMatrix.h TestComplexMatrix.cc -# TestComplexVector.h TestComplexVector.cc -# TestDimension.h TestDimension.cc -# TestMathOps.h TestMathOps.cc -# TestMatrixEval.h TestMatrixEval.cc -# TestMatrixFunctions.h TestMatrixFunctions.cc -# TestMatrixOperators.h TestMatrixOperators.cc -# TestSTL.h TestSTL.cc -# TestUnFunc.h TestUnFunc.cc -# TestVectorEval.h TestVectorEval.cc -# TestVectorFunctions.h TestVectorFunctions.cc -# TestVectorOperators.h TestVectorOperators.cc -# TestXpr.h TestXpr.cc -# TestXprMatrixFunctions.h TestXprMatrixFunctions.cc -# TestXprMatrixOperators.h TestXprMatrixOperators.cc -# TestXprVectorFunctions.h TestXprVectorFunctions.cc -# TestXprVectorOperators.h TestXprVectorOperators.cc -# TestUnloops.h TestUnloops.cc -# TestMatrixElementwise.h TestMatrixElementwise.cc -) - -QT4_AUTOMOC(${testsuite_SOURCES}) - -INCLUDE_DIRECTORIES(${CPPUNIT_INCLUDE_DIR} - ${CMAKE_SOURCE_DIR}/tvmet-1.7.1/include - ${CMAKE_INSTALL_PREFIX}/include) - -ADD_EXECUTABLE(testsuite ${testsuite_SOURCES}) - -TARGET_LINK_LIBRARIES(testsuite ${QT_QTCORE_LIBRARY} ${QT_QTTEST_LIBRARY}) - -ADD_TEST(Eigen testsuite) - -ENDIF(BUILD_TESTS) diff --git a/tvmet-1.7.1/testsuite/TestConstruction.h b/tvmet-1.7.1/testsuite/TestConstruction.h deleted file mode 100644 index 2df7be4b5..000000000 --- a/tvmet-1.7.1/testsuite/TestConstruction.h +++ /dev/null @@ -1,302 +0,0 @@ -/* - * Tiny Vector Matrix Library - * Dense Vector Matrix Libary of Tiny size using Expression Templates - * - * Copyright (C) 2001 - 2003 Olaf Petzold <opetzold@users.sourceforge.net> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id: TestConstruction.h,v 1.1 2004/04/24 11:55:15 opetzold Exp $ - */ - -#ifndef TVMET_TEST_CONSTRUCTION_H -#define TVMET_TEST_CONSTRUCTION_H - -#include <cppunit/extensions/HelperMacros.h> - -#include <tvmet/Vector.h> -#include <tvmet/Matrix.h> - -template <class T> -class TestConstruction : public CppUnit::TestFixture -{ - CPPUNIT_TEST_SUITE( TestConstruction ); - CPPUNIT_TEST( vector_ctor1 ); - CPPUNIT_TEST( vector_ctor2 ); - CPPUNIT_TEST( vector_ctor3 ); - CPPUNIT_TEST( vector_ctor4 ); - CPPUNIT_TEST( vector_ctor5 ); - CPPUNIT_TEST( vector_ctor6 ); - CPPUNIT_TEST( vector_cctor ); - CPPUNIT_TEST( matrix_ctor1 ); - CPPUNIT_TEST( matrix_ctor2 ); - CPPUNIT_TEST( matrix_ctor3 ); - CPPUNIT_TEST( matrix_ctor4 ); - CPPUNIT_TEST( matrix_ctor5 ); - CPPUNIT_TEST( matrix_cctor ); - CPPUNIT_TEST_SUITE_END(); - -private: - enum { dim = 3 }; - typedef tvmet::Vector<T, dim> vector_type; - typedef tvmet::Matrix<T, dim, dim> matrix_type; - -public: - TestConstruction() - : vZero(0), vOne(1), mZero(0), mOne(1) { } - -public: // cppunit interface - /** cppunit hook for fixture set up. */ - void setUp(); - - /** cppunit hook for fixture tear down. */ - void tearDown(); - -protected: - void vector_ctor1(); - void vector_ctor2(); - void vector_ctor3(); - void vector_ctor4(); - void vector_ctor5(); - void vector_ctor6(); - void vector_cctor(); - - void matrix_ctor1(); - void matrix_ctor2(); - void matrix_ctor3(); - void matrix_ctor4(); - void matrix_ctor5(); - void matrix_cctor(); - -private: - const vector_type vZero; - const vector_type vOne; - vector_type v1; - -private: - const matrix_type mZero; - const matrix_type mOne; - matrix_type m1; -}; - -/***************************************************************************** - * Implementation Part I (cppunit part) - ****************************************************************************/ - -template <class T> -void TestConstruction<T>::setUp () { - v1 = 1,2,3; - - m1 = 1,4,7, - 2,5,8, - 3,6,9; -} - -template <class T> -void TestConstruction<T>::tearDown() { } - -/***************************************************************************** - * Implementation Part II (Vectors) - ****************************************************************************/ - -/* - * Vector (InputIterator first, InputIterator last) - */ -template <class T> -void -TestConstruction<T>::vector_ctor1() { - T data[] = {1,2,3}; - - int sz = sizeof(data)/sizeof(T); - T* first = data; - T* last = data + sz; - - vector_type v(first, last); - - CPPUNIT_ASSERT( all_elements(v == v1) ); -} - -/* - * Vector (InputIterator first, int sz) - */ -template <class T> -void -TestConstruction<T>::vector_ctor2() { - T data[] = {1,2,3}; - - int sz = sizeof(data)/sizeof(T); - T* first = data; - - vector_type v(first, sz); - - CPPUNIT_ASSERT( all_elements(v == v1) ); -} - -/* - * Vector (value_type rhs) - */ -template <class T> -void -TestConstruction<T>::vector_ctor3() { - - vector_type one(static_cast<T>(1.0)); - vector_type zero(static_cast<T>(0.0)); - - CPPUNIT_ASSERT( all_elements(one == vOne) ); - CPPUNIT_ASSERT( all_elements(zero == vZero) ); -} - -/* - * Vector (value_type x0, value_type x1, value_type x2) - * TODO: check for other length too. - */ -template <class T> -void -TestConstruction<T>::vector_ctor4() { - vector_type v(1,2,3); - - CPPUNIT_ASSERT( all_elements(v == v1) ); -} - -/* - * Vector (XprVector< E, Sz > expr) - * Note: a little bit dangerous, since we haven't check expr yet. - */ -template <class T> -void -TestConstruction<T>::vector_ctor5() { - vector_type v(v1 - v1); - - CPPUNIT_ASSERT( all_elements(v == vZero) ); -} - -/* - * operator=(const Vector< T2, Sz > &) - */ -template <class T> -void -TestConstruction<T>::vector_ctor6() { - vector_type v; - v = v1; - - CPPUNIT_ASSERT( all_elements(v == v1) ); -} - -/* - * Vector (const this_type &rhs) - */ -template <class T> -void -TestConstruction<T>::vector_cctor() { - vector_type v(v1); - - CPPUNIT_ASSERT( all_elements(v == v1) ); -} - - -/***************************************************************************** - * Implementation Part III (Matrizes) - ****************************************************************************/ - -/* - * Matrix (InputIterator first, InputIterator last) - */ -template <class T> -void -TestConstruction<T>::matrix_ctor1() { - T data[] = { 1,4,7, - 2,5,8, - 3,6,9 }; - - int sz = sizeof(data)/sizeof(T); - T* first = data; - T* last = data + sz; - - matrix_type m(first, last); - - CPPUNIT_ASSERT( all_elements(m == m1) ); -} - -/* - * Matrix (InputIterator first, int sz) - */ -template <class T> -void -TestConstruction<T>::matrix_ctor2() { - T data[] = { 1,4,7, - 2,5,8, - 3,6,9 }; - - int sz = sizeof(data)/sizeof(T); - T* first = data; - - matrix_type m(first, sz); - - CPPUNIT_ASSERT( all_elements(m == m1) ); -} - -/* - * Matrix (value_type rhs) - */ -template <class T> -void -TestConstruction<T>::matrix_ctor3() { - matrix_type one(static_cast<T>(1.0)); - matrix_type zero(static_cast<T>(0.0)); - - CPPUNIT_ASSERT( all_elements(one == mOne) ); - CPPUNIT_ASSERT( all_elements(zero == mZero) ); -} - -/* - * Matrix (XprMatrix< E, Rows, Cols > expr) - * Note: a little bit dangerous, since we haven't check expr yet. - */ -template <class T> -void -TestConstruction<T>::matrix_ctor4() { - matrix_type m(m1 - m1); - - CPPUNIT_ASSERT( all_elements(m == mZero) ); -} - -/* - * operator= (value_type rhs) - */ -template <class T> -void -TestConstruction<T>::matrix_ctor5() { - matrix_type m; - m = m1; - - CPPUNIT_ASSERT( all_elements(m == m1) ); -} - -/* - * Matrix (const this_type &rhs) - */ -template <class T> -void -TestConstruction<T>::matrix_cctor() { - matrix_type m(m1); - - CPPUNIT_ASSERT( all_elements(m == m1) ); -} - -#endif // TVMET_TEST_CONSTRUCTION_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/testsuite/TestDimension.h b/tvmet-1.7.1/testsuite/TestDimension.h deleted file mode 100644 index f524b1167..000000000 --- a/tvmet-1.7.1/testsuite/TestDimension.h +++ /dev/null @@ -1,259 +0,0 @@ -/* - * Tiny Vector Matrix Library - * Dense Vector Matrix Libary of Tiny size using Expression Templates - * - * Copyright (C) 2001 - 2003 Olaf Petzold <opetzold@users.sourceforge.net> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id: TestDimension.h,v 1.1 2004/04/24 11:55:15 opetzold Exp $ - */ - -#ifndef TVMET_TEST_DIMENSION_H -#define TVMET_TEST_DIMENSION_H - -#include <cppunit/extensions/HelperMacros.h> - -#include <tvmet/Vector.h> -#include <tvmet/Matrix.h> - -template <class T> -class TestDimension : public CppUnit::TestFixture -{ - CPPUNIT_TEST_SUITE( TestDimension ); - CPPUNIT_TEST( small_add ); - CPPUNIT_TEST( Mtx ); - CPPUNIT_TEST( MtM ); - CPPUNIT_TEST( MMt ); - CPPUNIT_TEST( MMt ); - CPPUNIT_TEST( trans_MM ); - CPPUNIT_TEST( Row ); - CPPUNIT_TEST( Col ); - CPPUNIT_TEST_SUITE_END(); - -public: - TestDimension() { } - -public: // cppunit interface - /** cppunit hook for fixture set up. */ - void setUp(); - - /** cppunit hook for fixture tear down. */ - void tearDown(); - -protected: - void small_add(); - void Mtx(); - void MtM(); - void MMt(); - void trans_MM(); - void Row(); - void Col(); -}; - -/***************************************************************************** - * Implementation part I (cppunit part) - ****************************************************************************/ - -template <class T> -void TestDimension<T>::setUp() { } - -template <class T> -void TestDimension<T>::tearDown() { } - -/***************************************************************************** - * Implementation part II - ****************************************************************************/ - -template <class T> -void TestDimension<T>::small_add() { - using namespace tvmet; - - Matrix<double, 5, 3> M1, M2, M3; - - M1 = - 1,1,1, - 1,1,1, - 1,1,1, - 1,1,1, - 1,1,1; - M2 = M1; - - M3 = M1 + M2; - - CPPUNIT_ASSERT( all_elements(M3 == 2) ); -} - - -template <class T> -void TestDimension<T>::Mtx() { - using namespace tvmet; - - Matrix<double, 6, 3> M1; - - Vector<double, 6> v1; - Vector<double, 3> r(0), v2(0); - - M1 = - 1, 2, 3, - 4, 5, 6, - 7, 8, 9, - 10,11,12, - 13,14,15, - 16,17,18; - v1 = 1,2,3,4,5,6; - - r = trans(M1)*v1; - - v2 = Mtx_prod(M1, v1); - - CPPUNIT_ASSERT( all_elements(r == v2) ); -} - - -template <class T> -void TestDimension<T>::MtM() { - using namespace tvmet; - - Matrix<double, 6, 3> M1; - Matrix<double, 6, 2> M2; - Matrix<double, 3, 2> r(0), M3(0); - - M1 = - 1, 2, 3, - 4, 5, 6, - 7, 8, 9, - 10,11,12, - 13,14,15, - 16,17,18; - M2 = - 1, 2, - 3, 4, - 5, 6, - 7, 8, - 9,10, - 11,12; - - r = prod(trans(M1),M2); - - M3 = MtM_prod(M1, M2); - - CPPUNIT_ASSERT( all_elements(r == M3) ); -} - - -template <class T> -void TestDimension<T>::MMt() { - using namespace tvmet; - - Matrix<double, 3, 4> M1; - Matrix<double, 2, 4> M2; - Matrix<double, 3, 2> M3(0), r(0); - - M1 = - 1, 2, 3, 4, - 5, 6, 7, 8, - 9, 10,11,12; - M2 = - 1,2,3,4, - 5,6,7,8; - - r = M1*trans(M2); - - M3 = MMt_prod(M1,M2); - - CPPUNIT_ASSERT( all_elements(r == M3) ); -} - - -template <class T> -void TestDimension<T>::trans_MM() { - using namespace tvmet; - - Matrix<double, 6, 3> M1; - Matrix<double, 3, 6> M2; - Matrix<double, 6, 6> r(0), M3(0); - - M1 = - 1, 2, 3, - 4, 5, 6, - 7, 8, 9, - 10,11,12, - 13,14,15, - 16,17,18; - M2 = - 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10,11,12, - 13,14,15,16,17,18; - - r = trans(prod(M1, M2)); - - M3 = trans_prod(M1, M2); - - CPPUNIT_ASSERT( all_elements(r == M3) ); -} - - -template <class T> -void TestDimension<T>::Row() { - using namespace tvmet; - - Matrix<double, 6, 3> M; - Vector<double, 3> v; - Vector<double, 3> r0(1,2,3); - Vector<double, 3> r5(16,17,18); - - M = - 1, 2, 3, - 4, 5, 6, - 7, 8, 9, - 10,11,12, - 13,14,15, - 16,17,18; - - v = row(M, 0); - CPPUNIT_ASSERT( all_elements(v == r0) ); - - v = row(M, 5); - CPPUNIT_ASSERT( all_elements(v == r5) ); -} - - -template <class T> -void TestDimension<T>::Col() { - using namespace tvmet; - - Matrix<double, 3, 6> M; - Vector<double, 3> v; - Vector<double, 3> c0(1,7,13); - Vector<double, 3> c5(6,12,18); - - M = - 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10,11,12, - 13,14,15,16,17,18; - - v = col(M, 0); - CPPUNIT_ASSERT( all_elements(v == c0) ); - - v = col(M, 5); - CPPUNIT_ASSERT( all_elements(v == c5) ); -} - -#endif // TVMET_TEST_DIMENSION_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/testsuite/TestMathOps.h b/tvmet-1.7.1/testsuite/TestMathOps.h deleted file mode 100644 index 47ba7a547..000000000 --- a/tvmet-1.7.1/testsuite/TestMathOps.h +++ /dev/null @@ -1,491 +0,0 @@ -/* - * Tiny Vector Matrix Library - * Dense Vector Matrix Libary of Tiny size using Expression Templates - * - * Copyright (C) 2001 - 2003 Olaf Petzold <opetzold@users.sourceforge.net> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id: TestMathOps.h,v 1.1 2004/04/24 11:55:15 opetzold Exp $ - */ - -#ifndef TVMET_TEST_MATHOPS_H -#define TVMET_TEST_MATHOPS_H - -#include <cppunit/extensions/HelperMacros.h> - -#include <tvmet/Vector.h> -#include <tvmet/Matrix.h> -#include <tvmet/util/General.h> - -template <class T> -class TestMathOps : public CppUnit::TestFixture -{ - CPPUNIT_TEST_SUITE( TestMathOps ); - CPPUNIT_TEST( ScalarAssign ); - CPPUNIT_TEST( Assign ); - CPPUNIT_TEST( ScalarOps ); - CPPUNIT_TEST( Ops1 ); - CPPUNIT_TEST( Ops2 ); - CPPUNIT_TEST( VectorOps ); - CPPUNIT_TEST( VectorOps2 ); - CPPUNIT_TEST( VectorNorm2 ); - CPPUNIT_TEST( MatrixOps ); - CPPUNIT_TEST( MatrixVector1 ); - CPPUNIT_TEST( MatrixVector2 ); - CPPUNIT_TEST( MatrixTransMatrix ); - CPPUNIT_TEST( MatrixTransVector ); - CPPUNIT_TEST( MatrixRowVector ); - CPPUNIT_TEST( MatrixColVector ); - CPPUNIT_TEST( MatrixDiagVector ); - CPPUNIT_TEST( MatrixMatrixVector ); - CPPUNIT_TEST_SUITE_END(); - -private: - typedef tvmet::Vector<T, 3> vector_type; - typedef tvmet::Matrix<T, 3, 3> matrix_type; - -public: - TestMathOps() - : vZero(0), vOne(1), mZero(0), mOne(1), scalar(10) { } - -public: // cppunit interface - /** cppunit hook for fixture set up. */ - void setUp(); - - /** cppunit hook for fixture tear down. */ - void tearDown(); - -protected: - void ScalarAssign(); - void Assign(); - void ScalarOps(); - void Ops1(); - void Ops2(); - void VectorOps(); - void VectorOps2(); - void VectorNorm2(); - void MatrixOps(); - void MatrixVector1(); - void MatrixVector2(); - void MatrixTransMatrix(); - void MatrixTransVector(); - void MatrixRowVector(); - void MatrixColVector(); - void MatrixDiagVector(); - void MatrixMatrixVector(); - -private: - const vector_type vZero; - const vector_type vOne; - vector_type v1, v1b; - vector_type vBig; /**< vector 10x bigger than v1 */ - -private: - const matrix_type mZero; - const matrix_type mOne; - matrix_type m1, m1b; - matrix_type mBig; /**< matrix 10x bigger than m1 */ - -private: - vector_type m1_r0, m1_r1, m1_r2; // row vectors - vector_type m1_c0, m1_c1, m1_c2; // col vectors - -private: - const T scalar; -}; - -/***************************************************************************** - * Implementation - ****************************************************************************/ - -/* - * cppunit part - */ -template <class T> -void TestMathOps<T>::setUp() { - v1 = 1,2,3; - v1b = v1; // same as v1, cctor test done in checkInternal - vBig = 10,20,30; - - m1 = 1,4,7, - 2,5,8, - 3,6,9; - - m1_r0 = 1,4,7; - m1_r1 = 2,5,8; - m1_r2 = 3,6,9; - - m1_c0 = 1,2,3; - m1_c1 = 4,5,6; - m1_c2 = 7,8,9; - - m1b = m1; // same as m1, cctor test done in checkInternal - - mBig = 10,40,70, - 20,50,80, - 30,60,90; - -} - -template <class T> -void TestMathOps<T>::tearDown() { - -} - -/* - * regressions - */ -template <class T> -void -TestMathOps<T>::ScalarAssign() { - { - vector_type t1(v1), t2(v1), t3(v1), t4(vBig); - - t1 += scalar; - t2 -= scalar; - t3 *= scalar; - t4 /= scalar; - - CPPUNIT_ASSERT(t1(0) == (v1(0)+scalar) && t1(1) == (v1(1)+scalar) && t1(2) == (v1(2)+scalar)); - CPPUNIT_ASSERT(t2(0) == (v1(0)-scalar) && t2(1) == (v1(1)-scalar) && t2(2) == (v1(2)-scalar)); - CPPUNIT_ASSERT( all_elements(t3 == vBig) ); - CPPUNIT_ASSERT( all_elements(t4 == v1) ); - } - { - matrix_type t1(m1), t2(m1), t3(m1), t4(mBig); - - t1 += scalar; - t2 -= scalar; - t3 *= scalar; - t4 /= scalar; - - CPPUNIT_ASSERT(t1(0,0) == (m1(0,0)+scalar) && t1(0,1) == (m1(0,1)+scalar) && t1(0,2) == (m1(0,2)+scalar) && - t1(1,0) == (m1(1,0)+scalar) && t1(1,1) == (m1(1,1)+scalar) && t1(1,2) == (m1(1,2)+scalar) && - t1(2,0) == (m1(2,0)+scalar) && t1(2,1) == (m1(2,1)+scalar) && t1(2,2) == (m1(2,2)+scalar)); - CPPUNIT_ASSERT(t2(0,0) == (m1(0,0)-scalar) && t2(0,1) == (m1(0,1)-scalar) && t2(0,2) == (m1(0,2)-scalar) && - t2(1,0) == (m1(1,0)-scalar) && t2(1,1) == (m1(1,1)-scalar) && t2(1,2) == (m1(1,2)-scalar) && - t2(2,0) == (m1(2,0)-scalar) && t2(2,1) == (m1(2,1)-scalar) && t2(2,2) == (m1(2,2)-scalar)); - CPPUNIT_ASSERT( all_elements(t3 == mBig) ); - CPPUNIT_ASSERT( all_elements(t4 == m1) ); - } -} - -template <class T> -void -TestMathOps<T>::Assign() { - { - vector_type t1(vZero), t2(v1), t3(v1); - - t1 += v1; - t2 -= v1; - t3 *= v1; - - CPPUNIT_ASSERT( all_elements(t1 == v1) ); - CPPUNIT_ASSERT( all_elements(t2 == vZero) ); - CPPUNIT_ASSERT(t3(0) == (v1(0)*v1(0)) && t3(1) == (v1(1)*v1(1)) && t3(2) == (v1(2)*v1(2))); - } - { - matrix_type t1(mZero), t2(m1), t3(m1); - - t1 += m1; - t2 -= m1; - - CPPUNIT_ASSERT( all_elements(t1 == m1) ); - CPPUNIT_ASSERT( all_elements(t2 == mZero) ); - } -} - -template <class T> -void -TestMathOps<T>::ScalarOps() { - { - vector_type t1(v1), t2(v1), t3(v1), t4(vBig); - vector_type r1(v1), r2(v1); - r1 += scalar; - r2 -= scalar; - - t1 = t1 + scalar; - t2 = t2 - scalar; - t3 = t3 * scalar; - t4 = t4 / scalar; - - CPPUNIT_ASSERT( all_elements(t1 == r1) ); - CPPUNIT_ASSERT( all_elements(t2 == r2) ); - CPPUNIT_ASSERT( all_elements(t3 == vBig) ); - CPPUNIT_ASSERT( all_elements(t4 == v1) ); - } - { - matrix_type t1(m1), t2(m1), t3(m1), t4(mBig); - matrix_type r1(m1), r2(m1); - r1 += scalar; - r2 -= scalar; - - t1 = t1 + scalar; - t2 = t2 - scalar; - t3 = t3 * scalar; - t4 = t4 / scalar; - - CPPUNIT_ASSERT( all_elements(t1 == r1) ); - CPPUNIT_ASSERT( all_elements(t2 == r2) ); - CPPUNIT_ASSERT( all_elements(t3 == mBig) ); - CPPUNIT_ASSERT( all_elements(t4 == m1) ); - } -} - -template <class T> -void -TestMathOps<T>::Ops1() { - { - vector_type t1(0), t2(0), t3(0); - vector_type r(v1); - r *= v1; - - t1 = v1 + v1; - t2 = v1 - v1; - t3 = v1 * v1; - - CPPUNIT_ASSERT( all_elements(t1 == T(2)*v1) ); - CPPUNIT_ASSERT( all_elements(t2 == vZero) ); - CPPUNIT_ASSERT( all_elements(t3 == r) ); - } - { - matrix_type t1(0), t2(0); - t1 = m1 + m1; - t2 = m1 - m1; - - CPPUNIT_ASSERT( all_elements(t1 == T(2)*m1) ); - CPPUNIT_ASSERT( all_elements(t2 == mZero) ); - } -} - -template <class T> -void -TestMathOps<T>::Ops2() { - const vector_type vMinusOne(-1); - const matrix_type mMinusOne(-1); - - // negate operator - { - vector_type t1, t2; - - t1 = abs(v1); - CPPUNIT_ASSERT( all_elements(t1 == v1) ); - - t1 = -vOne; - CPPUNIT_ASSERT( all_elements(t1 == vMinusOne) ); - } - { - matrix_type t1, t2; - - t1 = abs(m1); - CPPUNIT_ASSERT( all_elements(t1 == m1) ); - - t1 = -mOne; - CPPUNIT_ASSERT( all_elements(t1 == mMinusOne) ); - - } -} - -template <class T> -void -TestMathOps<T>::VectorOps() { - -} - -template <class T> -void -TestMathOps<T>::VectorOps2() { -} - -template <class T> -void -TestMathOps<T>::VectorNorm2() { - // casts for int vectors, as well as for complex<> since - // norm2 returns sum_type - CPPUNIT_ASSERT( norm2(v1) == static_cast<T>(std::sqrt(14.0))); -} - -template <class T> -void -TestMathOps<T>::MatrixOps() { - matrix_type t1, t2, t3; - matrix_type r1, r2, r3; - - tvmet::util::Gemm(m1, m1, r1); - tvmet::util::Gemm(m1, mBig, r2); - tvmet::util::Gemm(mBig, m1, r3); - CPPUNIT_ASSERT( all_elements(r2 == r3) ); - - t1 = m1 * m1; - CPPUNIT_ASSERT( all_elements(t1 == r1) ); - - t2 = m1 * mBig; - CPPUNIT_ASSERT( all_elements(t2 == r2) ); - - t3 = mBig * m1; - CPPUNIT_ASSERT( all_elements(t3 == r3) ); - - t3 = trans(t1); - CPPUNIT_ASSERT( any_elements(t3 != t1) ); // XXX very simple test - t2 = trans(t3); - CPPUNIT_ASSERT( all_elements(t1 == t2) ); - - // trace return sum_type, therefore the cast for complex<> - CPPUNIT_ASSERT( static_cast<T>(trace(m1)) == static_cast<T>(15) ); -} - -template <class T> -void -TestMathOps<T>::MatrixVector1() { - - vector_type t1, t2; - vector_type vr1(0), vr2(0); // clear it before use due to util::Gemv algo - - // Matrix-Vector - tvmet::util::Gemv(m1, v1, vr1); - tvmet::util::Gemv(mBig, vBig, vr2); - - t1 = m1 * v1; - t2 = mBig * vBig; - - CPPUNIT_ASSERT( all_elements(t1 == vr1) ); - CPPUNIT_ASSERT( all_elements(t2 == vr2) ); -} - -template <class T> -void -TestMathOps<T>::MatrixVector2() { - - vector_type t1, t2; - vector_type vr(0), v2(0); // clear it before use due to util::Gemv algo - - // Matrix-XprVector - v2 = v1 * vBig; - tvmet::util::Gemv(m1, v2, vr); - - t1 = m1 * (v1*vBig); - - CPPUNIT_ASSERT( all_elements(t1 == vr) ); -} - -template <class T> -void -TestMathOps<T>::MatrixTransMatrix() { - // greatings to - { - matrix_type m1t, Mr, M2; - - // trans() and prod() is checked before! - m1t = trans(m1); - Mr = prod(m1t, mBig); - - M2 = MtM_prod(m1, mBig); - - CPPUNIT_ASSERT( all_elements(Mr == M2) ); - } -} - -template <class T> -void -TestMathOps<T>::MatrixTransVector() { - // greatings to - { - matrix_type Mt; - vector_type vr, y; - - // trans() and prod() is checked before! - Mt = trans(m1); - vr = Mt*v1; - y = Mtx_prod(m1, v1); - - CPPUNIT_ASSERT( all_elements(vr == y) ); - } -} - -template <class T> -void -TestMathOps<T>::MatrixRowVector() { - vector_type r0, r1, r2; - - r0 = row(m1, 0); - r1 = row(m1, 1); - r2 = row(m1, 2); - - CPPUNIT_ASSERT( all_elements(r0 == m1_r0) ); - CPPUNIT_ASSERT( all_elements(r1 == m1_r1) ); - CPPUNIT_ASSERT( all_elements(r2 == m1_r2) ); -} - -template <class T> -void -TestMathOps<T>::MatrixColVector() { - vector_type c0, c1, c2; - - c0 = col(m1, 0); - c1 = col(m1, 1); - c2 = col(m1, 2); - - CPPUNIT_ASSERT( all_elements(c0 == m1_c0) ); - CPPUNIT_ASSERT( all_elements(c1 == m1_c1) ); - CPPUNIT_ASSERT( all_elements(c2 == m1_c2) ); -} - -template <class T> -void -TestMathOps<T>::MatrixDiagVector() { - vector_type vd, t; - - vd = T(1), T(5), T(9); - - t = diag(m1); - - CPPUNIT_ASSERT( all_elements(vd == t) ); -} - -template <class T> -void -TestMathOps<T>::MatrixMatrixVector() { - { - vector_type t1; - vector_type vr1(0), vr2(0); // clear it before use due to util::Gemv algo - - // Matrix-Vector-Vector, referenz is using two ops - tvmet::util::Gemv(m1, v1, vr1); - tvmet::util::Gevvmul(vr1, vBig, vr2); - - t1 = m1 * v1 * vBig; - CPPUNIT_ASSERT( all_elements(t1 == vr2) ); - } -#if 0 - { - // XXX not working due to missing operators for (XprMatrix, Vector) - vector_type t; - matrix_type vr1; - vector_type vr2; - - // Matrix-Matrix-Vector - tvmet::util::Gemm(m1, mBig, vr1); - tvmet::util::Gemv(vr1, v1, vr2); - - } -#endif -} - -#endif // TVMET_TEST_MATHOPS_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/testsuite/TestMatrixElementwise.h b/tvmet-1.7.1/testsuite/TestMatrixElementwise.h deleted file mode 100644 index 39ec4776b..000000000 --- a/tvmet-1.7.1/testsuite/TestMatrixElementwise.h +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Tiny Vector Matrix Library - * Dense Vector Matrix Libary of Tiny size using Expression Templates - * - * Copyright (C) 2001 - 2003 Olaf Petzold <opetzold@users.sourceforge.net> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id: TestMatrixElementwise.h,v 1.2 2005/03/09 11:11:53 opetzold Exp $ - */ - -#ifndef TVMET_TEST_MATRIX_ELEMENTWISE_H -#define TVMET_TEST_MATRIX_ELEMENTWISE_H - -#include <cppunit/extensions/HelperMacros.h> - -#include <tvmet/Vector.h> -#include <tvmet/Matrix.h> - -template <class T> -class TestMatrixElementwise : public CppUnit::TestFixture -{ - CPPUNIT_TEST_SUITE( TestMatrixElementwise ); - CPPUNIT_TEST( sqr_add ); - CPPUNIT_TEST( sqr_xpr_add ); - CPPUNIT_TEST( sqr_mul ); - CPPUNIT_TEST( sqr_xpr_mul ); - CPPUNIT_TEST( nsqr_add ); - CPPUNIT_TEST( nsqr_xpr_add ); - CPPUNIT_TEST( nsqr_mul ); - CPPUNIT_TEST( nsqr_xpr_mul ); - CPPUNIT_TEST_SUITE_END(); - -public: - TestMatrixElementwise() { } - -public: // cppunit interface - /** cppunit hook for fixture set up. */ - void setUp(); - - /** cppunit hook for fixture tear down. */ - void tearDown(); - -protected: - void sqr_add(); - void sqr_xpr_add(); - void sqr_mul(); - void sqr_xpr_mul(); - - void nsqr_add(); - void nsqr_xpr_add(); - void nsqr_mul(); - void nsqr_xpr_mul(); -}; - -/***************************************************************************** - * Implementation part I (cppunit part) - ****************************************************************************/ - -template <class T> -void TestMatrixElementwise<T>::setUp() { } - -template <class T> -void TestMatrixElementwise<T>::tearDown() { } - -/***************************************************************************** - * Implementation part II, square matrices - ****************************************************************************/ - -template <class T> -void TestMatrixElementwise<T>::sqr_add() { - using namespace tvmet; - - Matrix<T, 3, 3> M1, M2, Mr1, Mr2; - - M1 = 2; - M2 = 2; - - Mr1 = M1 + M2; - Mr2 = add(M1, M1); - - CPPUNIT_ASSERT( all_elements(Mr1 == 4) ); - CPPUNIT_ASSERT( all_elements(Mr2 == 4) ); -} - - -template <class T> -void TestMatrixElementwise<T>::sqr_xpr_add() { - using namespace tvmet; - - Matrix<T, 3, 3> M1, M2, Mr1, Mr2; - - M1 = 1; - M2 = 1; - - T c1 = 1; - T c2 = 1; - - Mr1 = (c1+M1) + (c2+M2); - Mr2 = add(add(c1,M1), add(c2,M1)); - - CPPUNIT_ASSERT( all_elements(Mr1 == 4) ); - CPPUNIT_ASSERT( all_elements(Mr2 == 4) ); -} - - -template <class T> -void TestMatrixElementwise<T>::sqr_mul() { - using namespace tvmet; - - Matrix<T, 3, 3> M1, M2, Mr1, Mr2; - - M1 = 2; - M2 = 2; - - Mr1 = element_wise::operator*(M1, M2); - Mr2 = element_wise::mul(M1, M2); - - CPPUNIT_ASSERT( all_elements(Mr1 == 4) ); - CPPUNIT_ASSERT( all_elements(Mr2 == 4) ); -} - - -template <class T> -void TestMatrixElementwise<T>::sqr_xpr_mul() { - using namespace tvmet; - - Matrix<T, 3, 3> M1, M2, Mr1, Mr2; - - M1 = 2; - M2 = 2; - - T c1 = 1; - T c2 = 1; - - Mr1 = element_wise::operator*(c1*M1, c2*M2); - Mr2 = element_wise::mul(mul(c1, M1), mul(c2, M2)); - - CPPUNIT_ASSERT( all_elements(Mr1 == 4) ); - CPPUNIT_ASSERT( all_elements(Mr2 == 4) ); -} - - -/***************************************************************************** - * Implementation part II, non square matrices - ****************************************************************************/ - -template <class T> -void TestMatrixElementwise<T>::nsqr_add() { - using namespace tvmet; - - Matrix<T, 4, 3> M1, M2, Mr1, Mr2; - - M1 = 2; - M2 = 2; - - Mr1 = M1 + M2; - Mr2 = add(M1, M1); - - CPPUNIT_ASSERT( all_elements(Mr1 == 4) ); - CPPUNIT_ASSERT( all_elements(Mr2 == 4) ); -} - - -template <class T> -void TestMatrixElementwise<T>::nsqr_xpr_add() { - using namespace tvmet; - - Matrix<T, 4, 3> M1, M2, Mr1, Mr2; - - M1 = 1; - M2 = 1; - - T c1 = 1; - T c2 = 1; - - Mr1 = (c1+M1) + (c2+M2); - Mr2 = add(add(c1,M1), add(c2,M1)); - - CPPUNIT_ASSERT( all_elements(Mr1 == 4) ); - CPPUNIT_ASSERT( all_elements(Mr2 == 4) ); -} - - -template <class T> -void TestMatrixElementwise<T>::nsqr_mul() { - using namespace tvmet; - - Matrix<T, 4, 3> M1, M2, Mr1, Mr2; - - M1 = 2; - M2 = 2; - - Mr1 = element_wise::operator*(M1, M2); - Mr2 = element_wise::mul(M1, M2); - - CPPUNIT_ASSERT( all_elements(Mr1 == 4) ); - CPPUNIT_ASSERT( all_elements(Mr2 == 4) ); -} - - -template <class T> -void TestMatrixElementwise<T>::nsqr_xpr_mul() { - using namespace tvmet; - - Matrix<T, 4, 3> M1, M2, Mr1, Mr2; - - M1 = 2; - M2 = 2; - - T c1 = 1; - T c2 = 1; - - Mr1 = element_wise::operator*(c1*M1, c2*M2); - Mr2 = element_wise::mul(mul(c1, M1), mul(c2, M2)); - - CPPUNIT_ASSERT( all_elements(Mr1 == 4) ); - CPPUNIT_ASSERT( all_elements(Mr2 == 4) ); -} - - -#endif // TVMET_TEST_MATRIX_ELEMENTWISE_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/testsuite/TestMatrixEval.h b/tvmet-1.7.1/testsuite/TestMatrixEval.h deleted file mode 100644 index 63c5a95b8..000000000 --- a/tvmet-1.7.1/testsuite/TestMatrixEval.h +++ /dev/null @@ -1,307 +0,0 @@ -/* - * Tiny Vector Matrix Library - * Dense Vector Matrix Libary of Tiny size using Expression Templates - * - * Copyright (C) 2001 - 2003 Olaf Petzold <opetzold@users.sourceforge.net> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id: TestMatrixEval.h,v 1.1 2004/04/24 11:55:15 opetzold Exp $ - */ - -#ifndef TVMET_TEST_MATRIX_EVAL_H -#define TVMET_TEST_MATRIX_EVAL_H - -#include <cppunit/extensions/HelperMacros.h> - -#include <tvmet/Matrix.h> - -#include <cassert> - -template <class T> -class TestMatrixEval : public CppUnit::TestFixture -{ - CPPUNIT_TEST_SUITE( TestMatrixEval ); - CPPUNIT_TEST( Greater ); - CPPUNIT_TEST( Less ); - CPPUNIT_TEST( GreaterOrEqual ); - CPPUNIT_TEST( LessOrEqual ); - CPPUNIT_TEST( Equal ); - CPPUNIT_TEST( NotEqual ); - CPPUNIT_TEST( LogicalAnd ); - CPPUNIT_TEST( LogicalOr ); - - // others - CPPUNIT_TEST( AllElements ); - CPPUNIT_TEST( AnyElements ); - CPPUNIT_TEST( Eval3 ); - CPPUNIT_TEST( EvalPod3 ); - - CPPUNIT_TEST_SUITE_END(); - -private: - typedef tvmet::Matrix<T, 3, 3> matrix_type; - -public: - TestMatrixEval() - : mOne(1), mZero(0) { } - -public: // cppunit interface - /** cppunit hook for fixture set up. */ - void setUp(); - - /** cppunit hook for fixture tear down. */ - void tearDown(); - -protected: - void Greater(); - void Less(); - void GreaterOrEqual(); - void LessOrEqual(); - void Equal(); - void NotEqual(); - void LogicalAnd(); - void LogicalOr(); - - void AllElements(); - void AnyElements(); - void Eval3(); - void EvalPod3(); - -private: - matrix_type m1; - matrix_type mBig; /**< matrix bigger than m1 */ - const matrix_type mOne; - const matrix_type mZero; -}; - -/***************************************************************************** - * Implementation Part I (cppunit part) - ****************************************************************************/ - -template <class T> -void TestMatrixEval<T>::setUp () { - m1 = 1,4,7, - 2,5,8, - 3,6,9; - mBig = 10,40,70, - 20,50,80, - 30,60,90; -} - -template <class T> -void TestMatrixEval<T>::tearDown() { } - -/***************************************************************************** - * Implementation Part II - * these are elemental - therefore we use std::assert - ****************************************************************************/ - -/* - * on SelfTest, we have the guarantee, that the container holds the - * expected values. Now check comparing operation using tvmet's - * eval function. This is the basic for all further test since it's - * the way we check the correctness. The other way would be element wise - * compare as in SelfTest, urgh... - */ -template <class T> -void -TestMatrixEval<T>::Greater() { - // all test are element wise ! - assert( all_elements(mBig > m1) ); -} - -template <class T> -void -TestMatrixEval<T>::Less() { - // all test are element wise ! - assert( all_elements(m1 < mBig) ); -} - -template <class T> -void -TestMatrixEval<T>::GreaterOrEqual() { - // all test are element wise ! - assert( all_elements(mBig >= m1) ); - assert( all_elements(m1 >= m1) ); - assert( all_elements(mBig >= mBig) ); - assert( all_elements(mOne >= T(1)) ); - assert( all_elements(mZero>= T(0)) ); -} - -template <class T> -void -TestMatrixEval<T>::LessOrEqual() { - // all test are element wise ! - assert( all_elements(m1 <= mBig) ); - assert( all_elements(m1 <= m1) ); - assert( all_elements(mBig <= mBig) ); - assert( all_elements(mOne <= T(1)) ); - assert( all_elements(mZero<= T(0)) ); -} - -template <class T> -void -TestMatrixEval<T>::Equal() { - // all test are element wise ! - assert( all_elements(m1 == m1) ); - assert( all_elements(mBig == mBig) ); - assert( all_elements(mOne == T(1)) ); - assert( all_elements(mZero == T(0)) ); -} - -template <class T> -void -TestMatrixEval<T>::NotEqual() { - // all test are element wise ! - assert( all_elements(m1 != mBig) ); -} - -template <class T> -void -TestMatrixEval<T>::LogicalAnd() { - // TODO: implement -} - -template <class T> -void -TestMatrixEval<T>::LogicalOr() { - // TODO: implement -} - -/***************************************************************************** - * Implementation Part III - * test on generell and eval functions - ****************************************************************************/ - -template <class T> -void -TestMatrixEval<T>::AllElements() { - // true cases - CPPUNIT_ASSERT( all_elements(mBig > T(0)) ); - CPPUNIT_ASSERT( all_elements(mBig >= T(1)) ); - - CPPUNIT_ASSERT( all_elements(mBig < T(1000)) ); - CPPUNIT_ASSERT( all_elements(mBig <= T(1000)) ); - - CPPUNIT_ASSERT( all_elements(T(0) < mBig) ); // possible, I newer would write it - CPPUNIT_ASSERT( all_elements(T(1000) > mBig) ); // possible, I newer would write it - - CPPUNIT_ASSERT( all_elements(mOne == T(1)) ); - CPPUNIT_ASSERT( all_elements(mZero == T(0)) ); - - CPPUNIT_ASSERT( all_elements(mBig != T(1000)) ); - - // false cases - CPPUNIT_ASSERT( !all_elements(mBig < T(0)) ); -} - - -template <class T> -void -TestMatrixEval<T>::AnyElements() { - // true cases - CPPUNIT_ASSERT( any_elements(mBig > T(0)) ); - CPPUNIT_ASSERT( any_elements(mBig >= T(1)) ); - - CPPUNIT_ASSERT( any_elements(mBig < T(1000)) ); - CPPUNIT_ASSERT( any_elements(mBig <= T(1000)) ); - - CPPUNIT_ASSERT( any_elements(T(2) < m1) ); // possible, I newer would write it - CPPUNIT_ASSERT( any_elements(T(2) > m1) ); // possible, I newer would write it - - CPPUNIT_ASSERT( any_elements(mOne == T(1)) ); - CPPUNIT_ASSERT( any_elements(mZero == T(0)) ); - - CPPUNIT_ASSERT( any_elements(mBig != T(1000)) ); - - // false cases - CPPUNIT_ASSERT( !any_elements(mBig < T(2)) ); - CPPUNIT_ASSERT( !any_elements(mOne == T(0)) ); - CPPUNIT_ASSERT( !any_elements(mZero == T(1)) ); -} - - -template <class T> -void -TestMatrixEval<T>::Eval3() { - matrix_type v; - T a(1); // scalar - - // XprMatrix<E1, Rows, Cols> ? Matrix<T2, Rows, Cols> : Matrix<T3, Rows, Cols> - v = eval( m1 < mBig, m1, mBig); - CPPUNIT_ASSERT( all_elements(v == m1) ); - - v = eval( m1 > mBig, m1, mBig); - CPPUNIT_ASSERT( all_elements(v == mBig) ); - - // XprMatrix<E1, Rows, Cols> ? Matrix<T2, Rows, Cols> : XprMatrix<E3, Rows, Cols> - v = eval( m1 < mBig, m1, a*mBig); - CPPUNIT_ASSERT( all_elements(v == m1) ); - - v = eval( m1 > mBig, m1, a*mBig); - CPPUNIT_ASSERT( all_elements(v == mBig) ); - - // XprMatrix<E1, Rows, Cols> ? XprMatrix<E2, Rows, Cols> : Matrix<T3, Rows, Cols> - v = eval( m1 < mBig, a*m1, mBig); - CPPUNIT_ASSERT( all_elements(v == m1) ); - - v = eval( m1 > mBig, a*m1, mBig); - CPPUNIT_ASSERT( all_elements(v == mBig) ); - - // XprMatrix<E1, Rows, Cols> ? XprMatrix<E2, Rows, Cols> : XprMatrix<E3, Rows, Cols> - v = eval( m1 < mBig, a*m1, a*mBig); - CPPUNIT_ASSERT( all_elements(v == m1) ); - - v = eval( m1 > mBig, a*m1, a*mBig); - CPPUNIT_ASSERT( all_elements(v == mBig) ); -} - - -template <class T> -void -TestMatrixEval<T>::EvalPod3() { - matrix_type v; - T a(1); // scalar - - // XprMatrix<E, Rows, Cols> ? POD1 : POD2 - v = eval( m1 < mBig, T(0), T(1)); - CPPUNIT_ASSERT( all_elements(v == T(0)) ); - - v = eval( m1 > mBig, T(0), T(1)); - CPPUNIT_ASSERT( all_elements(v == T(1)) ); - - // XprMatrix<E1, Rows, Cols> ? POD : XprMatrix<E3, Rows, Cols> - v = eval( m1 < mBig, 1, a*mBig); - CPPUNIT_ASSERT( all_elements(v == mOne) ); - - v = eval( m1 > mBig, 1, a*mBig); - CPPUNIT_ASSERT( all_elements(v == mBig) ); - - // XprMatrix<E1, Rows, Cols> ? XprMatrix<E2, Rows, Cols> : POD - v = eval( m1 < mBig, a*m1, T(1)); - CPPUNIT_ASSERT( all_elements(v == m1) ); - - v = eval( m1 > mBig, a*m1, T(1)); - CPPUNIT_ASSERT( all_elements(v == mOne) ); - -} - - -#endif // TVMET_TEST_MATRIX_EVAL_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/testsuite/TestMatrixFunctions.h b/tvmet-1.7.1/testsuite/TestMatrixFunctions.h deleted file mode 100644 index a234ceef6..000000000 --- a/tvmet-1.7.1/testsuite/TestMatrixFunctions.h +++ /dev/null @@ -1,713 +0,0 @@ -/* - * Tiny Vector Matrix Library - * Dense Vector Matrix Libary of Tiny size using Expression Templates - * - * Copyright (C) 2001 - 2003 Olaf Petzold <opetzold@users.sourceforge.net> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id: TestMatrixFunctions.h,v 1.2 2004/07/06 06:24:23 opetzold Exp $ - */ - -#ifndef TVMET_TEST_MATRIXFUNC_H -#define TVMET_TEST_MATRIXFUNC_H - -#include <cppunit/extensions/HelperMacros.h> - -#include <tvmet/Vector.h> -#include <tvmet/Matrix.h> -#include <tvmet/util/General.h> - -template <class T> -class TestMatrixFunctions : public CppUnit::TestFixture -{ - CPPUNIT_TEST_SUITE( TestMatrixFunctions ); - CPPUNIT_TEST( scalarUpdAssign1 ); - CPPUNIT_TEST( scalarUpdAssign2 ); - CPPUNIT_TEST( scalarUpdAssign3 ); - CPPUNIT_TEST( scalarOps1 ); - CPPUNIT_TEST( scalarOps2 ); - CPPUNIT_TEST( globalMatrixFuncs1 ); - CPPUNIT_TEST( globalMatrixFuncs2 ); - CPPUNIT_TEST( globalMatrixFuncs3 ); - CPPUNIT_TEST( fn_prod1 ); - CPPUNIT_TEST( fn_prod2 ); - CPPUNIT_TEST( fn_prod3 ); - CPPUNIT_TEST( fn_trans ); - CPPUNIT_TEST( fn_MtM_prod ); - CPPUNIT_TEST( fn_MMt_prod ); - CPPUNIT_TEST( fn_prodTrans ); - CPPUNIT_TEST( fn_trace ); - CPPUNIT_TEST( rowVector ); - CPPUNIT_TEST( colVector ); - CPPUNIT_TEST( fn_diag ); - CPPUNIT_TEST( extremum ); - CPPUNIT_TEST( identity_matrix ); - CPPUNIT_TEST_SUITE_END(); - -private: - typedef tvmet::Vector<T, 3> vector_type; - typedef tvmet::Matrix<T, 3, 3> matrix_type; - -public: - TestMatrixFunctions() - : mZero(0), mOne(1), scalar(10), scalar2(2) { } - -public: // cppunit interface - /** cppunit hook for fixture set up. */ - void setUp(); - - /** cppunit hook for fixture tear down. */ - void tearDown(); - -protected: - void scalarUpdAssign1(); - void scalarUpdAssign2(); - void scalarUpdAssign3(); - void scalarOps1(); - void scalarOps2(); - void globalMatrixFuncs1(); - void globalMatrixFuncs2(); - void globalMatrixFuncs3(); - void fn_prod1(); - void fn_prod2(); - void fn_prod3(); - void fn_trans(); - void fn_MtM_prod(); - void fn_MMt_prod(); - void fn_prodTrans(); - void fn_trace(); - void rowVector(); - void colVector(); - void fn_diag(); - void extremum(); - void identity_matrix(); - -private: - const matrix_type mZero; - const matrix_type mOne; - matrix_type m1; - matrix_type mBig; /**< matrix 10x bigger than m1 */ - -private: - vector_type m1_r0, m1_r1, m1_r2; // row vectors - vector_type m1_c0, m1_c1, m1_c2; // col vectors - -private: - const T scalar; - const T scalar2; -}; - - -/***************************************************************************** - * Implementation Part I (cppunit part) - *** *************************************************************************/ - - -template <class T> -void TestMatrixFunctions<T>::setUp() { - m1 = 1,4,7, - 2,5,8, - 3,6,9; - - m1_r0 = 1,4,7; - m1_r1 = 2,5,8; - m1_r2 = 3,6,9; - - m1_c0 = 1,2,3; - m1_c1 = 4,5,6; - m1_c2 = 7,8,9; - - mBig = 10,40,70, - 20,50,80, - 30,60,90; -} - -template <class T> -void TestMatrixFunctions<T>::tearDown() { } - -/***************************************************************************** - * Implementation Part II - ****************************************************************************/ - - -/* - * member math operators with scalars - * Since we use it to compare results, these tests are elemental. - */ -template <class T> -void -TestMatrixFunctions<T>::scalarUpdAssign1() { - // all these functions are element wise - matrix_type t1(m1), t2(m1), t3(m1), t4(mBig); - - t1 += scalar; - t2 -= scalar; - t3 *= scalar; - t4 /= scalar; - - assert(t1(0,0) == (m1(0,0)+scalar) && t1(0,1) == (m1(0,1)+scalar) && t1(0,2) == (m1(0,2)+scalar) && - t1(1,0) == (m1(1,0)+scalar) && t1(1,1) == (m1(1,1)+scalar) && t1(1,2) == (m1(1,2)+scalar) && - t1(2,0) == (m1(2,0)+scalar) && t1(2,1) == (m1(2,1)+scalar) && t1(2,2) == (m1(2,2)+scalar)); - assert(t2(0,0) == (m1(0,0)-scalar) && t2(0,1) == (m1(0,1)-scalar) && t2(0,2) == (m1(0,2)-scalar) && - t2(1,0) == (m1(1,0)-scalar) && t2(1,1) == (m1(1,1)-scalar) && t2(1,2) == (m1(1,2)-scalar) && - t2(2,0) == (m1(2,0)-scalar) && t2(2,1) == (m1(2,1)-scalar) && t2(2,2) == (m1(2,2)-scalar)); - assert( all_elements(t3 == mBig) ); - assert( all_elements(t4 == m1) ); -} - - -/* - * member math operators with Matrizes - * Since we use it to compare results, these tests are elemental. - */ -template <class T> -void -TestMatrixFunctions<T>::scalarUpdAssign2() { - // all these functions are element wise - matrix_type t1(m1), t2(m1), t3(m1), t4(m1); - - t1 += m1; - t2 -= m1; - - { - using namespace tvmet::element_wise; - - t3 *= m1; - t4 /= m1; - } - - assert(t1(0,0) == (m1(0,0)*2) && t1(0,1) == (m1(0,1)*2) && t1(0,2) == (m1(0,2)*2) && - t1(1,0) == (m1(1,0)*2) && t1(1,1) == (m1(1,1)*2) && t1(1,2) == (m1(1,2)*2) && - t1(2,0) == (m1(2,0)*2) && t1(2,1) == (m1(2,1)*2) && t1(2,2) == (m1(2,2)*2)); - assert( all_elements(t2 == mZero) ); - assert(t3(0,0) == (m1(0,0)*m1(0,0)) && t3(0,1) == (m1(0,1)*m1(0,1)) && t3(0,2) == (m1(0,2)*m1(0,2)) && - t3(1,0) == (m1(1,0)*m1(1,0)) && t3(1,1) == (m1(1,1)*m1(1,1)) && t3(1,2) == (m1(1,2)*m1(1,2)) && - t3(2,0) == (m1(2,0)*m1(2,0)) && t3(2,1) == (m1(2,1)*m1(2,1)) && t3(2,2) == (m1(2,2)*m1(2,2))); - assert( all_elements(t4 == mOne) ); -} - - -/* - * member math operators with XprMatrizes - * Since we use it to compare results, these tests are elemental. - */ -template <class T> -void -TestMatrixFunctions<T>::scalarUpdAssign3() { - // all these functions are element wise - matrix_type t1(m1), t2(m1), t3(m1), t4(m1); - - t1 += T(1)*m1; - t2 -= T(1)*m1; - - { - using namespace tvmet::element_wise; - - t3 *= T(1)*m1; - t4 /= T(1)*m1; - } - - assert( all_elements(t1 == 2*m1) ); - assert( all_elements(t2 == mZero) ); - assert(t3(0,0) == (m1(0,0)*m1(0,0)) && t3(0,1) == (m1(0,1)*m1(0,1)) && t3(0,2) == (m1(0,2)*m1(0,2)) && - t3(1,0) == (m1(1,0)*m1(1,0)) && t3(1,1) == (m1(1,1)*m1(1,1)) && t3(1,2) == (m1(1,2)*m1(1,2)) && - t3(2,0) == (m1(2,0)*m1(2,0)) && t3(2,1) == (m1(2,1)*m1(2,1)) && t3(2,2) == (m1(2,2)*m1(2,2))); - assert( all_elements(t4 == mOne) ); -} - - -/* - * global math operators with scalars - * Note: checked against member operators since they are allready checked - */ -template <class T> -void -TestMatrixFunctions<T>::scalarOps1() { - matrix_type r1(m1), r2(m1); - matrix_type t1(0), t2(0), t3(0), t4(0); - - r1 += scalar; - r2 -= scalar; - - t1 = add(m1, scalar); - t2 = sub(m1, scalar); - t3 = mul(m1, scalar); - t4 = div(mBig, scalar); - - CPPUNIT_ASSERT( all_elements(t1 == r1) ); - CPPUNIT_ASSERT( all_elements(t2 == r2) ); - CPPUNIT_ASSERT( all_elements(t3 == mBig) ); - CPPUNIT_ASSERT( all_elements(t4 == m1) ); -} - - -/* - * global math operators with scalars, part II - * Note: checked against member operators since they are allready checked - */ -template <class T> -void -TestMatrixFunctions<T>::scalarOps2() { - matrix_type r1(m1), r2(m1); - matrix_type t1(0), t2(0); - - r1 += scalar; - r2 *= scalar; - - t1 = add(scalar, m1); - t2 = mul(scalar, m1); - - CPPUNIT_ASSERT( all_elements(t1 == r1) ); - CPPUNIT_ASSERT( all_elements(t2 == r2) ); -} - - -/* - * global math operators with matrizes - */ -template <class T> -void -TestMatrixFunctions<T>::globalMatrixFuncs1() { - matrix_type t1(0), t2(0), t3(0), t4(0); - - t1 = add(m1, m1); - t2 = sub(m1, m1); - - { - using namespace tvmet::element_wise; - - t3 = mul(m1, mOne); - t4 = div(m1, mOne); - } - - CPPUNIT_ASSERT( all_elements(t1 == 2*m1) ); - CPPUNIT_ASSERT( all_elements(t2 == T(0)) ); - CPPUNIT_ASSERT( all_elements(t3 == m1) ); - CPPUNIT_ASSERT( all_elements(t4 == m1) ); -} - - -/* - * global math operators with matrizes and xpr - */ -template <class T> -void -TestMatrixFunctions<T>::globalMatrixFuncs2() { - matrix_type r1(m1), r2(m1), r3(m1), r4(m1); - matrix_type t1(0), t2(0), t3(0), t4(0); - - r1 += T(1)*m1; - r2 -= T(1)*m1; - - { - using namespace tvmet::element_wise; - - r3 *= T(1)*m1; - r4 /= T(1)*m1; - } - - CPPUNIT_ASSERT( all_elements(r2 == T(0)) ); - CPPUNIT_ASSERT( all_elements(r4 == T(1)) ); - - t1 = add(m1, m1*T(1)); - t2 = sub(m1, m1*T(1)); - - { - using namespace tvmet::element_wise; - - t3 = mul(m1, m1*T(1)); - t4 = div(m1, m1*T(1)); - } - - CPPUNIT_ASSERT( all_elements(t1 == r1) ); - CPPUNIT_ASSERT( all_elements(t2 == r2) ); - CPPUNIT_ASSERT( all_elements(t3 == r3) ); - CPPUNIT_ASSERT( all_elements(t4 == r4) ); -} - - -/* - * global math operators with matrizes and xpr - */ -template <class T> -void -TestMatrixFunctions<T>::globalMatrixFuncs3() { - matrix_type r1(m1), r2(m1), r3(m1), r4(m1); - matrix_type t1(0), t2(0), t3(0), t4(0); - - r1 += T(1)*m1; - r2 -= T(1)*m1; - - { - using namespace tvmet::element_wise; - - r3 *= T(1)*m1; - r4 /= T(1)*m1; - } - - CPPUNIT_ASSERT( all_elements(r2 == T(0)) ); - CPPUNIT_ASSERT( all_elements(r4 == T(1)) ); - - t1 = add(T(1)*m1, m1); - t2 = sub(T(1)*m1, m1); - - { - using namespace tvmet::element_wise; - - t3 = mul(T(1)*m1, m1); - t4 = div(T(1)*m1, m1); - } - - CPPUNIT_ASSERT( all_elements(t1 == r1) ); - CPPUNIT_ASSERT( all_elements(t2 == r2) ); - CPPUNIT_ASSERT( all_elements(t3 == r3) ); - CPPUNIT_ASSERT( all_elements(t4 == r4) ); -} - - -/* - * product functions with matrizes - */ -template <class T> -void -TestMatrixFunctions<T>::fn_prod1() { - matrix_type t1, t2, t3; - matrix_type r1, r2, r3; - - tvmet::util::Gemm(m1, m1, r1); - tvmet::util::Gemm(m1, mBig, r2); - tvmet::util::Gemm(mBig, m1, r3); - CPPUNIT_ASSERT( all_elements(r2 == r3) ); - - t1 = prod(m1, m1); - CPPUNIT_ASSERT( all_elements(t1 == r1) ); - - t2 = prod(m1, mBig); - CPPUNIT_ASSERT( all_elements(t2 == r2) ); - - t3 = prod(mBig, m1); - CPPUNIT_ASSERT( all_elements(t3 == r3) ); -} - - -/* - * product functions with matrizes and xpr - * Note: Take care on aliasing! - */ -template <class T> -void -TestMatrixFunctions<T>::fn_prod2() { - matrix_type r1(0), rm(0); - matrix_type m2(m1); - matrix_type t1; - - rm = scalar*m1; - - tvmet::util::Gemm(m1, rm, r1); - - t1 = prod(m1, scalar*m2 /* alias mBig */); - CPPUNIT_ASSERT( all_elements(t1 == r1) ); -} - - -/* - * product functions with matrizes - * Note: Take care on aliasing! - */ -template <class T> -void -TestMatrixFunctions<T>::fn_prod3() { - matrix_type r1(0), rm(0); - matrix_type m2(m1); - matrix_type t1; - - rm = scalar*m1; - - tvmet::util::Gemm(rm, m1, r1); - - t1 = prod(scalar*m1 /* alias mBig */, m2); - CPPUNIT_ASSERT( all_elements(t1 == r1) ); -} - - -/* - * transpose functions with matrizes - */ -template <class T> -void -TestMatrixFunctions<T>::fn_trans() { - matrix_type t1, t2; - - t1 = trans(m1); - CPPUNIT_ASSERT( any_elements(t1 != m1) ); // XXX not very clever test - - t2 = trans(t1); // transpose back - CPPUNIT_ASSERT( all_elements(t2 == m1) ); -} - - -/* - * matrix function M^T * M - */ -template <class T> -void -TestMatrixFunctions<T>::fn_MtM_prod() { - matrix_type m1t, r1; - matrix_type m2; - - // trans() and prod() is checked before! - m1t = trans(m1); - r1 = prod(m1t, mBig); - - m2 = MtM_prod(m1, mBig); - - CPPUNIT_ASSERT( all_elements(r1 == m2) ); -} - - -/* - * matrix function M * M^T - */ -template <class T> -void -TestMatrixFunctions<T>::fn_MMt_prod() { - matrix_type m1t, r1; - matrix_type m2; - - // trans() and prod() is checked before! - m1t = trans(m1); - r1 = prod(mBig, m1t); - - m2 = MMt_prod(mBig, m1); - - CPPUNIT_ASSERT( all_elements(r1 == m2) ); -} - - -/* - * matrix function (M * M)^T - */ -template <class T> -void -TestMatrixFunctions<T>::fn_prodTrans() { - matrix_type r1, r1t; - matrix_type m2; - - // trans() and prod() is checked before! - r1 = prod(m1, mBig); - r1t = trans(r1); - - m2 = trans_prod(m1, mBig); - - CPPUNIT_ASSERT( all_elements(r1t == m2) ); -} - - -/* - * trace - */ -template <class T> -void -TestMatrixFunctions<T>::fn_trace() { - T t1 = trace(m1); - T t2 = trace(mBig); - - CPPUNIT_ASSERT( t1 == (m1(0,0)+m1(1,1)+m1(2,2)) ); - CPPUNIT_ASSERT( t2 == (mBig(0,0)+mBig(1,1)+mBig(2,2)) ); -} - - -/* - * matrix row vector - */ -template <class T> -void -TestMatrixFunctions<T>::rowVector() { - vector_type r0, r1, r2; - - r0 = row(m1, 0); - r1 = row(m1, 1); - r2 = row(m1, 2); - - CPPUNIT_ASSERT( all_elements(r0 == m1_r0) ); - CPPUNIT_ASSERT( all_elements(r1 == m1_r1) ); - CPPUNIT_ASSERT( all_elements(r2 == m1_r2) ); -} - - -/* - * matrix col vector - */ -template <class T> -void -TestMatrixFunctions<T>::colVector() { - vector_type c0, c1, c2; - - c0 = col(m1, 0); - c1 = col(m1, 1); - c2 = col(m1, 2); - - CPPUNIT_ASSERT( all_elements(c0 == m1_c0) ); - CPPUNIT_ASSERT( all_elements(c1 == m1_c1) ); - CPPUNIT_ASSERT( all_elements(c2 == m1_c2) ); -} - - -/* - * matrix diag vector - */ -template <class T> -void -TestMatrixFunctions<T>::fn_diag() { - vector_type r, v; - - r = 1, 5, 9; - - v = diag(m1); - - CPPUNIT_ASSERT( all_elements(r == v) ); -} - - -/* - * extremums - */ -template <class T> -void -TestMatrixFunctions<T>::extremum() { - CPPUNIT_ASSERT(max(m1) == 9); - CPPUNIT_ASSERT(min(m1) == 1); - - CPPUNIT_ASSERT(max(mBig) == 90); - CPPUNIT_ASSERT(min(mBig) == 10); - - CPPUNIT_ASSERT(maximum(m1).value() == 9); - CPPUNIT_ASSERT(maximum(m1).row() == 2); - CPPUNIT_ASSERT(maximum(m1).col() == 2); - - CPPUNIT_ASSERT(minimum(m1).value() == 1); - CPPUNIT_ASSERT(minimum(m1).row() == 0); - CPPUNIT_ASSERT(minimum(m1).col() == 0); - - CPPUNIT_ASSERT(maximum(mBig).value() == 90); - CPPUNIT_ASSERT(maximum(mBig).row() == 2); - CPPUNIT_ASSERT(maximum(mBig).col() == 2); - - CPPUNIT_ASSERT(minimum(mBig).value() == 10); - CPPUNIT_ASSERT(minimum(mBig).row() == 0); - CPPUNIT_ASSERT(minimum(mBig).col() == 0); -} - - -/* - * identity - */ -template <class T> -void -TestMatrixFunctions<T>::identity_matrix() { - // XXX strange, why does we have to specify the namespace here? - // got error: identifier "identity" is undefined - matrix_type E( tvmet::identity<matrix_type>() ); - - CPPUNIT_ASSERT( E(0,0) == 1 && - E(1,1) == 1 && - E(2,2) == 1); - - CPPUNIT_ASSERT( E(0,1) == 0 && - E(0,2) == 0 && - E(1,0) == 0 && - E(1,2) == 0 && - E(2,0) == 0 && - E(2,1) == 0); -} - - -/***************************************************************************** - * Implementation Part II (specialized for ints) - ****************************************************************************/ - - -/* - * member math operators with scalars - */ -template <> -void -TestMatrixFunctions<int>::scalarUpdAssign1() { - // all these functions are element wise - matrix_type t1(m1), t2(m1), t3(m1), t4(mBig); - matrix_type t5(m1), t6(mBig), t7(mBig), t8(mBig), t9(mBig); - matrix_type t10(m1), t11(m1); - - t1 += scalar; - t2 -= scalar; - t3 *= scalar; - t4 /= scalar; - - t5 %= scalar; - t6 %= scalar; - t7 ^= scalar; - t8 &= scalar; - t9 |= scalar; - t10 <<= scalar; - t11 >>= scalar2; - - CPPUNIT_ASSERT(t1(0,0) == (m1(0,0)+scalar) && t1(0,1) == (m1(0,1)+scalar) && t1(0,2) == (m1(0,2)+scalar) && - t1(1,0) == (m1(1,0)+scalar) && t1(1,1) == (m1(1,1)+scalar) && t1(1,2) == (m1(1,2)+scalar) && - t1(2,0) == (m1(2,0)+scalar) && t1(2,1) == (m1(2,1)+scalar) && t1(2,2) == (m1(2,2)+scalar)); - - CPPUNIT_ASSERT(t2(0,0) == (m1(0,0)-scalar) && t2(0,1) == (m1(0,1)-scalar) && t2(0,2) == (m1(0,2)-scalar) && - t2(1,0) == (m1(1,0)-scalar) && t2(1,1) == (m1(1,1)-scalar) && t2(1,2) == (m1(1,2)-scalar) && - t2(2,0) == (m1(2,0)-scalar) && t2(2,1) == (m1(2,1)-scalar) && t2(2,2) == (m1(2,2)-scalar)); - - CPPUNIT_ASSERT( all_elements(t3 == mBig) ); - - CPPUNIT_ASSERT( all_elements(t4 == m1) ); - - CPPUNIT_ASSERT( all_elements(t5 == m1) ); - CPPUNIT_ASSERT( all_elements(t6 == mZero) ); - - CPPUNIT_ASSERT(t7(0,0) == (mBig(0,0)^scalar) && t7(0,1) == (mBig(0,1)^scalar) && t7(0,2) == (mBig(0,2)^scalar) && - t7(1,0) == (mBig(1,0)^scalar) && t7(1,1) == (mBig(1,1)^scalar) && t7(1,2) == (mBig(1,2)^scalar) && - t7(2,0) == (mBig(2,0)^scalar) && t7(2,1) == (mBig(2,1)^scalar) && t7(2,2) == (mBig(2,2)^scalar)); - - CPPUNIT_ASSERT(t8(0,0) == (mBig(0,0)&scalar) && t8(0,1) == (mBig(0,1)&scalar) && t8(0,2) == (mBig(0,2)&scalar) && - t8(1,0) == (mBig(1,0)&scalar) && t8(1,1) == (mBig(1,1)&scalar) && t8(1,2) == (mBig(1,2)&scalar) && - t8(2,0) == (mBig(2,0)&scalar) && t8(2,1) == (mBig(2,1)&scalar) && t8(2,2) == (mBig(2,2)&scalar)); - - CPPUNIT_ASSERT(t9(0,0) == (mBig(0,0)|scalar) && t9(0,1) == (mBig(0,1)|scalar) && t9(0,2) == (mBig(0,2)|scalar) && - t9(1,0) == (mBig(1,0)|scalar) && t9(1,1) == (mBig(1,1)|scalar) && t9(1,2) == (mBig(1,2)|scalar) && - t9(2,0) == (mBig(2,0)|scalar) && t9(2,1) == (mBig(2,1)|scalar) && t9(2,2) == (mBig(2,2)|scalar)); - - CPPUNIT_ASSERT(t10(0,0) == (m1(0,0)<<scalar) && t10(0,1) == (m1(0,1)<<scalar) && t10(0,2) == (m1(0,2)<<scalar) && - t10(1,0) == (m1(1,0)<<scalar) && t10(1,1) == (m1(1,1)<<scalar) && t10(1,2) == (m1(1,2)<<scalar) && - t10(2,0) == (m1(2,0)<<scalar) && t10(2,1) == (m1(2,1)<<scalar) && t10(2,2) == (m1(2,2)<<scalar)); - - CPPUNIT_ASSERT(t11(0,0) == (m1(0,0)>>scalar2) && t11(0,1) == (m1(0,1)>>scalar2) && t11(0,2) == (m1(0,2)>>scalar2) && - t11(1,0) == (m1(1,0)>>scalar2) && t11(1,1) == (m1(1,1)>>scalar2) && t11(1,2) == (m1(1,2)>>scalar2) && - t11(2,0) == (m1(2,0)>>scalar2) && t11(2,1) == (m1(2,1)>>scalar2) && t11(2,2) == (m1(2,2)>>scalar2)); -} - -/* - * TODO: implement other UpdAssign functions, esp. for bit ops - * (since functions above are working, all others should work) - */ - - -#endif // TVMET_TEST_MATRIXFUNC_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/testsuite/TestMatrixOperators.h b/tvmet-1.7.1/testsuite/TestMatrixOperators.h deleted file mode 100644 index ecd28e775..000000000 --- a/tvmet-1.7.1/testsuite/TestMatrixOperators.h +++ /dev/null @@ -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: TestMatrixOperators.h,v 1.1 2004/04/24 11:55:15 opetzold Exp $ - */ - -#ifndef TVMET_TEST_MATRIXOPS_H -#define TVMET_TEST_MATRIXOPS_H - -#include <cppunit/extensions/HelperMacros.h> - -#include <tvmet/Vector.h> -#include <tvmet/Matrix.h> -#include <tvmet/util/General.h> - -template <class T> -class TestMatrixOperators : public CppUnit::TestFixture -{ - CPPUNIT_TEST_SUITE( TestMatrixOperators ); - CPPUNIT_TEST( scalarUpdAssign1 ); - CPPUNIT_TEST( scalarUpdAssign2 ); - CPPUNIT_TEST( scalarUpdAssign3 ); - CPPUNIT_TEST( scalarOps1 ); - CPPUNIT_TEST( scalarOps2 ); - CPPUNIT_TEST( globalMatrixOps ); - CPPUNIT_TEST( negate ); - CPPUNIT_TEST( prodOps ); - CPPUNIT_TEST_SUITE_END(); - -private: - typedef tvmet::Vector<T, 3> vector_type; - typedef tvmet::Matrix<T, 3, 3> matrix_type; - -public: - TestMatrixOperators() - : mZero(0), mOne(1), scalar(10), scalar2(2) { } - -public: // cppunit interface - /** cppunit hook for fixture set up. */ - void setUp(); - - /** cppunit hook for fixture tear down. */ - void tearDown(); - -protected: - void scalarUpdAssign1(); - void scalarUpdAssign2(); - void scalarUpdAssign3(); - void scalarOps1(); - void scalarOps2(); - void globalMatrixOps(); - void negate(); - void prodOps(); - -private: - const matrix_type mZero; - const matrix_type mOne; - matrix_type m1; - matrix_type mBig; /**< matrix 10x bigger than m1 */ - -private: - vector_type m1_r0, m1_r1, m1_r2; // row vectors - vector_type m1_c0, m1_c1, m1_c2; // col vectors - -private: - const T scalar; - const T scalar2; -}; - -/***************************************************************************** - * Implementation Part I (cppunit part) - ****************************************************************************/ - -template <class T> -void TestMatrixOperators<T>::setUp() { - m1 = 1,4,7, - 2,5,8, - 3,6,9; - - m1_r0 = 1,4,7; - m1_r1 = 2,5,8; - m1_r2 = 3,6,9; - - m1_c0 = 1,2,3; - m1_c1 = 4,5,6; - m1_c2 = 7,8,9; - - mBig = 10,40,70, - 20,50,80, - 30,60,90; -} - -template <class T> -void TestMatrixOperators<T>::tearDown() { } - -/***************************************************************************** - * Implementation Part II - ****************************************************************************/ - - -/* - * member math operators with scalars - */ -template <class T> -void -TestMatrixOperators<T>::scalarUpdAssign1() { - // all these functions are element wise - matrix_type t1(m1), t2(m1), t3(m1), t4(mBig); - - t1 += scalar; - t2 -= scalar; - t3 *= scalar; - t4 /= scalar; - - CPPUNIT_ASSERT(t1(0,0) == (m1(0,0)+scalar) && t1(0,1) == (m1(0,1)+scalar) && t1(0,2) == (m1(0,2)+scalar) && - t1(1,0) == (m1(1,0)+scalar) && t1(1,1) == (m1(1,1)+scalar) && t1(1,2) == (m1(1,2)+scalar) && - t1(2,0) == (m1(2,0)+scalar) && t1(2,1) == (m1(2,1)+scalar) && t1(2,2) == (m1(2,2)+scalar)); - CPPUNIT_ASSERT(t2(0,0) == (m1(0,0)-scalar) && t2(0,1) == (m1(0,1)-scalar) && t2(0,2) == (m1(0,2)-scalar) && - t2(1,0) == (m1(1,0)-scalar) && t2(1,1) == (m1(1,1)-scalar) && t2(1,2) == (m1(1,2)-scalar) && - t2(2,0) == (m1(2,0)-scalar) && t2(2,1) == (m1(2,1)-scalar) && t2(2,2) == (m1(2,2)-scalar)); - CPPUNIT_ASSERT( all_elements(t3 == mBig) ); - CPPUNIT_ASSERT( all_elements(t4 == m1) ); -} - - -/* - * member math operators with Matrizes - */ -template <class T> -void -TestMatrixOperators<T>::scalarUpdAssign2() { - // all these functions are element wise - matrix_type t1(m1), t2(m1), t3(m1), t4(m1); - - t1 += m1; - t2 -= m1; - - { - using namespace tvmet::element_wise; - - t3 *= m1; - t4 /= m1; - } - - CPPUNIT_ASSERT(t1(0,0) == (m1(0,0)*2) && t1(0,1) == (m1(0,1)*2) && t1(0,2) == (m1(0,2)*2) && - t1(1,0) == (m1(1,0)*2) && t1(1,1) == (m1(1,1)*2) && t1(1,2) == (m1(1,2)*2) && - t1(2,0) == (m1(2,0)*2) && t1(2,1) == (m1(2,1)*2) && t1(2,2) == (m1(2,2)*2)); - CPPUNIT_ASSERT( all_elements(t2 == mZero) ); - CPPUNIT_ASSERT(t3(0,0) == (m1(0,0)*m1(0,0)) && t3(0,1) == (m1(0,1)*m1(0,1)) && t3(0,2) == (m1(0,2)*m1(0,2)) && - t3(1,0) == (m1(1,0)*m1(1,0)) && t3(1,1) == (m1(1,1)*m1(1,1)) && t3(1,2) == (m1(1,2)*m1(1,2)) && - t3(2,0) == (m1(2,0)*m1(2,0)) && t3(2,1) == (m1(2,1)*m1(2,1)) && t3(2,2) == (m1(2,2)*m1(2,2))); - CPPUNIT_ASSERT( all_elements(t4 == mOne) ); -} - - -/* - * member math operators with XprMatrizes - */ -template <class T> -void -TestMatrixOperators<T>::scalarUpdAssign3() { - // all these functions are element wise - matrix_type t1(m1), t2(m1), t3(m1), t4(m1); - - t1 += T(1)*m1; - t2 -= T(1)*m1; - - { - using namespace tvmet::element_wise; - - t3 *= T(1)*m1; - t4 /= T(1)*m1; - } - - CPPUNIT_ASSERT( all_elements(t1 == 2*m1) ); - CPPUNIT_ASSERT( all_elements(t2 == mZero) ); - CPPUNIT_ASSERT(t3(0,0) == (m1(0,0)*m1(0,0)) && t3(0,1) == (m1(0,1)*m1(0,1)) && t3(0,2) == (m1(0,2)*m1(0,2)) && - t3(1,0) == (m1(1,0)*m1(1,0)) && t3(1,1) == (m1(1,1)*m1(1,1)) && t3(1,2) == (m1(1,2)*m1(1,2)) && - t3(2,0) == (m1(2,0)*m1(2,0)) && t3(2,1) == (m1(2,1)*m1(2,1)) && t3(2,2) == (m1(2,2)*m1(2,2))); - CPPUNIT_ASSERT( all_elements(t4 == mOne) ); -} - - -/* - * global math operators with scalars - * Note: checked against member operators since they are allready checked - */ -template <class T> -void -TestMatrixOperators<T>::scalarOps1() { - matrix_type r1(m1), r2(m1); - matrix_type t1(0), t2(0), t3(0), t4(0); - - r1 += scalar; - r2 -= scalar; - - t1 = m1 + scalar; - t2 = m1 - scalar; - t3 = m1 * scalar; - t4 = mBig / scalar; - - CPPUNIT_ASSERT( all_elements(t1 == r1) ); - CPPUNIT_ASSERT( all_elements(t2 == r2) ); - CPPUNIT_ASSERT( all_elements(t3 == mBig) ); - CPPUNIT_ASSERT( all_elements(t4 == m1) ); -} - - -/* - * global math operators with scalars, part II - * Note: checked against member operators since they are allready checked - */ -template <class T> -void -TestMatrixOperators<T>::scalarOps2() { - matrix_type r1(m1), r2(m1); - matrix_type t1(0), t2(0); - - r1 += scalar; - r2 *= scalar; - - t1 = scalar + m1; - t2 = scalar * m1; - - CPPUNIT_ASSERT( all_elements(t1 == r1) ); - CPPUNIT_ASSERT( all_elements(t2 == r2) ); -} - - -/* - * global math operators with matrizes - */ -template <class T> -void -TestMatrixOperators<T>::globalMatrixOps() { - matrix_type t1(0), t2(0), t3(0), t4(0); - - t1 = m1 + m1; - t2 = m1 - m1; - - { - using namespace tvmet::element_wise; - - //t3 = m1 * mOne; // overloaded by global op*() - t4 = m1 / mOne; - } - - CPPUNIT_ASSERT( all_elements(t1 == 2*m1) ); - CPPUNIT_ASSERT( all_elements(t2 == T(0)) ); - //CPPUNIT_ASSERT( all_elements(t3 == m1) ); - CPPUNIT_ASSERT( all_elements(t4 == m1) ); -} - - -/* - * negate operators with matrizes - */ -template <class T> -void -TestMatrixOperators<T>::negate() { - matrix_type m1; - - m1 = -mOne; - - CPPUNIT_ASSERT( all_elements(m1 == T(-1)) ); -} - - -/* - * product functions with matrizes - * Note: Take care on aliasing! - */ -template <class T> -void -TestMatrixOperators<T>::prodOps() { - matrix_type t1, t2, t3; - matrix_type r1, r2, r3; - matrix_type m2(m1);; - - tvmet::util::Gemm(m1, m1, r1); - tvmet::util::Gemm(m1, mBig, r2); - tvmet::util::Gemm(mBig, m1, r3); - CPPUNIT_ASSERT( all_elements(r2 == r3) ); - - t1 = m1 * m2; - CPPUNIT_ASSERT( all_elements(t1 == r1) ); - - t2 = m1 * mBig; - CPPUNIT_ASSERT( all_elements(t2 == r2) ); - - t3 = mBig * m1; - CPPUNIT_ASSERT( all_elements(t3 == r3) ); -} - - -#endif // TVMET_TEST_MATRIXOPS_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/testsuite/TestSTL.h b/tvmet-1.7.1/testsuite/TestSTL.h deleted file mode 100644 index 25a58cc4d..000000000 --- a/tvmet-1.7.1/testsuite/TestSTL.h +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Tiny Vector Matrix Library - * Dense Vector Matrix Libary of Tiny size using Expression Templates - * - * Copyright (C) 2001 - 2003 Olaf Petzold <opetzold@users.sourceforge.net> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id: TestSTL.h,v 1.1 2004/04/24 11:55:15 opetzold Exp $ - */ - -#ifndef TVMET_TEST_STL_H -#define TVMET_TEST_STL_H - -#include <vector> -#include <algorithm> - -#include <cppunit/extensions/HelperMacros.h> - -#include <tvmet/Vector.h> -#include <tvmet/Matrix.h> - -/** - * gernell test case - */ -template <class T> -class TestSTL : public CppUnit::TestFixture -{ - CPPUNIT_TEST_SUITE( TestSTL ); - CPPUNIT_TEST( vector_ctor ); - CPPUNIT_TEST( vector_copy ); - CPPUNIT_TEST( matrix_ctor ); - CPPUNIT_TEST( matrix_copy ); - CPPUNIT_TEST_SUITE_END(); - -private: - typedef tvmet::Vector<T, 3> vector_type; - typedef tvmet::Matrix<T, 3, 3> matrix_type; - - typedef std::vector<T> stlvec; - -public: - TestSTL() { } - -public: // cppunit interface - /** cppunit hook for fixture set up. */ - void setUp(); - - /** cppunit hook for fixture tear down. */ - void tearDown(); - -protected: - void vector_ctor(); - void vector_copy(); - - void matrix_ctor(); - void matrix_copy(); - -private: - stlvec stl_v1; - stlvec stl_v2; - vector_type v1; - matrix_type m1; -}; - -/***************************************************************************** - * Implementation Part I (cppunit part) - *** *************************************************************************/ - -template <class T> -void TestSTL<T>::setUp() { - stl_v1.push_back(static_cast<T>(1)); - stl_v1.push_back(static_cast<T>(2)); - stl_v1.push_back(static_cast<T>(3)); - - stl_v2.push_back(static_cast<T>(1)); - stl_v2.push_back(static_cast<T>(2)); - stl_v2.push_back(static_cast<T>(3)); - stl_v2.push_back(static_cast<T>(4)); - stl_v2.push_back(static_cast<T>(5)); - stl_v2.push_back(static_cast<T>(6)); - stl_v2.push_back(static_cast<T>(7)); - stl_v2.push_back(static_cast<T>(8)); - stl_v2.push_back(static_cast<T>(9)); -} - - -template <class T> -void TestSTL<T>::tearDown() { - -} - - -/***************************************************************************** - * Implementation Part II (vector) - ****************************************************************************/ - - -template <class T> -void -TestSTL<T>::vector_ctor() { - vector_type v(stl_v1.begin(), stl_v1.end()); - - CPPUNIT_ASSERT( std::equal(stl_v1.begin(), stl_v1.end(), v.begin()) == true ); -} - - -template <class T> -void -TestSTL<T>::vector_copy() { - vector_type v; - - std::copy(stl_v1.begin(), stl_v1.end(), v.begin()); - - CPPUNIT_ASSERT( std::equal(stl_v1.begin(), stl_v1.end(), v.begin()) == true ); -} - - -/***************************************************************************** - * Implementation Part II (matrix) - ****************************************************************************/ - - -template <class T> -void -TestSTL<T>::matrix_ctor() { - matrix_type m(stl_v2.begin(), stl_v2.end()); - - CPPUNIT_ASSERT( std::equal(stl_v2.begin(), stl_v2.end(), m.begin()) == true ); -} - - -template <class T> -void -TestSTL<T>::matrix_copy() { - matrix_type m; - - std::copy(stl_v2.begin(), stl_v2.end(), m.begin()); - - CPPUNIT_ASSERT( std::equal(stl_v2.begin(), stl_v2.end(), m.begin()) == true ); -} - - -#endif // TVMET_TEST_STL_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/testsuite/TestUnFunc.h b/tvmet-1.7.1/testsuite/TestUnFunc.h deleted file mode 100644 index 45aee9c66..000000000 --- a/tvmet-1.7.1/testsuite/TestUnFunc.h +++ /dev/null @@ -1,383 +0,0 @@ -/* - * Tiny Vector Matrix Library - * Dense Vector Matrix Libary of Tiny size using Expression Templates - * - * Copyright (C) 2001 - 2003 Olaf Petzold <opetzold@users.sourceforge.net> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id: TestUnFunc.h,v 1.1 2004/04/24 11:55:15 opetzold Exp $ - */ - -#ifndef TVMET_TEST_UNFUNC_H -#define TVMET_TEST_UNFUNC_H - -#include <cppunit/extensions/HelperMacros.h> - -#include <tvmet/Vector.h> -#include <tvmet/Matrix.h> - -/** - * generic - */ -template <class T> -class TestUnFunc : public CppUnit::TestFixture -{ - CPPUNIT_TEST_SUITE( TestUnFunc ); - CPPUNIT_TEST( fn_abs ); - CPPUNIT_TEST( Round ); - CPPUNIT_TEST( Arc ); - CPPUNIT_TEST( Log ); - CPPUNIT_TEST( Nan ); - CPPUNIT_TEST_SUITE_END(); - -private: - typedef tvmet::Vector<T, 3> vector_type; - typedef tvmet::Matrix<T, 3, 3> matrix_type; - -public: - TestUnFunc() - : vZero(0), vOne(1), vMinusOne(-1), vTwo(2), vE(M_E), - mZero(0), mOne(1), mMinusOne(-1), mTwo(2), mE(M_E), - scalar(10) - { } - -public: // cppunit interface - /** cppunit hook for fixture set up. */ - void setUp(); - - /** cppunit hook for fixture tear down. */ - void tearDown(); - -protected: - void fn_abs(); - void Round(); - void Arc(); - void Log(); - void Nan(); - -private: - const vector_type vZero; - const vector_type vOne; - const vector_type vMinusOne; - const vector_type vTwo; - const vector_type vE; - vector_type v1, v1b; - vector_type vBig; /**< vector 10x bigger than v1 */ - -private: - const matrix_type mZero; - const matrix_type mOne; - const matrix_type mMinusOne; - const matrix_type mTwo; - const matrix_type mE; - matrix_type m1, m1b; - matrix_type mBig; /**< matrix 10x bigger than m1 */ - -private: - const T scalar; -}; - - -/** - * specialized for int's (it doesn't support all binary functions, like sqrt(int)) - */ -template <> -class TestUnFunc<int> : public CppUnit::TestFixture -{ - CPPUNIT_TEST_SUITE( TestUnFunc<int> ); - CPPUNIT_TEST( fn_abs ); - CPPUNIT_TEST_SUITE_END(); - -private: - typedef tvmet::Vector<int, 3> vector_type; - typedef tvmet::Matrix<int, 3, 3> matrix_type; - -public: - TestUnFunc(); - -public: // cppunit interface - /** cppunit hook for fixture set up. */ - void setUp(); - - /** cppunit hook for fixture tear down. */ - void tearDown(); - -protected: - void fn_abs(); - -private: - const vector_type vZero, vOne, vMinusOne, vTwo; - -private: - const matrix_type mZero, mOne, mMinusOne, mTwo; -}; - - -/***************************************************************************** - * Implementation Part I (cppunit part) - ****************************************************************************/ - -template <class T> -void TestUnFunc<T>::setUp() { - v1 = 1,2,3; - v1b = v1; // same as v1, cctor test done in checkInternal - vBig = 10,20,30; - - m1 = 1,4,7, - 2,5,8, - 3,6,9; - m1b = m1; // same as m1, cctor test done in checkInternal - mBig = 10,40,70, - 20,50,80, - 30,60,90; -} - -template <class T> -void TestUnFunc<T>::tearDown() { - -} - - -/***************************************************************************** - * Implementation Part II - ****************************************************************************/ - - -template <class T> -void -TestUnFunc<T>::fn_abs() { - vector_type v, tv; - matrix_type m, tm; -} - - -template <class T> -void -TestUnFunc<T>::Round() { - vector_type v, tv; - matrix_type m, tm; - - // abs - v = abs(vMinusOne); - m = abs(mMinusOne); - CPPUNIT_ASSERT( all_elements(v == vOne) ); - CPPUNIT_ASSERT( all_elements(m == mOne) ); - -#if 0 // XXX cbrt not in std ?! - v = cbrt(vOne); - m = cbrt(mOne); - CPPUNIT_ASSERT( all_elements(v == std::cbrt(1)) ); - CPPUNIT_ASSERT( all_elements(m == std::cbrt(1)) ); -#endif - - // ceil - tv = vOne + 0.5; - tm = mOne + 0.5; - v = ceil(tv); - m = ceil(tm); - CPPUNIT_ASSERT( all_elements(v == vTwo) ); - CPPUNIT_ASSERT( all_elements(m == mTwo) ); - - // floor - tv = vTwo - 0.5; - tm = mTwo - 0.5; - v = floor(tv); - m = floor(tm); - CPPUNIT_ASSERT( all_elements(v == vOne) ); - CPPUNIT_ASSERT( all_elements(m == mOne) ); - -#if 0 // XXX rint not in std ?! - tv = vTwo - 0.5; - tm = mTwo - 0.5; - v = rint(tv); - m = rint(tm); - CPPUNIT_ASSERT( all_elements(v == vOne) ); - CPPUNIT_ASSERT( all_elements(m == mOne) ); -#endif -} - -template <class T> -void -TestUnFunc<T>::Arc() { - vector_type v, tv; - matrix_type m, tm; - - // sin - tv = M_PI/2.0; - tm = M_PI/2.0; - v = sin(tv); - m = sin(tm); - CPPUNIT_ASSERT( all_elements(v == vOne) ); - CPPUNIT_ASSERT( all_elements(m == mOne) ); - - // cos - tv = 2.0*M_PI; - tm = 2.0*M_PI; - v = cos(tv); - m = cos(tm); - CPPUNIT_ASSERT( all_elements(v == vOne) ); - CPPUNIT_ASSERT( all_elements(m == mOne) ); - - // tan - tv = M_PI/4.0; - tm = M_PI/4.0; - v = tan(tv); - m = tan(tm); - // precision problems, using element wise compare - CPPUNIT_ASSERT( all_elements(v == tan(M_PI/4.0) ) ); // this failed by OP - CPPUNIT_ASSERT( all_elements(m == tan(M_PI/4.0) ) ); // this not ... - - // asin - v = asin(vOne); - m = asin(mOne); - // precision problems, using element wise compare - CPPUNIT_ASSERT( all_elements(v == M_PI/2.0 ) ); - CPPUNIT_ASSERT( all_elements(m == M_PI/2.0 ) ); - - // acos - v = acos(vOne); - m = acos(mOne); - CPPUNIT_ASSERT( all_elements(v == 0.0) ); - CPPUNIT_ASSERT( all_elements(m == 0.0) ); - - // atan - v = atan(vOne); - m = atan(mOne); - CPPUNIT_ASSERT( all_elements(v == M_PI/4.0) ); - CPPUNIT_ASSERT( all_elements(m == M_PI/4.0) ); -} - -template <class T> -void -TestUnFunc<T>::Log() { - vector_type v, tv; - matrix_type m, tm; - - // exp - tv = vOne; - tm = mOne; - v = exp(tv); - m = exp(tm); - CPPUNIT_ASSERT( all_elements(v == vE) ); - CPPUNIT_ASSERT( all_elements(m == mE) ); - - // log naturalis - tv = vE; - tm = mE; - v = log(tv); - m = log(tm); - CPPUNIT_ASSERT( all_elements(v == vOne) ); - CPPUNIT_ASSERT( all_elements(m == mOne) ); - - // log10 - tv = vOne; - tm = mOne; - v = log10(tv); - m = log10(tm); - // precision problems, using element wise compare - CPPUNIT_ASSERT( all_elements(v == log10(1.0)) ); - CPPUNIT_ASSERT( all_elements(m == log10(1.0)) ); - - // sqrt - tv = 9; - tm = 9; - v = sqrt(tv); - m = sqrt(tm); - CPPUNIT_ASSERT( all_elements(v == 3) ); - CPPUNIT_ASSERT( all_elements(m == 3) ); -} - -template <class T> -void -TestUnFunc<T>::Nan() { -#ifdef HAVE_IEEE_MATH - vector_type v; - matrix_type m; - - // isnan - v = NAN; - m = NAN; - CPPUNIT_ASSERT( all_elements(isnan(v)) ); - CPPUNIT_ASSERT( all_elements(isnan(m)) ); - - CPPUNIT_ASSERT( all_elements(!isnan(v1)) ); - CPPUNIT_ASSERT( all_elements(!isnan(vBig)) ); - CPPUNIT_ASSERT( all_elements(!isnan(vOne)) ); - CPPUNIT_ASSERT( all_elements(!isnan(vZero)) ); - CPPUNIT_ASSERT( all_elements(!isnan(m1)) ); - CPPUNIT_ASSERT( all_elements(!isnan(mBig)) ); - CPPUNIT_ASSERT( all_elements(!isnan(mOne)) ); - CPPUNIT_ASSERT( all_elements(!isnan(mZero)) ); - - // isinf(1) - v = HUGE_VAL; - m = HUGE_VAL; - CPPUNIT_ASSERT( all_elements(isinf(v) > 0) ); // == 1 - CPPUNIT_ASSERT( all_elements(isinf(m) > 0) ); // == 1 - - v = -HUGE_VAL; - m = -HUGE_VAL; - - CPPUNIT_ASSERT( all_elements(isinf(v) < 0) ); // == -1 - CPPUNIT_ASSERT( all_elements(isinf(m) < 0) ); // == -1 - - // isinf(2) - CPPUNIT_ASSERT( all_elements(!isinf(v1)) ); - CPPUNIT_ASSERT( all_elements(!isinf(vBig)) ); - CPPUNIT_ASSERT( all_elements(!isinf(vOne)) ); - CPPUNIT_ASSERT( all_elements(!isinf(vZero)) ); - CPPUNIT_ASSERT( all_elements(!isinf(m1)) ); - CPPUNIT_ASSERT( all_elements(!isinf(mBig)) ); - CPPUNIT_ASSERT( all_elements(!isinf(mOne)) ); - CPPUNIT_ASSERT( all_elements(!isinf(mZero)) ); - -#if 0 // XXX finite not in std ?! - v = NAN; - m = NAN; - CPPUNIT_ASSERT( all_elements(finite(v) != 0) ); - CPPUNIT_ASSERT( all_elements(finite(m) != 0) ); - - CPPUNIT_ASSERT( all_elements(finite(v1) != 0) ); - CPPUNIT_ASSERT( all_elements(finite(vBig) != 0) ); - CPPUNIT_ASSERT( all_elements(finite(vOne) != 0) ); - CPPUNIT_ASSERT( all_elements(finite(vZero) != 0) ); - CPPUNIT_ASSERT( all_elements(finite(m1) != 0) ); - CPPUNIT_ASSERT( all_elements(finite(mBig) != 0) ); - CPPUNIT_ASSERT( all_elements(finite(mOne) != 0) ); - CPPUNIT_ASSERT( all_elements(finite(mZero) != 0) ); - - v = HUGE_VAL; - m = HUGE_VAL; - CPPUNIT_ASSERT( all_elements(finite(v) == 0) ); - CPPUNIT_ASSERT( all_elements(finite(m) == 0) ); - - v = -HUGE_VAL; - m = -HUGE_VAL; - - CPPUNIT_ASSERT( all_elements(finite(v) == 0) ); - CPPUNIT_ASSERT( all_elements(finite(m) == 0) ); -#endif - -#endif // HAVE_IEEE_MATH -} - - - -#endif // TVMET_TEST_UNFUNC_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/testsuite/TestUnloops.h b/tvmet-1.7.1/testsuite/TestUnloops.h deleted file mode 100644 index 1d021109d..000000000 --- a/tvmet-1.7.1/testsuite/TestUnloops.h +++ /dev/null @@ -1,417 +0,0 @@ -/* - * Tiny Vector Matrix Library - * Dense Vector Matrix Libary of Tiny size using Expression Templates - * - * Copyright (C) 2001 - 2003 Olaf Petzold <opetzold@users.sourceforge.net> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id: TestUnloops.h,v 1.1 2004/04/24 11:55:15 opetzold Exp $ - */ - -#ifndef TVMET_TEST_UNLOOPS_H -#define TVMET_TEST_UNLOOPS_H - -#include <algorithm> - -#include <cppunit/extensions/HelperMacros.h> - -#include <tvmet/Vector.h> -#include <tvmet/Matrix.h> -#include <tvmet/util/Incrementor.h> - - -template <class T> -class TestUnloops : public CppUnit::TestFixture -{ - CPPUNIT_TEST_SUITE( TestUnloops ); - CPPUNIT_TEST( Mx ); - CPPUNIT_TEST( Mtx ); - CPPUNIT_TEST( MM ); -// CPPUNIT_TEST( MtM ); -// CPPUNIT_TEST( MMt ); -// CPPUNIT_TEST( tMM ); - CPPUNIT_TEST_SUITE_END(); - -public: - TestUnloops() { } - -public: // cppunit interface - /** cppunit hook for fixture set up. */ - void setUp(); - - /** cppunit hook for fixture tear down. */ - void tearDown(); - -protected: - template<class A, class B, class C> - void mv_product(const A&, const B&, C&); - - template<class A, class B, class C> - void mm_product(const A&, const B&, C&); - - template<class A, class B, class C> - void mtm_product(const A&, const B&, C&); - - template<class A, class B, class C> - void mmt_product(const A&, const B&, C&); - -protected: - void Mx(); - void Mtx(); - void MM(); - void MtM(); - void MMt(); - void tMM(); - -public: - typedef T value_type; - -private: - enum { - dim = 8, - foo = 2 - }; -}; - -/***************************************************************************** - * Implementation part I (cppunit part) - ****************************************************************************/ - -template <class T> -void TestUnloops<T>::setUp() { } - -template <class T> -void TestUnloops<T>::tearDown() { } - -/***************************************************************************** - * Implementation part II (reference loops) - ****************************************************************************/ -template<class T> -template<class LHS, class RHS, class RES> -void TestUnloops<T>::mv_product(const LHS& A, const RHS& B, RES& X) { - assert(int(LHS::Rows) == int(RES::Size)); - assert(int(LHS::Cols) == int(RHS::Size)); - - enum { - M = LHS::Rows, - N = RHS::Size // is Vector - }; - - for (int i = 0; i < M; i++){ - value_type sum(0); - for (int j = 0; j < N; j++){ - sum += A(i, j) * B(j); - } - X(i) = sum; - } -} - -template<class T> -template<class LHS, class RHS, class RES> -void TestUnloops<T>::mm_product(const LHS& A, const RHS& B, RES& X) { - assert(int(LHS::Rows) == int(RES::Rows)); - assert(int(LHS::Cols) == int(RHS::Rows)); - assert(int(RHS::Cols) == int(RES::Cols)); - - enum { - M = LHS::Rows, - N = RHS::Cols, - K = RHS::Rows - }; - - for (int i = 0; i < M; ++i) { - for (int j = 0; j < N; ++j) { - value_type sum(0); - for (int k = 0; k < K; ++k) { - sum += A(i, k) * B(k, j); - } - X(i, j) = sum; - } - } -} - -template<class T> -template<class LHS, class RHS, class RES> -void TestUnloops<T>::mtm_product(const LHS& A, const RHS& B, RES& X) { - assert(int(LHS::Rows) == int(RHS::Rows)); - assert(int(LHS::Cols) == int(RES::Rows)); - assert(int(RHS::Cols) == int(RES::Cols)); - - enum { - M = LHS::Cols, - N = RHS::Cols, - K = RHS::Rows - }; - - for (int i = 0; i < N; i++){ - for (int j = 0; j < N; j++){ - value_type sum(0); - for (int k = 0; k < K; k++){ - sum += A(k, i) * B(k, j); - } - X(i, j) = sum; - } - } -} - -template<class T> -template<class LHS, class RHS, class RES> -void TestUnloops<T>::mmt_product(const LHS& A, const RHS& B, RES& X) { - assert(int(LHS::Rows) == int(RES::Rows)); - assert(int(LHS::Cols) == int(RHS::Cols)); - assert(int(RHS::Rows) == int(RES::Cols)); - - enum { - M = LHS::Rows, - N = RHS::Rows, - K = LHS::Cols - }; - - for (int i = 0;i < N; i++){ - for (int j = 0;j < N; j++){ - value_type sum(0); - for (int k = 0;k < N; k++){ - sum += A(i, k)*A(j, k); - } - X(i, j) = sum; - } - } -} - -/***************************************************************************** - * Implementation part III - ****************************************************************************/ - -template <class T> -void TestUnloops<T>::Mx() { - using namespace tvmet; - - enum { - Rows = dim-foo, - Cols = dim+foo, - }; - - typedef Matrix<T, Rows, Cols> matrix1_type; - typedef Vector<T, matrix1_type::Cols> vector1_type; - typedef Vector<T, matrix1_type::Rows> vector2_type; - - matrix1_type M; - vector1_type x; - - std::generate(M.begin(), M.end(), - tvmet::util::Incrementor<typename vector1_type::value_type>()); - std::generate(x.begin(), x.end(), - tvmet::util::Incrementor<typename vector2_type::value_type>()); - - vector2_type r; - mv_product(M, x, r); - - vector2_type y; - y = prod(M, x); - - CPPUNIT_ASSERT( all_elements( y == r ) ); -} - - -template <class T> -void TestUnloops<T>::Mtx() { - using namespace tvmet; - - enum { - Rows = dim-foo, - Cols = dim+foo, - }; - - typedef Matrix<T, Rows, Cols> matrix1_type; - typedef Matrix<T, - matrix1_type::Cols, matrix1_type::Rows> matrix1t_type; - typedef Vector<T, matrix1t_type::Cols> vector1_type; - typedef Vector<T, matrix1t_type::Rows> vector2_type; - - matrix1_type M; - vector1_type x; - - std::generate(M.begin(), M.end(), - tvmet::util::Incrementor<typename matrix1_type::value_type>()); - std::generate(x.begin(), x.end(), - tvmet::util::Incrementor<typename vector1_type::value_type>()); - - vector2_type r; - matrix1t_type Mt(trans(M)); - mv_product(Mt, x, r); - - vector2_type y; - y = Mtx_prod(M, x); - - CPPUNIT_ASSERT( all_elements( y == r ) ); -} - - -template <class T> -void TestUnloops<T>::MM() { - using namespace tvmet; - - enum { - Rows1 = dim-foo, - Cols1 = dim+foo, - Cols2 = dim - }; - - typedef Matrix<T, Rows1, Cols1> matrix1_type; - typedef Matrix<T, Cols1, Cols2> matrix2_type; - typedef Matrix<T, - matrix1_type::Rows, matrix2_type::Cols> matrix3_type; - - matrix1_type M1; - matrix2_type M2; - - std::generate(M1.begin(), M1.end(), - tvmet::util::Incrementor<typename matrix1_type::value_type>()); - std::generate(M2.begin(), M2.end(), - tvmet::util::Incrementor<typename matrix2_type::value_type>()); - - matrix3_type R; - mm_product(M1, M2, R); - - matrix3_type M3; - M3 = prod(M1, M2); - - CPPUNIT_ASSERT( all_elements( M3 == R ) ); -} - - -template <class T> -void TestUnloops<T>::MtM() { - using namespace tvmet; - - enum { - Rows1 = dim-foo, - Cols1 = dim+foo, - Cols2 = dim - }; - - typedef Matrix<T, Rows1, Cols1> matrix1_type; - typedef Matrix<T, Rows1, Cols2> matrix2_type; - typedef Matrix<T, - matrix1_type::Cols, matrix2_type::Cols> matrix3_type; - - matrix1_type M1; - matrix2_type M2; - - std::generate(M1.begin(), M1.end(), - tvmet::util::Incrementor<typename matrix1_type::value_type>()); - std::generate(M2.begin(), M2.end(), - tvmet::util::Incrementor<typename matrix2_type::value_type>()); - - matrix3_type R; - mtm_product(M1, M2, R); - - matrix3_type M3; - M3 = MtM_prod(M1, M2); - - std::cout << "M1=" << M1 << std::endl; - std::cout << "M2=" << M2 << std::endl; - std::cout << "M3=" << M3 << std::endl; - std::cout << "R=" << R << std::endl; - - CPPUNIT_ASSERT( all_elements( M3 == R ) ); -} - - -template <class T> -void TestUnloops<T>::MMt() { - using namespace tvmet; - - enum { - Rows1 = dim-foo, - Cols1 = dim+foo, - Rows2 = dim - }; - - typedef Matrix<T, Rows1, Cols1> matrix1_type; - typedef Matrix<T, Rows2, Cols1> matrix2_type; - typedef Matrix<T, - matrix1_type::Rows, matrix2_type::Rows> matrix3_type; - - matrix1_type M1; - matrix2_type M2; - - std::generate(M1.begin(), M1.end(), - tvmet::util::Incrementor<typename matrix1_type::value_type>()); - std::generate(M2.begin(), M2.end(), - tvmet::util::Incrementor<typename matrix2_type::value_type>()); - - matrix3_type R; - mmt_product(M1, M2, R); - - matrix3_type M3; - M3 = MMt_prod(M1, M2); - - std::cout << "M1=" << M1 << std::endl; - std::cout << "M2=" << M2 << std::endl; - std::cout << "M3=" << M3 << std::endl; - std::cout << "R=" << R << std::endl; - - CPPUNIT_ASSERT( all_elements( M3 == R ) ); -} - - -template <class T> -void TestUnloops<T>::tMM() { - using namespace tvmet; - - enum { - Rows1 = dim-foo, - Cols1 = dim+foo, - Cols2 = dim - }; - - typedef Matrix<T, Rows1, Cols1> matrix1_type; - typedef Matrix<T, Cols1, Cols2> matrix2_type; - typedef Matrix<T, - matrix1_type::Rows, matrix2_type::Cols> matrix3_type; - typedef Matrix<T, - matrix3_type::Cols, matrix3_type::Rows> matrix3t_type; - - matrix1_type M1; - matrix2_type M2; - - std::generate(M1.begin(), M1.end(), - tvmet::util::Incrementor<typename matrix1_type::value_type>()); - std::generate(M2.begin(), M2.end(), - tvmet::util::Incrementor<typename matrix2_type::value_type>()); - - matrix3_type R; - matrix3t_type Rt; - mm_product(M1, M2, R); - Rt = trans(R); - - matrix3t_type M3; - M3 = trans_prod(M1, M2); - - std::cout << "M1=" << M1 << std::endl; - std::cout << "M2=" << M2 << std::endl; - std::cout << "M3=" << M3 << std::endl; - std::cout << "Rt=" << Rt << std::endl; - - CPPUNIT_ASSERT( all_elements( M3 == Rt ) ); -} - -#endif // TVMET_TEST_UNLOOPS_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/testsuite/TestVectorEval.h b/tvmet-1.7.1/testsuite/TestVectorEval.h deleted file mode 100644 index 8beee50b6..000000000 --- a/tvmet-1.7.1/testsuite/TestVectorEval.h +++ /dev/null @@ -1,304 +0,0 @@ -/* - * Tiny Vector Matrix Library - * Dense Vector Matrix Libary of Tiny size using Expression Templates - * - * Copyright (C) 2001 - 2003 Olaf Petzold <opetzold@users.sourceforge.net> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id: TestVectorEval.h,v 1.1 2004/04/24 11:55:15 opetzold Exp $ - */ - -#ifndef TVMET_TEST_VECTOR_EVAL_H -#define TVMET_TEST_VECTOR_EVAL_H - -#include <cppunit/extensions/HelperMacros.h> - -#include <tvmet/Vector.h> - -#include <cassert> - -template <class T> -class TestVectorEval : public CppUnit::TestFixture -{ - // basic tests - CPPUNIT_TEST_SUITE( TestVectorEval ); - CPPUNIT_TEST( Greater ); - CPPUNIT_TEST( Less ); - CPPUNIT_TEST( GreaterOrEqual ); - CPPUNIT_TEST( LessOrEqual ); - CPPUNIT_TEST( Equal ); - CPPUNIT_TEST( NotEqual ); - CPPUNIT_TEST( LogicalAnd ); - CPPUNIT_TEST( LogicalOr ); - - // others - CPPUNIT_TEST( AllElements ); - CPPUNIT_TEST( AnyElements ); - CPPUNIT_TEST( Eval3 ); - CPPUNIT_TEST( EvalPod3 ); - - CPPUNIT_TEST_SUITE_END(); - -private: - typedef tvmet::Vector<T, 3> vector_type; - -public: - TestVectorEval() - : vOne(1), vZero(0) { } - -public: // cppunit interface - /** cppunit hook for fixture set up. */ - void setUp(); - - /** cppunit hook for fixture tear down. */ - void tearDown(); - -protected: - void Greater(); - void Less(); - void GreaterOrEqual(); - void LessOrEqual(); - void Equal(); - void NotEqual(); - void LogicalAnd(); - void LogicalOr(); - - void AllElements(); - void AnyElements(); - void Eval3(); - void EvalPod3(); - -private: - vector_type v1; - vector_type vBig; /**< vector bigger than v1 */ - const vector_type vOne; - const vector_type vZero; - -}; - -/***************************************************************************** - * Implementation Part I (cppunit part) - ****************************************************************************/ - -template <class T> -void TestVectorEval<T>::setUp () { - v1 = 1,2,3; - vBig = 10,20,30; -} - -template <class T> -void TestVectorEval<T>::tearDown() { } - -/***************************************************************************** - * Implementation Part II - * these are elemental - therefore we use std::assert - ****************************************************************************/ - -/* - * on SelfTest, we have the guarantee, that the container holds the - * expected values. Now check comparing operation using tvmet's - * eval function. This is the basic for all further test since it's - * the way we check the correctness. The other way would be element wise - * compare as in SelfTest, urgh... - */ -template <class T> -void -TestVectorEval<T>::Greater() { - // all test are element wise ! - assert( all_elements(vBig > v1) ); -} - -template <class T> -void -TestVectorEval<T>::Less() { - // all test are element wise ! - assert( all_elements(v1 < vBig) ); -} - -template <class T> -void -TestVectorEval<T>::GreaterOrEqual() { - // all test are element wise ! - assert( all_elements(vBig >= v1) ); - assert( all_elements(v1 >= v1) ); - assert( all_elements(vBig >= vBig) ); - assert( all_elements(vOne >= T(1)) ); - assert( all_elements(vZero>= T(0)) ); -} - -template <class T> -void -TestVectorEval<T>::LessOrEqual() { - // all test are element wise ! - assert( all_elements(v1 <= vBig) ); - assert( all_elements(v1 <= v1) ); - assert( all_elements(vBig <= vBig) ); - assert( all_elements(vOne <= T(1)) ); - assert( all_elements(vZero<= T(0)) ); -} - -template <class T> -void -TestVectorEval<T>::Equal() { - // all test are element wise ! - assert( all_elements(v1 == v1) ); - assert( all_elements(vBig == vBig) ); - assert( all_elements(vOne == 1) ); - assert( all_elements(vZero == T(0)) ); -} - -template <class T> -void -TestVectorEval<T>::NotEqual() { - // all test are element wise ! - assert( all_elements(v1 != vBig) ); -} - -template <class T> -void -TestVectorEval<T>::LogicalAnd() { - // TODO: implement -} - -template <class T> -void -TestVectorEval<T>::LogicalOr() { - // TODO: implement -} - -/***************************************************************************** - * Implementation Part III - * test on generell and eval functions - ****************************************************************************/ - -template <class T> -void -TestVectorEval<T>::AllElements() { - // true cases - CPPUNIT_ASSERT( all_elements(vBig > T(0)) ); - CPPUNIT_ASSERT( all_elements(vBig >= T(1)) ); - - CPPUNIT_ASSERT( all_elements(vBig < T(1000)) ); - CPPUNIT_ASSERT( all_elements(vBig <= T(1000)) ); - - CPPUNIT_ASSERT( all_elements(T(0) < vBig) ); // possible, I newer would write it - CPPUNIT_ASSERT( all_elements(T(1000) > vBig) ); // possible, I newer would write it - - CPPUNIT_ASSERT( all_elements(vOne == T(1)) ); - CPPUNIT_ASSERT( all_elements(vZero == T(0)) ); - - CPPUNIT_ASSERT( all_elements(vBig != T(1000)) ); - - // false cases - CPPUNIT_ASSERT( !all_elements(vBig < T(0)) ); -} - - -template <class T> -void -TestVectorEval<T>::AnyElements() { - // true cases - CPPUNIT_ASSERT( any_elements(vBig > T(0)) ); - CPPUNIT_ASSERT( any_elements(vBig >= T(1)) ); - - CPPUNIT_ASSERT( any_elements(vBig < T(1000)) ); - CPPUNIT_ASSERT( any_elements(vBig <= T(1000)) ); - - CPPUNIT_ASSERT( any_elements(T(2) < v1) ); // possible, I newer would write it - CPPUNIT_ASSERT( any_elements(T(2) > v1) ); // possible, I newer would write it - - CPPUNIT_ASSERT( any_elements(vOne == T(1)) ); - CPPUNIT_ASSERT( any_elements(vZero == T(0)) ); - - CPPUNIT_ASSERT( any_elements(vBig != T(1000)) ); - - // false cases - CPPUNIT_ASSERT( !any_elements(vBig < T(2)) ); - CPPUNIT_ASSERT( !any_elements(vOne == T(0)) ); - CPPUNIT_ASSERT( !any_elements(vZero == T(1)) ); -} - - -template <class T> -void -TestVectorEval<T>::Eval3() { - vector_type v; - T a(1); // scalar - - // XprVector<E1, Sz> ? Vector<T2, Sz> : Vector<T3, Sz> - v = eval( v1 < vBig, v1, vBig); - CPPUNIT_ASSERT( all_elements(v == v1) ); - - v = eval( v1 > vBig, v1, vBig); - CPPUNIT_ASSERT( all_elements(v == vBig) ); - - // XprVector<E1, Sz> ? Vector<T2, Sz> : XprVector<E3, Sz> - v = eval( v1 < vBig, v1, a*vBig); - CPPUNIT_ASSERT( all_elements(v == v1) ); - - v = eval( v1 > vBig, v1, a*vBig); - CPPUNIT_ASSERT( all_elements(v == vBig) ); - - // XprVector<E1, Sz> ? XprVector<E2, Sz> : Vector<T3, Sz> - v = eval( v1 < vBig, a*v1, vBig); - CPPUNIT_ASSERT( all_elements(v == v1) ); - - v = eval( v1 > vBig, a*v1, vBig); - CPPUNIT_ASSERT( all_elements(v == vBig) ); - - // XprVector<E1, Sz> ? XprVector<E2, Sz> : XprVector<E3, Sz> - v = eval( v1 < vBig, a*v1, a*vBig); - CPPUNIT_ASSERT( all_elements(v == v1) ); - - v = eval( v1 > vBig, a*v1, a*vBig); - CPPUNIT_ASSERT( all_elements(v == vBig) ); -} - - -template <class T> -void -TestVectorEval<T>::EvalPod3() { - vector_type v; - T a(1); // scalar - - // XprVector<E, Sz> ? POD1 : POD2 - v = eval( v1 < vBig, T(0), T(1)); - CPPUNIT_ASSERT( all_elements(v == T(0)) ); - - v = eval( v1 > vBig, T(0), T(1)); - CPPUNIT_ASSERT( all_elements(v == T(1)) ); - - // XprVector<E1, Sz> ? POD : XprVector<E3, Sz> - v = eval( v1 < vBig, 1, a*vBig); - CPPUNIT_ASSERT( all_elements(v == vOne) ); - - v = eval( v1 > vBig, 1, a*vBig); - CPPUNIT_ASSERT( all_elements(v == vBig) ); - - // XprVector<E1, Sz> ? XprVector<E2, Sz> : POD - v = eval( v1 < vBig, a*v1, T(1)); - CPPUNIT_ASSERT( all_elements(v == v1) ); - - v = eval( v1 > vBig, a*v1, T(1)); - CPPUNIT_ASSERT( all_elements(v == vOne) ); -} - - -#endif // TVMET_TEST_VECTOR_EVAL_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/testsuite/TestVectorFunctions.h b/tvmet-1.7.1/testsuite/TestVectorFunctions.h deleted file mode 100644 index be82784ff..000000000 --- a/tvmet-1.7.1/testsuite/TestVectorFunctions.h +++ /dev/null @@ -1,500 +0,0 @@ -/* - * Tiny Vector Matrix Library - * Dense Vector Matrix Libary of Tiny size using Expression Templates - * - * Copyright (C) 2001 - 2003 Olaf Petzold <opetzold@users.sourceforge.net> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id: TestVectorFunctions.h,v 1.1 2004/04/24 11:55:15 opetzold Exp $ - */ - -#ifndef TVMET_TEST_VECTORFUNC_H -#define TVMET_TEST_VECTORFUNC_H - -#include <limits> - -#include <cppunit/extensions/HelperMacros.h> - -#include <tvmet/Vector.h> -#include <tvmet/util/General.h> - -template <class T> -class TestVectorFunctions : public CppUnit::TestFixture -{ - CPPUNIT_TEST_SUITE( TestVectorFunctions ); - CPPUNIT_TEST( scalarUpdAssign1 ); - CPPUNIT_TEST( scalarUpdAssign2 ); - CPPUNIT_TEST( scalarUpdAssign3 ); - CPPUNIT_TEST( scalarFuncs1 ); - CPPUNIT_TEST( scalarFuncs2 ); - CPPUNIT_TEST( globalVectorFuncs1 ); - CPPUNIT_TEST( globalVectorFuncs2 ); - CPPUNIT_TEST( globalVectorFuncs3 ); - CPPUNIT_TEST( fn_sum ); - CPPUNIT_TEST( fn_product ); - CPPUNIT_TEST( fn_dot ); - CPPUNIT_TEST( fn_cross ); - CPPUNIT_TEST( fn_norm ); - CPPUNIT_TEST( extremum ); - CPPUNIT_TEST_SUITE_END(); - -private: - typedef tvmet::Vector<T, 3> vector_type; - -public: - TestVectorFunctions() - : vZero(0), vOne(1), scalar(10), scalar2(2) { } - -public: // cppunit interface - /** cppunit hook for fixture set up. */ - void setUp(); - - /** cppunit hook for fixture tear down. */ - void tearDown(); - -protected: - void scalarUpdAssign1(); - void scalarUpdAssign2(); - void scalarUpdAssign3(); - void scalarFuncs1(); - void scalarFuncs2(); - void globalVectorFuncs1(); - void globalVectorFuncs2(); - void globalVectorFuncs3(); - void fn_sum(); - void fn_product(); - void fn_dot(); - void fn_cross(); - void fn_norm(); - void extremum(); - -private: - const vector_type vZero; - const vector_type vOne; - vector_type v1; - vector_type vBig; /**< vector 10x bigger than v1 */ - -private: - const T scalar; - const T scalar2; -}; - - -/***************************************************************************** - * Implementation Part I (cppunit part) - ****************************************************************************/ - - -template <class T> -void TestVectorFunctions<T>::setUp() { - v1 = 1,2,3; - vBig = 10,20,30; -} - - -template <class T> -void TestVectorFunctions<T>::tearDown() { } - - -/***************************************************************************** - * Implementation Part II - ****************************************************************************/ - - -/* - * member math operators with scalars - * Since we use it to compare results, these tests are elemental. - */ -template <class T> -void -TestVectorFunctions<T>::scalarUpdAssign1() { - // all these functions are element wise - vector_type t1(v1), t2(v1), t3(v1), t4(vBig); - - t1 += scalar; - t2 -= scalar; - t3 *= scalar; - t4 /= scalar; - - assert(t1(0) == (v1(0)+scalar) && t1(1) == (v1(1)+scalar) && t1(2) == (v1(2)+scalar)); - assert(t2(0) == (v1(0)-scalar) && t2(1) == (v1(1)-scalar) && t2(2) == (v1(2)-scalar)); - assert( all_elements(t3 == vBig) ); - assert( all_elements(t4 == v1) ); -} - - -/* - * member math operators with Vectors - * Since we use it to compare results, these tests are elemental. - */ -template <class T> -void -TestVectorFunctions<T>::scalarUpdAssign2() { - // all these functions are element wise - vector_type t1(v1), t2(v1), t3(v1), t4(v1); - - t1 += v1; - t2 -= v1; - t3 *= v1; - - { - using namespace tvmet::element_wise; - t4 /= v1; - } - - assert( all_elements(t1 == 2*v1) ); - assert( all_elements(t2 == vZero) ); - assert(t3(0) == (v1(0)*v1(0)) && t3(1) == (v1(1)*v1(1)) && t3(2) == (v1(2)*v1(2))); - assert( all_elements(t4 == 1) ); -} - - -/* - * member math operators with XprVector - * Since we use it to compare results, these tests are elemental. - */ -template <class T> -void -TestVectorFunctions<T>::scalarUpdAssign3() { - // all these functions are element wise - vector_type t1(v1), t2(v1), t3(v1), t4(v1); - - t1 += T(1)*v1; - t2 -= T(1)*v1; - t3 *= T(1)*v1; - - { - using namespace tvmet::element_wise; - t4 /= T(1)*v1; - } - - assert( all_elements(t1 == 2*v1) ); - assert( all_elements(t2 == vZero) ); - assert(t3(0) == (v1(0)*v1(0)) && t3(1) == (v1(1)*v1(1)) && t3(2) == (v1(2)*v1(2))); - assert( all_elements(t4 == vOne) ); -} - - -/* - * global math operators with scalars - * Note: checked against member operators since they are allready checked - */ -template <class T> -void -TestVectorFunctions<T>::scalarFuncs1() { - vector_type r1(v1), r2(v1), r3(v1), r4(vBig); - vector_type t1(0), t2(0), t3(0), t4(0); - - r1 += scalar; - r2 -= scalar; - r3 *= scalar; - r4 /= scalar; - - // all element wise - t1 = add(v1, scalar); - t2 = sub(v1, scalar); - t3 = mul(v1, scalar); - t4 = div(vBig, scalar); - - CPPUNIT_ASSERT( all_elements(t1 == r1) ); - CPPUNIT_ASSERT( all_elements(t2 == r2) ); - CPPUNIT_ASSERT( all_elements(t3 == r3) ); - CPPUNIT_ASSERT( all_elements(t4 == r4) ); -} - - -/* - * global math operators with scalars, part II - * Note: checked against member operators since they are allready checked - */ -template <class T> -void -TestVectorFunctions<T>::scalarFuncs2() { - vector_type r1(v1), r2(v1); - vector_type t1(0), t2(0); - - r1 += scalar; - r2 *= scalar; - - // all element wise - t1 = add(scalar, v1); - t2 = mul(scalar, v1); - CPPUNIT_ASSERT( all_elements(t1 == r1) ); - CPPUNIT_ASSERT( all_elements(t2 == r2) ); -} - - -/* - * global math operators with vectors (using functions) - */ -template <class T> -void -TestVectorFunctions<T>::globalVectorFuncs1() { - vector_type r1(v1), r2(v1), r3(v1), r4(v1); - vector_type t1(0), t2(0), t3(0), t4(0); - vector_type v2(v1); - - CPPUNIT_ASSERT( all_elements( v1 == v2) ); - - r1 += v1; - r2 -= v1; - r3 *= v1; - - { - using namespace tvmet::element_wise; - r4 /= v1; - } - - CPPUNIT_ASSERT( all_elements(r2 == T(0)) ); - CPPUNIT_ASSERT( all_elements(r4 == T(1)) ); - - t1 = add(v1, v2); - t2 = sub(v1, v2); - t3 = mul(v1, v2); - t4 = tvmet::element_wise::div(v1, v1); - - CPPUNIT_ASSERT( all_elements(t1 == r1) ); - CPPUNIT_ASSERT( all_elements(t2 == r2) ); - CPPUNIT_ASSERT( all_elements(t3 == r3) ); - CPPUNIT_ASSERT( all_elements(t4 == r4) ); -} - - -/* - * global math operators with vectors and xpr (using functions) - */ -template <class T> -void -TestVectorFunctions<T>::globalVectorFuncs2() { - vector_type r1(v1), r2(v1), r3(v1), r4(v1); - vector_type t1(0), t2(0), t3(0), t4(0); - vector_type v2(v1); - - CPPUNIT_ASSERT( all_elements( v1 == v2) ); - - r1 += T(1)*v1; - r2 -= T(1)*v1; - r3 *= T(1)*v1; - - { - using namespace tvmet::element_wise; - r4 /= T(1)*v1; - } - - CPPUNIT_ASSERT( all_elements(r2 == T(0)) ); - CPPUNIT_ASSERT( all_elements(r4 == T(1)) ); - - t1 = add(v1, T(1)*v2); - t2 = sub(v1, T(1)*v2); - t3 = mul(v1, T(1)*v2); - t4 = tvmet::element_wise::div(v1, T(1)*v1); - - CPPUNIT_ASSERT( all_elements(t1 == r1) ); - CPPUNIT_ASSERT( all_elements(t2 == r2) ); - CPPUNIT_ASSERT( all_elements(t3 == r3) ); - CPPUNIT_ASSERT( all_elements(t4 == r4) ); -} - - -/* - * global math operators with vectors with xpr (using functions) - */ -template <class T> -void -TestVectorFunctions<T>::globalVectorFuncs3() { - vector_type r1(v1), r2(v1), r3(v1), r4(v1); - vector_type t1(0), t2(0), t3(0), t4(0); - vector_type v2(v1); - - CPPUNIT_ASSERT( all_elements( v1 == v2) ); - - r1 += T(1)*v1; - r2 -= T(1)*v1; - r3 *= T(1)*v1; - - { - using namespace tvmet::element_wise; - r4 /= T(1)*v1; - } - - CPPUNIT_ASSERT( all_elements(r2 == T(0)) ); - CPPUNIT_ASSERT( all_elements(r4 == T(1)) ); - - t1 = add(T(1)*v1, v2); - t2 = sub(T(1)*v1, v2); - t3 = mul(T(1)*v1, v2); - t4 = tvmet::element_wise::div(T(1)*v1, v1); - - CPPUNIT_ASSERT( all_elements(t1 == r1) ); - CPPUNIT_ASSERT( all_elements(t2 == r2) ); - CPPUNIT_ASSERT( all_elements(t3 == r3) ); - CPPUNIT_ASSERT( all_elements(t4 == r4) ); -} - - -/* - * sum of vector - */ -template <class T> -void -TestVectorFunctions<T>::fn_sum() { - T t = sum(v1); - - CPPUNIT_ASSERT( t == (v1(0) + v1(1) + v1(2))); -} - - -/* - * prod of vector - */ -template <class T> -void -TestVectorFunctions<T>::fn_product() { - T t = product(v1); - - CPPUNIT_ASSERT( t == (v1(0) * v1(1) * v1(2))); -} - - -/* - * dot product - */ -template <class T> -void -TestVectorFunctions<T>::fn_dot() { - vector_type v2(v1); - - T t1 = dot(v1, v2); - CPPUNIT_ASSERT( t1 == 14 ); - - T t2 = dot(v1, vBig); - CPPUNIT_ASSERT( t2 == 140 ); - - T t3 = dot(v1, vOne); - CPPUNIT_ASSERT( t3 == 6 ); - - T t4 = dot(v1, vZero); - CPPUNIT_ASSERT( t4 == 0 ); -} - - -/* - * cross product - */ -template <class T> -void -TestVectorFunctions<T>::fn_cross() { - vector_type v2(v1); - - vector_type t1 = cross(v1, v2); - CPPUNIT_ASSERT( all_elements(t1 == vZero) ); // orthogonal vectors - - vector_type t2 = cross(v1, vBig); - CPPUNIT_ASSERT( all_elements(t2 == vZero) ); // orthogonal vectors - - const vector_type r(-1,2,-1); - vector_type t3 = cross(v1, vOne); - CPPUNIT_ASSERT( all_elements(t3 == r) ); - - vector_type t4 = cross(v1, vZero); - CPPUNIT_ASSERT( all_elements(t4 == vZero) ); -} - - -/* - * norm - * Note: norm2 for ints specialized - */ -template <class T> -void -TestVectorFunctions<T>::fn_norm() { - vector_type v2; - vector_type r; - vector_type t5; - - v2 = -v1; // norm can't handle XprVector<> yet - - T t1 = norm1(v1); - T t2 = norm1(v2); - T t3 = norm2(v1); - T t4 = norm2(v2); - - CPPUNIT_ASSERT( t1 == sum(v1) ); - CPPUNIT_ASSERT( t2 == sum(v1) ); - CPPUNIT_ASSERT( std::abs(t3 - std::sqrt(static_cast<typename tvmet::Traits<T>::float_type>(14))) - < std::numeric_limits<T>::epsilon() ); - CPPUNIT_ASSERT( std::abs(t4 - std::sqrt(static_cast<typename tvmet::Traits<T>::float_type>(14))) - < std::numeric_limits<T>::epsilon() ); - - r = v1/norm2(v1); // norm2 is checked before - t5 = normalize(v1); - - CPPUNIT_ASSERT( all_elements(t5 == r) ); -} - - -/* - * min/max functions - */ -template <class T> -void -TestVectorFunctions<T>::extremum() { - CPPUNIT_ASSERT(max(v1) == 3); - CPPUNIT_ASSERT(min(v1) == 1); - - CPPUNIT_ASSERT(max(vBig) == 30); - CPPUNIT_ASSERT(min(vBig) == 10); - - CPPUNIT_ASSERT(maximum(v1).value() == 3); - CPPUNIT_ASSERT(maximum(v1).index() == 2); - - CPPUNIT_ASSERT(minimum(v1).value() == 1); - CPPUNIT_ASSERT(minimum(v1).index() == 0); - - CPPUNIT_ASSERT(maximum(vBig).value() == 30); - CPPUNIT_ASSERT(maximum(vBig).index() == 2); - - CPPUNIT_ASSERT(minimum(vBig).value() == 10); - CPPUNIT_ASSERT(minimum(vBig).index() == 0); -} - - -/***************************************************************************** - * Implementation Part II (specialized for ints) - ****************************************************************************/ - - -/* - * norm on int specialized due to rounding problems - */ -template <> -void -TestVectorFunctions<int>::fn_norm() { - vector_type v2; - v2 = -v1; - - int t1 = norm1(v1); - int t2 = norm1(v2); - CPPUNIT_ASSERT( t1 == sum(v1) ); - CPPUNIT_ASSERT( t2 == sum(v1) ); -} - - -#endif // TVMET_TEST_VECTORFUNC_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/testsuite/TestVectorOperators.h b/tvmet-1.7.1/testsuite/TestVectorOperators.h deleted file mode 100644 index 78e14bfe9..000000000 --- a/tvmet-1.7.1/testsuite/TestVectorOperators.h +++ /dev/null @@ -1,414 +0,0 @@ -/* - * Tiny Vector Matrix Library - * Dense Vector Matrix Libary of Tiny size using Expression Templates - * - * Copyright (C) 2001 - 2003 Olaf Petzold <opetzold@users.sourceforge.net> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id: TestVectorOperators.h,v 1.1 2004/04/24 11:55:15 opetzold Exp $ - */ - -#ifndef TVMET_TEST_VECTORPOS_H -#define TVMET_TEST_VECTORPOS_H - -#include <limits> - -#include <cppunit/extensions/HelperMacros.h> - -#include <tvmet/Vector.h> -#include <tvmet/util/General.h> - -template <class T> -class TestVectorOperators : public CppUnit::TestFixture -{ - CPPUNIT_TEST_SUITE( TestVectorOperators ); - CPPUNIT_TEST( scalarUpdAssign1 ); - CPPUNIT_TEST( scalarUpdAssign2 ); - CPPUNIT_TEST( scalarUpdAssign3 ); - CPPUNIT_TEST( scalarOps1 ); - CPPUNIT_TEST( scalarOps2 ); - CPPUNIT_TEST( globalVectorOps1 ); - CPPUNIT_TEST( globalVectorOps2 ); - CPPUNIT_TEST( globalVectorOps3 ); - CPPUNIT_TEST( negate ); - CPPUNIT_TEST_SUITE_END(); - -private: - typedef tvmet::Vector<T, 3> vector_type; - -public: - TestVectorOperators() - : vZero(0), vOne(1), scalar(10), scalar2(2) { } - -public: // cppunit interface - /** cppunit hook for fixture set up. */ - void setUp(); - - /** cppunit hook for fixture tear down. */ - void tearDown(); - -protected: - void scalarUpdAssign1(); - void scalarUpdAssign2(); - void scalarUpdAssign3(); - void scalarOps1(); - void scalarOps2(); - void globalVectorOps1(); - void globalVectorOps2(); - void globalVectorOps3(); - void negate(); - -private: - const vector_type vZero; - const vector_type vOne; - vector_type v1; - vector_type vBig; /**< vector 10x bigger than v1 */ - -private: - const T scalar; - const T scalar2; -}; - - -/***************************************************************************** - * Implementation Part I (cppunit part) - ****************************************************************************/ - - -template <class T> -void TestVectorOperators<T>::setUp() { - v1 = 1,2,3; - vBig = 10,20,30; -} - - -template <class T> -void TestVectorOperators<T>::tearDown() { } - - -/***************************************************************************** - * Implementation Part II - ****************************************************************************/ - - -/* - * member math operators with scalars; - */ -template <class T> -void -TestVectorOperators<T>::scalarUpdAssign1() { - // all these functions are element wise - vector_type t1(v1), t2(v1), t3(v1), t4(vBig); - - t1 += scalar; - t2 -= scalar; - t3 *= scalar; - t4 /= scalar; - - CPPUNIT_ASSERT(t1(0) == (v1(0)+scalar) && t1(1) == (v1(1)+scalar) && t1(2) == (v1(2)+scalar)); - CPPUNIT_ASSERT(t2(0) == (v1(0)-scalar) && t2(1) == (v1(1)-scalar) && t2(2) == (v1(2)-scalar)); - CPPUNIT_ASSERT( all_elements(t3 == vBig) ); - CPPUNIT_ASSERT( all_elements(t4 == v1) ); -} - - -/* - * member math operators with Vectors - */ -template <class T> -void -TestVectorOperators<T>::scalarUpdAssign2() { - // all these functions are element wise - vector_type t1(v1), t2(v1), t3(v1), t4(v1); - - t1 += v1; - t2 -= v1; - t3 *= v1; - - { - using namespace tvmet::element_wise; - t4 /= v1; - } - - CPPUNIT_ASSERT( all_elements(t1 == 2*v1) ); - CPPUNIT_ASSERT( all_elements(t2 == vZero) ); - CPPUNIT_ASSERT(t3(0) == (v1(0)*v1(0)) && t3(1) == (v1(1)*v1(1)) && t3(2) == (v1(2)*v1(2))); - CPPUNIT_ASSERT( all_elements(t4 == 1) ); -} - - -/* - * member math operators with XprVector - */ -template <class T> -void -TestVectorOperators<T>::scalarUpdAssign3() { - // all these functions are element wise - vector_type t1(v1), t2(v1), t3(v1), t4(v1); - - t1 += T(1)*v1; - t2 -= T(1)*v1; - t3 *= T(1)*v1; - - { - using namespace tvmet::element_wise; - t4 /= T(1)*v1; - } - - CPPUNIT_ASSERT( all_elements(t1 == 2*v1) ); - CPPUNIT_ASSERT( all_elements(t2 == vZero) ); - CPPUNIT_ASSERT(t3(0) == (v1(0)*v1(0)) && t3(1) == (v1(1)*v1(1)) && t3(2) == (v1(2)*v1(2))); - CPPUNIT_ASSERT( all_elements(t4 == vOne) ); -} - - -/* - * global math operators with scalars - * Note: checked against member operators since they are allready checked - */ -template <class T> -void -TestVectorOperators<T>::scalarOps1() { - vector_type r1(v1), r2(v1), r3(v1), r4(vBig); - vector_type t1(0), t2(0), t3(0), t4(0); - - r1 += scalar; - r2 -= scalar; - r3 *= scalar; - r4 /= scalar; - - // all element wise - t1 = v1 + scalar; - t2 = v1 - scalar; - t3 = v1 * scalar; - t4 = vBig / scalar; - - CPPUNIT_ASSERT( all_elements(t1 == r1) ); - CPPUNIT_ASSERT( all_elements(t2 == r2) ); - CPPUNIT_ASSERT( all_elements(t3 == r3) ); - CPPUNIT_ASSERT( all_elements(t4 == r4) ); -} - - -/* - * global math operators with scalars, part II - * Note: checked against member operators since they are allready checked - */ -template <class T> -void -TestVectorOperators<T>::scalarOps2() { - vector_type r1(v1), r2(v1); - vector_type t1(0), t2(0); - - r1 += scalar; - r2 *= scalar; - - // all element wise - t1 = scalar + v1; - t2 = scalar * v1; - - CPPUNIT_ASSERT( all_elements(t1 == r1) ); - CPPUNIT_ASSERT( all_elements(t2 == r2) ); -} - - -/* - * global math operators with vectors - */ -template <class T> -void -TestVectorOperators<T>::globalVectorOps1() { - vector_type r1(v1), r2(v1), r3(v1), r4(v1); - vector_type t1(0), t2(0), t3(0), t4(0); - vector_type v2(v1); - - CPPUNIT_ASSERT( all_elements( v1 == v2) ); - - r1 += v1; - r2 -= v1; - r3 *= v1; - - { - using namespace tvmet::element_wise; - r4 /= v1; - } - - CPPUNIT_ASSERT( all_elements(r2 == T(0)) ); - CPPUNIT_ASSERT( all_elements(r4 == T(1)) ); - - t1 = v1 + v2; - t2 = v1 - v2; - t3 = v1 * v2; - - { - using namespace tvmet::element_wise; - t4 = v1 / v1; - } - - CPPUNIT_ASSERT( all_elements(t1 == r1) ); - CPPUNIT_ASSERT( all_elements(t2 == r2) ); - CPPUNIT_ASSERT( all_elements(t3 == r3) ); - CPPUNIT_ASSERT( all_elements(t4 == r4) ); -} - - -/* - * global math operators with vectors and xpr - */ -template <class T> -void -TestVectorOperators<T>::globalVectorOps2() { - vector_type r1(v1), r2(v1), r3(v1), r4(v1); - vector_type t1(0), t2(0), t3(0), t4(0); - vector_type v2(v1); - - CPPUNIT_ASSERT( all_elements( v1 == v2) ); - - r1 += T(1)*v1; - r2 -= T(1)*v1; - r3 *= T(1)*v1; - - { - using namespace tvmet::element_wise; - r4 /= T(1)*v1; - } - - CPPUNIT_ASSERT( all_elements(r2 == T(0)) ); - CPPUNIT_ASSERT( all_elements(r4 == T(1)) ); - - t1 = v1 + T(1)*v2; - t2 = v1 - T(1)*v2; - t3 = v1 * T(1)*v2; - - { - using namespace tvmet::element_wise; - t4 = v1 / ( T(1)*v1 ); - } - - CPPUNIT_ASSERT( all_elements(t1 == r1) ); - CPPUNIT_ASSERT( all_elements(t2 == r2) ); - CPPUNIT_ASSERT( all_elements(t3 == r3) ); - CPPUNIT_ASSERT( all_elements(t4 == r4) ); -} - - -/* - * global math operators with vectors with xpr - */ -template <class T> -void -TestVectorOperators<T>::globalVectorOps3() { - vector_type r1(v1), r2(v1), r3(v1), r4(v1); - vector_type t1(0), t2(0), t3(0), t4(0); - vector_type v2(v1); - - CPPUNIT_ASSERT( all_elements( v1 == v2) ); - - r1 += T(1)*v1; - r2 -= T(1)*v1; - r3 *= T(1)*v1; - - { - using namespace tvmet::element_wise; - r4 /= T(1)*v1; - } - - CPPUNIT_ASSERT( all_elements(r2 == T(0)) ); - CPPUNIT_ASSERT( all_elements(r4 == T(1)) ); - - t1 = (T(1)*v1) + v2; - t2 = (T(1)*v1) - v2; - t3 = (T(1)*v1) * v2; - - { - using namespace tvmet::element_wise; - t4 = (T(1)*v1) / v1; - } - - CPPUNIT_ASSERT( all_elements(t1 == r1) ); - CPPUNIT_ASSERT( all_elements(t2 == r2) ); - CPPUNIT_ASSERT( all_elements(t3 == r3) ); - CPPUNIT_ASSERT( all_elements(t4 == r4) ); -} - - -/* - * negate operators - */ -template <class T> -void -TestVectorOperators<T>::negate() { - vector_type v2; - - v2 = -vOne; - - CPPUNIT_ASSERT( all_elements(v2 == T(-1)) ); -} - - -/***************************************************************************** - * Implementation Part II (specialized for ints) - ****************************************************************************/ - - -/* - * member math operators with scalars - */ -template <> -void -TestVectorOperators<int>::scalarUpdAssign1() { - // all these functions are element wise - vector_type t1(v1), t2(v1), t3(v1), t4(vBig); - vector_type t5(v1), t6(vBig), t7(vBig), t8(vBig), t9(vBig); - vector_type t10(v1), t11(v1); - - t1 += scalar; - t2 -= scalar; - t3 *= scalar; - t4 /= scalar; - - t5 %= scalar; - t6 %= scalar; - t7 ^= scalar; - t8 &= scalar; - t9 |= scalar; - t10 <<= scalar; - t11 >>= scalar2; - - CPPUNIT_ASSERT(t1(0) == (v1(0)+scalar) && t1(1) == (v1(1)+scalar) && t1(2) == (v1(2)+scalar)); - CPPUNIT_ASSERT(t2(0) == (v1(0)-scalar) && t2(1) == (v1(1)-scalar) && t2(2) == (v1(2)-scalar)); - CPPUNIT_ASSERT( all_elements(t3 == vBig) ); - CPPUNIT_ASSERT( all_elements(t4 == v1) ); - CPPUNIT_ASSERT( all_elements(t5 == v1) ); - CPPUNIT_ASSERT( all_elements(t6 == vZero) ); - CPPUNIT_ASSERT(t7(0) == (vBig(0)^scalar) && t7(1) == (vBig(1)^scalar) && t7(2) == (vBig(2)^scalar) ); - CPPUNIT_ASSERT(t8(0) == (vBig(0)&scalar) && t8(1) == (vBig(1)&scalar) && t8(2) == (vBig(2)&scalar) ); - CPPUNIT_ASSERT(t9(0) == (vBig(0)|scalar) && t9(1) == (vBig(1)|scalar) && t9(2) == (vBig(2)|scalar) ); - CPPUNIT_ASSERT(t10(0) == (v1(0)<<scalar) && t10(1) == (v1(1)<<scalar) && t10(2) == (v1(2)<<scalar) ); - CPPUNIT_ASSERT(t11(0) == (v1(0)>>scalar2) && t11(1) == (v1(1)>>scalar2) && t11(2) == (v1(2)>>scalar2) ); -} - -/* - * TODO: implement other UpdAssign functions, esp. for bit ops - * (since functions above are working, all others should work) - */ - - -#endif // TVMET_TEST_VECTORPOS_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/testsuite/TestXpr.h b/tvmet-1.7.1/testsuite/TestXpr.h deleted file mode 100644 index ce472fd38..000000000 --- a/tvmet-1.7.1/testsuite/TestXpr.h +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Tiny Vector Matrix Library - * Dense Vector Matrix Libary of Tiny size using Expression Templates - * - * Copyright (C) 2001 - 2003 Olaf Petzold <opetzold@users.sourceforge.net> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id: TestXpr.h,v 1.1 2004/04/24 11:55:15 opetzold Exp $ - */ - -#ifndef TVMET_TEST_XPR_H -#define TVMET_TEST_XPR_H - -#include <cppunit/extensions/HelperMacros.h> - -#include <tvmet/Vector.h> -#include <tvmet/Matrix.h> -#include <tvmet/util/General.h> - -template <class T> -class TestXpr : public CppUnit::TestFixture -{ - CPPUNIT_TEST_SUITE( TestXpr ); - CPPUNIT_TEST( fn_MMProd ); - CPPUNIT_TEST( fn_MMMProd ); - CPPUNIT_TEST( fn_MVProd ); - CPPUNIT_TEST( op_MMProd ); - CPPUNIT_TEST( op_MMMProd ); - CPPUNIT_TEST( op_MVProd ); - CPPUNIT_TEST_SUITE_END(); - -private: - typedef tvmet::Vector<T, 3> vector_type; - typedef tvmet::Matrix<T, 3, 3> matrix_type; - -public: - TestXpr() - : vZero(0), vOne(1), mZero(0), mOne(1), scalar(10) { } - -public: // cppunit interface - /** cppunit hook for fixture set up. */ - void setUp(); - - /** cppunit hook for fixture tear down. */ - void tearDown(); - -protected: - void fn_MMProd(); - void fn_MMMProd(); - void fn_MVProd(); - void op_MMProd(); - void op_MMMProd(); - void op_MVProd(); - -private: - const vector_type vZero; - const vector_type vOne; - vector_type v1, v1b; - vector_type vBig; /**< vector 10x bigger than v1 */ - -private: - const matrix_type mZero; - const matrix_type mOne; - matrix_type m1, m1b; - matrix_type mBig; /**< matrix 10x bigger than m1 */ - -private: - const T scalar; -}; - -/***************************************************************************** - * Implementation part I (cppunit part) - ****************************************************************************/ - -template <class T> -void TestXpr<T>::setUp() { - v1 = 1,2,3; - v1b = v1; - vBig = 10,20,30; - - m1 = 1,4,7, - 2,5,8, - 3,6,9; - m1b = m1; - mBig = 10,40,70, - 20,50,80, - 30,60,90; -} - -template <class T> -void TestXpr<T>::tearDown() { } - -/***************************************************************************** - * Implementation part II - ****************************************************************************/ - -/* - * XprMatrix - XprMatrix - */ -template <class T> -void -TestXpr<T>::fn_MMProd() { - matrix_type mr1(0), mr2(0), mr(0); - matrix_type m; - - tvmet::util::Gemm(m1, mOne, mr1); - tvmet::util::Gemm(m1, mOne, mr2); - tvmet::util::Gemm(mr1, mr2, mr); - - // XprMatrix * XprMatrix - m = prod(prod(m1,mOne), prod(m1,mOne)); - - CPPUNIT_ASSERT( all_elements(mr == m) ); -} - -/* - * Matrix - XprMatrix - XprMatrix - */ -template <class T> -void -TestXpr<T>::fn_MMMProd() { - matrix_type m; - matrix_type rhs(0), r(0); - - tvmet::util::Gemm(m1, m1, rhs); - tvmet::util::Gemm(m1, rhs, r); - - // Matrix * XprMatrix * XprMatrix - m = prod(m1, prod(m1, m1)); - - CPPUNIT_ASSERT( all_elements(r == m) ); -} - -/* - * XprMatrix - XprVector - */ -template <class T> -void -TestXpr<T>::fn_MVProd() { - matrix_type mr1(0); - vector_type vr(0), v; - - tvmet::util::Gemm(m1, mOne, mr1); - tvmet::util::Gemv(mr1, v1, vr); - - // XprMatrix * XprVector - v = prod(prod(m1,mOne), mul(v1,vOne)); - - CPPUNIT_ASSERT( all_elements(vr == v) ); -} - -/* - * XprMatrix - XprMatrix - */ -template <class T> -void -TestXpr<T>::op_MMProd() { - matrix_type mr1(0), mr2(0), mr(0), m; - - tvmet::util::Gemm(m1, mOne, mr1); - tvmet::util::Gemm(m1, mOne, mr2); - tvmet::util::Gemm(mr1, mr2, mr); - - // XprMatrix * XprMatrix - m = (m1*mOne)*(m1*mOne); - - CPPUNIT_ASSERT( all_elements(mr == m) ); -} - -/* - * Matrix - XprMatrix - XprMatrix - */ -template <class T> -void -TestXpr<T>::op_MMMProd() { - matrix_type m; - matrix_type rhs(0), r(0); - - tvmet::util::Gemm(m1, m1, rhs); - tvmet::util::Gemm(m1, rhs, r); - - // Matrix * XprMatrix * XprMatrix - m = m1 * m1 * m1; - - CPPUNIT_ASSERT( all_elements(r == m) ); -} - -/* - * XprMatrix - XprVector - */ -template <class T> -void -TestXpr<T>::op_MVProd() { - matrix_type mr1(0); - vector_type vr(0), v; - - tvmet::util::Gemm(m1, mOne, mr1); - tvmet::util::Gemv(mr1, v1, vr); - - // XprMatrix * XprVector - v = (m1*mOne)*(v1*vOne); - - CPPUNIT_ASSERT( all_elements(vr == v) ); -} - -#endif // TVMET_TEST_XPR_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/testsuite/TestXprMatrixFunctions.h b/tvmet-1.7.1/testsuite/TestXprMatrixFunctions.h deleted file mode 100644 index c0d53df3c..000000000 --- a/tvmet-1.7.1/testsuite/TestXprMatrixFunctions.h +++ /dev/null @@ -1,562 +0,0 @@ -/* - * Tiny Vector Matrix Library - * Dense Vector Matrix Libary of Tiny size using Expression Templates - * - * Copyright (C) 2001 - 2003 Olaf Petzold <opetzold@users.sourceforge.net> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id: TestXprMatrixFunctions.h,v 1.1 2004/04/24 11:55:15 opetzold Exp $ - */ - -#ifndef TVMET_TEST_XPR_MATRIXFUNC_H -#define TVMET_TEST_XPR_MATRIXFUNC_H - -#include <cppunit/extensions/HelperMacros.h> - -#include <tvmet/Vector.h> -#include <tvmet/Matrix.h> -#include <tvmet/util/General.h> - -template <class T> -class TestXprMatrixFunctions : public CppUnit::TestFixture -{ - CPPUNIT_TEST_SUITE( TestXprMatrixFunctions ); - CPPUNIT_TEST( scalarFuncs1 ); - CPPUNIT_TEST( scalarFuncs2 ); - CPPUNIT_TEST( globalXprMatrixFuncs1 ); - CPPUNIT_TEST( globalXprMatrixFuncs2 ); - CPPUNIT_TEST( globalXprMatrixFuncs3 ); - CPPUNIT_TEST( fn_prod1 ); - CPPUNIT_TEST( fn_prod2 ); - CPPUNIT_TEST( fn_prod3 ); - CPPUNIT_TEST( fn_trans ); - CPPUNIT_TEST( fn_MtM_prod ); - CPPUNIT_TEST( fn_MMt_prod ); - CPPUNIT_TEST( fn_prodTrans ); - CPPUNIT_TEST( fn_trace ); - CPPUNIT_TEST( rowVector1 ); - CPPUNIT_TEST( rowVector2 ); - CPPUNIT_TEST( colVector1 ); - CPPUNIT_TEST( colVector2 ); - CPPUNIT_TEST( fn_diag1 ); - CPPUNIT_TEST( fn_diag2 ); - CPPUNIT_TEST_SUITE_END(); - -private: - typedef tvmet::Vector<T, 3> vector_type; - typedef tvmet::Matrix<T, 3, 3> matrix_type; - -public: - TestXprMatrixFunctions() - : mZero(0), mOne(1), scalar(10), scalar2(2) { } - -public: // cppunit interface - /** cppunit hook for fixture set up. */ - void setUp(); - - /** cppunit hook for fixture tear down. */ - void tearDown(); - -protected: - void scalarFuncs1(); - void scalarFuncs2(); - void globalXprMatrixFuncs1(); - void globalXprMatrixFuncs2(); - void globalXprMatrixFuncs3(); - void fn_prod1(); - void fn_prod2(); - void fn_prod3(); - void fn_trans(); - void fn_MtM_prod(); - void fn_MMt_prod(); - void fn_prodTrans(); - void fn_trace(); - void rowVector1(); - void rowVector2(); - void colVector1(); - void colVector2(); - void fn_diag1(); - void fn_diag2(); - -private: - const matrix_type mZero; - const matrix_type mOne; - matrix_type m1; - matrix_type mBig; /**< matrix 10x bigger than m1 */ - -private: - vector_type m1_r0, m1_r1, m1_r2; // row vectors - vector_type m1_c0, m1_c1, m1_c2; // col vectors - -private: - const T scalar; - const T scalar2; -}; - - -/***************************************************************************** - * Implementation Part I (cppunit part) - *** *************************************************************************/ - - -template <class T> -void TestXprMatrixFunctions<T>::setUp() { - m1 = 1,4,7, - 2,5,8, - 3,6,9; - - m1_r0 = 1,4,7; - m1_r1 = 2,5,8; - m1_r2 = 3,6,9; - - m1_c0 = 1,2,3; - m1_c1 = 4,5,6; - m1_c2 = 7,8,9; - - mBig = 10,40,70, - 20,50,80, - 30,60,90; -} - - -template <class T> -void TestXprMatrixFunctions<T>::tearDown() { } - - -/***************************************************************************** - * Implementation Part II - ****************************************************************************/ - - -/* - * global math operators with scalars - * Note: checked against member operators since they are allready checked - */ -template <class T> -void -TestXprMatrixFunctions<T>::scalarFuncs1() { - matrix_type r1(m1), r2(m1); - matrix_type t1(0), t2(0), t3(0), t4(0); - - r1 += scalar; - r2 -= scalar; - - t1 = add(T(1)*m1, scalar); - t2 = sub(T(1)*m1, scalar); - t3 = mul(T(1)*m1, scalar); - t4 = div(T(1)*mBig, scalar); - - CPPUNIT_ASSERT( all_elements(t1 == r1) ); - CPPUNIT_ASSERT( all_elements(t2 == r2) ); - CPPUNIT_ASSERT( all_elements(t3 == mBig) ); - CPPUNIT_ASSERT( all_elements(t4 == m1) ); -} - - -/* - * global math operators with scalars, part II - * Note: checked against member operators since they are allready checked - */ -template <class T> -void -TestXprMatrixFunctions<T>::scalarFuncs2() { - matrix_type r1(m1), r2(m1); - matrix_type t1(0), t2(0); - - r1 += scalar; - r2 *= scalar; - - t1 = add(scalar, T(1)*m1); - t2 = mul(scalar, T(1)*m1); - - CPPUNIT_ASSERT( all_elements(t1 == r1) ); - CPPUNIT_ASSERT( all_elements(t2 == r2) ); -} - - -/* - * global math operators with matrizes - */ -template <class T> -void -TestXprMatrixFunctions<T>::globalXprMatrixFuncs1() { - matrix_type t1(0), t2(0), t3(0), t4(0); - matrix_type m2(m1); - - t1 = add(T(1)*m1, T(1)*m2); - t2 = sub(T(1)*m1, T(1)*m2); - - { - using namespace tvmet::element_wise; - - t3 = mul(T(1)*m1, T(1)*mOne); - t4 = div(T(1)*m1, T(1)*mOne); - } - - CPPUNIT_ASSERT( all_elements(t1 == 2*m1) ); - CPPUNIT_ASSERT( all_elements(t2 == T(0)) ); - CPPUNIT_ASSERT( all_elements(t3 == m1) ); - CPPUNIT_ASSERT( all_elements(t4 == m1) ); -} - - -/* - * global math operators with matrizes and xpr - */ -template <class T> -void -TestXprMatrixFunctions<T>::globalXprMatrixFuncs2() { - matrix_type r1(m1), r2(m1), r3(m1), r4(m1); - matrix_type t1(0), t2(0), t3(0), t4(0); - matrix_type m2(m1); - - r1 += T(1)*m1; - r2 -= T(1)*m1; - - { - using namespace tvmet::element_wise; - - r3 *= T(1)*m1; - r4 /= T(1)*m1; - } - - CPPUNIT_ASSERT( all_elements(r2 == T(0)) ); - CPPUNIT_ASSERT( all_elements(r4 == T(1)) ); - - t1 = add(T(1)*m1, m2*T(1)); - t2 = sub(T(1)*m1, m2*T(1)); - - { - using namespace tvmet::element_wise; - - t3 = mul(T(1)*m1, m2*T(1)); - t4 = div(T(1)*m1, m2*T(1)); - } - - CPPUNIT_ASSERT( all_elements(t1 == r1) ); - CPPUNIT_ASSERT( all_elements(t2 == r2) ); - CPPUNIT_ASSERT( all_elements(t3 == r3) ); - CPPUNIT_ASSERT( all_elements(t4 == r4) ); -} - - -/* - * global math operators with matrizes and xpr - */ -template <class T> -void -TestXprMatrixFunctions<T>::globalXprMatrixFuncs3() { - matrix_type r1(m1), r2(m1), r3(m1), r4(m1); - matrix_type t1(0), t2(0), t3(0), t4(0); - matrix_type m2(m1); - - r1 += T(1)*m1; - r2 -= T(1)*m1; - - { - using namespace tvmet::element_wise; - - r3 *= T(1)*m1; - r4 /= T(1)*m1; - } - - CPPUNIT_ASSERT( all_elements(r2 == T(0)) ); - CPPUNIT_ASSERT( all_elements(r4 == T(1)) ); - - t1 = add(T(1)*m1, m2*T(1)); - t2 = sub(T(1)*m1, m2*T(1)); - - { - using namespace tvmet::element_wise; - - t3 = mul(T(1)*m1, m2*T(1)); - t4 = div(T(1)*m1, m2*T(1)); - } - - CPPUNIT_ASSERT( all_elements(t1 == r1) ); - CPPUNIT_ASSERT( all_elements(t2 == r2) ); - CPPUNIT_ASSERT( all_elements(t3 == r3) ); - CPPUNIT_ASSERT( all_elements(t4 == r4) ); -} - - -/* - * product functions with matrizes - */ -template <class T> -void -TestXprMatrixFunctions<T>::fn_prod1() { - matrix_type t1, t2, t3; - matrix_type r1, r2, r3; - matrix_type m2(m1); - - tvmet::util::Gemm(m1, m1, r1); - tvmet::util::Gemm(m1, mBig, r2); - tvmet::util::Gemm(mBig, m1, r3); - CPPUNIT_ASSERT( all_elements(r2 == r3) ); - - t1 = prod(T(1)*m1, T(1)*m2); - CPPUNIT_ASSERT( all_elements(t1 == r1) ); - - t2 = prod(T(1)*m1, T(1)*mBig); - CPPUNIT_ASSERT( all_elements(t2 == r2) ); - - t3 = prod(T(1)*mBig, T(1)*m1); - CPPUNIT_ASSERT( all_elements(t3 == r3) ); -} - - -/* - * product functions with matrizes and xpr - * Note: Take care on aliasing! - */ -template <class T> -void -TestXprMatrixFunctions<T>::fn_prod2() { - matrix_type r1(0), rm(0); - matrix_type m2(m1); - matrix_type t1; - - rm = scalar*m1; - - tvmet::util::Gemm(m1, rm, r1); - - t1 = prod(T(1)*m1, scalar*m2 /* alias mBig */); - CPPUNIT_ASSERT( all_elements(t1 == r1) ); -} - - -/* - * product functions with matrizes - * Note: Take care on aliasing! - */ -template <class T> -void -TestXprMatrixFunctions<T>::fn_prod3() { - matrix_type r1(0), rm(0); - matrix_type m2(m1); - matrix_type t1; - - rm = scalar*m1; - - tvmet::util::Gemm(rm, m1, r1); - - t1 = prod(scalar*m1 /* alias mBig */, T(1)*m2); - CPPUNIT_ASSERT( all_elements(t1 == r1) ); -} - - -/* - * transpose functions with matrizes - */ -template <class T> -void -TestXprMatrixFunctions<T>::fn_trans() { - matrix_type t1, t2; - - t1 = trans(T(1)*m1); - CPPUNIT_ASSERT( any_elements(t1 == m1) ); // XXX not very clever - - t2 = trans(T(1)*t1); // transpose back - CPPUNIT_ASSERT( all_elements(t2 == m1) ); -} - - -/* - * matrix function M^T * M - */ -template <class T> -void -TestXprMatrixFunctions<T>::fn_MtM_prod() { - matrix_type m1t, r1; - matrix_type m2; - - // trans() and prod() is checked before! - m1t = trans(m1); - r1 = prod(m1t, mBig); - - m2 = MtM_prod(T(1)*m1, T(1)*mBig); - - CPPUNIT_ASSERT( all_elements(r1 == m2) ); -} - - -/* - * matrix function M * M^T - */ -template <class T> -void -TestXprMatrixFunctions<T>::fn_MMt_prod() { - matrix_type m1t, r1; - matrix_type m2; - - // trans() and prod() is checked before! - m1t = trans(m1); - r1 = prod(mBig, m1t); - - m2 = MMt_prod(T(1)*mBig, T(1)*m1); - - CPPUNIT_ASSERT( all_elements(r1 == m2) ); -} - - -/* - * matrix function (M * M)^T - */ -template <class T> -void -TestXprMatrixFunctions<T>::fn_prodTrans() { - matrix_type r1, r1t; - matrix_type m2; - - // trans() and prod() is checked before! - r1 = prod(m1, mBig); - r1t = trans(r1); - - m2 = trans_prod(T(1)*m1, T(1)*mBig); - - CPPUNIT_ASSERT( all_elements(r1t == m2) ); -} - - -/* - * trace - */ -template <class T> -void -TestXprMatrixFunctions<T>::fn_trace() { -// declaration on trace not yet. -// T t1 = trace(T(1)*m1); -// T t2 = trace(T(1)*mBig); - -// CPPUNIT_ASSERT( t1 == (m1(0,0)+m1(1,1)+m1(2,2)) ); -// CPPUNIT_ASSERT( t2 == (mBig(0,0)+mBig(1,1)+mBig(2,2)) ); -} - - -/* - * matrix row vector I - */ -template <class T> -void -TestXprMatrixFunctions<T>::rowVector1() { - vector_type r0, r1, r2; - - r0 = row(m1+m1, 0); - r1 = row(m1+m1, 1); - r2 = row(m1+m1, 2); - - CPPUNIT_ASSERT( all_elements(r0 == 2*m1_r0) ); - CPPUNIT_ASSERT( all_elements(r1 == 2*m1_r1) ); - CPPUNIT_ASSERT( all_elements(r2 == 2*m1_r2) ); -} - - -/* - * matrix row vector II - * g++ produce wrong results only for row0 - */ -template <class T> -void -TestXprMatrixFunctions<T>::rowVector2() { - vector_type r0, r1, r2; - - r0 = row(T(1)*m1, 0); - r1 = row(T(1)*m1, 1); - r2 = row(T(1)*m1, 2); - - CPPUNIT_ASSERT( all_elements(r0 == m1_r0) ); - CPPUNIT_ASSERT( all_elements(r1 == m1_r1) ); - CPPUNIT_ASSERT( all_elements(r2 == m1_r2) ); -} - - -/* - * matrix col vector I - */ -template <class T> -void -TestXprMatrixFunctions<T>::colVector1() { - vector_type c0, c1, c2; - - c0 = col(m1+m1, 0); - c1 = col(m1+m1, 1); - c2 = col(m1+m1, 2); - - CPPUNIT_ASSERT( all_elements(c0 == 2*m1_c0) ); - CPPUNIT_ASSERT( all_elements(c1 == 2*m1_c1) ); - CPPUNIT_ASSERT( all_elements(c2 == 2*m1_c2) ); -} - - -/* - * matrix col vector II - * g++ produce wrong results only for col0 - */ -template <class T> -void -TestXprMatrixFunctions<T>::colVector2() { - vector_type c0, c1, c2; - - c0 = col(T(1)*m1, 0); - c1 = col(T(1)*m1, 1); - c2 = col(T(1)*m1, 2); - - CPPUNIT_ASSERT( all_elements(c0 == m1_c0) ); - CPPUNIT_ASSERT( all_elements(c1 == m1_c1) ); - CPPUNIT_ASSERT( all_elements(c2 == m1_c2) ); -} - - -/* - * matrix diag vector I - */ -template <class T> -void -TestXprMatrixFunctions<T>::fn_diag1() { - vector_type r, v; - - r = 2*diag(m1); - - v = diag(m1+m1); - - CPPUNIT_ASSERT( all_elements(r == v) ); -} - - -/* - * matrix diag vector II - * g++ produce wrong results opposite to diag1 - */ -template <class T> -void -TestXprMatrixFunctions<T>::fn_diag2() { - vector_type r, v; - - r = diag(m1); - - v = diag(T(1)*m1); - - CPPUNIT_ASSERT( all_elements(r == v) ); -} - - -#endif // TVMET_TEST_XPR_MATRIXFUNC_H - - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/testsuite/TestXprMatrixOperators.h b/tvmet-1.7.1/testsuite/TestXprMatrixOperators.h deleted file mode 100644 index 3a5691c2a..000000000 --- a/tvmet-1.7.1/testsuite/TestXprMatrixOperators.h +++ /dev/null @@ -1,228 +0,0 @@ -/* - * Tiny Vector Matrix Library - * Dense Vector Matrix Libary of Tiny size using Expression Templates - * - * Copyright (C) 2001 - 2003 Olaf Petzold <opetzold@users.sourceforge.net> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id: TestXprMatrixOperators.h,v 1.1 2004/04/24 11:55:15 opetzold Exp $ - */ - -#ifndef TVMET_TEST_XPR_MATRIXOPS_H -#define TVMET_TEST_XPR_MATRIXOPS_H - -#include <cppunit/extensions/HelperMacros.h> - -#include <tvmet/Vector.h> -#include <tvmet/Matrix.h> -#include <tvmet/util/General.h> - -template <class T> -class TestXprMatrixOperators : public CppUnit::TestFixture -{ - CPPUNIT_TEST_SUITE( TestXprMatrixOperators ); - CPPUNIT_TEST( scalarOps1 ); - CPPUNIT_TEST( scalarOps2 ); - CPPUNIT_TEST( globalMatrixOps ); - CPPUNIT_TEST( negate ); - CPPUNIT_TEST( prodOps ); - CPPUNIT_TEST_SUITE_END(); - -private: - typedef tvmet::Vector<T, 3> vector_type; - typedef tvmet::Matrix<T, 3, 3> matrix_type; - -public: - TestXprMatrixOperators() - : mZero(0), mOne(1), scalar(10), scalar2(2) { } - -public: // cppunit interface - /** cppunit hook for fixture set up. */ - void setUp(); - - /** cppunit hook for fixture tear down. */ - void tearDown(); - -protected: - void scalarOps1(); - void scalarOps2(); - void globalMatrixOps(); - void negate(); - void prodOps(); - -private: - const matrix_type mZero; - const matrix_type mOne; - matrix_type m1; - matrix_type mBig; /**< matrix 10x bigger than m1 */ - -private: - vector_type m1_r0, m1_r1, m1_r2; // row vectors - vector_type m1_c0, m1_c1, m1_c2; // col vectors - -private: - const T scalar; - const T scalar2; -}; - -/***************************************************************************** - * Implementation Part I (cppunit part) - ****************************************************************************/ - -template <class T> -void TestXprMatrixOperators<T>::setUp() { - m1 = 1,4,7, - 2,5,8, - 3,6,9; - - m1_r0 = 1,4,7; - m1_r1 = 2,5,8; - m1_r2 = 3,6,9; - - m1_c0 = 1,2,3; - m1_c1 = 4,5,6; - m1_c2 = 7,8,9; - - mBig = 10,40,70, - 20,50,80, - 30,60,90; -} - -template <class T> -void TestXprMatrixOperators<T>::tearDown() { } - -/***************************************************************************** - * Implementation Part II - ****************************************************************************/ - - -/* - * global math operators with scalars - * Note: checked against member operators since they are allready checked - */ -template <class T> -void -TestXprMatrixOperators<T>::scalarOps1() { - matrix_type r1(m1), r2(m1); - matrix_type t1(0), t2(0), t3(0), t4(0); - - r1 += scalar; - r2 -= scalar; - - t1 = T(1)*m1 + scalar; - t2 = T(1)*m1 - scalar; - t3 = T(1)*m1 * scalar; - t4 = T(1)*mBig / scalar; - - CPPUNIT_ASSERT( all_elements(t1 == r1) ); - CPPUNIT_ASSERT( all_elements(t2 == r2) ); - CPPUNIT_ASSERT( all_elements(t3 == mBig) ); - CPPUNIT_ASSERT( all_elements(t4 == m1) ); -} - - -/* - * global math operators with scalars, part II - * Note: checked against member operators since they are allready checked - */ -template <class T> -void -TestXprMatrixOperators<T>::scalarOps2() { - matrix_type r1(m1), r2(m1); - matrix_type t1(0), t2(0); - - r1 += scalar; - r2 *= scalar; - - t1 = scalar + T(1)*m1; - t2 = scalar * (T(1)*m1); - - CPPUNIT_ASSERT( all_elements(t1 == r1) ); - CPPUNIT_ASSERT( all_elements(t2 == r2) ); -} - - -/* - * global math operators with matrizes - */ -template <class T> -void -TestXprMatrixOperators<T>::globalMatrixOps() { - matrix_type t1(0), t2(0), t3(0), t4(0); - - t1 = T(1)*m1 + T(1)*m1; - t2 = T(1)*m1 - T(1)*m1; - - { - using namespace tvmet::element_wise; - - //t3 = m1 * mOne; // overloaded by global op*() - t4 = T(1)*m1 / (T(1)*mOne); - } - - CPPUNIT_ASSERT( all_elements(t1 == 2*m1) ); - CPPUNIT_ASSERT( all_elements(t2 == T(0)) ); - //CPPUNIT_ASSERT( all_elements(t3 == m1) ); - CPPUNIT_ASSERT( all_elements(t4 == m1) ); -} - - -/* - * negate operators with matrizes - */ -template <class T> -void -TestXprMatrixOperators<T>::negate() { - matrix_type m1; - - m1 = -(T(1)*mOne); - - CPPUNIT_ASSERT( all_elements(m1 == T(-1)) ); -} - - -/* - * product functions with matrizes - * Note: Take care on aliasing! - */ -template <class T> -void -TestXprMatrixOperators<T>::prodOps() { - matrix_type t1, t2, t3; - matrix_type r1, r2, r3; - matrix_type m2(m1);; - - tvmet::util::Gemm(m1, m1, r1); - tvmet::util::Gemm(m1, mBig, r2); - tvmet::util::Gemm(mBig, m1, r3); - CPPUNIT_ASSERT( all_elements(r2 == r3) ); - - t1 = (T(1)*m1) * (T(1)*m2); - CPPUNIT_ASSERT( all_elements(t1 == r1) ); - - t2 = (T(1)*m1) * (T(1)*mBig); - CPPUNIT_ASSERT( all_elements(t2 == r2) ); - - t3 = (T(1))*mBig * (T(1)*m1); - CPPUNIT_ASSERT( all_elements(t3 == r3) ); -} - - -#endif // TVMET_TEST_XPR_MATRIXOPS_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/testsuite/TestXprVectorFunctions.h b/tvmet-1.7.1/testsuite/TestXprVectorFunctions.h deleted file mode 100644 index b1f1aa37b..000000000 --- a/tvmet-1.7.1/testsuite/TestXprVectorFunctions.h +++ /dev/null @@ -1,324 +0,0 @@ -/* - * Tiny Vector Matrix Library - * Dense Vector Matrix Libary of Tiny size using Expression Templates - * - * Copyright (C) 2001 - 2003 Olaf Petzold <opetzold@users.sourceforge.net> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id: TestXprVectorFunctions.h,v 1.2 2005/03/25 07:12:07 opetzold Exp $ - */ - -#ifndef TVMET_TEST_XPR_VECTORFUNC_H -#define TVMET_TEST_XPR_VECTORFUNC_H - -#include <limits> - -#include <cppunit/extensions/HelperMacros.h> - -#include <tvmet/Vector.h> -#include <tvmet/util/General.h> - -template <class T> -class TestXprVectorFunctions : public CppUnit::TestFixture -{ - CPPUNIT_TEST_SUITE( TestXprVectorFunctions ); - CPPUNIT_TEST( scalarFuncs1 ); - CPPUNIT_TEST( scalarFuncs2 ); - CPPUNIT_TEST( globalXprVectorFuncs ); - CPPUNIT_TEST( fn_sum ); - CPPUNIT_TEST( fn_product ); - CPPUNIT_TEST( fn_dot ); - CPPUNIT_TEST( fn_cross ); - CPPUNIT_TEST( fn_norm ); - CPPUNIT_TEST_SUITE_END(); - -private: - typedef tvmet::Vector<T, 3> vector_type; - -public: - TestXprVectorFunctions() - : vZero(0), vOne(1), scalar(10), scalar2(2) { } - -public: // cppunit interface - /** cppunit hook for fixture set up. */ - void setUp(); - - /** cppunit hook for fixture tear down. */ - void tearDown(); - -protected: - void scalarFuncs1(); - void scalarFuncs2(); - void globalXprVectorFuncs(); - void fn_sum(); - void fn_product(); - void fn_dot(); - void fn_cross(); - void fn_norm(); - -private: - const vector_type vZero; - const vector_type vOne; - vector_type v1; - vector_type vBig; /**< vector 10x bigger than v1 */ - -private: - const T scalar; - const T scalar2; -}; - - -/***************************************************************************** - * Implementation Part I (cppunit part) - ****************************************************************************/ - - -template <class T> -void TestXprVectorFunctions<T>::setUp() { - v1 = 1,2,3; - vBig = 10,20,30; -} - - -template <class T> -void TestXprVectorFunctions<T>::tearDown() { } - - -/***************************************************************************** - * Implementation Part II - ****************************************************************************/ - - -/* - * global math operators with scalars - * function(XprVector, scalar) - */ -template <class T> -void -TestXprVectorFunctions<T>::scalarFuncs1() { - vector_type r1(v1), r2(v1), r3(v1), r4(vBig); - vector_type t1(0), t2(0), t3(0), t4(0); - - r1 += scalar; - r2 -= scalar; - r3 *= scalar; - r4 /= scalar; - - // all element wise - t1 = add(T(1)*v1, scalar); - t2 = sub(T(1)*v1, scalar); - t3 = mul(T(1)*v1, scalar); - t4 = div(T(1)*vBig, scalar); - - CPPUNIT_ASSERT( all_elements(t1 == r1) ); - CPPUNIT_ASSERT( all_elements(t2 == r2) ); - CPPUNIT_ASSERT( all_elements(t3 == r3) ); - CPPUNIT_ASSERT( all_elements(t4 == r4) ); -} - - -/* - * global math operators with scalars, part II - * function(scalar, XprVector) - */ -template <class T> -void -TestXprVectorFunctions<T>::scalarFuncs2() { - vector_type r1(v1), r2(v1); - vector_type t1(0), t2(0); - - r1 += scalar; - r2 *= scalar; - - // all element wise - t1 = add(scalar, T(1)*v1); - t2 = mul(scalar, T(1)*v1); - CPPUNIT_ASSERT( all_elements(t1 == r1) ); - CPPUNIT_ASSERT( all_elements(t2 == r2) ); -} - - -/* - * global math operators with xpr vectors (using functions) - */ -template <class T> -void -TestXprVectorFunctions<T>::globalXprVectorFuncs() { - vector_type r1(v1), r2(v1), r3(v1), r4(v1); - vector_type t1(0), t2(0), t3(0), t4(0); - vector_type v2(v1); - - CPPUNIT_ASSERT( all_elements( v1 == v2) ); - - r1 += v1; - r2 -= v1; - r3 *= v1; - - { - using namespace tvmet::element_wise; - r4 /= v1; - } - - CPPUNIT_ASSERT( all_elements(r2 == T(0)) ); - CPPUNIT_ASSERT( all_elements(r4 == T(1)) ); - - t1 = add(T(1)*v1, T(1)*v2); - t2 = sub(T(1)*v1, T(1)*v2); - t3 = mul(T(1)*v1, T(1)*v2); - t4 = tvmet::element_wise::div(T(1)*v1, T(1)*v2); - - CPPUNIT_ASSERT( all_elements(t1 == r1) ); - CPPUNIT_ASSERT( all_elements(t2 == r2) ); - CPPUNIT_ASSERT( all_elements(t3 == r3) ); - CPPUNIT_ASSERT( all_elements(t4 == r4) ); -} - - -/* - * sum of vector - */ -template <class T> -void -TestXprVectorFunctions<T>::fn_sum() { - T t = sum(scalar*v1); // alias vBig - - CPPUNIT_ASSERT( t == (vBig(0) + vBig(1) + vBig(2))); -} - - -/* - * product of vector - */ -template <class T> -void -TestXprVectorFunctions<T>::fn_product() { - T t = product(scalar*v1); // alias vBig - - CPPUNIT_ASSERT( t == (vBig(0) * vBig(1) * vBig(2))); -} - -/* - * dot product - */ -template <class T> -void -TestXprVectorFunctions<T>::fn_dot() { - vector_type v2(v1); - - T t1 = dot(T(1)*v1, T(1)*v2); - CPPUNIT_ASSERT( t1 == 14 ); - - T t2 = dot(T(1)*v1, T(1)*vBig); - CPPUNIT_ASSERT( t2 == 140 ); - - T t3 = dot(T(1)*v1, T(1)*vOne); - CPPUNIT_ASSERT( t3 == 6 ); - - T t4 = dot(T(1)*v1, T(1)*vZero); - CPPUNIT_ASSERT( t4 == 0 ); - - T t5 = dot(T(1)*v1, vOne); - CPPUNIT_ASSERT( t5 == 6 ); - - T t6 = dot(vOne, T(1)*v1); - CPPUNIT_ASSERT( t6 == 6 ); -} - - -/* - * cross product - */ -template <class T> -void -TestXprVectorFunctions<T>::fn_cross() { - vector_type v2(v1); - - vector_type t1 = cross(T(1)*v1, T(1)*v2); - CPPUNIT_ASSERT( all_elements(t1 == vZero) ); // orthogonal vectors - - vector_type t2 = cross(T(1)*v1, T(1)*vBig); - CPPUNIT_ASSERT( all_elements(t2 == vZero) ); // orthogonal vectors - - const vector_type r(-1,2,-1); - vector_type t3 = cross(T(1)*v1, T(1)*vOne); - CPPUNIT_ASSERT( all_elements(t3 == r) ); - - vector_type t4 = cross(T(1)*v1, T(1)*vZero); - CPPUNIT_ASSERT( all_elements(t4 == vZero) ); - - vector_type t5 = cross(T(1)*v2, v1); // orthogonal - CPPUNIT_ASSERT( all_elements(t5 == vZero) ); - - vector_type t6 = cross(v1, T(1)*v2); // orthogonal - CPPUNIT_ASSERT( all_elements(t6 == vZero) ); -} - - -/* - * norm - * Note: norm2 for ints specialized - */ -template <class T> -void -TestXprVectorFunctions<T>::fn_norm() { - vector_type v2; - vector_type r; - vector_type t5; - - T t1 = norm1(T(1)*v1); - T t2 = norm1(-v1); - T t3 = norm2(T(1)*v1); - T t4 = norm2(-v1); - - CPPUNIT_ASSERT( t1 == sum(v1) ); - CPPUNIT_ASSERT( t2 == sum(v1) ); - CPPUNIT_ASSERT( std::abs(t3 - std::sqrt(static_cast<typename tvmet::Traits<T>::float_type>(14))) - < std::numeric_limits<T>::epsilon() ); - CPPUNIT_ASSERT( std::abs(t4 - std::sqrt(static_cast<typename tvmet::Traits<T>::float_type>(14))) - < std::numeric_limits<T>::epsilon() ); - - r = v1/norm2(v1); // norm2 is checked before - t5 = normalize(T(1)*v1); - - CPPUNIT_ASSERT( all_elements(t5 == r) ); -} - - -/***************************************************************************** - * Implementation Part II (specialized for ints) - ****************************************************************************/ - - -/* - * norm on int specialized due to rounding problems - */ -template <> -void -TestXprVectorFunctions<int>::fn_norm() { - vector_type v2; - - int t1 = norm1(int(1)*v1); - int t2 = norm1(-v1); - CPPUNIT_ASSERT( t1 == sum(v1) ); - CPPUNIT_ASSERT( t2 == sum(v1) ); -} - - -#endif // TVMET_TEST_XPR_VECTORFUNC_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/testsuite/TestXprVectorOperators.h b/tvmet-1.7.1/testsuite/TestXprVectorOperators.h deleted file mode 100644 index 6bf0b2868..000000000 --- a/tvmet-1.7.1/testsuite/TestXprVectorOperators.h +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Tiny Vector Matrix Library - * Dense Vector Matrix Libary of Tiny size using Expression Templates - * - * Copyright (C) 2001 - 2003 Olaf Petzold <opetzold@users.sourceforge.net> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id: TestXprVectorOperators.h,v 1.1 2004/04/24 11:55:15 opetzold Exp $ - */ - -#ifndef TVMET_TEST_XPR_VECTOROPS_H -#define TVMET_TEST_XPR_VECTOROPS_H - -#include <limits> - -#include <cppunit/extensions/HelperMacros.h> - -#include <tvmet/Vector.h> -#include <tvmet/util/General.h> - -template <class T> -class TestXprVectorOperators : public CppUnit::TestFixture -{ - CPPUNIT_TEST_SUITE( TestXprVectorOperators ); - CPPUNIT_TEST( scalarOps1 ); - CPPUNIT_TEST( scalarOps2 ); - CPPUNIT_TEST( globalXprVectorOps ); - CPPUNIT_TEST( negate ); - CPPUNIT_TEST_SUITE_END(); - -private: - typedef tvmet::Vector<T, 3> vector_type; - -public: - TestXprVectorOperators() - : vZero(0), vOne(1), scalar(10), scalar2(2) { } - -public: // cppunit interface - /** cppunit hook for fixture set up. */ - void setUp(); - - /** cppunit hook for fixture tear down. */ - void tearDown(); - -protected: - void scalarOps1(); - void scalarOps2(); - void globalXprVectorOps(); - void negate(); - -private: - const vector_type vZero; - const vector_type vOne; - vector_type v1; - vector_type vBig; /**< vector 10x bigger than v1 */ - -private: - const T scalar; - const T scalar2; -}; - - -/***************************************************************************** - * Implementation Part I (cppunit part) - ****************************************************************************/ - - -template <class T> -void TestXprVectorOperators<T>::setUp() { - v1 = 1,2,3; - vBig = 10,20,30; -} - - -template <class T> -void TestXprVectorOperators<T>::tearDown() { } - - -/***************************************************************************** - * Implementation Part II - ****************************************************************************/ - - -/* - * global math operators with scalars - * Note: checked against member operators since they are allready checked - */ -template <class T> -void -TestXprVectorOperators<T>::scalarOps1() { - vector_type r1(v1), r2(v1), r3(v1), r4(vBig); - vector_type t1(0), t2(0), t3(0), t4(0); - - r1 += scalar; - r2 -= scalar; - r3 *= scalar; - r4 /= scalar; - - // all element wise - t1 = T(1)*v1 + scalar; - t2 = T(1)*v1 - scalar; - t3 = T(1)*v1 * scalar; - t4 = T(1)*vBig / scalar; - - CPPUNIT_ASSERT( all_elements(t1 == r1) ); - CPPUNIT_ASSERT( all_elements(t2 == r2) ); - CPPUNIT_ASSERT( all_elements(t3 == r3) ); - CPPUNIT_ASSERT( all_elements(t4 == r4) ); -} - - -/* - * global math operators with scalars, part II - * Note: checked against member operators since they are allready checked - */ -template <class T> -void -TestXprVectorOperators<T>::scalarOps2() { - vector_type r1(v1), r2(v1); - vector_type t1(0), t2(0); - - r1 += scalar; - r2 *= scalar; - - // all element wise - t1 = scalar + T(1)*v1; - t2 = scalar * T(1)*v1; - - CPPUNIT_ASSERT( all_elements(t1 == r1) ); - CPPUNIT_ASSERT( all_elements(t2 == r2) ); -} - - -/* - * global math operators with vector expressions - */ -template <class T> -void -TestXprVectorOperators<T>::globalXprVectorOps() { - vector_type r1(v1), r2(v1), r3(v1), r4(v1); - vector_type t1(0), t2(0), t3(0), t4(0); - vector_type v2(v1); - - CPPUNIT_ASSERT( all_elements( v1 == v2) ); - - r1 += v1; - r2 -= v1; - r3 *= v1; - - { - using namespace tvmet::element_wise; - r4 /= v1; - } - - CPPUNIT_ASSERT( all_elements(r2 == T(0)) ); - CPPUNIT_ASSERT( all_elements(r4 == T(1)) ); - - t1 = T(1)*v1 + T(1)*v2; - t2 = T(1)*v1 - T(1)*v2; - t3 = T(1)*v1 * T(1)*v2; - - { - using namespace tvmet::element_wise; - t4 = (T(1)*v1) / (T(1)*v1); - } - - CPPUNIT_ASSERT( all_elements(t1 == r1) ); - CPPUNIT_ASSERT( all_elements(t2 == r2) ); - CPPUNIT_ASSERT( all_elements(t3 == r3) ); - CPPUNIT_ASSERT( all_elements(t4 == r4) ); -} - - -/* - * negate operators - */ -template <class T> -void -TestXprVectorOperators<T>::negate() { - vector_type v2; - - v2 = -(T(1)*vOne); - - CPPUNIT_ASSERT( all_elements(v2 == T(-1)) ); -} - -#endif // TVMET_TEST_XPR_VECTOROPS_H - -// Local Variables: -// mode:C++ -// End: diff --git a/tvmet-1.7.1/testsuite/compare.h b/tvmet-1.7.1/testsuite/compare.h deleted file mode 100644 index 3e27af8af..000000000 --- a/tvmet-1.7.1/testsuite/compare.h +++ /dev/null @@ -1,94 +0,0 @@ -/* This file is part of Eigen, a C++ template library for linear algebra - * Copyright (C) 2006-2007 Benoit Jacob <jacob@math.jussieu.fr> - * - * 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: SelfTest.cc,v 1.1 2004/04/24 11:55:15 opetzold Exp $ - */ - -/* This file is mostly a duplication of util/Fuzzy.h, but with 1000 times - * bigger epsilon. This prevents false positives in tests. - */ - -#ifndef EIGEN_TESTSUITE_COMPARE_H -#define EIGEN_TESTSUITE_COMPARE_H - -#include <QtTest/QtTest> - -#include <cstdlib> -#include <cmath> -#include <complex> - -#include <tvmet/Traits.h> - -template<typename T> inline typename tvmet::Traits<T>::real_type test_epsilon() -{ return static_cast<typename tvmet::Traits<T>::real_type>(0); } -template<> inline float test_epsilon<float>() { return 1e-2f; } -template<> inline double test_epsilon<double>() { return 1e-8; } -template<> inline float test_epsilon<std::complex<float> >() { return test_epsilon<float>(); } -template<> inline double test_epsilon<std::complex<double> >() { return test_epsilon<double>(); } - -/** - * 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) * test_epsilon<T> ). - */ -template<typename T> bool test_isNegligible( const T& a, const T& b ) -{ - return( tvmet::Traits<T>::abs(a) - <= tvmet::Traits<T>::abs(b) - * test_epsilon<T>() ); -} - -/** - * Short version: returns true if \a a is approximately zero. - * - * Full story: returns test_isNegligible( a, static_cast<T>(1) ); - */ -template<typename T> bool test_isZero( const T& a ) -{ - return test_isNegligible( a, static_cast<T>(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) ) * test_epsilon<T>. - */ -template<typename T> bool test_isApprox( const T& a, const T& b ) -{ - return( tvmet::Traits<T>::abs( a - b ) - <= std::min( tvmet::Traits<T>::abs(a), - tvmet::Traits<T>::abs(b) ) * test_epsilon<T>() ); -} - -/** - * Short version: returns true if a is smaller or approximately equalt to b, false otherwise. - * - * Full story: returns a <= b || test_isApprox(a, b); - */ -template<typename T> bool test_isLessThan( const T& a, const T& b ) -{ - return( tvmet::Traits<T>::isLessThan_nonfuzzy(a, b) || test_isApprox(a, b) ); -} - -#define TEST(a) QVERIFY(a) -#define TEST_NEGLIGIBLE(a,b) QVERIFY(test_isNegligible(a,b)) -#define TEST_ZERO(a) QVERIFY(test_isZero(a)) -#define TEST_APPROX(a,b) QVERIFY(test_isApprox(a,b)) -#define TEST_LESSTHAN(a,b) QVERIFY(test_isLessThan(a,b)) - -#endif // EIGEN_TESTSUITE_COMPARE_H diff --git a/tvmet-1.7.1/testsuite/main.cpp b/tvmet-1.7.1/testsuite/main.cpp deleted file mode 100644 index 9116b345c..000000000 --- a/tvmet-1.7.1/testsuite/main.cpp +++ /dev/null @@ -1,25 +0,0 @@ -/* This file is part of Eigen, a C++ template library for linear algebra - * Copyright (C) 2007 Benoit Jacob <jacob@math.jussieu.fr> - * - * 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: main.cc,v 1.1 2004/04/24 11:55:15 opetzold Exp $ - */ - -#include "main.h" - -QTEST_APPLESS_MAIN( TvmetTestSuite ) -#include "main.moc" - diff --git a/tvmet-1.7.1/testsuite/main.h b/tvmet-1.7.1/testsuite/main.h deleted file mode 100644 index 2b5d3d8ed..000000000 --- a/tvmet-1.7.1/testsuite/main.h +++ /dev/null @@ -1,53 +0,0 @@ -/* This file is part of Eigen, a C++ template library for linear algebra - * Copyright (C) 2007 Benoit Jacob <jacob@math.jussieu.fr> - * - * 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 - */ -#ifndef EIGEN_TESTSUITE_MAIN_H -#define EIGEN_TESTSUITE_MAIN_H - -#include <QtTest/QtTest> -#include <iostream> -#include <stdlib.h> -#include <time.h> - -#define EIGEN_USE_COMPLEX - -#ifdef EIGEN_USE_COMPLEX -#include <complex> -#endif - -#include <tvmet/Vector.h> -#include <tvmet/Matrix.h> - -#include "compare.h" - -using namespace tvmet; -using namespace std; - -class TvmetTestSuite : public QObject -{ - Q_OBJECT - - public: - TvmetTestSuite() {}; - - private slots: - void testCommaInitializer(); - void testTraits(); - void testConstructors(); -}; - -#endif // EIGEN_TESTSUITE_MAIN_H diff --git a/tvmet-1.7.1/testsuite/testcommainitializer.cpp b/tvmet-1.7.1/testsuite/testcommainitializer.cpp deleted file mode 100644 index dab438441..000000000 --- a/tvmet-1.7.1/testsuite/testcommainitializer.cpp +++ /dev/null @@ -1,49 +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: SelfTest.cc,v 1.1 2004/04/24 11:55:15 opetzold Exp $ - */ - -#include "main.h" - -template<typename T> static void TestCommaInitializer() -{ - // test the CommaInitializer - Vector<T, 3> v1; - v1 = 1,2,3; - Matrix<T, 3, 3> m1; - m1 = 1,4,7, - 2,5,8, - 3,6,9; - - QVERIFY(v1(0) == T(1) && v1(1) == T(2) && v1(2) == T(3)); - - QVERIFY(m1(0,0) == T(1) && m1(0,1) == T(4) && m1(0,2) == T(7) && - m1(1,0) == T(2) && m1(1,1) == T(5) && m1(1,2) == T(8) && - m1(2,0) == T(3) && m1(2,1) == T(6) && m1(2,2) == T(9)); -} - -void TvmetTestSuite::testCommaInitializer() -{ - TestCommaInitializer<int> (); - TestCommaInitializer<double> (); - TestCommaInitializer<complex<int> > (); - TestCommaInitializer<complex<double> > (); -} diff --git a/tvmet-1.7.1/testsuite/testconstructors.cpp b/tvmet-1.7.1/testsuite/testconstructors.cpp deleted file mode 100644 index 7172923f0..000000000 --- a/tvmet-1.7.1/testsuite/testconstructors.cpp +++ /dev/null @@ -1,147 +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: SelfTest.cc,v 1.1 2004/04/24 11:55:15 opetzold Exp $ - */ - -#include "main.h" - -template<typename T> -bool operator==(const tvmet::Vector<T, 3> & v1, const tvmet::Vector<T, 3> & v2) -{ - bool ret = true; - for(int i = 0; i < 3; i++) if(v1(i) != v2(i)) ret = false; - return ret; -} - -template<typename T> -bool operator==(const tvmet::Matrix<T, 3, 3> & v1, const tvmet::Matrix<T, 3, 3> & v2) -{ - bool ret = true; - for(int i = 0; i < 3; i++) - for(int j = 0; j < 3; j++) - if(v1(i,j) != v2(i,j)) ret = false; - return ret; -} - -template<typename T> struct TestConstructors -{ - typedef tvmet::Vector<T, 3> vector_type; - typedef tvmet::Matrix<T, 3, 3> matrix_type; - - void vector_ctor2() - { - T data[] = {1,2,3}; - vector_type v(data); - TEST(v == v1); - } - - void vector_ctor5() - { - vector_type v(v1 - v1); // expression - TEST(v == vZero); - } - - void vector_operator_eq() - { - vector_type v; - v = v1; - TEST(v == v1); - } - - void vector_copy_ctor() - { - vector_type v(v1); - TEST(v == v1); - } - - void matrix_ctor2() - { - T data[] = { 1, 2, 3, - 4, 5, 6, - 7, 8, 9 }; - matrix_type m(data); - TEST(m == m1); - } - - void matrix_ctor4() - { - matrix_type m(m1 - m1); // expression - TEST(m == mZero); - } - - void matrix_operator_eq() - { - matrix_type m; - m = m1; - TEST(m == m1); - } - - void matrix_copy_ctor() - { - matrix_type m(m1); - TEST(m == m1); - } - - TestConstructors() - { - vZero = 0,0,0; - vOne = 1,1,1; - mZero = 0,0,0, - 0,0,0, - 0,0,0; - mOne = 1,1,1, - 1,1,1, - 1,1,1; - v1 = 1,2,3; - m1 = 1,4,7, - 2,5,8, - 3,6,9; - - vector_ctor2(); - vector_ctor5(); - vector_operator_eq(); - vector_copy_ctor(); - - matrix_ctor2(); - matrix_ctor4(); - matrix_operator_eq(); - matrix_copy_ctor(); - } - -private: - vector_type vZero; - vector_type vOne; - vector_type v1; - - matrix_type mZero; - matrix_type mOne; - matrix_type m1; -}; - -void TvmetTestSuite::testConstructors() -{ - TestConstructors<int>(); - TestConstructors<float>(); - TestConstructors<double>(); - TestConstructors<std::complex<int> >(); - TestConstructors<std::complex<float> >(); - TestConstructors<std::complex<double> >(); -} diff --git a/tvmet-1.7.1/testsuite/testtraits.cpp b/tvmet-1.7.1/testsuite/testtraits.cpp deleted file mode 100644 index 1a533e65b..000000000 --- a/tvmet-1.7.1/testsuite/testtraits.cpp +++ /dev/null @@ -1,146 +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: SelfTest.cc,v 1.1 2004/04/24 11:55:15 opetzold Exp $ - */ - -#include "main.h" - -template<typename T> struct TestTraits -{ - void real_imag_conj_abs() - { - T x = Traits<T>::random(); - typedef typename Traits<T>::real_type real; - real r = Traits<T>::real(x); - real i = Traits<T>::imag(x); - T c = Traits<T>::conj(x); - real a = Traits<T>::abs(x); - - // a must be real - TEST_APPROX(a, Traits<real>::real(a)); - TEST_APPROX(a, Traits<T>::real(a)); - TEST_ZERO(Traits<real>::imag(a)); - TEST_ZERO(Traits<T>::imag(a)); - - // check Pythagora's formula - if(Traits<T>::isFloat() || !Traits<T>::isComplex()) TEST_APPROX(r*r + i*i, a*a); - - // check complex conjugation - TEST_APPROX(-i, Traits<T>::imag(c)); - } - - void imag() - { - T x = Traits<T>::random(); - typedef typename Traits<T>::real_type real_type; - real_type r = Traits<T>::imag(x); - TEST_ZERO(r); - } - - void conj() - { - T x = Traits<T>::random(); - typedef typename Traits<T>::real_type conj_type; - conj_type r = Traits<T>::conj(x); - TEST_APPROX(r, x); - } - - void abs() - { - T x = Traits<T>::random(); - typedef typename Traits<T>::real_type value_type; - value_type r1 = Traits<T>::abs(x); - value_type r2 = Traits<T>::abs(-x); - TEST_APPROX(r1, r2); - } - - void sqrt() - { - // only test compilation here - T x = Traits<T>::random(); - Traits<T>::sqrt(x); - } - - void isApprox() - { - T x = Traits<T>::random(); - T e = T(Traits<T>::epsilon()) / T(10); - TEST(Traits<T>::isApprox(x,x)); - TEST(Traits<T>::isApprox(x,x+e)); - TEST(!Traits<T>::isApprox(x,x+T(1))); - } - - void isNegligible() - { - T zero(0), one(1), x = Traits<T>::random(); - TEST(Traits<T>::isNegligible(zero, zero)); - TEST(Traits<T>::isNegligible(zero, one)); - TEST(!Traits<T>::isNegligible(one, one)); - if(x != zero) { - TEST(Traits<T>::isNegligible(zero, x)); - } - TEST(!Traits<T>::isNegligible(one, x)); - } - - - void isZero() - { - T zero(0), one(1), x = Traits<T>::random(), y = Traits<T>::random(); - TEST(Traits<T>::isZero(zero)); - TEST(!Traits<T>::isZero(one)); - TEST(Traits<T>::isZero((x+y)*(x+y)-x*x-y*y-x*y-y*x)); - } - - void isLessThan() - { - if(Traits<T>::isComplex()) { - T x = Traits<T>::random(), y = Traits<T>::random(); - TEST(!Traits<T>::isLessThan(x,y)); - } - else { - T one(1), x = Traits<T>::random(); - T e = T(Traits<T>::epsilon()) / T(10); - TEST(Traits<T>::isLessThan(x, x+one)); - TEST(!Traits<T>::isLessThan(x+one, x)); - TEST(Traits<T>::isLessThan(x, x+e)); - } - } - - TestTraits() - { - real_imag_conj_abs(); - sqrt(); - isApprox(); - isNegligible(); - isZero(); - isLessThan(); - } -}; - -void TvmetTestSuite::testTraits() -{ - TestTraits<int>(); - TestTraits<float>(); - TestTraits<double>(); - TestTraits<std::complex<int> >(); - TestTraits<std::complex<float> >(); - TestTraits<std::complex<double> >(); -} |