Hello community, here is the log from the commit of package armadillo for openSUSE:Factory checked in at 2016-10-31 09:56:48 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/armadillo (Old) and /work/SRC/openSUSE:Factory/.armadillo.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "armadillo" Changes: -------- --- /work/SRC/openSUSE:Factory/armadillo/armadillo.changes 2016-09-30 15:33:52.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.armadillo.new/armadillo.changes 2016-10-31 09:56:50.000000000 +0100 @@ -1,0 +2,8 @@ +Mon Oct 24 13:16:30 UTC 2016 - badshah400@gmail.com + +- Update to version 7.500.0: + + Expanded qz() to optionally specify ordering of the Schur + form. + + Expanded .each_slice() to support matrix multiplication. + +------------------------------------------------------------------- Old: ---- armadillo-7.400.3.tar.xz New: ---- armadillo-7.500.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ armadillo.spec ++++++ --- /var/tmp/diff_new_pack.96NKpe/_old 2016-10-31 09:56:51.000000000 +0100 +++ /var/tmp/diff_new_pack.96NKpe/_new 2016-10-31 09:56:51.000000000 +0100 @@ -19,7 +19,7 @@ %define soname libarmadillo7 Name: armadillo -Version: 7.400.3 +Version: 7.500.0 Release: 0 Summary: Fast C++ matrix library with interfaces to LAPACK and ATLAS License: MPL-2.0 ++++++ armadillo-7.400.3.tar.xz -> armadillo-7.500.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/armadillo-7.400.3/CMakeLists.txt new/armadillo-7.500.0/CMakeLists.txt --- old/armadillo-7.400.3/CMakeLists.txt 2016-06-16 18:16:04.000000000 +0200 +++ new/armadillo-7.500.0/CMakeLists.txt 2016-06-16 18:16:06.000000000 +0200 @@ -14,13 +14,9 @@ cmake_minimum_required(VERSION 2.8 FATAL_ERROR) -set(ARMA_MAJOR 7) -set(ARMA_MINOR 400) -set(ARMA_PATCH 2) -set(ARMADILLO_VERSION ${ARMA_MAJOR}.${ARMA_MINOR}.${ARMA_PATCH}) - -message(STATUS "Configuring Armadillo ${ARMADILLO_VERSION}") - +project(armadillo CXX) +include(CheckIncludeFileCXX) +include(CheckLibraryExists) ## Set ARMA_USE_WRAPPER to false if you're getting linking errors when compiling your programs, ## or if you prefer to directly link with BLAS and/or LAPACK. @@ -40,12 +36,24 @@ set(ARMA_USE_EXTERN_CXX11_RNG false) set(ARMA_USE_SUPERLU false) # Caveat: only SuperLU version 5.x can be used! -project(armadillo CXX) -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake_aux/Modules/") +## extract version from sources -include(CheckIncludeFileCXX) -include(CheckLibraryExists) +set(ARMA_VERSION_FILE_NAME "${PROJECT_SOURCE_DIR}/include/armadillo_bits/arma_version.hpp") + +if(NOT EXISTS ${ARMA_VERSION_FILE_NAME}) + message(FATAL_ERROR "Can't read ${ARMA_VERSION_FILE_NAME}") +endif() + +file(READ ${ARMA_VERSION_FILE_NAME} ARMA_VERSION_FILE_CONTENTS) +string(REGEX REPLACE ".*#define ARMA_VERSION_MAJOR ([0-9]+).*" "\\1" ARMA_VERSION_MAJOR "${ARMA_VERSION_FILE_CONTENTS}") +string(REGEX REPLACE ".*#define ARMA_VERSION_MINOR ([0-9]+).*" "\\1" ARMA_VERSION_MINOR "${ARMA_VERSION_FILE_CONTENTS}") +string(REGEX REPLACE ".*#define ARMA_VERSION_PATCH ([0-9]+).*" "\\1" ARMA_VERSION_PATCH "${ARMA_VERSION_FILE_CONTENTS}") + +message(STATUS "Configuring Armadillo ${ARMA_VERSION_MAJOR}.${ARMA_VERSION_MINOR}.${ARMA_VERSION_PATCH}") + + +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake_aux/Modules/") if(MSVC) @@ -312,13 +320,13 @@ ## work around a silly limitation in Mac OS X if(APPLE) - if(${ARMA_MINOR} GREATER 99) - math(EXPR ARMA_MINOR_ALT "${ARMA_MINOR} / 10") + if(${ARMA_VERSION_MINOR} GREATER 99) + math(EXPR ARMA_VERSION_MINOR_ALT "${ARMA_VERSION_MINOR} / 10") else() - set(ARMA_MINOR_ALT ${ARMA_MINOR}) + set(ARMA_VERSION_MINOR_ALT ${ARMA_VERSION_MINOR}) endif() else() - set(ARMA_MINOR_ALT ${ARMA_MINOR}) + set(ARMA_VERSION_MINOR_ALT ${ARMA_VERSION_MINOR}) endif() @@ -339,7 +347,7 @@ add_library( armadillo ${PROJECT_SOURCE_DIR}/src/wrapper.cpp ) target_link_libraries( armadillo ${ARMA_LIBS} ) -set_target_properties(armadillo PROPERTIES VERSION ${ARMA_MAJOR}.${ARMA_MINOR_ALT}.${ARMA_PATCH} SOVERSION ${ARMA_MAJOR}) +set_target_properties(armadillo PROPERTIES VERSION ${ARMA_VERSION_MAJOR}.${ARMA_VERSION_MINOR_ALT}.${ARMA_VERSION_PATCH} SOVERSION ${ARMA_VERSION_MAJOR}) ################################################################################ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/armadillo-7.400.3/README.txt new/armadillo-7.500.0/README.txt --- old/armadillo-7.400.3/README.txt 2016-06-16 18:16:04.000000000 +0200 +++ new/armadillo-7.500.0/README.txt 2016-06-16 18:16:06.000000000 +0200 @@ -8,33 +8,30 @@ 1: Introduction 2: Citation Details + 3: License - 3: Licenses - 4: Technical Support + 4: Requirements - 5: Requirements + 5: Linux and Mac OS X: Installation + 6: Linux and Mac OS X: Compiling & Linking - 6: Linux and Mac OS X: Installation - 7: Linux and Mac OS X: Compiling & Linking + 7: Windows: Installation + 8: Windows: Compiling & Linking - 8: Windows: Installation - 9: Windows: Compiling & Linking + 9: Support for OpenBLAS, Intel MKL and AMD ACML +10: Support for ATLAS -10: Support for OpenBLAS, Intel MKL and AMD ACML -11: Support for ATLAS +11: API Documentation +12: MEX Interface to Octave/Matlab -12: API Documentation -13: MEX Interface to Octave/Matlab - -14: Bug Reports and Frequently Asked Questions -15: Related Software +13: Bug Reports and Frequently Asked Questions +14: Related Software 1: Introduction =============== - Armadillo is a high quality C++ linear algebra library, aiming towards a good balance between speed and ease of use. @@ -55,10 +52,7 @@ The library can be used for machine learning, pattern recognition, computer vision, signal processing, bioinformatics, statistics, econometrics, etc. -Armadillo is primarily developed at Data61 / NICTA (Australia). -For information about Data61 see http://data61.csiro.au - -Main developers: +Authors: Conrad Sanderson - http://conradsanderson.id.au Ryan Curtin - http://ratml.org @@ -77,30 +71,15 @@ -3: Licenses -=========== +3: License +========== -Armadillo is available under 2 licenses: - -- Open source, under the restrictions of the Mozilla Public License (MPL) 2.0. - See the "LICENSE.txt" file for details. - -- Commercial license (not open source), available for purchase. - Please contact Conrad Sanderson for more information: - http://conradsanderson.id.au +Armadillo is available as open source, under the restrictions of the +Mozilla Public License (MPL) 2.0. See the "LICENSE.txt" file for details. -4: Technical Support -==================== - -Technical support can be obtained by purchasing the commercial license (see above). -Please contact Conrad Sanderson for more information: -http://conradsanderson.id.au - - - -5: Requirements +4: Requirements =============== Armadillo makes extensive use of template meta-programming, recursive templates @@ -122,7 +101,7 @@ -6: Linux and Mac OS X: Installation +5: Linux and Mac OS X: Installation =================================== * Step 1: @@ -195,7 +174,7 @@ -7: Linux and Mac OS X: Compiling & Linking +6: Linux and Mac OS X: Compiling & Linking ========================================== The "examples" directory contains several quick example programs @@ -219,7 +198,7 @@ -8: Windows: Installation +7: Windows: Installation ======================== The installation is comprised of 3 steps: @@ -249,7 +228,7 @@ -9: Windows: Compiling & Linking +8: Windows: Compiling & Linking =============================== Within the "examples" folder, we have included an MSVC project named "example1_win64" @@ -299,8 +278,8 @@ -10: Support for OpenBLAS, Intel MKL and AMD ACML -================================================ +9: Support for OpenBLAS, Intel MKL and AMD ACML +=============================================== Armadillo can use OpenBLAS, or Intel Math Kernel Library (MKL), or the AMD Core Math Library (ACML) as high-speed replacements @@ -357,7 +336,7 @@ -11: Support for ATLAS +10: Support for ATLAS ===================== Armadillo can use the ATLAS library for faster versions of @@ -374,7 +353,7 @@ -12: API Documentation +11: API Documentation ===================== Documentation of functions and classes is available at: @@ -386,7 +365,7 @@ -13: MEX Interface to Octave/Matlab +12: MEX Interface to Octave/Matlab ================================== The "mex_interface" folder contains examples of how to interface @@ -394,7 +373,7 @@ -14: Bug Reports and Frequently Asked Questions +13: Bug Reports and Frequently Asked Questions ============================================== Answers to frequently asked questions can be found at: @@ -416,15 +395,12 @@ -15: Related Software +14: Related Software ==================== * MLPACK: C++ library for machine learning and pattern recognition, built on top of Armadillo. http://mlpack.org -* Mantella: C++ library for analysing and solving optimisation problems - https://github.com/SebastianNiemann/Mantella - * libpca: C++ library for principal component analysis http://sourceforge.net/projects/libpca/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/armadillo-7.400.3/docs.html new/armadillo-7.500.0/docs.html --- old/armadillo-7.400.3/docs.html 2016-06-16 18:16:04.000000000 +0200 +++ new/armadillo-7.500.0/docs.html 2016-06-16 18:16:06.000000000 +0200 @@ -144,7 +144,7 @@ <!-- --> <a class="noprint" style="display:scroll; position:fixed; bottom:5px; right:5px;" href="#top"><font size=-1>[top]</font></a> -<big><b>API Documentation for Armadillo 7.400</b></big> +<big><b>API Documentation for Armadillo 7.500</b></big> <br> <br> <br> @@ -156,7 +156,7 @@ <table border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> -<td style="text-align: left; vertical-align: top; width: 50%;"> +<td style="text-align: left; vertical-align: top; width: 45%;"> <ul> <li> For converting Matlab/Octave programs, @@ -182,7 +182,7 @@ <td class="line" style="vertical-align: top;"> <br> </td> -<td style="text-align: left; vertical-align: top; width: 45%;"> +<td style="text-align: left; vertical-align: top; width: 50%;"> <ul> <li> Please cite the following article if you use Armadillo in your research and/or software. @@ -195,13 +195,6 @@ <br>Journal of Open Source Software, Vol. 1, pp. 26, 2016. </font> </li> -<!-- -<br> -<li> -If you use Armadillo in products, -please obtain the <a href="http://arma.sourceforge.net/faq.html#licenses">commercial license</a> -</li> ---> </ul> </td> </tr> @@ -3867,11 +3860,11 @@ </li> <br> <li> -Repeat a matrix operation on each slice of a cube +Repeat a matrix operation on each slice of a cube, with each slice treated as a matrix </li> <br> <li> -Supported operations for <i>.each_slice()</i> and <i>.each_slice(vector_of_indices)</i> forms: +Supported operations for the <i>.each_slice()</i> form: <br> <br> <ul> @@ -3880,11 +3873,16 @@ <tr><td><code><b>-</b></code></td><td> </td><td>subtraction</td><td> </td><td><code><b>-=</b></code></td><td> </td><td>in-place subtraction</td></tr> <tr><td><code><b>%</b></code></td><td> </td><td>element-wise multiplication</td><td> </td><td><code><b>%=</b></code></td><td> </td><td>in-place element-wise multiplication</td></tr> <tr><td><code><b>/</b></code></td><td> </td><td>element-wise division</td><td> </td><td><code><b>/=</b></code></td><td> </td><td>in-place element-wise division</td></tr> +<tr><td><code><b>*</b></code></td><td> </td><td>matrix multiplication</td><td> </td><td><code><b>*=</b></code></td><td> </td><td>in-place matrix multiplication</td></tr> <tr><td><code><b>=</b></code></td><td> </td><td>assignment (copy)</td><td> </td><td> </td><td> </td><td> </td></tr> </table> </ul> </li> <br> +<li> +The <i>.each_slice(vector_of_indices)</i> form also supports the above operations, except for <code><b>*</b></code> and <code><b>*=</b></code> (ie. matrix multiplication) +</li> +<br> <li>The argument <i>vector_of_indices</i> is optional; by default all slices are used</li> <br> <li> @@ -7096,9 +7094,7 @@ </li> <br> <li> -If a binary or trinary expression is given (ie. 2 or 3 terms), -the function will try to exploit the fact that the result is a 1x1 matrix -by using optimised expression evaluations +Optimised expression evaluations are automatically used when a binary or trinary expression is given (ie. 2 or 3 terms) </li> <br> <li> @@ -7109,8 +7105,7 @@ colvec q = randu<colvec>(5); mat X = randu<mat>(5,5); -// examples of some expressions -// for which optimised implementations exist +// examples of expressions which have optimised implementations double a = as_scalar(r*q); double b = as_scalar(r*X*q); @@ -10875,12 +10870,28 @@ <div class="pagebreak"></div><div class="noprint"><hr class="greyline"><br></div> <a name="qz"></a> <b>qz( AA, BB, Q, Z, A, B )</b> +<br><b>qz( AA, BB, Q, Z, A, B, select )</b> <ul> <li> Generalised Schur decomposition for pair of general square matrices <i>A</i> and <i>B</i> of the same size, <br>such that <i>A = Q.t()*AA*Z.t()</i> and <i>B = Q.t()*BB*Z.t()</i> </li> <br> +<li>The <i>select</i> argument is optional and specifies the ordering of the top left of the Schur form; it is one of the following: +<br> +<ul> +<table> +<tbody> +<tr><td><code>"none"</code></td><td> </td><td>no selection (default operation)</td></tr> +<tr><td><code>"lhp"</code></td><td> </td><td>left-half-plane: eigenvalues with real part < 0</td></tr> +<tr><td><code>"rhp"</code></td><td> </td><td>right-half-plane: eigenvalues with real part > 0</td></tr> +<tr><td><code>"iuc"</code></td><td> </td><td>inside-unit-circle: eigenvalues with absolute value < 1</td></tr> +<tr><td><code>"ouc"</code></td><td> </td><td>outside-unit-circle: eigenvalues with absolute value > 1</td></tr> +</tbody> +</table> +</ul> +</li> +<br> <li>The left and right Schur vectors are stored in <i>Q</i> and <i>Z</i>, respectively</li> <br> <li>In the complex-valued problem, the generalised eigenvalues are found in <i>diagvec(AA) / diagvec(BB)</i></li> @@ -15121,6 +15132,29 @@ <tbody> <tr> <td style="vertical-align: top;"> +<code>ARMA_DONT_USE_WRAPPER</code> + </td> + <td style="vertical-align: top;"> + + </td> + <td style="vertical-align: top;"> +Disable going through the run-time Armadillo wrapper library (<i>libarmadillo.so</i>) when calling LAPACK, BLAS, ARPACK, SuperLU and HDF5 functions. +You will need to directly link with BLAS, LAPACK, etc (eg. <i>-lblas -llapack </i>) + </td> + </tr> + <tr> + <td style="vertical-align: top;"> + + </td> + <td style="vertical-align: top;"> + + </td> + <td style="vertical-align: top;"> + + </td> + </tr> + <tr> + <td style="vertical-align: top;"> <code>ARMA_USE_LAPACK</code> </td> <td style="vertical-align: top;"> @@ -15394,29 +15428,6 @@ </tr> <tr> <td style="vertical-align: top;"> -<code>ARMA_DONT_USE_WRAPPER</code> - </td> - <td style="vertical-align: top;"> - - </td> - <td style="vertical-align: top;"> -Disable going through the run-time Armadillo wrapper library (<i>libarmadillo.so</i>) when calling LAPACK, BLAS, ARPACK, SuperLU and HDF5 functions. -You will need to directly link with LAPACK, BLAS, etc (eg. <i>-llapack -lblas</i>) - </td> - </tr> - <tr> - <td style="vertical-align: top;"> - - </td> - <td style="vertical-align: top;"> - - </td> - <td style="vertical-align: top;"> - - </td> - </tr> - <tr> - <td style="vertical-align: top;"> <a name="config_hpp_arma_use_cxx11"></a> <code>ARMA_USE_CXX11</code> </td> @@ -15891,6 +15902,14 @@ <br> <ul> +<a name="version_7500"></a> +<li>Version 7.500: +<ul> +<li>expanded <a href="#qz">qz()</a> to optionally specify ordering of the Schur form</li> +<li>expanded <a href="#each_slice">each_slice()</a> to support matrix multiplication</li> +</ul> +</li> +<br> <a name="version_7400"></a> <li>Version 7.400: <ul> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/armadillo-7.400.3/include/armadillo_bits/Mat_meat.hpp new/armadillo-7.500.0/include/armadillo_bits/Mat_meat.hpp --- old/armadillo-7.400.3/include/armadillo_bits/Mat_meat.hpp 2016-06-16 18:16:04.000000000 +0200 +++ new/armadillo-7.500.0/include/armadillo_bits/Mat_meat.hpp 2016-06-16 18:16:06.000000000 +0200 @@ -3877,7 +3877,7 @@ for(uword ii=0; ii < n_cols; ++ii) { - const Col<eT> tmp(colptr(ii), n_rows, false, true); + const Col<eT> tmp(const_cast<eT*>(colptr(ii)), n_rows, false, true); F(tmp); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/armadillo-7.400.3/include/armadillo_bits/arma_version.hpp new/armadillo-7.500.0/include/armadillo_bits/arma_version.hpp --- old/armadillo-7.400.3/include/armadillo_bits/arma_version.hpp 2016-06-16 18:16:04.000000000 +0200 +++ new/armadillo-7.500.0/include/armadillo_bits/arma_version.hpp 2016-06-16 18:16:06.000000000 +0200 @@ -14,9 +14,9 @@ #define ARMA_VERSION_MAJOR 7 -#define ARMA_VERSION_MINOR 400 -#define ARMA_VERSION_PATCH 3 -#define ARMA_VERSION_NAME "Feral Winter Deluxe" +#define ARMA_VERSION_MINOR 500 +#define ARMA_VERSION_PATCH 0 +#define ARMA_VERSION_NAME "Coup d'Etat" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/armadillo-7.400.3/include/armadillo_bits/arrayops_meat.hpp new/armadillo-7.500.0/include/armadillo_bits/arrayops_meat.hpp --- old/armadillo-7.400.3/include/armadillo_bits/arrayops_meat.hpp 2016-06-16 18:16:04.000000000 +0200 +++ new/armadillo-7.500.0/include/armadillo_bits/arrayops_meat.hpp 2016-06-16 18:16:06.000000000 +0200 @@ -19,7 +19,7 @@ void arrayops::copy(eT* dest, const eT* src, const uword n_elem) { - if( (n_elem <= 16) && (is_cx<eT>::no) ) + if( (n_elem <= 9) && (is_cx<eT>::no) ) { arrayops::copy_small(dest, src, n_elem); } @@ -39,13 +39,6 @@ { switch(n_elem) { - case 16: dest[15] = src[15]; - case 15: dest[14] = src[14]; - case 14: dest[13] = src[13]; - case 13: dest[12] = src[12]; - case 12: dest[11] = src[11]; - case 11: dest[10] = src[10]; - case 10: dest[ 9] = src[ 9]; case 9: dest[ 8] = src[ 8]; case 8: dest[ 7] = src[ 7]; case 7: dest[ 6] = src[ 6]; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/armadillo-7.400.3/include/armadillo_bits/auxlib_bones.hpp new/armadillo-7.500.0/include/armadillo_bits/auxlib_bones.hpp --- old/armadillo-7.400.3/include/armadillo_bits/auxlib_bones.hpp 2016-06-16 18:16:04.000000000 +0200 +++ new/armadillo-7.500.0/include/armadillo_bits/auxlib_bones.hpp 2016-06-16 18:16:06.000000000 +0200 @@ -260,10 +260,10 @@ // QZ decomposition template<typename T, typename T1, typename T2> - inline static bool qz(Mat<T>& A, Mat<T>& B, Mat<T>& vsl, Mat<T>& vsr, const Base<T,T1>& X_expr, const Base<T,T2>& Y_expr); + inline static bool qz(Mat<T>& A, Mat<T>& B, Mat<T>& vsl, Mat<T>& vsr, const Base<T,T1>& X_expr, const Base<T,T2>& Y_expr, const char mode); template<typename T, typename T1, typename T2> - inline static bool qz(Mat< std::complex<T> >& A, Mat< std::complex<T> >& B, Mat< std::complex<T> >& vsl, Mat< std::complex<T> >& vsr, const Base< std::complex<T>, T1 >& X_expr, const Base< std::complex<T>, T2 >& Y_expr); + inline static bool qz(Mat< std::complex<T> >& A, Mat< std::complex<T> >& B, Mat< std::complex<T> >& vsl, Mat< std::complex<T> >& vsr, const Base< std::complex<T>, T1 >& X_expr, const Base< std::complex<T>, T2 >& Y_expr, const char mode); // @@ -277,4 +277,22 @@ }; + +namespace qz_helper + { + template<typename T> inline blas_int select_lhp(const T* x_ptr, const T* y_ptr, const T* z_ptr); + template<typename T> inline blas_int select_rhp(const T* x_ptr, const T* y_ptr, const T* z_ptr); + template<typename T> inline blas_int select_iuc(const T* x_ptr, const T* y_ptr, const T* z_ptr); + template<typename T> inline blas_int select_ouc(const T* x_ptr, const T* y_ptr, const T* z_ptr); + + template<typename T> inline blas_int cx_select_lhp(const std::complex<T>* x_ptr, const std::complex<T>* y_ptr); + template<typename T> inline blas_int cx_select_rhp(const std::complex<T>* x_ptr, const std::complex<T>* y_ptr); + template<typename T> inline blas_int cx_select_iuc(const std::complex<T>* x_ptr, const std::complex<T>* y_ptr); + template<typename T> inline blas_int cx_select_ouc(const std::complex<T>* x_ptr, const std::complex<T>* y_ptr); + + template<typename T> inline void_ptr ptr_cast(blas_int (*function)(const T*, const T*, const T*)); + template<typename T> inline void_ptr ptr_cast(blas_int (*function)(const std::complex<T>*, const std::complex<T>*)); + } + + //! @} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/armadillo-7.400.3/include/armadillo_bits/auxlib_meat.hpp new/armadillo-7.500.0/include/armadillo_bits/auxlib_meat.hpp --- old/armadillo-7.400.3/include/armadillo_bits/auxlib_meat.hpp 2016-06-16 18:16:04.000000000 +0200 +++ new/armadillo-7.500.0/include/armadillo_bits/auxlib_meat.hpp 2016-06-16 18:16:06.000000000 +0200 @@ -3885,7 +3885,7 @@ template<typename T, typename T1, typename T2> inline bool -auxlib::qz(Mat<T>& A, Mat<T>& B, Mat<T>& vsl, Mat<T>& vsr, const Base<T,T1>& X_expr, const Base<T,T2>& Y_expr) +auxlib::qz(Mat<T>& A, Mat<T>& B, Mat<T>& vsl, Mat<T>& vsr, const Base<T,T1>& X_expr, const Base<T,T2>& Y_expr, const char mode) { arma_extra_debug_sigprint(); @@ -3921,6 +3921,11 @@ blas_int lwork = 3 * ((std::max)(blas_int(1),8*N+16)); blas_int info = 0; + if(mode == 'l') { eigsort = 'S'; selctg = qz_helper::ptr_cast(&(qz_helper::select_lhp<T>)); } + else if(mode == 'r') { eigsort = 'S'; selctg = qz_helper::ptr_cast(&(qz_helper::select_rhp<T>)); } + else if(mode == 'i') { eigsort = 'S'; selctg = qz_helper::ptr_cast(&(qz_helper::select_iuc<T>)); } + else if(mode == 'o') { eigsort = 'S'; selctg = qz_helper::ptr_cast(&(qz_helper::select_ouc<T>)); } + podarray<T> alphar(A.n_rows); podarray<T> alphai(A.n_rows); podarray<T> beta(A.n_rows); @@ -3952,6 +3957,7 @@ arma_ignore(vsr); arma_ignore(X_expr); arma_ignore(Y_expr); + arma_ignore(mode); arma_stop_logic_error("qz(): use of LAPACK must be enabled"); return false; } @@ -3966,7 +3972,7 @@ template<typename T, typename T1, typename T2> inline bool -auxlib::qz(Mat< std::complex<T> >& A, Mat< std::complex<T> >& B, Mat< std::complex<T> >& vsl, Mat< std::complex<T> >& vsr, const Base< std::complex<T>, T1 >& X_expr, const Base< std::complex<T>, T2 >& Y_expr) +auxlib::qz(Mat< std::complex<T> >& A, Mat< std::complex<T> >& B, Mat< std::complex<T> >& vsl, Mat< std::complex<T> >& vsr, const Base< std::complex<T>, T1 >& X_expr, const Base< std::complex<T>, T2 >& Y_expr, const char mode) { arma_extra_debug_sigprint(); @@ -4015,6 +4021,11 @@ blas_int lwork = 3 * ((std::max)(blas_int(1),2*N)); blas_int info = 0; + if(mode == 'l') { eigsort = 'S'; selctg = qz_helper::ptr_cast(&(qz_helper::cx_select_lhp<T>)); } + else if(mode == 'r') { eigsort = 'S'; selctg = qz_helper::ptr_cast(&(qz_helper::cx_select_rhp<T>)); } + else if(mode == 'i') { eigsort = 'S'; selctg = qz_helper::ptr_cast(&(qz_helper::cx_select_iuc<T>)); } + else if(mode == 'o') { eigsort = 'S'; selctg = qz_helper::ptr_cast(&(qz_helper::cx_select_ouc<T>)); } + podarray<eT> alpha(A.n_rows); podarray<eT> beta(A.n_rows); @@ -4046,6 +4057,7 @@ arma_ignore(vsr); arma_ignore(X_expr); arma_ignore(Y_expr); + arma_ignore(mode); arma_stop_logic_error("qz(): use of LAPACK must be enabled"); return false; } @@ -4166,4 +4178,248 @@ +// + + + +namespace qz_helper +{ + +// sgges() and dgges() require an external function with three arguments: +// select(alpha_real, alpha_imag, beta) +// where the eigenvalue is defined as complex(alpha_real, alpha_imag) / beta + +template<typename T> +inline +blas_int +select_lhp(const T* x_ptr, const T* y_ptr, const T* z_ptr) + { + arma_extra_debug_sigprint(); + + // cout << "select_lhp(): (*x_ptr) = " << (*x_ptr) << endl; + // cout << "select_lhp(): (*y_ptr) = " << (*y_ptr) << endl; + // cout << "select_lhp(): (*z_ptr) = " << (*z_ptr) << endl; + + arma_ignore(y_ptr); // ignore imaginary part + + const T x = (*x_ptr); + const T z = (*z_ptr); + + if(z == T(0)) { return blas_int(0); } // consider an infinite eig value not to lie in either lhp or rhp + + return ((x/z) < T(0)) ? blas_int(1) : blas_int(0); + } + + + +template<typename T> +inline +blas_int +select_rhp(const T* x_ptr, const T* y_ptr, const T* z_ptr) + { + arma_extra_debug_sigprint(); + + // cout << "select_rhp(): (*x_ptr) = " << (*x_ptr) << endl; + // cout << "select_rhp(): (*y_ptr) = " << (*y_ptr) << endl; + // cout << "select_rhp(): (*z_ptr) = " << (*z_ptr) << endl; + + arma_ignore(y_ptr); // ignore imaginary part + + const T x = (*x_ptr); + const T z = (*z_ptr); + + if(z == T(0)) { return blas_int(0); } // consider an infinite eig value not to lie in either lhp or rhp + + return ((x/z) > T(0)) ? blas_int(1) : blas_int(0); + } + + + +template<typename T> +inline +blas_int +select_iuc(const T* x_ptr, const T* y_ptr, const T* z_ptr) + { + arma_extra_debug_sigprint(); + + // cout << "select_iuc(): (*x_ptr) = " << (*x_ptr) << endl; + // cout << "select_iuc(): (*y_ptr) = " << (*y_ptr) << endl; + // cout << "select_iuc(): (*z_ptr) = " << (*z_ptr) << endl; + + const T x = (*x_ptr); + const T y = (*y_ptr); + const T z = (*z_ptr); + + if(z == T(0)) { return blas_int(0); } // consider an infinite eig value to be outside of the unit circle + + //return (std::abs(std::complex<T>(x,y) / z) < T(1)) ? blas_int(1) : blas_int(0); + return (std::sqrt(x*x + y*y) < std::abs(z)) ? blas_int(1) : blas_int(0); + } + + + +template<typename T> +inline +blas_int +select_ouc(const T* x_ptr, const T* y_ptr, const T* z_ptr) + { + arma_extra_debug_sigprint(); + + // cout << "select_ouc(): (*x_ptr) = " << (*x_ptr) << endl; + // cout << "select_ouc(): (*y_ptr) = " << (*y_ptr) << endl; + // cout << "select_ouc(): (*z_ptr) = " << (*z_ptr) << endl; + + const T x = (*x_ptr); + const T y = (*y_ptr); + const T z = (*z_ptr); + + if(z == T(0)) + { + return (x == T(0)) ? blas_int(0) : blas_int(1); // consider an infinite eig value to be outside of the unit circle + } + + //return (std::abs(std::complex<T>(x,y) / z) > T(1)) ? blas_int(1) : blas_int(0); + return (std::sqrt(x*x + y*y) > std::abs(z)) ? blas_int(1) : blas_int(0); + } + + + +// cgges() and zgges() require an external function with two arguments: +// select(alpha, beta) +// where the complex eigenvalue is defined as (alpha / beta) + +template<typename T> +inline +blas_int +cx_select_lhp(const std::complex<T>* x_ptr, const std::complex<T>* y_ptr) + { + arma_extra_debug_sigprint(); + + // cout << "cx_select_lhp(): (*x_ptr) = " << (*x_ptr) << endl; + // cout << "cx_select_lhp(): (*y_ptr) = " << (*y_ptr) << endl; + + const std::complex<T>& x = (*x_ptr); + const std::complex<T>& y = (*y_ptr); + + if( (y.real() == T(0)) && (y.imag() == T(0)) ) { return blas_int(0); } // consider an infinite eig value not to lie in either lhp or rhp + + return (std::real(x / y) < T(0)) ? blas_int(1) : blas_int(0); + } + + + +template<typename T> +inline +blas_int +cx_select_rhp(const std::complex<T>* x_ptr, const std::complex<T>* y_ptr) + { + arma_extra_debug_sigprint(); + + // cout << "cx_select_rhp(): (*x_ptr) = " << (*x_ptr) << endl; + // cout << "cx_select_rhp(): (*y_ptr) = " << (*y_ptr) << endl; + + const std::complex<T>& x = (*x_ptr); + const std::complex<T>& y = (*y_ptr); + + if( (y.real() == T(0)) && (y.imag() == T(0)) ) { return blas_int(0); } // consider an infinite eig value not to lie in either lhp or rhp + + return (std::real(x / y) > T(0)) ? blas_int(1) : blas_int(0); + } + + + +template<typename T> +inline +blas_int +cx_select_iuc(const std::complex<T>* x_ptr, const std::complex<T>* y_ptr) + { + arma_extra_debug_sigprint(); + + // cout << "cx_select_iuc(): (*x_ptr) = " << (*x_ptr) << endl; + // cout << "cx_select_iuc(): (*y_ptr) = " << (*y_ptr) << endl; + + const std::complex<T>& x = (*x_ptr); + const std::complex<T>& y = (*y_ptr); + + if( (y.real() == T(0)) && (y.imag() == T(0)) ) { return blas_int(0); } // consider an infinite eig value to be outside of the unit circle + + return (std::abs(x / y) < T(1)) ? blas_int(1) : blas_int(0); + } + + + +template<typename T> +inline +blas_int +cx_select_ouc(const std::complex<T>* x_ptr, const std::complex<T>* y_ptr) + { + arma_extra_debug_sigprint(); + + // cout << "cx_select_ouc(): (*x_ptr) = " << (*x_ptr) << endl; + // cout << "cx_select_ouc(): (*y_ptr) = " << (*y_ptr) << endl; + + const std::complex<T>& x = (*x_ptr); + const std::complex<T>& y = (*y_ptr); + + if( (y.real() == T(0)) && (y.imag() == T(0)) ) + { + return ((x.real() == T(0)) && (x.imag() == T(0))) ? blas_int(0) : blas_int(1); // consider an infinite eig value to be outside of the unit circle + } + + return (std::abs(x / y) > T(1)) ? blas_int(1) : blas_int(0); + } + + + +// need to do shenanigans with pointers due to: +// - we're using LAPACK ?gges() defined to expect pointer-to-function to be passed as pointer-to-object +// - explicit casting between pointer-to-function and pointer-to-object is a non-standard extension in C +// - the extension is essentially mandatory on POSIX systems +// - some compilers will complain about the extension in pedantic mode + +template<typename T> +inline +void_ptr +ptr_cast(blas_int (*function)(const T*, const T*, const T*)) + { + union converter + { + blas_int (*fn)(const T*, const T*, const T*); + void_ptr obj; + }; + + converter tmp; + + tmp.obj = 0; + tmp.fn = function; + + return tmp.obj; + } + + + +template<typename T> +inline +void_ptr +ptr_cast(blas_int (*function)(const std::complex<T>*, const std::complex<T>*)) + { + union converter + { + blas_int (*fn)(const std::complex<T>*, const std::complex<T>*); + void_ptr obj; + }; + + converter tmp; + + tmp.obj = 0; + tmp.fn = function; + + return tmp.obj; + } + + + +} // end of namespace qz_helper + + //! @} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/armadillo-7.400.3/include/armadillo_bits/fn_elem.hpp new/armadillo-7.500.0/include/armadillo_bits/fn_elem.hpp --- old/armadillo-7.400.3/include/armadillo_bits/fn_elem.hpp 2016-06-16 18:16:04.000000000 +0200 +++ new/armadillo-7.500.0/include/armadillo_bits/fn_elem.hpp 2016-06-16 18:16:06.000000000 +0200 @@ -441,6 +441,12 @@ // +// +// TODO: arg (C++11) + + + +// // square template<typename T1> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/armadillo-7.400.3/include/armadillo_bits/fn_qz.hpp new/armadillo-7.500.0/include/armadillo_bits/fn_qz.hpp --- old/armadillo-7.400.3/include/armadillo_bits/fn_qz.hpp 2016-06-16 18:16:04.000000000 +0200 +++ new/armadillo-7.500.0/include/armadillo_bits/fn_qz.hpp 2016-06-16 18:16:06.000000000 +0200 @@ -1,4 +1,4 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright (C) 2015-2016 National ICT Australia (NICTA) // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -30,12 +30,17 @@ Mat<typename T1::elem_type>& Q, Mat<typename T1::elem_type>& Z, const Base<typename T1::elem_type,T1>& A_expr, - const Base<typename T1::elem_type,T2>& B_expr + const Base<typename T1::elem_type,T2>& B_expr, + const char* select = "none" ) { arma_extra_debug_sigprint(); - const bool status = auxlib::qz(AA, BB, Q, Z, A_expr.get_ref(), B_expr.get_ref()); + const char sig = (select != NULL) ? select[0] : char(0); + + arma_debug_check( ( (sig != 'n') && (sig != 'l') && (sig != 'r') && (sig != 'i') && (sig != 'o') ), "qz(): unknown select form" ); + + const bool status = auxlib::qz(AA, BB, Q, Z, A_expr.get_ref(), B_expr.get_ref(), sig); if(status == false) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/armadillo-7.400.3/include/armadillo_bits/operator_cube_times.hpp new/armadillo-7.500.0/include/armadillo_bits/operator_cube_times.hpp --- old/armadillo-7.400.3/include/armadillo_bits/operator_cube_times.hpp 2016-06-16 18:16:04.000000000 +0200 +++ new/armadillo-7.500.0/include/armadillo_bits/operator_cube_times.hpp 2016-06-16 18:16:06.000000000 +0200 @@ -1,4 +1,4 @@ -// Copyright (C) 2008-2010 National ICT Australia (NICTA) +// Copyright (C) 2008-2016 National ICT Australia (NICTA) // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -80,5 +80,37 @@ } + +template<typename eT, typename T2> +arma_inline +Cube<eT> +operator* + ( + const subview_cube_each1<eT>& X, + const Base<eT,T2>& Y + ) + { + arma_extra_debug_sigprint(); + + return subview_cube_each1_aux::operator_times(X, Y.get_ref()); + } + + + +template<typename T1, typename eT> +arma_inline +Cube<eT> +operator* + ( + const Base<eT,T1>& X, + const subview_cube_each1<eT>& Y + ) + { + arma_extra_debug_sigprint(); + + return subview_cube_each1_aux::operator_times(X.get_ref(), Y); + } + + //! @} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/armadillo-7.400.3/include/armadillo_bits/subview_cube_each_bones.hpp new/armadillo-7.500.0/include/armadillo_bits/subview_cube_each_bones.hpp --- old/armadillo-7.400.3/include/armadillo_bits/subview_cube_each_bones.hpp 2016-06-16 18:16:04.000000000 +0200 +++ new/armadillo-7.500.0/include/armadillo_bits/subview_cube_each_bones.hpp 2016-06-16 18:16:06.000000000 +0200 @@ -1,4 +1,4 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright (C) 2015-2016 National ICT Australia (NICTA) // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -56,6 +56,7 @@ template<typename T1> inline void operator-= (const Base<eT,T1>& x); template<typename T1> inline void operator%= (const Base<eT,T1>& x); template<typename T1> inline void operator/= (const Base<eT,T1>& x); + template<typename T1> inline void operator*= (const Base<eT,T1>& x); private: @@ -116,6 +117,12 @@ template<typename T1, typename eT> static inline Cube<eT> operator_div(const Base<eT,T1>& X, const subview_cube_each1<eT>& Y); + + template<typename eT, typename T2> + static inline Cube<eT> operator_times(const subview_cube_each1<eT>& X,const Base<eT,T2>& Y); + + template<typename T1, typename eT> + static inline Cube<eT> operator_times(const Base<eT,T1>& X, const subview_cube_each1<eT>& Y); }; @@ -141,6 +148,8 @@ template<typename T1, typename eT, typename TB> static inline Cube<eT> operator_div(const Base<eT,T1>& X, const subview_cube_each2<eT,TB>& Y); + + // TODO: operator_times }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/armadillo-7.400.3/include/armadillo_bits/subview_cube_each_meat.hpp new/armadillo-7.500.0/include/armadillo_bits/subview_cube_each_meat.hpp --- old/armadillo-7.400.3/include/armadillo_bits/subview_cube_each_meat.hpp 2016-06-16 18:16:04.000000000 +0200 +++ new/armadillo-7.500.0/include/armadillo_bits/subview_cube_each_meat.hpp 2016-06-16 18:16:06.000000000 +0200 @@ -1,4 +1,4 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright (C) 2015-2016 National ICT Australia (NICTA) // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -207,6 +207,21 @@ +template<typename eT> +template<typename T1> +inline +void +subview_cube_each1<eT>::operator*= (const Base<eT,T1>& in) + { + arma_extra_debug_sigprint(); + + Cube<eT>& C = access::rw(subview_cube_each_common<eT>::P); + + C = C.each_slice() * in.get_ref(); + } + + + // // // subview_cube_each2 @@ -662,6 +677,68 @@ } return out; + } + + + +template<typename eT, typename T2> +inline +Cube<eT> +subview_cube_each1_aux::operator_times + ( + const subview_cube_each1<eT>& X, + const Base<eT,T2>& Y + ) + { + arma_extra_debug_sigprint(); + + const Cube<eT>& C = X.P; + + const unwrap<T2> tmp(Y.get_ref()); + const Mat<eT>& M = tmp.M; + + Cube<eT> out(C.n_rows, M.n_cols, C.n_slices); + + for(uword i=0; i < C.n_slices; ++i) + { + Mat<eT> out_slice( out.slice_memptr(i), C.n_rows, M.n_cols, false, true); + const Mat<eT> C_slice(const_cast<eT*>(C.slice_memptr(i)), C.n_rows, C.n_cols, false, true); + + out_slice = C_slice * M; + } + + return out; + } + + + +template<typename T1, typename eT> +inline +Cube<eT> +subview_cube_each1_aux::operator_times + ( + const Base<eT,T1>& X, + const subview_cube_each1<eT>& Y + ) + { + arma_extra_debug_sigprint(); + + const unwrap<T1> tmp(X.get_ref()); + const Mat<eT>& M = tmp.M; + + const Cube<eT>& C = Y.P; + + Cube<eT> out(M.n_rows, C.n_cols, C.n_slices); + + for(uword i=0; i < C.n_slices; ++i) + { + Mat<eT> out_slice( out.slice_memptr(i), M.n_rows, C.n_cols, false, true); + const Mat<eT> C_slice(const_cast<eT*>(C.slice_memptr(i)), C.n_rows, C.n_cols, false, true); + + out_slice = M * C_slice; + } + + return out; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/armadillo-7.400.3/include/armadillo_bits/subview_elem1_meat.hpp new/armadillo-7.500.0/include/armadillo_bits/subview_elem1_meat.hpp --- old/armadillo-7.400.3/include/armadillo_bits/subview_elem1_meat.hpp 2016-06-16 18:16:04.000000000 +0200 +++ new/armadillo-7.500.0/include/armadillo_bits/subview_elem1_meat.hpp 2016-06-16 18:16:06.000000000 +0200 @@ -27,6 +27,8 @@ , a(in_a) { arma_extra_debug_sigprint(); + + // TODO: refactor to unwrap 'in_a' instead of storing a ref to it; this will allow removal of carrying T1 around and repetition of size checks } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/armadillo-7.400.3/mex_interface/armaMex.hpp new/armadillo-7.500.0/mex_interface/armaMex.hpp --- old/armadillo-7.400.3/mex_interface/armaMex.hpp 2016-06-16 18:16:04.000000000 +0200 +++ new/armadillo-7.500.0/mex_interface/armaMex.hpp 2016-06-16 18:16:06.000000000 +0200 @@ -362,8 +362,8 @@ return Cube<double>(); } } - - + + // Get complex cube from Matlab/Octave inline cx_cube @@ -389,8 +389,7 @@ return cx_cube(); } } - - + // return real valued cube to Matlab/Octave template<class Type> inline @@ -403,7 +402,7 @@ std::memcpy(dst_pointer, src_pointer, sizeof(Type)*armaCube.n_elem); } - + // Return double real valued cube to Matlab/Octave inline void @@ -415,7 +414,7 @@ std::memcpy(dst_pointer, src_pointer, sizeof(double)*armaCube.n_elem); } - + // Return imaginary valued cube to Matlab/Octave. template<class Type> inline @@ -428,7 +427,7 @@ std::memcpy(dst_pointer, src_pointer, sizeof(Type)*armaCube.n_elem); } - + // Return double imaginary valued matrix to Matlab/Octave inline void @@ -574,8 +573,8 @@ return SpMat<double>(locations, values, m, n, sort_locations); } } - - + + // Get imaginary sparse matrix from Matlab/Octave. template<class Type> inline @@ -694,8 +693,8 @@ return SpMat<double>(locations, values, m, n, sort_locations); } } - - + + // Return sparse matrix to matlab inline void
participants (1)
-
root@hilbert.suse.de