diff -Nru armadillo-7.600.2+dfsg/CMakeLists.txt armadillo-7.950.1+dfsg/CMakeLists.txt --- armadillo-7.600.2+dfsg/CMakeLists.txt 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/CMakeLists.txt 2016-06-16 16:16:31.000000000 +0000 @@ -1,20 +1,24 @@ -# Copyright (C) 2008-2016 National ICT Australia (NICTA) +# Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +# Copyright 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 -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# ------------------------------------------------------------------- +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 # -# Written by Conrad Sanderson - http://conradsanderson.id.au -# Written by Ryan Curtin -# Written by Clement Creusot +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ------------------------------------------------------------------------ -cmake_minimum_required(VERSION 2.8 FATAL_ERROR) +cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) -project(armadillo CXX) +project(armadillo CXX C) include(CheckIncludeFileCXX) include(CheckLibraryExists) @@ -53,7 +57,49 @@ 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/") +# As Red Hat Enterprise Linux (and related systems such as Fedora) +# does not search /usr/local/lib by default, we need to place the +# library in either /usr/lib or /usr/lib64 + +if(NOT APPLE) + if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + message(STATUS "*** CMAKE_INSTALL_PREFIX was initalised by cmake to the default value of ${CMAKE_INSTALL_PREFIX}") + message(STATUS "*** CMAKE_INSTALL_PREFIX changed to /usr") + set(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "Standard install prefix" FORCE) + endif() +endif() + + +# Adhere to GNU filesystem layout conventions +include(GNUInstallDirs) + +# deprecated options +set(INSTALL_LIB_DIR "" CACHE STRING "deprecated; use CMAKE_INSTALL_LIBDIR instead") +set(INSTALL_INCLUDE_DIR "" CACHE STRING "deprecated; use CMAKE_INSTALL_INCLUDEDIR instead") +set(INSTALL_DATA_DIR "" CACHE STRING "deprecated; use CMAKE_INSTALL_DATADIR instead") +set(INSTALL_BIN_DIR "" CACHE STRING "deprecated; use CMAKE_INSTALL_BINDIR instead") + +if(INSTALL_LIB_DIR) + message(STATUS "*** INSTALL_LIB_DIR is deprecated; use CMAKE_INSTALL_LIBDIR instead") + set(CMAKE_INSTALL_LIBDIR "${INSTALL_LIB_DIR}") + GNUInstallDirs_get_absolute_install_dir(CMAKE_INSTALL_FULL_LIBDIR CMAKE_INSTALL_LIBDIR) +endif() + +if(INSTALL_INCLUDE_DIR) + message(STATUS "*** INSTALL_INCLUDE_DIR is deprecated; use CMAKE_INSTALL_INCLUDEDIR instead") + set(CMAKE_INSTALL_INCLUDEDIR "${INSTALL_INCLUDE_DIR}") + GNUInstallDirs_get_absolute_install_dir(CMAKE_INSTALL_FULL_INCLUDEDIR CMAKE_INSTALL_INCLUDEDIR) +endif() + +if(INSTALL_DATA_DIR) + message(STATUS "*** INSTALL_DATA_DIR is deprecated; use CMAKE_INSTALL_DATADIR instead") + set(CMAKE_INSTALL_DATADIR "${INSTALL_DATA_DIR}") +endif() + +if(INSTALL_BIN_DIR) + message(STATUS "*** INSTALL_BIN_DIR is deprecated; use CMAKE_INSTALL_BINDIR instead") + set(CMAKE_INSTALL_BINDIR "${INSTALL_BIN_DIR}") +endif() if(MSVC) @@ -62,8 +108,6 @@ option(BUILD_SHARED_LIBS "build shared library" ON) endif() -option(DETECT_PKG_CONFIG "Detect pkg-config and install pkg-config data, if found" ON) - option(DETECT_HDF5 "Detect HDF5 and include HDF5 support, if found" OFF) @@ -88,7 +132,6 @@ message(STATUS "CMAKE_CXX_COMPILER_VERSION = ${CMAKE_CXX_COMPILER_VERSION}") message(STATUS "CMAKE_COMPILER_IS_GNUCXX = ${CMAKE_COMPILER_IS_GNUCXX}" ) message(STATUS "BUILD_SHARED_LIBS = ${BUILD_SHARED_LIBS}" ) -message(STATUS "DETECT_PKG_CONFIG = ${DETECT_PKG_CONFIG}" ) message(STATUS "DETECT_HDF5 = ${DETECT_HDF5}" ) @@ -96,6 +139,8 @@ ## Find LAPACK and BLAS libraries, or their optimised versions ## +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake_aux/Modules/") + if(APPLE) set(ARMA_OS macos) @@ -228,9 +273,7 @@ endif() -if(DETECT_PKG_CONFIG) - find_package(PkgConfig) -endif() +find_package(PkgConfig) # set(DETECT_HDF5 true) @@ -240,7 +283,7 @@ ## cmake -D DETECT_HDF5=true . if(DETECT_HDF5) - find_package(HDF5 QUIET) + find_package(HDF5 QUIET COMPONENTS C) if(NOT HDF5_FOUND) # On Debian systems, the HDF5 package has been split into multiple packages @@ -353,6 +396,7 @@ add_library( armadillo ${PROJECT_SOURCE_DIR}/src/wrapper.cpp ) target_link_libraries( armadillo ${ARMA_LIBS} ) +target_include_directories(armadillo INTERFACE $ $) set_target_properties(armadillo PROPERTIES VERSION ${ARMA_VERSION_MAJOR}.${ARMA_VERSION_MINOR_ALT}.${ARMA_VERSION_PATCH} SOVERSION ${ARMA_VERSION_MAJOR}) @@ -360,73 +404,17 @@ # INSTALL CONFIGURATION -# As Red Hat Enterprise Linux (and related systems such as Fedora) -# does not search /usr/local/lib by default, we need to place the -# library in either /usr/lib or /usr/lib64 - -if(NOT APPLE) - if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - message(STATUS "*** CMAKE_INSTALL_PREFIX was initalised by cmake to the default value of ${CMAKE_INSTALL_PREFIX}") - message(STATUS "*** CMAKE_INSTALL_PREFIX changed to /usr") - unset(CMAKE_INSTALL_PREFIX) - set(CMAKE_INSTALL_PREFIX "/usr") - #set(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "install prefix" FORCE) - endif() -endif() - -# Allow for the "lib" directory to be specified on the command line -if(NOT INSTALL_LIB_DIR) - set(INSTALL_LIB_DIR "lib") - if(UNIX AND NOT APPLE) # I don't know how Mac OS handles 64 bit systems - if(CMAKE_SIZEOF_VOID_P EQUAL 8) - message(STATUS "*** Detected 64 bit system") - # use "lib64" only on systems that have it (eg. Fedora, Red Hat). - # if installing in /usr/local/, the use of lib64 might be unreliable on systems which have /usr/local/lib64 but don't use it - if(IS_DIRECTORY "${CMAKE_INSTALL_PREFIX}/lib64") - unset(INSTALL_LIB_DIR) - set(INSTALL_LIB_DIR "lib64") - message(STATUS "*** ${CMAKE_INSTALL_PREFIX}/lib64/ exists, so destination directory for the run-time library changed to ${CMAKE_INSTALL_PREFIX}/lib64/") - message(STATUS "*** Your system and/or compiler must search ${CMAKE_INSTALL_PREFIX}/lib64/ during linking") - endif() - endif() - endif() -endif() - -# Allow for the "include" directory to be specified on the command line - -if(NOT INSTALL_INCLUDE_DIR) - set(INSTALL_INCLUDE_DIR "include") -endif() - -# We use data dir to store files shared with other programs -# like the ArmadilloConfig.cmake file. -if(NOT INSTALL_DATA_DIR) - set(INSTALL_DATA_DIR "share") -endif() - -# executables destination -if(NOT INSTALL_BIN_DIR) - set(INSTALL_BIN_DIR "bin") -endif() - -# Make relative paths absolute so we can write them in Config.cmake files -foreach(p LIB INCLUDE DATA BIN) - set(var INSTALL_${p}_DIR) - if(NOT IS_ABSOLUTE "${${var}}") - set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}") - endif() -endforeach() - -message(STATUS "CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}") -message(STATUS "INSTALL_LIB_DIR = ${INSTALL_LIB_DIR}" ) -message(STATUS "INSTALL_INCLUDE_DIR = ${INSTALL_INCLUDE_DIR}" ) -message(STATUS "INSTALL_DATA_DIR = ${INSTALL_DATA_DIR}" ) -message(STATUS "INSTALL_BIN_DIR = ${INSTALL_BIN_DIR}" ) +message(STATUS "" ) +message(STATUS "CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}" ) +message(STATUS "CMAKE_INSTALL_LIBDIR = ${CMAKE_INSTALL_LIBDIR}" ) +message(STATUS "CMAKE_INSTALL_INCLUDEDIR = ${CMAKE_INSTALL_INCLUDEDIR}") +message(STATUS "CMAKE_INSTALL_DATADIR = ${CMAKE_INSTALL_DATADIR}" ) +message(STATUS "CMAKE_INSTALL_BINDIR = ${CMAKE_INSTALL_BINDIR}" ) # Note that the trailing / character in "include/" is critical -install(DIRECTORY ${PROJECT_BINARY_DIR}/tmp/include/ DESTINATION ${INSTALL_INCLUDE_DIR} +install(DIRECTORY ${PROJECT_BINARY_DIR}/tmp/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} PATTERN ".svn" EXCLUDE PATTERN "*.cmake" EXCLUDE PATTERN "*~" EXCLUDE @@ -434,9 +422,9 @@ ) install(TARGETS armadillo EXPORT ArmadilloLibraryDepends - ARCHIVE DESTINATION ${INSTALL_LIB_DIR} - LIBRARY DESTINATION ${INSTALL_LIB_DIR} - RUNTIME DESTINATION ${INSTALL_BIN_DIR}) + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) # Export the package for use from the build-tree # (this registers the build-tree with a global CMake-registry) @@ -444,7 +432,7 @@ ## LOCAL FILES # Create ArmadilloConfig.cmake file for the use from the build tree -set(ARMADILLO_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}") +set(ARMADILLO_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/tmp/include") set(ARMADILLO_LIB_DIR "${PROJECT_BINARY_DIR}") set(ARMADILLO_CMAKE_DIR "${PROJECT_BINARY_DIR}") @@ -460,16 +448,16 @@ # Install the export set for use with the install-tree install(EXPORT ArmadilloLibraryDepends DESTINATION - "${INSTALL_DATA_DIR}/Armadillo/CMake" + "${CMAKE_INSTALL_DATADIR}/Armadillo/CMake" COMPONENT dev) ## GLOBAL INSTALL FILES # Create ArmadilloConfig.cmake file for the use from the install tree # and install it -set(ARMADILLO_INCLUDE_DIRS "${INSTALL_INCLUDE_DIR}") -set(ARMADILLO_LIB_DIR "${INSTALL_LIB_DIR}") -set(ARMADILLO_CMAKE_DIR "${INSTALL_DATA_DIR}/Armadillo/CMake") +set(ARMADILLO_INCLUDE_DIRS "${CMAKE_INSTALL_FULL_INCLUDEDIR}") +set(ARMADILLO_LIB_DIR "${CMAKE_INSTALL_FULL_LIBDIR}") +set(ARMADILLO_CMAKE_DIR "${CMAKE_INSTALL_FULL_DATADIR}/Armadillo/CMake") message(STATUS "Generating '${PROJECT_BINARY_DIR}/InstallFiles/ArmadilloConfig.cmake'") @@ -488,16 +476,12 @@ DESTINATION "${ARMADILLO_CMAKE_DIR}" COMPONENT dev) -if(PKG_CONFIG_FOUND) - message(STATUS "Copying ${PROJECT_SOURCE_DIR}/misc/ to ${PROJECT_BINARY_DIR}/tmp/misc/") - file(COPY ${PROJECT_SOURCE_DIR}/misc/ DESTINATION ${PROJECT_BINARY_DIR}/tmp/misc/) +# pkgconfig related - message(STATUS "Generating '${PROJECT_BINARY_DIR}/tmp/misc/armadillo.pc'") - configure_file(${PROJECT_BINARY_DIR}/tmp/misc/armadillo.pc.in "${PROJECT_BINARY_DIR}/tmp/misc/armadillo.pc" @ONLY) - - if(NOT PKG_CONFIG_DIR) - set(PKG_CONFIG_DIR "${INSTALL_LIB_DIR}/pkgconfig") - endif() - - install(FILES "${PROJECT_BINARY_DIR}/tmp/misc/armadillo.pc" DESTINATION ${PKG_CONFIG_DIR}) -endif() +message(STATUS "Copying ${PROJECT_SOURCE_DIR}/misc/ to ${PROJECT_BINARY_DIR}/tmp/misc/") +file(COPY ${PROJECT_SOURCE_DIR}/misc/ DESTINATION ${PROJECT_BINARY_DIR}/tmp/misc/) + +message(STATUS "Generating '${PROJECT_BINARY_DIR}/tmp/misc/armadillo.pc'") +configure_file(${PROJECT_BINARY_DIR}/tmp/misc/armadillo.pc.in "${PROJECT_BINARY_DIR}/tmp/misc/armadillo.pc" @ONLY) + +install(FILES "${PROJECT_BINARY_DIR}/tmp/misc/armadillo.pc" DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) diff -Nru armadillo-7.600.2+dfsg/debian/changelog armadillo-7.950.1+dfsg/debian/changelog --- armadillo-7.600.2+dfsg/debian/changelog 2017-02-19 06:54:41.000000000 +0000 +++ armadillo-7.950.1+dfsg/debian/changelog 2017-06-20 15:06:34.000000000 +0000 @@ -1,3 +1,21 @@ +armadillo (1:7.950.1+dfsg-1) unstable; urgency=medium + + * New upstream release + + -- Kumar Appaiah Tue, 20 Jun 2017 20:36:34 +0530 + +armadillo (1:7.900.1+dfsg-2) experimental; urgency=medium + + * Update copyright to reflect Apache License + + -- Kumar Appaiah Tue, 16 May 2017 07:08:51 +0530 + +armadillo (1:7.900.1+dfsg-1) experimental; urgency=medium + + * New upstream release + + -- Kumar Appaiah Mon, 15 May 2017 20:42:34 +0530 + armadillo (1:7.600.2+dfsg-2) unstable; urgency=medium * Add patch for conv_alias from upstream diff -Nru armadillo-7.600.2+dfsg/debian/compat armadillo-7.950.1+dfsg/debian/compat --- armadillo-7.600.2+dfsg/debian/compat 2017-02-19 05:42:23.000000000 +0000 +++ armadillo-7.950.1+dfsg/debian/compat 2017-06-20 15:06:34.000000000 +0000 @@ -1 +1 @@ -7 +9 diff -Nru armadillo-7.600.2+dfsg/debian/copyright armadillo-7.950.1+dfsg/debian/copyright --- armadillo-7.600.2+dfsg/debian/copyright 2017-02-19 05:42:23.000000000 +0000 +++ armadillo-7.950.1+dfsg/debian/copyright 2017-06-20 15:06:34.000000000 +0000 @@ -7,384 +7,13 @@ *pdf Files: * -Copyright: Copyright (C) 2008-2015 National ICT Australia (NICTA) -License: MPL - Mozilla Public License Version 2.0 - ================================== +Copyright: Copyright (C) 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) + Copyright (C) 2008-2016 National ICT Australia (NICTA) +License: Apache-2.0 + This package is licensed under the Apache 2.0 License. On + Debian systems, the complete text of the GNU General Public License + can be found in `/usr/share/common-licenses/Apache-2.0'. . - 1. Definitions - -------------- - . - 1.1. "Contributor" - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - . - 1.2. "Contributor Version" - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - . - 1.3. "Contribution" - means Covered Software of a particular Contributor. - . - 1.4. "Covered Software" - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - . - 1.5. "Incompatible With Secondary Licenses" - means - . - (a) that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or - . - (b) that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - . - 1.6. "Executable Form" - means any form of the work other than Source Code Form. - . - 1.7. "Larger Work" - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - . - 1.8. "License" - means this document. - . - 1.9. "Licensable" - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - . - 1.10. "Modifications" - means any of the following: - . - (a) any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or - . - (b) any new file in Source Code Form that contains any Covered - Software. - . - 1.11. "Patent Claims" of a Contributor - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - . - 1.12. "Secondary License" - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - . - 1.13. "Source Code Form" - means the form of the work preferred for making modifications. - . - 1.14. "You" (or "Your") - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, "control" means (a) the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or (b) ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - . - 2. License Grants and Conditions - -------------------------------- - . - 2.1. Grants - . - Each Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - . - (a) under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - . - (b) under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - . - 2.2. Effective Date - . - The licenses granted in Section 2.1 with respect to any Contribution - become effective for each Contribution on the date the Contributor first - distributes such Contribution. - . - 2.3. Limitations on Grant Scope - . - The licenses granted in this Section 2 are the only rights granted under - this License. No additional rights or licenses will be implied from the - distribution or licensing of Covered Software under this License. - Notwithstanding Section 2.1(b) above, no patent license is granted by a - Contributor: - . - (a) for any code that a Contributor has removed from Covered Software; - or - . - (b) for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - . - (c) under Patent Claims infringed by Covered Software in the absence of - its Contributions. - . - This License does not grant any rights in the trademarks, service marks, - or logos of any Contributor (except as may be necessary to comply with - the notice requirements in Section 3.4). - . - 2.4. Subsequent Licenses - . - No Contributor makes additional grants as a result of Your choice to - distribute the Covered Software under a subsequent version of this - License (see Section 10.2) or under the terms of a Secondary License (if - permitted under the terms of Section 3.3). - . - 2.5. Representation - . - Each Contributor represents that the Contributor believes its - Contributions are its original creation(s) or it has sufficient rights - to grant the rights to its Contributions conveyed by this License. - . - 2.6. Fair Use - . - This License is not intended to limit any rights You have under - applicable copyright doctrines of fair use, fair dealing, or other - equivalents. - . - 2.7. Conditions - . - Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted - in Section 2.1. - . - 3. Responsibilities - ------------------- - . - 3.1. Distribution of Source Form - . - All distribution of Covered Software in Source Code Form, including any - Modifications that You create or to which You contribute, must be under - the terms of this License. You must inform recipients that the Source - Code Form of the Covered Software is governed by the terms of this - License, and how they can obtain a copy of this License. You may not - attempt to alter or restrict the recipients' rights in the Source Code - Form. - . - 3.2. Distribution of Executable Form - . - If You distribute Covered Software in Executable Form then: - . - (a) such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - . - (b) You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - . - 3.3. Distribution of a Larger Work - . - You may create and distribute a Larger Work under terms of Your choice, - provided that You also comply with the requirements of this License for - the Covered Software. If the Larger Work is a combination of Covered - Software with a work governed by one or more Secondary Licenses, and the - Covered Software is not Incompatible With Secondary Licenses, this - License permits You to additionally distribute such Covered Software - under the terms of such Secondary License(s), so that the recipient of - the Larger Work may, at their option, further distribute the Covered - Software under the terms of either this License or such Secondary - License(s). - . - 3.4. Notices - . - You may not remove or alter the substance of any license notices - (including copyright notices, patent notices, disclaimers of warranty, - or limitations of liability) contained within the Source Code Form of - the Covered Software, except that You may alter any license notices to - the extent required to remedy known factual inaccuracies. - . - 3.5. Application of Additional Terms - . - You may choose to offer, and to charge a fee for, warranty, support, - indemnity or liability obligations to one or more recipients of Covered - Software. However, You may do so only on Your own behalf, and not on - behalf of any Contributor. You must make it absolutely clear that any - such warranty, support, indemnity, or liability obligation is offered by - You alone, and You hereby agree to indemnify every Contributor for any - liability incurred by such Contributor as a result of warranty, support, - indemnity or liability terms You offer. You may include additional - disclaimers of warranty and limitations of liability specific to any - jurisdiction. - . - 4. Inability to Comply Due to Statute or Regulation - --------------------------------------------------- - . - If it is impossible for You to comply with any of the terms of this - License with respect to some or all of the Covered Software due to - statute, judicial order, or regulation then You must: (a) comply with - the terms of this License to the maximum extent possible; and (b) - describe the limitations and the code they affect. Such description must - be placed in a text file included with all distributions of the Covered - Software under this License. Except to the extent prohibited by statute - or regulation, such description must be sufficiently detailed for a - recipient of ordinary skill to be able to understand it. - . - 5. Termination - -------------- - . - 5.1. The rights granted under this License will terminate automatically - if You fail to comply with any of its terms. However, if You become - compliant, then the rights granted under this License from a particular - Contributor are reinstated (a) provisionally, unless and until such - Contributor explicitly and finally terminates Your grants, and (b) on an - ongoing basis, if such Contributor fails to notify You of the - non-compliance by some reasonable means prior to 60 days after You have - come back into compliance. Moreover, Your grants from a particular - Contributor are reinstated on an ongoing basis if such Contributor - notifies You of the non-compliance by some reasonable means, this is the - first time You have received notice of non-compliance with this License - from such Contributor, and You become compliant prior to 30 days after - Your receipt of the notice. - . - 5.2. If You initiate litigation against any entity by asserting a patent - infringement claim (excluding declaratory judgment actions, - counter-claims, and cross-claims) alleging that a Contributor Version - directly or indirectly infringes any patent, then the rights granted to - You by any and all Contributors for the Covered Software under Section - 2.1 of this License shall terminate. - . - 5.3. In the event of termination under Sections 5.1 or 5.2 above, all - end user license agreements (excluding distributors and resellers) which - have been validly granted by You or Your distributors under this License - prior to termination shall survive termination. - . - ************************************************************************ - * * - * 6. Disclaimer of Warranty * - * ------------------------- * - * * - * Covered Software is provided under this License on an "as is" * - * basis, without warranty of any kind, either expressed, implied, or * - * statutory, including, without limitation, warranties that the * - * Covered Software is free of defects, merchantable, fit for a * - * particular purpose or non-infringing. The entire risk as to the * - * quality and performance of the Covered Software is with You. * - * Should any Covered Software prove defective in any respect, You * - * (not any Contributor) assume the cost of any necessary servicing, * - * repair, or correction. This disclaimer of warranty constitutes an * - * essential part of this License. No use of any Covered Software is * - * authorized under this License except under this disclaimer. * - * * - ************************************************************************ - . - ************************************************************************ - * * - * 7. Limitation of Liability * - * -------------------------- * - * * - * Under no circumstances and under no legal theory, whether tort * - * (including negligence), contract, or otherwise, shall any * - * Contributor, or anyone who distributes Covered Software as * - * permitted above, be liable to You for any direct, indirect, * - * special, incidental, or consequential damages of any character * - * including, without limitation, damages for lost profits, loss of * - * goodwill, work stoppage, computer failure or malfunction, or any * - * and all other commercial damages or losses, even if such party * - * shall have been informed of the possibility of such damages. This * - * limitation of liability shall not apply to liability for death or * - * personal injury resulting from such party's negligence to the * - * extent applicable law prohibits such limitation. Some * - * jurisdictions do not allow the exclusion or limitation of * - * incidental or consequential damages, so this exclusion and * - * limitation may not apply to You. * - * * - ************************************************************************ - . - 8. Litigation - ------------- - . - Any litigation relating to this License may be brought only in the - courts of a jurisdiction where the defendant maintains its principal - place of business and such litigation shall be governed by laws of that - jurisdiction, without reference to its conflict-of-law provisions. - Nothing in this Section shall prevent a party's ability to bring - cross-claims or counter-claims. - . - 9. Miscellaneous - ---------------- - . - This License represents the complete agreement concerning the subject - matter hereof. If any provision of this License is held to be - unenforceable, such provision shall be reformed only to the extent - necessary to make it enforceable. Any law or regulation which provides - that the language of a contract shall be construed against the drafter - shall not be used to construe this License against a Contributor. - . - 10. Versions of the License - --------------------------- - . - 10.1. New Versions - . - Mozilla Foundation is the license steward. Except as provided in Section - 10.3, no one other than the license steward has the right to modify or - publish new versions of this License. Each version will be given a - distinguishing version number. - . - 10.2. Effect of New Versions - . - You may distribute the Covered Software under the terms of the version - of the License under which You originally received the Covered Software, - or under the terms of any subsequent version published by the license - steward. - . - 10.3. Modified Versions - . - If you create software not governed by this License, and you want to - create a new license for such software, you may create and use a - modified version of this License if you rename the license and remove - any references to the name of the license steward (except to note that - such modified license differs from this License). - . - 10.4. Distributing Source Code Form that is Incompatible With Secondary - Licenses - . - If You choose to distribute Source Code Form that is Incompatible With - Secondary Licenses under the terms of this version of the License, the - notice described in Exhibit B of this License must be attached. - . - Exhibit A - Source Code Form License Notice - ------------------------------------------- - . - 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 - file, You can obtain one at http://mozilla.org/MPL/2.0/. - . - If it is not possible or desirable to put the notice in a particular - file, then You may include the notice in a location (such as a LICENSE - file in a relevant directory) where a recipient would be likely to look - for such a notice. - . - You may add additional accurate notices of copyright ownership. - . - Exhibit B - "Incompatible With Secondary Licenses" Notice - --------------------------------------------------------- - . - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. - . - All files: - Copyright (C) 2008-2015 National ICT Australia (NICTA) Upstream Author: Conrad Sanderson (Change first `!' to `@', second one to `.') Main developers: - Conrad Sanderson - http://itee.uq.edu.au/~conrad/ diff -Nru armadillo-7.600.2+dfsg/debian/patches/conv_alias_fix.patch armadillo-7.950.1+dfsg/debian/patches/conv_alias_fix.patch --- armadillo-7.600.2+dfsg/debian/patches/conv_alias_fix.patch 2017-02-19 06:36:43.000000000 +0000 +++ armadillo-7.950.1+dfsg/debian/patches/conv_alias_fix.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ -diff --git a/include/armadillo_bits/glue_conv_meat.hpp b/include/armadillo_bits/glue_conv_meat.hpp -index eb515c4a..d3b7a7f2 100644 ---- a/include/armadillo_bits/glue_conv_meat.hpp -+++ b/include/armadillo_bits/glue_conv_meat.hpp -@@ -28,8 +28,6 @@ glue_conv::apply(Mat& out, const Mat& A, const Mat& B, const bool A_ - const uword x_n_elem = x.n_elem; - const uword out_n_elem = ((h_n_elem + x_n_elem) > 0) ? (h_n_elem + x_n_elem - 1) : uword(0); - -- (A_is_col) ? out.set_size(out_n_elem, 1) : out.set_size(1, out_n_elem); -- - if( (h_n_elem == 0) || (x_n_elem == 0) ) { out.zeros(); return; } - - -@@ -52,6 +50,8 @@ glue_conv::apply(Mat& out, const Mat& A, const Mat& B, const bool A_ - arrayops::copy( &(xx_mem[h_n_elem_m1]), x_mem, x_n_elem ); - - -+ (A_is_col) ? out.set_size(out_n_elem, 1) : out.set_size(1, out_n_elem); -+ - eT* out_mem = out.memptr(); - - for(uword i=0; i < out_n_elem; ++i) -@@ -132,10 +132,9 @@ glue_conv2::apply(Mat& out, const Mat& A, const Mat& B) - const uword out_n_rows = ((W.n_rows + G.n_rows) > 0) ? (W.n_rows + G.n_rows - 1) : uword(0); - const uword out_n_cols = ((W.n_cols + G.n_cols) > 0) ? (W.n_cols + G.n_cols - 1) : uword(0); - -- out.set_size( out_n_rows, out_n_cols ); -- - if(G.is_empty() || W.is_empty()) { out.zeros(); return; } - -+ - Mat H(G.n_rows, G.n_cols); // flipped filter coefficients - - const uword H_n_rows = H.n_rows; -@@ -159,6 +158,9 @@ glue_conv2::apply(Mat& out, const Mat& A, const Mat& B) - - X( H_n_rows_m1, H_n_cols_m1, arma::size(W) ) = W; // zero padded version of 2D image - -+ -+ out.set_size( out_n_rows, out_n_cols ); -+ - for(uword col=0; col < out_n_cols; ++col) - { - eT* out_colptr = out.colptr(col); diff -Nru armadillo-7.600.2+dfsg/debian/patches/series armadillo-7.950.1+dfsg/debian/patches/series --- armadillo-7.600.2+dfsg/debian/patches/series 2017-02-19 06:33:02.000000000 +0000 +++ armadillo-7.950.1+dfsg/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -conv_alias_fix.patch diff -Nru armadillo-7.600.2+dfsg/docs.html armadillo-7.950.1+dfsg/docs.html --- armadillo-7.600.2+dfsg/docs.html 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/docs.html 2016-06-16 16:16:31.000000000 +0000 @@ -1,14 +1,19 @@ @@ -144,7 +149,7 @@ [top] -API Documentation for Armadillo 7.600 +API Documentation for Armadillo 7.950


@@ -185,7 +190,7 @@
  • -Please cite the following article if you use Armadillo in your research or software. +Please cite the following article if you use Armadillo in your research and/or software. Citations are useful for the continued development and maintenance of the library.

    @@ -356,11 +361,11 @@ cross cross product cumsum cumulative sum cumprod cumulative product -det / log_det determinant +det determinant diagmat generate diagonal matrix from given matrix or vector diagvec extract specified diagonal diff differences between adjacent elements -dot/cdot/norm_dot dot product +dot / cdot / norm_dot dot product eps obtain distance of each element to next largest floating point representation expmat matrix exponential expmat_sym matrix exponential (symmetric) @@ -377,34 +382,35 @@ join_rows / join_cols concatenation of matrices join_slices concatenation of cubes kron Kronecker tensor product -logmat matrix logarithm +log_det log determinant +logmat matrix logarithm logmat_sympd matrix logarithm (symmetric) min / max return extremum values -nonzeros return non-zero values +nonzeros return non-zero values norm various norms of vectors and matrices normalise normalise vectors to unit p-norm -prod product of elements +prod product of elements rank rank of matrix rcond reciprocal of condition number -repmat replicate matrix in block-like fashion +repmat replicate matrix in block-like fashion reshape change size while keeping elements resize change size while keeping elements and preserving layout -shift shift elements +shift shift elements shuffle randomly shuffle elements size obtain dimensions of given object -sort sort elements +sort sort elements sort_index vector describing sorted order of elements sqrtmat square root of matrix -sqrtmat_sympd square root of matrix (symmetric) +sqrtmat_sympd square root of matrix (symmetric) sum sum of elements sub2ind convert subscripts to linear index -symmatu / symmatl generate symmetric matrix from given matrix +symmatu / symmatl generate symmetric matrix from given matrix trace sum of diagonal elements trans transpose of matrix -trapz trapezoidal numerical integration -trimatu / trimatl generate triangular matrix from given matrix +trapz trapezoidal numerical integration +trimatu / trimatl copy upper/lower triangular part unique return unique elements -vectorise convert matrix to vector +vectorise convert matrix to vector misc functions miscellaneous element-wise functions: exp, log, pow, sqrt, round, sign, ... trig functions trigonometric element-wise functions: cos, sin, ... @@ -464,6 +470,8 @@ fft / ifft 1D fast Fourier transform and its inverse fft2 / ifft2 2D fast Fourier transform and its inverse interp1 1D interpolation +polyfit find polynomial coefficients for data fitting +polyval evaluate polynomial
@@ -502,7 +510,7 @@ Matlab/Armadillo syntax differences examples of Matlab syntax and conceptually corresponding Armadillo syntax example program short example program config.hpp configuration options -API additions API version policy and list of API additions +API additions API stability and list of API additions @@ -1823,7 +1831,7 @@
  • element-wise functions: abs(), imag(), real(), conj(), sqrt(), square(), floor(), ceil(), round(), trunc(), sign()
  • scalar functions of matrices: accu(), as_scalar(), dot(), norm(), trace()
  • vector valued functions of matrices: min(), max(), nonzeros(), sum(), mean(), var()
  • -
  • matrix valued functions of matrices: diagmat(), join_rows(), join_cols(), repmat(), reshape(), resize(), .t(), trans()
  • +
  • matrix valued functions of matrices: diagmat(), trimatu()/trimatl(), symmatu()/symmatl(), join_rows(), join_cols(), repmat(), reshape(), resize(), .t(), trans()
  • generated matrices: speye(), spones(), sprandu()/sprandn()
  • eigen and svd decomposition: eigs_sym(), eigs_gen(), svds()
  • solution of sparse linear systems: spsolve() @@ -4426,6 +4434,15 @@

  • +Iterators for dense matrices and vectors traverse over all elements +
  • +
    +
  • +Iterators for sparse matrices traverse over non-zero elements; +
    caveat: writing a zero value into a sparse matrix through an iterator will invalidate all current iterators associated with the sparse matrix +
  • +
    +
  • Iterator types:

    @@ -5115,7 +5132,8 @@

  • -This function should be used sparingly and only in cases where it is absolutely necessary; indiscriminate use can cause slow downs +This function should be used sparingly and only in cases where it is absolutely necessary; +indiscriminate use can cause performance degradations

  • @@ -7450,7 +7468,6 @@


    det( A ) -
    log_det( val, sign, A )
    • Determinant of square matrix A @@ -7461,24 +7478,16 @@

    • -log_det(): find the log determinant, such that the determinant is equal to exp(val)*sign -
    • -
      -
    • -Caveat: for large matrices log_det() is more precise than det() +Caveat: for large matrices log_det() is more precise than det()

    • Examples:
        -mat    A = randu<mat>(5,5);
        -double x = det(A);
        -
        -double val;
        -double sign;
        +mat A(5,5,fill::randu);
         
        -log_det(val, sign, A);
        +double x = det(A);
         
    • @@ -7486,6 +7495,7 @@
    • See also: @@ -7517,11 +7527,11 @@

    • -For k > 0, the k-th super-diagonal is used (top-right corner) +For k > 0, the k-th super-diagonal is used (above main diagonal, towards top-right corner)

    • -For k < 0, the k-th sub-diagonal is used (bottom-left corner) +For k < 0, the k-th sub-diagonal is used (below main diagonal, towards bottom-left corner)

    • @@ -8484,6 +8494,73 @@


    + + + + + + +
    log_det( val, sign, A )   (form 1)
    complex result = log_det( A )   (form 2)
    +
      +
    • +Log determinant of square matrix A +
    • +
      +
    • +If A is not square sized, a std::logic_error exception is thrown +
    • +
      +
    • form 1: store the calculated log determinant in val and sign +
      the determinant is equal to exp(val)*sign +
    • +
      +
    • form 2: return the complex log determinant +
        +
      • +if matrix A is real and the determinant is positive: +
          +
        • the real part of the result is the log determinant
        • +
        • the imaginary part is zero
        • +
        +
      • +
      • +if matrix A is real and the determinant is negative: +
          +
        • the real part of the result is the log of the absolute value of the determinant
        • +
        • the imaginary part is equal to datum::pi
        • +
        +
      • +
      +
      +
    • +Examples: +
        +
        +mat A(5,5,fill::randu);
        +
        +double val;
        +double sign;
        +
        +log_det(val, sign, A);          // form 1
        +
        +cx_double result = log_det(A);  // form 2
        +
        +
      +
    • +
      +
    • +See also: + +
    • +
      +
    + +


    B = logmat(A)
    logmat(B, A) @@ -8653,6 +8730,7 @@
  • .min() & .max() (member functions)
  • index_min() & index_max()
  • clamp() +
  • statistics functions
  • running_stat
  • running_stat_vec
  • @@ -8690,6 +8768,7 @@
    @@ -9114,7 +9193,7 @@
  • -N can be positive of negative +N can be positive or negative

  • @@ -9719,14 +9798,33 @@


    trimatu( A ) +
    trimatu( A, k ) +

    trimatl( A ) +
    trimatl( A, k )
    • -trimatu(A): generate upper triangular matrix from square matrix A +Create a new matrix by copying either the upper or lower triangular part from square matrix A, and setting the remaining elements to zero +
        +
      • trimatu() copies the upper triangular part
      • +
      • trimatl() copies the lower triangular part
      • +

    • -trimatl(A): generate lower triangular matrix from square matrix A +The argument k specifies the diagonal which inclusively delineates the boundary of the triangular part +
        +
      • +for k > 0, the k-th super-diagonal is used (above main diagonal, towards top-right corner) +
      • +
      • +for k < 0, the k-th sub-diagonal is used (below main diagonal, towards bottom-left corner) +
      • +
      +
    • +
      +
    • +The argument k is optional; by default the main diagonal is used (k=0)

    • @@ -9739,8 +9837,11 @@
       mat A = randu<mat>(5,5);
       
      -mat U = trimatu(A);
      -mat L = trimatl(A);
      +mat U  = trimatu(A);
      +mat L  = trimatl(A);
      +
      +mat UU = trimatu(A,  1);  // omit the main diagonal
      +mat LL = trimatl(A, -1);  // omit the main diagonal
       
  • @@ -9749,6 +9850,7 @@ @@ -9833,10 +9935,11 @@
  • See also:

  • @@ -11343,7 +11446,7 @@ - + @@ -11367,7 +11470,15 @@
    -
  • Caveat: there is currently no check whether X is symmetric
  • +
  • Caveats: +
      +
    • there is currently no check whether X is symmetric
    • +
    • +it's more difficult to compute the smallest eigenvalues than the largest eigenvalues; +
      if the decomposition fails, try increasing k (number of eigenvalues) and/or the tolerance +
    • +
    +

  • Examples: @@ -11425,7 +11536,7 @@
  • "lm" = obtain eigenvalues with largest magnitude (default operation)
    "sm" = obtain eigenvalues with smallest magnitude
    "sm" = obtain eigenvalues with smallest magnitude (see caveat below)
    "la" = obtain eigenvalues with largest algebraic value
    "sa" = obtain eigenvalues with smallest algebraic value
    - + @@ -11455,6 +11566,10 @@
    +
  • Caveat: it's more difficult to compute the smallest eigenvalues than the largest eigenvalues; +
    if the decomposition fails, try increasing k (number of eigenvalues) and/or the tolerance +
  • +
  • Examples:
      @@ -11988,6 +12103,7 @@
    • See also: +


      + +P = polyfit( X, Y, N ) +
      polyfit( P, X, Y, N ) +
        +
      • +Given a 1D function specified in vectors X and Y +(where X holds independent values and Y holds the corresponding dependent values), +
        model the function as a polynomial of order N and store the polynomial coefficients in column vector P +
      • +
        +
      • +The given function is modelled as: +
          +y = p0xN + + p1xN-1 + + p2xN-2 + + ... + + pN-1x1 + + pN +
        +where pi is the i-th polynomial coefficient; the coefficients are selected to minimise the overall error of the fit (least squares) +
      • +
        +
      • +The column vector P has N+1 coefficients +
      • +
        +
      • +N must be smaller than the number of elements in X +
      • +
        +
      • If the polynomial coefficients cannot be found: +
          +
        • P = polyfit( X, Y, N ) resets P and throws a std::runtime_error exception
        • +
        • polyfit( P, X, Y, N ) resets P and returns a bool set to false (exception is not thrown)
        • +
        +
      • +
        +
      • +Examples: +
          +
          +vec x = linspace<vec>(0,4*datum::pi,100);
          +vec y = cos(x);
          +
          +vec p = polyfit(x,y,10);
          +
          +
        +
      • +
        +
      • +See also: + +
      • +
        +
      + +


      + +Y = polyval( P, X ) +
        +
      • +Given vector P of polynomial coefficients and vector X containing the independent values of a 1D function, +
        generate vector Y which contains the corresponding dependent values +
      • +
        +
      • +For each x value in vector X, the corresponding y value in vector Y is generated using: +
          +y = p0xN + + p1xN-1 + + p2xN-2 + + ... + + pN-1x1 + + pN +
        +where pi is the i-th polynomial coefficient in vector P +
      • +
        +
      • +P must contain polynomial coefficients in descending powers (eg. generated by the polyfit() function) +
      • +
        +
      • +Examples: +
          +
          +vec x1 = linspace<vec>(0,4*datum::pi,100);
          +vec y1 = cos(x1);
          +vec p1 = polyfit(x1,y1,10);
          +
          +vec y2 = polyval(p1,x1);
          +
          +
        +
      • +
        +
      • +See also: + +
      • +
        +
      +
      @@ -12011,7 +12242,7 @@


      -mean, median, stddev, var +mean, median, stddev, var, range
  • "lm" = obtain eigenvalues with largest magnitude (default operation)
    "sm" = obtain eigenvalues with smallest magnitude
    "sm" = obtain eigenvalues with smallest magnitude (see caveat below)
    "lr" = obtain eigenvalues with largest real part
    "sr" = obtain eigenvalues with smallest real part
    "li" = obtain eigenvalues with largest imaginary part
    @@ -12095,6 +12326,23 @@ ⎭  + + + + +
    + range( V ) +
    range( M ) +
    range( M, dim ) +
    +
    +
    +     + + ⎫ 
    + ⎬  range (difference between max and min)
    + ⎭  +
  • @@ -12148,6 +12396,7 @@
  • diff()
  • hist()
  • histc()
  • +
  • min() & max()
  • running_stat - class for running statistics of scalars
  • running_stat_vec - class for running statistics of vectors
  • gmm_diag - class for modelling data as a Gaussian mixture model
  • @@ -12475,7 +12724,7 @@  
    - update the statistics so far using the given scalar + update the statistics using the given scalar @@ -12485,7 +12734,7 @@  
    - get the minimum value so far + current minimum value @@ -12495,7 +12744,17 @@  
    - get the maximum value so far + current maximum value + + + + + X.range() + +  
    + + + current range @@ -12505,7 +12764,7 @@  
    - get the mean or average value so far + current mean or average value @@ -12515,7 +12774,7 @@  
    - get the variance so far + current variance @@ -12525,7 +12784,7 @@  
    - get the standard deviation so far + current standard deviation @@ -12545,7 +12804,7 @@  
    - get the number of samples so far + current number of samples @@ -12632,7 +12891,7 @@  
    - update the statistics so far using the given vector + update the statistics using the given vector @@ -12642,7 +12901,7 @@  
    - get the vector of minimum values so far + vector of current minimum values @@ -12652,7 +12911,17 @@  
    - get the vector of maximum values so far + vector of current maximum values + + + + + X.range() + +  
    + + + vector of current ranges @@ -12662,7 +12931,7 @@  
    - get the mean vector so far + vector of current means @@ -12672,7 +12941,7 @@  
    - get the vector of variances so far + vector of current variances @@ -12682,7 +12951,7 @@  
    - get the vector of standard deviations so far + vector of current standard deviations @@ -12692,7 +12961,7 @@  
    - get the covariance matrix so far; + matrix of current covariances; valid if calc_cov=true during construction of running_stat_vec @@ -12713,7 +12982,7 @@  
    - get the number of samples so far + current number of samples @@ -15469,7 +15738,7 @@ Use C++11 features, such as initialiser lists; -automatically enabled when using a compiler in C++11 mode, for example, g++ -std=c++11 +automatically enabled when using a compiler in C++11 or C++14 mode, for example: g++ -std=c++11 @@ -15507,6 +15776,97 @@ +ARMA_USE_OPENMP + + +   + + +Use OpenMP for parallelisation of computationally expensive element-wise operations +(such as exp(), log(), cos(), etc). +Automatically enabled when using a C++11/C++14 compiler which has OpenMP 3.0+ active (eg. the -fopenmp option for gcc and clang). +Caveat: when using gcc, use of -march=native in conjunction with -fopenmp may lead to speed regressions on recent processors. + + + + +   + + +   + + +   + + + + +ARMA_DONT_USE_OPENMP + + +   + + +Disable use of OpenMP for parallelisation of element-wise operations. Overrides ARMA_USE_OPENMP + + + + +   + + +   + + +   + + + + +ARMA_OPENMP_THRESHOLD + + +   + + +The minimum number of elements in a matrix to enable OpenMP based parallelisation of computationally expensive element-wise functions; default value is 384 + + + + +   + + +   + + +   + + + + +ARMA_OPENMP_THREADS + + +   + + +The maximum number of threads for OpenMP based parallelisation of computationally expensive element-wise functions; default value is 8 + + + + +   + + +   + + +   + + + + ARMA_BLAS_CAPITALS @@ -15886,32 +16246,38 @@ History of API Additions, Changes and Deprecations
      -
    • API Version Policy: +
    • API Stability and Versioning:

      • -Armadillo's version number is A.B.C, where A is a major version, B is a minor version, and C is the patch level (indicating bug fixes) +Each release of Armadillo has its public API (functions, classes, constants) described in the accompanying API documentation specific to that release. +
      • +
        +
      • +Each release of Armadillo has its full version specified as A.B.C, where A is a major version number, B is a minor version number, and C is a patch level (indicating bug fixes).

      • -Within each major version (eg. 4.x), minor versions are backwards compatible with earlier minor versions. -For example, code written for version 4.000 will work with version 4.100, 4.120, 4.200, etc. -However, as each minor version may have more features (ie. API extensions) than earlier versions, -code specifically written for version 4.100 doesn't necessarily work with 4.000 +Within a major version (eg. 7), each minor version has a public API that strongly strives to be backwards compatible (at the source level) with the public API of preceding minor versions. +For example, user code written for version 7.100 should work with version 7.200, 7.300, 7.400, etc. +However, as later minor versions may have more features (API extensions) than preceding minor versions, user code specifically written for version 7.400 may not work with 7.300.

      • -We don't like changes to existing APIs and strongly prefer not to break any user software. -However, to allow evolution, we reserve the right to alter the APIs in future major versions of Armadillo -while remaining backwards compatible in as many cases as possible -(eg. version 5.x may have slightly different APIs than 4.x). -In a rare instance the user API may need to be tweaked if a bug fix absolutely requires it +An increase in the patch level, while the major and minor versions are retained, indicates modifications to the code and/or documentation which aim to fix bugs without altering the public API.

      • -This policy is applicable to the APIs described in this documentation; it is not applicable to internal functions -(ie. the underlying internal implementation details may change across consecutive minor versions) +We don't like changes to existing public API and strongly prefer not to break any user software. +However, to allow evolution, we reserve the right to alter the public API in future major versions of Armadillo while remaining backwards compatible in as many cases as possible +(eg. major version 8 may have slightly different public API than major version 7). +
      • +
        +
      • +Caveat: any function, class, constant or other code not explicitly described in the public API documentation is considered as part of the underlying internal implementation details, +and may change or be removed without notice. +(In other words, don't use internal functionality).
    • @@ -15937,6 +16303,52 @@
        + + + +
      • Version 7.950: +
          +
        • expanded accu() and sum() to use OpenMP for processing expressions with computationally expensive element-wise functions
        • +
        • expanded trimatu() and trimatl() to allow specification of the diagonal which delineates the boundary of the triangular part
        • +
        +
      • +
        + +
      • Version 7.900: +
          +
        • expanded clamp() to handle cubes
        • +
        • +computationally expensive element-wise functions (such as exp(), log(), cos(), etc) +can now be automatically sped up via OpenMP; +this requires a C++11/C++14 compiler with OpenMP 3.0+ support +
            +
          • for GCC and clang compilers use the following options to enable both C++11 and OpenMP: -std=c++11 -fopenmp
          • +
          • Caveat: when using GCC, use of -march=native in conjunction with -fopenmp may lead to speed regressions on recent processors
          • +
          +
        • +
        +
      • +
        + +
      • Version 7.800: + +
      • +
        + +
      • Version 7.700: + +
      • +
      • Version 7.600:
      • diff -Nru armadillo-7.600.2+dfsg/include/armadillo armadillo-7.950.1+dfsg/include/armadillo --- armadillo-7.600.2+dfsg/include/armadillo 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #ifndef ARMA_INCLUDES @@ -41,12 +47,7 @@ #endif -#if (__cplusplus >= 201103L) - #undef ARMA_USE_CXX11 - #define ARMA_USE_CXX11 -#endif - - +#include "armadillo_bits/compiler_extra.hpp" #include "armadillo_bits/config.hpp" #include "armadillo_bits/compiler_setup.hpp" @@ -83,7 +84,7 @@ #include "armadillo_bits/include_superlu.hpp" -#if defined(_OPENMP) +#if defined(ARMA_USE_OPENMP) #include #endif @@ -112,6 +113,7 @@ #include "armadillo_bits/distr_param.hpp" #include "armadillo_bits/constants.hpp" #include "armadillo_bits/constants_old.hpp" + #include "armadillo_bits/mp_misc.hpp" #ifdef ARMA_RNG_ALT #include ARMA_INCFILE_WRAP(ARMA_RNG_ALT) @@ -267,6 +269,7 @@ #include "armadillo_bits/op_norm_bones.hpp" #include "armadillo_bits/op_sqrtmat_bones.hpp" #include "armadillo_bits/op_logmat_bones.hpp" + #include "armadillo_bits/op_range_bones.hpp" #include "armadillo_bits/glue_times_bones.hpp" #include "armadillo_bits/glue_mixed_bones.hpp" @@ -286,6 +289,8 @@ #include "armadillo_bits/glue_trapz_bones.hpp" #include "armadillo_bits/glue_atan2_bones.hpp" #include "armadillo_bits/glue_hypot_bones.hpp" + #include "armadillo_bits/glue_polyfit_bones.hpp" + #include "armadillo_bits/glue_polyval_bones.hpp" #include "armadillo_bits/gmm_misc_bones.hpp" #include "armadillo_bits/gmm_diag_bones.hpp" @@ -299,6 +304,8 @@ #include "armadillo_bits/spop_diagmat_bones.hpp" #include "armadillo_bits/spop_mean_bones.hpp" #include "armadillo_bits/spop_var_bones.hpp" + #include "armadillo_bits/spop_trimat_bones.hpp" + #include "armadillo_bits/spop_symmat_bones.hpp" #include "armadillo_bits/spglue_plus_bones.hpp" #include "armadillo_bits/spglue_minus_bones.hpp" @@ -507,6 +514,9 @@ #include "armadillo_bits/fn_sqrtmat.hpp" #include "armadillo_bits/fn_logmat.hpp" #include "armadillo_bits/fn_trapz.hpp" + #include "armadillo_bits/fn_range.hpp" + #include "armadillo_bits/fn_polyfit.hpp" + #include "armadillo_bits/fn_polyval.hpp" #include "armadillo_bits/fn_speye.hpp" #include "armadillo_bits/fn_spones.hpp" @@ -634,6 +644,7 @@ #include "armadillo_bits/op_norm_meat.hpp" #include "armadillo_bits/op_sqrtmat_meat.hpp" #include "armadillo_bits/op_logmat_meat.hpp" + #include "armadillo_bits/op_range_meat.hpp" #include "armadillo_bits/glue_times_meat.hpp" #include "armadillo_bits/glue_mixed_meat.hpp" @@ -653,6 +664,8 @@ #include "armadillo_bits/glue_trapz_meat.hpp" #include "armadillo_bits/glue_atan2_meat.hpp" #include "armadillo_bits/glue_hypot_meat.hpp" + #include "armadillo_bits/glue_polyfit_meat.hpp" + #include "armadillo_bits/glue_polyval_meat.hpp" #include "armadillo_bits/gmm_misc_meat.hpp" #include "armadillo_bits/gmm_diag_meat.hpp" @@ -666,6 +679,8 @@ #include "armadillo_bits/spop_diagmat_meat.hpp" #include "armadillo_bits/spop_mean_meat.hpp" #include "armadillo_bits/spop_var_meat.hpp" + #include "armadillo_bits/spop_trimat_meat.hpp" + #include "armadillo_bits/spop_symmat_meat.hpp" #include "armadillo_bits/spglue_plus_meat.hpp" #include "armadillo_bits/spglue_minus_meat.hpp" diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/access.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/access.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/access.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/access.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2013 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup access diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/arma_cmath.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/arma_cmath.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/arma_cmath.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/arma_cmath.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/arma_config.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/arma_config.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/arma_config.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/arma_config.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup arma_config @@ -22,6 +28,20 @@ #endif + #if defined(ARMA_OPENMP_THRESHOLD) + static const uword mp_threshold = (sword(ARMA_OPENMP_THRESHOLD) > 0) ? uword(ARMA_OPENMP_THRESHOLD) : 384; + #else + static const uword mp_threshold = 384; + #endif + + + #if defined(ARMA_OPENMP_THREADS) + static const uword mp_threads = (sword(ARMA_OPENMP_THREADS) > 0) ? uword(ARMA_OPENMP_THREADS) : 8; + #else + static const uword mp_threads = 8; + #endif + + #if defined(ARMA_SPMAT_CHUNKSIZE) static const uword spmat_chunksize = (sword(ARMA_SPMAT_CHUNKSIZE) > 0) ? uword(ARMA_SPMAT_CHUNKSIZE) : 256; #else @@ -116,20 +136,20 @@ #if defined(ARMA_USE_CXX11) - static const bool use_cxx11 = true; + static const bool cxx11 = true; #else - static const bool use_cxx11 = false; + static const bool cxx11 = false; #endif #if defined(ARMA_USE_WRAPPER) - static const bool use_wrapper = true; + static const bool wrapper = true; #else - static const bool use_wrapper = false; + static const bool wrapper = false; #endif - #if defined(_OPENMP) + #if defined(ARMA_USE_OPENMP) static const bool openmp = true; #else static const bool openmp = false; diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/arma_forward.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/arma_forward.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/arma_forward.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/arma_forward.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ using std::cout; @@ -109,6 +115,8 @@ class glue_join_rows; class glue_atan2; class glue_hypot; +class glue_polyfit; +class glue_polyval; class glue_rel_lt; class glue_rel_gt; diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/arma_ostream_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/arma_ostream_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/arma_ostream_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/arma_ostream_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup arma_ostream diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/arma_ostream_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/arma_ostream_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/arma_ostream_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/arma_ostream_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup arma_ostream diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/arma_rng_cxx11.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/arma_rng_cxx11.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/arma_rng_cxx11.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/arma_rng_cxx11.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup arma_rng_cxx11 diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/arma_rng_cxx98.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/arma_rng_cxx98.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/arma_rng_cxx98.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/arma_rng_cxx98.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup arma_rng_cxx98 diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/arma_rng.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/arma_rng.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/arma_rng.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/arma_rng.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup arma_rng @@ -264,20 +270,20 @@ void fill(eT* mem, const uword N) { - uword i,j; + uword j; - for(i=0, j=1; j < N; i+=2, j+=2) + for(j=1; j < N; j+=2) { const eT tmp_i = eT( arma_rng::randu() ); const eT tmp_j = eT( arma_rng::randu() ); - mem[i] = tmp_i; - mem[j] = tmp_j; + (*mem) = tmp_i; mem++; + (*mem) = tmp_j; mem++; } - if(i < N) + if((j-1) < N) { - mem[i] = eT( arma_rng::randu() ); + (*mem) = eT( arma_rng::randu() ); } } }; diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/arma_static_check.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/arma_static_check.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/arma_static_check.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/arma_static_check.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2011 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup arma_static_check diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/arma_str.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/arma_str.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/arma_str.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/arma_str.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2013 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup arma_str diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/arma_version.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/arma_version.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/arma_version.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/arma_version.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup arma_version @@ -14,9 +20,9 @@ #define ARMA_VERSION_MAJOR 7 -#define ARMA_VERSION_MINOR 600 -#define ARMA_VERSION_PATCH 2 -#define ARMA_VERSION_NAME "Coup d'Etat Deluxe" +#define ARMA_VERSION_MINOR 950 +#define ARMA_VERSION_PATCH 1 +#define ARMA_VERSION_NAME "Northern Banana Republic" diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/arrayops_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/arrayops_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/arrayops_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/arrayops_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2011-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup arrayops diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/arrayops_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/arrayops_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/arrayops_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/arrayops_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2011-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup arrayops @@ -591,7 +597,7 @@ { typedef typename get_pod_type::result pod_type; - if( (n_elem <= 16) && (is_cx::no) ) + if( (n_elem <= 9) && (is_cx::no) ) { arrayops::inplace_set_small(dest, val, n_elem); } @@ -660,13 +666,6 @@ { switch(n_elem) { - case 16: dest[15] = val; - case 15: dest[14] = val; - case 14: dest[13] = val; - case 13: dest[12] = val; - case 12: dest[11] = val; - case 11: dest[10] = val; - case 10: dest[ 9] = val; case 9: dest[ 8] = val; case 8: dest[ 7] = val; case 7: dest[ 6] = val; diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/auxlib_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/auxlib_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/auxlib_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/auxlib_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,13 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by James Sanders -// Written by Eric Jon Sundstrom +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup auxlib diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/auxlib_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/auxlib_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/auxlib_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/auxlib_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,16 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by James Sanders -// Written by Stanislav Funiak -// Written by Eric Jon Sundstrom -// Written by Michael McNeil Forbes -// Written by Keith O'Hara +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup auxlib @@ -686,6 +687,8 @@ arma_extra_debug_print("atlas::clapack_getrf()"); const int info = atlas::clapack_getrf(atlas::CblasColMajor, tmp.n_rows, tmp.n_cols, tmp.memptr(), tmp.n_rows, ipiv.memptr()); + if(info < 0) { return false; } + // on output tmp appears to be L+U_alt, where U_alt is U with the main diagonal set to zero sword sign = (is_complex::value == false) ? ( (access::tmp_real( tmp.at(0,0) ) < T(0)) ? -1 : +1 ) : +1; @@ -710,7 +713,7 @@ out_val = val; out_sign = T(sign); - return (info == 0); + return true; } #elif defined(ARMA_USE_LAPACK) { @@ -735,6 +738,8 @@ arma_extra_debug_print("lapack::getrf()"); lapack::getrf(&n_rows, &n_cols, tmp.memptr(), &n_rows, ipiv.memptr(), &info); + if(info < 0) { return false; } + // on output tmp appears to be L+U_alt, where U_alt is U with the main diagonal set to zero sword sign = (is_complex::value == false) ? ( (access::tmp_real( tmp.at(0,0) ) < T(0)) ? -1 : +1 ) : +1; @@ -759,7 +764,7 @@ out_val = val; out_sign = T(sign); - return (info == 0); + return true; } #else { diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/Base_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/Base_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/Base_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/Base_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup Base diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/BaseCube_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/BaseCube_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/BaseCube_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/BaseCube_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup BaseCube diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/BaseCube_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/BaseCube_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/BaseCube_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/BaseCube_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup BaseCube diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/Base_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/Base_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/Base_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/Base_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup Base diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/Col_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/Col_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/Col_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/Col_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup Col @@ -34,30 +40,30 @@ template inline Col(const uword in_rows, const uword in_cols, const fill::fill_class& f); template inline Col(const SizeMat& s, const fill::fill_class& f); - inline Col(const char* text); - inline const Col& operator=(const char* text); + inline Col(const char* text); + inline Col& operator=(const char* text); - inline Col(const std::string& text); - inline const Col& operator=(const std::string& text); + inline Col(const std::string& text); + inline Col& operator=(const std::string& text); - inline Col(const std::vector& x); - inline const Col& operator=(const std::vector& x); + inline Col(const std::vector& x); + inline Col& operator=(const std::vector& x); #if defined(ARMA_USE_CXX11) - inline Col(const std::initializer_list& list); - inline const Col& operator=(const std::initializer_list& list); + inline Col(const std::initializer_list& list); + inline Col& operator=(const std::initializer_list& list); - inline Col(Col&& m); - inline const Col& operator=(Col&& m); + inline Col(Col&& m); + inline Col& operator=(Col&& m); #endif inline explicit Col(const SpCol& X); - inline const Col& operator=(const eT val); - inline const Col& operator=(const Col& m); + inline Col& operator=(const eT val); + inline Col& operator=(const Col& m); - template inline Col(const Base& X); - template inline const Col& operator=(const Base& X); + template inline Col(const Base& X); + template inline Col& operator=(const Base& X); inline Col( eT* aux_mem, const uword aux_length, const bool copy_aux_mem = true, const bool strict = false); inline Col(const eT* aux_mem, const uword aux_length); @@ -65,11 +71,11 @@ template inline explicit Col(const Base& A, const Base& B); - template inline Col(const BaseCube& X); - template inline const Col& operator=(const BaseCube& X); + template inline Col(const BaseCube& X); + template inline Col& operator=(const BaseCube& X); - inline Col(const subview_cube& X); - inline const Col& operator=(const subview_cube& X); + inline Col(const subview_cube& X); + inline Col& operator=(const subview_cube& X); inline mat_injector operator<<(const eT val); @@ -195,25 +201,25 @@ inline fixed(const char* text); inline fixed(const std::string& text); - template inline const Col& operator=(const Base& A); + template inline Col& operator=(const Base& A); - inline const Col& operator=(const eT val); - inline const Col& operator=(const char* text); - inline const Col& operator=(const std::string& text); - inline const Col& operator=(const subview_cube& X); + inline Col& operator=(const eT val); + inline Col& operator=(const char* text); + inline Col& operator=(const std::string& text); + inline Col& operator=(const subview_cube& X); using Col::operator(); #if defined(ARMA_USE_CXX11) - inline fixed(const std::initializer_list& list); - inline const Col& operator=(const std::initializer_list& list); + inline fixed(const std::initializer_list& list); + inline Col& operator=(const std::initializer_list& list); #endif - arma_inline const Col& operator=(const fixed& X); + arma_inline Col& operator=(const fixed& X); #if defined(ARMA_GOOD_COMPILER) - template inline const Col& operator=(const eOp& X); - template inline const Col& operator=(const eGlue& X); + template inline Col& operator=(const eOp& X); + template inline Col& operator=(const eGlue& X); #endif arma_inline const Op< Col_fixed_type, op_htrans > t() const; diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/Col_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/Col_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/Col_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/Col_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup Col @@ -134,7 +140,7 @@ //! construct a column vector from specified text template inline -const Col& +Col& Col::operator=(const char* text) { arma_extra_debug_sigprint(); @@ -173,7 +179,7 @@ //! construct a column vector from specified text template inline -const Col& +Col& Col::operator=(const std::string& text) { arma_extra_debug_sigprint(); @@ -210,7 +216,7 @@ //! create a column vector from std::vector template inline -const Col& +Col& Col::operator=(const std::vector& x) { arma_extra_debug_sigprint(); @@ -248,7 +254,7 @@ template inline - const Col& + Col& Col::operator=(const std::initializer_list& list) { arma_extra_debug_sigprint(); @@ -308,7 +314,7 @@ template inline - const Col& + Col& Col::operator=(Col&& X) { arma_extra_debug_sigprint(arma_str::format("this = %x X = %x") % this % &X); @@ -349,7 +355,7 @@ template inline -const Col& +Col& Col::operator=(const eT val) { arma_extra_debug_sigprint(); @@ -363,7 +369,7 @@ template inline -const Col& +Col& Col::operator=(const Col& X) { arma_extra_debug_sigprint(); @@ -391,7 +397,7 @@ template template inline -const Col& +Col& Col::operator=(const Base& X) { arma_extra_debug_sigprint(); @@ -464,7 +470,7 @@ template template inline -const Col& +Col& Col::operator=(const BaseCube& X) { arma_extra_debug_sigprint(); @@ -491,7 +497,7 @@ template inline -const Col& +Col& Col::operator=(const subview_cube& X) { arma_extra_debug_sigprint(); @@ -1233,7 +1239,7 @@ template template template -const Col& +Col& Col::fixed::operator=(const Base& A) { arma_extra_debug_sigprint(); @@ -1247,7 +1253,7 @@ template template -const Col& +Col& Col::fixed::operator=(const eT val) { arma_extra_debug_sigprint(); @@ -1261,7 +1267,7 @@ template template -const Col& +Col& Col::fixed::operator=(const char* text) { arma_extra_debug_sigprint(); @@ -1277,7 +1283,7 @@ template template -const Col& +Col& Col::fixed::operator=(const std::string& text) { arma_extra_debug_sigprint(); @@ -1293,7 +1299,7 @@ template template -const Col& +Col& Col::fixed::operator=(const subview_cube& X) { arma_extra_debug_sigprint(); @@ -1323,7 +1329,7 @@ template template inline - const Col& + Col& Col::fixed::operator=(const std::initializer_list& list) { arma_extra_debug_sigprint(); @@ -1348,7 +1354,7 @@ template template arma_inline -const Col& +Col& Col::fixed::operator=(const fixed& X) { arma_extra_debug_sigprint(); @@ -1372,7 +1378,7 @@ template template inline - const Col& + Col& Col::fixed::operator=(const eOp& X) { arma_extra_debug_sigprint(); @@ -1405,7 +1411,7 @@ template template inline - const Col& + Col& Col::fixed::operator=(const eGlue& X) { arma_extra_debug_sigprint(); diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/compiler_extra.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/compiler_extra.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/compiler_extra.hpp 1970-01-01 00:00:00.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/compiler_extra.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -0,0 +1,36 @@ +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + + + +#if (__cplusplus >= 201103L) + #undef ARMA_USE_CXX11 + #define ARMA_USE_CXX11 +#endif + + +// MS really can't get its proverbial shit together +#if (defined(_MSVC_LANG) && (_MSVC_LANG >= 201402L)) + #undef ARMA_USE_CXX11 + #define ARMA_USE_CXX11 + #undef ARMA_DONT_PRINT_CXX11_WARNING + #define ARMA_DONT_PRINT_CXX11_WARNING +#endif + + +#if (defined(_OPENMP) && (_OPENMP >= 200805)) + #undef ARMA_USE_OPENMP + #define ARMA_USE_OPENMP +#endif diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/compiler_setup.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/compiler_setup.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/compiler_setup.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/compiler_setup.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ @@ -312,6 +318,10 @@ #if defined(__INTEL_COMPILER) + #if (__INTEL_COMPILER == 9999) + #error "*** Need a newer compiler ***" + #endif + #if (__INTEL_COMPILER < 1300) #error "*** Need a newer compiler ***" #endif @@ -348,6 +358,8 @@ #endif #endif + #undef arma_deprecated + #define arma_deprecated __declspec(deprecated) // #undef arma_inline // #define arma_inline inline __forceinline @@ -446,6 +458,32 @@ #undef ARMA_PRINT_CXX11_WARNING +#if ( defined(ARMA_USE_OPENMP) && (!defined(_OPENMP) || (defined(_OPENMP) && (_OPENMP < 200805))) ) + // we require OpenMP 3.0 to enable parallelisation of for loops with unsigned integers; + // earlier versions of OpenMP can only handle signed integers + #undef ARMA_USE_OPENMP + #undef ARMA_PRINT_OPENMP_WARNING + #define ARMA_PRINT_OPENMP_WARNING +#endif + + +#if ( (defined(_OPENMP) && (_OPENMP < 200805)) && !defined(ARMA_DONT_USE_OPENMP) ) + // if the compiler has an ancient version of OpenMP and use of OpenMP hasn't been explicitly disabled, + // print a warning to ensure there is no confusion about OpenMP support + #undef ARMA_USE_OPENMP + #undef ARMA_PRINT_OPENMP_WARNING + #define ARMA_PRINT_OPENMP_WARNING +#endif + + +#if defined(ARMA_PRINT_OPENMP_WARNING) && !defined(ARMA_DONT_PRINT_OPENMP_WARNING) + #pragma message ("WARNING: use of OpenMP disabled; this compiler doesn't support OpenMP 3.0+") +#endif + + +#undef ARMA_PRINT_OPENMP_WARNING + + #if defined(log2) #undef log2 #pragma message ("WARNING: detected 'log2' macro and undefined it") diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/compiler_setup_post.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/compiler_setup_post.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/compiler_setup_post.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/compiler_setup_post.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/cond_rel_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/cond_rel_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/cond_rel_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/cond_rel_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2012 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup cond_rel diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/cond_rel_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/cond_rel_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/cond_rel_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/cond_rel_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2012 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup cond_rel diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/config.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/config.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/config.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/config.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ @@ -87,6 +92,12 @@ //// Note that ARMA_USE_CXX11 is automatically enabled when a C++11 compiler is detected. #endif +#if !defined(ARMA_USE_OPENMP) +// #define ARMA_USE_OPENMP +//// Uncomment the above line to forcefully enable use of OpenMP for parallelisation. +//// Note that ARMA_USE_OPENMP is automatically enabled when a compiler supporting OpenMP 3.0 is detected. +#endif + #if !defined(ARMA_64BIT_WORD) // #define ARMA_64BIT_WORD //// Uncomment the above line if you require matrices/vectors capable of holding more than 4 billion elements. @@ -117,6 +128,18 @@ //// If you mainly use lots of very small vectors (eg. <= 4 elements), //// change the number to the size of your vectors. +#if !defined(ARMA_OPENMP_THRESHOLD) + #define ARMA_OPENMP_THRESHOLD 384 +#endif +//// The minimum number of elements in a matrix to allow OpenMP based parallelisation; +//// it must be an integer that is at least 1. + +#if !defined(ARMA_OPENMP_THREADS) + #define ARMA_OPENMP_THREADS 8 +#endif +//// The maximum number of threads to use for OpenMP based parallelisation; +//// it must be an integer that is at least 1. + #if !defined(ARMA_SPMAT_CHUNKSIZE) #define ARMA_SPMAT_CHUNKSIZE 256 #endif @@ -185,6 +208,10 @@ #undef ARMA_USE_EXTERN_CXX11_RNG #endif +#if defined(ARMA_DONT_USE_OPENMP) + #undef ARMA_USE_OPENMP +#endif + #if defined(ARMA_USE_WRAPPER) #if defined(ARMA_USE_CXX11) #if !defined(ARMA_USE_EXTERN_CXX11_RNG) diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/config.hpp.cmake armadillo-7.950.1+dfsg/include/armadillo_bits/config.hpp.cmake --- armadillo-7.600.2+dfsg/include/armadillo_bits/config.hpp.cmake 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/config.hpp.cmake 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ @@ -84,14 +89,20 @@ #if !defined(ARMA_USE_CXX11) // #define ARMA_USE_CXX11 //// Uncomment the above line to forcefully enable use of C++11 features (eg. initialiser lists). -//// Note that ARMA_USE_CXX11 is automatically enabled when a C++11 compiler is detected +//// Note that ARMA_USE_CXX11 is automatically enabled when a C++11 compiler is detected. +#endif + +#if !defined(ARMA_USE_OPENMP) +// #define ARMA_USE_OPENMP +//// Uncomment the above line to forcefully enable use of OpenMP for parallelisation. +//// Note that ARMA_USE_OPENMP is automatically enabled when a compiler supporting OpenMP 3.0 is detected. #endif #if !defined(ARMA_64BIT_WORD) // #define ARMA_64BIT_WORD //// Uncomment the above line if you require matrices/vectors capable of holding more than 4 billion elements. -//// Your machine and compiler must have support for 64 bit integers (eg. via "long" or "long long") -//// Note that ARMA_64BIT_WORD is automatically enabled when a C++11 compiler is detected +//// Your machine and compiler must have support for 64 bit integers (eg. via "long" or "long long"). +//// Note that ARMA_64BIT_WORD is automatically enabled when a C++11 compiler is detected. #endif #if !defined(ARMA_USE_HDF5) @@ -117,6 +128,18 @@ //// If you mainly use lots of very small vectors (eg. <= 4 elements), //// change the number to the size of your vectors. +#if !defined(ARMA_OPENMP_THRESHOLD) + #define ARMA_OPENMP_THRESHOLD 384 +#endif +//// The minimum number of elements in a matrix to allow OpenMP based parallelisation; +//// it must be an integer that is at least 1. + +#if !defined(ARMA_OPENMP_THREADS) + #define ARMA_OPENMP_THREADS 8 +#endif +//// The maximum number of threads to use for OpenMP based parallelisation; +//// it must be an integer that is at least 1. + #if !defined(ARMA_SPMAT_CHUNKSIZE) #define ARMA_SPMAT_CHUNKSIZE 256 #endif @@ -185,6 +208,10 @@ #undef ARMA_USE_EXTERN_CXX11_RNG #endif +#if defined(ARMA_DONT_USE_OPENMP) + #undef ARMA_USE_OPENMP +#endif + #if defined(ARMA_USE_WRAPPER) #if defined(ARMA_USE_CXX11) #if !defined(ARMA_USE_EXTERN_CXX11_RNG) diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/constants.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/constants.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/constants.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/constants.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2012 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup constants diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/constants_old.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/constants_old.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/constants_old.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/constants_old.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2011 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup constants_old diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/Cube_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/Cube_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/Cube_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/Cube_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup Cube @@ -66,35 +72,35 @@ template inline Cube(const SizeCube& s, const fill::fill_class& f); #if defined(ARMA_USE_CXX11) - inline Cube(Cube&& m); - inline const Cube& operator=(Cube&& m); + inline Cube(Cube&& m); + inline Cube& operator=(Cube&& m); #endif inline Cube( eT* aux_mem, const uword aux_n_rows, const uword aux_n_cols, const uword aux_n_slices, const bool copy_aux_mem = true, const bool strict = false, const bool prealloc_mat = false); inline Cube(const eT* aux_mem, const uword aux_n_rows, const uword aux_n_cols, const uword aux_n_slices); - arma_inline const Cube& operator=(const eT val); - arma_inline const Cube& operator+=(const eT val); - arma_inline const Cube& operator-=(const eT val); - arma_inline const Cube& operator*=(const eT val); - arma_inline const Cube& operator/=(const eT val); - - inline Cube(const Cube& m); - inline const Cube& operator=(const Cube& m); - inline const Cube& operator+=(const Cube& m); - inline const Cube& operator-=(const Cube& m); - inline const Cube& operator%=(const Cube& m); - inline const Cube& operator/=(const Cube& m); + inline Cube& operator=(const eT val); + inline Cube& operator+=(const eT val); + inline Cube& operator-=(const eT val); + inline Cube& operator*=(const eT val); + inline Cube& operator/=(const eT val); + + inline Cube(const Cube& m); + inline Cube& operator=(const Cube& m); + inline Cube& operator+=(const Cube& m); + inline Cube& operator-=(const Cube& m); + inline Cube& operator%=(const Cube& m); + inline Cube& operator/=(const Cube& m); template inline explicit Cube(const BaseCube& A, const BaseCube& B); - inline Cube(const subview_cube& X); - inline const Cube& operator=(const subview_cube& X); - inline const Cube& operator+=(const subview_cube& X); - inline const Cube& operator-=(const subview_cube& X); - inline const Cube& operator%=(const subview_cube& X); - inline const Cube& operator/=(const subview_cube& X); + inline Cube(const subview_cube& X); + inline Cube& operator=(const subview_cube& X); + inline Cube& operator+=(const subview_cube& X); + inline Cube& operator-=(const subview_cube& X); + inline Cube& operator%=(const subview_cube& X); + inline Cube& operator/=(const subview_cube& X); inline Mat& slice(const uword in_slice); inline const Mat& slice(const uword in_slice) const; @@ -164,54 +170,54 @@ inline void insert_slices(const uword row_num, const BaseCube& X); - template inline Cube(const GenCube& X); - template inline const Cube& operator=(const GenCube& X); - template inline const Cube& operator+=(const GenCube& X); - template inline const Cube& operator-=(const GenCube& X); - template inline const Cube& operator%=(const GenCube& X); - template inline const Cube& operator/=(const GenCube& X); - - template inline Cube(const OpCube& X); - template inline const Cube& operator=(const OpCube& X); - template inline const Cube& operator+=(const OpCube& X); - template inline const Cube& operator-=(const OpCube& X); - template inline const Cube& operator%=(const OpCube& X); - template inline const Cube& operator/=(const OpCube& X); - - template inline Cube(const eOpCube& X); - template inline const Cube& operator=(const eOpCube& X); - template inline const Cube& operator+=(const eOpCube& X); - template inline const Cube& operator-=(const eOpCube& X); - template inline const Cube& operator%=(const eOpCube& X); - template inline const Cube& operator/=(const eOpCube& X); - - template inline Cube(const mtOpCube& X); - template inline const Cube& operator=(const mtOpCube& X); - template inline const Cube& operator+=(const mtOpCube& X); - template inline const Cube& operator-=(const mtOpCube& X); - template inline const Cube& operator%=(const mtOpCube& X); - template inline const Cube& operator/=(const mtOpCube& X); - - template inline Cube(const GlueCube& X); - template inline const Cube& operator=(const GlueCube& X); - template inline const Cube& operator+=(const GlueCube& X); - template inline const Cube& operator-=(const GlueCube& X); - template inline const Cube& operator%=(const GlueCube& X); - template inline const Cube& operator/=(const GlueCube& X); - - template inline Cube(const eGlueCube& X); - template inline const Cube& operator=(const eGlueCube& X); - template inline const Cube& operator+=(const eGlueCube& X); - template inline const Cube& operator-=(const eGlueCube& X); - template inline const Cube& operator%=(const eGlueCube& X); - template inline const Cube& operator/=(const eGlueCube& X); - - template inline Cube(const mtGlueCube& X); - template inline const Cube& operator=(const mtGlueCube& X); - template inline const Cube& operator+=(const mtGlueCube& X); - template inline const Cube& operator-=(const mtGlueCube& X); - template inline const Cube& operator%=(const mtGlueCube& X); - template inline const Cube& operator/=(const mtGlueCube& X); + template inline Cube(const GenCube& X); + template inline Cube& operator=(const GenCube& X); + template inline Cube& operator+=(const GenCube& X); + template inline Cube& operator-=(const GenCube& X); + template inline Cube& operator%=(const GenCube& X); + template inline Cube& operator/=(const GenCube& X); + + template inline Cube(const OpCube& X); + template inline Cube& operator=(const OpCube& X); + template inline Cube& operator+=(const OpCube& X); + template inline Cube& operator-=(const OpCube& X); + template inline Cube& operator%=(const OpCube& X); + template inline Cube& operator/=(const OpCube& X); + + template inline Cube(const eOpCube& X); + template inline Cube& operator=(const eOpCube& X); + template inline Cube& operator+=(const eOpCube& X); + template inline Cube& operator-=(const eOpCube& X); + template inline Cube& operator%=(const eOpCube& X); + template inline Cube& operator/=(const eOpCube& X); + + template inline Cube(const mtOpCube& X); + template inline Cube& operator=(const mtOpCube& X); + template inline Cube& operator+=(const mtOpCube& X); + template inline Cube& operator-=(const mtOpCube& X); + template inline Cube& operator%=(const mtOpCube& X); + template inline Cube& operator/=(const mtOpCube& X); + + template inline Cube(const GlueCube& X); + template inline Cube& operator=(const GlueCube& X); + template inline Cube& operator+=(const GlueCube& X); + template inline Cube& operator-=(const GlueCube& X); + template inline Cube& operator%=(const GlueCube& X); + template inline Cube& operator/=(const GlueCube& X); + + template inline Cube(const eGlueCube& X); + template inline Cube& operator=(const eGlueCube& X); + template inline Cube& operator+=(const eGlueCube& X); + template inline Cube& operator-=(const eGlueCube& X); + template inline Cube& operator%=(const eGlueCube& X); + template inline Cube& operator/=(const eGlueCube& X); + + template inline Cube(const mtGlueCube& X); + template inline Cube& operator=(const mtGlueCube& X); + template inline Cube& operator+=(const mtGlueCube& X); + template inline Cube& operator-=(const mtGlueCube& X); + template inline Cube& operator%=(const mtGlueCube& X); + template inline Cube& operator/=(const mtGlueCube& X); arma_inline arma_warn_unused const eT& at_alt (const uword i) const; @@ -266,13 +272,17 @@ inline void impl_raw_print( const std::string& extra_text) const; inline void impl_raw_print(std::ostream& user_stream, const std::string& extra_text) const; - inline void set_size(const uword in_rows, const uword in_cols, const uword in_slices); - inline void reshape(const uword in_rows, const uword in_cols, const uword in_slices, const uword dim = 0); - inline void resize(const uword in_rows, const uword in_cols, const uword in_slices); - - inline void set_size(const SizeCube& s); - inline void reshape(const SizeCube& s); - inline void resize(const SizeCube& s); + inline void set_size(const uword in_rows, const uword in_cols, const uword in_slices); + inline void set_size(const SizeCube& s); + + inline void reshape(const uword in_rows, const uword in_cols, const uword in_slices); + inline void reshape(const SizeCube& s); + + inline void resize(const uword in_rows, const uword in_cols, const uword in_slices); + inline void resize(const SizeCube& s); + + arma_deprecated inline void reshape(const uword in_rows, const uword in_cols, const uword in_slices, const uword dim); //!< NOTE: don't use this form: it will be removed + template inline void copy_size(const Cube& m); @@ -420,7 +430,7 @@ using Cube::operator=; using Cube::operator(); - inline const Cube& operator=(const fixed& X); + inline Cube& operator=(const fixed& X); arma_inline arma_warn_unused eT& operator[] (const uword i); diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/Cube_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/Cube_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/Cube_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/Cube_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup Cube @@ -172,7 +178,7 @@ template inline - const Cube& + Cube& Cube::operator=(Cube&& in_cube) { arma_extra_debug_sigprint(arma_str::format("this = %x in_cube = %x") % this % &in_cube); @@ -476,8 +482,8 @@ //! Set the cube to be equal to the specified scalar. //! NOTE: the size of the cube will be 1x1x1 template -arma_inline -const Cube& +inline +Cube& Cube::operator=(const eT val) { arma_extra_debug_sigprint(); @@ -491,8 +497,8 @@ //! In-place addition of a scalar to all elements of the cube template -arma_inline -const Cube& +inline +Cube& Cube::operator+=(const eT val) { arma_extra_debug_sigprint(); @@ -506,8 +512,8 @@ //! In-place subtraction of a scalar from all elements of the cube template -arma_inline -const Cube& +inline +Cube& Cube::operator-=(const eT val) { arma_extra_debug_sigprint(); @@ -521,8 +527,8 @@ //! In-place multiplication of all elements of the cube with a scalar template -arma_inline -const Cube& +inline +Cube& Cube::operator*=(const eT val) { arma_extra_debug_sigprint(); @@ -536,8 +542,8 @@ //! In-place division of all elements of the cube with a scalar template -arma_inline -const Cube& +inline +Cube& Cube::operator/=(const eT val) { arma_extra_debug_sigprint(); @@ -575,7 +581,7 @@ //! construct a cube from a given cube template inline -const Cube& +Cube& Cube::operator=(const Cube& x) { arma_extra_debug_sigprint(arma_str::format("this = %x in_cube = %x") % this % &x); @@ -651,7 +657,7 @@ //! in-place cube addition template inline -const Cube& +Cube& Cube::operator+=(const Cube& m) { arma_extra_debug_sigprint(); @@ -668,7 +674,7 @@ //! in-place cube subtraction template inline -const Cube& +Cube& Cube::operator-=(const Cube& m) { arma_extra_debug_sigprint(); @@ -685,7 +691,7 @@ //! in-place element-wise cube multiplication template inline -const Cube& +Cube& Cube::operator%=(const Cube& m) { arma_extra_debug_sigprint(); @@ -702,7 +708,7 @@ //! in-place element-wise cube division template inline -const Cube& +Cube& Cube::operator/=(const Cube& m) { arma_extra_debug_sigprint(); @@ -766,7 +772,7 @@ //! construct a cube from a subview_cube instance (e.g. construct a cube from a delayed subcube operation) template inline -const Cube& +Cube& Cube::operator=(const subview_cube& X) { arma_extra_debug_sigprint(); @@ -794,7 +800,7 @@ //! in-place cube addition (using a subcube on the right-hand-side) template inline -const Cube& +Cube& Cube::operator+=(const subview_cube& X) { arma_extra_debug_sigprint(); @@ -809,7 +815,7 @@ //! in-place cube subtraction (using a subcube on the right-hand-side) template inline -const Cube& +Cube& Cube::operator-=(const subview_cube& X) { arma_extra_debug_sigprint(); @@ -824,7 +830,7 @@ //! in-place element-wise cube mutiplication (using a subcube on the right-hand-side) template inline -const Cube& +Cube& Cube::operator%=(const subview_cube& X) { arma_extra_debug_sigprint(); @@ -839,7 +845,7 @@ //! in-place element-wise cube division (using a subcube on the right-hand-side) template inline -const Cube& +Cube& Cube::operator/=(const subview_cube& X) { arma_extra_debug_sigprint(); @@ -1753,7 +1759,7 @@ template template inline -const Cube& +Cube& Cube::operator=(const GenCube& X) { arma_extra_debug_sigprint(); @@ -1770,7 +1776,7 @@ template template inline -const Cube& +Cube& Cube::operator+=(const GenCube& X) { arma_extra_debug_sigprint(); @@ -1785,7 +1791,7 @@ template template inline -const Cube& +Cube& Cube::operator-=(const GenCube& X) { arma_extra_debug_sigprint(); @@ -1800,7 +1806,7 @@ template template inline -const Cube& +Cube& Cube::operator%=(const GenCube& X) { arma_extra_debug_sigprint(); @@ -1815,7 +1821,7 @@ template template inline -const Cube& +Cube& Cube::operator/=(const GenCube& X) { arma_extra_debug_sigprint(); @@ -1854,7 +1860,7 @@ template template inline -const Cube& +Cube& Cube::operator=(const OpCube& X) { arma_extra_debug_sigprint(); @@ -1872,7 +1878,7 @@ template template inline -const Cube& +Cube& Cube::operator+=(const OpCube& X) { arma_extra_debug_sigprint(); @@ -1890,7 +1896,7 @@ template template inline -const Cube& +Cube& Cube::operator-=(const OpCube& X) { arma_extra_debug_sigprint(); @@ -1908,7 +1914,7 @@ template template inline -const Cube& +Cube& Cube::operator%=(const OpCube& X) { arma_extra_debug_sigprint(); @@ -1926,7 +1932,7 @@ template template inline -const Cube& +Cube& Cube::operator/=(const OpCube& X) { arma_extra_debug_sigprint(); @@ -1969,7 +1975,7 @@ template template inline -const Cube& +Cube& Cube::operator=(const eOpCube& X) { arma_extra_debug_sigprint(); @@ -2000,7 +2006,7 @@ template template inline -const Cube& +Cube& Cube::operator+=(const eOpCube& X) { arma_extra_debug_sigprint(); @@ -2018,7 +2024,7 @@ template template inline -const Cube& +Cube& Cube::operator-=(const eOpCube& X) { arma_extra_debug_sigprint(); @@ -2036,7 +2042,7 @@ template template inline -const Cube& +Cube& Cube::operator%=(const eOpCube& X) { arma_extra_debug_sigprint(); @@ -2054,7 +2060,7 @@ template template inline -const Cube& +Cube& Cube::operator/=(const eOpCube& X) { arma_extra_debug_sigprint(); @@ -2068,7 +2074,6 @@ -//! EXPERIMENTAL template template inline @@ -2089,11 +2094,10 @@ -//! EXPERIMENTAL template template inline -const Cube& +Cube& Cube::operator=(const mtOpCube& X) { arma_extra_debug_sigprint(); @@ -2105,11 +2109,10 @@ -//! EXPERIMENTAL template template inline -const Cube& +Cube& Cube::operator+=(const mtOpCube& X) { arma_extra_debug_sigprint(); @@ -2121,11 +2124,10 @@ -//! EXPERIMENTAL template template inline -const Cube& +Cube& Cube::operator-=(const mtOpCube& X) { arma_extra_debug_sigprint(); @@ -2137,11 +2139,10 @@ -//! EXPERIMENTAL template template inline -const Cube& +Cube& Cube::operator%=(const mtOpCube& X) { arma_extra_debug_sigprint(); @@ -2153,11 +2154,10 @@ -//! EXPERIMENTAL template template inline -const Cube& +Cube& Cube::operator/=(const mtOpCube& X) { arma_extra_debug_sigprint(); @@ -2193,7 +2193,7 @@ template template inline -const Cube& +Cube& Cube::operator=(const GlueCube& X) { arma_extra_debug_sigprint(); @@ -2211,7 +2211,7 @@ template template inline -const Cube& +Cube& Cube::operator+=(const GlueCube& X) { arma_extra_debug_sigprint(); @@ -2230,7 +2230,7 @@ template template inline -const Cube& +Cube& Cube::operator-=(const GlueCube& X) { arma_extra_debug_sigprint(); @@ -2249,7 +2249,7 @@ template template inline -const Cube& +Cube& Cube::operator%=(const GlueCube& X) { arma_extra_debug_sigprint(); @@ -2268,7 +2268,7 @@ template template inline -const Cube& +Cube& Cube::operator/=(const GlueCube& X) { arma_extra_debug_sigprint(); @@ -2313,7 +2313,7 @@ template template inline -const Cube& +Cube& Cube::operator=(const eGlueCube& X) { arma_extra_debug_sigprint(); @@ -2345,7 +2345,7 @@ template template inline -const Cube& +Cube& Cube::operator+=(const eGlueCube& X) { arma_extra_debug_sigprint(); @@ -2364,7 +2364,7 @@ template template inline -const Cube& +Cube& Cube::operator-=(const eGlueCube& X) { arma_extra_debug_sigprint(); @@ -2383,7 +2383,7 @@ template template inline -const Cube& +Cube& Cube::operator%=(const eGlueCube& X) { arma_extra_debug_sigprint(); @@ -2402,7 +2402,7 @@ template template inline -const Cube& +Cube& Cube::operator/=(const eGlueCube& X) { arma_extra_debug_sigprint(); @@ -2417,7 +2417,6 @@ -//! EXPERIMENTAL template template inline @@ -2438,11 +2437,10 @@ -//! EXPERIMENTAL template template inline -const Cube& +Cube& Cube::operator=(const mtGlueCube& X) { arma_extra_debug_sigprint(); @@ -2454,11 +2452,10 @@ -//! EXPERIMENTAL template template inline -const Cube& +Cube& Cube::operator+=(const mtGlueCube& X) { arma_extra_debug_sigprint(); @@ -2470,11 +2467,10 @@ -//! EXPERIMENTAL template template inline -const Cube& +Cube& Cube::operator-=(const mtGlueCube& X) { arma_extra_debug_sigprint(); @@ -2486,11 +2482,10 @@ -//! EXPERIMENTAL template template inline -const Cube& +Cube& Cube::operator%=(const mtGlueCube& X) { arma_extra_debug_sigprint(); @@ -2502,11 +2497,10 @@ -//! EXPERIMENTAL template template inline -const Cube& +Cube& Cube::operator/=(const mtGlueCube& X) { arma_extra_debug_sigprint(); @@ -3041,6 +3035,20 @@ template inline void +Cube::reshape(const uword in_rows, const uword in_cols, const uword in_slices) + { + arma_extra_debug_sigprint(); + + *this = arma::reshape(*this, in_rows, in_cols, in_slices); + } + + + +//! NOTE: don't use this form; it's deprecated and will be removed +template +arma_deprecated +inline +void Cube::reshape(const uword in_rows, const uword in_cols, const uword in_slices, const uword dim) { arma_extra_debug_sigprint(); @@ -4330,7 +4338,7 @@ template template inline -const Cube& +Cube& Cube::fixed::operator=(const fixed& X) { arma_extra_debug_sigprint(); diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/debug.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/debug.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/debug.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/debug.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Stanislav Funiak +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup debug @@ -330,7 +335,7 @@ void arma_check(const bool state, const T1& x) { - if(state == true) { arma_stop_logic_error(arma_str::str_wrapper(x)); } + if(state) { arma_stop_logic_error(arma_str::str_wrapper(x)); } } @@ -340,7 +345,7 @@ void arma_check(const bool state, const T1& x, const T2& y) { - if(state == true) { arma_stop_logic_error( std::string(x) + std::string(y) ); } + if(state) { arma_stop_logic_error( std::string(x) + std::string(y) ); } } @@ -350,7 +355,7 @@ void arma_check_bad_alloc(const bool state, const T1& x) { - if(state == true) { arma_stop_bad_alloc(x); } + if(state) { arma_stop_bad_alloc(x); } } @@ -1267,8 +1272,8 @@ << arma_version::major << '.' << arma_version::minor << '.' << arma_version::patch << " (" << nickname << ")\n"; - out << "@ arma_config::use_wrapper = " << arma_config::use_wrapper << '\n'; - out << "@ arma_config::use_cxx11 = " << arma_config::use_cxx11 << '\n'; + out << "@ arma_config::wrapper = " << arma_config::wrapper << '\n'; + out << "@ arma_config::cxx11 = " << arma_config::cxx11 << '\n'; out << "@ arma_config::openmp = " << arma_config::openmp << '\n'; out << "@ arma_config::lapack = " << arma_config::lapack << '\n'; out << "@ arma_config::blas = " << arma_config::blas << '\n'; @@ -1280,6 +1285,8 @@ out << "@ arma_config::good_comp = " << arma_config::good_comp << '\n'; out << "@ arma_config::extra_code = " << arma_config::extra_code << '\n'; out << "@ arma_config::mat_prealloc = " << arma_config::mat_prealloc << '\n'; + out << "@ arma_config::mp_threshold = " << arma_config::mp_threshold << '\n'; + out << "@ arma_config::mp_threads = " << arma_config::mp_threads << '\n'; out << "@ sizeof(void*) = " << sizeof(void*) << '\n'; out << "@ sizeof(int) = " << sizeof(int) << '\n'; out << "@ sizeof(long) = " << sizeof(long) << '\n'; diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/def_arpack.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/def_arpack.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/def_arpack.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/def_arpack.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) // -// Written by Ryan Curtin +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #ifdef ARMA_USE_ARPACK diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/def_atlas.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/def_atlas.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/def_atlas.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/def_atlas.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #ifdef ARMA_USE_ATLAS diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/def_blas.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/def_blas.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/def_blas.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/def_blas.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/def_hdf5.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/def_hdf5.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/def_hdf5.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/def_hdf5.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2014 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #if defined(ARMA_USE_HDF5) diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/def_lapack.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/def_lapack.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/def_lapack.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/def_lapack.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,13 +1,17 @@ -// Copyright (C) 2008-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by James Sanders -// Written by Eric Jon Sundstrom +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/def_superlu.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/def_superlu.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/def_superlu.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/def_superlu.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/ -// ------------------------------------------------------------------- +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #if defined(ARMA_USE_SUPERLU) diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/diagmat_proxy.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/diagmat_proxy.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/diagmat_proxy.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/diagmat_proxy.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup diagmat_proxy diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/diagview_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/diagview_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/diagview_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/diagview_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup diagview diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/diagview_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/diagview_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/diagview_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/diagview_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup diagview diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/diskio_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/diskio_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/diskio_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/diskio_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,14 +1,17 @@ -// Copyright (C) 2008-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ian Cullinan -// Written by Ryan Curtin -// Written by Szabolcs Horvat +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup diskio @@ -53,6 +56,7 @@ template inline static bool save_raw_binary (const Mat& x, std::ostream& f); template inline static bool save_arma_ascii (const Mat& x, std::ostream& f); template inline static bool save_csv_ascii (const Mat& x, std::ostream& f); + template inline static bool save_csv_ascii (const Mat< std::complex >& x, std::ostream& f); template inline static bool save_arma_binary(const Mat& x, std::ostream& f); template inline static bool save_pgm_binary (const Mat& x, std::ostream& f); template inline static bool save_pgm_binary (const Mat< std::complex >& x, std::ostream& f); @@ -75,6 +79,7 @@ template inline static bool load_raw_binary (Mat& x, std::istream& f, std::string& err_msg); template inline static bool load_arma_ascii (Mat& x, std::istream& f, std::string& err_msg); template inline static bool load_csv_ascii (Mat& x, std::istream& f, std::string& err_msg); + template inline static bool load_csv_ascii (Mat< std::complex >& x, std::istream& f, std::string& err_msg); template inline static bool load_arma_binary(Mat& x, std::istream& f, std::string& err_msg); template inline static bool load_pgm_binary (Mat& x, std::istream& is, std::string& err_msg); template inline static bool load_pgm_binary (Mat< std::complex >& x, std::istream& is, std::string& err_msg); diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/diskio_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/diskio_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/diskio_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/diskio_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,14 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ian Cullinan -// Written by Ryan Curtin -// Written by Szabolcs Horvat +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup diskio @@ -794,29 +797,33 @@ uword cell_width; - // TODO: need sane values for complex numbers - - if( (is_float::value) || (is_double::value) ) + if(is_real::value) { f.setf(ios::scientific); f.precision(14); cell_width = 22; } + if(is_cx::value) + { + f.setf(ios::scientific); + f.precision(14); + } + for(uword row=0; row < x.n_rows; ++row) { for(uword col=0; col < x.n_cols; ++col) { f.put(' '); - if( (is_float::value) || (is_double::value) ) + if(is_real::value) { f.width(std::streamsize(cell_width)); } arma_ostream::print_elem(f, x.at(row,col), false); } - + f.put('\n'); } @@ -920,22 +927,26 @@ uword cell_width; - // TODO: need sane values for complex numbers - - if( (is_float::value) || (is_double::value) ) + if(is_real::value) { f.setf(ios::scientific); f.precision(14); cell_width = 22; } - + + if(is_cx::value) + { + f.setf(ios::scientific); + f.precision(14); + } + for(uword row=0; row < x.n_rows; ++row) { for(uword col=0; col < x.n_cols; ++col) { f.put(' '); - if( (is_float::value) || (is_double::value) ) + if(is_real::value) { f.width(std::streamsize(cell_width)); } @@ -997,8 +1008,6 @@ const ios::fmtflags orig_flags = f.flags(); - // TODO: need sane values for complex numbers - if( (is_float::value) || (is_double::value) ) { f.setf(ios::scientific); @@ -1014,10 +1023,59 @@ { arma_ostream::print_elem(f, x.at(row,col), false); - if( col < (x_n_cols-1) ) - { - f.put(','); - } + if( col < (x_n_cols-1) ) { f.put(','); } + } + + f.put('\n'); + } + + const bool save_okay = f.good(); + + f.flags(orig_flags); + + return save_okay; + } + + + +//! Save a matrix in CSV text format (human readable); complex numbers stored in "a+bi" format +template +inline +bool +diskio::save_csv_ascii(const Mat< std::complex >& x, std::ostream& f) + { + arma_extra_debug_sigprint(); + + typedef typename std::complex eT; + + const ios::fmtflags orig_flags = f.flags(); + + if( (is_float::value) || (is_double::value) ) + { + f.setf(ios::scientific); + f.precision(14); + } + + uword x_n_rows = x.n_rows; + uword x_n_cols = x.n_cols; + + for(uword row=0; row < x_n_rows; ++row) + { + for(uword col=0; col < x_n_cols; ++col) + { + const eT& val = x.at(row,col); + + const T tmp_r = std::real(val); + const T tmp_i = std::imag(val); + const T tmp_i_abs = (tmp_i < T(0)) ? T(-tmp_i) : T(tmp_i); + const char tmp_sign = (tmp_i < T(0)) ? char('-') : char('+'); + + arma_ostream::print_elem(f, tmp_r, false); + f.put(tmp_sign); + arma_ostream::print_elem(f, tmp_i_abs, false); + f.put('i'); + + if( col < (x_n_cols-1) ) { f.put(','); } } f.put('\n'); @@ -1613,6 +1671,8 @@ { arma_extra_debug_sigprint(); + // TODO: replace with more efficient implementation + bool load_okay = f.good(); f.clear(); @@ -1717,6 +1777,231 @@ +//! Load a matrix in CSV text format (human readable); complex numbers stored in "a+bi" format +template +inline +bool +diskio::load_csv_ascii(Mat< std::complex >& x, std::istream& f, std::string&) + { + arma_extra_debug_sigprint(); + + // TODO: replace with more efficient implementation + + bool load_okay = f.good(); + + f.clear(); + const std::fstream::pos_type pos1 = f.tellg(); + + // + // work out the size + + uword f_n_rows = 0; + uword f_n_cols = 0; + + std::string line_string; + std::string token; + + std::stringstream line_stream; + + while( (f.good() == true) && (load_okay == true) ) + { + std::getline(f, line_string); + + if(line_string.size() == 0) + { + break; + } + + line_stream.clear(); + line_stream.str(line_string); + + uword line_n_cols = 0; + + while(line_stream.good() == true) + { + std::getline(line_stream, token, ','); + ++line_n_cols; + } + + if(f_n_cols < line_n_cols) + { + f_n_cols = line_n_cols; + } + + ++f_n_rows; + } + + f.clear(); + f.seekg(pos1); + + x.zeros(f_n_rows, f_n_cols); + + uword row = 0; + + std::stringstream ss; + std::string str_real; + std::string str_imag; + + while(f.good() == true) + { + std::getline(f, line_string); + + if(line_string.size() == 0) + { + break; + } + + line_stream.clear(); + line_stream.str(line_string); + + uword col = 0; + + while(line_stream.good() == true) + { + std::getline(line_stream, token, ','); + + if(token.length() == 0) { col++; continue; } + + bool found_x = false; + std::string::size_type loc_x = 0; // location of the separator (+ or -) between the real and imaginary part + + std::string::size_type loc_i = token.find_last_of('i'); // location of the imaginary part indicator + + if(loc_i == std::string::npos) + { + str_real = token; + str_imag.clear(); + } + else + { + bool found_plus = false; + bool found_minus = false; + + std::string::size_type loc_plus = token.find_last_of('+'); + + if(loc_plus != std::string::npos) + { + if(loc_plus >= 1) + { + const char prev_char = token.at(loc_plus-1); + + // make sure we're not looking at the sign of the exponent + if( (prev_char != 'e') && (prev_char != 'E') ) + { + found_plus = true; + } + else + { + // search again, omitting the exponent + loc_plus = token.find_last_of('+', loc_plus-1); + + if(loc_plus != std::string::npos) { found_plus = true; } + } + } + else + { + // loc_plus == 0, meaning we're at the start of the string + found_plus = true; + } + } + + std::string::size_type loc_minus = token.find_last_of('-'); + + if(loc_minus != std::string::npos) + { + if(loc_minus >= 1) + { + const char prev_char = token.at(loc_minus-1); + + // make sure we're not looking at the sign of the exponent + if( (prev_char != 'e') && (prev_char != 'E') ) + { + found_minus = true; + } + else + { + // search again, omitting the exponent + loc_minus = token.find_last_of('-', loc_minus-1); + + if(loc_minus != std::string::npos) { found_minus = true; } + } + } + else + { + // loc_minus == 0, meaning we're at the start of the string + found_minus = true; + } + } + + if(found_plus && found_minus) + { + if( (loc_i > loc_plus) && (loc_i > loc_minus) ) + { + // choose the sign closest to the "i" to be the separator between the real and imaginary part + loc_x = ( (loc_i - loc_plus) < (loc_i - loc_minus) ) ? loc_plus : loc_minus; + found_x = true; + } + } + else if(found_plus ) { loc_x = loc_plus; found_x = true; } + else if(found_minus) { loc_x = loc_minus; found_x = true; } + + if(found_x) + { + if(loc_x > 0) { str_real = token.substr(0,loc_x); } else { str_real.clear(); } + if((loc_x+1) < token.size()) { str_imag = token.substr(loc_x, token.size()-loc_x-1); } else { str_imag.clear(); } + } + } + + T val_real_1 = T(0); + T val_real_2 = T(0); + + T val_imag_1 = T(0); + T val_imag_2 = T(0); + + ss.clear(); + ss.str(str_real); + ss >> val_real_1; + + if(ss.fail() == false) + { + val_real_2 = val_real_1; + } + else + { + T val_tmp = T(0); + diskio::convert_naninf(val_tmp, str_real); + val_real_2 = val_tmp; + } + + + ss.clear(); + ss.str(str_imag); + ss >> val_imag_1; + + if(ss.fail() == false) + { + val_imag_2 = val_imag_1; + } + else + { + T val_tmp = T(0); + diskio::convert_naninf(val_tmp, str_real); + val_imag_2 = val_tmp; + } + + x.at(row,col) = std::complex(val_real_2, val_imag_2); + + ++col; + } + + ++row; + } + + return load_okay; + } + + + //! Load a matrix in binary format, //! with a header that indicates the matrix type as well as its dimensions template @@ -2458,6 +2743,8 @@ arma_extra_debug_sigprint(); arma_ignore(err_msg); + // TODO: replace with more efficient implementation + bool load_okay = f.good(); f.clear(); @@ -2683,6 +2970,8 @@ arma_extra_debug_sigprint(); arma_ignore(err_msg); + // TODO: replace with more efficient implementation + bool load_okay = f.good(); f.clear(); @@ -3135,15 +3424,19 @@ uword cell_width; - // TODO: need sane values for complex numbers - - if( (is_float::value) || (is_double::value) ) + if(is_real::value) { f.setf(ios::scientific); f.precision(14); cell_width = 22; } + if(is_cx::value) + { + f.setf(ios::scientific); + f.precision(14); + } + for(uword slice=0; slice < x.n_slices; ++slice) { for(uword row=0; row < x.n_rows; ++row) @@ -3152,7 +3445,7 @@ { f.put(' '); - if( (is_float::value) || (is_double::value) ) + if(is_real::value) { f.width(std::streamsize(cell_width)); } @@ -3264,15 +3557,19 @@ uword cell_width; - // TODO: need sane values for complex numbers - - if( (is_float::value) || (is_double::value) ) + if(is_real::value) { f.setf(ios::scientific); f.precision(14); cell_width = 22; } - + + if(is_cx::value) + { + f.setf(ios::scientific); + f.precision(14); + } + for(uword slice=0; slice < x.n_slices; ++slice) { for(uword row=0; row < x.n_rows; ++row) @@ -3281,7 +3578,7 @@ { f.put(' '); - if( (is_float::value) || (is_double::value) ) + if(is_real::value) { f.width(std::streamsize(cell_width)); } diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/distr_param.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/distr_param.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/distr_param.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/distr_param.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/eGlue_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/eGlue_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/eGlue_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/eGlue_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup eGlue @@ -23,6 +29,7 @@ typedef Proxy proxy2_type; static const bool use_at = (Proxy::use_at || Proxy::use_at ); + static const bool use_mp = (Proxy::use_mp || Proxy::use_mp ); static const bool has_subview = (Proxy::has_subview || Proxy::has_subview); static const bool fake_mat = (Proxy::fake_mat || Proxy::fake_mat ); diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/eglue_core_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/eglue_core_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/eglue_core_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/eglue_core_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup eglue_core diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/eglue_core_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/eglue_core_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/eglue_core_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/eglue_core_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup eglue_core @@ -20,6 +26,10 @@ #undef operatorA #undef operatorB +#undef arma_applier_1_mp +#undef arma_applier_2_mp +#undef arma_applier_3_mp + #if defined(ARMA_SIMPLE_LOOPS) #define arma_applier_1u(operatorA, operatorB) \ @@ -167,6 +177,75 @@ +#if (defined(ARMA_USE_OPENMP) && defined(ARMA_USE_CXX11)) + + #define arma_applier_1_mp(operatorA, operatorB) \ + {\ + const int n_threads = mp_thread_limit::get();\ + _Pragma("omp parallel for schedule(static) num_threads(n_threads)")\ + for(uword i=0; i::use_at || Proxy::use_at); + const bool use_mp = (Proxy::use_mp || Proxy::use_mp) && (arma_config::cxx11 && arma_config::openmp); // NOTE: we're assuming that the matrix has already been set to the correct size and there is no aliasing; // size setting and alias checking is done by either the Mat contructor or operator=() @@ -195,41 +275,54 @@ { const uword n_elem = x.get_n_elem(); - if(memory::is_aligned(out_mem)) + if(use_mp && mp_gate::use_mp && Proxy::use_mp)>::eval(n_elem)) { - memory::mark_as_aligned(out_mem); + typename Proxy::ea_type P1 = x.P1.get_ea(); + typename Proxy::ea_type P2 = x.P2.get_ea(); - if(x.P1.is_aligned() && x.P2.is_aligned()) + if(is_same_type::yes) { arma_applier_1_mp(=, +); } + else if(is_same_type::yes) { arma_applier_1_mp(=, -); } + else if(is_same_type::yes) { arma_applier_1_mp(=, /); } + else if(is_same_type::yes) { arma_applier_1_mp(=, *); } + } + else + { + if(memory::is_aligned(out_mem)) { - typename Proxy::aligned_ea_type P1 = x.P1.get_aligned_ea(); - typename Proxy::aligned_ea_type P2 = x.P2.get_aligned_ea(); + memory::mark_as_aligned(out_mem); - if(is_same_type::yes) { arma_applier_1a(=, +); } - else if(is_same_type::yes) { arma_applier_1a(=, -); } - else if(is_same_type::yes) { arma_applier_1a(=, /); } - else if(is_same_type::yes) { arma_applier_1a(=, *); } + if(x.P1.is_aligned() && x.P2.is_aligned()) + { + typename Proxy::aligned_ea_type P1 = x.P1.get_aligned_ea(); + typename Proxy::aligned_ea_type P2 = x.P2.get_aligned_ea(); + + if(is_same_type::yes) { arma_applier_1a(=, +); } + else if(is_same_type::yes) { arma_applier_1a(=, -); } + else if(is_same_type::yes) { arma_applier_1a(=, /); } + else if(is_same_type::yes) { arma_applier_1a(=, *); } + } + else + { + typename Proxy::ea_type P1 = x.P1.get_ea(); + typename Proxy::ea_type P2 = x.P2.get_ea(); + + if(is_same_type::yes) { arma_applier_1u(=, +); } + else if(is_same_type::yes) { arma_applier_1u(=, -); } + else if(is_same_type::yes) { arma_applier_1u(=, /); } + else if(is_same_type::yes) { arma_applier_1u(=, *); } + } } else { typename Proxy::ea_type P1 = x.P1.get_ea(); typename Proxy::ea_type P2 = x.P2.get_ea(); - + if(is_same_type::yes) { arma_applier_1u(=, +); } else if(is_same_type::yes) { arma_applier_1u(=, -); } else if(is_same_type::yes) { arma_applier_1u(=, /); } else if(is_same_type::yes) { arma_applier_1u(=, *); } } } - else - { - typename Proxy::ea_type P1 = x.P1.get_ea(); - typename Proxy::ea_type P2 = x.P2.get_ea(); - - if(is_same_type::yes) { arma_applier_1u(=, +); } - else if(is_same_type::yes) { arma_applier_1u(=, -); } - else if(is_same_type::yes) { arma_applier_1u(=, /); } - else if(is_same_type::yes) { arma_applier_1u(=, *); } - } } else { @@ -239,10 +332,20 @@ const Proxy& P1 = x.P1; const Proxy& P2 = x.P2; - if(is_same_type::yes) { arma_applier_2(=, +); } - else if(is_same_type::yes) { arma_applier_2(=, -); } - else if(is_same_type::yes) { arma_applier_2(=, /); } - else if(is_same_type::yes) { arma_applier_2(=, *); } + if(use_mp && mp_gate::use_mp && Proxy::use_mp)>::eval(x.get_n_elem())) + { + if(is_same_type::yes) { arma_applier_2_mp(=, +); } + else if(is_same_type::yes) { arma_applier_2_mp(=, -); } + else if(is_same_type::yes) { arma_applier_2_mp(=, /); } + else if(is_same_type::yes) { arma_applier_2_mp(=, *); } + } + else + { + if(is_same_type::yes) { arma_applier_2(=, +); } + else if(is_same_type::yes) { arma_applier_2(=, -); } + else if(is_same_type::yes) { arma_applier_2(=, /); } + else if(is_same_type::yes) { arma_applier_2(=, *); } + } } } @@ -267,56 +370,80 @@ eT* out_mem = out.memptr(); const bool use_at = (Proxy::use_at || Proxy::use_at); + const bool use_mp = (Proxy::use_mp || Proxy::use_mp) && (arma_config::cxx11 && arma_config::openmp); if(use_at == false) { const uword n_elem = x.get_n_elem(); - if(memory::is_aligned(out_mem)) + if(use_mp && mp_gate::use_mp && Proxy::use_mp)>::eval(n_elem)) { - memory::mark_as_aligned(out_mem); + typename Proxy::ea_type P1 = x.P1.get_ea(); + typename Proxy::ea_type P2 = x.P2.get_ea(); - if(x.P1.is_aligned() && x.P2.is_aligned()) + if(is_same_type::yes) { arma_applier_1_mp(+=, +); } + else if(is_same_type::yes) { arma_applier_1_mp(+=, -); } + else if(is_same_type::yes) { arma_applier_1_mp(+=, /); } + else if(is_same_type::yes) { arma_applier_1_mp(+=, *); } + } + else + { + if(memory::is_aligned(out_mem)) { - typename Proxy::aligned_ea_type P1 = x.P1.get_aligned_ea(); - typename Proxy::aligned_ea_type P2 = x.P2.get_aligned_ea(); + memory::mark_as_aligned(out_mem); - if(is_same_type::yes) { arma_applier_1a(+=, +); } - else if(is_same_type::yes) { arma_applier_1a(+=, -); } - else if(is_same_type::yes) { arma_applier_1a(+=, /); } - else if(is_same_type::yes) { arma_applier_1a(+=, *); } + if(x.P1.is_aligned() && x.P2.is_aligned()) + { + typename Proxy::aligned_ea_type P1 = x.P1.get_aligned_ea(); + typename Proxy::aligned_ea_type P2 = x.P2.get_aligned_ea(); + + if(is_same_type::yes) { arma_applier_1a(+=, +); } + else if(is_same_type::yes) { arma_applier_1a(+=, -); } + else if(is_same_type::yes) { arma_applier_1a(+=, /); } + else if(is_same_type::yes) { arma_applier_1a(+=, *); } + } + else + { + typename Proxy::ea_type P1 = x.P1.get_ea(); + typename Proxy::ea_type P2 = x.P2.get_ea(); + + if(is_same_type::yes) { arma_applier_1u(+=, +); } + else if(is_same_type::yes) { arma_applier_1u(+=, -); } + else if(is_same_type::yes) { arma_applier_1u(+=, /); } + else if(is_same_type::yes) { arma_applier_1u(+=, *); } + } } else { typename Proxy::ea_type P1 = x.P1.get_ea(); typename Proxy::ea_type P2 = x.P2.get_ea(); - + if(is_same_type::yes) { arma_applier_1u(+=, +); } else if(is_same_type::yes) { arma_applier_1u(+=, -); } else if(is_same_type::yes) { arma_applier_1u(+=, /); } else if(is_same_type::yes) { arma_applier_1u(+=, *); } } } - else - { - typename Proxy::ea_type P1 = x.P1.get_ea(); - typename Proxy::ea_type P2 = x.P2.get_ea(); - - if(is_same_type::yes) { arma_applier_1u(+=, +); } - else if(is_same_type::yes) { arma_applier_1u(+=, -); } - else if(is_same_type::yes) { arma_applier_1u(+=, /); } - else if(is_same_type::yes) { arma_applier_1u(+=, *); } - } } else { const Proxy& P1 = x.P1; const Proxy& P2 = x.P2; - if(is_same_type::yes) { arma_applier_2(+=, +); } - else if(is_same_type::yes) { arma_applier_2(+=, -); } - else if(is_same_type::yes) { arma_applier_2(+=, /); } - else if(is_same_type::yes) { arma_applier_2(+=, *); } + if(use_mp && mp_gate::use_mp && Proxy::use_mp)>::eval(x.get_n_elem())) + { + if(is_same_type::yes) { arma_applier_2_mp(+=, +); } + else if(is_same_type::yes) { arma_applier_2_mp(+=, -); } + else if(is_same_type::yes) { arma_applier_2_mp(+=, /); } + else if(is_same_type::yes) { arma_applier_2_mp(+=, *); } + } + else + { + if(is_same_type::yes) { arma_applier_2(+=, +); } + else if(is_same_type::yes) { arma_applier_2(+=, -); } + else if(is_same_type::yes) { arma_applier_2(+=, /); } + else if(is_same_type::yes) { arma_applier_2(+=, *); } + } } } @@ -341,56 +468,80 @@ eT* out_mem = out.memptr(); const bool use_at = (Proxy::use_at || Proxy::use_at); + const bool use_mp = (Proxy::use_mp || Proxy::use_mp) && (arma_config::cxx11 && arma_config::openmp); if(use_at == false) { const uword n_elem = x.get_n_elem(); - if(memory::is_aligned(out_mem)) + if(use_mp && mp_gate::use_mp && Proxy::use_mp)>::eval(n_elem)) { - memory::mark_as_aligned(out_mem); + typename Proxy::ea_type P1 = x.P1.get_ea(); + typename Proxy::ea_type P2 = x.P2.get_ea(); - if(x.P1.is_aligned() && x.P2.is_aligned()) + if(is_same_type::yes) { arma_applier_1_mp(-=, +); } + else if(is_same_type::yes) { arma_applier_1_mp(-=, -); } + else if(is_same_type::yes) { arma_applier_1_mp(-=, /); } + else if(is_same_type::yes) { arma_applier_1_mp(-=, *); } + } + else + { + if(memory::is_aligned(out_mem)) { - typename Proxy::aligned_ea_type P1 = x.P1.get_aligned_ea(); - typename Proxy::aligned_ea_type P2 = x.P2.get_aligned_ea(); + memory::mark_as_aligned(out_mem); - if(is_same_type::yes) { arma_applier_1a(-=, +); } - else if(is_same_type::yes) { arma_applier_1a(-=, -); } - else if(is_same_type::yes) { arma_applier_1a(-=, /); } - else if(is_same_type::yes) { arma_applier_1a(-=, *); } + if(x.P1.is_aligned() && x.P2.is_aligned()) + { + typename Proxy::aligned_ea_type P1 = x.P1.get_aligned_ea(); + typename Proxy::aligned_ea_type P2 = x.P2.get_aligned_ea(); + + if(is_same_type::yes) { arma_applier_1a(-=, +); } + else if(is_same_type::yes) { arma_applier_1a(-=, -); } + else if(is_same_type::yes) { arma_applier_1a(-=, /); } + else if(is_same_type::yes) { arma_applier_1a(-=, *); } + } + else + { + typename Proxy::ea_type P1 = x.P1.get_ea(); + typename Proxy::ea_type P2 = x.P2.get_ea(); + + if(is_same_type::yes) { arma_applier_1u(-=, +); } + else if(is_same_type::yes) { arma_applier_1u(-=, -); } + else if(is_same_type::yes) { arma_applier_1u(-=, /); } + else if(is_same_type::yes) { arma_applier_1u(-=, *); } + } } else { typename Proxy::ea_type P1 = x.P1.get_ea(); typename Proxy::ea_type P2 = x.P2.get_ea(); - + if(is_same_type::yes) { arma_applier_1u(-=, +); } else if(is_same_type::yes) { arma_applier_1u(-=, -); } else if(is_same_type::yes) { arma_applier_1u(-=, /); } else if(is_same_type::yes) { arma_applier_1u(-=, *); } } } - else - { - typename Proxy::ea_type P1 = x.P1.get_ea(); - typename Proxy::ea_type P2 = x.P2.get_ea(); - - if(is_same_type::yes) { arma_applier_1u(-=, +); } - else if(is_same_type::yes) { arma_applier_1u(-=, -); } - else if(is_same_type::yes) { arma_applier_1u(-=, /); } - else if(is_same_type::yes) { arma_applier_1u(-=, *); } - } } else { const Proxy& P1 = x.P1; const Proxy& P2 = x.P2; - if(is_same_type::yes) { arma_applier_2(-=, +); } - else if(is_same_type::yes) { arma_applier_2(-=, -); } - else if(is_same_type::yes) { arma_applier_2(-=, /); } - else if(is_same_type::yes) { arma_applier_2(-=, *); } + if(use_mp && mp_gate::use_mp && Proxy::use_mp)>::eval(x.get_n_elem())) + { + if(is_same_type::yes) { arma_applier_2_mp(-=, +); } + else if(is_same_type::yes) { arma_applier_2_mp(-=, -); } + else if(is_same_type::yes) { arma_applier_2_mp(-=, /); } + else if(is_same_type::yes) { arma_applier_2_mp(-=, *); } + } + else + { + if(is_same_type::yes) { arma_applier_2(-=, +); } + else if(is_same_type::yes) { arma_applier_2(-=, -); } + else if(is_same_type::yes) { arma_applier_2(-=, /); } + else if(is_same_type::yes) { arma_applier_2(-=, *); } + } } } @@ -415,56 +566,80 @@ eT* out_mem = out.memptr(); const bool use_at = (Proxy::use_at || Proxy::use_at); + const bool use_mp = (Proxy::use_mp || Proxy::use_mp) && (arma_config::cxx11 && arma_config::openmp); if(use_at == false) { const uword n_elem = x.get_n_elem(); - if(memory::is_aligned(out_mem)) + if(use_mp && mp_gate::use_mp && Proxy::use_mp)>::eval(n_elem)) { - memory::mark_as_aligned(out_mem); + typename Proxy::ea_type P1 = x.P1.get_ea(); + typename Proxy::ea_type P2 = x.P2.get_ea(); - if(x.P1.is_aligned() && x.P2.is_aligned()) + if(is_same_type::yes) { arma_applier_1_mp(*=, +); } + else if(is_same_type::yes) { arma_applier_1_mp(*=, -); } + else if(is_same_type::yes) { arma_applier_1_mp(*=, /); } + else if(is_same_type::yes) { arma_applier_1_mp(*=, *); } + } + else + { + if(memory::is_aligned(out_mem)) { - typename Proxy::aligned_ea_type P1 = x.P1.get_aligned_ea(); - typename Proxy::aligned_ea_type P2 = x.P2.get_aligned_ea(); + memory::mark_as_aligned(out_mem); - if(is_same_type::yes) { arma_applier_1a(*=, +); } - else if(is_same_type::yes) { arma_applier_1a(*=, -); } - else if(is_same_type::yes) { arma_applier_1a(*=, /); } - else if(is_same_type::yes) { arma_applier_1a(*=, *); } + if(x.P1.is_aligned() && x.P2.is_aligned()) + { + typename Proxy::aligned_ea_type P1 = x.P1.get_aligned_ea(); + typename Proxy::aligned_ea_type P2 = x.P2.get_aligned_ea(); + + if(is_same_type::yes) { arma_applier_1a(*=, +); } + else if(is_same_type::yes) { arma_applier_1a(*=, -); } + else if(is_same_type::yes) { arma_applier_1a(*=, /); } + else if(is_same_type::yes) { arma_applier_1a(*=, *); } + } + else + { + typename Proxy::ea_type P1 = x.P1.get_ea(); + typename Proxy::ea_type P2 = x.P2.get_ea(); + + if(is_same_type::yes) { arma_applier_1u(*=, +); } + else if(is_same_type::yes) { arma_applier_1u(*=, -); } + else if(is_same_type::yes) { arma_applier_1u(*=, /); } + else if(is_same_type::yes) { arma_applier_1u(*=, *); } + } } else { typename Proxy::ea_type P1 = x.P1.get_ea(); typename Proxy::ea_type P2 = x.P2.get_ea(); - + if(is_same_type::yes) { arma_applier_1u(*=, +); } else if(is_same_type::yes) { arma_applier_1u(*=, -); } else if(is_same_type::yes) { arma_applier_1u(*=, /); } else if(is_same_type::yes) { arma_applier_1u(*=, *); } } } - else - { - typename Proxy::ea_type P1 = x.P1.get_ea(); - typename Proxy::ea_type P2 = x.P2.get_ea(); - - if(is_same_type::yes) { arma_applier_1u(*=, +); } - else if(is_same_type::yes) { arma_applier_1u(*=, -); } - else if(is_same_type::yes) { arma_applier_1u(*=, /); } - else if(is_same_type::yes) { arma_applier_1u(*=, *); } - } } else { const Proxy& P1 = x.P1; const Proxy& P2 = x.P2; - if(is_same_type::yes) { arma_applier_2(*=, +); } - else if(is_same_type::yes) { arma_applier_2(*=, -); } - else if(is_same_type::yes) { arma_applier_2(*=, /); } - else if(is_same_type::yes) { arma_applier_2(*=, *); } + if(use_mp && mp_gate::use_mp && Proxy::use_mp)>::eval(x.get_n_elem())) + { + if(is_same_type::yes) { arma_applier_2_mp(*=, +); } + else if(is_same_type::yes) { arma_applier_2_mp(*=, -); } + else if(is_same_type::yes) { arma_applier_2_mp(*=, /); } + else if(is_same_type::yes) { arma_applier_2_mp(*=, *); } + } + else + { + if(is_same_type::yes) { arma_applier_2(*=, +); } + else if(is_same_type::yes) { arma_applier_2(*=, -); } + else if(is_same_type::yes) { arma_applier_2(*=, /); } + else if(is_same_type::yes) { arma_applier_2(*=, *); } + } } } @@ -489,56 +664,80 @@ eT* out_mem = out.memptr(); const bool use_at = (Proxy::use_at || Proxy::use_at); + const bool use_mp = (Proxy::use_mp || Proxy::use_mp) && (arma_config::cxx11 && arma_config::openmp); if(use_at == false) { const uword n_elem = x.get_n_elem(); - if(memory::is_aligned(out_mem)) + if(use_mp && mp_gate::use_mp && Proxy::use_mp)>::eval(n_elem)) { - memory::mark_as_aligned(out_mem); + typename Proxy::ea_type P1 = x.P1.get_ea(); + typename Proxy::ea_type P2 = x.P2.get_ea(); - if(x.P1.is_aligned() && x.P2.is_aligned()) + if(is_same_type::yes) { arma_applier_1_mp(/=, +); } + else if(is_same_type::yes) { arma_applier_1_mp(/=, -); } + else if(is_same_type::yes) { arma_applier_1_mp(/=, /); } + else if(is_same_type::yes) { arma_applier_1_mp(/=, *); } + } + else + { + if(memory::is_aligned(out_mem)) { - typename Proxy::aligned_ea_type P1 = x.P1.get_aligned_ea(); - typename Proxy::aligned_ea_type P2 = x.P2.get_aligned_ea(); + memory::mark_as_aligned(out_mem); - if(is_same_type::yes) { arma_applier_1a(/=, +); } - else if(is_same_type::yes) { arma_applier_1a(/=, -); } - else if(is_same_type::yes) { arma_applier_1a(/=, /); } - else if(is_same_type::yes) { arma_applier_1a(/=, *); } + if(x.P1.is_aligned() && x.P2.is_aligned()) + { + typename Proxy::aligned_ea_type P1 = x.P1.get_aligned_ea(); + typename Proxy::aligned_ea_type P2 = x.P2.get_aligned_ea(); + + if(is_same_type::yes) { arma_applier_1a(/=, +); } + else if(is_same_type::yes) { arma_applier_1a(/=, -); } + else if(is_same_type::yes) { arma_applier_1a(/=, /); } + else if(is_same_type::yes) { arma_applier_1a(/=, *); } + } + else + { + typename Proxy::ea_type P1 = x.P1.get_ea(); + typename Proxy::ea_type P2 = x.P2.get_ea(); + + if(is_same_type::yes) { arma_applier_1u(/=, +); } + else if(is_same_type::yes) { arma_applier_1u(/=, -); } + else if(is_same_type::yes) { arma_applier_1u(/=, /); } + else if(is_same_type::yes) { arma_applier_1u(/=, *); } + } } else { typename Proxy::ea_type P1 = x.P1.get_ea(); typename Proxy::ea_type P2 = x.P2.get_ea(); - + if(is_same_type::yes) { arma_applier_1u(/=, +); } else if(is_same_type::yes) { arma_applier_1u(/=, -); } else if(is_same_type::yes) { arma_applier_1u(/=, /); } else if(is_same_type::yes) { arma_applier_1u(/=, *); } } } - else - { - typename Proxy::ea_type P1 = x.P1.get_ea(); - typename Proxy::ea_type P2 = x.P2.get_ea(); - - if(is_same_type::yes) { arma_applier_1u(/=, +); } - else if(is_same_type::yes) { arma_applier_1u(/=, -); } - else if(is_same_type::yes) { arma_applier_1u(/=, /); } - else if(is_same_type::yes) { arma_applier_1u(/=, *); } - } } else { const Proxy& P1 = x.P1; const Proxy& P2 = x.P2; - if(is_same_type::yes) { arma_applier_2(/=, +); } - else if(is_same_type::yes) { arma_applier_2(/=, -); } - else if(is_same_type::yes) { arma_applier_2(/=, /); } - else if(is_same_type::yes) { arma_applier_2(/=, *); } + if(use_mp && mp_gate::use_mp && Proxy::use_mp)>::eval(x.get_n_elem())) + { + if(is_same_type::yes) { arma_applier_2_mp(/=, +); } + else if(is_same_type::yes) { arma_applier_2_mp(/=, -); } + else if(is_same_type::yes) { arma_applier_2_mp(/=, /); } + else if(is_same_type::yes) { arma_applier_2_mp(/=, *); } + } + else + { + if(is_same_type::yes) { arma_applier_2(/=, +); } + else if(is_same_type::yes) { arma_applier_2(/=, -); } + else if(is_same_type::yes) { arma_applier_2(/=, /); } + else if(is_same_type::yes) { arma_applier_2(/=, *); } + } } } @@ -561,6 +760,7 @@ typedef typename T1::elem_type eT; const bool use_at = (ProxyCube::use_at || ProxyCube::use_at); + const bool use_mp = (ProxyCube::use_mp || ProxyCube::use_mp) && (arma_config::cxx11 && arma_config::openmp); // NOTE: we're assuming that the cube has already been set to the correct size and there is no aliasing; // size setting and alias checking is done by either the Cube contructor or operator=() @@ -572,19 +772,42 @@ { const uword n_elem = out.n_elem; - if(memory::is_aligned(out_mem)) + if(use_mp && mp_gate::use_mp && ProxyCube::use_mp)>::eval(n_elem)) { - memory::mark_as_aligned(out_mem); + typename ProxyCube::ea_type P1 = x.P1.get_ea(); + typename ProxyCube::ea_type P2 = x.P2.get_ea(); - if(x.P1.is_aligned() && x.P2.is_aligned()) + if(is_same_type::yes) { arma_applier_1_mp(=, +); } + else if(is_same_type::yes) { arma_applier_1_mp(=, -); } + else if(is_same_type::yes) { arma_applier_1_mp(=, /); } + else if(is_same_type::yes) { arma_applier_1_mp(=, *); } + } + else + { + if(memory::is_aligned(out_mem)) { - typename ProxyCube::aligned_ea_type P1 = x.P1.get_aligned_ea(); - typename ProxyCube::aligned_ea_type P2 = x.P2.get_aligned_ea(); + memory::mark_as_aligned(out_mem); - if(is_same_type::yes) { arma_applier_1a(=, +); } - else if(is_same_type::yes) { arma_applier_1a(=, -); } - else if(is_same_type::yes) { arma_applier_1a(=, /); } - else if(is_same_type::yes) { arma_applier_1a(=, *); } + if(x.P1.is_aligned() && x.P2.is_aligned()) + { + typename ProxyCube::aligned_ea_type P1 = x.P1.get_aligned_ea(); + typename ProxyCube::aligned_ea_type P2 = x.P2.get_aligned_ea(); + + if(is_same_type::yes) { arma_applier_1a(=, +); } + else if(is_same_type::yes) { arma_applier_1a(=, -); } + else if(is_same_type::yes) { arma_applier_1a(=, /); } + else if(is_same_type::yes) { arma_applier_1a(=, *); } + } + else + { + typename ProxyCube::ea_type P1 = x.P1.get_ea(); + typename ProxyCube::ea_type P2 = x.P2.get_ea(); + + if(is_same_type::yes) { arma_applier_1u(=, +); } + else if(is_same_type::yes) { arma_applier_1u(=, -); } + else if(is_same_type::yes) { arma_applier_1u(=, /); } + else if(is_same_type::yes) { arma_applier_1u(=, *); } + } } else { @@ -597,30 +820,30 @@ else if(is_same_type::yes) { arma_applier_1u(=, *); } } } - else - { - typename ProxyCube::ea_type P1 = x.P1.get_ea(); - typename ProxyCube::ea_type P2 = x.P2.get_ea(); - - if(is_same_type::yes) { arma_applier_1u(=, +); } - else if(is_same_type::yes) { arma_applier_1u(=, -); } - else if(is_same_type::yes) { arma_applier_1u(=, /); } - else if(is_same_type::yes) { arma_applier_1u(=, *); } - } } else { const uword n_rows = x.get_n_rows(); const uword n_cols = x.get_n_cols(); const uword n_slices = x.get_n_slices(); - + const ProxyCube& P1 = x.P1; const ProxyCube& P2 = x.P2; - if(is_same_type::yes) { arma_applier_3(=, +); } - else if(is_same_type::yes) { arma_applier_3(=, -); } - else if(is_same_type::yes) { arma_applier_3(=, /); } - else if(is_same_type::yes) { arma_applier_3(=, *); } + if(use_mp && mp_gate::use_mp && ProxyCube::use_mp)>::eval(x.get_n_elem())) + { + if(is_same_type::yes) { arma_applier_3_mp(=, +); } + else if(is_same_type::yes) { arma_applier_3_mp(=, -); } + else if(is_same_type::yes) { arma_applier_3_mp(=, /); } + else if(is_same_type::yes) { arma_applier_3_mp(=, *); } + } + else + { + if(is_same_type::yes) { arma_applier_3(=, +); } + else if(is_same_type::yes) { arma_applier_3(=, -); } + else if(is_same_type::yes) { arma_applier_3(=, /); } + else if(is_same_type::yes) { arma_applier_3(=, *); } + } } } @@ -646,24 +869,48 @@ eT* out_mem = out.memptr(); const bool use_at = (ProxyCube::use_at || ProxyCube::use_at); + const bool use_mp = (ProxyCube::use_mp || ProxyCube::use_mp) && (arma_config::cxx11 && arma_config::openmp); if(use_at == false) { const uword n_elem = out.n_elem; - if(memory::is_aligned(out_mem)) + if(use_mp && mp_gate::use_mp && ProxyCube::use_mp)>::eval(n_elem)) { - memory::mark_as_aligned(out_mem); + typename ProxyCube::ea_type P1 = x.P1.get_ea(); + typename ProxyCube::ea_type P2 = x.P2.get_ea(); - if(x.P1.is_aligned() && x.P2.is_aligned()) + if(is_same_type::yes) { arma_applier_1_mp(+=, +); } + else if(is_same_type::yes) { arma_applier_1_mp(+=, -); } + else if(is_same_type::yes) { arma_applier_1_mp(+=, /); } + else if(is_same_type::yes) { arma_applier_1_mp(+=, *); } + } + else + { + if(memory::is_aligned(out_mem)) { - typename ProxyCube::aligned_ea_type P1 = x.P1.get_aligned_ea(); - typename ProxyCube::aligned_ea_type P2 = x.P2.get_aligned_ea(); + memory::mark_as_aligned(out_mem); - if(is_same_type::yes) { arma_applier_1a(+=, +); } - else if(is_same_type::yes) { arma_applier_1a(+=, -); } - else if(is_same_type::yes) { arma_applier_1a(+=, /); } - else if(is_same_type::yes) { arma_applier_1a(+=, *); } + if(x.P1.is_aligned() && x.P2.is_aligned()) + { + typename ProxyCube::aligned_ea_type P1 = x.P1.get_aligned_ea(); + typename ProxyCube::aligned_ea_type P2 = x.P2.get_aligned_ea(); + + if(is_same_type::yes) { arma_applier_1a(+=, +); } + else if(is_same_type::yes) { arma_applier_1a(+=, -); } + else if(is_same_type::yes) { arma_applier_1a(+=, /); } + else if(is_same_type::yes) { arma_applier_1a(+=, *); } + } + else + { + typename ProxyCube::ea_type P1 = x.P1.get_ea(); + typename ProxyCube::ea_type P2 = x.P2.get_ea(); + + if(is_same_type::yes) { arma_applier_1u(+=, +); } + else if(is_same_type::yes) { arma_applier_1u(+=, -); } + else if(is_same_type::yes) { arma_applier_1u(+=, /); } + else if(is_same_type::yes) { arma_applier_1u(+=, *); } + } } else { @@ -676,26 +923,26 @@ else if(is_same_type::yes) { arma_applier_1u(+=, *); } } } - else - { - typename ProxyCube::ea_type P1 = x.P1.get_ea(); - typename ProxyCube::ea_type P2 = x.P2.get_ea(); - - if(is_same_type::yes) { arma_applier_1u(+=, +); } - else if(is_same_type::yes) { arma_applier_1u(+=, -); } - else if(is_same_type::yes) { arma_applier_1u(+=, /); } - else if(is_same_type::yes) { arma_applier_1u(+=, *); } - } } else { const ProxyCube& P1 = x.P1; const ProxyCube& P2 = x.P2; - if(is_same_type::yes) { arma_applier_3(+=, +); } - else if(is_same_type::yes) { arma_applier_3(+=, -); } - else if(is_same_type::yes) { arma_applier_3(+=, /); } - else if(is_same_type::yes) { arma_applier_3(+=, *); } + if(use_mp && mp_gate::use_mp && ProxyCube::use_mp)>::eval(x.get_n_elem())) + { + if(is_same_type::yes) { arma_applier_3_mp(+=, +); } + else if(is_same_type::yes) { arma_applier_3_mp(+=, -); } + else if(is_same_type::yes) { arma_applier_3_mp(+=, /); } + else if(is_same_type::yes) { arma_applier_3_mp(+=, *); } + } + else + { + if(is_same_type::yes) { arma_applier_3(+=, +); } + else if(is_same_type::yes) { arma_applier_3(+=, -); } + else if(is_same_type::yes) { arma_applier_3(+=, /); } + else if(is_same_type::yes) { arma_applier_3(+=, *); } + } } } @@ -721,24 +968,48 @@ eT* out_mem = out.memptr(); const bool use_at = (ProxyCube::use_at || ProxyCube::use_at); + const bool use_mp = (ProxyCube::use_mp || ProxyCube::use_mp) && (arma_config::cxx11 && arma_config::openmp); if(use_at == false) { const uword n_elem = out.n_elem; - if(memory::is_aligned(out_mem)) + if(use_mp && mp_gate::use_mp && ProxyCube::use_mp)>::eval(n_elem)) { - memory::mark_as_aligned(out_mem); + typename ProxyCube::ea_type P1 = x.P1.get_ea(); + typename ProxyCube::ea_type P2 = x.P2.get_ea(); - if(x.P1.is_aligned() && x.P2.is_aligned()) + if(is_same_type::yes) { arma_applier_1_mp(-=, +); } + else if(is_same_type::yes) { arma_applier_1_mp(-=, -); } + else if(is_same_type::yes) { arma_applier_1_mp(-=, /); } + else if(is_same_type::yes) { arma_applier_1_mp(-=, *); } + } + else + { + if(memory::is_aligned(out_mem)) { - typename ProxyCube::aligned_ea_type P1 = x.P1.get_aligned_ea(); - typename ProxyCube::aligned_ea_type P2 = x.P2.get_aligned_ea(); + memory::mark_as_aligned(out_mem); - if(is_same_type::yes) { arma_applier_1a(-=, +); } - else if(is_same_type::yes) { arma_applier_1a(-=, -); } - else if(is_same_type::yes) { arma_applier_1a(-=, /); } - else if(is_same_type::yes) { arma_applier_1a(-=, *); } + if(x.P1.is_aligned() && x.P2.is_aligned()) + { + typename ProxyCube::aligned_ea_type P1 = x.P1.get_aligned_ea(); + typename ProxyCube::aligned_ea_type P2 = x.P2.get_aligned_ea(); + + if(is_same_type::yes) { arma_applier_1a(-=, +); } + else if(is_same_type::yes) { arma_applier_1a(-=, -); } + else if(is_same_type::yes) { arma_applier_1a(-=, /); } + else if(is_same_type::yes) { arma_applier_1a(-=, *); } + } + else + { + typename ProxyCube::ea_type P1 = x.P1.get_ea(); + typename ProxyCube::ea_type P2 = x.P2.get_ea(); + + if(is_same_type::yes) { arma_applier_1u(-=, +); } + else if(is_same_type::yes) { arma_applier_1u(-=, -); } + else if(is_same_type::yes) { arma_applier_1u(-=, /); } + else if(is_same_type::yes) { arma_applier_1u(-=, *); } + } } else { @@ -751,26 +1022,26 @@ else if(is_same_type::yes) { arma_applier_1u(-=, *); } } } - else - { - typename ProxyCube::ea_type P1 = x.P1.get_ea(); - typename ProxyCube::ea_type P2 = x.P2.get_ea(); - - if(is_same_type::yes) { arma_applier_1u(-=, +); } - else if(is_same_type::yes) { arma_applier_1u(-=, -); } - else if(is_same_type::yes) { arma_applier_1u(-=, /); } - else if(is_same_type::yes) { arma_applier_1u(-=, *); } - } } else { const ProxyCube& P1 = x.P1; const ProxyCube& P2 = x.P2; - if(is_same_type::yes) { arma_applier_3(-=, +); } - else if(is_same_type::yes) { arma_applier_3(-=, -); } - else if(is_same_type::yes) { arma_applier_3(-=, /); } - else if(is_same_type::yes) { arma_applier_3(-=, *); } + if(use_mp && mp_gate::use_mp && ProxyCube::use_mp)>::eval(x.get_n_elem())) + { + if(is_same_type::yes) { arma_applier_3_mp(-=, +); } + else if(is_same_type::yes) { arma_applier_3_mp(-=, -); } + else if(is_same_type::yes) { arma_applier_3_mp(-=, /); } + else if(is_same_type::yes) { arma_applier_3_mp(-=, *); } + } + else + { + if(is_same_type::yes) { arma_applier_3(-=, +); } + else if(is_same_type::yes) { arma_applier_3(-=, -); } + else if(is_same_type::yes) { arma_applier_3(-=, /); } + else if(is_same_type::yes) { arma_applier_3(-=, *); } + } } } @@ -796,24 +1067,48 @@ eT* out_mem = out.memptr(); const bool use_at = (ProxyCube::use_at || ProxyCube::use_at); + const bool use_mp = (ProxyCube::use_mp || ProxyCube::use_mp) && (arma_config::cxx11 && arma_config::openmp); if(use_at == false) { const uword n_elem = out.n_elem; - if(memory::is_aligned(out_mem)) + if(use_mp && mp_gate::use_mp && ProxyCube::use_mp)>::eval(n_elem)) { - memory::mark_as_aligned(out_mem); + typename ProxyCube::ea_type P1 = x.P1.get_ea(); + typename ProxyCube::ea_type P2 = x.P2.get_ea(); - if(x.P1.is_aligned() && x.P2.is_aligned()) + if(is_same_type::yes) { arma_applier_1_mp(*=, +); } + else if(is_same_type::yes) { arma_applier_1_mp(*=, -); } + else if(is_same_type::yes) { arma_applier_1_mp(*=, /); } + else if(is_same_type::yes) { arma_applier_1_mp(*=, *); } + } + else + { + if(memory::is_aligned(out_mem)) { - typename ProxyCube::aligned_ea_type P1 = x.P1.get_aligned_ea(); - typename ProxyCube::aligned_ea_type P2 = x.P2.get_aligned_ea(); + memory::mark_as_aligned(out_mem); - if(is_same_type::yes) { arma_applier_1a(*=, +); } - else if(is_same_type::yes) { arma_applier_1a(*=, -); } - else if(is_same_type::yes) { arma_applier_1a(*=, /); } - else if(is_same_type::yes) { arma_applier_1a(*=, *); } + if(x.P1.is_aligned() && x.P2.is_aligned()) + { + typename ProxyCube::aligned_ea_type P1 = x.P1.get_aligned_ea(); + typename ProxyCube::aligned_ea_type P2 = x.P2.get_aligned_ea(); + + if(is_same_type::yes) { arma_applier_1a(*=, +); } + else if(is_same_type::yes) { arma_applier_1a(*=, -); } + else if(is_same_type::yes) { arma_applier_1a(*=, /); } + else if(is_same_type::yes) { arma_applier_1a(*=, *); } + } + else + { + typename ProxyCube::ea_type P1 = x.P1.get_ea(); + typename ProxyCube::ea_type P2 = x.P2.get_ea(); + + if(is_same_type::yes) { arma_applier_1u(*=, +); } + else if(is_same_type::yes) { arma_applier_1u(*=, -); } + else if(is_same_type::yes) { arma_applier_1u(*=, /); } + else if(is_same_type::yes) { arma_applier_1u(*=, *); } + } } else { @@ -826,26 +1121,26 @@ else if(is_same_type::yes) { arma_applier_1u(*=, *); } } } - else - { - typename ProxyCube::ea_type P1 = x.P1.get_ea(); - typename ProxyCube::ea_type P2 = x.P2.get_ea(); - - if(is_same_type::yes) { arma_applier_1u(*=, +); } - else if(is_same_type::yes) { arma_applier_1u(*=, -); } - else if(is_same_type::yes) { arma_applier_1u(*=, /); } - else if(is_same_type::yes) { arma_applier_1u(*=, *); } - } } else { const ProxyCube& P1 = x.P1; const ProxyCube& P2 = x.P2; - if(is_same_type::yes) { arma_applier_3(*=, +); } - else if(is_same_type::yes) { arma_applier_3(*=, -); } - else if(is_same_type::yes) { arma_applier_3(*=, /); } - else if(is_same_type::yes) { arma_applier_3(*=, *); } + if(use_mp && mp_gate::use_mp && ProxyCube::use_mp)>::eval(x.get_n_elem())) + { + if(is_same_type::yes) { arma_applier_3_mp(*=, +); } + else if(is_same_type::yes) { arma_applier_3_mp(*=, -); } + else if(is_same_type::yes) { arma_applier_3_mp(*=, /); } + else if(is_same_type::yes) { arma_applier_3_mp(*=, *); } + } + else + { + if(is_same_type::yes) { arma_applier_3(*=, +); } + else if(is_same_type::yes) { arma_applier_3(*=, -); } + else if(is_same_type::yes) { arma_applier_3(*=, /); } + else if(is_same_type::yes) { arma_applier_3(*=, *); } + } } } @@ -871,24 +1166,48 @@ eT* out_mem = out.memptr(); const bool use_at = (ProxyCube::use_at || ProxyCube::use_at); + const bool use_mp = (ProxyCube::use_mp || ProxyCube::use_mp) && (arma_config::cxx11 && arma_config::openmp); if(use_at == false) { const uword n_elem = out.n_elem; - if(memory::is_aligned(out_mem)) + if(use_mp && mp_gate::use_mp && ProxyCube::use_mp)>::eval(n_elem)) { - memory::mark_as_aligned(out_mem); + typename ProxyCube::ea_type P1 = x.P1.get_ea(); + typename ProxyCube::ea_type P2 = x.P2.get_ea(); - if(x.P1.is_aligned() && x.P2.is_aligned()) + if(is_same_type::yes) { arma_applier_1_mp(/=, +); } + else if(is_same_type::yes) { arma_applier_1_mp(/=, -); } + else if(is_same_type::yes) { arma_applier_1_mp(/=, /); } + else if(is_same_type::yes) { arma_applier_1_mp(/=, *); } + } + else + { + if(memory::is_aligned(out_mem)) { - typename ProxyCube::aligned_ea_type P1 = x.P1.get_aligned_ea(); - typename ProxyCube::aligned_ea_type P2 = x.P2.get_aligned_ea(); + memory::mark_as_aligned(out_mem); - if(is_same_type::yes) { arma_applier_1a(/=, +); } - else if(is_same_type::yes) { arma_applier_1a(/=, -); } - else if(is_same_type::yes) { arma_applier_1a(/=, /); } - else if(is_same_type::yes) { arma_applier_1a(/=, *); } + if(x.P1.is_aligned() && x.P2.is_aligned()) + { + typename ProxyCube::aligned_ea_type P1 = x.P1.get_aligned_ea(); + typename ProxyCube::aligned_ea_type P2 = x.P2.get_aligned_ea(); + + if(is_same_type::yes) { arma_applier_1a(/=, +); } + else if(is_same_type::yes) { arma_applier_1a(/=, -); } + else if(is_same_type::yes) { arma_applier_1a(/=, /); } + else if(is_same_type::yes) { arma_applier_1a(/=, *); } + } + else + { + typename ProxyCube::ea_type P1 = x.P1.get_ea(); + typename ProxyCube::ea_type P2 = x.P2.get_ea(); + + if(is_same_type::yes) { arma_applier_1u(/=, +); } + else if(is_same_type::yes) { arma_applier_1u(/=, -); } + else if(is_same_type::yes) { arma_applier_1u(/=, /); } + else if(is_same_type::yes) { arma_applier_1u(/=, *); } + } } else { @@ -901,26 +1220,26 @@ else if(is_same_type::yes) { arma_applier_1u(/=, *); } } } - else - { - typename ProxyCube::ea_type P1 = x.P1.get_ea(); - typename ProxyCube::ea_type P2 = x.P2.get_ea(); - - if(is_same_type::yes) { arma_applier_1u(/=, +); } - else if(is_same_type::yes) { arma_applier_1u(/=, -); } - else if(is_same_type::yes) { arma_applier_1u(/=, /); } - else if(is_same_type::yes) { arma_applier_1u(/=, *); } - } } else { const ProxyCube& P1 = x.P1; const ProxyCube& P2 = x.P2; - if(is_same_type::yes) { arma_applier_3(/=, +); } - else if(is_same_type::yes) { arma_applier_3(/=, -); } - else if(is_same_type::yes) { arma_applier_3(/=, /); } - else if(is_same_type::yes) { arma_applier_3(/=, *); } + if(use_mp && mp_gate::use_mp && ProxyCube::use_mp)>::eval(x.get_n_elem())) + { + if(is_same_type::yes) { arma_applier_3_mp(/=, +); } + else if(is_same_type::yes) { arma_applier_3_mp(/=, -); } + else if(is_same_type::yes) { arma_applier_3_mp(/=, /); } + else if(is_same_type::yes) { arma_applier_3_mp(/=, *); } + } + else + { + if(is_same_type::yes) { arma_applier_3(/=, +); } + else if(is_same_type::yes) { arma_applier_3(/=, -); } + else if(is_same_type::yes) { arma_applier_3(/=, /); } + else if(is_same_type::yes) { arma_applier_3(/=, *); } + } } } @@ -931,6 +1250,9 @@ #undef arma_applier_2 #undef arma_applier_3 +#undef arma_applier_1_mp +#undef arma_applier_2_mp +#undef arma_applier_3_mp //! @} diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/eGlueCube_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/eGlueCube_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/eGlueCube_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/eGlueCube_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup eGlueCube @@ -21,6 +27,7 @@ typedef typename get_pod_type::result pod_type; static const bool use_at = (ProxyCube::use_at || ProxyCube::use_at ); + static const bool use_mp = (ProxyCube::use_mp || ProxyCube::use_mp ); static const bool has_subview = (ProxyCube::has_subview || ProxyCube::has_subview); arma_aligned const ProxyCube P1; diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/eGlueCube_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/eGlueCube_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/eGlueCube_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/eGlueCube_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2013 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup eGlueCube diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/eGlue_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/eGlue_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/eGlue_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/eGlue_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2013 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup eGlue diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/eop_aux.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/eop_aux.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/eop_aux.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/eop_aux.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup eop_aux diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/eOp_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/eOp_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/eOp_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/eOp_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup eOp @@ -23,6 +29,7 @@ typedef Proxy proxy_type; static const bool use_at = Proxy::use_at; + static const bool use_mp = Proxy::use_mp || eop_type::use_mp; static const bool has_subview = Proxy::has_subview; static const bool fake_mat = Proxy::fake_mat; diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/eop_core_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/eop_core_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/eop_core_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/eop_core_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup eop_core @@ -44,49 +50,60 @@ }; +struct eop_use_mp_true { static const bool use_mp = true; }; +struct eop_use_mp_false { static const bool use_mp = false; }; -class eop_neg : public eop_core {}; -class eop_scalar_plus : public eop_core {}; -class eop_scalar_minus_pre : public eop_core {}; -class eop_scalar_minus_post : public eop_core {}; -class eop_scalar_times : public eop_core {}; -class eop_scalar_div_pre : public eop_core {}; -class eop_scalar_div_post : public eop_core {}; -class eop_square : public eop_core {}; -class eop_sqrt : public eop_core {}; -class eop_log : public eop_core {}; -class eop_log2 : public eop_core {}; -class eop_log10 : public eop_core {}; -class eop_trunc_log : public eop_core {}; -class eop_exp : public eop_core {}; -class eop_exp2 : public eop_core {}; -class eop_exp10 : public eop_core {}; -class eop_trunc_exp : public eop_core {}; -class eop_cos : public eop_core {}; -class eop_sin : public eop_core {}; -class eop_tan : public eop_core {}; -class eop_acos : public eop_core {}; -class eop_asin : public eop_core {}; -class eop_atan : public eop_core {}; -class eop_cosh : public eop_core {}; -class eop_sinh : public eop_core {}; -class eop_tanh : public eop_core {}; -class eop_acosh : public eop_core {}; -class eop_asinh : public eop_core {}; -class eop_atanh : public eop_core {}; -class eop_eps : public eop_core {}; -class eop_abs : public eop_core {}; -class eop_arg : public eop_core {}; -class eop_conj : public eop_core {}; -class eop_pow : public eop_core {}; -class eop_floor : public eop_core {}; -class eop_ceil : public eop_core {}; -class eop_round : public eop_core {}; -class eop_trunc : public eop_core {}; -class eop_sign : public eop_core {}; -class eop_erf : public eop_core {}; -class eop_erfc : public eop_core {}; -class eop_lgamma : public eop_core {}; + +class eop_neg : public eop_core , public eop_use_mp_false {}; +class eop_scalar_plus : public eop_core , public eop_use_mp_false {}; +class eop_scalar_minus_pre : public eop_core , public eop_use_mp_false {}; +class eop_scalar_minus_post : public eop_core , public eop_use_mp_false {}; +class eop_scalar_times : public eop_core , public eop_use_mp_false {}; +class eop_scalar_div_pre : public eop_core , public eop_use_mp_false {}; +class eop_scalar_div_post : public eop_core , public eop_use_mp_false {}; +class eop_square : public eop_core , public eop_use_mp_false {}; +class eop_sqrt : public eop_core , public eop_use_mp_true {}; +class eop_pow : public eop_core , public eop_use_mp_false {}; // for pow(), use_mp is selectively enabled in eop_core_meat.hpp +class eop_log : public eop_core , public eop_use_mp_true {}; +class eop_log2 : public eop_core , public eop_use_mp_true {}; +class eop_log10 : public eop_core , public eop_use_mp_true {}; +class eop_trunc_log : public eop_core , public eop_use_mp_true {}; +class eop_exp : public eop_core , public eop_use_mp_true {}; +class eop_exp2 : public eop_core , public eop_use_mp_true {}; +class eop_exp10 : public eop_core , public eop_use_mp_true {}; +class eop_trunc_exp : public eop_core , public eop_use_mp_true {}; +class eop_cos : public eop_core , public eop_use_mp_true {}; +class eop_sin : public eop_core , public eop_use_mp_true {}; +class eop_tan : public eop_core , public eop_use_mp_true {}; +class eop_acos : public eop_core , public eop_use_mp_true {}; +class eop_asin : public eop_core , public eop_use_mp_true {}; +class eop_atan : public eop_core , public eop_use_mp_true {}; +class eop_cosh : public eop_core , public eop_use_mp_true {}; +class eop_sinh : public eop_core , public eop_use_mp_true {}; +class eop_tanh : public eop_core , public eop_use_mp_true {}; +class eop_acosh : public eop_core , public eop_use_mp_true {}; +class eop_asinh : public eop_core , public eop_use_mp_true {}; +class eop_atanh : public eop_core , public eop_use_mp_true {}; +class eop_eps : public eop_core , public eop_use_mp_true {}; +class eop_abs : public eop_core , public eop_use_mp_false {}; +class eop_arg : public eop_core , public eop_use_mp_false {}; +class eop_conj : public eop_core , public eop_use_mp_false {}; +class eop_floor : public eop_core , public eop_use_mp_false {}; +class eop_ceil : public eop_core , public eop_use_mp_false {}; +class eop_round : public eop_core , public eop_use_mp_false {}; +class eop_trunc : public eop_core , public eop_use_mp_false {}; +class eop_sign : public eop_core , public eop_use_mp_false {}; +class eop_erf : public eop_core , public eop_use_mp_true {}; +class eop_erfc : public eop_core , public eop_use_mp_true {}; +class eop_lgamma : public eop_core , public eop_use_mp_true {}; + + + +// the classes below are currently not used; reserved for potential future use +class eop_log_approx {}; +class eop_exp_approx {}; +class eop_approx_log {}; +class eop_approx_exp {}; diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/eop_core_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/eop_core_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/eop_core_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/eop_core_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup eop_core @@ -18,6 +24,10 @@ #undef arma_applier_3 #undef operatorA +#undef arma_applier_1_mp +#undef arma_applier_2_mp +#undef arma_applier_3_mp + #if defined(ARMA_SIMPLE_LOOPS) #define arma_applier_1u(operatorA) \ @@ -52,6 +62,7 @@ #endif + #if defined(ARMA_SIMPLE_LOOPS) #define arma_applier_1a(operatorA) \ {\ @@ -152,6 +163,75 @@ +#if (defined(ARMA_USE_OPENMP) && defined(ARMA_USE_CXX11)) + + #define arma_applier_1_mp(operatorA) \ + {\ + const int n_threads = mp_thread_limit::get();\ + _Pragma("omp parallel for schedule(static) num_threads(n_threads)")\ + for(uword i=0; i::process(P[i], k);\ + }\ + } + + #define arma_applier_2_mp(operatorA) \ + {\ + const int n_threads = mp_thread_limit::get();\ + if(n_cols == 1)\ + {\ + _Pragma("omp parallel for schedule(static) num_threads(n_threads)")\ + for(uword count=0; count < n_rows; ++count)\ + {\ + out_mem[count] operatorA eop_core::process(P.at(count,0), k);\ + }\ + }\ + else\ + if(n_rows == 1)\ + {\ + _Pragma("omp parallel for schedule(static) num_threads(n_threads)")\ + for(uword count=0; count < n_cols; ++count)\ + {\ + out_mem[count] operatorA eop_core::process(P.at(0,count), k);\ + }\ + }\ + else\ + {\ + _Pragma("omp parallel for schedule(static) num_threads(n_threads)")\ + for(uword col=0; col < n_cols; ++col)\ + {\ + for(uword row=0; row < n_rows; ++row)\ + {\ + out.at(row,col) operatorA eop_core::process(P.at(row,col), k);\ + }\ + }\ + }\ + } + + #define arma_applier_3_mp(operatorA) \ + {\ + const int n_threads = mp_thread_limit::get();\ + _Pragma("omp parallel for schedule(static) num_threads(n_threads)")\ + for(uword slice=0; slice::process(P.at(row,col,slice), k);\ + }\ + }\ + } + +#else + + #define arma_applier_1_mp(operatorA) arma_applier_1u(operatorA) + #define arma_applier_2_mp(operatorA) arma_applier_2(operatorA) + #define arma_applier_3_mp(operatorA) arma_applier_3(operatorA) + +#endif + + + // // matrices @@ -174,19 +254,36 @@ const eT k = x.aux; eT* out_mem = out.memptr(); + const bool use_mp = (arma_config::cxx11 && arma_config::openmp) && (eOp::use_mp || (is_same_type::value && (is_cx::yes || x.aux != eT(2)))); + if(Proxy::use_at == false) { const uword n_elem = x.get_n_elem(); - if(memory::is_aligned(out_mem)) + if(use_mp && mp_gate::eval(n_elem)) { - memory::mark_as_aligned(out_mem); + typename Proxy::ea_type P = x.P.get_ea(); - if(x.P.is_aligned()) + arma_applier_1_mp(=); + } + else + { + if(memory::is_aligned(out_mem)) { - typename Proxy::aligned_ea_type P = x.P.get_aligned_ea(); + memory::mark_as_aligned(out_mem); - arma_applier_1a(=); + if(x.P.is_aligned()) + { + typename Proxy::aligned_ea_type P = x.P.get_aligned_ea(); + + arma_applier_1a(=); + } + else + { + typename Proxy::ea_type P = x.P.get_ea(); + + arma_applier_1u(=); + } } else { @@ -195,12 +292,6 @@ arma_applier_1u(=); } } - else - { - typename Proxy::ea_type P = x.P.get_ea(); - - arma_applier_1u(=); - } } else { @@ -209,7 +300,14 @@ const Proxy& P = x.P; - arma_applier_2(=); + if(use_mp && mp_gate::eval(x.get_n_elem())) + { + arma_applier_2_mp(=); + } + else + { + arma_applier_2(=); + } } } @@ -234,19 +332,36 @@ const eT k = x.aux; eT* out_mem = out.memptr(); + const bool use_mp = (arma_config::cxx11 && arma_config::openmp) && (eOp::use_mp || (is_same_type::value && (is_cx::yes || x.aux != eT(2)))); + if(Proxy::use_at == false) { const uword n_elem = x.get_n_elem(); - if(memory::is_aligned(out_mem)) + if(use_mp && mp_gate::eval(n_elem)) { - memory::mark_as_aligned(out_mem); + typename Proxy::ea_type P = x.P.get_ea(); - if(x.P.is_aligned()) + arma_applier_1_mp(+=); + } + else + { + if(memory::is_aligned(out_mem)) { - typename Proxy::aligned_ea_type P = x.P.get_aligned_ea(); + memory::mark_as_aligned(out_mem); - arma_applier_1a(+=); + if(x.P.is_aligned()) + { + typename Proxy::aligned_ea_type P = x.P.get_aligned_ea(); + + arma_applier_1a(+=); + } + else + { + typename Proxy::ea_type P = x.P.get_ea(); + + arma_applier_1u(+=); + } } else { @@ -255,18 +370,19 @@ arma_applier_1u(+=); } } - else - { - typename Proxy::ea_type P = x.P.get_ea(); - - arma_applier_1u(+=); - } } else { const Proxy& P = x.P; - arma_applier_2(+=); + if(use_mp && mp_gate::eval(x.get_n_elem())) + { + arma_applier_2_mp(+=); + } + else + { + arma_applier_2(+=); + } } } @@ -291,19 +407,36 @@ const eT k = x.aux; eT* out_mem = out.memptr(); + const bool use_mp = (arma_config::cxx11 && arma_config::openmp) && (eOp::use_mp || (is_same_type::value && (is_cx::yes || x.aux != eT(2)))); + if(Proxy::use_at == false) { const uword n_elem = x.get_n_elem(); - if(memory::is_aligned(out_mem)) + if(use_mp && mp_gate::eval(n_elem)) { - memory::mark_as_aligned(out_mem); + typename Proxy::ea_type P = x.P.get_ea(); - if(x.P.is_aligned()) + arma_applier_1_mp(-=); + } + else + { + if(memory::is_aligned(out_mem)) { - typename Proxy::aligned_ea_type P = x.P.get_aligned_ea(); + memory::mark_as_aligned(out_mem); - arma_applier_1a(-=); + if(x.P.is_aligned()) + { + typename Proxy::aligned_ea_type P = x.P.get_aligned_ea(); + + arma_applier_1a(-=); + } + else + { + typename Proxy::ea_type P = x.P.get_ea(); + + arma_applier_1u(-=); + } } else { @@ -312,18 +445,19 @@ arma_applier_1u(-=); } } - else - { - typename Proxy::ea_type P = x.P.get_ea(); - - arma_applier_1u(-=); - } } else { const Proxy& P = x.P; - arma_applier_2(-=); + if(use_mp && mp_gate::eval(x.get_n_elem())) + { + arma_applier_2_mp(-=); + } + else + { + arma_applier_2(-=); + } } } @@ -348,19 +482,36 @@ const eT k = x.aux; eT* out_mem = out.memptr(); + const bool use_mp = (arma_config::cxx11 && arma_config::openmp) && (eOp::use_mp || (is_same_type::value && (is_cx::yes || x.aux != eT(2)))); + if(Proxy::use_at == false) { const uword n_elem = x.get_n_elem(); - if(memory::is_aligned(out_mem)) + if(use_mp && mp_gate::eval(n_elem)) { - memory::mark_as_aligned(out_mem); + typename Proxy::ea_type P = x.P.get_ea(); - if(x.P.is_aligned()) + arma_applier_1_mp(*=); + } + else + { + if(memory::is_aligned(out_mem)) { - typename Proxy::aligned_ea_type P = x.P.get_aligned_ea(); + memory::mark_as_aligned(out_mem); - arma_applier_1a(*=); + if(x.P.is_aligned()) + { + typename Proxy::aligned_ea_type P = x.P.get_aligned_ea(); + + arma_applier_1a(*=); + } + else + { + typename Proxy::ea_type P = x.P.get_ea(); + + arma_applier_1u(*=); + } } else { @@ -369,18 +520,19 @@ arma_applier_1u(*=); } } - else - { - typename Proxy::ea_type P = x.P.get_ea(); - - arma_applier_1u(*=); - } } else { const Proxy& P = x.P; - arma_applier_2(*=); + if(use_mp && mp_gate::eval(x.get_n_elem())) + { + arma_applier_2_mp(*=); + } + else + { + arma_applier_2(*=); + } } } @@ -405,19 +557,36 @@ const eT k = x.aux; eT* out_mem = out.memptr(); + const bool use_mp = (arma_config::cxx11 && arma_config::openmp) && (eOp::use_mp || (is_same_type::value && (is_cx::yes || x.aux != eT(2)))); + if(Proxy::use_at == false) { const uword n_elem = x.get_n_elem(); - if(memory::is_aligned(out_mem)) + if(use_mp && mp_gate::eval(n_elem)) { - memory::mark_as_aligned(out_mem); + typename Proxy::ea_type P = x.P.get_ea(); - if(x.P.is_aligned()) + arma_applier_1_mp(/=); + } + else + { + if(memory::is_aligned(out_mem)) { - typename Proxy::aligned_ea_type P = x.P.get_aligned_ea(); + memory::mark_as_aligned(out_mem); - arma_applier_1a(/=); + if(x.P.is_aligned()) + { + typename Proxy::aligned_ea_type P = x.P.get_aligned_ea(); + + arma_applier_1a(/=); + } + else + { + typename Proxy::ea_type P = x.P.get_ea(); + + arma_applier_1u(/=); + } } else { @@ -426,18 +595,19 @@ arma_applier_1u(/=); } } - else - { - typename Proxy::ea_type P = x.P.get_ea(); - - arma_applier_1u(/=); - } } else { const Proxy& P = x.P; - arma_applier_2(/=); + if(use_mp && mp_gate::eval(x.get_n_elem())) + { + arma_applier_2_mp(/=); + } + else + { + arma_applier_2(/=); + } } } @@ -465,19 +635,36 @@ const eT k = x.aux; eT* out_mem = out.memptr(); + const bool use_mp = (arma_config::cxx11 && arma_config::openmp) && (eOpCube::use_mp || (is_same_type::value && (is_cx::yes || x.aux != eT(2)))); + if(ProxyCube::use_at == false) { const uword n_elem = out.n_elem; - if(memory::is_aligned(out_mem)) + if(use_mp && mp_gate::eval(n_elem)) { - memory::mark_as_aligned(out_mem); + typename ProxyCube::ea_type P = x.P.get_ea(); - if(x.P.is_aligned()) + arma_applier_1_mp(=); + } + else + { + if(memory::is_aligned(out_mem)) { - typename ProxyCube::aligned_ea_type P = x.P.get_aligned_ea(); + memory::mark_as_aligned(out_mem); - arma_applier_1a(=); + if(x.P.is_aligned()) + { + typename ProxyCube::aligned_ea_type P = x.P.get_aligned_ea(); + + arma_applier_1a(=); + } + else + { + typename ProxyCube::ea_type P = x.P.get_ea(); + + arma_applier_1u(=); + } } else { @@ -486,12 +673,6 @@ arma_applier_1u(=); } } - else - { - typename ProxyCube::ea_type P = x.P.get_ea(); - - arma_applier_1u(=); - } } else { @@ -501,7 +682,14 @@ const ProxyCube& P = x.P; - arma_applier_3(=); + if(use_mp && mp_gate::eval(x.get_n_elem())) + { + arma_applier_3_mp(=); + } + else + { + arma_applier_3(=); + } } } @@ -527,19 +715,36 @@ const eT k = x.aux; eT* out_mem = out.memptr(); + const bool use_mp = (arma_config::cxx11 && arma_config::openmp) && (eOpCube::use_mp || (is_same_type::value && (is_cx::yes || x.aux != eT(2)))); + if(ProxyCube::use_at == false) { const uword n_elem = out.n_elem; - if(memory::is_aligned(out_mem)) + if(use_mp && mp_gate::eval(n_elem)) { - memory::mark_as_aligned(out_mem); + typename ProxyCube::ea_type P = x.P.get_ea(); - if(x.P.is_aligned()) + arma_applier_1_mp(+=); + } + else + { + if(memory::is_aligned(out_mem)) { - typename ProxyCube::aligned_ea_type P = x.P.get_aligned_ea(); + memory::mark_as_aligned(out_mem); - arma_applier_1a(+=); + if(x.P.is_aligned()) + { + typename ProxyCube::aligned_ea_type P = x.P.get_aligned_ea(); + + arma_applier_1a(+=); + } + else + { + typename ProxyCube::ea_type P = x.P.get_ea(); + + arma_applier_1u(+=); + } } else { @@ -548,18 +753,19 @@ arma_applier_1u(+=); } } - else - { - typename ProxyCube::ea_type P = x.P.get_ea(); - - arma_applier_1u(+=); - } } else { const ProxyCube& P = x.P; - arma_applier_3(+=); + if(use_mp && mp_gate::eval(x.get_n_elem())) + { + arma_applier_3_mp(+=); + } + else + { + arma_applier_3(+=); + } } } @@ -585,19 +791,36 @@ const eT k = x.aux; eT* out_mem = out.memptr(); + const bool use_mp = (arma_config::cxx11 && arma_config::openmp) && (eOpCube::use_mp || (is_same_type::value && (is_cx::yes || x.aux != eT(2)))); + if(ProxyCube::use_at == false) { const uword n_elem = out.n_elem; - - if(memory::is_aligned(out_mem)) + + if(use_mp && mp_gate::eval(n_elem)) { - memory::mark_as_aligned(out_mem); + typename ProxyCube::ea_type P = x.P.get_ea(); - if(x.P.is_aligned()) + arma_applier_1_mp(-=); + } + else + { + if(memory::is_aligned(out_mem)) { - typename ProxyCube::aligned_ea_type P = x.P.get_aligned_ea(); + memory::mark_as_aligned(out_mem); - arma_applier_1a(-=); + if(x.P.is_aligned()) + { + typename ProxyCube::aligned_ea_type P = x.P.get_aligned_ea(); + + arma_applier_1a(-=); + } + else + { + typename ProxyCube::ea_type P = x.P.get_ea(); + + arma_applier_1u(-=); + } } else { @@ -606,18 +829,19 @@ arma_applier_1u(-=); } } - else - { - typename ProxyCube::ea_type P = x.P.get_ea(); - - arma_applier_1u(-=); - } } else { const ProxyCube& P = x.P; - arma_applier_3(-=); + if(use_mp && mp_gate::eval(x.get_n_elem())) + { + arma_applier_3_mp(-=); + } + else + { + arma_applier_3(-=); + } } } @@ -643,19 +867,36 @@ const eT k = x.aux; eT* out_mem = out.memptr(); + const bool use_mp = (arma_config::cxx11 && arma_config::openmp) && (eOpCube::use_mp || (is_same_type::value && (is_cx::yes || x.aux != eT(2)))); + if(ProxyCube::use_at == false) { const uword n_elem = out.n_elem; - if(memory::is_aligned(out_mem)) + if(use_mp && mp_gate::eval(n_elem)) { - memory::mark_as_aligned(out_mem); + typename ProxyCube::ea_type P = x.P.get_ea(); - if(x.P.is_aligned()) + arma_applier_1_mp(*=); + } + else + { + if(memory::is_aligned(out_mem)) { - typename ProxyCube::aligned_ea_type P = x.P.get_aligned_ea(); + memory::mark_as_aligned(out_mem); - arma_applier_1a(*=); + if(x.P.is_aligned()) + { + typename ProxyCube::aligned_ea_type P = x.P.get_aligned_ea(); + + arma_applier_1a(*=); + } + else + { + typename ProxyCube::ea_type P = x.P.get_ea(); + + arma_applier_1u(*=); + } } else { @@ -664,18 +905,19 @@ arma_applier_1u(*=); } } - else - { - typename ProxyCube::ea_type P = x.P.get_ea(); - - arma_applier_1u(*=); - } } else { const ProxyCube& P = x.P; - arma_applier_3(*=); + if(use_mp && mp_gate::eval(x.get_n_elem())) + { + arma_applier_3_mp(*=); + } + else + { + arma_applier_3(*=); + } } } @@ -701,19 +943,36 @@ const eT k = x.aux; eT* out_mem = out.memptr(); + const bool use_mp = (arma_config::cxx11 && arma_config::openmp) && (eOpCube::use_mp || (is_same_type::value && (is_cx::yes || x.aux != eT(2)))); + if(ProxyCube::use_at == false) { const uword n_elem = out.n_elem; - if(memory::is_aligned(out_mem)) + if(use_mp && mp_gate::eval(n_elem)) { - memory::mark_as_aligned(out_mem); + typename ProxyCube::ea_type P = x.P.get_ea(); - if(x.P.is_aligned()) + arma_applier_1_mp(/=); + } + else + { + if(memory::is_aligned(out_mem)) { - typename ProxyCube::aligned_ea_type P = x.P.get_aligned_ea(); + memory::mark_as_aligned(out_mem); - arma_applier_1a(/=); + if(x.P.is_aligned()) + { + typename ProxyCube::aligned_ea_type P = x.P.get_aligned_ea(); + + arma_applier_1a(/=); + } + else + { + typename ProxyCube::ea_type P = x.P.get_ea(); + + arma_applier_1u(/=); + } } else { @@ -722,18 +981,19 @@ arma_applier_1u(/=); } } - else - { - typename ProxyCube::ea_type P = x.P.get_ea(); - - arma_applier_1u(/=); - } } else { const ProxyCube& P = x.P; - arma_applier_3(/=); + if(use_mp && mp_gate::eval(x.get_n_elem())) + { + arma_applier_3_mp(/=); + } + else + { + arma_applier_3(/=); + } } } @@ -889,6 +1149,9 @@ #undef arma_applier_2 #undef arma_applier_3 +#undef arma_applier_1_mp +#undef arma_applier_2_mp +#undef arma_applier_3_mp //! @} diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/eOpCube_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/eOpCube_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/eOpCube_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/eOpCube_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup eOpCube @@ -22,6 +28,7 @@ typedef typename get_pod_type::result pod_type; static const bool use_at = ProxyCube::use_at; + static const bool use_mp = ProxyCube::use_mp || eop_type::use_mp; static const bool has_subview = ProxyCube::has_subview; arma_aligned const ProxyCube P; diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/eOpCube_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/eOpCube_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/eOpCube_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/eOpCube_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2013 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup eOpCube @@ -14,6 +20,7 @@ template +inline eOpCube::eOpCube(const BaseCube& in_m) : P (in_m.get_ref()) { @@ -23,6 +30,7 @@ template +inline eOpCube::eOpCube(const BaseCube& in_m, const typename T1::elem_type in_aux) : P (in_m.get_ref()) , aux (in_aux) @@ -33,6 +41,7 @@ template +inline eOpCube::eOpCube(const BaseCube& in_m, const uword in_aux_uword_a, const uword in_aux_uword_b) : P (in_m.get_ref()) , aux_uword_a (in_aux_uword_a) @@ -44,6 +53,7 @@ template +inline eOpCube::eOpCube(const BaseCube& in_m, const uword in_aux_uword_a, const uword in_aux_uword_b, const uword in_aux_uword_c) : P (in_m.get_ref()) , aux_uword_a (in_aux_uword_a) @@ -56,6 +66,7 @@ template +inline eOpCube::eOpCube(const BaseCube& in_m, const typename T1::elem_type in_aux, const uword in_aux_uword_a, const uword in_aux_uword_b, const uword in_aux_uword_c) : P (in_m.get_ref()) , aux (in_aux) @@ -69,6 +80,7 @@ template +inline eOpCube::~eOpCube() { arma_extra_debug_sigprint(); diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/eOp_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/eOp_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/eOp_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/eOp_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2013 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup eOp @@ -14,6 +20,7 @@ template +inline eOp::eOp(const T1& in_m) : P(in_m) { @@ -23,6 +30,7 @@ template +inline eOp::eOp(const T1& in_m, const typename T1::elem_type in_aux) : P(in_m) , aux(in_aux) @@ -33,6 +41,7 @@ template +inline eOp::eOp(const T1& in_m, const uword in_aux_uword_a, const uword in_aux_uword_b) : P(in_m) , aux_uword_a(in_aux_uword_a) @@ -44,6 +53,7 @@ template +inline eOp::eOp(const T1& in_m, const typename T1::elem_type in_aux, const uword in_aux_uword_a, const uword in_aux_uword_b) : P(in_m) , aux(in_aux) @@ -56,6 +66,7 @@ template +inline eOp::~eOp() { arma_extra_debug_sigprint(); diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fft_engine.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fft_engine.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fft_engine.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fft_engine.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,19 +1,21 @@ -// This Source Code Form is a compilation of: -// (1) source code written by Conrad Sanderson, and -// (2) a modified form of source code referred to as "kissfft.hh". -// -// This compilation is Copyright (C) 2013 National ICT Australia (NICTA) -// and is subject to the terms of the Mozilla Public License, v. 2.0. -// -// The source code that is distinct and separate from "kissfft.hh" -// is Copyright (C) 2013 National ICT Australia (NICTA) -// and is subject to the terms of the Mozilla Public License, v. 2.0. +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) // -// If a copy of the MPL was not distributed with this file, -// You can obtain one at http://mozilla.org/MPL/2.0/. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// The original "kissfft.hh" source code is licensed under a 3-clause BSD license, -// as follows: +// ------------------------------------------------------------------------ +// +// This file includes portions of Kiss FFT software, +// licensed under the following conditions. // // Copyright (c) 2003-2010 Mark Borgerding // @@ -29,17 +31,23 @@ // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // -// * Neither the author nor the names of any contributors may be used to endorse or promote -// products derived from this software without specific prior written permission. +// * Neither the author nor the names of any contributors may be used to +// endorse or promote products derived from this software without specific +// prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS -// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER -// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, -// OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// ------------------------------------------------------------------------ //! \addtogroup fft_engine diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/field_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/field_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/field_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/field_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2008-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ian Cullinan +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup field @@ -48,11 +53,11 @@ inline ~field(); inline field(); - inline field(const field& x); - inline const field& operator=(const field& x); + inline field(const field& x); + inline field& operator=(const field& x); - inline field(const subview_field& x); - inline const field& operator=(const subview_field& x); + inline field(const subview_field& x); + inline field& operator=(const subview_field& x); inline explicit field(const uword n_elem_in); inline explicit field(const uword n_rows_in, const uword n_cols_in); @@ -67,14 +72,14 @@ inline void set_size(const SizeCube& s); #if defined(ARMA_USE_CXX11) - inline field(const std::initializer_list& list); - inline const field& operator=(const std::initializer_list& list); + inline field(const std::initializer_list& list); + inline field& operator=(const std::initializer_list& list); - inline field(const std::initializer_list< std::initializer_list >& list); - inline const field& operator=(const std::initializer_list< std::initializer_list >& list); + inline field(const std::initializer_list< std::initializer_list >& list); + inline field& operator=(const std::initializer_list< std::initializer_list >& list); - inline field(field&& X); - inline const field& operator=(field&& X); + inline field(field&& X); + inline field& operator=(field&& X); #endif template diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/field_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/field_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/field_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/field_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ian Cullinan +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup field @@ -69,7 +74,7 @@ //! construct a field from a given field template inline -const field& +field& field::operator=(const field& x) { arma_extra_debug_sigprint(); @@ -100,7 +105,7 @@ //! construct a field from subview_field (e.g. construct a field from a delayed subfield operation) template inline -const field& +field& field::operator=(const subview_field& X) { arma_extra_debug_sigprint(); @@ -274,7 +279,7 @@ template inline - const field& + field& field::operator=(const std::initializer_list& list) { arma_extra_debug_sigprint(); @@ -312,7 +317,7 @@ template inline - const field& + field& field::operator=(const std::initializer_list< std::initializer_list >& list) { arma_extra_debug_sigprint(); @@ -399,7 +404,7 @@ template inline - const field& + field& field::operator=(field&& X) { arma_extra_debug_sigprint(arma_str::format("this = %x X = %x") % this % &X); diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_accu.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_accu.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_accu.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_accu.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_accu @@ -20,64 +25,78 @@ typename T1::elem_type accu_proxy_linear(const Proxy& P) { + arma_extra_debug_sigprint(); + typedef typename T1::elem_type eT; + eT val = eT(0); + + typename Proxy::ea_type Pea = P.get_ea(); + const uword n_elem = P.get_n_elem(); - #if defined(__FINITE_MATH_ONLY__) && (__FINITE_MATH_ONLY__ > 0) + if( arma_config::openmp && Proxy::use_mp && mp_gate::eval(n_elem) ) { - eT val = eT(0); - - if(P.is_aligned()) + #if defined(ARMA_USE_OPENMP) { - typename Proxy::aligned_ea_type A = P.get_aligned_ea(); + // NOTE: using parallelisation with manual reduction workaround to take into account complex numbers; + // NOTE: OpenMP versions lower than 4.0 do not support user-defined reduction - for(uword i=0; i::ea_type A = P.get_ea(); + const int n_threads_max = mp_thread_limit::get(); + const uword n_threads_use = (std::min)(uword(podarray_prealloc_n_elem::val), uword(n_threads_max)); + const uword chunk_size = n_elem / n_threads_use; + + podarray partial_accs(n_threads_use); + + #pragma omp parallel for schedule(static) num_threads(int(n_threads_use)) + for(uword thread_id=0; thread_id < n_threads_use; ++thread_id) + { + const uword start = (thread_id+0) * chunk_size; + const uword endp1 = (thread_id+1) * chunk_size; + + eT acc = eT(0); + for(uword i=start; i < endp1; ++i) { acc += Pea[i]; } + + partial_accs[thread_id] = acc; + } - for(uword i=0; i::ea_type A = P.get_ea(); - - uword i,j; - for(i=0, j=1; j < n_elem; i+=2, j+=2) + #if defined(__FINITE_MATH_ONLY__) && (__FINITE_MATH_ONLY__ > 0) { - val1 += A[i]; - val2 += A[j]; + if(P.is_aligned()) + { + typename Proxy::aligned_ea_type Pea_aligned = P.get_aligned_ea(); + + for(uword i=0; i -arma_hot -inline -typename T1::elem_type -accu_proxy_mat(const Proxy& P) - { - const quasi_unwrap::stored_type> tmp(P.Q); - return arrayops::accumulate(tmp.M.memptr(), tmp.M.n_elem); + return val; } @@ -88,8 +107,15 @@ typename T1::elem_type accu_proxy_at(const Proxy& P) { + arma_extra_debug_sigprint(); + typedef typename T1::elem_type eT; + if(arma_config::openmp && Proxy::use_mp && mp_gate::eval(P.get_n_elem())) + { + return accu_proxy_at_mp(P); + } + const uword n_rows = P.get_n_rows(); const uword n_cols = P.get_n_cols(); @@ -103,27 +129,118 @@ for(uword col=0; col < n_cols; ++col) { uword i,j; - for(i=0, j=1; j < n_rows; i+=2, j+=2) - { - val1 += P.at(i,col); - val2 += P.at(j,col); - } + for(i=0, j=1; j < n_rows; i+=2, j+=2) { val1 += P.at(i,col); val2 += P.at(j,col); } - if(i < n_rows) - { - val1 += P.at(i,col); - } + if(i < n_rows) { val1 += P.at(i,col); } } val = val1 + val2; } else { - for(uword col=0; col < n_cols; ++col) + for(uword col=0; col < n_cols; ++col) { val += P.at(0,col); } + } + + return val; + } + + + +template +arma_hot +inline +typename T1::elem_type +accu_proxy_at_mp(const Proxy& P) + { + arma_extra_debug_sigprint(); + + typedef typename T1::elem_type eT; + + if(P.get_n_elem() == uword(0)) + { + return eT(0); + } + + eT val = eT(0); + + #if defined(ARMA_USE_OPENMP) + { + const uword n_rows = P.get_n_rows(); + const uword n_cols = P.get_n_cols(); + + if(n_cols == 1) + { + const int n_threads_max = mp_thread_limit::get(); + const uword n_threads_use = (std::min)(uword(podarray_prealloc_n_elem::val), uword(n_threads_max)); + const uword chunk_size = n_rows / n_threads_use; + + podarray partial_accs(n_threads_use); + + #pragma omp parallel for schedule(static) num_threads(int(n_threads_use)) + for(uword thread_id=0; thread_id < n_threads_use; ++thread_id) + { + const uword start = (thread_id+0) * chunk_size; + const uword endp1 = (thread_id+1) * chunk_size; + + eT acc = eT(0); + for(uword i=start; i < endp1; ++i) { acc += P.at(i,0); } + + partial_accs[thread_id] = acc; + } + + for(uword thread_id=0; thread_id < n_threads_use; ++thread_id) { val += partial_accs[thread_id]; } + + for(uword i=(n_threads_use*chunk_size); i < n_rows; ++i) { val += P.at(i,0); } + } + else + if(n_rows == 1) { - val += P.at(0,col); + const int n_threads_max = mp_thread_limit::get(); + const uword n_threads_use = (std::min)(uword(podarray_prealloc_n_elem::val), uword(n_threads_max)); + const uword chunk_size = n_cols / n_threads_use; + + podarray partial_accs(n_threads_use); + + #pragma omp parallel for schedule(static) num_threads(int(n_threads_use)) + for(uword thread_id=0; thread_id < n_threads_use; ++thread_id) + { + const uword start = (thread_id+0) * chunk_size; + const uword endp1 = (thread_id+1) * chunk_size; + + eT acc = eT(0); + for(uword i=start; i < endp1; ++i) { acc += P.at(0,i); } + + partial_accs[thread_id] = acc; + } + + for(uword thread_id=0; thread_id < n_threads_use; ++thread_id) { val += partial_accs[thread_id]; } + + for(uword i=(n_threads_use*chunk_size); i < n_cols; ++i) { val += P.at(0,i); } + } + else + { + podarray col_accs(n_cols); + + const int n_threads = mp_thread_limit::get(); + + #pragma omp parallel for schedule(static) num_threads(n_threads) + for(uword col=0; col < n_cols; ++col) + { + eT val1 = eT(0); + eT val2 = eT(0); + + uword i,j; + for(i=0, j=1; j < n_rows; i+=2, j+=2) { val1 += P.at(i,col); val2 += P.at(j,col); } + + if(i < n_rows) { val1 += P.at(i,col); } + + col_accs[col] = val1 + val2; + } + + val = arrayops::accumulate(col_accs.memptr(), n_cols); } } + #endif return val; } @@ -142,9 +259,14 @@ const Proxy P(X); - const bool have_direct_mem = (is_Mat::stored_type>::value) || (is_subview_col::stored_type>::value); + if(is_Mat::stored_type>::value || is_subview_col::stored_type>::value) + { + const quasi_unwrap::stored_type> tmp(P.Q); + + return arrayops::accumulate(tmp.M.memptr(), tmp.M.n_elem); + } - return (Proxy::use_at) ? accu_proxy_at(P) : (have_direct_mem ? accu_proxy_mat(P) : accu_proxy_linear(P)); + return (Proxy::use_at) ? accu_proxy_at(P) : accu_proxy_linear(P); } @@ -349,67 +471,172 @@ +// + + + template arma_hot inline typename T1::elem_type -accu_cube_proxy(const ProxyCube& P) +accu_cube_proxy_linear(const ProxyCube& P) { arma_extra_debug_sigprint(); - typedef typename T1::elem_type eT; - typedef typename ProxyCube::ea_type ea_type; + typedef typename T1::elem_type eT; - if(ProxyCube::use_at == false) - { - ea_type Pea = P.get_ea(); - const uword n_elem = P.get_n_elem(); - - eT val1 = eT(0); - eT val2 = eT(0); - - uword i,j; + eT val = eT(0); - for(i=0, j=1; j::ea_type Pea = P.get_ea(); + + const uword n_elem = P.get_n_elem(); + + if( arma_config::openmp && ProxyCube::use_mp && mp_gate::eval(n_elem) ) + { + #if defined(ARMA_USE_OPENMP) + { + // NOTE: using parallelisation with manual reduction workaround to take into account complex numbers; + // NOTE: OpenMP versions lower than 4.0 do not support user-defined reduction + + const int n_threads_max = mp_thread_limit::get(); + const uword n_threads_use = (std::min)(uword(podarray_prealloc_n_elem::val), uword(n_threads_max)); + const uword chunk_size = n_elem / n_threads_use; + + podarray partial_accs(n_threads_use); + + #pragma omp parallel for schedule(static) num_threads(int(n_threads_use)) + for(uword thread_id=0; thread_id < n_threads_use; ++thread_id) + { + const uword start = (thread_id+0) * chunk_size; + const uword endp1 = (thread_id+1) * chunk_size; + + eT acc = eT(0); + for(uword i=start; i < endp1; ++i) { acc += Pea[i]; } + + partial_accs[thread_id] = acc; + } + + for(uword thread_id=0; thread_id < n_threads_use; ++thread_id) { val += partial_accs[thread_id]; } + + for(uword i=(n_threads_use*chunk_size); i < n_elem; ++i) { val += Pea[i]; } + } + #endif + } + else + { + #if defined(__FINITE_MATH_ONLY__) && (__FINITE_MATH_ONLY__ > 0) { - val1 += Pea[i]; - val2 += Pea[j]; + if(P.is_aligned()) + { + typename ProxyCube::aligned_ea_type Pea_aligned = P.get_aligned_ea(); + + for(uword i=0; i +arma_hot +inline +typename T1::elem_type +accu_cube_proxy_at(const ProxyCube& P) + { + arma_extra_debug_sigprint(); + + typedef typename T1::elem_type eT; + + if(arma_config::openmp && ProxyCube::use_mp && mp_gate::eval(P.get_n_elem())) + { + return accu_cube_proxy_at_mp(P); + } + + const uword n_rows = P.get_n_rows(); + const uword n_cols = P.get_n_cols(); + const uword n_slices = P.get_n_slices(); + + eT val1 = eT(0); + eT val2 = eT(0); + + for(uword slice = 0; slice < n_slices; ++slice) + for(uword col = 0; col < n_cols; ++col ) + { + uword i,j; + for(i=0, j=1; j +arma_hot +inline +typename T1::elem_type +accu_cube_proxy_at_mp(const ProxyCube& P) + { + arma_extra_debug_sigprint(); + + typedef typename T1::elem_type eT; + + eT val = eT(0); + + #if defined(ARMA_USE_OPENMP) { const uword n_rows = P.get_n_rows(); const uword n_cols = P.get_n_cols(); const uword n_slices = P.get_n_slices(); - eT val1 = eT(0); - eT val2 = eT(0); + podarray slice_accs(n_slices); + + const int n_threads = mp_thread_limit::get(); + #pragma omp parallel for schedule(static) num_threads(n_threads) for(uword slice = 0; slice < n_slices; ++slice) - for(uword col = 0; col < n_cols; ++col ) { - uword i,j; - for(i=0, j=1; j::use_at) ? accu_cube_proxy_at(P) : accu_cube_proxy_linear(P); } @@ -462,11 +689,15 @@ const ProxyCube P(expr); - return accu_cube_proxy(P); + return (ProxyCube::use_at) ? accu_cube_proxy_at(P) : accu_cube_proxy_linear(P); } +// + + + template arma_warn_unused inline diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_all.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_all.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_all.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_all.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_all diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_any.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_any.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_any.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_any.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_any diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_approx_equal.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_approx_equal.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_approx_equal.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_approx_equal.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_approx_equal diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_as_scalar.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_as_scalar.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_as_scalar.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_as_scalar.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_as_scalar diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_chol.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_chol.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_chol.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_chol.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_chol diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_clamp.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_clamp.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_clamp.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_clamp.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2014-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_clamp @@ -32,5 +38,21 @@ } + +template +arma_warn_unused +inline +const mtOpCube +clamp(const BaseCube& X, const typename T1::elem_type min_val, const typename T1::elem_type max_val, typename arma_not_cx::result* junk = 0) + { + arma_extra_debug_sigprint(); + arma_ignore(junk); + + arma_debug_check( (min_val > max_val), "clamp(): min_val has to be smaller than max_val" ); + + return mtOpCube(mtOpCube_dual_aux_indicator(), X.get_ref(), min_val, max_val); + } + + //! @} diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_cond.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_cond.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_cond.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_cond.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_cond diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_conv.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_conv.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_conv.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_conv.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_conv diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_conv_to.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_conv_to.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_conv_to.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_conv_to.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_conv_to diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_cor.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_cor.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_cor.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_cor.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2009-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Dimitrios Bouzas +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_cor diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_cov.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_cov.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_cov.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_cov.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2009-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Dimitrios Bouzas +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_cov diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_cross.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_cross.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_cross.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_cross.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_cross diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_cumprod.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_cumprod.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_cumprod.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_cumprod.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_cumprod diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_cumsum.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_cumsum.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_cumsum.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_cumsum.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_cumsum diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_det.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_det.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_det.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_det.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_det @@ -131,6 +137,7 @@ +//! NOTE: don't use this form: it will be removed template arma_deprecated inline @@ -150,6 +157,7 @@ +//! NOTE: don't use this form: it will be removed template arma_deprecated inline diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_diagmat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_diagmat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_diagmat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_diagmat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_diagmat diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_diagvec.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_diagvec.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_diagvec.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_diagvec.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_diagvec diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_diff.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_diff.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_diff.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_diff.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_diff diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_dot.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_dot.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_dot.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_dot.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_dot diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_eig_gen.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_eig_gen.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_eig_gen.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_eig_gen.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_eig_gen diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_eig_pair.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_eig_pair.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_eig_pair.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_eig_pair.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_eig_pair diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_eigs_gen.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_eigs_gen.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_eigs_gen.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_eigs_gen.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2013-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_eigs_gen diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_eigs_sym.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_eigs_sym.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_eigs_sym.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_eigs_sym.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2013-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_eigs_sym diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_eig_sym.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_eig_sym.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_eig_sym.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_eig_sym.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Stanislav Funiak +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_eig_sym diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_elem.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_elem.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_elem.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_elem.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_elem @@ -1050,4 +1056,11 @@ +// the functions below are currently unused; reserved for potential future use + +template void exp_approx(const T1&) { arma_stop_logic_error("unimplemented"); } +template void log_approx(const T1&) { arma_stop_logic_error("unimplemented"); } +template void approx_exp(const T1&) { arma_stop_logic_error("unimplemented"); } +template void approx_log(const T1&) { arma_stop_logic_error("unimplemented"); } + //! @} diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_eps.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_eps.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_eps.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_eps.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2009-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Dimitrios Bouzas +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_expmat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_expmat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_expmat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_expmat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2014-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_expmat diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_eye.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_eye.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_eye.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_eye.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_eye diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_fft2.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_fft2.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_fft2.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_fft2.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_fft2 diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_fft.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_fft.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_fft.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_fft.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_fft diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_find.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_find.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_find.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_find.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_find diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_find_unique.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_find_unique.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_find_unique.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_find_unique.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_find_unique diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_flip.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_flip.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_flip.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_flip.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_flip diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_histc.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_histc.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_histc.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_histc.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_histc diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_hist.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_hist.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_hist.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_hist.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2012-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_hist diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_index_max.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_index_max.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_index_max.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_index_max.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_index_max diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_index_min.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_index_min.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_index_min.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_index_min.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_index_min diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_inplace_strans.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_inplace_strans.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_inplace_strans.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_inplace_strans.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2013 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Alexandre Drouin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_inplace_strans diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_inplace_trans.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_inplace_trans.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_inplace_trans.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_inplace_trans.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_inplace_trans diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_interp1.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_interp1.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_interp1.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_interp1.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_interp1 diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_inv.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_inv.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_inv.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_inv.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_inv @@ -29,6 +35,7 @@ +//! NOTE: don't use this form: it will be removed template arma_deprecated inline @@ -48,6 +55,7 @@ +//! NOTE: don't use this form: it will be removed template arma_deprecated inline @@ -83,6 +91,7 @@ +//! NOTE: don't use this form: it will be removed template arma_deprecated inline @@ -102,6 +111,7 @@ +//! NOTE: don't use this form: it will be removed template arma_deprecated inline @@ -146,6 +156,7 @@ +//! NOTE: don't use this form: it will be removed template arma_deprecated inline @@ -166,6 +177,7 @@ +//! NOTE: don't use this form: it will be removed template arma_deprecated inline @@ -202,6 +214,7 @@ +//! NOTE: don't use this form: it will be removed template arma_deprecated inline @@ -221,6 +234,7 @@ +//! NOTE: don't use this form: it will be removed template arma_deprecated inline @@ -265,6 +279,7 @@ +//! NOTE: don't use this form: it will be removed template arma_deprecated inline @@ -285,6 +300,7 @@ +//! NOTE: don't use this form: it will be removed template arma_deprecated inline diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_join.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_join.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_join.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_join.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_join diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_kmeans.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_kmeans.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_kmeans.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_kmeans.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_kmeans diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_kron.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_kron.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_kron.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_kron.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2009-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Dimitrios Bouzas +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_kron diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_log_det.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_log_det.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_log_det.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_log_det.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_log_det @@ -16,7 +22,7 @@ //! log determinant of mat template inline -bool +void log_det ( typename T1::elem_type& out_val, @@ -28,7 +34,18 @@ arma_extra_debug_sigprint(); arma_ignore(junk); - return auxlib::log_det(out_val, out_sign, X); + typedef typename T1::elem_type eT; + typedef typename T1::pod_type T; + + const bool status = auxlib::log_det(out_val, out_sign, X); + + if(status == false) + { + out_val = eT(Datum::nan); + out_sign = T(0); + + arma_warn("log_det(): failed to find determinant"); + } } @@ -66,15 +83,15 @@ eT x = A[0]; - T sign = (is_complex::value == false) ? ( (access::tmp_real(x) < T(0)) ? -1 : +1 ) : +1; - eT val = (is_complex::value == false) ? std::log( (access::tmp_real(x) < T(0)) ? x*T(-1) : x ) : std::log(x); + T sign = (is_cx::no) ? ( (access::tmp_real(x) < T(0)) ? -1 : +1 ) : +1; + eT val = (is_cx::no) ? std::log( (access::tmp_real(x) < T(0)) ? x*T(-1) : x ) : std::log(x); for(uword i=1; i::value == false) ? ( (access::tmp_real(x) < T(0)) ? -1 : +1 ) : +1; - val += (is_complex::value == false) ? std::log( (access::tmp_real(x) < T(0)) ? x*T(-1) : x ) : std::log(x); + sign *= (is_cx::no) ? ( (access::tmp_real(x) < T(0)) ? -1 : +1 ) : +1; + val += (is_cx::no) ? std::log( (access::tmp_real(x) < T(0)) ? x*T(-1) : x ) : std::log(x); } out_val = val; @@ -82,5 +99,31 @@ } + +template +inline +arma_warn_unused +std::complex +log_det + ( + const Base& X, + const typename arma_blas_type_only::result* junk = 0 + ) + { + arma_extra_debug_sigprint(); + arma_ignore(junk); + + typedef typename T1::elem_type eT; + typedef typename T1::pod_type T; + + eT out_val = eT(0); + T out_sign = T(0); + + log_det(out_val, out_sign, X.get_ref()); + + return (out_sign >= T(1)) ? std::complex(out_val) : (out_val + std::complex(T(0),Datum::pi)); + } + + //! @} diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_logmat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_logmat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_logmat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_logmat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_logmat diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_lu.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_lu.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_lu.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_lu.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2011 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_lu diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_max.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_max.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_max.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_max.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_max diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_mean.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_mean.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_mean.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_mean.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_mean diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_median.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_median.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_median.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_median.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_median diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_min.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_min.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_min.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_min.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_min diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_misc.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_misc.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_misc.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_misc.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_misc @@ -312,7 +318,7 @@ -//! DO NOT USE IN NEW CODE; change instances of inv(sympd(X)) to inv_sympd(X) +//! NOTE: don't use this function: it will be removed template arma_deprecated inline diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_nonzeros.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_nonzeros.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_nonzeros.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_nonzeros.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_nonzeros diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_normalise.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_normalise.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_normalise.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_normalise.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2014-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_normalise diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_norm.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_norm.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_norm.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_norm.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_norm diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_numel.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_numel.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_numel.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_numel.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_numel diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_n_unique.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_n_unique.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_n_unique.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_n_unique.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2012 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_n_unique diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_ones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_ones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_ones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_ones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_ones diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_orth_null.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_orth_null.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_orth_null.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_orth_null.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_orth_null diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_pinv.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_pinv.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_pinv.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_pinv.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2009-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Dimitrios Bouzas +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_pinv diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_polyfit.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_polyfit.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_polyfit.hpp 1970-01-01 00:00:00.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_polyfit.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -0,0 +1,65 @@ +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + + +//! \addtogroup fn_polyfit +//! @{ + + + +template +inline +typename +enable_if2 + < + is_supported_blas_type::value, + bool + >::result +polyfit(Mat& out, const Base& X, const Base& Y, const uword N) + { + arma_extra_debug_sigprint(); + + const bool status = glue_polyfit::apply_direct(out, X.get_ref(), Y.get_ref(), N); + + if(status == false) + { + out.reset(); + arma_debug_warn("polyfit(): failed"); + } + + return status; + } + + + +template +arma_warn_unused +inline +typename +enable_if2 + < + is_supported_blas_type::value, + const Glue + >::result +polyfit(const Base& X, const Base& Y, const uword N) + { + arma_extra_debug_sigprint(); + + return Glue(X.get_ref(), Y.get_ref(), N); + } + + + +//! @} diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_polyval.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_polyval.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_polyval.hpp 1970-01-01 00:00:00.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_polyval.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -0,0 +1,40 @@ +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + + +//! \addtogroup fn_polyval +//! @{ + + + +template +arma_warn_unused +inline +typename +enable_if2 + < + (is_supported_blas_type::value && is_arma_type::value && is_same_type::value), + const Glue + >::result +polyval(const Base& P, const T2& X) + { + arma_extra_debug_sigprint(); + + return Glue(P.get_ref(), X); + } + + + +//! @} diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_princomp.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_princomp.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_princomp.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_princomp.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2010-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Dimitrios Bouzas +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_princomp diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_prod.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_prod.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_prod.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_prod.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_prod diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_qr.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_qr.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_qr.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_qr.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2012 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_qr diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_qz.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_qz.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_qz.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_qz.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2015-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Keith O'Hara +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_qz diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_randg.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_randg.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_randg.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_randg.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_randg diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_randi.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_randi.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_randi.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_randi.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_randi diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_randn.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_randn.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_randn.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_randn.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_randn diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_randu.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_randu.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_randu.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_randu.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_randu diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_range.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_range.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_range.hpp 1970-01-01 00:00:00.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_range.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -0,0 +1,81 @@ +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + + +//! \addtogroup fn_range +//! @{ + + +template +arma_warn_unused +arma_inline +const Op +range + ( + const T1& X, + const uword dim = 0, + const typename enable_if< is_arma_type::value == true >::result* junk1 = 0, + const typename enable_if< resolves_to_vector::value == false >::result* junk2 = 0 + ) + { + arma_extra_debug_sigprint(); + arma_ignore(junk1); + arma_ignore(junk2); + + return Op(X, dim, 0); + } + + + +template +arma_warn_unused +arma_inline +const Op +range + ( + const T1& X, + const uword dim, + const typename enable_if::value == true>::result* junk = 0 + ) + { + arma_extra_debug_sigprint(); + arma_ignore(junk); + + return Op(X, dim, 0); + } + + + +template +arma_warn_unused +inline +typename T1::elem_type +range + ( + const T1& X, + const arma_empty_class junk1 = arma_empty_class(), + const typename enable_if::value == true>::result* junk2 = 0 + ) + { + arma_extra_debug_sigprint(); + arma_ignore(junk1); + arma_ignore(junk2); + + return op_range::vector_range(X); + } + + + +//! @} diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_rank.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_rank.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_rank.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_rank.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,13 +1,17 @@ -// Copyright (C) 2009-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Dimitrios Bouzas -// Written by Stanislav Funiak +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_rank diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_regspace.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_regspace.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_regspace.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_regspace.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_regspace diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_repmat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_repmat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_repmat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_repmat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2009-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Dimitrios Bouzas +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_reshape.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_reshape.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_reshape.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_reshape.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_reshape @@ -39,17 +45,19 @@ -//! NOTE: this form is deprecated: don't use it +//! NOTE: don't use this form: it will be removed template arma_deprecated inline const Op -reshape(const Base& X, const uword in_n_rows, const uword in_n_cols, const uword dim) +reshape(const Base& X, const uword in_n_rows, const uword in_n_cols, const uword dim) //!< NOTE: don't use this form: it will be removed { arma_extra_debug_sigprint(); arma_debug_check( (dim > 1), "reshape(): parameter 'dim' must be 0 or 1" ); + // arma_debug_warn("this form of reshape() is deprecated and will be removed"); + return Op(X.get_ref(), in_n_rows, in_n_cols, dim, 'j'); } @@ -59,12 +67,28 @@ arma_warn_unused inline const OpCube -reshape(const BaseCube& X, const uword in_n_rows, const uword in_n_cols, const uword in_n_slices, const uword dim = 0) +reshape(const BaseCube& X, const uword in_n_rows, const uword in_n_cols, const uword in_n_slices) + { + arma_extra_debug_sigprint(); + + return OpCube(X.get_ref(), in_n_rows, in_n_cols, in_n_slices, uword(0), 'j'); + } + + + +//! NOTE: don't use this form: it will be removed +template +arma_deprecated +inline +const OpCube +reshape(const BaseCube& X, const uword in_n_rows, const uword in_n_cols, const uword in_n_slices, const uword dim) //!< NOTE: don't use this form: it will be removed { arma_extra_debug_sigprint(); arma_debug_check( (dim > 1), "reshape(): parameter 'dim' must be 0 or 1" ); + // arma_debug_warn("this form of reshape() is deprecated and will be removed"); + return OpCube(X.get_ref(), in_n_rows, in_n_cols, in_n_slices, dim, 'j'); } @@ -74,12 +98,28 @@ arma_warn_unused inline const OpCube -reshape(const BaseCube& X, const SizeCube& s, const uword dim = 0) +reshape(const BaseCube& X, const SizeCube& s) + { + arma_extra_debug_sigprint(); + + return OpCube(X.get_ref(), s.n_rows, s.n_cols, s.n_slices, uword(0), 'j'); + } + + + +//! NOTE: don't use this form: it will be removed +template +arma_deprecated +inline +const OpCube +reshape(const BaseCube& X, const SizeCube& s, const uword dim) //!< NOTE: don't use this form: it will be removed { arma_extra_debug_sigprint(); arma_debug_check( (dim > 1), "reshape(): parameter 'dim' must be 0 or 1" ); + // arma_debug_warn("this form of reshape() is deprecated and will be removed"); + return OpCube(X.get_ref(), s.n_rows, s.n_cols, s.n_slices, dim, 'j'); } diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_resize.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_resize.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_resize.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_resize.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2011-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_resize diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_schur.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_schur.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_schur.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_schur.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_schur diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_shift.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_shift.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_shift.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_shift.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_shuffle.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_shuffle.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_shuffle.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_shuffle.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2009-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Dimitrios Bouzas +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_size.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_size.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_size.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_size.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_size diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_solve.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_solve.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_solve.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_solve.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_solve @@ -35,6 +41,7 @@ +//! NOTE: don't use this form: it will be removed template arma_deprecated inline @@ -55,6 +62,7 @@ +//! NOTE: don't use this form: it will be removed template arma_deprecated inline @@ -93,6 +101,7 @@ +//! NOTE: don't use this form: it will be removed template arma_deprecated inline @@ -114,6 +123,7 @@ +//! NOTE: don't use this form: it will be removed template arma_deprecated inline @@ -162,6 +172,7 @@ +//! NOTE: don't use this form: it will be removed template arma_deprecated inline @@ -187,6 +198,7 @@ +//! NOTE: don't use this form: it will be removed template arma_deprecated inline @@ -235,6 +247,7 @@ +//! NOTE: don't use this form: it will be removed template arma_deprecated inline @@ -261,6 +274,7 @@ +//! NOTE: don't use this form: it will be removed template arma_deprecated inline diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_sort.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_sort.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_sort.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_sort.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_sort @@ -34,7 +40,7 @@ -//! kept only for compatibility with old code +//! NOTE: don't use this form: it will be removed template arma_deprecated inline @@ -59,7 +65,7 @@ -//! kept only for compatibility with old code +//! NOTE: don't use this form: it will be removed template arma_deprecated inline diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_sort_index.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_sort_index.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_sort_index.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_sort_index.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_sort_index @@ -29,7 +35,7 @@ -//! kept only for compatibility with old code +//! NOTE: don't use this form: it will be removed template arma_deprecated inline @@ -97,7 +103,7 @@ -//! kept only for compatibility with old code +//! NOTE: don't use this form: it will be removed template arma_deprecated inline diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_speye.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_speye.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_speye.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_speye.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2012-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_speye diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_spones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_spones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_spones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_spones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2012-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_spones diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_sprandn.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_sprandn.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_sprandn.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_sprandn.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2012-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_sprandn diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_sprandu.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_sprandu.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_sprandu.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_sprandu.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2012-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_sprandu diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_spsolve.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_spsolve.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_spsolve.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_spsolve.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2015-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_spsolve diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_sqrtmat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_sqrtmat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_sqrtmat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_sqrtmat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_sqrtmat diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_stddev.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_stddev.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_stddev.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_stddev.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_stddev diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_strans.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_strans.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_strans.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_strans.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2011-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_strans @@ -54,21 +60,6 @@ } - -//! two consecutive transpose operations cancel each other -template -arma_warn_unused -arma_inline -const T1& -strans(const Op& X) - { - arma_extra_debug_sigprint(); - arma_extra_debug_print("strans(): removing op_strans"); - - return X.m; - } - - // // handling of sparse matrices diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_sum.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_sum.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_sum.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_sum.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_sum diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_svd.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_svd.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_svd.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_svd.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_svd diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_svds.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_svds.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_svds.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_svds.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_svds diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_syl_lyap.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_syl_lyap.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_syl_lyap.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_syl_lyap.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2011-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_syl_lyap diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_symmat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_symmat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_symmat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_symmat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2011-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_symmat @@ -65,5 +71,63 @@ } + +// + + + +template +arma_warn_unused +arma_inline +typename enable_if2< is_cx::no, const SpOp >::result +symmatu(const SpBase& X, const bool do_conj = false) + { + arma_extra_debug_sigprint(); + arma_ignore(do_conj); + + return SpOp(X.get_ref(), 0, 0); + } + + + +template +arma_warn_unused +arma_inline +typename enable_if2< is_cx::no, const SpOp >::result +symmatl(const SpBase& X, const bool do_conj = false) + { + arma_extra_debug_sigprint(); + arma_ignore(do_conj); + + return SpOp(X.get_ref(), 1, 0); + } + + + +template +arma_warn_unused +arma_inline +typename enable_if2< is_cx::yes, const SpOp >::result +symmatu(const SpBase& X, const bool do_conj = true) + { + arma_extra_debug_sigprint(); + + return SpOp(X.get_ref(), 0, (do_conj ? 1 : 0)); + } + + + +template +arma_warn_unused +arma_inline +typename enable_if2< is_cx::yes, const SpOp >::result +symmatl(const SpBase& X, const bool do_conj = true) + { + arma_extra_debug_sigprint(); + + return SpOp(X.get_ref(), 1, (do_conj ? 1 : 0)); + } + + //! @} diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_toeplitz.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_toeplitz.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_toeplitz.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_toeplitz.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_toeplitz diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_trace.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_trace.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_trace.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_trace.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_trace diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_trans.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_trans.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_trans.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_trans.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_trans @@ -47,34 +53,6 @@ } - -//! two consecutive transpose operations cancel each other -template -arma_warn_unused -arma_inline -const T1& -trans(const Op& X) - { - arma_extra_debug_sigprint(); - arma_extra_debug_print("trans(): removing op_htrans"); - - return X.m; - } - - - -template -arma_inline -const T1& -htrans(const Op& X) - { - arma_extra_debug_sigprint(); - arma_extra_debug_print("htrans(): removing op_htrans"); - - return X.m; - } - - // // handling of sparse matrices diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_trapz.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_trapz.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_trapz.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_trapz.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_trapz diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_trig.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_trig.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_trig.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_trig.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_trig diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_trimat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_trimat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_trimat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_trimat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_trimat @@ -38,4 +44,100 @@ +template +arma_warn_unused +arma_inline +const SpOp +trimatu(const SpBase& X) + { + arma_extra_debug_sigprint(); + + return SpOp(X.get_ref(), 0, 0); + } + + + +template +arma_warn_unused +arma_inline +const SpOp +trimatl(const SpBase& X) + { + arma_extra_debug_sigprint(); + + return SpOp(X.get_ref(), 1, 0); + } + + + +// + + + +template +arma_warn_unused +arma_inline +const Op +trimatl(const Base& X, const sword k) + { + arma_extra_debug_sigprint(); + + const uword row_offset = (k < 0) ? uword(-k) : uword(0); + const uword col_offset = (k > 0) ? uword( k) : uword(0); + + return Op(X.get_ref(), row_offset, col_offset); + } + + + +template +arma_warn_unused +arma_inline +const Op +trimatu(const Base& X, const sword k) + { + arma_extra_debug_sigprint(); + + const uword row_offset = (k < 0) ? uword(-k) : uword(0); + const uword col_offset = (k > 0) ? uword( k) : uword(0); + + return Op(X.get_ref(), row_offset, col_offset); + } + + + +// // TODO: implement for sparse matrices +// template +// arma_warn_unused +// arma_inline +// const SpOp +// trimatu(const SpBase& X, const sword k) +// { +// arma_extra_debug_sigprint(); +// +// const uword row_offset = (k < 0) ? uword(-k) : uword(0); +// const uword col_offset = (k > 0) ? uword( k) : uword(0); +// +// return SpOp(X.get_ref(), row_offset, col_offset); +// } +// +// +// +// // TODO: implement for sparse matrices +// template +// arma_warn_unused +// arma_inline +// const SpOp +// trimatl(const SpBase& X, const sword k) +// { +// arma_extra_debug_sigprint(); +// +// const uword row_offset = (k < 0) ? uword(-k) : uword(0); +// const uword col_offset = (k > 0) ? uword( k) : uword(0); +// +// return SpOp(X.get_ref(), row_offset, col_offset); +// } + + + //! @} diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_trunc_exp.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_trunc_exp.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_trunc_exp.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_trunc_exp.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_trunc_exp diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_trunc_log.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_trunc_log.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_trunc_log.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_trunc_log.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_trunc_log diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_unique.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_unique.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_unique.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_unique.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2012-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Arnold Wiliem +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_unique diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_var.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_var.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_var.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_var.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_var diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_vectorise.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_vectorise.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_vectorise.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_vectorise.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_vectorise diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/fn_zeros.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/fn_zeros.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/fn_zeros.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/fn_zeros.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup fn_zeros diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/Gen_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/Gen_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/Gen_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/Gen_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2011-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup Gen diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/GenCube_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/GenCube_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/GenCube_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/GenCube_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2011-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup GenCube diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/GenCube_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/GenCube_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/GenCube_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/GenCube_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2011-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup GenCube diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/Gen_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/Gen_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/Gen_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/Gen_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2011-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup Gen diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/GenSpecialiser.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/GenSpecialiser.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/GenSpecialiser.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/GenSpecialiser.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup GenSpecialiser diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_atan2_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_atan2_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_atan2_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_atan2_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_atan2_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_atan2_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_atan2_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_atan2_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup glue_atan2 @@ -56,30 +62,58 @@ const uword n_rows = P1.get_n_rows(); const uword n_cols = P1.get_n_cols(); + const uword n_elem = P1.get_n_elem(); out.set_size(n_rows, n_cols); eT* out_mem = out.memptr(); - if( (Proxy::use_at == false) && (Proxy::use_at == false) ) + const bool use_mp = arma_config::cxx11 && arma_config::openmp && mp_gate::use_mp || Proxy::use_mp)>::eval(n_elem); + const bool use_at = Proxy::use_at || Proxy::use_at; + + if(use_at == false) { typename Proxy::ea_type eaP1 = P1.get_ea(); typename Proxy::ea_type eaP2 = P2.get_ea(); - const uword N = P1.get_n_elem(); - - for(uword i=0; i::stored_type> U1(P1.Q); + const unwrap::stored_type> U2(P2.Q); + + out = arma::atan2(U1.M, U2.M); + } + else { - *out_mem = std::atan2( P1.at(row,col), P2.at(row,col) ); - out_mem++; + for(uword col=0; col < n_cols; ++col) + for(uword row=0; row < n_rows; ++row) + { + *out_mem = std::atan2( P1.at(row,col), P2.at(row,col) ); + out_mem++; + } } } } @@ -130,31 +164,59 @@ const uword n_rows = P1.get_n_rows(); const uword n_cols = P1.get_n_cols(); const uword n_slices = P1.get_n_slices(); + const uword n_elem = P1.get_n_elem(); out.set_size(n_rows, n_cols, n_slices); eT* out_mem = out.memptr(); - if( (ProxyCube::use_at == false) && (ProxyCube::use_at == false) ) + const bool use_mp = arma_config::cxx11 && arma_config::openmp && mp_gate::use_mp || ProxyCube::use_mp)>::eval(n_elem); + const bool use_at = ProxyCube::use_at || ProxyCube::use_at; + + if(use_at == false) { typename ProxyCube::ea_type eaP1 = P1.get_ea(); typename ProxyCube::ea_type eaP2 = P2.get_ea(); - const uword N = P1.get_n_elem(); - - for(uword i=0; i::stored_type> U1(P1.Q); + const unwrap_cube::stored_type> U2(P2.Q); + + out = arma::atan2(U1.M, U2.M); + } + else { - *out_mem = std::atan2( P1.at(row,col,slice), P2.at(row,col,slice) ); - out_mem++; + for(uword slice=0; slice < n_slices; ++slice) + for(uword col=0; col < n_cols; ++col ) + for(uword row=0; row < n_rows; ++row ) + { + *out_mem = std::atan2( P1.at(row,col,slice), P2.at(row,col,slice) ); + out_mem++; + } } } } diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/Glue_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/Glue_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/Glue_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/Glue_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup Glue @@ -39,14 +45,17 @@ || (is_same_type::value && T1::is_row) || (is_same_type::value && T1::is_row && T2::is_row) || (is_same_type::value && (T1::is_row || T2::is_row)) - || (is_same_type::value && (T1::is_row || T2::is_row)); + || (is_same_type::value && (T1::is_row || T2::is_row)) + || (is_same_type::value && T2::is_row); static const bool is_col = \ (is_same_type::value && T2::is_col) || (is_same_type::value && T1::is_col) || (is_same_type::value && T1::is_col && T2::is_col) || (is_same_type::value && (T1::is_col || T2::is_col)) - || (is_same_type::value && (T1::is_col || T2::is_col)); + || (is_same_type::value && (T1::is_col || T2::is_col)) + || (is_same_type::value) + || (is_same_type::value && T2::is_col); arma_inline Glue(const T1& in_A, const T2& in_B); arma_inline Glue(const T1& in_A, const T2& in_B, const uword in_aux_uword); diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_conv_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_conv_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_conv_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_conv_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_conv_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_conv_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_conv_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_conv_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup glue_conv @@ -28,8 +34,6 @@ const uword x_n_elem = x.n_elem; const uword out_n_elem = ((h_n_elem + x_n_elem) > 0) ? (h_n_elem + x_n_elem - 1) : uword(0); - (A_is_col) ? out.set_size(out_n_elem, 1) : out.set_size(1, out_n_elem); - if( (h_n_elem == 0) || (x_n_elem == 0) ) { out.zeros(); return; } @@ -52,6 +56,8 @@ arrayops::copy( &(xx_mem[h_n_elem_m1]), x_mem, x_n_elem ); + (A_is_col) ? out.set_size(out_n_elem, 1) : out.set_size(1, out_n_elem); + eT* out_mem = out.memptr(); for(uword i=0; i < out_n_elem; ++i) @@ -132,10 +138,9 @@ const uword out_n_rows = ((W.n_rows + G.n_rows) > 0) ? (W.n_rows + G.n_rows - 1) : uword(0); const uword out_n_cols = ((W.n_cols + G.n_cols) > 0) ? (W.n_cols + G.n_cols - 1) : uword(0); - out.set_size( out_n_rows, out_n_cols ); - if(G.is_empty() || W.is_empty()) { out.zeros(); return; } + Mat H(G.n_rows, G.n_cols); // flipped filter coefficients const uword H_n_rows = H.n_rows; @@ -155,10 +160,14 @@ } } + Mat X( (W.n_rows + 2*H_n_rows_m1), (W.n_cols + 2*H_n_cols_m1), fill::zeros ); X( H_n_rows_m1, H_n_cols_m1, arma::size(W) ) = W; // zero padded version of 2D image + + out.set_size( out_n_rows, out_n_cols ); + for(uword col=0; col < out_n_cols; ++col) { eT* out_colptr = out.colptr(col); diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_cor_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_cor_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_cor_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_cor_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2009-2010 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Dimitrios Bouzas +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// ------------------------------------------------------------------- -// 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_cor_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_cor_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_cor_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_cor_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2009-2012 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Dimitrios Bouzas +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup glue_cor diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_cov_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_cov_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_cov_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_cov_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2009-2010 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Dimitrios Bouzas +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_cov_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_cov_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_cov_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_cov_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2009-2012 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Dimitrios Bouzas +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup glue_cov diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_cross_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_cross_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_cross_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_cross_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_cross_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_cross_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_cross_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_cross_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/GlueCube_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/GlueCube_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/GlueCube_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/GlueCube_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2010 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup GlueCube diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/GlueCube_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/GlueCube_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/GlueCube_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/GlueCube_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2010 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup GlueCube diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_hist_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_hist_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_hist_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_hist_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2012-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup glue_hist diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_histc_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_histc_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_histc_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_histc_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup glue_histc diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_histc_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_histc_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_histc_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_histc_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup glue_histc diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_hist_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_hist_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_hist_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_hist_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2012-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup glue_hist diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_hypot_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_hypot_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_hypot_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_hypot_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_hypot_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_hypot_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_hypot_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_hypot_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup glue_hypot diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_join_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_join_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_join_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_join_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_join_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_join_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_join_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_join_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup glue_join diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_kron_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_kron_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_kron_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_kron_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2009-2010 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Dimitrios Bouzas +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_kron_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_kron_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_kron_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_kron_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2009-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Dimitrios Bouzas +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup glue_kron diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_max_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_max_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_max_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_max_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_max_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_max_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_max_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_max_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/Glue_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/Glue_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/Glue_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/Glue_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2010 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup Glue diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_min_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_min_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_min_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_min_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_min_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_min_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_min_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_min_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_mixed_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_mixed_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_mixed_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_mixed_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2010 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup glue_mixed diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_mixed_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_mixed_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_mixed_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_mixed_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup glue_mixed diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_polyfit_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_polyfit_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_polyfit_bones.hpp 1970-01-01 00:00:00.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_polyfit_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -0,0 +1,37 @@ +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + + + +//! \addtogroup glue_polyfit +//! @{ + + + +class glue_polyfit + { + public: + + template inline static bool apply_noalias(Mat& out, const Col& X, const Col& Y, const uword N); + + template inline static bool apply_direct(Mat& out, const Base& X_expr, const Base& Y_expr, const uword N); + + template inline static void apply(Mat& out, const Glue& expr); + }; + + + +//! @} + diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_polyfit_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_polyfit_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_polyfit_meat.hpp 1970-01-01 00:00:00.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_polyfit_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -0,0 +1,131 @@ +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + + +//! \addtogroup glue_polyfit +//! @{ + + + +template +inline +bool +glue_polyfit::apply_noalias(Mat& out, const Col& X, const Col& Y, const uword N) + { + arma_extra_debug_sigprint(); + + // create Vandermonde matrix + + Mat V(X.n_elem, N+1); + + V.tail_cols(1).ones(); + + for(uword i=1; i <= N; ++i) + { + const uword j = N-i; + + Col V_col_j (V.colptr(j ), V.n_rows, false, false); + Col V_col_jp1(V.colptr(j+1), V.n_rows, false, false); + + V_col_j = V_col_jp1 % X; + } + + Mat Q; + Mat R; + + const bool status1 = auxlib::qr_econ(Q, R, V); + + if(status1 == false) { return false; } + + const bool status2 = auxlib::solve_tri(out, R, (Q.t() * Y), uword(0)); + + if(status2 == false) { return false; } + + return true; + } + + + +template +inline +bool +glue_polyfit::apply_direct(Mat& out, const Base& X_expr, const Base& Y_expr, const uword N) + { + arma_extra_debug_sigprint(); + + typedef typename T1::elem_type eT; + + const quasi_unwrap UX(X_expr.get_ref()); + const quasi_unwrap UY(Y_expr.get_ref()); + + const Mat& X = UX.M; + const Mat& Y = UY.M; + + arma_debug_check + ( + ( ((X.is_vec() == false) && (X.is_empty() == false)) || ((Y.is_vec() == false) && (Y.is_empty() == false)) ), + "polyfit(): given object is not a vector" + ); + + arma_debug_check( (X.n_elem != Y.n_elem), "polyfit(): given vectors must have the same number of elements" ); + + if(X.n_elem == 0) + { + out.reset(); + return true; + } + + arma_debug_check( (N >= X.n_elem), "polyfit(): N must be less than the number of elements in X" ); + + const Col X_as_colvec( const_cast(X.memptr()), X.n_elem, false, false); + const Col Y_as_colvec( const_cast(Y.memptr()), Y.n_elem, false, false); + + bool status = false; + + if(UX.is_alias(out) || UY.is_alias(out)) + { + Mat tmp; + status = glue_polyfit::apply_noalias(tmp, X_as_colvec, Y_as_colvec, N); + out.steal_mem(tmp); + } + else + { + status = glue_polyfit::apply_noalias(out, X_as_colvec, Y_as_colvec, N); + } + + return status; + } + + + +template +inline +void +glue_polyfit::apply(Mat& out, const Glue& expr) + { + arma_extra_debug_sigprint(); + + const bool status = glue_polyfit::apply_direct(out, expr.A, expr.B, expr.aux_uword); + + if(status == false) + { + out.reset(); + arma_stop_runtime_error("polyfit(): failed"); + } + } + + + +//! @} diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_polyval_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_polyval_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_polyval_bones.hpp 1970-01-01 00:00:00.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_polyval_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -0,0 +1,35 @@ +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + + + +//! \addtogroup glue_polyval +//! @{ + + + +class glue_polyval + { + public: + + template inline static void apply_noalias(Mat& out, const Mat& P, const Mat& X); + + template inline static void apply(Mat& out, const Glue& expr); + }; + + + +//! @} + diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_polyval_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_polyval_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_polyval_meat.hpp 1970-01-01 00:00:00.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_polyval_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -0,0 +1,81 @@ +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + + +//! \addtogroup glue_polyval +//! @{ + + + +template +inline +void +glue_polyval::apply_noalias(Mat& out, const Mat& P, const Mat& X) + { + arma_extra_debug_sigprint(); + + out.set_size(X.n_rows, X.n_cols); + + const eT* P_mem = P.memptr(); + const uword P_n_elem = P.n_elem; + + out.fill(P_mem[0]); + + for(uword i=1; i < P_n_elem; ++i) + { + out = out % X + P_mem[i]; + } + } + + + +template +inline +void +glue_polyval::apply(Mat& out, const Glue& expr) + { + arma_extra_debug_sigprint(); + + typedef typename T1::elem_type eT; + + const quasi_unwrap UP(expr.A); + const quasi_unwrap UX(expr.B); + + const Mat& P = UP.M; + const Mat& X = UX.M; + + arma_debug_check( ((P.is_vec() == false) && (P.is_empty() == false)), "polyval(): argument P must be a vector" ); + + if(P.is_empty() || X.is_empty()) + { + out.zeros(X.n_rows, X.n_cols); + return; + } + + if(UP.is_alias(out) || UX.is_alias(out)) + { + Mat tmp; + glue_polyval::apply_noalias(tmp, P, X); + out.steal_mem(tmp); + } + else + { + glue_polyval::apply_noalias(out, P, X); + } + } + + + +//! @} diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_relational_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_relational_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_relational_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_relational_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2014 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup glue_relational diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_relational_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_relational_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_relational_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_relational_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup glue_relational diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_solve_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_solve_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_solve_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_solve_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_solve_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_solve_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_solve_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_solve_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup glue_solve diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_times_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_times_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_times_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_times_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2013 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup glue_times diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_times_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_times_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_times_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_times_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup glue_times diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_toeplitz_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_toeplitz_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_toeplitz_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_toeplitz_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2013 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_toeplitz_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_toeplitz_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_toeplitz_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_toeplitz_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2013 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_trapz_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_trapz_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_trapz_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_trapz_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/glue_trapz_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/glue_trapz_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/glue_trapz_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/glue_trapz_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup glue_trapz diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/gmm_diag_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/gmm_diag_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/gmm_diag_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/gmm_diag_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2014-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup gmm_diag @@ -51,7 +57,7 @@ struct gmm_empty_arg {}; -#if defined(_OPENMP) +#if defined(ARMA_USE_OPENMP) struct arma_omp_state { const int orig_dynamic_state; @@ -80,8 +86,8 @@ inline ~gmm_diag(); inline gmm_diag(); - inline gmm_diag(const gmm_diag& x); - inline const gmm_diag& operator=(const gmm_diag& x); + inline gmm_diag(const gmm_diag& x); + inline gmm_diag& operator=(const gmm_diag& x); inline gmm_diag(const uword in_n_dims, const uword in_n_gaus); inline void reset(const uword in_n_dims, const uword in_n_gaus); diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/gmm_diag_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/gmm_diag_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/gmm_diag_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/gmm_diag_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2014-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup gmm_diag @@ -49,7 +55,7 @@ template inline -const gmm_diag& +gmm_diag& gmm_diag::operator=(const gmm_diag& x) { arma_extra_debug_sigprint(); @@ -934,7 +940,7 @@ { arma_extra_debug_sigprint(); - #if defined(_OPENMP) + #if defined(ARMA_USE_OPENMP) // const uword n_cores = 0; const uword n_cores = uword(omp_get_num_procs()); const uword n_threads = (n_cores > 0) ? ( (n_cores <= N) ? n_cores : 1 ) : 1; @@ -1068,7 +1074,7 @@ if(N > 0) { - #if defined(_OPENMP) + #if defined(ARMA_USE_OPENMP) { const arma_omp_state save_omp_state; @@ -1076,7 +1082,7 @@ const uword n_threads = boundaries.n_cols; - #pragma omp parallel for + #pragma omp parallel for schedule(static) for(uword t=0; t < n_threads; ++t) { const uword start_index = boundaries.at(0,t); @@ -1124,7 +1130,7 @@ if(N > 0) { - #if defined(_OPENMP) + #if defined(ARMA_USE_OPENMP) { const arma_omp_state save_omp_state; @@ -1132,7 +1138,7 @@ const uword n_threads = boundaries.n_cols; - #pragma omp parallel for + #pragma omp parallel for schedule(static) for(uword t=0; t < n_threads; ++t) { const uword start_index = boundaries.at(0,t); @@ -1178,7 +1184,7 @@ if(N == 0) { return (-Datum::inf); } - #if defined(_OPENMP) + #if defined(ARMA_USE_OPENMP) { const arma_omp_state save_omp_state; @@ -1189,7 +1195,7 @@ field< running_mean_scalar > t_running_means(n_threads); - #pragma omp parallel for + #pragma omp parallel for schedule(static) for(uword t=0; t < n_threads; ++t) { const uword start_index = boundaries.at(0,t); @@ -1249,7 +1255,7 @@ if(N == 0) { return (-Datum::inf); } - #if defined(_OPENMP) + #if defined(ARMA_USE_OPENMP) { const arma_omp_state save_omp_state; @@ -1260,7 +1266,7 @@ field< running_mean_scalar > t_running_means(n_threads); - #pragma omp parallel for + #pragma omp parallel for schedule(static) for(uword t=0; t < n_threads; ++t) { const uword start_index = boundaries.at(0,t); @@ -1679,7 +1685,7 @@ const eT* mah_aux_mem = mah_aux.memptr(); - #if defined(_OPENMP) + #if defined(ARMA_USE_OPENMP) const arma_omp_state save_omp_state; const umat boundaries = internal_gen_boundaries(X.n_cols); @@ -1701,7 +1707,7 @@ for(uword iter=1; iter <= max_iter; ++iter) { - #if defined(_OPENMP) + #if defined(ARMA_USE_OPENMP) { for(uword t=0; t < n_threads; ++t) { @@ -1711,7 +1717,7 @@ // km_update_stats() is the "map" operation, which produces partial means - #pragma omp parallel for + #pragma omp parallel for schedule(static) for(uword t=0; t < n_threads; ++t) { field< running_mean_vec >& current_running_means = t_running_means[t]; @@ -1934,7 +1940,7 @@ get_stream_err2().setf(ios::fixed); } - #if defined(_OPENMP) + #if defined(ARMA_USE_OPENMP) const arma_omp_state save_omp_state; #endif @@ -1960,7 +1966,7 @@ } - #if defined(_OPENMP) + #if defined(ARMA_USE_OPENMP) if(verbose) { get_stream_err2() << "gmm_diag::learn(): EM: n_threads: " << n_threads << '\n'; @@ -2033,9 +2039,9 @@ // em_generate_acc() is the "map" operation, which produces partial accumulators for means, diagonal covariances and hefts - #if defined(_OPENMP) + #if defined(ARMA_USE_OPENMP) { - #pragma omp parallel for + #pragma omp parallel for schedule(static) for(uword t=0; t& acc_means = t_acc_means[t]; diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/gmm_misc_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/gmm_misc_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/gmm_misc_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/gmm_misc_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2014 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup gmm_diag diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/gmm_misc_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/gmm_misc_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/gmm_misc_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/gmm_misc_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2014 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup gmm_diag diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/hdf5_misc.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/hdf5_misc.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/hdf5_misc.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/hdf5_misc.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,13 +1,17 @@ -// Copyright (C) 2012-2013 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin -// Written by Szabolcs Horvat +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup hdf5_misc diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/include_atlas.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/include_atlas.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/include_atlas.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/include_atlas.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2011 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #if defined(ARMA_USE_ATLAS) diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/include_hdf5.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/include_hdf5.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/include_hdf5.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/include_hdf5.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2014 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #if defined(ARMA_USE_HDF5) diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/include_superlu.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/include_superlu.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/include_superlu.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/include_superlu.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,19 +1,21 @@ -// This Source Code Form is a compilation of: -// (1) source code written by Ryan Curtin and Conrad Sanderson, and -// (2) extracts from SuperLU 5.2 source code. - -// This compilation is Copyright (C) 2016 National ICT Australia (NICTA) -// and is subject to the terms of the Mozilla Public License, v. 2.0. +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) // -// The source code that is distinct and separate from SuperLU 5.2 source code -// is Copyright (C) 2016 National ICT Australia (NICTA) -// and is subject to the terms of the Mozilla Public License, v. 2.0. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // -// If a copy of the MPL was not distributed with this file, -// You can obtain one at http://mozilla.org/MPL/2.0/. +// ------------------------------------------------------------------------ // -// The original SuperLU 5.2 source code is licensed under a 3-clause BSD license, -// as follows: +// This file includes portions of SuperLU 5.2 software, +// licensed under the following conditions. // // Copyright (c) 2003, The Regents of the University of California, through // Lawrence Berkeley National Laboratory (subject to receipt of any required @@ -43,7 +45,9 @@ // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE // OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// ------------------------------------------------------------------------ #if defined(ARMA_USE_SUPERLU) diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/injector_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/injector_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/injector_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/injector_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup injector diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/injector_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/injector_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/injector_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/injector_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup injector diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/Mat_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/Mat_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/Mat_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/Mat_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup Mat @@ -57,63 +62,63 @@ template inline Mat(const uword in_rows, const uword in_cols, const fill::fill_class& f); template inline Mat(const SizeMat& s, const fill::fill_class& f); - inline Mat(const char* text); - inline const Mat& operator=(const char* text); + inline Mat(const char* text); + inline Mat& operator=(const char* text); - inline Mat(const std::string& text); - inline const Mat& operator=(const std::string& text); + inline Mat(const std::string& text); + inline Mat& operator=(const std::string& text); - inline Mat(const std::vector& x); - inline const Mat& operator=(const std::vector& x); + inline Mat(const std::vector& x); + inline Mat& operator=(const std::vector& x); #if defined(ARMA_USE_CXX11) - inline Mat(const std::initializer_list& list); - inline const Mat& operator=(const std::initializer_list& list); + inline Mat(const std::initializer_list& list); + inline Mat& operator=(const std::initializer_list& list); - inline Mat(const std::initializer_list< std::initializer_list >& list); - inline const Mat& operator=(const std::initializer_list< std::initializer_list >& list); + inline Mat(const std::initializer_list< std::initializer_list >& list); + inline Mat& operator=(const std::initializer_list< std::initializer_list >& list); - inline Mat(Mat&& m); - inline const Mat& operator=(Mat&& m); + inline Mat(Mat&& m); + inline Mat& operator=(Mat&& m); #endif inline Mat( eT* aux_mem, const uword aux_n_rows, const uword aux_n_cols, const bool copy_aux_mem = true, const bool strict = false); inline Mat(const eT* aux_mem, const uword aux_n_rows, const uword aux_n_cols); - arma_inline const Mat& operator=(const eT val); - arma_inline const Mat& operator+=(const eT val); - arma_inline const Mat& operator-=(const eT val); - arma_inline const Mat& operator*=(const eT val); - arma_inline const Mat& operator/=(const eT val); - - inline Mat(const Mat& m); - inline const Mat& operator=(const Mat& m); - inline const Mat& operator+=(const Mat& m); - inline const Mat& operator-=(const Mat& m); - inline const Mat& operator*=(const Mat& m); - inline const Mat& operator%=(const Mat& m); - inline const Mat& operator/=(const Mat& m); - - template inline Mat(const BaseCube& X); - template inline const Mat& operator=(const BaseCube& X); - template inline const Mat& operator+=(const BaseCube& X); - template inline const Mat& operator-=(const BaseCube& X); - template inline const Mat& operator*=(const BaseCube& X); - template inline const Mat& operator%=(const BaseCube& X); - template inline const Mat& operator/=(const BaseCube& X); + inline Mat& operator=(const eT val); + inline Mat& operator+=(const eT val); + inline Mat& operator-=(const eT val); + inline Mat& operator*=(const eT val); + inline Mat& operator/=(const eT val); + + inline Mat(const Mat& m); + inline Mat& operator=(const Mat& m); + inline Mat& operator+=(const Mat& m); + inline Mat& operator-=(const Mat& m); + inline Mat& operator*=(const Mat& m); + inline Mat& operator%=(const Mat& m); + inline Mat& operator/=(const Mat& m); + + template inline Mat(const BaseCube& X); + template inline Mat& operator=(const BaseCube& X); + template inline Mat& operator+=(const BaseCube& X); + template inline Mat& operator-=(const BaseCube& X); + template inline Mat& operator*=(const BaseCube& X); + template inline Mat& operator%=(const BaseCube& X); + template inline Mat& operator/=(const BaseCube& X); template inline explicit Mat(const Base& A, const Base& B); inline explicit Mat(const subview& X, const bool use_colmem); // only to be used by the quasi_unwrap class - inline Mat(const subview& X); - inline const Mat& operator=(const subview& X); - inline const Mat& operator+=(const subview& X); - inline const Mat& operator-=(const subview& X); - inline const Mat& operator*=(const subview& X); - inline const Mat& operator%=(const subview& X); - inline const Mat& operator/=(const subview& X); + inline Mat(const subview& X); + inline Mat& operator=(const subview& X); + inline Mat& operator+=(const subview& X); + inline Mat& operator-=(const subview& X); + inline Mat& operator*=(const subview& X); + inline Mat& operator%=(const subview& X); + inline Mat& operator/=(const subview& X); inline Mat(const subview_row_strans& X); // subview_row_strans can only be generated by the Proxy class inline Mat(const subview_row_htrans& X); // subview_row_htrans can only be generated by the Proxy class @@ -122,54 +127,54 @@ template inline Mat(const xtrans_mat& X); // xtrans_mat can only be generated by the Proxy class - inline Mat(const subview_cube& X); - inline const Mat& operator=(const subview_cube& X); - inline const Mat& operator+=(const subview_cube& X); - inline const Mat& operator-=(const subview_cube& X); - inline const Mat& operator*=(const subview_cube& X); - inline const Mat& operator%=(const subview_cube& X); - inline const Mat& operator/=(const subview_cube& X); - - inline Mat(const diagview& X); - inline const Mat& operator=(const diagview& X); - inline const Mat& operator+=(const diagview& X); - inline const Mat& operator-=(const diagview& X); - inline const Mat& operator*=(const diagview& X); - inline const Mat& operator%=(const diagview& X); - inline const Mat& operator/=(const diagview& X); - - inline Mat(const spdiagview& X); - inline const Mat& operator=(const spdiagview& X); - inline const Mat& operator+=(const spdiagview& X); - inline const Mat& operator-=(const spdiagview& X); - inline const Mat& operator*=(const spdiagview& X); - inline const Mat& operator%=(const spdiagview& X); - inline const Mat& operator/=(const spdiagview& X); - - template inline Mat(const subview_elem1& X); - template inline const Mat& operator= (const subview_elem1& X); - template inline const Mat& operator+=(const subview_elem1& X); - template inline const Mat& operator-=(const subview_elem1& X); - template inline const Mat& operator*=(const subview_elem1& X); - template inline const Mat& operator%=(const subview_elem1& X); - template inline const Mat& operator/=(const subview_elem1& X); - - template inline Mat(const subview_elem2& X); - template inline const Mat& operator= (const subview_elem2& X); - template inline const Mat& operator+=(const subview_elem2& X); - template inline const Mat& operator-=(const subview_elem2& X); - template inline const Mat& operator*=(const subview_elem2& X); - template inline const Mat& operator%=(const subview_elem2& X); - template inline const Mat& operator/=(const subview_elem2& X); + inline Mat(const subview_cube& X); + inline Mat& operator=(const subview_cube& X); + inline Mat& operator+=(const subview_cube& X); + inline Mat& operator-=(const subview_cube& X); + inline Mat& operator*=(const subview_cube& X); + inline Mat& operator%=(const subview_cube& X); + inline Mat& operator/=(const subview_cube& X); + + inline Mat(const diagview& X); + inline Mat& operator=(const diagview& X); + inline Mat& operator+=(const diagview& X); + inline Mat& operator-=(const diagview& X); + inline Mat& operator*=(const diagview& X); + inline Mat& operator%=(const diagview& X); + inline Mat& operator/=(const diagview& X); + + inline Mat(const spdiagview& X); + inline Mat& operator=(const spdiagview& X); + inline Mat& operator+=(const spdiagview& X); + inline Mat& operator-=(const spdiagview& X); + inline Mat& operator*=(const spdiagview& X); + inline Mat& operator%=(const spdiagview& X); + inline Mat& operator/=(const spdiagview& X); + + template inline Mat(const subview_elem1& X); + template inline Mat& operator= (const subview_elem1& X); + template inline Mat& operator+=(const subview_elem1& X); + template inline Mat& operator-=(const subview_elem1& X); + template inline Mat& operator*=(const subview_elem1& X); + template inline Mat& operator%=(const subview_elem1& X); + template inline Mat& operator/=(const subview_elem1& X); + + template inline Mat(const subview_elem2& X); + template inline Mat& operator= (const subview_elem2& X); + template inline Mat& operator+=(const subview_elem2& X); + template inline Mat& operator-=(const subview_elem2& X); + template inline Mat& operator*=(const subview_elem2& X); + template inline Mat& operator%=(const subview_elem2& X); + template inline Mat& operator/=(const subview_elem2& X); // Operators on sparse matrices (and subviews) - template inline explicit Mat(const SpBase& m); - template inline const Mat& operator=(const SpBase& m); - template inline const Mat& operator+=(const SpBase& m); - template inline const Mat& operator-=(const SpBase& m); - template inline const Mat& operator*=(const SpBase& m); - template inline const Mat& operator%=(const SpBase& m); - template inline const Mat& operator/=(const SpBase& m); + template inline explicit Mat(const SpBase& m); + template inline Mat& operator=(const SpBase& m); + template inline Mat& operator+=(const SpBase& m); + template inline Mat& operator-=(const SpBase& m); + template inline Mat& operator*=(const SpBase& m); + template inline Mat& operator%=(const SpBase& m); + template inline Mat& operator/=(const SpBase& m); inline mat_injector operator<<(const eT val); inline mat_injector operator<<(const injector_end_of_row<>& x); @@ -297,64 +302,64 @@ template inline void insert_cols(const uword col_num, const Base& X); - template inline Mat(const Gen& X); - template inline const Mat& operator=(const Gen& X); - template inline const Mat& operator+=(const Gen& X); - template inline const Mat& operator-=(const Gen& X); - template inline const Mat& operator*=(const Gen& X); - template inline const Mat& operator%=(const Gen& X); - template inline const Mat& operator/=(const Gen& X); - - template inline Mat(const Op& X); - template inline const Mat& operator=(const Op& X); - template inline const Mat& operator+=(const Op& X); - template inline const Mat& operator-=(const Op& X); - template inline const Mat& operator*=(const Op& X); - template inline const Mat& operator%=(const Op& X); - template inline const Mat& operator/=(const Op& X); - - template inline Mat(const eOp& X); - template inline const Mat& operator=(const eOp& X); - template inline const Mat& operator+=(const eOp& X); - template inline const Mat& operator-=(const eOp& X); - template inline const Mat& operator*=(const eOp& X); - template inline const Mat& operator%=(const eOp& X); - template inline const Mat& operator/=(const eOp& X); - - template inline Mat(const mtOp& X); - template inline const Mat& operator=(const mtOp& X); - template inline const Mat& operator+=(const mtOp& X); - template inline const Mat& operator-=(const mtOp& X); - template inline const Mat& operator*=(const mtOp& X); - template inline const Mat& operator%=(const mtOp& X); - template inline const Mat& operator/=(const mtOp& X); - - template inline Mat(const Glue& X); - template inline const Mat& operator=(const Glue& X); - template inline const Mat& operator+=(const Glue& X); - template inline const Mat& operator-=(const Glue& X); - template inline const Mat& operator*=(const Glue& X); - template inline const Mat& operator%=(const Glue& X); - template inline const Mat& operator/=(const Glue& X); - - template inline const Mat& operator+=(const Glue& X); - template inline const Mat& operator-=(const Glue& X); - - template inline Mat(const eGlue& X); - template inline const Mat& operator=(const eGlue& X); - template inline const Mat& operator+=(const eGlue& X); - template inline const Mat& operator-=(const eGlue& X); - template inline const Mat& operator*=(const eGlue& X); - template inline const Mat& operator%=(const eGlue& X); - template inline const Mat& operator/=(const eGlue& X); - - template inline Mat(const mtGlue& X); - template inline const Mat& operator=(const mtGlue& X); - template inline const Mat& operator+=(const mtGlue& X); - template inline const Mat& operator-=(const mtGlue& X); - template inline const Mat& operator*=(const mtGlue& X); - template inline const Mat& operator%=(const mtGlue& X); - template inline const Mat& operator/=(const mtGlue& X); + template inline Mat(const Gen& X); + template inline Mat& operator=(const Gen& X); + template inline Mat& operator+=(const Gen& X); + template inline Mat& operator-=(const Gen& X); + template inline Mat& operator*=(const Gen& X); + template inline Mat& operator%=(const Gen& X); + template inline Mat& operator/=(const Gen& X); + + template inline Mat(const Op& X); + template inline Mat& operator=(const Op& X); + template inline Mat& operator+=(const Op& X); + template inline Mat& operator-=(const Op& X); + template inline Mat& operator*=(const Op& X); + template inline Mat& operator%=(const Op& X); + template inline Mat& operator/=(const Op& X); + + template inline Mat(const eOp& X); + template inline Mat& operator=(const eOp& X); + template inline Mat& operator+=(const eOp& X); + template inline Mat& operator-=(const eOp& X); + template inline Mat& operator*=(const eOp& X); + template inline Mat& operator%=(const eOp& X); + template inline Mat& operator/=(const eOp& X); + + template inline Mat(const mtOp& X); + template inline Mat& operator=(const mtOp& X); + template inline Mat& operator+=(const mtOp& X); + template inline Mat& operator-=(const mtOp& X); + template inline Mat& operator*=(const mtOp& X); + template inline Mat& operator%=(const mtOp& X); + template inline Mat& operator/=(const mtOp& X); + + template inline Mat(const Glue& X); + template inline Mat& operator=(const Glue& X); + template inline Mat& operator+=(const Glue& X); + template inline Mat& operator-=(const Glue& X); + template inline Mat& operator*=(const Glue& X); + template inline Mat& operator%=(const Glue& X); + template inline Mat& operator/=(const Glue& X); + + template inline Mat& operator+=(const Glue& X); + template inline Mat& operator-=(const Glue& X); + + template inline Mat(const eGlue& X); + template inline Mat& operator=(const eGlue& X); + template inline Mat& operator+=(const eGlue& X); + template inline Mat& operator-=(const eGlue& X); + template inline Mat& operator*=(const eGlue& X); + template inline Mat& operator%=(const eGlue& X); + template inline Mat& operator/=(const eGlue& X); + + template inline Mat(const mtGlue& X); + template inline Mat& operator=(const mtGlue& X); + template inline Mat& operator+=(const mtGlue& X); + template inline Mat& operator-=(const mtGlue& X); + template inline Mat& operator*=(const mtGlue& X); + template inline Mat& operator%=(const mtGlue& X); + template inline Mat& operator/=(const mtGlue& X); arma_inline arma_warn_unused const eT& at_alt (const uword ii) const; @@ -428,7 +433,7 @@ inline void reshape(const uword in_rows, const uword in_cols); inline void reshape(const SizeMat& s); - arma_deprecated inline void reshape(const uword in_rows, const uword in_cols, const uword dim); //!< NOTE: don't use this form: it's deprecated + arma_deprecated inline void reshape(const uword in_rows, const uword in_cols, const uword dim); //!< NOTE: don't use this form: it will be removed template inline const Mat& for_each(functor F); @@ -762,18 +767,18 @@ using Mat::operator(); #if defined(ARMA_USE_CXX11) - inline fixed(const std::initializer_list& list); - inline const Mat& operator=(const std::initializer_list& list); + inline fixed(const std::initializer_list& list); + inline Mat& operator=(const std::initializer_list& list); - inline fixed(const std::initializer_list< std::initializer_list >& list); - inline const Mat& operator=(const std::initializer_list< std::initializer_list >& list); + inline fixed(const std::initializer_list< std::initializer_list >& list); + inline Mat& operator=(const std::initializer_list< std::initializer_list >& list); #endif - arma_inline const Mat& operator=(const fixed& X); + arma_inline Mat& operator=(const fixed& X); #if defined(ARMA_GOOD_COMPILER) - template inline const Mat& operator=(const eOp& X); - template inline const Mat& operator=(const eGlue& X); + template inline Mat& operator=(const eOp& X); + template inline Mat& operator=(const eGlue& X); #endif arma_inline const Op< Mat_fixed_type, op_htrans > t() const; @@ -813,17 +818,17 @@ { public: - template arma_inline static void prefix_pp(Mat& x); - template arma_inline static void prefix_pp(Mat< std::complex >& x); + template inline static void prefix_pp(Mat& x); + template inline static void prefix_pp(Mat< std::complex >& x); - template arma_inline static void postfix_pp(Mat& x); - template arma_inline static void postfix_pp(Mat< std::complex >& x); + template inline static void postfix_pp(Mat& x); + template inline static void postfix_pp(Mat< std::complex >& x); - template arma_inline static void prefix_mm(Mat& x); - template arma_inline static void prefix_mm(Mat< std::complex >& x); + template inline static void prefix_mm(Mat& x); + template inline static void prefix_mm(Mat< std::complex >& x); - template arma_inline static void postfix_mm(Mat& x); - template arma_inline static void postfix_mm(Mat< std::complex >& x); + template inline static void postfix_mm(Mat& x); + template inline static void postfix_mm(Mat< std::complex >& x); template inline static void set_real(Mat& out, const Base& X); template inline static void set_real(Mat< std::complex >& out, const Base< T,T1>& X); diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/Mat_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/Mat_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/Mat_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/Mat_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup Mat @@ -363,7 +368,7 @@ //! create the matrix from a textual description template inline -const Mat& +Mat& Mat::operator=(const char* text) { arma_extra_debug_sigprint(); @@ -395,7 +400,7 @@ //! create the matrix from a textual description template inline -const Mat& +Mat& Mat::operator=(const std::string& text) { arma_extra_debug_sigprint(); @@ -546,7 +551,7 @@ //! create the matrix from std::vector template inline -const Mat& +Mat& Mat::operator=(const std::vector& x) { arma_extra_debug_sigprint(); @@ -584,7 +589,7 @@ template inline - const Mat& + Mat& Mat::operator=(const std::initializer_list& list) { arma_extra_debug_sigprint(); @@ -615,7 +620,7 @@ template inline - const Mat& + Mat& Mat::operator=(const std::initializer_list< std::initializer_list >& list) { arma_extra_debug_sigprint(); @@ -670,7 +675,7 @@ template inline - const Mat& + Mat& Mat::operator=(Mat&& X) { arma_extra_debug_sigprint(arma_str::format("this = %x X = %x") % this % &X); @@ -695,8 +700,8 @@ //! Set the matrix to be equal to the specified scalar. //! NOTE: the size of the matrix will be 1x1 template -arma_inline -const Mat& +inline +Mat& Mat::operator=(const eT val) { arma_extra_debug_sigprint(); @@ -710,8 +715,8 @@ //! In-place addition of a scalar to all elements of the matrix template -arma_inline -const Mat& +inline +Mat& Mat::operator+=(const eT val) { arma_extra_debug_sigprint(); @@ -725,8 +730,8 @@ //! In-place subtraction of a scalar from all elements of the matrix template -arma_inline -const Mat& +inline +Mat& Mat::operator-=(const eT val) { arma_extra_debug_sigprint(); @@ -740,8 +745,8 @@ //! In-place multiplication of all elements of the matrix with a scalar template -arma_inline -const Mat& +inline +Mat& Mat::operator*=(const eT val) { arma_extra_debug_sigprint(); @@ -755,8 +760,8 @@ //! In-place division of all elements of the matrix with a scalar template -arma_inline -const Mat& +inline +Mat& Mat::operator/=(const eT val) { arma_extra_debug_sigprint(); @@ -791,7 +796,7 @@ //! construct a matrix from a given matrix template inline -const Mat& +Mat& Mat::operator=(const Mat& in_mat) { arma_extra_debug_sigprint(arma_str::format("this = %x in_mat = %x") % this % &in_mat); @@ -1268,7 +1273,7 @@ //! in-place matrix addition template inline -const Mat& +Mat& Mat::operator+=(const Mat& m) { arma_extra_debug_sigprint(); @@ -1285,7 +1290,7 @@ //! in-place matrix subtraction template inline -const Mat& +Mat& Mat::operator-=(const Mat& m) { arma_extra_debug_sigprint(); @@ -1302,7 +1307,7 @@ //! in-place matrix multiplication template inline -const Mat& +Mat& Mat::operator*=(const Mat& m) { arma_extra_debug_sigprint(); @@ -1317,7 +1322,7 @@ //! in-place element-wise matrix multiplication template inline -const Mat& +Mat& Mat::operator%=(const Mat& m) { arma_extra_debug_sigprint(); @@ -1334,7 +1339,7 @@ //! in-place element-wise matrix division template inline -const Mat& +Mat& Mat::operator/=(const Mat& m) { arma_extra_debug_sigprint(); @@ -1369,7 +1374,7 @@ template template inline -const Mat& +Mat& Mat::operator=(const BaseCube& X) { arma_extra_debug_sigprint(); @@ -1456,7 +1461,7 @@ template template inline -const Mat& +Mat& Mat::operator+=(const BaseCube& X) { arma_extra_debug_sigprint(); @@ -1537,7 +1542,7 @@ template template inline -const Mat& +Mat& Mat::operator-=(const BaseCube& X) { arma_extra_debug_sigprint(); @@ -1618,7 +1623,7 @@ template template inline -const Mat& +Mat& Mat::operator*=(const BaseCube& X) { arma_extra_debug_sigprint(); @@ -1635,7 +1640,7 @@ template template inline -const Mat& +Mat& Mat::operator%=(const BaseCube& X) { arma_extra_debug_sigprint(); @@ -1716,7 +1721,7 @@ template template inline -const Mat& +Mat& Mat::operator/=(const BaseCube& X) { arma_extra_debug_sigprint(); @@ -1866,7 +1871,7 @@ //! construct a matrix from subview (e.g. construct a matrix from a delayed submatrix operation) template inline -const Mat& +Mat& Mat::operator=(const subview& X) { arma_extra_debug_sigprint(); @@ -1893,7 +1898,7 @@ //! in-place matrix addition (using a submatrix on the right-hand-side) template inline -const Mat& +Mat& Mat::operator+=(const subview& X) { arma_extra_debug_sigprint(); @@ -1907,7 +1912,7 @@ //! in-place matrix subtraction (using a submatrix on the right-hand-side) template inline -const Mat& +Mat& Mat::operator-=(const subview& X) { arma_extra_debug_sigprint(); @@ -1922,7 +1927,7 @@ //! in-place matrix mutiplication (using a submatrix on the right-hand-side) template inline -const Mat& +Mat& Mat::operator*=(const subview& X) { arma_extra_debug_sigprint(); @@ -1937,7 +1942,7 @@ //! in-place element-wise matrix mutiplication (using a submatrix on the right-hand-side) template inline -const Mat& +Mat& Mat::operator%=(const subview& X) { arma_extra_debug_sigprint(); @@ -1952,7 +1957,7 @@ //! in-place element-wise matrix division (using a submatrix on the right-hand-side) template inline -const Mat& +Mat& Mat::operator/=(const subview& X) { arma_extra_debug_sigprint(); @@ -2062,7 +2067,7 @@ //! construct a matrix from a subview_cube instance template inline -const Mat& +Mat& Mat::operator=(const subview_cube& X) { arma_extra_debug_sigprint(); @@ -2077,7 +2082,7 @@ //! in-place matrix addition (using a single-slice subcube on the right-hand-side) template inline -const Mat& +Mat& Mat::operator+=(const subview_cube& X) { arma_extra_debug_sigprint(); @@ -2092,7 +2097,7 @@ //! in-place matrix subtraction (using a single-slice subcube on the right-hand-side) template inline -const Mat& +Mat& Mat::operator-=(const subview_cube& X) { arma_extra_debug_sigprint(); @@ -2107,7 +2112,7 @@ //! in-place matrix mutiplication (using a single-slice subcube on the right-hand-side) template inline -const Mat& +Mat& Mat::operator*=(const subview_cube& X) { arma_extra_debug_sigprint(); @@ -2123,7 +2128,7 @@ //! in-place element-wise matrix mutiplication (using a single-slice subcube on the right-hand-side) template inline -const Mat& +Mat& Mat::operator%=(const subview_cube& X) { arma_extra_debug_sigprint(); @@ -2138,7 +2143,7 @@ //! in-place element-wise matrix division (using a single-slice subcube on the right-hand-side) template inline -const Mat& +Mat& Mat::operator/=(const subview_cube& X) { arma_extra_debug_sigprint(); @@ -2173,7 +2178,7 @@ //! construct a matrix from diagview (e.g. construct a matrix from a delayed diag operation) template inline -const Mat& +Mat& Mat::operator=(const diagview& X) { arma_extra_debug_sigprint(); @@ -2201,7 +2206,7 @@ //! in-place matrix addition (using a diagview on the right-hand-side) template inline -const Mat& +Mat& Mat::operator+=(const diagview& X) { arma_extra_debug_sigprint(); @@ -2216,7 +2221,7 @@ //! in-place matrix subtraction (using a diagview on the right-hand-side) template inline -const Mat& +Mat& Mat::operator-=(const diagview& X) { arma_extra_debug_sigprint(); @@ -2231,7 +2236,7 @@ //! in-place matrix mutiplication (using a diagview on the right-hand-side) template inline -const Mat& +Mat& Mat::operator*=(const diagview& X) { arma_extra_debug_sigprint(); @@ -2246,7 +2251,7 @@ //! in-place element-wise matrix mutiplication (using a diagview on the right-hand-side) template inline -const Mat& +Mat& Mat::operator%=(const diagview& X) { arma_extra_debug_sigprint(); @@ -2261,7 +2266,7 @@ //! in-place element-wise matrix division (using a diagview on the right-hand-side) template inline -const Mat& +Mat& Mat::operator/=(const diagview& X) { arma_extra_debug_sigprint(); @@ -2294,7 +2299,7 @@ template inline -const Mat& +Mat& Mat::operator=(const spdiagview& X) { arma_extra_debug_sigprint(); @@ -2310,7 +2315,7 @@ template inline -const Mat& +Mat& Mat::operator+=(const spdiagview& X) { arma_extra_debug_sigprint(); @@ -2326,7 +2331,7 @@ template inline -const Mat& +Mat& Mat::operator-=(const spdiagview& X) { arma_extra_debug_sigprint(); @@ -2342,7 +2347,7 @@ template inline -const Mat& +Mat& Mat::operator*=(const spdiagview& X) { arma_extra_debug_sigprint(); @@ -2358,7 +2363,7 @@ template inline -const Mat& +Mat& Mat::operator%=(const spdiagview& X) { arma_extra_debug_sigprint(); @@ -2374,7 +2379,7 @@ template inline -const Mat& +Mat& Mat::operator/=(const spdiagview& X) { arma_extra_debug_sigprint(); @@ -2409,7 +2414,7 @@ template template inline -const Mat& +Mat& Mat::operator=(const subview_elem1& X) { arma_extra_debug_sigprint(); @@ -2424,7 +2429,7 @@ template template inline -const Mat& +Mat& Mat::operator+=(const subview_elem1& X) { arma_extra_debug_sigprint(); @@ -2439,7 +2444,7 @@ template template inline -const Mat& +Mat& Mat::operator-=(const subview_elem1& X) { arma_extra_debug_sigprint(); @@ -2454,7 +2459,7 @@ template template inline -const Mat& +Mat& Mat::operator*=(const subview_elem1& X) { arma_extra_debug_sigprint(); @@ -2469,7 +2474,7 @@ template template inline -const Mat& +Mat& Mat::operator%=(const subview_elem1& X) { arma_extra_debug_sigprint(); @@ -2484,7 +2489,7 @@ template template inline -const Mat& +Mat& Mat::operator/=(const subview_elem1& X) { arma_extra_debug_sigprint(); @@ -2517,7 +2522,7 @@ template template inline -const Mat& +Mat& Mat::operator=(const subview_elem2& X) { arma_extra_debug_sigprint(); @@ -2532,7 +2537,7 @@ template template inline -const Mat& +Mat& Mat::operator+=(const subview_elem2& X) { arma_extra_debug_sigprint(); @@ -2547,7 +2552,7 @@ template template inline -const Mat& +Mat& Mat::operator-=(const subview_elem2& X) { arma_extra_debug_sigprint(); @@ -2562,7 +2567,7 @@ template template inline -const Mat& +Mat& Mat::operator*=(const subview_elem2& X) { arma_extra_debug_sigprint(); @@ -2577,7 +2582,7 @@ template template inline -const Mat& +Mat& Mat::operator%=(const subview_elem2& X) { arma_extra_debug_sigprint(); @@ -2592,7 +2597,7 @@ template template inline -const Mat& +Mat& Mat::operator/=(const subview_elem2& X) { arma_extra_debug_sigprint(); @@ -2642,7 +2647,7 @@ template template inline -const Mat& +Mat& Mat::operator=(const SpBase& m) { arma_extra_debug_sigprint(); @@ -2670,7 +2675,7 @@ template template inline -const Mat& +Mat& Mat::operator+=(const SpBase& m) { arma_extra_debug_sigprint(); @@ -2696,7 +2701,7 @@ template template inline -const Mat& +Mat& Mat::operator-=(const SpBase& m) { arma_extra_debug_sigprint(); @@ -2722,7 +2727,7 @@ template template inline -const Mat& +Mat& Mat::operator*=(const SpBase& m) { arma_extra_debug_sigprint(); @@ -2739,7 +2744,7 @@ template template inline -const Mat& +Mat& Mat::operator%=(const SpBase& m) { arma_extra_debug_sigprint(); @@ -2777,7 +2782,7 @@ template template inline -const Mat& +Mat& Mat::operator/=(const SpBase& m) { arma_extra_debug_sigprint(); @@ -4467,7 +4472,7 @@ template template inline -const Mat& +Mat& Mat::operator=(const Gen& X) { arma_extra_debug_sigprint(); @@ -4486,7 +4491,7 @@ template template inline -const Mat& +Mat& Mat::operator+=(const Gen& X) { arma_extra_debug_sigprint(); @@ -4503,7 +4508,7 @@ template template inline -const Mat& +Mat& Mat::operator-=(const Gen& X) { arma_extra_debug_sigprint(); @@ -4520,7 +4525,7 @@ template template inline -const Mat& +Mat& Mat::operator*=(const Gen& X) { arma_extra_debug_sigprint(); @@ -4537,7 +4542,7 @@ template template inline -const Mat& +Mat& Mat::operator%=(const Gen& X) { arma_extra_debug_sigprint(); @@ -4554,7 +4559,7 @@ template template inline -const Mat& +Mat& Mat::operator/=(const Gen& X) { arma_extra_debug_sigprint(); @@ -4593,7 +4598,7 @@ template template inline -const Mat& +Mat& Mat::operator=(const Op& X) { arma_extra_debug_sigprint(); @@ -4611,7 +4616,7 @@ template template inline -const Mat& +Mat& Mat::operator+=(const Op& X) { arma_extra_debug_sigprint(); @@ -4629,7 +4634,7 @@ template template inline -const Mat& +Mat& Mat::operator-=(const Op& X) { arma_extra_debug_sigprint(); @@ -4647,7 +4652,7 @@ template template inline -const Mat& +Mat& Mat::operator*=(const Op& X) { arma_extra_debug_sigprint(); @@ -4665,7 +4670,7 @@ template template inline -const Mat& +Mat& Mat::operator%=(const Op& X) { arma_extra_debug_sigprint(); @@ -4683,7 +4688,7 @@ template template inline -const Mat& +Mat& Mat::operator/=(const Op& X) { arma_extra_debug_sigprint(); @@ -4724,7 +4729,7 @@ template template inline -const Mat& +Mat& Mat::operator=(const eOp& X) { arma_extra_debug_sigprint(); @@ -4756,7 +4761,7 @@ template template inline -const Mat& +Mat& Mat::operator+=(const eOp& X) { arma_extra_debug_sigprint(); @@ -4773,7 +4778,7 @@ template template inline -const Mat& +Mat& Mat::operator-=(const eOp& X) { arma_extra_debug_sigprint(); @@ -4790,7 +4795,7 @@ template template inline -const Mat& +Mat& Mat::operator*=(const eOp& X) { arma_extra_debug_sigprint(); @@ -4807,7 +4812,7 @@ template template inline -const Mat& +Mat& Mat::operator%=(const eOp& X) { arma_extra_debug_sigprint(); @@ -4824,7 +4829,7 @@ template template inline -const Mat& +Mat& Mat::operator/=(const eOp& X) { arma_extra_debug_sigprint(); @@ -4838,7 +4843,6 @@ -//! EXPERIMENTAL template template inline @@ -4857,11 +4861,10 @@ -//! EXPERIMENTAL template template inline -const Mat& +Mat& Mat::operator=(const mtOp& X) { arma_extra_debug_sigprint(); @@ -4873,11 +4876,10 @@ -//! EXPERIMENTAL template template inline -const Mat& +Mat& Mat::operator+=(const mtOp& X) { arma_extra_debug_sigprint(); @@ -4889,11 +4891,10 @@ -//! EXPERIMENTAL template template inline -const Mat& +Mat& Mat::operator-=(const mtOp& X) { arma_extra_debug_sigprint(); @@ -4905,11 +4906,10 @@ -//! EXPERIMENTAL template template inline -const Mat& +Mat& Mat::operator*=(const mtOp& X) { arma_extra_debug_sigprint(); @@ -4921,11 +4921,10 @@ -//! EXPERIMENTAL template template inline -const Mat& +Mat& Mat::operator%=(const mtOp& X) { arma_extra_debug_sigprint(); @@ -4937,11 +4936,10 @@ -//! EXPERIMENTAL template template inline -const Mat& +Mat& Mat::operator/=(const mtOp& X) { arma_extra_debug_sigprint(); @@ -4979,7 +4977,7 @@ template template inline -const Mat& +Mat& Mat::operator=(const Glue& X) { arma_extra_debug_sigprint(); @@ -4998,7 +4996,7 @@ template template inline -const Mat& +Mat& Mat::operator+=(const Glue& X) { arma_extra_debug_sigprint(); @@ -5017,7 +5015,7 @@ template template inline -const Mat& +Mat& Mat::operator-=(const Glue& X) { arma_extra_debug_sigprint(); @@ -5036,7 +5034,7 @@ template template inline -const Mat& +Mat& Mat::operator*=(const Glue& X) { arma_extra_debug_sigprint(); @@ -5055,7 +5053,7 @@ template template inline -const Mat& +Mat& Mat::operator%=(const Glue& X) { arma_extra_debug_sigprint(); @@ -5074,7 +5072,7 @@ template template inline -const Mat& +Mat& Mat::operator/=(const Glue& X) { arma_extra_debug_sigprint(); @@ -5092,7 +5090,7 @@ template template inline -const Mat& +Mat& Mat::operator+=(const Glue& X) { arma_extra_debug_sigprint(); @@ -5107,7 +5105,7 @@ template template inline -const Mat& +Mat& Mat::operator-=(const Glue& X) { arma_extra_debug_sigprint(); @@ -5147,7 +5145,7 @@ template template inline -const Mat& +Mat& Mat::operator=(const eGlue& X) { arma_extra_debug_sigprint(); @@ -5186,7 +5184,7 @@ template template inline -const Mat& +Mat& Mat::operator+=(const eGlue& X) { arma_extra_debug_sigprint(); @@ -5205,7 +5203,7 @@ template template inline -const Mat& +Mat& Mat::operator-=(const eGlue& X) { arma_extra_debug_sigprint(); @@ -5223,7 +5221,7 @@ template template inline -const Mat& +Mat& Mat::operator*=(const eGlue& X) { arma_extra_debug_sigprint(); @@ -5240,7 +5238,7 @@ template template inline -const Mat& +Mat& Mat::operator%=(const eGlue& X) { arma_extra_debug_sigprint(); @@ -5257,7 +5255,7 @@ template template inline -const Mat& +Mat& Mat::operator/=(const eGlue& X) { arma_extra_debug_sigprint(); @@ -5271,7 +5269,6 @@ -//! EXPERIMENTAL: create a matrix from mtGlue, i.e. run the previously delayed binary operations template template inline @@ -5290,11 +5287,10 @@ -//! EXPERIMENTAL: create a matrix from Glue, i.e. run the previously delayed binary operations template template inline -const Mat& +Mat& Mat::operator=(const mtGlue& X) { arma_extra_debug_sigprint(); @@ -5306,11 +5302,10 @@ -//! EXPERIMENTAL: in-place matrix addition, with the right-hand-side operands having delayed operations template template inline -const Mat& +Mat& Mat::operator+=(const mtGlue& X) { arma_extra_debug_sigprint(); @@ -5322,11 +5317,10 @@ -//! EXPERIMENTAL: in-place matrix subtraction, with the right-hand-side operands having delayed operations template template inline -const Mat& +Mat& Mat::operator-=(const mtGlue& X) { arma_extra_debug_sigprint(); @@ -5338,11 +5332,10 @@ -//! EXPERIMENTAL: in-place matrix multiplications, with the right-hand-side operands having delayed operations template template inline -const Mat& +Mat& Mat::operator*=(const mtGlue& X) { arma_extra_debug_sigprint(); @@ -5356,11 +5349,10 @@ -//! EXPERIMENTAL: in-place matrix element-wise multiplication, with the right-hand-side operands having delayed operations template template inline -const Mat& +Mat& Mat::operator%=(const mtGlue& X) { arma_extra_debug_sigprint(); @@ -5372,11 +5364,10 @@ -//! EXPERIMENTAL: in-place matrix element-wise division, with the right-hand-side operands having delayed operations template template inline -const Mat& +Mat& Mat::operator/=(const mtGlue& X) { arma_extra_debug_sigprint(); @@ -6235,7 +6226,7 @@ -//!< NOTE: don't use this in new code; kept only for compatibility with old code +//! NOTE: don't use this form; it's deprecated and will be removed template arma_deprecated inline @@ -8195,7 +8186,7 @@ template template inline - const Mat& + Mat& Mat::fixed::operator=(const std::initializer_list& list) { arma_extra_debug_sigprint(); @@ -8231,7 +8222,7 @@ template template inline - const Mat& + Mat& Mat::fixed::operator=(const std::initializer_list< std::initializer_list >& list) { arma_extra_debug_sigprint(); @@ -8248,7 +8239,7 @@ template template arma_inline -const Mat& +Mat& Mat::fixed::operator=(const fixed& X) { arma_extra_debug_sigprint(); @@ -8272,7 +8263,7 @@ template template inline - const Mat& + Mat& Mat::fixed::operator=(const eOp& X) { arma_extra_debug_sigprint(); @@ -8305,7 +8296,7 @@ template template inline - const Mat& + Mat& Mat::fixed::operator=(const eGlue& X) { arma_extra_debug_sigprint(); @@ -8653,7 +8644,7 @@ //! prefix ++ template -arma_inline +inline void Mat_aux::prefix_pp(Mat& x) { @@ -8678,7 +8669,7 @@ //! prefix ++ for complex numbers (work around for limitations of the std::complex class) template -arma_inline +inline void Mat_aux::prefix_pp(Mat< std::complex >& x) { @@ -8689,7 +8680,7 @@ //! postfix ++ template -arma_inline +inline void Mat_aux::postfix_pp(Mat& x) { @@ -8714,7 +8705,7 @@ //! postfix ++ for complex numbers (work around for limitations of the std::complex class) template -arma_inline +inline void Mat_aux::postfix_pp(Mat< std::complex >& x) { @@ -8725,7 +8716,7 @@ //! prefix -- template -arma_inline +inline void Mat_aux::prefix_mm(Mat& x) { @@ -8750,7 +8741,7 @@ //! prefix -- for complex numbers (work around for limitations of the std::complex class) template -arma_inline +inline void Mat_aux::prefix_mm(Mat< std::complex >& x) { @@ -8761,7 +8752,7 @@ //! postfix -- template -arma_inline +inline void Mat_aux::postfix_mm(Mat& x) { @@ -8786,7 +8777,7 @@ //! postfix ++ for complex numbers (work around for limitations of the std::complex class) template -arma_inline +inline void Mat_aux::postfix_mm(Mat< std::complex >& x) { diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/memory.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/memory.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/memory.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/memory.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2012-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup memory diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/mp_misc.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/mp_misc.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/mp_misc.hpp 1970-01-01 00:00:00.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/mp_misc.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -0,0 +1,73 @@ +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + + +//! \addtogroup mp_misc +//! @{ + + + + +template +struct mp_gate + { + arma_inline + static + bool + eval(const uword n_elem) + { + #if defined(ARMA_USE_OPENMP) + { + const bool length_ok = (is_cx::yes || use_smaller_thresh) ? (n_elem >= (arma_config::mp_threshold/uword(2))) : (n_elem >= arma_config::mp_threshold); + + if(length_ok) + { + if(omp_in_parallel()) { return false; } + } + + return length_ok; + } + #else + { + arma_ignore(n_elem); + + return false; + } + #endif + } + }; + + + +struct mp_thread_limit + { + arma_inline + static + int + get() + { + #if defined(ARMA_USE_OPENMP) + int n_threads = (std::min)(int(arma_config::mp_threads), int((std::max)(int(1), int(omp_get_max_threads())))); + #else + int n_threads = int(1); + #endif + + return n_threads; + } + }; + + + +//! @} diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/mtGlue_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/mtGlue_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/mtGlue_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/mtGlue_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup mtGlue diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/mtGlueCube_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/mtGlueCube_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/mtGlueCube_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/mtGlueCube_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2011 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup mtGlueCube diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/mtGlueCube_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/mtGlueCube_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/mtGlueCube_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/mtGlueCube_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2011 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup mtGlueCube diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/mtGlue_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/mtGlue_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/mtGlue_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/mtGlue_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2011 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup mtGlue diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/mtOp_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/mtOp_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/mtOp_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/mtOp_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup mtOp diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/mtOpCube_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/mtOpCube_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/mtOpCube_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/mtOpCube_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2011 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup mtOpCube @@ -13,6 +19,9 @@ +struct mtOpCube_dual_aux_indicator {}; + + template class mtOpCube : public BaseCube > { @@ -30,8 +39,10 @@ inline mtOpCube(const char junk, const T1& in_m, const out_eT in_aux); + inline mtOpCube(const mtOpCube_dual_aux_indicator&, const T1& in_m, const in_eT in_aux_a, const out_eT in_aux_b); + inline ~mtOpCube(); - + arma_aligned const T1& m; //!< storage of reference to the operand (eg. a matrix) arma_aligned in_eT aux; //!< storage of auxiliary data, using the element type as used by T1 diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/mtOpCube_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/mtOpCube_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/mtOpCube_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/mtOpCube_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2011 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup mtOpCube @@ -72,6 +78,18 @@ } + +template +inline +mtOpCube::mtOpCube(const mtOpCube_dual_aux_indicator&, const T1& in_m, const typename T1::elem_type in_aux_a, const out_eT in_aux_b) + : m (in_m ) + , aux (in_aux_a) + , aux_out_eT(in_aux_b) + { + arma_extra_debug_sigprint(); + } + + template inline diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/mtOp_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/mtOp_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/mtOp_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/mtOp_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2011 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup mtOp diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/mtSpOp_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/mtSpOp_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/mtSpOp_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/mtSpOp_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2008-2012 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup mtSpOp diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/mtSpOp_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/mtSpOp_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/mtSpOp_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/mtSpOp_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2008-2012 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup mtSpOp diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/mul_gemm.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/mul_gemm.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/mul_gemm.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/mul_gemm.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup gemm diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/mul_gemm_mixed.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/mul_gemm_mixed.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/mul_gemm_mixed.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/mul_gemm_mixed.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2011 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup gemm_mixed diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/mul_gemv.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/mul_gemv.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/mul_gemv.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/mul_gemv.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup gemv diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/mul_herk.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/mul_herk.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/mul_herk.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/mul_herk.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup herk diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/mul_syrk.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/mul_syrk.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/mul_syrk.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/mul_syrk.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup syrk diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/newarp_cx_attrib.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/newarp_cx_attrib.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/newarp_cx_attrib.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/newarp_cx_attrib.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- -// -// Written by Yixuan Qiu +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ namespace newarp diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/newarp_DenseGenMatProd_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/newarp_DenseGenMatProd_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/newarp_DenseGenMatProd_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/newarp_DenseGenMatProd_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- -// -// Written by Yixuan Qiu +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ namespace newarp diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/newarp_DenseGenMatProd_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/newarp_DenseGenMatProd_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/newarp_DenseGenMatProd_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/newarp_DenseGenMatProd_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- -// -// Written by Yixuan Qiu +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ namespace newarp diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/newarp_DoubleShiftQR_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/newarp_DoubleShiftQR_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/newarp_DoubleShiftQR_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/newarp_DoubleShiftQR_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- -// -// Written by Yixuan Qiu +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ namespace newarp diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/newarp_DoubleShiftQR_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/newarp_DoubleShiftQR_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/newarp_DoubleShiftQR_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/newarp_DoubleShiftQR_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- -// -// Written by Yixuan Qiu +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ namespace newarp diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/newarp_EigsSelect.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/newarp_EigsSelect.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/newarp_EigsSelect.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/newarp_EigsSelect.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- -// -// Written by Yixuan Qiu +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ namespace newarp diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/newarp_GenEigsSolver_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/newarp_GenEigsSolver_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/newarp_GenEigsSolver_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/newarp_GenEigsSolver_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- -// -// Written by Yixuan Qiu +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ namespace newarp diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/newarp_GenEigsSolver_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/newarp_GenEigsSolver_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/newarp_GenEigsSolver_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/newarp_GenEigsSolver_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- -// -// Written by Yixuan Qiu -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ namespace newarp @@ -114,7 +119,7 @@ for(uword i = k; i < ncv; i++) { - if(cx_attrib::is_complex(ritz_val(i), eps) && cx_attrib::is_conj(ritz_val(i), ritz_val(i + 1), eps)) + if(cx_attrib::is_complex(ritz_val(i), eT(0)) && (i < (ncv - 1)) && cx_attrib::is_conj(ritz_val(i), ritz_val(i + 1), eT(0))) { // H - mu * I = Q1 * R1 // H <- R1 * Q1 + mu * I = Q1' * H * Q1 @@ -159,13 +164,14 @@ Col v(Vs.colptr(i), dim_n, false); v = V * q; } + Vs.col(k) = fac_V * Q.col(k); fac_V.head_cols(k + 1) = Vs; Col fk = fac_f * Q(ncv - 1, k - 1) + fac_V.col(k) * fac_H(k, k - 1); factorise_from(k, ncv, fk); retrieve_ritzpair(); -} + } diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/newarp_SortEigenvalue.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/newarp_SortEigenvalue.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/newarp_SortEigenvalue.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/newarp_SortEigenvalue.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- -// -// Written by Yixuan Qiu +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ namespace newarp diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/newarp_SparseGenMatProd_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/newarp_SparseGenMatProd_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/newarp_SparseGenMatProd_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/newarp_SparseGenMatProd_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- -// -// Written by Yixuan Qiu +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ namespace newarp diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/newarp_SparseGenMatProd_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/newarp_SparseGenMatProd_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/newarp_SparseGenMatProd_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/newarp_SparseGenMatProd_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- -// -// Written by Yixuan Qiu +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ namespace newarp diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/newarp_SymEigsSolver_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/newarp_SymEigsSolver_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/newarp_SymEigsSolver_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/newarp_SymEigsSolver_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- -// -// Written by Yixuan Qiu +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ namespace newarp diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/newarp_SymEigsSolver_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/newarp_SymEigsSolver_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/newarp_SymEigsSolver_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/newarp_SymEigsSolver_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- -// -// Written by Yixuan Qiu -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ namespace newarp diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/newarp_TridiagEigen_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/newarp_TridiagEigen_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/newarp_TridiagEigen_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/newarp_TridiagEigen_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- -// -// Written by Yixuan Qiu +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ namespace newarp diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/newarp_TridiagEigen_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/newarp_TridiagEigen_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/newarp_TridiagEigen_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/newarp_TridiagEigen_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- -// -// Written by Yixuan Qiu -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ namespace newarp diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/newarp_UpperHessenbergEigen_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/newarp_UpperHessenbergEigen_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/newarp_UpperHessenbergEigen_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/newarp_UpperHessenbergEigen_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- -// -// Written by Yixuan Qiu +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ namespace newarp diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/newarp_UpperHessenbergEigen_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/newarp_UpperHessenbergEigen_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/newarp_UpperHessenbergEigen_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/newarp_UpperHessenbergEigen_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- -// -// Written by Yixuan Qiu -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ namespace newarp @@ -116,24 +121,21 @@ arma_debug_check( (computed == false), "newarp::UpperHessenbergEigen::eigenvectors(): need to call compute() first" ); - // in fact Lapack will set the imaginary parts of real eigenvalues to be exact zero - // here we just use a small value - eT prec = std::numeric_limits::epsilon(); - + // Lapack will set the imaginary parts of real eigenvalues to be exact zero Mat< std::complex > evecs(n, n); std::complex* col_ptr = evecs.memptr(); for(blas_int i = 0; i < n; i++) { - if(cx_attrib::is_real(evals(i), prec)) + if(cx_attrib::is_real(evals(i), eT(0))) { // for real eigenvector, normalise and copy eT z_norm = norm(mat_Z.col(i)); for(blas_int j = 0; j < n; j++) { - col_ptr[j] = std::complex(mat_Z(j, i) / z_norm, 0); + col_ptr[j] = std::complex(mat_Z(j, i) / z_norm, eT(0)); } col_ptr += n; diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/newarp_UpperHessenbergQR_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/newarp_UpperHessenbergQR_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/newarp_UpperHessenbergQR_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/newarp_UpperHessenbergQR_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- -// -// Written by Yixuan Qiu +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ namespace newarp diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/newarp_UpperHessenbergQR_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/newarp_UpperHessenbergQR_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/newarp_UpperHessenbergQR_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/newarp_UpperHessenbergQR_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- -// -// Written by Yixuan Qiu +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ namespace newarp diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_all_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_all_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_all_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_all_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_all_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_all_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_all_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_all_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_any_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_any_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_any_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_any_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_any_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_any_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_any_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_any_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/Op_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/Op_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/Op_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/Op_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup Op diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_chol_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_chol_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_chol_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_chol_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2010 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_chol diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_chol_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_chol_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_chol_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_chol_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2014 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_chol diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_clamp_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_clamp_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_clamp_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_clamp_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2014 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ @@ -18,9 +24,18 @@ { public: + // matrices + template inline static void apply(Mat& out, const mtOp& in); template inline static void apply_noalias(Mat& out, const Proxy& P, const typename T1::elem_type min_val, const typename T1::elem_type max_val); + + + // cubes + + template inline static void apply(Cube& out, const mtOpCube& in); + + template inline static void apply_noalias(Cube& out, const ProxyCube& P, const typename T1::elem_type min_val, const typename T1::elem_type max_val); }; diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_clamp_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_clamp_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_clamp_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_clamp_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2014-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ @@ -96,6 +102,97 @@ val = (val < min_val) ? min_val : ((val > max_val) ? max_val : val); + (*out_mem) = val; out_mem++; + } + } + } + + + +template +inline +void +op_clamp::apply(Cube& out, const mtOpCube& in) + { + arma_extra_debug_sigprint(); + + typedef typename T1::elem_type eT; + + const ProxyCube P(in.m); + + if(P.is_alias(out) && (is_Cube::value == false)) + { + Cube tmp; + + op_clamp::apply_noalias(tmp, P, in.aux, in.aux_out_eT); + + out.steal_mem(tmp); + } + else + { + op_clamp::apply_noalias(out, P, in.aux, in.aux_out_eT); + } + } + + + +template +inline +void +op_clamp::apply_noalias(Cube& out, const ProxyCube& P, const typename T1::elem_type min_val, const typename T1::elem_type max_val) + { + arma_extra_debug_sigprint(); + + typedef typename T1::elem_type eT; + + const uword n_rows = P.get_n_rows(); + const uword n_cols = P.get_n_cols(); + const uword n_slices = P.get_n_slices(); + + out.set_size(n_rows, n_cols, n_slices); + + eT* out_mem = out.memptr(); + + if(ProxyCube::use_at == false) + { + const uword N = P.get_n_elem(); + + typename ProxyCube::ea_type A = P.get_ea(); + + uword j; + for(j=1; j max_val) ? max_val : val_i); + val_j = (val_j < min_val) ? min_val : ((val_j > max_val) ? max_val : val_j); + + (*out_mem) = val_i; out_mem++; + (*out_mem) = val_j; out_mem++; + } + + const uword i = j-1; + + if(i < N) + { + eT val_i = A[i]; + + val_i = (val_i < min_val) ? min_val : ((val_i > max_val) ? max_val : val_i); + + (*out_mem) = val_i; + } + } + else + { + for(uword k=0; k < n_slices; ++k) + for(uword j=0; j < n_cols; ++j) + for(uword i=0; i < n_rows; ++i) + { + eT val = P.at(i,j,k); + + val = (val < min_val) ? min_val : ((val > max_val) ? max_val : val); + (*out_mem) = val; out_mem++; } } diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_cor_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_cor_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_cor_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_cor_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2009-2010 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Dimitrios Bouzas +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_cor_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_cor_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_cor_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_cor_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2009-2011 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Dimitrios Bouzas +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_cov_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_cov_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_cov_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_cov_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2009-2010 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Dimitrios Bouzas +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_cov_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_cov_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_cov_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_cov_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2009-2011 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Dimitrios Bouzas +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/OpCube_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/OpCube_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/OpCube_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/OpCube_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2011 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup OpCube diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/OpCube_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/OpCube_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/OpCube_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/OpCube_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2011 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup OpCube diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_cumprod_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_cumprod_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_cumprod_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_cumprod_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_cumprod diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_cumprod_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_cumprod_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_cumprod_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_cumprod_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_cumprod diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_cumsum_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_cumsum_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_cumsum_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_cumsum_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_cumsum diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_cumsum_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_cumsum_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_cumsum_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_cumsum_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_cumsum diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_cx_scalar_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_cx_scalar_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_cx_scalar_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_cx_scalar_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2010 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_cx_scalar diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_cx_scalar_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_cx_scalar_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_cx_scalar_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_cx_scalar_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_cx_scalar diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_diagmat_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_diagmat_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_diagmat_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_diagmat_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_diagmat diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_diagmat_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_diagmat_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_diagmat_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_diagmat_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_diagmat diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_diagvec_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_diagvec_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_diagvec_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_diagvec_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2012 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_diagvec diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_diagvec_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_diagvec_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_diagvec_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_diagvec_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2012 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_diagvec diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_diff_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_diff_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_diff_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_diff_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_diff diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_diff_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_diff_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_diff_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_diff_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_diff diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_dot_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_dot_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_dot_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_dot_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2014 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_dot diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_dotext_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_dotext_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_dotext_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_dotext_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2010 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_dotext diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_dotext_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_dotext_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_dotext_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_dotext_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2010 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_dotext diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_dot_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_dot_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_dot_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_dot_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_dot diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/operator_cube_div.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/operator_cube_div.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/operator_cube_div.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/operator_cube_div.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup operator_cube_div diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/operator_cube_minus.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/operator_cube_minus.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/operator_cube_minus.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/operator_cube_minus.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup operator_cube_minus @@ -28,22 +34,6 @@ } - -//! cancellation of two consecutive negations: -(-T1) -template -arma_inline -const typename ProxyCube::stored_type& -operator- - ( - const eOpCube& X - ) - { - arma_extra_debug_sigprint(); - - return X.P.Q; - } - - //! BaseCube - scalar template diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/operator_cube_plus.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/operator_cube_plus.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/operator_cube_plus.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/operator_cube_plus.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup operator_cube_plus diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/operator_cube_relational.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/operator_cube_relational.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/operator_cube_relational.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/operator_cube_relational.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2014 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup operator_cube_relational diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/operator_cube_schur.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/operator_cube_schur.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/operator_cube_schur.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/operator_cube_schur.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2010 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup operator_cube_schur diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/operator_cube_times.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/operator_cube_times.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/operator_cube_times.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/operator_cube_times.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup operator_cube_times diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/operator_div.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/operator_div.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/operator_div.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/operator_div.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2009-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup operator_div diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/operator_minus.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/operator_minus.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/operator_minus.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/operator_minus.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2008-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup operator_minus @@ -28,20 +33,6 @@ } - -//! cancellation of two consecutive negations: -(-T1) -template -arma_inline -const typename Proxy::stored_type& -operator- -(const eOp& X) - { - arma_extra_debug_sigprint(); - - return X.P.Q; - } - - //! Base - scalar template diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/operator_ostream.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/operator_ostream.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/operator_ostream.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/operator_ostream.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2014 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup operator_ostream diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/operator_plus.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/operator_plus.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/operator_plus.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/operator_plus.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2008-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup operator_plus diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/operator_relational.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/operator_relational.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/operator_relational.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/operator_relational.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2014 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup operator_relational diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/operator_schur.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/operator_schur.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/operator_schur.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/operator_schur.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2008-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup operator_schur diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/operator_times.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/operator_times.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/operator_times.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/operator_times.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2008-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup operator_times diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_expmat_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_expmat_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_expmat_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_expmat_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2014-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_expmat_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_expmat_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_expmat_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_expmat_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2014-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_fft_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_fft_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_fft_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_fft_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_fft_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_fft_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_fft_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_fft_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_find_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_find_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_find_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_find_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2010-2014 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Dimitrios Bouzas +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_find_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_find_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_find_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_find_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2010-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Dimitrios Bouzas +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_find_unique_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_find_unique_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_find_unique_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_find_unique_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_find_unique diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_find_unique_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_find_unique_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_find_unique_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_find_unique_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_find_unique diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_flip_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_flip_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_flip_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_flip_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_flip diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_flip_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_flip_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_flip_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_flip_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_flip diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_hist_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_hist_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_hist_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_hist_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2012-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_hist_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_hist_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_hist_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_hist_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2012-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_htrans_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_htrans_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_htrans_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_htrans_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2013 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_htrans diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_htrans_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_htrans_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_htrans_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_htrans_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_htrans diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_index_max_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_index_max_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_index_max_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_index_max_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_index_max diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_index_max_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_index_max_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_index_max_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_index_max_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_index_max diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_index_min_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_index_min_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_index_min_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_index_min_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_index_min diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_index_min_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_index_min_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_index_min_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_index_min_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_index_min diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_inv_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_inv_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_inv_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_inv_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_inv diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_inv_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_inv_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_inv_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_inv_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_inv diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_logmat_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_logmat_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_logmat_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_logmat_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_logmat diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_logmat_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_logmat_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_logmat_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_logmat_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_logmat diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_max_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_max_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_max_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_max_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_max diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_max_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_max_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_max_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_max_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_max diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_mean_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_mean_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_mean_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_mean_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_mean diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_mean_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_mean_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_mean_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_mean_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_mean diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/Op_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/Op_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/Op_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/Op_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2011 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup Op diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_median_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_median_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_median_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_median_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2012 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_median diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_median_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_median_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_median_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_median_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_median diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_min_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_min_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_min_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_min_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_min diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_min_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_min_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_min_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_min_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_min diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_misc_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_misc_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_misc_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_misc_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_misc diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_misc_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_misc_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_misc_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_misc_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_misc diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_nonzeros_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_nonzeros_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_nonzeros_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_nonzeros_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_nonzeros_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_nonzeros_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_nonzeros_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_nonzeros_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_normalise_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_normalise_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_normalise_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_normalise_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2014-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_normalise_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_normalise_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_normalise_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_normalise_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2014-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_norm_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_norm_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_norm_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_norm_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_norm diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_norm_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_norm_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_norm_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_norm_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_norm diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_orth_null_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_orth_null_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_orth_null_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_orth_null_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_orth_null_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_orth_null_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_orth_null_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_orth_null_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_pinv_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_pinv_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_pinv_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_pinv_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2009-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Dimitrios Bouzas +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_pinv_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_pinv_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_pinv_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_pinv_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,13 +1,17 @@ -// Copyright (C) 2009-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Dimitrios Bouzas -// Written by Stanislav Funiak +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_princomp_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_princomp_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_princomp_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_princomp_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2010-2012 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Dimitrios Bouzas +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_princomp diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_princomp_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_princomp_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_princomp_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_princomp_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,13 +1,17 @@ -// Copyright (C) 2010-2013 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Dimitrios Bouzas -// Written by Stanislav Funiak +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_princomp diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_prod_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_prod_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_prod_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_prod_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_prod diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_prod_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_prod_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_prod_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_prod_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_prod diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_range_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_range_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_range_bones.hpp 1970-01-01 00:00:00.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_range_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -0,0 +1,37 @@ +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + + +//! \addtogroup op_range +//! @{ + + +class op_range + { + public: + + template + inline static void apply(Mat& out, const Op& in); + + template + inline static void apply_noalias(Mat& out, const Mat& X, const uword dim); + + template + inline static typename T1::elem_type vector_range(const T1& expr); + }; + + + +//! @} diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_range_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_range_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_range_meat.hpp 1970-01-01 00:00:00.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_range_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -0,0 +1,94 @@ +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + + +//! \addtogroup op_range +//! @{ + + + +template +inline +void +op_range::apply(Mat& out, const Op& in) + { + arma_extra_debug_sigprint(); + + typedef typename T1::elem_type eT; + + const uword dim = in.aux_uword_a; + arma_debug_check( (dim > 1), "range(): parameter 'dim' must be 0 or 1"); + + const quasi_unwrap U(in.m); + const Mat& X = U.M; + + if(U.is_alias(out) == false) + { + op_range::apply_noalias(out, X, dim); + } + else + { + Mat tmp; + + op_range::apply_noalias(tmp, X, dim); + + out.steal_mem(tmp); + } + } + + + +template +inline +void +op_range::apply_noalias(Mat& out, const Mat& X, const uword dim) + { + arma_extra_debug_sigprint(); + + // TODO: replace with dedicated implementation which finds min and max at the same time + out = max(X,dim) - min(X,dim); + } + + + +template +inline +typename T1::elem_type +op_range::vector_range(const T1& expr) + { + arma_extra_debug_sigprint(); + + typedef typename T1::elem_type eT; + + const quasi_unwrap U(expr); + const Mat& X = U.M; + + const eT* X_mem = X.memptr(); + const uword N = X.n_elem; + + if(N == 0) + { + arma_debug_check(true, "range(): object has no elements"); + + return Datum::nan; + } + + // TODO: replace with dedicated implementation which finds min and max at the same time + return op_max::direct_max(X_mem, N) - op_min::direct_min(X_mem, N); + } + + + +//! @} diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_relational_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_relational_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_relational_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_relational_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2010 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_relational diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_relational_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_relational_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_relational_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_relational_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_relational diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_repmat_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_repmat_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_repmat_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_repmat_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2009-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Dimitrios Bouzas +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_repmat_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_repmat_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_repmat_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_repmat_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2009-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Dimitrios Bouzas +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_reshape_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_reshape_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_reshape_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_reshape_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2014 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_reshape_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_reshape_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_reshape_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_reshape_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_resize_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_resize_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_resize_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_resize_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2011 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_resize_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_resize_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_resize_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_resize_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2011-2013 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_shift_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_shift_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_shift_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_shift_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_shift_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_shift_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_shift_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_shift_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_shuffle_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_shuffle_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_shuffle_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_shuffle_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2009-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Dimitrios Bouzas +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_shuffle_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_shuffle_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_shuffle_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_shuffle_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2009-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Dimitrios Bouzas +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_sort_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_sort_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_sort_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_sort_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_sort diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_sort_index_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_sort_index_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_sort_index_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_sort_index_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_sort_index diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_sort_index_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_sort_index_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_sort_index_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_sort_index_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_sort_index diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_sort_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_sort_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_sort_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_sort_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_sort diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_sqrtmat_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_sqrtmat_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_sqrtmat_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_sqrtmat_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_sqrtmat diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_sqrtmat_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_sqrtmat_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_sqrtmat_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_sqrtmat_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_sqrtmat diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_stddev_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_stddev_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_stddev_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_stddev_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2011 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_stddev diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_stddev_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_stddev_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_stddev_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_stddev_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_stddev diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_strans_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_strans_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_strans_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_strans_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_strans diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_strans_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_strans_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_strans_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_strans_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_strans diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_sum_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_sum_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_sum_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_sum_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_sum @@ -30,6 +36,9 @@ template arma_hot inline static void apply_noalias_proxy(Mat& out, const Proxy& P, const uword dim); + template + arma_hot inline static void apply_noalias_proxy_mp(Mat& out, const Proxy& P, const uword dim); + // cubes @@ -44,6 +53,9 @@ template arma_hot inline static void apply_noalias_proxy(Cube& out, const ProxyCube& P, const uword dim); + + template + arma_hot inline static void apply_noalias_proxy_mp(Cube& out, const ProxyCube& P, const uword dim); }; diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_sum_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_sum_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_sum_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_sum_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_sum @@ -119,6 +125,13 @@ typedef typename T1::elem_type eT; + if( arma_config::openmp && Proxy::use_mp && mp_gate::eval(P.get_n_elem()) ) + { + op_sum::apply_noalias_proxy_mp(out, P, dim); + + return; + } + const uword P_n_rows = P.get_n_rows(); const uword P_n_cols = P.get_n_cols(); @@ -164,6 +177,74 @@ +template +arma_hot +inline +void +op_sum::apply_noalias_proxy_mp(Mat& out, const Proxy& P, const uword dim) + { + arma_extra_debug_sigprint(); + + #if defined(ARMA_USE_OPENMP) + { + typedef typename T1::elem_type eT; + + const uword P_n_rows = P.get_n_rows(); + const uword P_n_cols = P.get_n_cols(); + + const int n_threads = mp_thread_limit::get(); + + if(dim == 0) + { + out.set_size(1, P_n_cols); + + eT* out_mem = out.memptr(); + + #pragma omp parallel for schedule(static) num_threads(n_threads) + for(uword col=0; col < P_n_cols; ++col) + { + eT val1 = eT(0); + eT val2 = eT(0); + + uword i,j; + for(i=0, j=1; j < P_n_rows; i+=2, j+=2) + { + val1 += P.at(i,col); + val2 += P.at(j,col); + } + + if(i < P_n_rows) + { + val1 += P.at(i,col); + } + + out_mem[col] = (val1 + val2); + } + } + else + { + out.set_size(P_n_rows, 1); + + eT* out_mem = out.memptr(); + + #pragma omp parallel for schedule(static) num_threads(n_threads) + for(uword row=0; row < P_n_rows; ++row) + { + eT acc = eT(0); + for(uword col=0; col < P_n_cols; ++col) + { + acc += P.at(row,col); + } + + out_mem[row] = acc; + } + } + } + #endif + } + + + // // cubes @@ -295,6 +376,13 @@ typedef typename T1::elem_type eT; + if( arma_config::openmp && ProxyCube::use_mp && mp_gate::eval(P.get_n_elem()) ) + { + op_sum::apply_noalias_proxy_mp(out, P, dim); + + return; + } + const uword P_n_rows = P.get_n_rows(); const uword P_n_cols = P.get_n_cols(); const uword P_n_slices = P.get_n_slices(); @@ -365,5 +453,116 @@ } + +template +arma_hot +inline +void +op_sum::apply_noalias_proxy_mp(Cube& out, const ProxyCube& P, const uword dim) + { + arma_extra_debug_sigprint(); + + #if defined(ARMA_USE_OPENMP) + { + typedef typename T1::elem_type eT; + + const uword P_n_rows = P.get_n_rows(); + const uword P_n_cols = P.get_n_cols(); + const uword P_n_slices = P.get_n_slices(); + + const int n_threads = mp_thread_limit::get(); + + if(dim == 0) + { + out.set_size(1, P_n_cols, P_n_slices); + + #pragma omp parallel for schedule(static) num_threads(n_threads) + for(uword slice=0; slice < P_n_slices; ++slice) + { + eT* out_mem = out.slice_memptr(slice); + + for(uword col=0; col < P_n_cols; ++col) + { + eT val1 = eT(0); + eT val2 = eT(0); + + uword i,j; + for(i=0, j=1; j < P_n_rows; i+=2, j+=2) + { + val1 += P.at(i,col,slice); + val2 += P.at(j,col,slice); + } + + if(i < P_n_rows) + { + val1 += P.at(i,col,slice); + } + + out_mem[col] = (val1 + val2); + } + } + } + else + if(dim == 1) + { + out.zeros(P_n_rows, 1, P_n_slices); + + #pragma omp parallel for schedule(static) num_threads(n_threads) + for(uword slice=0; slice < P_n_slices; ++slice) + { + eT* out_mem = out.slice_memptr(slice); + + for(uword col=0; col < P_n_cols; ++col) + for(uword row=0; row < P_n_rows; ++row) + { + out_mem[row] += P.at(row,col,slice); + } + } + } + else + if(dim == 2) + { + out.zeros(P_n_rows, P_n_cols, 1); + + if(P_n_cols >= P_n_rows) + { + #pragma omp parallel for schedule(static) num_threads(n_threads) + for(uword col=0; col < P_n_cols; ++col) + { + for(uword row=0; row < P_n_rows; ++row) + { + eT acc = eT(0); + for(uword slice=0; slice < P_n_slices; ++slice) + { + acc += P.at(row,col,slice); + } + + out.at(row,col,0) = acc; + } + } + } + else + { + #pragma omp parallel for schedule(static) num_threads(n_threads) + for(uword row=0; row < P_n_rows; ++row) + { + for(uword col=0; col < P_n_cols; ++col) + { + eT acc = eT(0); + for(uword slice=0; slice < P_n_slices; ++slice) + { + acc += P.at(row,col,slice); + } + + out.at(row,col,0) = acc; + } + } + } + } + } + #endif + } + + //! @} diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_symmat_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_symmat_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_symmat_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_symmat_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2011-2014 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_symmat diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_symmat_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_symmat_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_symmat_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_symmat_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2011-2014 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_symmat diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_toeplitz_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_toeplitz_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_toeplitz_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_toeplitz_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_toeplitz diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_toeplitz_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_toeplitz_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_toeplitz_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_toeplitz_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_toeplitz diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_trimat_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_trimat_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_trimat_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_trimat_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2010-2012 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_trimat @@ -39,5 +44,31 @@ }; + +class op_trimatu_ext + { + public: + + template + inline static void apply(Mat& out, const Op& in); + + template + inline static void fill_zeros(Mat& A, const uword row_offset, const uword col_offset); + }; + + + +class op_trimatl_ext + { + public: + + template + inline static void apply(Mat& out, const Op& in); + + template + inline static void fill_zeros(Mat& A, const uword row_offset, const uword col_offset); + }; + + //! @} diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_trimat_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_trimat_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_trimat_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_trimat_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2010-2012 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_trimat @@ -241,5 +246,187 @@ } + +// + + + +template +inline +void +op_trimatu_ext::apply(Mat& out, const Op& in) + { + arma_extra_debug_sigprint(); + + typedef typename T1::elem_type eT; + + const unwrap tmp(in.m); + const Mat& A = tmp.M; + + arma_debug_check( (A.is_square() == false), "trimatu(): given matrix must be square sized" ); + + const uword row_offset = in.aux_uword_a; + const uword col_offset = in.aux_uword_b; + + const uword n_rows = A.n_rows; + const uword n_cols = A.n_cols; + + arma_debug_check( ((row_offset > 0) && (row_offset >= n_rows)) || ((col_offset > 0) && (col_offset >= n_cols)), "trimatu(): requested diagonal is out of bounds" ); + + if(&out != &A) + { + out.copy_size(A); + + const uword N = (std::min)(n_rows - row_offset, n_cols - col_offset); + + for(uword i=0; i < n_cols; ++i) + { + const uword col = i + col_offset; + + if(i < N) + { + const uword end_row = i + row_offset; + + for(uword row=0; row <= end_row; ++row) + { + out.at(row,col) = A.at(row,col); + } + } + else + { + if(col < n_cols) + { + arrayops::copy(out.colptr(col), A.colptr(col), n_rows); + } + } + } + } + + op_trimatu_ext::fill_zeros(out, row_offset, col_offset); + } + + + +template +inline +void +op_trimatu_ext::fill_zeros(Mat& out, const uword row_offset, const uword col_offset) + { + arma_extra_debug_sigprint(); + + const uword n_rows = out.n_rows; + const uword n_cols = out.n_cols; + + const uword N = (std::min)(n_rows - row_offset, n_cols - col_offset); + + for(uword col=0; col < col_offset; ++col) + { + arrayops::fill_zeros(out.colptr(col), n_rows); + } + + for(uword i=0; i < N; ++i) + { + const uword start_row = i + row_offset + 1; + const uword col = i + col_offset; + + for(uword row=start_row; row < n_rows; ++row) + { + out.at(row,col) = eT(0); + } + } + } + + + +// + + + +template +inline +void +op_trimatl_ext::apply(Mat& out, const Op& in) + { + arma_extra_debug_sigprint(); + + typedef typename T1::elem_type eT; + + const unwrap tmp(in.m); + const Mat& A = tmp.M; + + arma_debug_check( (A.is_square() == false), "trimatl(): given matrix must be square sized" ); + + const uword row_offset = in.aux_uword_a; + const uword col_offset = in.aux_uword_b; + + const uword n_rows = A.n_rows; + const uword n_cols = A.n_cols; + + arma_debug_check( ((row_offset > 0) && (row_offset >= n_rows)) || ((col_offset > 0) && (col_offset >= n_cols)), "trimatl(): requested diagonal is out of bounds" ); + + if(&out != &A) + { + out.copy_size(A); + + const uword N = (std::min)(n_rows - row_offset, n_cols - col_offset); + + for(uword col=0; col < col_offset; ++col) + { + arrayops::copy( out.colptr(col), A.colptr(col), n_rows ); + } + + for(uword i=0; i +inline +void +op_trimatl_ext::fill_zeros(Mat& out, const uword row_offset, const uword col_offset) + { + arma_extra_debug_sigprint(); + + const uword n_rows = out.n_rows; + const uword n_cols = out.n_cols; + + const uword N = (std::min)(n_rows - row_offset, n_cols - col_offset); + + for(uword i=0; i < n_cols; ++i) + { + const uword col = i + col_offset; + + if(i < N) + { + const uword end_row = i + row_offset; + + for(uword row=0; row < end_row; ++row) + { + out.at(row,col) = eT(0); + } + } + else + { + if(col < n_cols) + { + arrayops::fill_zeros(out.colptr(col), n_rows); + } + } + } + } + + //! @} diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_unique_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_unique_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_unique_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_unique_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2012-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Arnold Wiliem +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_unique_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_unique_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_unique_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_unique_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2012-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Arnold Wiliem +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_var_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_var_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_var_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_var_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2012 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_var diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_var_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_var_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_var_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_var_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup op_var diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_vectorise_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_vectorise_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_vectorise_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_vectorise_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/op_vectorise_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/op_vectorise_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/op_vectorise_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/op_vectorise_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/podarray_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/podarray_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/podarray_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/podarray_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2012 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup podarray diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/podarray_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/podarray_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/podarray_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/podarray_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup podarray diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/promote_type.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/promote_type.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/promote_type.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/promote_type.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2013 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup promote_type @@ -184,6 +190,7 @@ #if defined(ARMA_USE_U64S64) template<> struct is_promotable : public is_promotable_ok { typedef s64 result; }; // float ? +template<> struct is_promotable : public is_promotable_ok { typedef s64 result; }; template<> struct is_promotable : public is_promotable_ok { typedef s64 result; }; template<> struct is_promotable : public is_promotable_ok { typedef s64 result; }; template<> struct is_promotable : public is_promotable_ok { typedef s64 result; }; diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/ProxyCube.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/ProxyCube.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/ProxyCube.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/ProxyCube.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup ProxyCube @@ -40,6 +46,7 @@ typedef const Cube& aligned_ea_type; static const bool use_at = false; + static const bool use_mp = false; static const bool has_subview = false; arma_aligned const Cube& Q; @@ -72,7 +79,7 @@ template -class ProxyCube< GenCube > +class ProxyCube< GenCube > { public: @@ -83,6 +90,7 @@ typedef const GenCube& aligned_ea_type; static const bool use_at = false; + static const bool use_mp = false; static const bool has_subview = false; arma_aligned const GenCube& Q; @@ -114,6 +122,94 @@ +template +class ProxyCube< GenCube > + { + public: + + typedef eT elem_type; + typedef typename get_pod_type::result pod_type; + typedef Cube stored_type; + typedef const eT* ea_type; + typedef const Cube& aligned_ea_type; + + static const bool use_at = false; + static const bool use_mp = false; + static const bool has_subview = false; + + arma_aligned const Cube Q; + + inline explicit ProxyCube(const GenCube& A) + : Q(A) + { + arma_extra_debug_sigprint(); + } + + arma_inline uword get_n_rows() const { return Q.n_rows; } + arma_inline uword get_n_cols() const { return Q.n_cols; } + arma_inline uword get_n_elem_slice() const { return Q.n_elem_slice; } + arma_inline uword get_n_slices() const { return Q.n_slices; } + arma_inline uword get_n_elem() const { return Q.n_elem; } + + arma_inline elem_type operator[] (const uword i) const { return Q[i]; } + arma_inline elem_type at (const uword row, const uword col, const uword slice) const { return Q.at(row, col, slice); } + arma_inline elem_type at_alt (const uword i) const { return Q.at_alt(i); } + + arma_inline ea_type get_ea() const { return Q.memptr(); } + arma_inline aligned_ea_type get_aligned_ea() const { return Q; } + + template + arma_inline bool is_alias(const Cube&) const { return false; } + + arma_inline bool is_aligned() const { return memory::is_aligned(Q.memptr()); } + }; + + + +template +class ProxyCube< GenCube > + { + public: + + typedef eT elem_type; + typedef typename get_pod_type::result pod_type; + typedef Cube stored_type; + typedef const eT* ea_type; + typedef const Cube& aligned_ea_type; + + static const bool use_at = false; + static const bool use_mp = false; + static const bool has_subview = false; + + arma_aligned const Cube Q; + + inline explicit ProxyCube(const GenCube& A) + : Q(A) + { + arma_extra_debug_sigprint(); + } + + arma_inline uword get_n_rows() const { return Q.n_rows; } + arma_inline uword get_n_cols() const { return Q.n_cols; } + arma_inline uword get_n_elem_slice() const { return Q.n_elem_slice; } + arma_inline uword get_n_slices() const { return Q.n_slices; } + arma_inline uword get_n_elem() const { return Q.n_elem; } + + arma_inline elem_type operator[] (const uword i) const { return Q[i]; } + arma_inline elem_type at (const uword row, const uword col, const uword slice) const { return Q.at(row, col, slice); } + arma_inline elem_type at_alt (const uword i) const { return Q.at_alt(i); } + + arma_inline ea_type get_ea() const { return Q.memptr(); } + arma_inline aligned_ea_type get_aligned_ea() const { return Q; } + + template + arma_inline bool is_alias(const Cube&) const { return false; } + + arma_inline bool is_aligned() const { return memory::is_aligned(Q.memptr()); } + }; + + + template class ProxyCube< OpCube > { @@ -126,6 +222,7 @@ typedef const Cube& aligned_ea_type; static const bool use_at = false; + static const bool use_mp = false; static const bool has_subview = false; arma_aligned const Cube Q; @@ -169,6 +266,7 @@ typedef const Cube& aligned_ea_type; static const bool use_at = false; + static const bool use_mp = false; static const bool has_subview = false; arma_aligned const Cube Q; @@ -212,6 +310,7 @@ typedef const subview_cube& aligned_ea_type; static const bool use_at = true; + static const bool use_mp = false; static const bool has_subview = true; arma_aligned const subview_cube& Q; @@ -255,6 +354,7 @@ typedef const eOpCube& aligned_ea_type; static const bool use_at = eOpCube::use_at; + static const bool use_mp = eOpCube::use_mp; static const bool has_subview = eOpCube::has_subview; arma_aligned const eOpCube& Q; @@ -298,6 +398,7 @@ typedef const eGlueCube& aligned_ea_type; static const bool use_at = eGlueCube::use_at; + static const bool use_mp = eGlueCube::use_mp; static const bool has_subview = eGlueCube::has_subview; arma_aligned const eGlueCube& Q; @@ -341,6 +442,7 @@ typedef const Cube& aligned_ea_type; static const bool use_at = false; + static const bool use_mp = false; static const bool has_subview = false; arma_aligned const Cube Q; @@ -384,6 +486,7 @@ typedef const Cube& aligned_ea_type; static const bool use_at = false; + static const bool use_mp = false; static const bool has_subview = false; arma_aligned const Cube Q; diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/Proxy.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/Proxy.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/Proxy.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/Proxy.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup Proxy @@ -38,6 +44,7 @@ typedef const T1& aligned_ea_type; static const bool use_at = false; + static const bool use_mp = false; static const bool has_subview = false; static const bool fake_mat = false; @@ -113,6 +120,7 @@ typedef const Mat& aligned_ea_type; static const bool use_at = false; + static const bool use_mp = false; static const bool has_subview = false; static const bool fake_mat = false; @@ -158,6 +166,7 @@ typedef const Col& aligned_ea_type; static const bool use_at = false; + static const bool use_mp = false; static const bool has_subview = false; static const bool fake_mat = false; @@ -203,6 +212,7 @@ typedef const Row& aligned_ea_type; static const bool use_at = false; + static const bool use_mp = false; static const bool has_subview = false; static const bool fake_mat = false; @@ -237,7 +247,7 @@ template -class Proxy< Gen > +class Proxy< Gen > { public: @@ -248,6 +258,7 @@ typedef const Gen& aligned_ea_type; static const bool use_at = Gen::use_at; + static const bool use_mp = false; static const bool has_subview = false; static const bool fake_mat = false; @@ -281,8 +292,100 @@ +template +class Proxy< Gen > + { + public: + + typedef typename T1::elem_type elem_type; + typedef typename get_pod_type::result pod_type; + typedef Mat stored_type; + typedef const elem_type* ea_type; + typedef const Mat& aligned_ea_type; + + static const bool use_at = false; + static const bool use_mp = false; + static const bool has_subview = false; + static const bool fake_mat = false; + + static const bool is_row = Gen::is_row; + static const bool is_col = Gen::is_col; + + arma_aligned const Mat Q; + + inline explicit Proxy(const Gen& A) + : Q(A) + { + arma_extra_debug_sigprint(); + } + + arma_inline uword get_n_rows() const { return (is_row ? 1 : Q.n_rows); } + arma_inline uword get_n_cols() const { return (is_col ? 1 : Q.n_cols); } + arma_inline uword get_n_elem() const { return (is_row ? 1 : Q.n_rows) * (is_col ? 1 : Q.n_cols); } + + arma_inline elem_type operator[] (const uword i) const { return Q[i]; } + arma_inline elem_type at (const uword row, const uword col) const { return Q.at(row, col); } + arma_inline elem_type at_alt (const uword i) const { return Q.at_alt(i); } + + arma_inline ea_type get_ea() const { return Q.memptr(); } + arma_inline aligned_ea_type get_aligned_ea() const { return Q; } + + template + arma_inline bool is_alias(const Mat&) const { return false; } + + arma_inline bool is_aligned() const { return memory::is_aligned(Q.memptr()); } + }; + + + +template +class Proxy< Gen > + { + public: + + typedef typename T1::elem_type elem_type; + typedef typename get_pod_type::result pod_type; + typedef Mat stored_type; + typedef const elem_type* ea_type; + typedef const Mat& aligned_ea_type; + + static const bool use_at = false; + static const bool use_mp = false; + static const bool has_subview = false; + static const bool fake_mat = false; + + static const bool is_row = Gen::is_row; + static const bool is_col = Gen::is_col; + + arma_aligned const Mat Q; + + inline explicit Proxy(const Gen& A) + : Q(A) + { + arma_extra_debug_sigprint(); + } + + arma_inline uword get_n_rows() const { return (is_row ? 1 : Q.n_rows); } + arma_inline uword get_n_cols() const { return (is_col ? 1 : Q.n_cols); } + arma_inline uword get_n_elem() const { return (is_row ? 1 : Q.n_rows) * (is_col ? 1 : Q.n_cols); } + + arma_inline elem_type operator[] (const uword i) const { return Q[i]; } + arma_inline elem_type at (const uword row, const uword col) const { return Q.at(row, col); } + arma_inline elem_type at_alt (const uword i) const { return Q.at_alt(i); } + + arma_inline ea_type get_ea() const { return Q.memptr(); } + arma_inline aligned_ea_type get_aligned_ea() const { return Q; } + + template + arma_inline bool is_alias(const Mat&) const { return false; } + + arma_inline bool is_aligned() const { return memory::is_aligned(Q.memptr()); } + }; + + + template -class Proxy< eOp > +class Proxy< eOp > { public: @@ -293,6 +396,7 @@ typedef const eOp& aligned_ea_type; static const bool use_at = eOp::use_at; + static const bool use_mp = eOp::use_mp; static const bool has_subview = eOp::has_subview; static const bool fake_mat = eOp::fake_mat; @@ -327,7 +431,7 @@ template -class Proxy< eGlue > +class Proxy< eGlue > { public: @@ -338,6 +442,7 @@ typedef const eGlue& aligned_ea_type; static const bool use_at = eGlue::use_at; + static const bool use_mp = eGlue::use_mp; static const bool has_subview = eGlue::has_subview; static const bool fake_mat = eGlue::fake_mat; @@ -383,6 +488,7 @@ typedef const Mat& aligned_ea_type; static const bool use_at = false; + static const bool use_mp = false; static const bool has_subview = false; static const bool fake_mat = false; @@ -429,6 +535,7 @@ static const bool use_at = false; static const bool has_subview = false; + static const bool use_mp = false; static const bool fake_mat = false; static const bool is_row = Glue::is_row; @@ -473,6 +580,7 @@ typedef const Mat& aligned_ea_type; static const bool use_at = false; + static const bool use_mp = false; static const bool has_subview = false; static const bool fake_mat = false; @@ -507,7 +615,7 @@ template -class Proxy< mtGlue > +class Proxy< mtGlue > { public: @@ -518,6 +626,7 @@ typedef const Mat& aligned_ea_type; static const bool use_at = false; + static const bool use_mp = false; static const bool has_subview = false; static const bool fake_mat = false; @@ -563,6 +672,7 @@ typedef const subview& aligned_ea_type; static const bool use_at = true; + static const bool use_mp = false; static const bool has_subview = true; static const bool fake_mat = false; @@ -608,6 +718,7 @@ typedef const subview_col& aligned_ea_type; static const bool use_at = false; + static const bool use_mp = false; static const bool has_subview = true; static const bool fake_mat = false; @@ -653,6 +764,7 @@ typedef const subview_row& aligned_ea_type; static const bool use_at = false; + static const bool use_mp = false; static const bool has_subview = true; static const bool fake_mat = false; @@ -698,6 +810,7 @@ typedef const Proxy< subview_elem1 >& aligned_ea_type; static const bool use_at = false; + static const bool use_mp = false; static const bool has_subview = true; static const bool fake_mat = false; @@ -750,6 +863,7 @@ typedef const Mat& aligned_ea_type; static const bool use_at = false; + static const bool use_mp = false; static const bool has_subview = false; static const bool fake_mat = false; @@ -795,6 +909,7 @@ typedef const diagview& aligned_ea_type; static const bool use_at = false; + static const bool use_mp = false; static const bool has_subview = true; static const bool fake_mat = false; @@ -840,6 +955,7 @@ typedef const spdiagview& aligned_ea_type; static const bool use_at = false; + static const bool use_mp = false; static const bool has_subview = false; static const bool fake_mat = false; @@ -893,6 +1009,7 @@ typedef const diagview& aligned_ea_type; static const bool use_at = false; + static const bool use_mp = false; static const bool has_subview = true; static const bool fake_mat = false; @@ -947,6 +1064,7 @@ typedef const Mat& aligned_ea_type; static const bool use_at = false; + static const bool use_mp = false; static const bool has_subview = false; static const bool fake_mat = false; @@ -1028,6 +1146,7 @@ typedef const xtrans_mat& aligned_ea_type; static const bool use_at = true; + static const bool use_mp = false; static const bool has_subview = true; static const bool fake_mat = false; @@ -1067,6 +1186,7 @@ typedef const xtrans_mat& aligned_ea_type; static const bool use_at = true; + static const bool use_mp = false; static const bool has_subview = true; static const bool fake_mat = false; @@ -1112,6 +1232,7 @@ typedef const Mat& aligned_ea_type; static const bool use_at = false; + static const bool use_mp = false; static const bool has_subview = quasi_unwrap::has_subview; static const bool fake_mat = true; @@ -1150,6 +1271,7 @@ typedef const Mat& aligned_ea_type; static const bool use_at = false; + static const bool use_mp = false; static const bool has_subview = quasi_unwrap::has_subview; static const bool fake_mat = true; @@ -1216,6 +1338,7 @@ typedef typename Proxy_xtrans::aligned_ea_type aligned_ea_type; static const bool use_at = Proxy_xtrans::use_at; + static const bool use_mp = Proxy_xtrans::use_mp; static const bool has_subview = Proxy_xtrans::has_subview; static const bool fake_mat = Proxy_xtrans::fake_mat; @@ -1276,6 +1399,7 @@ typedef typename Proxy_xtrans::aligned_ea_type aligned_ea_type; static const bool use_at = Proxy_xtrans::use_at; + static const bool use_mp = Proxy_xtrans::use_mp; static const bool has_subview = Proxy_xtrans::has_subview; static const bool fake_mat = Proxy_xtrans::fake_mat; @@ -1319,6 +1443,7 @@ typedef const subview_row_htrans& aligned_ea_type; static const bool use_at = false; + static const bool use_mp = false; static const bool has_subview = true; static const bool fake_mat = false; @@ -1349,6 +1474,7 @@ typedef const subview_row_strans& aligned_ea_type; static const bool use_at = false; + static const bool use_mp = false; static const bool has_subview = true; static const bool fake_mat = false; @@ -1407,6 +1533,7 @@ typedef typename Proxy_sv_row_ht::ea_type aligned_ea_type; static const bool use_at = Proxy_sv_row_ht::use_at; + static const bool use_mp = Proxy_sv_row_ht::use_mp; static const bool has_subview = Proxy_sv_row_ht::has_subview; static const bool fake_mat = Proxy_sv_row_ht::fake_mat; @@ -1452,6 +1579,7 @@ typedef const subview_row_strans& aligned_ea_type; static const bool use_at = false; + static const bool use_mp = false; static const bool has_subview = true; static const bool fake_mat = false; @@ -1499,6 +1627,7 @@ typedef const xvec_htrans& aligned_ea_type; static const bool use_at = false; + static const bool use_mp = false; static const bool has_subview = false; static const bool fake_mat = false; @@ -1548,6 +1677,7 @@ typedef const xvec_htrans& aligned_ea_type; static const bool use_at = false; + static const bool use_mp = false; static const bool has_subview = false; static const bool fake_mat = false; @@ -1597,6 +1727,7 @@ typedef const xvec_htrans& aligned_ea_type; static const bool use_at = false; + static const bool use_mp = false; static const bool has_subview = true; static const bool fake_mat = false; @@ -1644,6 +1775,7 @@ typedef const eOp< Op, eop_scalar_times>& aligned_ea_type; static const bool use_at = eOp< Op, eop_scalar_times>::use_at; + static const bool use_mp = eOp< Op, eop_scalar_times>::use_mp; static const bool has_subview = eOp< Op, eop_scalar_times>::has_subview; static const bool fake_mat = eOp< Op, eop_scalar_times>::fake_mat; @@ -1692,6 +1824,7 @@ typedef const subview_row_strans& aligned_ea_type; static const bool use_at = false; + static const bool use_mp = false; static const bool has_subview = true; static const bool fake_mat = false; @@ -1737,6 +1870,7 @@ typedef const subview_row_htrans& aligned_ea_type; static const bool use_at = false; + static const bool use_mp = false; static const bool has_subview = true; static const bool fake_mat = false; @@ -1782,6 +1916,7 @@ typedef const Mat& aligned_ea_type; static const bool use_at = false; + static const bool use_mp = false; static const bool has_subview = false; static const bool fake_mat = false; @@ -1827,6 +1962,7 @@ typedef const Mat& aligned_ea_type; static const bool use_at = false; + static const bool use_mp = false; static const bool has_subview = false; static const bool fake_mat = false; @@ -1880,6 +2016,7 @@ typedef const Mat& aligned_ea_type; static const bool use_at = false; + static const bool use_mp = false; static const bool has_subview = true; static const bool fake_mat = true; @@ -1935,6 +2072,7 @@ typedef typename Proxy::aligned_ea_type aligned_ea_type; static const bool use_at = false; + static const bool use_mp = Proxy::use_mp; static const bool has_subview = Proxy::has_subview; static const bool fake_mat = Proxy::fake_mat; diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/restrictors.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/restrictors.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/restrictors.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/restrictors.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2013 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup restrictors diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/Row_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/Row_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/Row_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/Row_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup Row @@ -34,30 +40,30 @@ template inline Row(const uword in_rows, const uword in_cols, const fill::fill_class& f); template inline Row(const SizeMat& s, const fill::fill_class& f); - inline Row(const char* text); - inline const Row& operator=(const char* text); + inline Row(const char* text); + inline Row& operator=(const char* text); - inline Row(const std::string& text); - inline const Row& operator=(const std::string& text); + inline Row(const std::string& text); + inline Row& operator=(const std::string& text); - inline Row(const std::vector& x); - inline const Row& operator=(const std::vector& x); + inline Row(const std::vector& x); + inline Row& operator=(const std::vector& x); #if defined(ARMA_USE_CXX11) - inline Row(const std::initializer_list& list); - inline const Row& operator=(const std::initializer_list& list); + inline Row(const std::initializer_list& list); + inline Row& operator=(const std::initializer_list& list); - inline Row(Row&& m); - inline const Row& operator=(Row&& m); + inline Row(Row&& m); + inline Row& operator=(Row&& m); #endif inline explicit Row(const SpRow& X); - inline const Row& operator=(const eT val); - inline const Row& operator=(const Row& X); + inline Row& operator=(const eT val); + inline Row& operator=(const Row& X); - template inline Row(const Base& X); - template inline const Row& operator=(const Base& X); + template inline Row(const Base& X); + template inline Row& operator=(const Base& X); inline Row( eT* aux_mem, const uword aux_length, const bool copy_aux_mem = true, const bool strict = false); inline Row(const eT* aux_mem, const uword aux_length); @@ -65,11 +71,11 @@ template inline explicit Row(const Base& A, const Base& B); - template inline Row(const BaseCube& X); - template inline const Row& operator=(const BaseCube& X); + template inline Row(const BaseCube& X); + template inline Row& operator=(const BaseCube& X); - inline Row(const subview_cube& X); - inline const Row& operator=(const subview_cube& X); + inline Row(const subview_cube& X); + inline Row& operator=(const subview_cube& X); inline mat_injector operator<<(const eT val); @@ -193,25 +199,25 @@ inline fixed(const char* text); inline fixed(const std::string& text); - template inline const Row& operator=(const Base& A); + template inline Row& operator=(const Base& A); - inline const Row& operator=(const eT val); - inline const Row& operator=(const char* text); - inline const Row& operator=(const std::string& text); - inline const Row& operator=(const subview_cube& X); + inline Row& operator=(const eT val); + inline Row& operator=(const char* text); + inline Row& operator=(const std::string& text); + inline Row& operator=(const subview_cube& X); using Row::operator(); #if defined(ARMA_USE_CXX11) - inline fixed(const std::initializer_list& list); - inline const Row& operator=(const std::initializer_list& list); + inline fixed(const std::initializer_list& list); + inline Row& operator=(const std::initializer_list& list); #endif - arma_inline const Row& operator=(const fixed& X); + arma_inline Row& operator=(const fixed& X); #if defined(ARMA_GOOD_COMPILER) - template inline const Row& operator=(const eOp& X); - template inline const Row& operator=(const eGlue& X); + template inline Row& operator=(const eOp& X); + template inline Row& operator=(const eGlue& X); #endif arma_inline const Op< Row_fixed_type, op_htrans > t() const; diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/Row_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/Row_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/Row_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/Row_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup Row @@ -128,7 +134,7 @@ template inline -const Row& +Row& Row::operator=(const char* text) { arma_extra_debug_sigprint(); @@ -155,7 +161,7 @@ template inline -const Row& +Row& Row::operator=(const std::string& text) { arma_extra_debug_sigprint(); @@ -186,7 +192,7 @@ //! create a row vector from std::vector template inline -const Row& +Row& Row::operator=(const std::vector& x) { arma_extra_debug_sigprint(); @@ -220,7 +226,7 @@ template inline - const Row& + Row& Row::operator=(const std::initializer_list& list) { arma_extra_debug_sigprint(); @@ -274,7 +280,7 @@ template inline - const Row& + Row& Row::operator=(Row&& X) { arma_extra_debug_sigprint(arma_str::format("this = %x X = %x") % this % &X); @@ -315,7 +321,7 @@ template inline -const Row& +Row& Row::operator=(const eT val) { arma_extra_debug_sigprint(); @@ -329,7 +335,7 @@ template inline -const Row& +Row& Row::operator=(const Row& X) { arma_extra_debug_sigprint(); @@ -357,7 +363,7 @@ template template inline -const Row& +Row& Row::operator=(const Base& X) { arma_extra_debug_sigprint(); @@ -430,7 +436,7 @@ template template inline -const Row& +Row& Row::operator=(const BaseCube& X) { arma_extra_debug_sigprint(); @@ -457,7 +463,7 @@ template inline -const Row& +Row& Row::operator=(const subview_cube& X) { arma_extra_debug_sigprint(); @@ -1175,7 +1181,7 @@ template template template -const Row& +Row& Row::fixed::operator=(const Base& A) { arma_extra_debug_sigprint(); @@ -1189,7 +1195,7 @@ template template -const Row& +Row& Row::fixed::operator=(const eT val) { arma_extra_debug_sigprint(); @@ -1203,7 +1209,7 @@ template template -const Row& +Row& Row::fixed::operator=(const char* text) { arma_extra_debug_sigprint(); @@ -1217,7 +1223,7 @@ template template -const Row& +Row& Row::fixed::operator=(const std::string& text) { arma_extra_debug_sigprint(); @@ -1231,7 +1237,7 @@ template template -const Row& +Row& Row::fixed::operator=(const subview_cube& X) { arma_extra_debug_sigprint(); @@ -1261,7 +1267,7 @@ template template inline - const Row& + Row& Row::fixed::operator=(const std::initializer_list& list) { arma_extra_debug_sigprint(); @@ -1286,7 +1292,7 @@ template template arma_inline -const Row& +Row& Row::fixed::operator=(const fixed& X) { arma_extra_debug_sigprint(); @@ -1310,7 +1316,7 @@ template template inline - const Row& + Row& Row::fixed::operator=(const eOp& X) { arma_extra_debug_sigprint(); @@ -1343,7 +1349,7 @@ template template inline - const Row& + Row& Row::fixed::operator=(const eGlue& X) { arma_extra_debug_sigprint(); diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/running_stat_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/running_stat_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/running_stat_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/running_stat_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2013 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup running_stat @@ -63,8 +69,9 @@ inline T var (const uword norm_type = 0) const; inline T stddev(const uword norm_type = 0) const; - inline eT min() const; - inline eT max() const; + inline eT min() const; + inline eT max() const; + inline eT range() const; inline T count() const; diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/running_stat_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/running_stat_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/running_stat_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/running_stat_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2011 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup running_stat @@ -289,6 +295,18 @@ } + +template +inline +eT +running_stat::range() const + { + arma_extra_debug_sigprint(); + + return (max_val - min_val); + } + + //! number of samples so far template diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/running_stat_vec_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/running_stat_vec_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/running_stat_vec_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/running_stat_vec_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,20 +1,41 @@ -// Copyright (C) 2009-2013 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup running_stat_vec //! @{ -template struct rsv_get_elem_type { }; -template struct rsv_get_elem_type { typedef obj_type elem_type; }; -template struct rsv_get_elem_type { typedef typename obj_type::elem_type elem_type; }; +template struct rsv_get_elem_type_worker { }; +template struct rsv_get_elem_type_worker { typedef obj_type result; }; +template struct rsv_get_elem_type_worker { typedef typename obj_type::elem_type result; }; + +template struct rsv_get_elem_type { typedef typename rsv_get_elem_type_worker::value>::result elem_type; }; + + +template struct rsv_get_return_type1_worker { }; +template struct rsv_get_return_type1_worker { typedef Mat result; }; +template struct rsv_get_return_type1_worker { typedef obj_type result; }; + +template struct rsv_get_return_type1 { typedef typename rsv_get_return_type1_worker::value>::result return_type1; }; + + +template struct rsv_get_return_type2 { }; +template struct rsv_get_return_type2< Mat > { typedef Mat::result> return_type2; }; +template struct rsv_get_return_type2< Row > { typedef Row::result> return_type2; }; +template struct rsv_get_return_type2< Col > { typedef Col::result> return_type2; }; //! Class for keeping statistics of a continuously sampled process / signal. @@ -27,30 +48,34 @@ public: // voodoo for compatibility with old user code - typedef typename rsv_get_elem_type::value>::elem_type eT; + typedef typename rsv_get_elem_type::elem_type eT; typedef typename get_pod_type::result T; + typedef typename rsv_get_return_type1::return_type1 return_type1; + typedef typename rsv_get_return_type2::return_type2 return_type2; + inline ~running_stat_vec(); inline running_stat_vec(const bool in_calc_cov = false); // TODO: investigate char* overload, eg. "calc_cov", "no_calc_cov" inline running_stat_vec(const running_stat_vec& in_rsv); - inline const running_stat_vec& operator=(const running_stat_vec& in_rsv); + inline running_stat_vec& operator=(const running_stat_vec& in_rsv); template arma_hot inline void operator() (const Base< T, T1>& X); template arma_hot inline void operator() (const Base, T1>& X); inline void reset(); - inline const Mat& mean() const; - - inline const Mat< T>& var (const uword norm_type = 0); - inline Mat< T> stddev(const uword norm_type = 0) const; - inline const Mat& cov (const uword norm_type = 0); + inline const return_type1& mean() const; - inline const Mat& min() const; - inline const Mat& max() const; + inline const return_type2& var (const uword norm_type = 0); + inline return_type2 stddev(const uword norm_type = 0) const; + inline const Mat& cov (const uword norm_type = 0); + + inline const return_type1& min() const; + inline const return_type1& max() const; + inline return_type1 range() const; inline T count() const; @@ -63,18 +88,18 @@ arma_aligned arma_counter counter; - arma_aligned Mat r_mean; - arma_aligned Mat< T> r_var; - arma_aligned Mat r_cov; + arma_aligned return_type1 r_mean; + arma_aligned return_type2 r_var; + arma_aligned Mat r_cov; - arma_aligned Mat min_val; - arma_aligned Mat max_val; + arma_aligned return_type1 min_val; + arma_aligned return_type1 max_val; arma_aligned Mat< T> min_val_norm; arma_aligned Mat< T> max_val_norm; - arma_aligned Mat< T> r_var_dummy; - arma_aligned Mat r_cov_dummy; + arma_aligned return_type2 r_var_dummy; + arma_aligned Mat r_cov_dummy; arma_aligned Mat tmp1; arma_aligned Mat tmp2; diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/running_stat_vec_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/running_stat_vec_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/running_stat_vec_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/running_stat_vec_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2013 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup running_stat_vec @@ -52,7 +58,7 @@ template inline -const running_stat_vec& +running_stat_vec& running_stat_vec::operator=(const running_stat_vec& in_rsv) { arma_extra_debug_sigprint(); @@ -163,7 +169,7 @@ //! mean or average value template inline -const Mat< typename running_stat_vec::eT >& +const typename running_stat_vec::return_type1& running_stat_vec::mean() const { arma_extra_debug_sigprint(); @@ -176,7 +182,7 @@ //! variance template inline -const Mat< typename running_stat_vec::T >& +const typename running_stat_vec::return_type2& running_stat_vec::var(const uword norm_type) { arma_extra_debug_sigprint(); @@ -212,7 +218,7 @@ //! standard deviation template inline -Mat< typename running_stat_vec::T > +typename running_stat_vec::return_type2 running_stat_vec::stddev(const uword norm_type) const { arma_extra_debug_sigprint(); @@ -234,7 +240,8 @@ } else { - return Mat(); + typedef typename running_stat_vec::return_type2 out_type; + return out_type(); } } @@ -269,7 +276,9 @@ } else { - r_cov_dummy.zeros(r_mean.n_rows, r_mean.n_cols); + const uword out_size = (std::max)(r_mean.n_rows, r_mean.n_cols); + + r_cov_dummy.zeros(out_size, out_size); return r_cov_dummy; } @@ -288,7 +297,7 @@ //! vector with minimum values template inline -const Mat< typename running_stat_vec::eT >& +const typename running_stat_vec::return_type1& running_stat_vec::min() const { arma_extra_debug_sigprint(); @@ -301,7 +310,7 @@ //! vector with maximum values template inline -const Mat< typename running_stat_vec::eT >& +const typename running_stat_vec::return_type1& running_stat_vec::max() const { arma_extra_debug_sigprint(); @@ -310,6 +319,18 @@ } + +template +inline +typename running_stat_vec::return_type1 +running_stat_vec::range() const + { + arma_extra_debug_sigprint(); + + return (max_val - min_val); + } + + //! number of samples so far template diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/SizeCube_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/SizeCube_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/SizeCube_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/SizeCube_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup SizeCube diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/SizeCube_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/SizeCube_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/SizeCube_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/SizeCube_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup SizeCube diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/SizeMat_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/SizeMat_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/SizeMat_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/SizeMat_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup SizeMat diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/SizeMat_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/SizeMat_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/SizeMat_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/SizeMat_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup SizeMat diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/span.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/span.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/span.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/span.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2010-2012 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Stanislav Funiak +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/sp_auxlib_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/sp_auxlib_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/sp_auxlib_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/sp_auxlib_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2013-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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup sp_auxlib diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/sp_auxlib_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/sp_auxlib_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/sp_auxlib_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/sp_auxlib_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,13 +1,17 @@ -// Copyright (C) 2013-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin -// Written by Yixuan Qiu +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup sp_auxlib diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/SpBase_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/SpBase_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/SpBase_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/SpBase_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup SpBase diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/SpBase_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/SpBase_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/SpBase_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/SpBase_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup SpBase diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/SpCol_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/SpCol_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/SpCol_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/SpCol_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,13 +1,17 @@ -// Copyright (C) 2008-2012 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin -// Written by Matthew Amidon +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup SpCol @@ -31,19 +35,19 @@ inline explicit SpCol(const uword n_elem); inline SpCol(const uword in_rows, const uword in_cols); - inline SpCol(const char* text); - inline const SpCol& operator=(const char* text); + inline SpCol(const char* text); + inline SpCol& operator=(const char* text); - inline SpCol(const std::string& text); - inline const SpCol& operator=(const std::string& text); + inline SpCol(const std::string& text); + inline SpCol& operator=(const std::string& text); - inline const SpCol& operator=(const eT val); + inline SpCol& operator=(const eT val); - template inline SpCol(const Base& X); - template inline const SpCol& operator=(const Base& X); + template inline SpCol(const Base& X); + template inline SpCol& operator=(const Base& X); - template inline SpCol(const SpBase& X); - template inline const SpCol& operator=(const SpBase& X); + template inline SpCol(const SpBase& X); + template inline SpCol& operator=(const SpBase& X); template inline explicit SpCol(const SpBase& A, const SpBase& B); diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/SpCol_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/SpCol_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/SpCol_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/SpCol_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,13 +1,17 @@ -// Copyright (C) 2008-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin -// Written by Matthew Amidon +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup SpCol @@ -72,7 +76,7 @@ //! construct a column vector from specified text template inline -const SpCol& +SpCol& SpCol::operator=(const char* text) { arma_extra_debug_sigprint(); @@ -104,7 +108,7 @@ //! construct a column vector from specified text template inline -const SpCol& +SpCol& SpCol::operator=(const std::string& text) { arma_extra_debug_sigprint(); @@ -118,7 +122,7 @@ template inline -const SpCol& +SpCol& SpCol::operator=(const eT val) { arma_extra_debug_sigprint(); @@ -147,7 +151,7 @@ template template inline -const SpCol& +SpCol& SpCol::operator=(const Base& X) { arma_extra_debug_sigprint(); @@ -178,7 +182,7 @@ template template inline -const SpCol& +SpCol& SpCol::operator=(const SpBase& X) { arma_extra_debug_sigprint(); diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/spdiagview_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/spdiagview_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/spdiagview_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/spdiagview_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup spdiagview diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/spdiagview_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/spdiagview_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/spdiagview_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/spdiagview_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup spdiagview diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/SpGlue_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/SpGlue_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/SpGlue_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/SpGlue_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2012 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup SpGlue diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/spglue_join_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/spglue_join_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/spglue_join_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/spglue_join_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup spglue_join diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/spglue_join_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/spglue_join_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/spglue_join_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/spglue_join_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup spglue_join diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/SpGlue_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/SpGlue_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/SpGlue_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/SpGlue_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2012 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup SpGlue diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/spglue_minus_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/spglue_minus_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/spglue_minus_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/spglue_minus_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2012 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup spglue_minus diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/spglue_minus_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/spglue_minus_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/spglue_minus_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/spglue_minus_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2012-2014 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup spglue_minus diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/spglue_plus_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/spglue_plus_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/spglue_plus_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/spglue_plus_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2012 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup spglue_plus diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/spglue_plus_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/spglue_plus_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/spglue_plus_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/spglue_plus_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2012-2014 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup spglue_plus diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/spglue_times_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/spglue_times_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/spglue_times_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/spglue_times_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2012 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup spglue_times diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/spglue_times_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/spglue_times_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/spglue_times_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/spglue_times_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2012-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup spglue_times diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/SpMat_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/SpMat_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/SpMat_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/SpMat_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,13 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin -// Written by Matthew Amidon +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup SpMat @@ -81,16 +85,16 @@ inline explicit SpMat(const uword in_rows, const uword in_cols); inline explicit SpMat(const SizeMat& s); - inline SpMat(const char* text); - inline const SpMat& operator=(const char* text); - inline SpMat(const std::string& text); - inline const SpMat& operator=(const std::string& text); - inline SpMat(const SpMat& x); + inline SpMat(const char* text); + inline SpMat& operator=(const char* text); + inline SpMat(const std::string& text); + inline SpMat& operator=(const std::string& text); + inline SpMat(const SpMat& x); #if defined(ARMA_USE_CXX11) - inline SpMat(SpMat&& m); - inline const SpMat& operator=(SpMat&& m); + inline SpMat(SpMat&& m); + inline SpMat& operator=(SpMat&& m); #endif template @@ -105,65 +109,65 @@ template inline SpMat(const bool add_values, const Base& locations, const Base& values, const uword n_rows, const uword n_cols, const bool sort_locations = true, const bool check_for_zeros = true); - inline const SpMat& operator=(const eT val); //! sets size to 1x1 - inline const SpMat& operator*=(const eT val); - inline const SpMat& operator/=(const eT val); + inline SpMat& operator=(const eT val); //! sets size to 1x1 + inline SpMat& operator*=(const eT val); + inline SpMat& operator/=(const eT val); // operator+=(val) and operator-=(val) are not defined as they don't make sense for sparse matrices - inline const SpMat& operator=(const SpMat& m); - inline const SpMat& operator+=(const SpMat& m); - inline const SpMat& operator-=(const SpMat& m); - inline const SpMat& operator*=(const SpMat& m); - inline const SpMat& operator%=(const SpMat& m); - inline const SpMat& operator/=(const SpMat& m); - - template inline explicit SpMat(const Base& m); - template inline const SpMat& operator=(const Base& m); - template inline const SpMat& operator+=(const Base& m); - template inline const SpMat& operator-=(const Base& m); - template inline const SpMat& operator*=(const Base& m); - template inline const SpMat& operator/=(const Base& m); - template inline const SpMat& operator%=(const Base& m); + inline SpMat& operator=(const SpMat& m); + inline SpMat& operator+=(const SpMat& m); + inline SpMat& operator-=(const SpMat& m); + inline SpMat& operator*=(const SpMat& m); + inline SpMat& operator%=(const SpMat& m); + inline SpMat& operator/=(const SpMat& m); + + template inline explicit SpMat(const Base& m); + template inline SpMat& operator=(const Base& m); + template inline SpMat& operator+=(const Base& m); + template inline SpMat& operator-=(const Base& m); + template inline SpMat& operator*=(const Base& m); + template inline SpMat& operator/=(const Base& m); + template inline SpMat& operator%=(const Base& m); //! construction of complex matrix out of two non-complex matrices template inline explicit SpMat(const SpBase& A, const SpBase& B); - inline SpMat(const SpSubview& X); - inline const SpMat& operator=(const SpSubview& X); - inline const SpMat& operator+=(const SpSubview& X); - inline const SpMat& operator-=(const SpSubview& X); - inline const SpMat& operator*=(const SpSubview& X); - inline const SpMat& operator%=(const SpSubview& X); - inline const SpMat& operator/=(const SpSubview& X); + inline SpMat(const SpSubview& X); + inline SpMat& operator=(const SpSubview& X); + inline SpMat& operator+=(const SpSubview& X); + inline SpMat& operator-=(const SpSubview& X); + inline SpMat& operator*=(const SpSubview& X); + inline SpMat& operator%=(const SpSubview& X); + inline SpMat& operator/=(const SpSubview& X); // delayed unary ops - template inline SpMat(const SpOp& X); - template inline const SpMat& operator=(const SpOp& X); - template inline const SpMat& operator+=(const SpOp& X); - template inline const SpMat& operator-=(const SpOp& X); - template inline const SpMat& operator*=(const SpOp& X); - template inline const SpMat& operator%=(const SpOp& X); - template inline const SpMat& operator/=(const SpOp& X); + template inline SpMat(const SpOp& X); + template inline SpMat& operator=(const SpOp& X); + template inline SpMat& operator+=(const SpOp& X); + template inline SpMat& operator-=(const SpOp& X); + template inline SpMat& operator*=(const SpOp& X); + template inline SpMat& operator%=(const SpOp& X); + template inline SpMat& operator/=(const SpOp& X); // delayed binary ops - template inline SpMat(const SpGlue& X); - template inline const SpMat& operator=(const SpGlue& X); - template inline const SpMat& operator+=(const SpGlue& X); - template inline const SpMat& operator-=(const SpGlue& X); - template inline const SpMat& operator*=(const SpGlue& X); - template inline const SpMat& operator%=(const SpGlue& X); - template inline const SpMat& operator/=(const SpGlue& X); + template inline SpMat(const SpGlue& X); + template inline SpMat& operator=(const SpGlue& X); + template inline SpMat& operator+=(const SpGlue& X); + template inline SpMat& operator-=(const SpGlue& X); + template inline SpMat& operator*=(const SpGlue& X); + template inline SpMat& operator%=(const SpGlue& X); + template inline SpMat& operator/=(const SpGlue& X); // delayed mixed-type unary ops - template inline SpMat(const mtSpOp& X); - template inline const SpMat& operator=(const mtSpOp& X); - template inline const SpMat& operator+=(const mtSpOp& X); - template inline const SpMat& operator-=(const mtSpOp& X); - template inline const SpMat& operator*=(const mtSpOp& X); - template inline const SpMat& operator%=(const mtSpOp& X); - template inline const SpMat& operator/=(const mtSpOp& X); + template inline SpMat(const mtSpOp& X); + template inline SpMat& operator=(const mtSpOp& X); + template inline SpMat& operator+=(const mtSpOp& X); + template inline SpMat& operator-=(const mtSpOp& X); + template inline SpMat& operator*=(const mtSpOp& X); + template inline SpMat& operator%=(const mtSpOp& X); + template inline SpMat& operator/=(const mtSpOp& X); arma_inline SpSubview row(const uword row_num); diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/SpMat_iterators_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/SpMat_iterators_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/SpMat_iterators_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/SpMat_iterators_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,13 +1,17 @@ -// Copyright (C) 2011-2014 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin -// Written by Matthew Amidon +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup SpMat diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/SpMat_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/SpMat_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/SpMat_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/SpMat_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,13 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin -// Written by Matthew Amidon +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup SpMat @@ -121,7 +125,7 @@ template inline -const SpMat& +SpMat& SpMat::operator=(const char* text) { arma_extra_debug_sigprint(); @@ -154,7 +158,7 @@ template inline -const SpMat& +SpMat& SpMat::operator=(const std::string& text) { arma_extra_debug_sigprint(); @@ -209,7 +213,7 @@ template inline - const SpMat& + SpMat& SpMat::operator=(SpMat&& in_mat) { arma_extra_debug_sigprint(arma_str::format("this = %x in_mat = %x") % this % &in_mat); @@ -510,7 +514,7 @@ template inline -const SpMat& +SpMat& SpMat::operator=(const eT val) { arma_extra_debug_sigprint(); @@ -538,7 +542,7 @@ template inline -const SpMat& +SpMat& SpMat::operator*=(const eT val) { arma_extra_debug_sigprint(); @@ -562,7 +566,7 @@ template inline -const SpMat& +SpMat& SpMat::operator/=(const eT val) { arma_extra_debug_sigprint(); @@ -580,7 +584,7 @@ template inline -const SpMat& +SpMat& SpMat::operator=(const SpMat& x) { arma_extra_debug_sigprint(); @@ -594,7 +598,7 @@ template inline -const SpMat& +SpMat& SpMat::operator+=(const SpMat& x) { arma_extra_debug_sigprint(); @@ -610,7 +614,7 @@ template inline -const SpMat& +SpMat& SpMat::operator-=(const SpMat& x) { arma_extra_debug_sigprint(); @@ -626,7 +630,7 @@ template inline -const SpMat& +SpMat& SpMat::operator*=(const SpMat& y) { arma_extra_debug_sigprint(); @@ -643,7 +647,7 @@ // This is in-place element-wise matrix multiplication. template inline -const SpMat& +SpMat& SpMat::operator%=(const SpMat& y) { arma_extra_debug_sigprint(); @@ -756,7 +760,7 @@ template inline -const SpMat& +SpMat& SpMat::operator/=(const SpMat& x) { arma_extra_debug_sigprint(); @@ -801,7 +805,7 @@ template template inline -const SpMat& +SpMat& SpMat::operator=(const Base& expr) { arma_extra_debug_sigprint(); @@ -857,7 +861,7 @@ template template inline -const SpMat& +SpMat& SpMat::operator+=(const Base& x) { arma_extra_debug_sigprint(); @@ -870,7 +874,7 @@ template template inline -const SpMat& +SpMat& SpMat::operator-=(const Base& x) { arma_extra_debug_sigprint(); @@ -883,7 +887,7 @@ template template inline -const SpMat& +SpMat& SpMat::operator*=(const Base& y) { arma_extra_debug_sigprint(); @@ -981,7 +985,7 @@ template template inline -const SpMat& +SpMat& SpMat::operator/=(const Base& x) { arma_extra_debug_sigprint(); @@ -998,7 +1002,7 @@ template template inline -const SpMat& +SpMat& SpMat::operator%=(const Base& x) { arma_extra_debug_sigprint(); @@ -1079,7 +1083,7 @@ template inline -const SpMat& +SpMat& SpMat::operator=(const SpSubview& X) { arma_extra_debug_sigprint(); @@ -1129,7 +1133,7 @@ template inline -const SpMat& +SpMat& SpMat::operator+=(const SpSubview& X) { arma_extra_debug_sigprint(); @@ -1145,7 +1149,7 @@ template inline -const SpMat& +SpMat& SpMat::operator-=(const SpSubview& X) { arma_extra_debug_sigprint(); @@ -1161,7 +1165,7 @@ template inline -const SpMat& +SpMat& SpMat::operator*=(const SpSubview& y) { arma_extra_debug_sigprint(); @@ -1177,7 +1181,7 @@ template inline -const SpMat& +SpMat& SpMat::operator%=(const SpSubview& x) { arma_extra_debug_sigprint(); @@ -1193,7 +1197,7 @@ template inline -const SpMat& +SpMat& SpMat::operator/=(const SpSubview& x) { arma_extra_debug_sigprint(); @@ -1236,7 +1240,7 @@ template template inline -const SpMat& +SpMat& SpMat::operator=(const SpOp& X) { arma_extra_debug_sigprint(); @@ -1253,7 +1257,7 @@ template template inline -const SpMat& +SpMat& SpMat::operator+=(const SpOp& X) { arma_extra_debug_sigprint(); @@ -1270,7 +1274,7 @@ template template inline -const SpMat& +SpMat& SpMat::operator-=(const SpOp& X) { arma_extra_debug_sigprint(); @@ -1287,7 +1291,7 @@ template template inline -const SpMat& +SpMat& SpMat::operator*=(const SpOp& X) { arma_extra_debug_sigprint(); @@ -1304,7 +1308,7 @@ template template inline -const SpMat& +SpMat& SpMat::operator%=(const SpOp& X) { arma_extra_debug_sigprint(); @@ -1321,7 +1325,7 @@ template template inline -const SpMat& +SpMat& SpMat::operator/=(const SpOp& X) { arma_extra_debug_sigprint(); @@ -1380,7 +1384,7 @@ template template inline -const SpMat& +SpMat& SpMat::operator=(const mtSpOp& X) { arma_extra_debug_sigprint(); @@ -1395,7 +1399,7 @@ template template inline -const SpMat& +SpMat& SpMat::operator+=(const mtSpOp& X) { arma_extra_debug_sigprint(); @@ -1410,7 +1414,7 @@ template template inline -const SpMat& +SpMat& SpMat::operator-=(const mtSpOp& X) { arma_extra_debug_sigprint(); @@ -1425,7 +1429,7 @@ template template inline -const SpMat& +SpMat& SpMat::operator*=(const mtSpOp& X) { arma_extra_debug_sigprint(); @@ -1440,7 +1444,7 @@ template template inline -const SpMat& +SpMat& SpMat::operator%=(const mtSpOp& X) { arma_extra_debug_sigprint(); @@ -1455,7 +1459,7 @@ template template inline -const SpMat& +SpMat& SpMat::operator/=(const mtSpOp& X) { arma_extra_debug_sigprint(); @@ -1470,7 +1474,7 @@ template template inline -const SpMat& +SpMat& SpMat::operator=(const SpGlue& X) { arma_extra_debug_sigprint(); @@ -1487,7 +1491,7 @@ template template inline -const SpMat& +SpMat& SpMat::operator+=(const SpGlue& X) { arma_extra_debug_sigprint(); @@ -1504,7 +1508,7 @@ template template inline -const SpMat& +SpMat& SpMat::operator-=(const SpGlue& X) { arma_extra_debug_sigprint(); @@ -1521,7 +1525,7 @@ template template inline -const SpMat& +SpMat& SpMat::operator*=(const SpGlue& X) { arma_extra_debug_sigprint(); @@ -1538,7 +1542,7 @@ template template inline -const SpMat& +SpMat& SpMat::operator%=(const SpGlue& X) { arma_extra_debug_sigprint(); @@ -1555,7 +1559,7 @@ template template inline -const SpMat& +SpMat& SpMat::operator/=(const SpGlue& X) { arma_extra_debug_sigprint(); @@ -3697,6 +3701,7 @@ break; case coord_ascii: + arma_debug_warn("SpMat::save(): support for coord format is experimental"); save_okay = diskio::save_coord_ascii(*this, name); break; @@ -3737,6 +3742,7 @@ break; case coord_ascii: + arma_debug_warn("SpMat::save(): support for coord format is experimental"); save_okay = diskio::save_coord_ascii(*this, os); break; @@ -3782,6 +3788,7 @@ break; case coord_ascii: + arma_debug_warn("SpMat::load(): support for coord format is experimental"); load_okay = diskio::load_coord_ascii(*this, name, err_msg); break; @@ -3842,6 +3849,7 @@ break; case coord_ascii: + arma_debug_warn("SpMat::load(): support for coord format is experimental"); load_okay = diskio::load_coord_ascii(*this, is, err_msg); break; diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/SpOp_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/SpOp_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/SpOp_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/SpOp_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2012 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup SpOp diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/spop_diagmat_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/spop_diagmat_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/spop_diagmat_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/spop_diagmat_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2012-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup spop_diagmat diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/spop_diagmat_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/spop_diagmat_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/spop_diagmat_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/spop_diagmat_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2012-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup spop_diagmat diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/spop_htrans_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/spop_htrans_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/spop_htrans_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/spop_htrans_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2012 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup spop_htrans diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/spop_htrans_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/spop_htrans_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/spop_htrans_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/spop_htrans_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2012-2014 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup spop_htrans diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/spop_max_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/spop_max_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/spop_max_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/spop_max_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2012-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup spop_max diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/spop_max_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/spop_max_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/spop_max_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/spop_max_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2012-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup spop_max diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/spop_mean_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/spop_mean_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/spop_mean_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/spop_mean_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2012-2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup spop_mean diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/spop_mean_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/spop_mean_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/spop_mean_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/spop_mean_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2012-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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup spop_mean diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/SpOp_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/SpOp_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/SpOp_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/SpOp_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2012 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup SpOp diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/spop_min_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/spop_min_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/spop_min_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/spop_min_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2012-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup spop_min diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/spop_min_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/spop_min_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/spop_min_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/spop_min_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2012-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup spop_min diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/spop_misc_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/spop_misc_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/spop_misc_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/spop_misc_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2012-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup spop_misc diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/spop_misc_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/spop_misc_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/spop_misc_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/spop_misc_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2012-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup spop_misc diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/spop_strans_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/spop_strans_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/spop_strans_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/spop_strans_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2012-2014 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup spop_strans diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/spop_strans_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/spop_strans_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/spop_strans_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/spop_strans_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2012-2014 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup spop_strans diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/spop_sum_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/spop_sum_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/spop_sum_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/spop_sum_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2012 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup spop_sum diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/spop_sum_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/spop_sum_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/spop_sum_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/spop_sum_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2012-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup spop_sum diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/spop_symmat_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/spop_symmat_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/spop_symmat_bones.hpp 1970-01-01 00:00:00.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/spop_symmat_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -0,0 +1,42 @@ +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + + +//! \addtogroup spop_symmat +//! @{ + + + +class spop_symmat + { + public: + + template + inline static void apply(SpMat& out, const SpOp& in); + }; + + + +class spop_symmat_cx + { + public: + + template + inline static void apply(SpMat& out, const SpOp& in); + }; + + + +//! @} diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/spop_symmat_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/spop_symmat_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/spop_symmat_meat.hpp 1970-01-01 00:00:00.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/spop_symmat_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -0,0 +1,349 @@ +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + + +//! \addtogroup spop_symmat +//! @{ + + + +template +inline +void +spop_symmat::apply(SpMat& out, const SpOp& in) + { + arma_extra_debug_sigprint(); + + typedef typename T1::elem_type eT; + typedef typename umat::elem_type ueT; + + const SpProxy P(in.m); + + arma_debug_check( (P.get_n_rows() != P.get_n_cols()), "symmatu()/symmatl(): given matrix must be square sized" ); + + const bool upper = (in.aux_uword_a == 0); + + const uword old_n_nonzero = P.get_n_nonzero(); + + if(old_n_nonzero == uword(0)) + { + out.zeros(P.get_n_rows(), P.get_n_cols()); + return; + } + + // count number of relevant elements + + typename SpProxy::const_iterator_type it = P.begin(); + + uword n_non_diagonal = 0; + uword n_yes_diagonal = 0; + + if(upper) + { + for(uword i = 0; i < old_n_nonzero; ++i) + { + const uword row = it.row(); + const uword col = it.col(); + + n_non_diagonal += (row < col) ? uword(1) : uword(0); + n_yes_diagonal += (row == col) ? uword(1) : uword(0); + + ++it; + } + } + else + { + for(uword i = 0; i < old_n_nonzero; ++i) + { + const uword row = it.row(); + const uword col = it.col(); + + n_non_diagonal += (row > col) ? uword(1) : uword(0); + n_yes_diagonal += (row == col) ? uword(1) : uword(0); + + ++it; + } + } + + const uword new_n_nonzero = n_yes_diagonal + 2*n_non_diagonal; + + umat out_locs(2, new_n_nonzero); + + Col out_vals(new_n_nonzero); + eT* out_vals_ptr = out_vals.memptr(); + + uword out_count = 0; + + it = P.begin(); + + if(upper) + { + // upper triangular: copy the diagonal and the elements above the diagonal + + for(uword in_count = 0; in_count < old_n_nonzero; ++in_count) + { + const uword row = it.row(); + const uword col = it.col(); + + if(row < col) + { + ueT* out_locs_ptr_a = out_locs.colptr(out_count ); + ueT* out_locs_ptr_b = out_locs.colptr(out_count+1); + + out_locs_ptr_a[0] = row; + out_locs_ptr_a[1] = col; + + out_locs_ptr_b[0] = col; + out_locs_ptr_b[1] = row; + + const eT val = (*it); + + out_vals_ptr[out_count ] = val; + out_vals_ptr[out_count+1] = val; + + out_count += 2; + } + else + if(row == col) + { + ueT* out_locs_ptr = out_locs.colptr(out_count); + + out_locs_ptr[0] = row; + out_locs_ptr[1] = col; + + out_vals_ptr[out_count] = (*it); + + out_count++; + } + + ++it; + } + } + else + { + // lower triangular: copy the diagonal and the elements below the diagonal + + for(uword in_count = 0; in_count < old_n_nonzero; ++in_count) + { + const uword row = it.row(); + const uword col = it.col(); + + if(row > col) + { + ueT* out_locs_ptr_a = out_locs.colptr(out_count ); + ueT* out_locs_ptr_b = out_locs.colptr(out_count+1); + + out_locs_ptr_a[0] = row; + out_locs_ptr_a[1] = col; + + out_locs_ptr_b[0] = col; + out_locs_ptr_b[1] = row; + + const eT val = (*it); + + out_vals_ptr[out_count ] = val; + out_vals_ptr[out_count+1] = val; + + out_count += 2; + } + else + if(row == col) + { + ueT* out_locs_ptr = out_locs.colptr(out_count); + + out_locs_ptr[0] = row; + out_locs_ptr[1] = col; + + out_vals_ptr[out_count] = (*it); + + out_count++; + } + + ++it; + } + } + + SpMat tmp(out_locs, out_vals, P.get_n_rows(), P.get_n_cols()); + + out.steal_mem(tmp); + } + + + +template +inline +void +spop_symmat_cx::apply(SpMat& out, const SpOp& in) + { + arma_extra_debug_sigprint(); + + typedef typename T1::elem_type eT; + typedef typename umat::elem_type ueT; + + const SpProxy P(in.m); + + arma_debug_check( (P.get_n_rows() != P.get_n_cols()), "symmatu()/symmatl(): given matrix must be square sized" ); + + const bool upper = (in.aux_uword_a == 0); + const bool do_conj = (in.aux_uword_b == 1); + + const uword old_n_nonzero = P.get_n_nonzero(); + + if(old_n_nonzero == uword(0)) + { + out.zeros(P.get_n_rows(), P.get_n_cols()); + return; + } + + // count number of relevant elements + + typename SpProxy::const_iterator_type it = P.begin(); + + uword n_non_diagonal = 0; + uword n_yes_diagonal = 0; + + if(upper) + { + for(uword i = 0; i < old_n_nonzero; ++i) + { + const uword row = it.row(); + const uword col = it.col(); + + n_non_diagonal += (row < col) ? uword(1) : uword(0); + n_yes_diagonal += (row == col) ? uword(1) : uword(0); + + ++it; + } + } + else + { + for(uword i = 0; i < old_n_nonzero; ++i) + { + const uword row = it.row(); + const uword col = it.col(); + + n_non_diagonal += (row > col) ? uword(1) : uword(0); + n_yes_diagonal += (row == col) ? uword(1) : uword(0); + + ++it; + } + } + + const uword new_n_nonzero = n_yes_diagonal + 2*n_non_diagonal; + + umat out_locs(2, new_n_nonzero); + + Col out_vals(new_n_nonzero); + eT* out_vals_ptr = out_vals.memptr(); + + uword out_count = 0; + + it = P.begin(); + + if(upper) + { + // upper triangular: copy the diagonal and the elements above the diagonal + + for(uword in_count = 0; in_count < old_n_nonzero; ++in_count) + { + const uword row = it.row(); + const uword col = it.col(); + + if(row < col) + { + ueT* out_locs_ptr_a = out_locs.colptr(out_count ); + ueT* out_locs_ptr_b = out_locs.colptr(out_count+1); + + out_locs_ptr_a[0] = row; + out_locs_ptr_a[1] = col; + + out_locs_ptr_b[0] = col; + out_locs_ptr_b[1] = row; + + const eT val = (*it); + + out_vals_ptr[out_count ] = val; + out_vals_ptr[out_count+1] = (do_conj) ? std::conj(val) : val; + + out_count += 2; + } + else + if(row == col) + { + ueT* out_locs_ptr = out_locs.colptr(out_count); + + out_locs_ptr[0] = row; + out_locs_ptr[1] = col; + + out_vals_ptr[out_count] = (*it); + + out_count++; + } + + ++it; + } + } + else + { + // lower triangular: copy the diagonal and the elements below the diagonal + + for(uword in_count = 0; in_count < old_n_nonzero; ++in_count) + { + const uword row = it.row(); + const uword col = it.col(); + + if(row > col) + { + ueT* out_locs_ptr_a = out_locs.colptr(out_count ); + ueT* out_locs_ptr_b = out_locs.colptr(out_count+1); + + out_locs_ptr_a[0] = row; + out_locs_ptr_a[1] = col; + + out_locs_ptr_b[0] = col; + out_locs_ptr_b[1] = row; + + const eT val = (*it); + + out_vals_ptr[out_count ] = val; + out_vals_ptr[out_count+1] = (do_conj) ? std::conj(val) : val; + + out_count += 2; + } + else + if(row == col) + { + ueT* out_locs_ptr = out_locs.colptr(out_count); + + out_locs_ptr[0] = row; + out_locs_ptr[1] = col; + + out_vals_ptr[out_count] = (*it); + + out_count++; + } + + ++it; + } + } + + SpMat tmp(out_locs, out_vals, P.get_n_rows(), P.get_n_cols()); + + out.steal_mem(tmp); + } + + + +//! @} diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/spop_trimat_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/spop_trimat_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/spop_trimat_bones.hpp 1970-01-01 00:00:00.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/spop_trimat_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -0,0 +1,35 @@ +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + + +//! \addtogroup spop_trimat +//! @{ + + + +class spop_trimat + { + public: + + template + inline static void apply_noalias(SpMat& out, const SpProxy& P, const bool upper); + + template + inline static void apply(SpMat& out, const SpOp& in); + }; + + + +//! @} diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/spop_trimat_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/spop_trimat_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/spop_trimat_meat.hpp 1970-01-01 00:00:00.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/spop_trimat_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -0,0 +1,144 @@ +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + + +//! \addtogroup spop_trimat +//! @{ + + + +template +inline +void +spop_trimat::apply_noalias(SpMat& out, const SpProxy& P, const bool upper) + { + arma_extra_debug_sigprint(); + + typename SpProxy::const_iterator_type it = P.begin(); + + const uword old_n_nonzero = P.get_n_nonzero(); + uword new_n_nonzero = 0; + + if(upper) + { + // upper triangular: count elements on the diagonal and above the diagonal + + for(uword i=0; i < old_n_nonzero; ++i) + { + new_n_nonzero += (it.row() <= it.col()) ? uword(1) : uword(0); + ++it; + } + } + else + { + // lower triangular: count elements on the diagonal and below the diagonal + + for(uword i=0; i < old_n_nonzero; ++i) + { + new_n_nonzero += (it.row() >= it.col()) ? uword(1) : uword(0); + ++it; + } + } + + const uword n_rows = P.get_n_rows(); + const uword n_cols = P.get_n_cols(); + + out.set_size(n_rows, n_cols); + + out.mem_resize(new_n_nonzero); + + uword new_index = 0; + + it = P.begin(); + + if(upper) + { + // upper triangular: copy elements on the diagonal and above the diagonal + + for(uword i=0; i < old_n_nonzero; ++i) + { + const uword row = it.row(); + const uword col = it.col(); + + if(row <= col) + { + access::rw(out.values[new_index]) = (*it); + access::rw(out.row_indices[new_index]) = row; + access::rw(out.col_ptrs[col + 1])++; + ++new_index; + } + + ++it; + } + } + else + { + // lower triangular: copy elements on the diagonal and below the diagonal + + for(uword i=0; i < old_n_nonzero; ++i) + { + const uword row = it.row(); + const uword col = it.col(); + + if(row >= col) + { + access::rw(out.values[new_index]) = (*it); + access::rw(out.row_indices[new_index]) = row; + access::rw(out.col_ptrs[col + 1])++; + ++new_index; + } + + ++it; + } + } + + for(uword i=0; i < n_cols; ++i) + { + access::rw(out.col_ptrs[i + 1]) += out.col_ptrs[i]; + } + } + + + +template +inline +void +spop_trimat::apply(SpMat& out, const SpOp& in) + { + arma_extra_debug_sigprint(); + + typedef typename T1::elem_type eT; + + const SpProxy P(in.m); + + arma_debug_check( (P.get_n_rows() != P.get_n_cols()), "trimatu()/trimatl(): given matrix must be square sized" ); + + const bool upper = (in.aux_uword_a == 0); + + if(P.is_alias(out)) + { + SpMat tmp; + spop_trimat::apply_noalias(tmp, P, upper); + out.steal_mem(tmp); + } + else + { + spop_trimat::apply_noalias(out, P, upper); + } + } + + + +//! @} diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/spop_var_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/spop_var_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/spop_var_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/spop_var_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2012 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup spop_var diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/spop_var_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/spop_var_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/spop_var_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/spop_var_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2012-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup spop_var diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/SpProxy.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/SpProxy.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/SpProxy.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/SpProxy.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2012 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup SpProxy diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/SpRow_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/SpRow_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/SpRow_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/SpRow_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,13 +1,17 @@ -// Copyright (C) 2008-2012 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin -// Written by Matthew Amidon +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup SpRow @@ -31,19 +35,19 @@ inline explicit SpRow(const uword N); inline SpRow(const uword in_rows, const uword in_cols); - inline SpRow(const char* text); - inline const SpRow& operator=(const char* text); + inline SpRow(const char* text); + inline SpRow& operator=(const char* text); - inline SpRow(const std::string& text); - inline const SpRow& operator=(const std::string& text); + inline SpRow(const std::string& text); + inline SpRow& operator=(const std::string& text); - inline const SpRow& operator=(const eT val); + inline SpRow& operator=(const eT val); - template inline SpRow(const Base& X); - template inline const SpRow& operator=(const Base& X); + template inline SpRow(const Base& X); + template inline SpRow& operator=(const Base& X); - template inline SpRow(const SpBase& X); - template inline const SpRow& operator=(const SpBase& X); + template inline SpRow(const SpBase& X); + template inline SpRow& operator=(const SpBase& X); template inline explicit SpRow(const SpBase& A, const SpBase& B); diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/SpRow_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/SpRow_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/SpRow_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/SpRow_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,13 +1,17 @@ -// Copyright (C) 2008-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin -// Written by Matthew Amidon +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup SpRow @@ -69,7 +73,7 @@ template inline -const SpRow& +SpRow& SpRow::operator=(const char* text) { arma_extra_debug_sigprint(); @@ -99,7 +103,7 @@ template inline -const SpRow& +SpRow& SpRow::operator=(const std::string& text) { arma_extra_debug_sigprint(); @@ -113,7 +117,7 @@ template inline -const SpRow& +SpRow& SpRow::operator=(const eT val) { arma_extra_debug_sigprint(); @@ -142,7 +146,7 @@ template template inline -const SpRow& +SpRow& SpRow::operator=(const Base& X) { arma_extra_debug_sigprint(); @@ -171,7 +175,7 @@ template template inline -const SpRow& +SpRow& SpRow::operator=(const SpBase& X) { arma_extra_debug_sigprint(); diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/SpSubview_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/SpSubview_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/SpSubview_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/SpSubview_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,13 +1,17 @@ -// Copyright (C) 2011-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin -// Written by Matthew Amidon +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup SpSubview diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/SpSubview_iterators_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/SpSubview_iterators_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/SpSubview_iterators_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/SpSubview_iterators_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2012 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup SpSubview diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/SpSubview_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/SpSubview_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/SpSubview_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/SpSubview_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,13 +1,17 @@ -// Copyright (C) 2011-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin -// Written by Matthew Amidon +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup SpSubview diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/SpValProxy_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/SpValProxy_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/SpValProxy_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/SpValProxy_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2011-2012 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup SpValProxy diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/SpValProxy_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/SpValProxy_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/SpValProxy_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/SpValProxy_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2011-2012 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup SpValProxy diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/strip.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/strip.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/strip.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/strip.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup strip diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/subview_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/subview_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/subview_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/subview_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by James Sanders +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup subview diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/subview_cube_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/subview_cube_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/subview_cube_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/subview_cube_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup subview_cube diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/subview_cube_each_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/subview_cube_each_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/subview_cube_each_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/subview_cube_each_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup subview_cube_each diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/subview_cube_each_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/subview_cube_each_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/subview_cube_each_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/subview_cube_each_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup subview_cube_each diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/subview_cube_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/subview_cube_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/subview_cube_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/subview_cube_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup subview_cube diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/subview_each_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/subview_each_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/subview_each_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/subview_each_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2012-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup subview_each diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/subview_each_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/subview_each_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/subview_each_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/subview_each_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2012-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup subview_each diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/subview_elem1_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/subview_elem1_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/subview_elem1_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/subview_elem1_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup subview_elem1 diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/subview_elem1_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/subview_elem1_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/subview_elem1_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/subview_elem1_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup subview_elem1 diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/subview_elem2_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/subview_elem2_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/subview_elem2_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/subview_elem2_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2012 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup subview_elem2 diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/subview_elem2_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/subview_elem2_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/subview_elem2_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/subview_elem2_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2012-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup subview_elem2 diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/subview_field_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/subview_field_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/subview_field_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/subview_field_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup subview_field diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/subview_field_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/subview_field_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/subview_field_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/subview_field_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup subview_field diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/subview_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/subview_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/subview_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/subview_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,13 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin -// Written by James Sanders +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup subview @@ -125,11 +129,12 @@ arma_debug_assert_same_size(s, P, identifier); + const bool use_mp = arma_config::cxx11 && arma_config::openmp && Proxy::use_mp && mp_gate::eval(s.n_elem); const bool is_alias = P.is_alias(s.m); if(is_alias) { arma_extra_debug_print("aliasing detected"); } - if( (is_Mat::stored_type>::value) || (is_alias) ) + if( (is_Mat::stored_type>::value) || (use_mp) || (is_alias) ) { const unwrap_check::stored_type> tmp(P.Q, is_alias); const Mat& B = tmp.M; diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/traits.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/traits.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/traits.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/traits.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup traits @@ -235,6 +241,10 @@ struct is_Cube< Cube > { static const bool value = true; }; +template +struct is_Cube< const Cube > + { static const bool value = true; }; + template struct is_subview_cube { static const bool value = false; }; @@ -243,6 +253,9 @@ struct is_subview_cube< subview_cube > { static const bool value = true; }; +template +struct is_subview_cube< const subview_cube > + { static const bool value = true; }; // @@ -623,7 +636,7 @@ template -struct is_arma_type +struct is_arma_type2 { static const bool value = is_Mat::value @@ -644,6 +657,17 @@ }; + +// due to rather baroque C++ rules for proving constant expressions, +// certain compilers may get confused with the combination of conditional inheritance, nested classes and the shenanigans in is_Mat_fixed_only. +// below we explicitly ensure the type is forced to be const, which seems to eliminate the confusion. +template +struct is_arma_type + { + static const bool value = is_arma_type2::value; + }; + + template struct is_arma_cube_type diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/typedef_elem_check.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/typedef_elem_check.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/typedef_elem_check.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/typedef_elem_check.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2014 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup typedef_elem diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/typedef_elem.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/typedef_elem.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/typedef_elem.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/typedef_elem.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup typedef_elem diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/typedef_mat_fixed.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/typedef_mat_fixed.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/typedef_mat_fixed.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/typedef_mat_fixed.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2010 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup typedef_mat_fixed @@ -40,6 +46,15 @@ typedef fmat::fixed<8,8> fmat88; typedef fmat::fixed<9,9> fmat99; +typedef dmat::fixed<2,2> dmat22; +typedef dmat::fixed<3,3> dmat33; +typedef dmat::fixed<4,4> dmat44; +typedef dmat::fixed<5,5> dmat55; +typedef dmat::fixed<6,6> dmat66; +typedef dmat::fixed<7,7> dmat77; +typedef dmat::fixed<8,8> dmat88; +typedef dmat::fixed<9,9> dmat99; + typedef mat::fixed<2,2> mat22; typedef mat::fixed<3,3> mat33; typedef mat::fixed<4,4> mat44; @@ -58,6 +73,15 @@ typedef cx_fmat::fixed<8,8> cx_fmat88; typedef cx_fmat::fixed<9,9> cx_fmat99; +typedef cx_dmat::fixed<2,2> cx_dmat22; +typedef cx_dmat::fixed<3,3> cx_dmat33; +typedef cx_dmat::fixed<4,4> cx_dmat44; +typedef cx_dmat::fixed<5,5> cx_dmat55; +typedef cx_dmat::fixed<6,6> cx_dmat66; +typedef cx_dmat::fixed<7,7> cx_dmat77; +typedef cx_dmat::fixed<8,8> cx_dmat88; +typedef cx_dmat::fixed<9,9> cx_dmat99; + typedef cx_mat::fixed<2,2> cx_mat22; typedef cx_mat::fixed<3,3> cx_mat33; typedef cx_mat::fixed<4,4> cx_mat44; @@ -98,6 +122,15 @@ typedef fvec::fixed<8> fvec8; typedef fvec::fixed<9> fvec9; +typedef dvec::fixed<2> dvec2; +typedef dvec::fixed<3> dvec3; +typedef dvec::fixed<4> dvec4; +typedef dvec::fixed<5> dvec5; +typedef dvec::fixed<6> dvec6; +typedef dvec::fixed<7> dvec7; +typedef dvec::fixed<8> dvec8; +typedef dvec::fixed<9> dvec9; + typedef vec::fixed<2> vec2; typedef vec::fixed<3> vec3; typedef vec::fixed<4> vec4; @@ -116,6 +149,15 @@ typedef cx_fvec::fixed<8> cx_fvec8; typedef cx_fvec::fixed<9> cx_fvec9; +typedef cx_dvec::fixed<2> cx_dvec2; +typedef cx_dvec::fixed<3> cx_dvec3; +typedef cx_dvec::fixed<4> cx_dvec4; +typedef cx_dvec::fixed<5> cx_dvec5; +typedef cx_dvec::fixed<6> cx_dvec6; +typedef cx_dvec::fixed<7> cx_dvec7; +typedef cx_dvec::fixed<8> cx_dvec8; +typedef cx_dvec::fixed<9> cx_dvec9; + typedef cx_vec::fixed<2> cx_vec2; typedef cx_vec::fixed<3> cx_vec3; typedef cx_vec::fixed<4> cx_vec4; @@ -156,6 +198,15 @@ typedef fcolvec::fixed<8> fcolvec8; typedef fcolvec::fixed<9> fcolvec9; +typedef dcolvec::fixed<2> dcolvec2; +typedef dcolvec::fixed<3> dcolvec3; +typedef dcolvec::fixed<4> dcolvec4; +typedef dcolvec::fixed<5> dcolvec5; +typedef dcolvec::fixed<6> dcolvec6; +typedef dcolvec::fixed<7> dcolvec7; +typedef dcolvec::fixed<8> dcolvec8; +typedef dcolvec::fixed<9> dcolvec9; + typedef colvec::fixed<2> colvec2; typedef colvec::fixed<3> colvec3; typedef colvec::fixed<4> colvec4; @@ -174,6 +225,15 @@ typedef cx_fcolvec::fixed<8> cx_fcolvec8; typedef cx_fcolvec::fixed<9> cx_fcolvec9; +typedef cx_dcolvec::fixed<2> cx_dcolvec2; +typedef cx_dcolvec::fixed<3> cx_dcolvec3; +typedef cx_dcolvec::fixed<4> cx_dcolvec4; +typedef cx_dcolvec::fixed<5> cx_dcolvec5; +typedef cx_dcolvec::fixed<6> cx_dcolvec6; +typedef cx_dcolvec::fixed<7> cx_dcolvec7; +typedef cx_dcolvec::fixed<8> cx_dcolvec8; +typedef cx_dcolvec::fixed<9> cx_dcolvec9; + typedef cx_colvec::fixed<2> cx_colvec2; typedef cx_colvec::fixed<3> cx_colvec3; typedef cx_colvec::fixed<4> cx_colvec4; @@ -214,6 +274,15 @@ typedef frowvec::fixed<8> frowvec8; typedef frowvec::fixed<9> frowvec9; +typedef drowvec::fixed<2> drowvec2; +typedef drowvec::fixed<3> drowvec3; +typedef drowvec::fixed<4> drowvec4; +typedef drowvec::fixed<5> drowvec5; +typedef drowvec::fixed<6> drowvec6; +typedef drowvec::fixed<7> drowvec7; +typedef drowvec::fixed<8> drowvec8; +typedef drowvec::fixed<9> drowvec9; + typedef rowvec::fixed<2> rowvec2; typedef rowvec::fixed<3> rowvec3; typedef rowvec::fixed<4> rowvec4; @@ -232,6 +301,15 @@ typedef cx_frowvec::fixed<8> cx_frowvec8; typedef cx_frowvec::fixed<9> cx_frowvec9; +typedef cx_drowvec::fixed<2> cx_drowvec2; +typedef cx_drowvec::fixed<3> cx_drowvec3; +typedef cx_drowvec::fixed<4> cx_drowvec4; +typedef cx_drowvec::fixed<5> cx_drowvec5; +typedef cx_drowvec::fixed<6> cx_drowvec6; +typedef cx_drowvec::fixed<7> cx_drowvec7; +typedef cx_drowvec::fixed<8> cx_drowvec8; +typedef cx_drowvec::fixed<9> cx_drowvec9; + typedef cx_rowvec::fixed<2> cx_rowvec2; typedef cx_rowvec::fixed<3> cx_rowvec3; typedef cx_rowvec::fixed<4> cx_rowvec4; diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/typedef_mat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/typedef_mat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/typedef_mat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/typedef_mat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2013 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup typedef_mat @@ -62,6 +68,12 @@ typedef Row frowvec; typedef Cube fcube; +typedef Mat dmat; +typedef Col dvec; +typedef Col dcolvec; +typedef Row drowvec; +typedef Cube dcube; + typedef Mat mat; typedef Col vec; typedef Col colvec; @@ -74,6 +86,12 @@ typedef Row cx_frowvec; typedef Cube cx_fcube; +typedef Mat cx_dmat; +typedef Col cx_dvec; +typedef Col cx_dcolvec; +typedef Row cx_drowvec; +typedef Cube cx_dcube; + typedef Mat cx_mat; typedef Col cx_vec; typedef Col cx_colvec; @@ -97,6 +115,11 @@ typedef SpCol sp_fcolvec; typedef SpRow sp_frowvec; +typedef SpMat sp_dmat; +typedef SpCol sp_dvec; +typedef SpCol sp_dcolvec; +typedef SpRow sp_drowvec; + typedef SpMat sp_mat; typedef SpCol sp_vec; typedef SpCol sp_colvec; @@ -107,6 +130,11 @@ typedef SpCol sp_cx_fcolvec; typedef SpRow sp_cx_frowvec; +typedef SpMat sp_cx_dmat; +typedef SpCol sp_cx_dvec; +typedef SpCol sp_cx_dcolvec; +typedef SpRow sp_cx_drowvec; + typedef SpMat sp_cx_mat; typedef SpCol sp_cx_vec; typedef SpCol sp_cx_colvec; diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/unwrap_cube.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/unwrap_cube.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/unwrap_cube.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/unwrap_cube.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2010 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup unwrap_cube diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/unwrap.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/unwrap.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/unwrap.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/unwrap.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup unwrap diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/unwrap_spmat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/unwrap_spmat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/unwrap_spmat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/unwrap_spmat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2012-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup unwrap_spmat diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/upgrade_val.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/upgrade_val.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/upgrade_val.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/upgrade_val.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2009-2010 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup upgrade_val diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/wall_clock_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/wall_clock_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/wall_clock_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/wall_clock_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup wall_clock diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/wall_clock_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/wall_clock_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/wall_clock_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/wall_clock_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2016 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup wall_clock @@ -77,8 +83,8 @@ { gettimeofday(&posix_time2, 0); - const double tmp_time1 = posix_time1.tv_sec + posix_time1.tv_usec * 1.0e-6; - const double tmp_time2 = posix_time2.tv_sec + posix_time2.tv_usec * 1.0e-6; + const double tmp_time1 = double(posix_time1.tv_sec) + double(posix_time1.tv_usec) * 1.0e-6; + const double tmp_time2 = double(posix_time2.tv_sec) + double(posix_time2.tv_usec) * 1.0e-6; return tmp_time2 - tmp_time1; } diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/wrapper_arpack.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/wrapper_arpack.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/wrapper_arpack.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/wrapper_arpack.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) // -// Written by Ryan Curtin +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/wrapper_atlas.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/wrapper_atlas.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/wrapper_atlas.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/wrapper_atlas.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #ifdef ARMA_USE_ATLAS diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/wrapper_blas.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/wrapper_blas.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/wrapper_blas.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/wrapper_blas.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2008-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/wrapper_lapack.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/wrapper_lapack.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/wrapper_lapack.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/wrapper_lapack.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,13 +1,17 @@ -// Copyright (C) 2008-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by James Sanders -// Written by Eric Jon Sundstrom +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/wrapper_superlu.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/wrapper_superlu.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/wrapper_superlu.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/wrapper_superlu.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2008-2016 National ICT Australia (NICTA) // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/xtrans_mat_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/xtrans_mat_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/xtrans_mat_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/xtrans_mat_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2014 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup xtrans_mat diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/xtrans_mat_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/xtrans_mat_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/xtrans_mat_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/xtrans_mat_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2014 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup xtrans_mat diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/xvec_htrans_bones.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/xvec_htrans_bones.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/xvec_htrans_bones.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/xvec_htrans_bones.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup xvec_htrans diff -Nru armadillo-7.600.2+dfsg/include/armadillo_bits/xvec_htrans_meat.hpp armadillo-7.950.1+dfsg/include/armadillo_bits/xvec_htrans_meat.hpp --- armadillo-7.600.2+dfsg/include/armadillo_bits/xvec_htrans_meat.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/include/armadillo_bits/xvec_htrans_meat.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2013 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ //! \addtogroup xvec_htrans diff -Nru armadillo-7.600.2+dfsg/index.html armadillo-7.950.1+dfsg/index.html --- armadillo-7.600.2+dfsg/index.html 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/index.html 2016-06-16 16:16:31.000000000 +0000 @@ -4,6 +4,7 @@
        • API Reference / Documentation diff -Nru armadillo-7.600.2+dfsg/LICENSE.txt armadillo-7.950.1+dfsg/LICENSE.txt --- armadillo-7.600.2+dfsg/LICENSE.txt 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/LICENSE.txt 2016-06-16 16:16:31.000000000 +0000 @@ -1,373 +1,202 @@ -Mozilla Public License Version 2.0 -================================== -1. Definitions --------------- - -1.1. "Contributor" - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -1.2. "Contributor Version" - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - (a) that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or - - (b) that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -1.6. "Executable Form" - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -1.8. "License" - means this document. - -1.9. "Licensable" - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -1.10. "Modifications" - means any of the following: - - (a) any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or - - (b) any new file in Source Code Form that contains any Covered - Software. - -1.11. "Patent Claims" of a Contributor - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -1.12. "Secondary License" - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -1.13. "Source Code Form" - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, "control" means (a) the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or (b) ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - -2. License Grants and Conditions --------------------------------- - -2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -(a) under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - -(b) under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -(a) for any code that a Contributor has removed from Covered Software; - or - -(b) for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - -(c) under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - -3. Responsibilities -------------------- - -3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -(a) such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -(b) You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - -4. Inability to Comply Due to Statute or Regulation ---------------------------------------------------- - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: (a) comply with -the terms of this License to the maximum extent possible; and (b) -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - -5. Termination --------------- - -5.1. The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated (a) provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and (b) on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - -************************************************************************ -* * -* 6. Disclaimer of Warranty * -* ------------------------- * -* * -* Covered Software is provided under this License on an "as is" * -* basis, without warranty of any kind, either expressed, implied, or * -* statutory, including, without limitation, warranties that the * -* Covered Software is free of defects, merchantable, fit for a * -* particular purpose or non-infringing. The entire risk as to the * -* quality and performance of the Covered Software is with You. * -* Should any Covered Software prove defective in any respect, You * -* (not any Contributor) assume the cost of any necessary servicing, * -* repair, or correction. This disclaimer of warranty constitutes an * -* essential part of this License. No use of any Covered Software is * -* authorized under this License except under this disclaimer. * -* * -************************************************************************ - -************************************************************************ -* * -* 7. Limitation of Liability * -* -------------------------- * -* * -* Under no circumstances and under no legal theory, whether tort * -* (including negligence), contract, or otherwise, shall any * -* Contributor, or anyone who distributes Covered Software as * -* permitted above, be liable to You for any direct, indirect, * -* special, incidental, or consequential damages of any character * -* including, without limitation, damages for lost profits, loss of * -* goodwill, work stoppage, computer failure or malfunction, or any * -* and all other commercial damages or losses, even if such party * -* shall have been informed of the possibility of such damages. This * -* limitation of liability shall not apply to liability for death or * -* personal injury resulting from such party's negligence to the * -* extent applicable law prohibits such limitation. Some * -* jurisdictions do not allow the exclusion or limitation of * -* incidental or consequential damages, so this exclusion and * -* limitation may not apply to You. * -* * -************************************************************************ - -8. Litigation -------------- - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - -9. Miscellaneous ----------------- - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - -10. Versions of the License ---------------------------- - -10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary -Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice -------------------------------------------- - - 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 - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice ---------------------------------------------------------- - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff -Nru armadillo-7.600.2+dfsg/mex_interface/armaMex_demo.cpp armadillo-7.950.1+dfsg/mex_interface/armaMex_demo.cpp --- armadillo-7.600.2+dfsg/mex_interface/armaMex_demo.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/mex_interface/armaMex_demo.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2014 National ICT Australia (NICTA) +// Copyright 2014 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2014 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by George Yammine +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ // Demonstration of how to connect Armadillo with Matlab mex functions. diff -Nru armadillo-7.600.2+dfsg/mex_interface/armaMex.hpp armadillo-7.950.1+dfsg/mex_interface/armaMex.hpp --- armadillo-7.600.2+dfsg/mex_interface/armaMex.hpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/mex_interface/armaMex.hpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2014 National ICT Australia (NICTA) +// Copyright 2014 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2014 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by George Yammine +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ // Connector for Mex files to use Armadillo for calculation diff -Nru armadillo-7.600.2+dfsg/mex_interface/readMatTest.cpp armadillo-7.950.1+dfsg/mex_interface/readMatTest.cpp --- armadillo-7.600.2+dfsg/mex_interface/readMatTest.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/mex_interface/readMatTest.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2014 National ICT Australia (NICTA) +// Copyright 2014 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2014 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by George Yammine +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ // Demonstration of how to connect Armadillo with Matlab mex functions. diff -Nru armadillo-7.600.2+dfsg/misc/armadillo.pc.in armadillo-7.950.1+dfsg/misc/armadillo.pc.in --- armadillo-7.600.2+dfsg/misc/armadillo.pc.in 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/misc/armadillo.pc.in 2016-06-16 16:16:31.000000000 +0000 @@ -1,7 +1,5 @@ -prefix=@CMAKE_INSTALL_PREFIX@ -exec_prefix=${prefix} -libdir=@INSTALL_LIB_DIR@ -includedir=@INSTALL_INCLUDE_DIR@ +libdir=@CMAKE_INSTALL_FULL_LIBDIR@ +includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ Name: armadillo Description: Fast C++ matrix library with syntax similar to MATLAB and Octave diff -Nru armadillo-7.600.2+dfsg/misc/armadillo.spec armadillo-7.950.1+dfsg/misc/armadillo.spec --- armadillo-7.600.2+dfsg/misc/armadillo.spec 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/misc/armadillo.spec 2016-06-16 16:16:31.000000000 +0000 @@ -1,10 +1,10 @@ Name: armadillo -Version: 7.400.1 +Version: 7.800.0 Release: 1%{?dist} Summary: Fast C++ matrix library with syntax similar to MATLAB and Octave Group: Development/Libraries -License: MPLv2.0 +License: ASL 2.0 URL: http://arma.sourceforge.net/ Source: http://sourceforge.net/projects/arma/files/%{name}-%{version}.tar.xz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -18,19 +18,19 @@ %description Armadillo is a high quality C++ linear algebra library, aiming towards a good balance between speed and ease of use. -It's useful for algorithm development directly in C++, +Useful for algorithm development directly in C++, and/or quick conversion of research code into production environments. The syntax (API) is deliberately similar to Matlab. The library provides efficient classes for vectors, matrices and cubes, as well as 200+ associated functions (eg. contiguous and non-contiguous submatrix views). Various matrix decompositions are provided through integration with LAPACK, or one of its high performance drop-in replacements -(eg. OpenBLAS, Intel MKL, AMD ACML, Apple Accelerate framework, etc). +(eg. OpenBLAS, Intel MKL, Apple Accelerate framework, etc). A sophisticated expression evaluator (via C++ template meta-programming) automatically combines several operations (at compile time) to increase speed and efficiency. The library can be used for machine learning, pattern recognition, -computer vision, signal processing, bioinformatics, statistics, etc. +computer vision, signal processing, bioinformatics, statistics, finance, etc. %package devel @@ -88,9 +88,11 @@ %files %{_libdir}/*.so.* %license LICENSE.txt +%license NOTICE.txt %files devel %{_libdir}/*.so +%{_libdir}/pkgconfig/%{name}.pc %{_includedir}/armadillo %{_includedir}/armadillo_bits/ %{_datadir}/Armadillo/ diff -Nru armadillo-7.600.2+dfsg/NOTICE.txt armadillo-7.950.1+dfsg/NOTICE.txt --- armadillo-7.600.2+dfsg/NOTICE.txt 1970-01-01 00:00:00.000000000 +0000 +++ armadillo-7.950.1+dfsg/NOTICE.txt 2016-06-16 16:16:31.000000000 +0000 @@ -0,0 +1,6 @@ +Armadillo C++ Linear Algebra Library +Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +Copyright 2008-2016 National ICT Australia (NICTA) + +This product includes software developed by Conrad Sanderson (http://conradsanderson.id.au) +This product includes software developed at National ICT Australia (NICTA) diff -Nru armadillo-7.600.2+dfsg/README.txt armadillo-7.950.1+dfsg/README.txt --- armadillo-7.600.2+dfsg/README.txt 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/README.txt 2016-06-16 16:16:31.000000000 +0000 @@ -1,6 +1,9 @@ Armadillo C++ Linear Algebra Library http://arma.sourceforge.net +Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +Copyright 2008-2016 National ICT Australia (NICTA) + Contents @@ -8,9 +11,9 @@ 1: Introduction 2: Citation Details - 3: License + 3: Distribution License - 4: Requirements + 4: Compilers and External Dependencies 5: Linux and Mac OS X: Installation 6: Linux and Mac OS X: Compiling & Linking @@ -18,14 +21,17 @@ 7: Windows: Installation 8: Windows: Compiling & Linking - 9: Support for OpenBLAS, Intel MKL and AMD ACML + 9: Support for OpenBLAS and Intel MKL 10: Support for ATLAS +11: Support for C++11/C++14 Features +12: Support for OpenMP -11: API Documentation -12: MEX Interface to Octave/Matlab +13: API Documentation +14: API Stability and Versioning +15: Bug Reports and Frequently Asked Questions -13: Bug Reports and Frequently Asked Questions -14: Related Software +16: MEX Interface to Octave/Matlab +17: Related Software @@ -41,16 +47,16 @@ The library provides efficient classes for vectors, matrices and cubes, as well as 200+ associated functions (eg. contiguous and non-contiguous -submatrix views). Various matrix decompositions are provided through +submatrix views). Various matrix decompositions are provided through integration with LAPACK, or one of its high performance drop-in replacements -(eg. OpenBLAS, Intel MKL, AMD ACML, Apple Accelerate framework, etc). +(eg. OpenBLAS, Intel MKL, Apple Accelerate framework, etc). A sophisticated expression evaluator (via C++ template meta-programming) automatically combines several operations (at compile time) to increase speed and efficiency. The library can be used for machine learning, pattern recognition, computer vision, -signal processing, bioinformatics, statistics, econometrics, etc. +signal processing, bioinformatics, statistics, finance, etc. Authors: Conrad Sanderson - http://conradsanderson.id.au @@ -71,25 +77,33 @@ -3: License -========== +3: Distribution License +======================= -Armadillo is available as open source, under the restrictions of the -Mozilla Public License (MPL) 2.0. See the "LICENSE.txt" file for details. +Armadillo can be used in both open-source and proprietary (closed-source) software. +Armadillo is licensed under the Apache License, Version 2.0 (the "License"). +A copy of the License is included in the "LICENSE.txt" file. + +Any software that incorporates or distributes Armadillo in source or binary form +must include, in the documentation and/or other materials provided with the software, +a readable copy of the attribution notices present in the "NOTICE.txt" file. +See the License for details. The contents of the "NOTICE.txt" file are for +informational purposes only and do not modify the License. -4: Requirements -=============== + +4: Compilers and External Dependencies +====================================== Armadillo makes extensive use of template meta-programming, recursive templates -and template based function overloading. As such, C++ compilers which do not +and template based function overloading. As such, C++ compilers which do not fully implement the C++ standard may not work correctly. The functionality of Armadillo is partly dependent on other libraries: -LAPACK, BLAS, ARPACK and SuperLU. The LAPACK and BLAS libraries are +LAPACK, BLAS, ARPACK and SuperLU. The LAPACK and BLAS libraries are used for dense matrices, while the ARPACK and SuperLU libraries are -used for sparse matrices. Armadillo can work without these libraries, +used for sparse matrices. Armadillo can work without these libraries, but its functionality will be reduced. In particular, basic functionality will be available (eg. matrix addition and multiplication), but things like eigen decomposition or matrix inversion will not be. @@ -133,7 +147,7 @@ On Linux-based systems, the following libraries are recommended to be present: OpenBLAS, LAPACK, SuperLU and ARPACK. It is also necessary to install the corresponding development - files for each library. For example, when installing the "lapack" + files for each library. For example, when installing the "lapack" package, also install the "lapack-devel" or "lapack-dev" package. * Step 4: @@ -232,16 +246,16 @@ =============================== Within the "examples" folder, we have included an MSVC project named "example1_win64" -which can be used to compile "example1.cpp". The project needs to be compiled as a +which can be used to compile "example1.cpp". The project needs to be compiled as a 64 bit program: the active solution platform must be set to x64, instead of win32. -The MSCV project was tested on 64 bit Windows 7 with Visual C++ 2012. +The MSVC project was tested on 64 bit Windows 7 with Visual C++ 2012. You may need to make adaptations for 32 bit systems, later versions of Windows -and/or the compiler. For example, you may have to enable or disable -ARMA_BLAS_LONG and ARMA_BLAS_UNDERSCORE macros in "armadillo_bits/config.hpp". +and/or the compiler. For example, you may have to enable or disable +ARMA_BLAS_LONG and ARMA_BLAS_UNDERSCORE defines in "armadillo_bits/config.hpp". The folder "examples/lib_win64" contains standard LAPACK and BLAS libraries compiled -for 64 bit Windows. The compilation was done by a third party. USE AT YOUR OWN RISK. +for 64 bit Windows. The compilation was done by a third party. USE AT YOUR OWN RISK. The compiled versions of LAPACK and BLAS were obtained from: http://ylzhao.blogspot.com.au/2013/10/blas-lapack-precompiled-binaries-for.html @@ -252,10 +266,9 @@ Faster and/or alternative implementations of BLAS and LAPACK are available: http://xianyi.github.com/OpenBLAS/ http://software.intel.com/en-us/intel-mkl/ - http://developer.amd.com/tools-and-sdks/cpu-development/amd-core-math-library-acml/ http://icl.cs.utk.edu/lapack-for-windows/lapack/ -The OpenBLAS, MKL and ACML libraries are generally the fastest. +The OpenBLAS and Intel MKL libraries are generally the fastest. For better performance, we recommend the following high-quality C++ compilers: GCC from MinGW: http://www.mingw.org/ @@ -278,32 +291,29 @@ -9: Support for OpenBLAS, Intel MKL and AMD ACML -=============================================== +9: Support for OpenBLAS and Intel MKL +===================================== -Armadillo can use OpenBLAS, or Intel Math Kernel Library (MKL), -or the AMD Core Math Library (ACML) as high-speed replacements -for BLAS and LAPACK. In essence this involves linking with the +Armadillo can use OpenBLAS or Intel Math Kernel Library (MKL) as high-speed +replacements for BLAS and LAPACK. In essence this involves linking with the replacement libraries instead of BLAS and LAPACK. You may need to make minor modifications to include/armadillo_bits/config.hpp to make sure Armadillo uses the same integer sizes and style of function names -as used by MKL or ACML. Specifically, you may need comment or uncomment the -following defines: - -ARMA_USE_WRAPPER -ARMA_BLAS_CAPITALS -ARMA_BLAS_UNDERSCORE -ARMA_BLAS_LONG -ARMA_BLAS_LONG_LONG - -See the associated descriptions in include/armadillo_bits/config.hpp -for more information about the above defines. - -On Linux systems, MKL and ACML might be installed in a non-standard -location, such as /opt, which can cause problems during linking. -Before installing Armadillo, the system should know where the MKL or ACML -libraries are located. For example, "/opt/intel/mkl/lib/intel64/". +as used by the replacement libraries. Specifically, you may need comment or uncomment +the following defines: + ARMA_USE_WRAPPER + ARMA_BLAS_CAPITALS + ARMA_BLAS_UNDERSCORE + ARMA_BLAS_LONG + ARMA_BLAS_LONG_LONG + +See the documentation for more information on the above defines. + +On Linux systems, MKL might be installed in a non-standard location +such as /opt which can cause problems during linking. +Before installing Armadillo, the system should know where the MKL libraries +are located. For example, "/opt/intel/mkl/lib/intel64/". This can be achieved by setting the LD_LIBRARY_PATH environment variable, or for a more permanent solution, adding the directory locations to "/etc/ld.so.conf". It may also be possible to store a text file @@ -318,18 +328,16 @@ /opt/intel/lib/intel64 /opt/intel/mkl/lib/intel64 -The default installations of ACML 4.4.0 and MKL 10.2.2.025 are known -to have issues with SELinux, which is turned on by default in Fedora -(and possibly RHEL). The problem may manifest itself during run-time, -where the run-time linker reports permission problems. -It is possible to work around the problem by applying an appropriate -SELinux type to all ACML and MKL libraries. - -If you have ACML or MKL installed and they are persistently giving -you problems during linking, you can disable the support for them -by editing the "CMakeLists.txt" file, deleting "CMakeCache.txt" and -re-running the CMake based installation. Specifically, comment out -the lines containing: +The default installations of MKL 10.2.2.025 are known to have issues with +SELinux, which is turned on by default in Fedora and RHEL. +The problem may manifest itself during run-time, where the run-time linker +reports permission problems. It is possible to work around the problem by +applying an appropriate SELinux type to all MKL libraries. + +If you have MKL installed and its persistently giving you problems +during linking, you can disable the support for MKL by editing the +"CMakeLists.txt" file, deleting "CMakeCache.txt" and re-running +the CMake based installation. Comment out the lines containing: INCLUDE(ARMA_FindMKL) INCLUDE(ARMA_FindACMLMP) INCLUDE(ARMA_FindACML) @@ -348,64 +356,136 @@ as well as corrupting memory, leading to random crashes. Users of older Ubuntu and Debian based systems should explicitly -check that ATLAS 3.6 is not installed. It's better to +check that ATLAS 3.6 is not installed. It's better to remove the old version and use the standard LAPACK library. -11: API Documentation +11: Support for C++11 / C++14 Features +====================================== + +Armadillo works with compilers supporting the older C++98 and C++03 standards, +as well as the newer C++11 and C++14 standards. + +Armadillo will enable extra features (such as move constructors) +when a C++11/C++14 compiler is detected. You can also force Armadillo +to make use C++11 features by defining ARMA_USE_CXX11 before +#include in your code. + +You may need to explicitly enable C++11 mode in your compiler. +For example, use the -std=c++11 or -std=c++14 options in gcc & clang. + +Caveat: use of the C++11 "auto" keyword is not recommended with Armadillo +objects and expressions. Armadillo has a template meta-programming framework +which creates lots of short lived temporaries that are not handled by auto. + + + +12: Support for OpenMP +====================== + +Armadillo can use OpenMP to automatically speed up computationally +expensive element-wise functions such as exp(), log(), cos(), etc. +This requires a C++11/C++14 compiler with OpenMP 3.0+ support. + +When using gcc or clang, use the following options to enable both +C++11 and OpenMP: -std=c++11 -fopenmp + +Caveat: when using gcc, use of -march=native in conjunction with -fopenmp +may lead to speed regressions on recent processors. + + + +13: API Documentation ===================== -Documentation of functions and classes is available at: - +Documentation of functions, classes and options is available at: + http://arma.sourceforge.net/docs.html - + The documentation is also in the "docs.html" file in this folder, which can be viewed with a web browser. -12: MEX Interface to Octave/Matlab -================================== +14: API Stability and Versioning +================================ -The "mex_interface" folder contains examples of how to interface -Octave/Matlab with C++ code that uses Armadillo matrices. +Each release of Armadillo has its public API (functions, classes, constants) +described in the accompanying API documentation (docs.html) specific +to that release. + +Each release of Armadillo has its full version specified as A.B.C, +where A is a major version number, B is a minor version number, +and C is a patch level (indicating bug fixes). + +Within a major version (eg. 7), each minor version has a public API that +strongly strives to be backwards compatible (at the source level) with the +public API of preceding minor versions. For example, user code written for +version 7.100 should work with version 7.200, 7.300, 7.400, etc. However, +as later minor versions may have more features (API extensions) than +preceding minor versions, user code specifically written for version 7.400 +may not work with 7.300. + +An increase in the patch level, while the major and minor versions are retained, +indicates modifications to the code and/or documentation which aim to fix bugs +without altering the public API. + +We don't like changes to existing public API and strongly prefer not to break +any user software. However, to allow evolution, we reserve the right to +alter the public API in future major versions of Armadillo while remaining +backwards compatible in as many cases as possible (eg. major version 8 may +have slightly different public API than major version 7). + +CAVEAT: any function, class, constant or other code _not_ explicitly described +in the public API documentation is considered as part of the underlying internal +implementation details, and may change or be removed without notice. +(In other words, don't use internal functionality). -13: Bug Reports and Frequently Asked Questions +15: Bug Reports and Frequently Asked Questions ============================================== -Answers to frequently asked questions can be found at: - - http://arma.sourceforge.net/faq.html - -This library has gone through extensive testing and +Armadillo has gone through extensive testing and has been successfully used in production environments. However, as with almost all software, it's impossible to guarantee 100% correct functionality. -If you find a bug in the library (or the documentation), +If you find a bug in the library or the documentation, we are interested in hearing about it. Please make a _small_ and _self-contained_ program which exposes the bug, -and then send the program source (as well as the bug description) -to the developers. The developers' contact details are at: +and then send the program source and the bug description +to the developers. The contact details are at: http://arma.sourceforge.net/contact.html +Further information about Armadillo as well as +answers to frequently asked questions are at: + + http://arma.sourceforge.net/faq.html + + + +16: MEX Interface to Octave/Matlab +================================== + +The "mex_interface" folder contains examples of how to interface +Octave/Matlab with C++ code that uses Armadillo matrices. + -14: Related Software +17: Related Software ==================== * MLPACK: C++ library for machine learning and pattern recognition, built on top of Armadillo. http://mlpack.org +* SigPack: C++ signal processing library using Armadillo + https://sourceforge.net/projects/sigpack/ + * libpca: C++ library for principal component analysis - http://sourceforge.net/projects/libpca/ - -* ArmaNpy: interfaces Armadillo matrices with Python - http://sourceforge.net/projects/armanpy/ + https://sourceforge.net/projects/libpca/ * matlab2cpp: conversion of Matlab code to Armadillo based C++ code - https://github.com/jonathf/matlab2cpp + https://github.com/emc2norway/m2cpp diff -Nru armadillo-7.600.2+dfsg/src/wrapper.cpp armadillo-7.950.1+dfsg/src/wrapper.cpp --- armadillo-7.600.2+dfsg/src/wrapper.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/src/wrapper.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,12 +1,17 @@ -// Copyright (C) 2008-2015 National ICT Australia (NICTA) +// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au -// Written by Ryan Curtin +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/attributes.cpp armadillo-7.950.1+dfsg/tests/attributes.cpp --- armadillo-7.600.2+dfsg/tests/attributes.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/attributes.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/bounds.cpp armadillo-7.950.1+dfsg/tests/bounds.cpp --- armadillo-7.600.2+dfsg/tests/bounds.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/bounds.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/decomp_eig_gen.cpp armadillo-7.950.1+dfsg/tests/decomp_eig_gen.cpp --- armadillo-7.600.2+dfsg/tests/decomp_eig_gen.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/decomp_eig_gen.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/decomp_eig_sym.cpp armadillo-7.950.1+dfsg/tests/decomp_eig_sym.cpp --- armadillo-7.600.2+dfsg/tests/decomp_eig_sym.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/decomp_eig_sym.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/expr_elem.cpp armadillo-7.950.1+dfsg/tests/expr_elem.cpp --- armadillo-7.600.2+dfsg/tests/expr_elem.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/expr_elem.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/expr_misc.cpp armadillo-7.950.1+dfsg/tests/expr_misc.cpp --- armadillo-7.600.2+dfsg/tests/expr_misc.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/expr_misc.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/fn_abs.cpp armadillo-7.950.1+dfsg/tests/fn_abs.cpp --- armadillo-7.600.2+dfsg/tests/fn_abs.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_abs.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- -// -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include @@ -16,7 +22,7 @@ TEST_CASE("fn_abs_1") { - mat A = + mat A = "\ 0.061198 0.201990 0.019678 -0.493936 -0.126745 0.051408;\ 0.437242 0.058956 -0.149362 -0.045465 0.296153 0.035437;\ @@ -24,8 +30,8 @@ 0.336352 0.411541 0.458476 -0.393139 -0.135040 0.373833;\ 0.239585 -0.428913 -0.406953 -0.291020 -0.353768 0.258704;\ "; - - mat abs_A = + + mat abs_A = "\ 0.061198 0.201990 0.019678 0.493936 0.126745 0.051408;\ 0.437242 0.058956 0.149362 0.045465 0.296153 0.035437;\ @@ -33,53 +39,53 @@ 0.336352 0.411541 0.458476 0.393139 0.135040 0.373833;\ 0.239585 0.428913 0.406953 0.291020 0.353768 0.258704;\ "; - + mat X = abs(A); - + REQUIRE( X(0,0) == Approx(0.061198) ); REQUIRE( X(1,0) == Approx(0.437242) ); REQUIRE( X(2,0) == Approx(0.492474) ); REQUIRE( X(3,0) == Approx(0.336352) ); REQUIRE( X(4,0) == Approx(0.239585) ); - + REQUIRE( X(0,1) == Approx(0.201990) ); REQUIRE( X(1,1) == Approx(0.058956) ); REQUIRE( X(2,1) == Approx(0.031309) ); REQUIRE( X(3,1) == Approx(0.411541) ); REQUIRE( X(4,1) == Approx(0.428913) ); - + REQUIRE( X(0,5) == Approx(0.051408) ); REQUIRE( X(1,5) == Approx(0.035437) ); REQUIRE( X(2,5) == Approx(0.454499) ); REQUIRE( X(3,5) == Approx(0.373833) ); REQUIRE( X(4,5) == Approx(0.258704) ); - + mat Y = abs(2*A) / 2; - + REQUIRE( Y(0,0) == Approx(0.061198) ); REQUIRE( Y(1,0) == Approx(0.437242) ); REQUIRE( Y(2,0) == Approx(0.492474) ); REQUIRE( Y(3,0) == Approx(0.336352) ); REQUIRE( Y(4,0) == Approx(0.239585) ); - + REQUIRE( Y(0,1) == Approx(0.201990) ); REQUIRE( Y(1,1) == Approx(0.058956) ); REQUIRE( Y(2,1) == Approx(0.031309) ); REQUIRE( Y(3,1) == Approx(0.411541) ); REQUIRE( Y(4,1) == Approx(0.428913) ); - + REQUIRE( Y(0,5) == Approx(0.051408) ); REQUIRE( Y(1,5) == Approx(0.035437) ); REQUIRE( Y(2,5) == Approx(0.454499) ); REQUIRE( Y(3,5) == Approx(0.373833) ); REQUIRE( Y(4,5) == Approx(0.258704) ); - + REQUIRE( accu( abs(A) - abs_A ) == Approx(0.0) ); REQUIRE( accu( 2*abs(A) - 2*abs_A ) == Approx(0.0) ); - + REQUIRE( accu( abs(-A) - abs_A ) == Approx(0.0) ); REQUIRE( accu( 2*abs(-A) - 2*abs_A ) == Approx(0.0) ); - + // REQUIRE_THROWS( ); } @@ -87,7 +93,7 @@ TEST_CASE("fn_abs_2") { - mat A = + mat A = "\ 0.061198 0.201990 0.019678 -0.493936 -0.126745 0.051408;\ 0.437242 0.058956 -0.149362 -0.045465 0.296153 0.035437;\ @@ -95,9 +101,9 @@ 0.336352 0.411541 0.458476 -0.393139 -0.135040 0.373833;\ 0.239585 -0.428913 -0.406953 -0.291020 -0.353768 0.258704;\ "; - + cx_mat C = cx_mat(A,fliplr(A)); - + mat abs_C = "\ 0.079925 0.238462 0.494328 0.494328 0.238462 0.079925;\ @@ -106,29 +112,29 @@ 0.502876 0.433130 0.603952 0.603952 0.433130 0.502876;\ 0.352603 0.555984 0.500303 0.500303 0.555984 0.352603;\ "; - + mat X = abs(C); - + REQUIRE( X(0,0) == Approx(0.079925) ); REQUIRE( X(1,0) == Approx(0.438676) ); REQUIRE( X(2,0) == Approx(0.670149) ); REQUIRE( X(3,0) == Approx(0.502876) ); REQUIRE( X(4,0) == Approx(0.352603) ); - + REQUIRE( X(0,1) == Approx(0.238462) ); REQUIRE( X(1,1) == Approx(0.301964) ); REQUIRE( X(2,1) == Approx(0.075150) ); REQUIRE( X(3,1) == Approx(0.433130) ); REQUIRE( X(4,1) == Approx(0.555984) ); - + REQUIRE( X(0,5) == Approx(0.079925) ); REQUIRE( X(1,5) == Approx(0.438676) ); REQUIRE( X(2,5) == Approx(0.670149) ); REQUIRE( X(3,5) == Approx(0.502876) ); REQUIRE( X(4,5) == Approx(0.352603) ); - + REQUIRE( accu( abs(C) - abs_C ) == Approx(0.0) ); - + // REQUIRE_THROWS( ); } @@ -138,9 +144,9 @@ { vec re = 2*linspace(1,5,6); vec im = -4*linspace(1,5,6); - + cx_vec a(re,im); - + vec b = { 4.47213595499958, @@ -150,20 +156,20 @@ 18.78297101099824, 22.36067977499790 }; - - + + vec c = abs(a); - + REQUIRE( accu(c - b) == Approx(0.0) ); REQUIRE( accu(abs(a) - b) == Approx(0.0) ); } - + TEST_CASE("fn_abs_4") { vec a = -2*linspace(1,5,6); vec b = +2*linspace(1,5,6); - + REQUIRE( accu(abs(a) - b) == Approx(0.0) ); REQUIRE( accu(abs(a(span::all)) - b(span::all)) == Approx(0.0) ); } @@ -177,3 +183,67 @@ REQUIRE( accu(abs(-2*A) - (2*A)) == Approx(0.0) ); REQUIRE( accu(abs(-2*A(span::all,span::all)) - (2*A(span::all,span::all))) == Approx(0.0) ); } + + + +TEST_CASE("fn_abs_sp_mat") + { + SpMat a(3, 3); + a(0, 2) = 4.3; + a(1, 1) = -5.5; + a(2, 2) = -6.3; + + SpMat b = abs(a); + + REQUIRE( (double) b(0, 0) == 0 ); + REQUIRE( (double) b(1, 0) == 0 ); + REQUIRE( (double) b(2, 0) == 0 ); + REQUIRE( (double) b(0, 1) == 0 ); + REQUIRE( (double) b(1, 1) == Approx(5.5) ); + REQUIRE( (double) b(2, 1) == 0 ); + REQUIRE( (double) b(0, 2) == Approx(4.3) ); + REQUIRE( (double) b(1, 2) == 0 ); + REQUIRE( (double) b(2, 2) == Approx(6.3) ); + + // Just test that these compile and run. + b = abs(a); + b *= abs(a); + b %= abs(a); + b /= abs(a); + } + + + +TEST_CASE("fn_abs_sp_mat_2") + { + mat x = randu(100, 100); + x -= 0.5; + + SpMat y(x); + + mat xr = abs(x); + SpMat yr = abs(y); + + for(size_t i = 0; i < xr.n_elem; ++i) + { + REQUIRE( xr[i] == Approx((double) yr[i]) ); + } + } + + + +TEST_CASE("fn_abs_sp_cx_mat") + { + cx_mat x = randu(100, 100); + x -= cx_double(0.5, 0.5); + + sp_cx_mat y(x); + + mat xr = abs(x); + SpMat yr = abs(y); + + for(size_t i = 0; i < xr.n_elem; ++i) + { + REQUIRE( xr[i] == Approx((double) yr[i]) ); + } + } diff -Nru armadillo-7.600.2+dfsg/tests/fn_accu.cpp armadillo-7.950.1+dfsg/tests/fn_accu.cpp --- armadillo-7.600.2+dfsg/tests/fn_accu.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_accu.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- -// -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include @@ -16,7 +22,7 @@ TEST_CASE("fn_accu_1") { - mat A = + mat A = "\ 0.061198 0.201990 0.019678 -0.493936 -0.126745 0.051408;\ 0.437242 0.058956 -0.149362 -0.045465 0.296153 0.035437;\ @@ -24,7 +30,7 @@ 0.336352 0.411541 0.458476 -0.393139 -0.135040 0.373833;\ 0.239585 -0.428913 -0.406953 -0.291020 -0.353768 0.258704;\ "; - + REQUIRE( accu(A) == Approx( 0.240136) ); REQUIRE( accu(abs(A)) == Approx( 7.845382) ); REQUIRE( accu(A-A) == Approx( 0.0 ) ); @@ -38,16 +44,16 @@ REQUIRE( accu(A.row(1)) == Approx( 0.632961) ); REQUIRE( accu(2*A.col(1)) == Approx( 0.424530) ); REQUIRE( accu(2*A.row(1)) == Approx( 1.265922) ); - + REQUIRE( accu(A%A) == Approx(2.834218657806) ); REQUIRE( accu(A*A.t()) == Approx(1.218704694166) ); REQUIRE( accu(A.t()*A) == Approx(2.585464740700) ); - + REQUIRE( accu(vectorise(A)) == Approx(0.240136) ); - + REQUIRE( accu( A(span(1,3), span(1,4)) ) == Approx(1.273017) ); REQUIRE( accu( 2*A(span(1,3), span(1,4)) ) == Approx(2.546034) ); - + REQUIRE_THROWS( accu(A*A) ); } @@ -55,7 +61,7 @@ TEST_CASE("fn_accu_2") { - mat A = + mat A = "\ 0.061198 0.201990 0.019678 -0.493936 -0.126745 0.051408;\ 0.437242 0.058956 -0.149362 -0.045465 0.296153 0.035437;\ @@ -63,17 +69,17 @@ 0.336352 0.411541 0.458476 -0.393139 -0.135040 0.373833;\ 0.239585 -0.428913 -0.406953 -0.291020 -0.353768 0.258704;\ "; - + cx_mat C = cx_mat(A, 2*fliplr(A)); cx_mat D = cx_mat(2*fliplr(A), A); - + REQUIRE( abs(accu(C) - cx_double(0.240136, +0.480272)) == Approx(0.0) ); - + REQUIRE( abs(accu(cx_double(2,3)*C) - cx_double(-0.960544000000001, +1.680951999999999)) == Approx(0.0) ); - + REQUIRE( abs(accu(C*D.t() ) - cx_double(-0.710872588088, +3.656114082498002)) == Approx(0.0) ); REQUIRE( abs(accu(C*D.st()) - cx_double(0.0, +6.093523470830000)) == Approx(0.0) ); - + REQUIRE( abs(accu(C.t() *D) - cx_double(10.341858962800, -7.756394222100000)) == Approx(0.0) ); REQUIRE( abs(accu(C.st()*D) - cx_double(0.0, +1.29273237035e+01)) == Approx(0.0) ); } @@ -85,7 +91,7 @@ vec a = linspace(1,5,5); vec b = linspace(1,5,6); vec c = -linspace(1,5,6); - + REQUIRE(accu(a) == Approx( 15.0)); REQUIRE(accu(b) == Approx( 18.0)); REQUIRE(accu(c) == Approx(-18.0)); @@ -98,13 +104,13 @@ mat A(5,6); A.fill(2.0); mat B(5,6); B.fill(4.0); mat C(6,5); C.fill(6.0); - + REQUIRE( accu(A + B) == Approx(double((2+4)*(A.n_rows*A.n_cols))) ); REQUIRE( accu(A(span::all,span::all) + B(span::all,span::all)) == Approx(double((2+4)*(A.n_rows*A.n_cols))) ); - + REQUIRE( accu(A % B) == Approx(double((2*4)*(A.n_rows*A.n_cols))) ); REQUIRE( accu(A(span::all,span::all) % B(span::all,span::all)) == Approx(double((2*4)*(A.n_rows*A.n_cols))) ); - + // A and C matrices are non-conformat, so accu() will throw unless ARMA_NO_DEBUG is defined REQUIRE_THROWS( accu(A % C) ); REQUIRE_THROWS( accu(A(span::all,span::all) % C(span::all,span::all)) ); @@ -112,3 +118,15 @@ +TEST_CASE("fn_accu_spmat") + { + SpMat b(4, 4); + b(0, 1) = 6; + b(1, 3) = 15; + b(3, 1) = 14; + b(2, 0) = 5; + b(3, 3) = 12; + + REQUIRE( accu(b) == 52 ); + REQUIRE( accu(b.submat(1, 1, 3, 3)) == 41 ); + } diff -Nru armadillo-7.600.2+dfsg/tests/fn_all.cpp armadillo-7.950.1+dfsg/tests/fn_all.cpp --- armadillo-7.600.2+dfsg/tests/fn_all.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_all.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/fn_any.cpp armadillo-7.950.1+dfsg/tests/fn_any.cpp --- armadillo-7.600.2+dfsg/tests/fn_any.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_any.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/fn_as_scalar.cpp armadillo-7.950.1+dfsg/tests/fn_as_scalar.cpp --- armadillo-7.600.2+dfsg/tests/fn_as_scalar.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_as_scalar.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/fn_clamp.cpp armadillo-7.950.1+dfsg/tests/fn_clamp.cpp --- armadillo-7.600.2+dfsg/tests/fn_clamp.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_clamp.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/fn_cond.cpp armadillo-7.950.1+dfsg/tests/fn_cond.cpp --- armadillo-7.600.2+dfsg/tests/fn_cond.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_cond.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/fn_conj.cpp armadillo-7.950.1+dfsg/tests/fn_conj.cpp --- armadillo-7.600.2+dfsg/tests/fn_conj.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_conj.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/fn_conv.cpp armadillo-7.950.1+dfsg/tests/fn_conv.cpp --- armadillo-7.600.2+dfsg/tests/fn_conv.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_conv.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/fn_conv_to.cpp armadillo-7.950.1+dfsg/tests/fn_conv_to.cpp --- armadillo-7.600.2+dfsg/tests/fn_conv_to.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_conv_to.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/fn_cor.cpp armadillo-7.950.1+dfsg/tests/fn_cor.cpp --- armadillo-7.600.2+dfsg/tests/fn_cor.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_cor.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/fn_cov.cpp armadillo-7.950.1+dfsg/tests/fn_cov.cpp --- armadillo-7.600.2+dfsg/tests/fn_cov.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_cov.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/fn_cross.cpp armadillo-7.950.1+dfsg/tests/fn_cross.cpp --- armadillo-7.600.2+dfsg/tests/fn_cross.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_cross.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/fn_cumprod.cpp armadillo-7.950.1+dfsg/tests/fn_cumprod.cpp --- armadillo-7.600.2+dfsg/tests/fn_cumprod.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_cumprod.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/fn_cumsum.cpp armadillo-7.950.1+dfsg/tests/fn_cumsum.cpp --- armadillo-7.600.2+dfsg/tests/fn_cumsum.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_cumsum.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/fn_det.cpp armadillo-7.950.1+dfsg/tests/fn_det.cpp --- armadillo-7.600.2+dfsg/tests/fn_det.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_det.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include @@ -59,7 +65,7 @@ } -TEST_CASE("fn_det_") +TEST_CASE("fn_det_3") { mat A = toeplitz(linspace(1,5,6)); diff -Nru armadillo-7.600.2+dfsg/tests/fn_diagmat.cpp armadillo-7.950.1+dfsg/tests/fn_diagmat.cpp --- armadillo-7.600.2+dfsg/tests/fn_diagmat.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_diagmat.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/fn_diagvec.cpp armadillo-7.950.1+dfsg/tests/fn_diagvec.cpp --- armadillo-7.600.2+dfsg/tests/fn_diagvec.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_diagvec.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/fn_diff.cpp armadillo-7.950.1+dfsg/tests/fn_diff.cpp --- armadillo-7.600.2+dfsg/tests/fn_diff.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_diff.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/fn_dot.cpp armadillo-7.950.1+dfsg/tests/fn_dot.cpp --- armadillo-7.600.2+dfsg/tests/fn_dot.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_dot.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- -// -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include @@ -16,7 +22,7 @@ TEST_CASE("fn_dot_1") { - mat A = + mat A = "\ 0.061198 0.201990 0.019678 -0.493936 -0.126745;\ 0.437242 0.058956 -0.149362 -0.045465 0.296153;\ @@ -24,19 +30,19 @@ 0.336352 0.411541 0.458476 -0.393139 -0.135040;\ 0.239585 -0.428913 -0.406953 -0.291020 -0.353768;\ "; - + vec a = A.head_cols(1); vec b = A.tail_cols(1); - + rowvec c = A.head_rows(1); rowvec d = A.tail_rows(1); - + REQUIRE( dot( a, b) == Approx(-0.04208883710200) ); REQUIRE( dot(2*a,2+b) == Approx( 2.24343432579600) ); - + REQUIRE( dot( c, d) == Approx( 0.108601544706000) ); REQUIRE( dot(0.5*c,2-d) == Approx(-0.392115772353000) ); - + REQUIRE( dot(a,b) == Approx( dot(A.head_cols(1), A.tail_cols(1)) ) ); REQUIRE( dot(c,d) == Approx( dot(A.head_rows(1), A.tail_rows(1)) ) ); } @@ -45,7 +51,7 @@ TEST_CASE("fn_dot_2") { - mat A = + mat A = "\ 0.061198 0.201990 0.019678 -0.493936 -0.126745;\ 0.437242 0.058956 -0.149362 -0.045465 0.296153;\ @@ -53,19 +59,65 @@ 0.336352 0.411541 0.458476 -0.393139 -0.135040;\ 0.239585 -0.428913 -0.406953 -0.291020 -0.353768;\ "; - + cx_vec a = cx_vec(A.col(0), A.col(1)); cx_vec b = cx_vec(A.col(2), A.col(3)); - + cx_rowvec c = cx_rowvec(A.row(0), A.row(1)); cx_rowvec d = cx_rowvec(A.row(2), A.row(3)); - + REQUIRE( abs( dot(a,b) - cx_double(-0.009544718641000, -0.110209641379000)) == Approx(0.0) ); REQUIRE( abs( dot(c,d) - cx_double(-0.326993347830000, +0.061084261990000)) == Approx(0.0) ); - + REQUIRE( abs(cdot(a,b) - cx_double(-0.314669805873000, -0.807333974477000)) == Approx(0.0) ); REQUIRE( abs(cdot(c,d) - cx_double(-0.165527940664000, +0.586984291846000)) == Approx(0.0) ); } + +TEST_CASE("fn_dot_sp_mat_mat") + { + // Make matrices. + SpMat a("3.0 0.0 0.0; 1.0 2.0 2.0; 0.0 0.0 1.0"); + Mat b("1.0 2.0 1.0; 1.0 2.0 2.0; 3.0 4.0 5.0"); + + REQUIRE( dot(a, b) == Approx(17.0) ); + REQUIRE( dot(b, a) == Approx(17.0) ); + } + + + +TEST_CASE("fn_dot_sp_col_col") + { + SpCol a("3; 4; 0; 0; 0; 2; 0; 0"); + Col b("1 6 1 2 3 7 1 2"); + + REQUIRE( dot(a, b) == 41 ); + REQUIRE( dot(b, a) == 41 ); + } + + + +TEST_CASE("fn_dot_sp_mat_sp_mat") + { + SpMat a("3.0 0.0 0.0; 1.0 2.0 2.0; 0.0 0.0 1.0"); + SpMat b("3.0 0.0 0.0; 1.0 2.0 2.0; 0.0 0.0 1.0"); + + REQUIRE( dot(a, b) == Approx(19.0) ); + REQUIRE( dot(b, a) == Approx(19.0) ); + } + + + +TEST_CASE("fn_dot_sp_col_sp_col") + { + SpCol a("3; 4; 0; 0; 0; 2; 0; 0"); + SpCol b("0; 8; 0; 1; 1; 0; 0; 0"); + + REQUIRE( dot(a, b) == 32 ); + REQUIRE( dot(b, a) == 32 ); + } + + + // TODO: norm_dot diff -Nru armadillo-7.600.2+dfsg/tests/fn_eigs_gen.cpp armadillo-7.950.1+dfsg/tests/fn_eigs_gen.cpp --- armadillo-7.600.2+dfsg/tests/fn_eigs_gen.cpp 1970-01-01 00:00:00.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_eigs_gen.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -0,0 +1,453 @@ +// Copyright 2011-2017 Ryan Curtin (http://www.ratml.org/) +// Copyright 2017 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + +#include + +#include "catch.hpp" + +using namespace arma; + +TEST_CASE("fn_eigs_gen_odd_test") + { + const uword n_rows = 10; + const uword n_eigval = 5; + for (size_t trial = 0; trial < 10; ++trial) + { + sp_mat m; + m.sprandu(n_rows, n_rows, 0.3); + mat d(m); + + // Eigendecompose, getting first 5 eigenvectors. + Col< std::complex > sp_eigval; + Mat< std::complex > sp_eigvec; + eigs_gen(sp_eigval, sp_eigvec, m, n_eigval); + + // Do the same for the dense case. + Col< std::complex > eigval; + Mat< std::complex > eigvec; + eig_gen(eigval, eigvec, d); + + uvec used(n_rows); + used.fill(0); + + for (size_t i = 0; i < n_eigval; ++i) + { + // Sorting these is a super bitch. + // Find which one is the likely dense eigenvalue. + uword dense_eval = n_rows + 1; + for (uword k = 0; k < n_rows; ++k) + { + if ((std::abs(std::complex(sp_eigval[i]).real() - eigval[k].real()) < 1e-4) && + (std::abs(std::complex(sp_eigval[i]).imag() - eigval[k].imag()) < 1e-4) && + (used[k] == 0)) + { + dense_eval = k; + used[k] = 1; + break; + } + } + + REQUIRE( dense_eval != n_rows + 1 ); + + REQUIRE( std::abs(sp_eigval[i]) == Approx(std::abs(eigval[dense_eval])).epsilon(0.1) ); + for (uword j = 0; j < n_rows; ++j) + { + REQUIRE( std::abs(sp_eigvec(j, i)) == Approx(std::abs(eigvec(j, dense_eval))).epsilon(0.1) ); + } + } + } + } + + + +TEST_CASE("fn_eigs_gen_even_test") + { + const uword n_rows = 10; + const uword n_eigval = 4; + for (size_t trial = 0; trial < 10; ++trial) + { + sp_mat m; + m.sprandu(n_rows, n_rows, 0.3); + sp_mat z(5, 5); + z.sprandu(5, 5, 0.5); + m.submat(2, 2, 6, 6) += 5 * z; + mat d(m); + + // Eigendecompose, getting first 5 eigenvectors. + Col< std::complex > sp_eigval; + Mat< std::complex > sp_eigvec; + eigs_gen(sp_eigval, sp_eigvec, m, n_eigval); + + // Do the same for the dense case. + Col< std::complex > eigval; + Mat< std::complex > eigvec; + eig_gen(eigval, eigvec, d); + + uvec used(n_rows); + used.fill(0); + + for (size_t i = 0; i < n_eigval; ++i) + { + // Sorting these is a super bitch. + // Find which one is the likely dense eigenvalue. + uword dense_eval = n_rows + 1; + for (uword k = 0; k < n_rows; ++k) + { + if ((std::abs(std::complex(sp_eigval[i]).real() - eigval[k].real()) < 1e-4) && + (std::abs(std::complex(sp_eigval[i]).imag() - eigval[k].imag()) < 1e-4) && + (used[k] == 0)) + { + dense_eval = k; + used[k] = 1; + break; + } + } + + REQUIRE( dense_eval != n_rows + 1 ); + + REQUIRE( std::abs(sp_eigval[i]) == Approx(std::abs(eigval[dense_eval])).epsilon(0.01) ); + for (uword j = 0; j < n_rows; ++j) + { + REQUIRE( std::abs(sp_eigvec(j, i)) == Approx(std::abs(eigvec(j, dense_eval))).epsilon(0.01) ); + } + } + } + } + + + +TEST_CASE("fn_eigs_gen_odd_float_test") + { + const uword n_rows = 10; + const uword n_eigval = 5; + for (size_t trial = 0; trial < 10; ++trial) + { + SpMat m; + m.sprandu(n_rows, n_rows, 0.3); + for (uword i = 0; i < n_rows; ++i) + { + m(i, i) += 5 * double(i) / double(n_rows); + } + Mat d(m); + + // Eigendecompose, getting first 5 eigenvectors. + Col< std::complex > sp_eigval; + Mat< std::complex > sp_eigvec; + eigs_gen(sp_eigval, sp_eigvec, m, n_eigval); + + // Do the same for the dense case. + Col< std::complex > eigval; + Mat< std::complex > eigvec; + eig_gen(eigval, eigvec, d); + + uvec used(n_rows); + used.fill(0); + + for (size_t i = 0; i < n_eigval; ++i) + { + // Sorting these is a super bitch. + // Find which one is the likely dense eigenvalue. + uword dense_eval = n_rows + 1; + for (uword k = 0; k < n_rows; ++k) + { + if ((std::abs(std::complex(sp_eigval[i]).real() - eigval[k].real()) < 0.001) && + (std::abs(std::complex(sp_eigval[i]).imag() - eigval[k].imag()) < 0.001) && + (used[k] == 0)) + { + dense_eval = k; + used[k] = 1; + break; + } + } + + REQUIRE( dense_eval != n_rows + 1 ); + + REQUIRE( std::abs(sp_eigval[i]) == Approx(std::abs(eigval[dense_eval])).epsilon(0.001) ); + for (uword j = 0; j < n_rows; ++j) + { + REQUIRE( std::abs(sp_eigvec(j, i)) == Approx(std::abs(eigvec(j, dense_eval))).epsilon(0.01) ); + } + } + } + } + + + +TEST_CASE("fn_eigs_gen_even_float_test") + { + const uword n_rows = 12; + const uword n_eigval = 8; + for (size_t trial = 0; trial < 10; ++trial) + { + SpMat m; + m.sprandu(n_rows, n_rows, 0.3); + for (uword i = 0; i < n_rows; ++i) + { + m(i, i) += 5 * double(i) / double(n_rows); + } + Mat d(m); + + // Eigendecompose, getting first 5 eigenvectors. + Col< std::complex > sp_eigval; + Mat< std::complex > sp_eigvec; + eigs_gen(sp_eigval, sp_eigvec, m, n_eigval); + + // Do the same for the dense case. + Col< std::complex > eigval; + Mat< std::complex > eigvec; + eig_gen(eigval, eigvec, d); + + uvec used(n_rows); + used.fill(0); + + for (size_t i = 0; i < n_eigval; ++i) + { + // Sorting these is a super bitch. + // Find which one is the likely dense eigenvalue. + uword dense_eval = n_rows + 1; + for (uword k = 0; k < n_rows; ++k) + { + if ((std::abs(std::complex(sp_eigval[i]).real() - eigval[k].real()) < 0.001) && + (std::abs(std::complex(sp_eigval[i]).imag() - eigval[k].imag()) < 0.001) && + (used[k] == 0)) + { + dense_eval = k; + used[k] = 1; + break; + } + } + + REQUIRE( dense_eval != n_rows + 1 ); + + REQUIRE( std::abs(sp_eigval[i]) == Approx(std::abs(eigval[dense_eval])).epsilon(0.01) ); + for (uword j = 0; j < n_rows; ++j) + { + REQUIRE( std::abs(sp_eigvec(j, i)) == Approx(std::abs(eigvec(j, dense_eval))).epsilon(0.01) ); + } + } + } + } + + + +TEST_CASE("fn_eigs_gen_odd_complex_float_test") + { + const uword n_rows = 10; + const uword n_eigval = 5; + for (size_t trial = 0; trial < 10; ++trial) + { + SpMat< std::complex > m; + m.sprandu(n_rows, n_rows, 0.3); + Mat< std::complex > d(m); + + // Eigendecompose, getting first 5 eigenvectors. + Col< std::complex > sp_eigval; + Mat< std::complex > sp_eigvec; + eigs_gen(sp_eigval, sp_eigvec, m, n_eigval); + + // Do the same for the dense case. + Col< std::complex > eigval; + Mat< std::complex > eigvec; + eig_gen(eigval, eigvec, d); + + uvec used(n_rows); + used.fill(0); + + for (size_t i = 0; i < n_eigval; ++i) + { + // Sorting these is a super bitch. + // Find which one is the likely dense eigenvalue. + uword dense_eval = n_rows + 1; + for (uword k = 0; k < n_rows; ++k) + { + if ((std::abs(std::complex(sp_eigval[i]).real() - eigval[k].real()) < 0.001) && + (std::abs(std::complex(sp_eigval[i]).imag() - eigval[k].imag()) < 0.001) && + (used[k] == 0)) + { + dense_eval = k; + used[k] = 1; + break; + } + } + + REQUIRE( dense_eval != n_rows + 1 ); + + REQUIRE( std::abs(sp_eigval[i]) == Approx(std::abs(eigval[dense_eval])).epsilon(0.01) ); + for (uword j = 0; j < n_rows; ++j) + { + REQUIRE( std::abs(sp_eigvec(j, i)) == Approx(std::abs(eigvec(j, dense_eval))).epsilon(0.01) ); + } + } + } + } + + + +TEST_CASE("fn_eigs_gen_even_complex_float_test") + { + const uword n_rows = 12; + const uword n_eigval = 8; + for (size_t trial = 0; trial < 10; ++trial) + { + SpMat< std::complex > m; + m.sprandu(n_rows, n_rows, 0.3); + Mat< std::complex > d(m); + + // Eigendecompose, getting first 5 eigenvectors. + Col< std::complex > sp_eigval; + Mat< std::complex > sp_eigvec; + eigs_gen(sp_eigval, sp_eigvec, m, n_eigval); + + // Do the same for the dense case. + Col< std::complex > eigval; + Mat< std::complex > eigvec; + eig_gen(eigval, eigvec, d); + + uvec used(n_rows); + used.fill(0); + + for (size_t i = 0; i < n_eigval; ++i) + { + // Sorting these is a super bitch. + // Find which one is the likely dense eigenvalue. + uword dense_eval = n_rows + 1; + for (uword k = 0; k < n_rows; ++k) + { + if ((std::abs(std::complex(sp_eigval[i]).real() - eigval[k].real()) < 0.001) && + (std::abs(std::complex(sp_eigval[i]).imag() - eigval[k].imag()) < 0.001) && + (used[k] == 0)) + { + dense_eval = k; + used[k] = 1; + break; + } + } + + REQUIRE( dense_eval != n_rows + 1 ); + + REQUIRE( std::abs(sp_eigval[i]) == Approx(std::abs(eigval[dense_eval])).epsilon(0.01) ); + for (uword j = 0; j < n_rows; ++j) + { + REQUIRE( std::abs(sp_eigvec(j, i)) == Approx(std::abs(eigvec(j, dense_eval))).epsilon(0.01) ); + } + } + } + } + + + +TEST_CASE("eigs_gen_odd_complex_test") + { + const uword n_rows = 10; + const uword n_eigval = 5; + for (size_t trial = 0; trial < 10; ++trial) + { + SpMat< std::complex > m; + m.sprandu(n_rows, n_rows, 0.3); + Mat< std::complex > d(m); + + // Eigendecompose, getting first 5 eigenvectors. + Col< std::complex > sp_eigval; + Mat< std::complex > sp_eigvec; + eigs_gen(sp_eigval, sp_eigvec, m, n_eigval); + + // Do the same for the dense case. + Col< std::complex > eigval; + Mat< std::complex > eigvec; + eig_gen(eigval, eigvec, d); + + uvec used(n_rows); + used.fill(0); + + for (size_t i = 0; i < n_eigval; ++i) + { + // Sorting these is a super bitch. + // Find which one is the likely dense eigenvalue. + uword dense_eval = n_rows + 1; + for (uword k = 0; k < n_rows; ++k) + { + if ((std::abs(std::complex(sp_eigval[i]).real() - eigval[k].real()) < 1e-10) && + (std::abs(std::complex(sp_eigval[i]).imag() - eigval[k].imag()) < 1e-10) && + (used[k] == 0)) + { + dense_eval = k; + used[k] = 1; + break; + } + } + + REQUIRE( dense_eval != n_rows + 1 ); + + REQUIRE( std::abs(sp_eigval[i]) == Approx(std::abs(eigval[dense_eval])).epsilon(0.01) ); + for (size_t j = 0; j < n_rows; ++j) + { + REQUIRE( std::abs(sp_eigvec(j, i)) == Approx(std::abs(eigvec(j, dense_eval))).epsilon(0.01) ); + } + } + } + } + + + +TEST_CASE("fn_eigs_gen_even_complex_test") + { + const uword n_rows = 15; + const uword n_eigval = 6; + for (size_t trial = 0; trial < 10; ++trial) + { + SpMat< std::complex > m; + m.sprandu(n_rows, n_rows, 0.3); + Mat< std::complex > d(m); + + // Eigendecompose, getting first 5 eigenvectors. + Col< std::complex > sp_eigval; + Mat< std::complex > sp_eigvec; + eigs_gen(sp_eigval, sp_eigvec, m, n_eigval); + + // Do the same for the dense case. + Col< std::complex > eigval; + Mat< std::complex > eigvec; + eig_gen(eigval, eigvec, d); + + uvec used(n_rows); + used.fill(0); + + for (size_t i = 0; i < n_eigval; ++i) + { + // Sorting these is a super bitch. + // Find which one is the likely dense eigenvalue. + uword dense_eval = n_rows + 1; + for (uword k = 0; k < n_rows; ++k) + { + if ((std::abs(std::complex(sp_eigval[i]).real() - eigval[k].real()) < 1e-10) && + (std::abs(std::complex(sp_eigval[i]).imag() - eigval[k].imag()) < 1e-10) && + (used[k] == 0)) + { + dense_eval = k; + used[k] = 1; + break; + } + } + + REQUIRE( dense_eval != n_rows + 1 ); + + REQUIRE( std::abs(sp_eigval[i]) == Approx(std::abs(eigval[dense_eval])).epsilon(0.01) ); + for (uword j = 0; j < n_rows; ++j) + { + REQUIRE( std::abs(sp_eigvec(j, i)) == Approx(std::abs(eigvec(j, dense_eval))).epsilon(0.01) ); + } + } + } + } diff -Nru armadillo-7.600.2+dfsg/tests/fn_eigs_sym.cpp armadillo-7.950.1+dfsg/tests/fn_eigs_sym.cpp --- armadillo-7.600.2+dfsg/tests/fn_eigs_sym.cpp 1970-01-01 00:00:00.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_eigs_sym.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -0,0 +1,139 @@ +// Copyright 2011-2017 Ryan Curtin (http://www.ratml.org/) +// Copyright 2017 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + +#include + +#include "catch.hpp" + +using namespace arma; + +TEST_CASE("fn_eigs_test") + { + for (size_t trial = 0; trial < 10; ++trial) + { + // Test ARPACK decomposition of sparse matrices. + sp_mat m(1000, 1000); + sp_vec dd; + for (size_t i = 0; i < 10; ++i) + { + dd.sprandu(1000, 1, 0.15); + double eig = rand(); + m += eig * dd * dd.t(); + } + mat d(m); + + // Eigendecompose, getting first 5 eigenvectors. + vec sp_eigval; + mat sp_eigvec; + eigs_sym(sp_eigval, sp_eigvec, m, 5); + + // Do the same for the dense case. + vec eigval; + mat eigvec; + eig_sym(eigval, eigvec, d); + + for (uword i = 0; i < 5; ++i) + { + // It may be pointed the wrong direction. + REQUIRE( sp_eigval[i] == Approx(eigval[i + 995]).epsilon(0.01) ); + + for (uword j = 0; j < 1000; ++j) + { + REQUIRE( std::abs(sp_eigvec(j, i)) == + Approx(std::abs(eigvec(j, i + 995))).epsilon(0.01) ); + } + } + } + } + + + +TEST_CASE("fn_eigs_float_test") + { + for (size_t trial = 0; trial < 10; ++trial) + { + // Test ARPACK decomposition of sparse matrices. + SpMat m(100, 100); + SpCol dd; + for (size_t i = 0; i < 10; ++i) + { + dd.sprandu(100, 1, 0.15); + float eig = rand(); + m += 0.000001 * eig * dd * dd.t(); + } + Mat d(m); + + // Eigendecompose, getting first 5 eigenvectors. + Col sp_eigval; + Mat sp_eigvec; + eigs_sym(sp_eigval, sp_eigvec, m, 5); + + // Do the same for the dense case. + Col eigval; + Mat eigvec; + eig_sym(eigval, eigvec, d); + + for (uword i = 0; i < 5; ++i) + { + // It may be pointed the wrong direction. + REQUIRE( sp_eigval[i] == Approx(eigval[i + 95]).epsilon(0.01) ); + + for (uword j = 0; j < 100; ++j) + { + REQUIRE(std::abs(sp_eigvec(j, i)) == + Approx(std::abs(eigvec(j, i + 95))).epsilon(0.01) ); + } + } + } + } + + + +TEST_CASE("fn_eigs_sm_test") + { + for (size_t trial = 0; trial < 10; ++trial) + { + // Test ARPACK decomposition of sparse matrices. + sp_mat m(100, 100); + sp_vec dd; + for (uword i = 0; i < 100; ++i) + { + m(i, i) = i + 10; + } + mat d(m); + + // Eigendecompose, getting first 5 eigenvectors. + vec sp_eigval; + mat sp_eigvec; + eigs_sym(sp_eigval, sp_eigvec, m, 5, "sm"); + + // Do the same for the dense case. + vec eigval; + mat eigvec; + eig_sym(eigval, eigvec, d); + + for (size_t i = 0; i < 5; ++i) + { + // It may be pointed the wrong direction. + REQUIRE( sp_eigval[i] == Approx(eigval[i]).epsilon(0.01) ); + + for (size_t j = 0; j < 100; ++j) + { + REQUIRE( std::abs(sp_eigvec(j, i)) == + Approx(std::abs(eigvec(j, i))).epsilon(0.01) ); + } + } + } + } diff -Nru armadillo-7.600.2+dfsg/tests/fn_eps.cpp armadillo-7.950.1+dfsg/tests/fn_eps.cpp --- armadillo-7.600.2+dfsg/tests/fn_eps.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_eps.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/fn_expmat.cpp armadillo-7.950.1+dfsg/tests/fn_expmat.cpp --- armadillo-7.600.2+dfsg/tests/fn_expmat.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_expmat.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/fn_find.cpp armadillo-7.950.1+dfsg/tests/fn_find.cpp --- armadillo-7.600.2+dfsg/tests/fn_find.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_find.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/fn_find_finite.cpp armadillo-7.950.1+dfsg/tests/fn_find_finite.cpp --- armadillo-7.600.2+dfsg/tests/fn_find_finite.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_find_finite.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/fn_find_nonfinite.cpp armadillo-7.950.1+dfsg/tests/fn_find_nonfinite.cpp --- armadillo-7.600.2+dfsg/tests/fn_find_nonfinite.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_find_nonfinite.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/fn_find_unique.cpp armadillo-7.950.1+dfsg/tests/fn_find_unique.cpp --- armadillo-7.600.2+dfsg/tests/fn_find_unique.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_find_unique.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/fn_flip.cpp armadillo-7.950.1+dfsg/tests/fn_flip.cpp --- armadillo-7.600.2+dfsg/tests/fn_flip.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_flip.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/fn_interp1.cpp armadillo-7.950.1+dfsg/tests/fn_interp1.cpp --- armadillo-7.600.2+dfsg/tests/fn_interp1.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_interp1.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/fn_is_finite.cpp armadillo-7.950.1+dfsg/tests/fn_is_finite.cpp --- armadillo-7.600.2+dfsg/tests/fn_is_finite.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_is_finite.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/fn_max.cpp armadillo-7.950.1+dfsg/tests/fn_max.cpp --- armadillo-7.600.2+dfsg/tests/fn_max.cpp 1970-01-01 00:00:00.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_max.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -0,0 +1,736 @@ +// Copyright 2011-2017 Ryan Curtin (http://www.ratml.org/) +// Copyright 2017 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + +#include + +#include "catch.hpp" + +using namespace arma; + +TEST_CASE("fn_max_subview_test") + { + // We will assume subview.at() works and returns points within the bounds of + // the matrix, so we just have to ensure the results are the same as + // Mat.max()... + for (size_t r = 50; r < 150; ++r) + { + mat x; + x.randu(r, r); + + uword x_max; + uword x_subview_max1; + uword x_subview_max2; + uword x_subview_max3; + + const double mval = x.max(x_max); + const double mval1 = x.submat(0, 0, r - 1, r - 1).max(x_subview_max1); + const double mval2 = x.cols(0, r - 1).max(x_subview_max2); + const double mval3 = x.rows(0, r - 1).max(x_subview_max3); + + REQUIRE( x_max == x_subview_max1 ); + REQUIRE( x_max == x_subview_max2 ); + REQUIRE( x_max == x_subview_max3 ); + + REQUIRE( mval == Approx(mval1) ); + REQUIRE( mval == Approx(mval2) ); + REQUIRE( mval == Approx(mval3) ); + } + } + + + +TEST_CASE("fn_max_subview_col_test") + { + for (size_t r = 10; r < 50; ++r) + { + vec x; + x.randu(r); + + uword x_max; + uword x_subview_max1; + uword x_subview_max2; + + const double mval = x.max(x_max); + const double mval1 = x.submat(0, 0, r - 1, 0).max(x_subview_max1); + const double mval2 = x.rows(0, r - 1).max(x_subview_max2); + + REQUIRE( x_max == x_subview_max1 ); + REQUIRE( x_max == x_subview_max2 ); + + REQUIRE( mval == Approx(mval1) ); + REQUIRE( mval == Approx(mval2) ); + } + } + + + +TEST_CASE("fn_max_subview_row_test") + { + for (size_t r = 10; r < 50; ++r) + { + rowvec x; + x.randu(r); + + uword x_max; + uword x_subview_max1; + uword x_subview_max2; + + const double mval = x.max(x_max); + const double mval1 = x.submat(0, 0, 0, r - 1).max(x_subview_max1); + const double mval2 = x.cols(0, r - 1).max(x_subview_max2); + + REQUIRE( x_max == x_subview_max1 ); + REQUIRE( x_max == x_subview_max2 ); + + REQUIRE( mval == Approx(mval1) ); + REQUIRE( mval == Approx(mval2) ); + } + } + + + +TEST_CASE("fn_max_incomplete_subview_test") + { + for (size_t r = 50; r < 150; ++r) + { + mat x; + x.randu(r, r); + + uword x_max; + uword x_subview_max1; + uword x_subview_max2; + uword x_subview_max3; + + const double mval = x.max(x_max); + const double mval1 = x.submat(1, 1, r - 2, r - 2).max(x_subview_max1); + const double mval2 = x.cols(1, r - 2).max(x_subview_max2); + const double mval3 = x.rows(1, r - 2).max(x_subview_max3); + + uword row, col; + x.max(row, col); + + if (row != 0 && row != r - 1 && col != 0 && col != r - 1) + { + uword srow, scol; + + srow = x_subview_max1 % (r - 2); + scol = x_subview_max1 / (r - 2); + REQUIRE( x_max == (srow + 1) + r * (scol + 1) ); + REQUIRE( x_max == x_subview_max2 + r ); + + srow = x_subview_max3 % (r - 2); + scol = x_subview_max3 / (r - 2); + REQUIRE( x_max == (srow + 1) + r * scol ); + + REQUIRE( mval == Approx(mval1) ); + REQUIRE( mval == Approx(mval2) ); + REQUIRE( mval == Approx(mval3) ); + } + } + } + + + +TEST_CASE("fn_max_incomplete_subview_col_test") + { + for (size_t r = 10; r < 50; ++r) + { + vec x; + x.randu(r); + + uword x_max; + uword x_subview_max1; + uword x_subview_max2; + + const double mval = x.max(x_max); + const double mval1 = x.submat(1, 0, r - 2, 0).max(x_subview_max1); + const double mval2 = x.rows(1, r - 2).max(x_subview_max2); + + if (x_max != 0 && x_max != r - 1) + { + REQUIRE( x_max == x_subview_max1 + 1 ); + REQUIRE( x_max == x_subview_max2 + 1 ); + + REQUIRE( mval == Approx(mval1) ); + REQUIRE( mval == Approx(mval2) ); + } + } + } + + + +TEST_CASE("fn_max_cx_subview_row_test") + { + for (size_t r = 10; r < 50; ++r) + { + cx_rowvec x; + x.randu(r); + + uword x_max; + uword x_subview_max1; + uword x_subview_max2; + + const std::complex mval = x.max(x_max); + const std::complex mval1 = x.submat(0, 0, 0, r - 1).max(x_subview_max1); + const std::complex mval2 = x.cols(0, r - 1).max(x_subview_max2); + + REQUIRE( x_max == x_subview_max1 ); + REQUIRE( x_max == x_subview_max2 ); + + REQUIRE( mval.real() == Approx(mval1.real()) ); + REQUIRE( mval.imag() == Approx(mval1.imag()) ); + REQUIRE( mval.real() == Approx(mval2.real()) ); + REQUIRE( mval.imag() == Approx(mval2.imag()) ); + } + } + + + +TEST_CASE("fn_max_cx_incomplete_subview_test") + { + for (size_t r = 50; r < 150; ++r) + { + cx_mat x; + x.randu(r, r); + + uword x_max; + uword x_subview_max1; + uword x_subview_max2; + uword x_subview_max3; + + const std::complex mval = x.max(x_max); + const std::complex mval1 = x.submat(1, 1, r - 2, r - 2).max(x_subview_max1); + const std::complex mval2 = x.cols(1, r - 2).max(x_subview_max2); + const std::complex mval3 = x.rows(1, r - 2).max(x_subview_max3); + + uword row, col; + x.max(row, col); + + if (row != 0 && row != r - 1 && col != 0 && col != r - 1) + { + uword srow, scol; + + srow = x_subview_max1 % (r - 2); + scol = x_subview_max1 / (r - 2); + REQUIRE( x_max == (srow + 1) + r * (scol + 1) ); + REQUIRE( x_max == x_subview_max2 + r ); + + srow = x_subview_max3 % (r - 2); + scol = x_subview_max3 / (r - 2); + REQUIRE( x_max == (srow + 1) + r * scol ); + + REQUIRE( mval.real() == Approx(mval1.real()) ); + REQUIRE( mval.imag() == Approx(mval1.imag()) ); + REQUIRE( mval.real() == Approx(mval2.real()) ); + REQUIRE( mval.imag() == Approx(mval2.imag()) ); + REQUIRE( mval.real() == Approx(mval3.real()) ); + REQUIRE( mval.imag() == Approx(mval3.imag()) ); + } + } + } + + + +TEST_CASE("fn_max_cx_incomplete_subview_col_test") + { + for (size_t r = 10; r < 50; ++r) + { + cx_vec x; + x.randu(r); + + uword x_max; + uword x_subview_max1; + uword x_subview_max2; + + const std::complex mval = x.max(x_max); + const std::complex mval1 = x.submat(1, 0, r - 2, 0).max(x_subview_max1); + const std::complex mval2 = x.rows(1, r - 2).max(x_subview_max2); + + if (x_max != 0 && x_max != r - 1) + { + REQUIRE( x_max == x_subview_max1 + 1 ); + REQUIRE( x_max == x_subview_max2 + 1 ); + + REQUIRE( mval.real() == Approx(mval1.real()) ); + REQUIRE( mval.imag() == Approx(mval1.imag()) ); + REQUIRE( mval.real() == Approx(mval2.real()) ); + REQUIRE( mval.imag() == Approx(mval2.imag()) ); + } + } + } + + + +TEST_CASE("fn_max_cx_incomplete_subview_row_test") + { + for (size_t r = 10; r < 50; ++r) + { + cx_rowvec x; + x.randu(r); + + uword x_max; + uword x_subview_max1; + uword x_subview_max2; + + const std::complex mval = x.max(x_max); + const std::complex mval1 = x.submat(0, 1, 0, r - 2).max(x_subview_max1); + const std::complex mval2 = x.cols(1, r - 2).max(x_subview_max2); + + if (x_max != 0 && x_max != r - 1) + { + REQUIRE( x_max == x_subview_max1 + 1 ); + REQUIRE( x_max == x_subview_max2 + 1 ); + + REQUIRE( mval.real() == Approx(mval1.real()) ); + REQUIRE( mval.imag() == Approx(mval1.imag()) ); + REQUIRE( mval.real() == Approx(mval2.real()) ); + REQUIRE( mval.imag() == Approx(mval2.imag()) ); + } + } + } + + + +TEST_CASE("fn_max_weird_operation_test") + { + mat a(10, 10); + mat b(25, 10); + a.randn(); + b.randn(); + + mat output = a * b.t(); + + uword real_max; + uword operation_max; + + const double mval = output.max(real_max); + const double other_mval = (a * b.t()).max(operation_max); + + REQUIRE( real_max == operation_max ); + REQUIRE( mval == Approx(other_mval) ); + } + + + +TEST_CASE("fn_max_weird_sparse_operation_test") + { + sp_mat a(10, 10); + sp_mat b(25, 10); + a.sprandn(10, 10, 0.3); + b.sprandn(25, 10, 0.3); + + sp_mat output = a * b.t(); + + uword real_max; + uword operation_max; + + const double mval = output.max(real_max); + const double other_mval = (a * b.t()).max(operation_max); + + REQUIRE( real_max == operation_max ); + REQUIRE( mval == Approx(other_mval) ); + } + + + +TEST_CASE("fn_max_spsubview_test") + { + // We will assume subview.at() works and returns points within the bounds of + // the matrix, so we just have to ensure the results are the same as + // Mat.max()... + for (size_t r = 50; r < 150; ++r) + { + sp_mat x; + x.sprandn(r, r, 0.3); + + uword x_max; + uword x_subview_max1; + uword x_subview_max2; + uword x_subview_max3; + + const double mval = x.max(x_max); + const double mval1 = x.submat(0, 0, r - 1, r - 1).max(x_subview_max1); + const double mval2 = x.cols(0, r - 1).max(x_subview_max2); + const double mval3 = x.rows(0, r - 1).max(x_subview_max3); + + if (mval != 0.0) + { + REQUIRE( x_max == x_subview_max1 ); + REQUIRE( x_max == x_subview_max2 ); + REQUIRE( x_max == x_subview_max3 ); + + REQUIRE( mval == Approx(mval1) ); + REQUIRE( mval == Approx(mval2) ); + REQUIRE( mval == Approx(mval3) ); + } + } + } + + + +TEST_CASE("fn_max_spsubview_col_test") + { + for (size_t r = 10; r < 50; ++r) + { + sp_vec x; + x.sprandn(r, 1, 0.3); + + uword x_max; + uword x_subview_max1; + uword x_subview_max2; + + const double mval = x.max(x_max); + const double mval1 = x.submat(0, 0, r - 1, 0).max(x_subview_max1); + const double mval2 = x.rows(0, r - 1).max(x_subview_max2); + + if (mval != 0.0) + { + REQUIRE( x_max == x_subview_max1 ); + REQUIRE( x_max == x_subview_max2 ); + + REQUIRE( mval == Approx(mval1) ); + REQUIRE( mval == Approx(mval2) ); + } + } + } + + + +TEST_CASE("fn_max_spsubview_row_test") + { + for (size_t r = 10; r < 50; ++r) + { + sp_rowvec x; + x.sprandn(1, r, 0.3); + + uword x_max; + uword x_subview_max1; + uword x_subview_max2; + + const double mval = x.max(x_max); + const double mval1 = x.submat(0, 0, 0, r - 1).max(x_subview_max1); + const double mval2 = x.cols(0, r - 1).max(x_subview_max2); + + if (mval != 0.0) + { + REQUIRE( x_max == x_subview_max1 ); + REQUIRE( x_max == x_subview_max2 ); + + REQUIRE( mval == Approx(mval1) ); + REQUIRE( mval == Approx(mval2) ); + } + } + } + + + +TEST_CASE("fn_max_spincompletesubview_test") + { + for (size_t r = 50; r < 150; ++r) + { + sp_mat x; + x.sprandn(r, r, 0.3); + + uword x_max; + uword x_subview_max1; + uword x_subview_max2; + uword x_subview_max3; + + const double mval = x.max(x_max); + const double mval1 = x.submat(1, 1, r - 2, r - 2).max(x_subview_max1); + const double mval2 = x.cols(1, r - 2).max(x_subview_max2); + const double mval3 = x.rows(1, r - 2).max(x_subview_max3); + + uword row, col; + x.max(row, col); + + if (row != 0 && row != r - 1 && col != 0 && col != r - 1 && mval != 0.0) + { + uword srow, scol; + + srow = x_subview_max1 % (r - 2); + scol = x_subview_max1 / (r - 2); + REQUIRE( x_max == (srow + 1) + r * (scol + 1) ); + REQUIRE( x_max == x_subview_max2 + r ); + + srow = x_subview_max3 % (r - 2); + scol = x_subview_max3 / (r - 2); + REQUIRE( x_max == (srow + 1) + r * scol ); + + REQUIRE( mval == Approx(mval1) ); + REQUIRE( mval == Approx(mval2) ); + REQUIRE( mval == Approx(mval3) ); + } + } + } + + + +TEST_CASE("fn_max_spincompletesubview_col_test") + { + for (size_t r = 10; r < 50; ++r) + { + sp_vec x; + x.sprandu(r, 1, 0.3); + + uword x_max; + uword x_subview_max1; + uword x_subview_max2; + + const double mval = x.max(x_max); + const double mval1 = x.submat(1, 0, r - 2, 0).max(x_subview_max1); + const double mval2 = x.rows(1, r - 2).max(x_subview_max2); + + if (x_max != 0 && x_max != r - 1 && mval != 0.0) + { + REQUIRE( x_max == x_subview_max1 + 1 ); + REQUIRE( x_max == x_subview_max2 + 1 ); + + REQUIRE( mval == Approx(mval1) ); + REQUIRE( mval == Approx(mval2) ); + } + } + } + + + +TEST_CASE("fn_max_spincompletesubview_row_test") + { + for (size_t r = 10; r < 50; ++r) + { + sp_rowvec x; + x.sprandn(1, r, 0.3); + + uword x_max; + uword x_subview_max1; + uword x_subview_max2; + + const double mval = x.max(x_max); + const double mval1 = x.submat(0, 1, 0, r - 2).max(x_subview_max1); + const double mval2 = x.cols(1, r - 2).max(x_subview_max2); + + if (mval != 0.0 && x_max != 0 && x_max != r - 1) + { + REQUIRE( x_max == x_subview_max1 + 1 ); + REQUIRE( x_max == x_subview_max2 + 1 ); + + REQUIRE( mval == Approx(mval1) ); + REQUIRE( mval == Approx(mval2) ); + } + } + } + + + +TEST_CASE("fn_max_cx_spsubview_test") + { + // We will assume subview.at() works and returns points within the bounds of + // the matrix, so we just have to ensure the results are the same as + // Mat.max()... + for (size_t r = 50; r < 150; ++r) + { + sp_cx_mat x; + x.sprandn(r, r, 0.3); + + uword x_max; + uword x_subview_max1; + uword x_subview_max2; + uword x_subview_max3; + + const std::complex mval = x.max(x_max); + const std::complex mval1 = x.submat(0, 0, r - 1, r - 1).max(x_subview_max1); + const std::complex mval2 = x.cols(0, r - 1).max(x_subview_max2); + const std::complex mval3 = x.rows(0, r - 1).max(x_subview_max3); + + if (mval != std::complex(0.0)) + { + REQUIRE( x_max == x_subview_max1 ); + REQUIRE( x_max == x_subview_max2 ); + REQUIRE( x_max == x_subview_max3 ); + + REQUIRE( mval.real() == Approx(mval1.real()) ); + REQUIRE( mval.imag() == Approx(mval1.imag()) ); + REQUIRE( mval.real() == Approx(mval2.real()) ); + REQUIRE( mval.imag() == Approx(mval2.imag()) ); + REQUIRE( mval.real() == Approx(mval3.real()) ); + REQUIRE( mval.imag() == Approx(mval3.imag()) ); + } + } + } + + + +TEST_CASE("fn_max_cx_spsubview_col_test") + { + for (size_t r = 10; r < 50; ++r) + { + sp_cx_vec x; + x.sprandn(r, 1, 0.3); + + uword x_max; + uword x_subview_max1; + uword x_subview_max2; + + const std::complex mval = x.max(x_max); + const std::complex mval1 = x.submat(0, 0, r - 1, 0).max(x_subview_max1); + const std::complex mval2 = x.rows(0, r - 1).max(x_subview_max2); + + if (mval != std::complex(0.0)) + { + REQUIRE( x_max == x_subview_max1 ); + REQUIRE( x_max == x_subview_max2 ); + + REQUIRE( mval.real() == Approx(mval1.real()) ); + REQUIRE( mval.imag() == Approx(mval1.imag()) ); + REQUIRE( mval.real() == Approx(mval2.real()) ); + REQUIRE( mval.imag() == Approx(mval2.imag()) ); + } + } + } + + + +TEST_CASE("fn_max_cx_spsubview_row_test") + { + for (size_t r = 10; r < 50; ++r) + { + sp_cx_rowvec x; + x.sprandn(1, r, 0.3); + + uword x_max; + uword x_subview_max1; + uword x_subview_max2; + + const std::complex mval = x.max(x_max); + const std::complex mval1 = x.submat(0, 0, 0, r - 1).max(x_subview_max1); + const std::complex mval2 = x.cols(0, r - 1).max(x_subview_max2); + + if (mval != std::complex(0.0)) + { + REQUIRE( x_max == x_subview_max1 ); + REQUIRE( x_max == x_subview_max2 ); + + REQUIRE( mval.real() == Approx(mval1.real()) ); + REQUIRE( mval.imag() == Approx(mval1.imag()) ); + REQUIRE( mval.real() == Approx(mval2.real()) ); + REQUIRE( mval.imag() == Approx(mval2.imag()) ); + } + } + } + + + +TEST_CASE("fn_max_cx_spincompletesubview_test") + { + for (size_t r = 50; r < 150; ++r) + { + sp_cx_mat x; + x.sprandn(r, r, 0.3); + + uword x_max; + uword x_subview_max1; + uword x_subview_max2; + uword x_subview_max3; + + const std::complex mval = x.max(x_max); + const std::complex mval1 = x.submat(1, 1, r - 2, r - 2).max(x_subview_max1); + const std::complex mval2 = x.cols(1, r - 2).max(x_subview_max2); + const std::complex mval3 = x.rows(1, r - 2).max(x_subview_max3); + + uword row, col; + x.max(row, col); + + if (row != 0 && row != r - 1 && col != 0 && col != r - 1 && mval != std::complex(0.0)) + { + uword srow, scol; + + srow = x_subview_max1 % (r - 2); + scol = x_subview_max1 / (r - 2); + REQUIRE( x_max == (srow + 1) + r * (scol + 1) ); + REQUIRE( x_max == x_subview_max2 + r ); + + srow = x_subview_max3 % (r - 2); + scol = x_subview_max3 / (r - 2); + REQUIRE( x_max == (srow + 1) + r * scol ); + + REQUIRE( mval.real() == Approx(mval1.real()) ); + REQUIRE( mval.imag() == Approx(mval1.imag()) ); + REQUIRE( mval.real() == Approx(mval2.real()) ); + REQUIRE( mval.imag() == Approx(mval2.imag()) ); + REQUIRE( mval.real() == Approx(mval3.real()) ); + REQUIRE( mval.imag() == Approx(mval3.imag()) ); + } + } + } + + + +TEST_CASE("fn_max_cx_spincompletesubview_col_test") + { + for (size_t r = 10; r < 50; ++r) + { + sp_cx_vec x; + x.sprandn(r, 1, 0.3); + + uword x_max; + uword x_subview_max1; + uword x_subview_max2; + + const std::complex mval = x.max(x_max); + const std::complex mval1 = x.submat(1, 0, r - 2, 0).max(x_subview_max1); + const std::complex mval2 = x.rows(1, r - 2).max(x_subview_max2); + + if (x_max != 0 && x_max != r - 1 && mval != std::complex(0.0)) + { + REQUIRE( x_max == x_subview_max1 + 1 ); + REQUIRE( x_max == x_subview_max2 + 1 ); + + REQUIRE( mval.real() == Approx(mval1.real()) ); + REQUIRE( mval.imag() == Approx(mval1.imag()) ); + REQUIRE( mval.real() == Approx(mval2.real()) ); + REQUIRE( mval.imag() == Approx(mval2.imag()) ); + } + } + } + + + +TEST_CASE("fn_max_cx_spincompletesubview_row_test") + { + for (size_t r = 10; r < 50; ++r) + { + sp_cx_rowvec x; + x.sprandn(1, r, 0.3); + + uword x_max; + uword x_subview_max1; + uword x_subview_max2; + + const std::complex mval = x.max(x_max); + const std::complex mval1 = x.submat(0, 1, 0, r - 2).max(x_subview_max1); + const std::complex mval2 = x.cols(1, r - 2).max(x_subview_max2); + + if (x_max != 0 && x_max != r - 1 && mval != std::complex(0.0)) + { + REQUIRE( x_max == x_subview_max1 + 1 ); + REQUIRE( x_max == x_subview_max2 + 1 ); + + REQUIRE( mval.real() == Approx(mval1.real()) ); + REQUIRE( mval.imag() == Approx(mval1.imag()) ); + REQUIRE( mval.real() == Approx(mval2.real()) ); + REQUIRE( mval.imag() == Approx(mval2.imag()) ); + } + } + } diff -Nru armadillo-7.600.2+dfsg/tests/fn_mean.cpp armadillo-7.950.1+dfsg/tests/fn_mean.cpp --- armadillo-7.600.2+dfsg/tests/fn_mean.cpp 1970-01-01 00:00:00.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_mean.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -0,0 +1,948 @@ +// Copyright 2011-2017 Ryan Curtin (http://www.ratml.org/) +// Copyright 2017 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + +#include + +#include "catch.hpp" + +using namespace arma; + +TEST_CASE("fn_mean_spmat_empty_test") + { + SpMat m(20, 25); + + SpRow result = mean(m, 0); + REQUIRE( result.n_nonzero == 0 ); + REQUIRE( result.n_rows == 1 ); + REQUIRE( result.n_cols == 25 ); + + SpCol result2 = mean(m, 1); + REQUIRE( result2.n_nonzero == 0 ); + REQUIRE( result2.n_rows == 20 ); + REQUIRE( result2.n_cols == 1 ); + + double r = mean(mean(m)); + REQUIRE( r == Approx(0.0) ); + + // Now the same with subviews. + result = mean(m.submat(2, 2, 11, 16)); + REQUIRE( result.n_nonzero == 0 ); + REQUIRE( result.n_rows == 1 ); + REQUIRE( result.n_cols == 15 ); + + result2 = mean(m.submat(2, 2, 11, 16), 1); + REQUIRE( result2.n_nonzero == 0 ); + REQUIRE( result2.n_rows == 10 ); + REQUIRE( result2.n_cols == 1 ); + + r = mean(mean(m.submat(2, 2, 11, 16))); + REQUIRE( r == Approx(0.0) ); + + // And with an operation. + result = mean(trans(m)); + REQUIRE( result.n_nonzero == 0 ); + REQUIRE( result.n_rows == 1 ); + REQUIRE( result.n_cols == 20 ); + + result2 = mean(trans(m), 1); + REQUIRE( result2.n_nonzero == 0 ); + REQUIRE( result2.n_rows == 25 ); + REQUIRE( result2.n_cols == 1 ); + + r = mean(mean(trans(m))); + REQUIRE( r == Approx(0.0) ); + } + + + +TEST_CASE("fn_mean_spcxmat_empty_test") + { + // Now with complex numbers. + SpMat > m(20, 25); + SpRow > result = mean(m, 0); + + REQUIRE( result.n_nonzero == 0 ); + REQUIRE( result.n_rows == 1 ); + REQUIRE( result.n_cols == 25 ); + + SpCol > result2 = mean(m, 1); + + REQUIRE( result2.n_nonzero == 0 ); + REQUIRE( result2.n_rows == 20 ); + REQUIRE( result2.n_cols == 1 ); + + std::complex r = mean(mean(m)); + + REQUIRE( real(r) == Approx(0.0) ); + REQUIRE( imag(r) == Approx(0.0) ); + + // Now the same with subviews. + result = mean(m.submat(2, 2, 11, 16)); + REQUIRE( result.n_nonzero == 0 ); + REQUIRE( result.n_rows == 1 ); + REQUIRE( result.n_cols == 15 ); + + result2 = mean(m.submat(2, 2, 11, 16), 1); + REQUIRE( result2.n_nonzero == 0 ); + REQUIRE( result2.n_rows == 10 ); + REQUIRE( result2.n_cols == 1 ); + + r = mean(mean(m.submat(2, 2, 11, 16))); + REQUIRE( real(r) == Approx(0.0) ); + REQUIRE( imag(r) == Approx(0.0) ); + + // And with an operation. + result = mean(trans(m)); + REQUIRE( result.n_nonzero == 0 ); + REQUIRE( result.n_rows == 1 ); + REQUIRE( result.n_cols == 20 ); + + result2 = mean(trans(m), 1); + REQUIRE( result2.n_nonzero == 0 ); + REQUIRE( result2.n_rows == 25 ); + REQUIRE( result2.n_cols == 1 ); + + r = mean(mean(trans(m))); + REQUIRE( real(r) == Approx(0.0) ); + REQUIRE( imag(r) == Approx(0.0) ); + } + + + +TEST_CASE("fn_mean_spmat_test") + { + // Create a random matrix and do mean testing on it, with varying levels of + // nonzero (eventually this becomes a fully dense matrix). + for (int i = 0; i < 10; ++i) + { + SpMat x; + x.sprandu(50, 75, ((double) (i + 1)) / 10); + mat d(x); + + SpRow rr = mean(x); + rowvec drr = mean(d); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 75 ); + for (uword j = 0; j < 75; ++j) + REQUIRE( drr[j] == Approx((double) rr[j]) ); + + SpCol cr = mean(x, 1); + vec dcr = mean(d, 1); + + REQUIRE( cr.n_rows == 50 ); + REQUIRE( cr.n_cols == 1 ); + for (uword j = 0; j < 50; ++j) + REQUIRE( dcr[j] == Approx((double) cr[j]) ); + + double dr = mean(mean(x)); + double ddr = mean(mean(d)); + + REQUIRE( dr == Approx(ddr) ); + + // Now on a subview. + rr = mean(x.submat(11, 11, 30, 45), 0); + drr = mean(d.submat(11, 11, 30, 45), 0); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 35 ); + for (uword j = 0; j < 35; ++j) + REQUIRE( drr[j] == Approx((double) rr[j]) ); + + cr = mean(x.submat(11, 11, 30, 45), 1); + dcr = mean(d.submat(11, 11, 30, 45), 1); + + REQUIRE( cr.n_rows == 20 ); + REQUIRE( cr.n_cols == 1 ); + for (uword j = 0; j < 20; ++j) + REQUIRE( dcr[j] == Approx((double) cr[j]) ); + + dr = mean(mean(x.submat(11, 11, 30, 45))); + ddr = mean(mean(d.submat(11, 11, 30, 45))); + + REQUIRE( dr == Approx(ddr) ); + + // Now on an SpOp (spop_scalar_times) + rr = mean(3.0 * x); + drr = mean(3.0 * d); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 75 ); + for (uword j = 0; j < 75; ++j) + REQUIRE( drr[j] == Approx((double) rr[j]) ); + + cr = mean(4.5 * x, 1); + dcr = mean(4.5 * d, 1); + + REQUIRE( cr.n_rows == 50 ); + REQUIRE( cr.n_cols == 1 ); + for (uword j = 0; j < 50; ++j) + REQUIRE( dcr[j] == Approx((double) cr[j]) ); + + dr = mean(mean(1.2 * x)); + ddr = mean(mean(1.2 * d)); + + REQUIRE( dr == Approx(ddr) ); + + // Now on an SpGlue! + SpMat y; + y.sprandu(50, 75, 0.3); + mat e(y); + + rr = mean(x + y); + drr = mean(d + e); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 75 ); + for (uword j = 0; j < 75; ++j) + REQUIRE( drr[j] == Approx((double) rr[j]) ); + + cr = mean(x + y, 1); + dcr = mean(d + e, 1); + + REQUIRE( cr.n_rows == 50 ); + REQUIRE( cr.n_cols == 1 ); + for (uword j = 0; j < 50; ++j) + REQUIRE( dcr[j] == Approx((double) cr[j]) ); + + dr = mean(mean(x + y)); + ddr = mean(mean(d + e)); + + REQUIRE( dr == Approx(ddr) ); + } + } + + + +TEST_CASE("fn_mean_spcxmat_test") + { + // Create a random matrix and do mean testing on it, with varying levels of + // nonzero (eventually this becomes a fully dense matrix). + for (int i = 0; i < 10; ++i) + { + SpMat > x; + x.sprandu(50, 75, ((double) (i + 1)) / 10); + cx_mat d(x); + + SpRow > rr = mean(x); + cx_rowvec drr = mean(d); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 75 ); + for (uword j = 0; j < 75; ++j) + { + REQUIRE( real(drr[j]) == Approx(real((std::complex) rr[j])) ); + REQUIRE( imag(drr[j]) == Approx(imag((std::complex) rr[j])) ); + } + + SpCol > cr = mean(x, 1); + cx_vec dcr = mean(d, 1); + + REQUIRE( cr.n_rows == 50 ); + REQUIRE( cr.n_cols == 1 ); + for (uword j = 0; j < 50; ++j) + { + REQUIRE( real(dcr[j]) == Approx(real((std::complex) cr[j])) ); + REQUIRE( imag(dcr[j]) == Approx(imag((std::complex) cr[j])) ); + } + + std::complex dr = mean(mean(x)); + std::complex ddr = mean(mean(d)); + + REQUIRE( real(dr) == Approx(real(ddr)) ); + REQUIRE( imag(dr) == Approx(imag(ddr)) ); + + // Now on a subview. + rr = mean(x.submat(11, 11, 30, 45), 0); + drr = mean(d.submat(11, 11, 30, 45), 0); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 35 ); + for (uword j = 0; j < 35; ++j) + { + REQUIRE( real(drr[j]) == Approx(real((std::complex) rr[j])) ); + REQUIRE( imag(drr[j]) == Approx(imag((std::complex) rr[j])) ); + } + + cr = mean(x.submat(11, 11, 30, 45), 1); + dcr = mean(d.submat(11, 11, 30, 45), 1); + + REQUIRE( cr.n_rows == 20 ); + REQUIRE( cr.n_cols == 1 ); + for (uword j = 0; j < 20; ++j) + { + REQUIRE( real(dcr[j]) == Approx(real((std::complex) cr[j])) ); + REQUIRE( imag(dcr[j]) == Approx(imag((std::complex) cr[j])) ); + } + + dr = mean(mean(x.submat(11, 11, 30, 45))); + ddr = mean(mean(d.submat(11, 11, 30, 45))); + + REQUIRE( real(dr) == Approx(real(ddr)) ); + REQUIRE( imag(dr) == Approx(imag(ddr)) ); + + // Now on an SpOp (spop_scalar_times) + rr = mean(3.0 * x); + drr = mean(3.0 * d); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 75 ); + for (uword j = 0; j < 75; ++j) + { + REQUIRE( real(drr[j]) == Approx(real((std::complex) rr[j])) ); + REQUIRE( imag(drr[j]) == Approx(imag((std::complex) rr[j])) ); + } + + cr = mean(4.5 * x, 1); + dcr = mean(4.5 * d, 1); + + REQUIRE( cr.n_rows == 50 ); + REQUIRE( cr.n_cols == 1 ); + for (uword j = 0; j < 50; ++j) + { + REQUIRE( real(dcr[j]) == Approx(real((std::complex) cr[j])) ); + REQUIRE( imag(dcr[j]) == Approx(imag((std::complex) cr[j])) ); + } + + dr = mean(mean(1.2 * x)); + ddr = mean(mean(1.2 * d)); + + REQUIRE( real(dr) == Approx(real(ddr)) ); + REQUIRE( imag(dr) == Approx(imag(ddr)) ); + + // Now on an SpGlue! + SpMat > y; + y.sprandu(50, 75, 0.3); + cx_mat e(y); + + rr = mean(x + y); + drr = mean(d + e); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 75 ); + for (uword j = 0; j < 75; ++j) + { + REQUIRE( real(drr[j]) == Approx(real((std::complex) rr[j])) ); + REQUIRE( imag(drr[j]) == Approx(imag((std::complex) rr[j])) ); + } + + cr = mean(x + y, 1); + dcr = mean(d + e, 1); + + REQUIRE( cr.n_rows == 50 ); + REQUIRE( cr.n_cols == 1 ); + for (uword j = 0; j < 50; ++j) + { + REQUIRE( real(dcr[j]) == Approx(real((std::complex) cr[j])) ); + REQUIRE( imag(dcr[j]) == Approx(imag((std::complex) cr[j])) ); + } + + dr = mean(mean(x + y)); + ddr = mean(mean(d + e)); + + REQUIRE( real(dr) == Approx(real(ddr)) ); + REQUIRE( imag(dr) == Approx(imag(ddr)) ); + } + } + + +TEST_CASE("fn_mean_sp_vector_test") + { + // Test mean() on vectors. + SpCol c(1000); + + SpCol cr = mean(c, 0); + REQUIRE( cr.n_rows == 1 ); + REQUIRE( cr.n_cols == 1 ); + REQUIRE( (double) cr[0] == Approx(0.0) ); + + cr = mean(c, 1); + REQUIRE( cr.n_rows == 1000 ); + REQUIRE( cr.n_cols == 1 ); + for (uword i = 0; i < 1000; ++i) + { + REQUIRE( (double) cr[i] == Approx(0.0) ); + } + + double ddcr = mean(c); + REQUIRE( ddcr == Approx(0.0) ); + + c.sprandu(1000, 1, 0.3); + vec dc(c); + + cr = mean(c, 0); + vec dcr = mean(dc, 0); + + REQUIRE( cr.n_rows == 1 ); + REQUIRE( cr.n_cols == 1 ); + REQUIRE( (double) cr[0] == Approx(dcr[0]) ); + + cr = mean(c, 1); + dcr = mean(dc, 1); + + REQUIRE( cr.n_rows == 1000 ); + REQUIRE( cr.n_cols == 1 ); + for (uword i = 0; i < 1000; ++i) + { + REQUIRE( (double) cr[i] == Approx(dcr[i]) ); + } + + ddcr = mean(c); + double dddr = mean(dc); + + REQUIRE( ddcr == Approx(dddr) ); + + SpRow r; + r.sprandu(1, 1000, 0.3); + rowvec dr(r); + + SpRow rr = mean(r, 0); + rowvec drr = mean(dr, 0); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 1000 ); + for (uword i = 0; i < 1000; ++i) + { + REQUIRE( (double) rr[i] == Approx(drr[i]) ); + } + + rr = mean(r, 1); + drr = mean(dr, 1); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 1 ); + REQUIRE( (double) rr[0] == Approx(drr[0]) ); + + ddcr = mean(r); + dddr = mean(dr); + + REQUIRE( ddcr == Approx(dddr) ); + } + + + +TEST_CASE("fn_mean_sp_cx_vector_test") + { + // Test mean() on vectors. + SpCol > c(1000); + + SpCol > cr = mean(c, 0); + REQUIRE( cr.n_rows == 1 ); + REQUIRE( cr.n_cols == 1 ); + REQUIRE( real((std::complex) cr[0]) == Approx(0.0) ); + REQUIRE( imag((std::complex) cr[0]) == Approx(0.0) ); + + cr = mean(c, 1); + REQUIRE( cr.n_rows == 1000 ); + REQUIRE( cr.n_cols == 1 ); + for (uword i = 0; i < 1000; ++i) + { + REQUIRE( real((std::complex) cr[i]) == Approx(0.0) ); + REQUIRE( imag((std::complex) cr[i]) == Approx(0.0) ); + } + + std::complex ddcr = mean(c); + REQUIRE( real(ddcr) == Approx(0.0) ); + REQUIRE( imag(ddcr) == Approx(0.0) ); + + c.sprandu(1000, 1, 0.3); + cx_vec dc(c); + + cr = mean(c, 0); + cx_vec dcr = mean(dc, 0); + + REQUIRE( cr.n_rows == 1 ); + REQUIRE( cr.n_cols == 1 ); + REQUIRE( real((std::complex) cr[0]) == Approx(real(dcr[0])) ); + REQUIRE( imag((std::complex) cr[0]) == Approx(imag(dcr[0])) ); + + cr = mean(c, 1); + dcr = mean(dc, 1); + + REQUIRE( cr.n_rows == 1000 ); + REQUIRE( cr.n_cols == 1 ); + for (uword i = 0; i < 1000; ++i) + { + REQUIRE( real((std::complex) cr[i]) == Approx(real(dcr[i])) ); + REQUIRE( imag((std::complex) cr[i]) == Approx(imag(dcr[i])) ); + } + + ddcr = mean(c); + std::complex dddr = mean(dc); + + REQUIRE( real(ddcr) == Approx(real(dddr)) ); + REQUIRE( imag(ddcr) == Approx(imag(dddr)) ); + + SpRow > r; + r.sprandu(1, 1000, 0.3); + cx_rowvec dr(r); + + SpRow > rr = mean(r, 0); + cx_rowvec drr = mean(dr, 0); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 1000 ); + for (uword i = 0; i < 1000; ++i) + { + REQUIRE( real((std::complex) rr[i]) == Approx(real(drr[i])) ); + REQUIRE( imag((std::complex) rr[i]) == Approx(imag(drr[i])) ); + } + + rr = mean(r, 1); + drr = mean(dr, 1); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 1 ); + REQUIRE( real((std::complex) rr[0]) == Approx(real(drr[0])) ); + REQUIRE( imag((std::complex) rr[0]) == Approx(imag(drr[0])) ); + + ddcr = mean(r); + dddr = mean(dr); + + REQUIRE( real(ddcr) == Approx(real(dddr)) ); + REQUIRE( imag(ddcr) == Approx(imag(dddr)) ); + } + + + +TEST_CASE("fn_mean_robust_sparse_test") + { + // Create a sparse matrix with values that will overflow. + SpMat x; + x.sprandu(50, 75, 0.1); + for (SpMat::iterator i = x.begin(); i != x.end(); ++i) + { + (*i) *= std::numeric_limits::max(); + } + mat d(x); + + SpRow rr = mean(x); + rowvec drr = mean(d); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 75 ); + for (uword j = 0; j < 75; ++j) + { + REQUIRE( drr[j] == Approx((double) rr[j]) ); + } + + SpCol cr = mean(x, 1); + vec dcr = mean(d, 1); + + REQUIRE( cr.n_rows == 50 ); + REQUIRE( cr.n_cols == 1 ); + for (uword j = 0; j < 50; ++j) + { + REQUIRE( dcr[j] == Approx((double) cr[j]) ); + } + + double dr = mean(mean(x)); + double ddr = mean(mean(d)); + + REQUIRE( dr == Approx(ddr) ); + + // Now on a subview. + rr = mean(x.submat(11, 11, 30, 45), 0); + drr = mean(d.submat(11, 11, 30, 45), 0); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 35 ); + for (uword j = 0; j < 35; ++j) + { + REQUIRE( drr[j] == Approx((double) rr[j]) ); + } + + cr = mean(x.submat(11, 11, 30, 45), 1); + dcr = mean(d.submat(11, 11, 30, 45), 1); + + REQUIRE( cr.n_rows == 20 ); + REQUIRE( cr.n_cols == 1 ); + for (uword j = 0; j < 20; ++j) + { + REQUIRE( dcr[j] == Approx((double) cr[j]) ); + } + + dr = mean(mean(x.submat(11, 11, 30, 45))); + ddr = mean(mean(d.submat(11, 11, 30, 45))); + + REQUIRE( dr == Approx(ddr) ); + + // Now on an SpOp (spop_scalar_times) + rr = mean(0.4 * x); + drr = mean(0.4 * d); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 75 ); + for (uword j = 0; j < 75; ++j) + { + REQUIRE( drr[j] == Approx((double) rr[j]) ); + } + + cr = mean(0.1 * x, 1); + dcr = mean(0.1 * d, 1); + + REQUIRE( cr.n_rows == 50 ); + REQUIRE( cr.n_cols == 1 ); + for (uword j = 0; j < 50; ++j) + { + REQUIRE( dcr[j] == Approx((double) cr[j]) ); + } + + dr = mean(mean(0.7 * x)); + ddr = mean(mean(0.7 * d)); + + REQUIRE( dr == Approx(ddr) ); + + // Now on an SpGlue! + SpMat y; + y.sprandu(50, 75, 0.3); + for (SpMat::iterator i = y.begin(); i != y.end(); ++i) + { + (*i) *= std::numeric_limits::max(); + } + mat e(y); + + rr = mean(0.5 * x + 0.5 * y); + drr = mean(0.5 * d + 0.5 * e); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 75 ); + for (uword j = 0; j < 75; ++j) + { + REQUIRE( drr[j] == Approx((double) rr[j]) ); + } + + cr = mean(0.5 * x + 0.5 * y, 1); + dcr = mean(0.5 * d + 0.5 * e, 1); + + REQUIRE( cr.n_rows == 50 ); + REQUIRE( cr.n_cols == 1 ); + for (uword j = 0; j < 50; ++j) + { + REQUIRE( dcr[j] == Approx((double) cr[j]) ); + } + + dr = mean(mean(0.5 * x + 0.5 * y)); + ddr = mean(mean(0.5 * d + 0.5 * e)); + + REQUIRE( dr == Approx(ddr) ); + } + + + +TEST_CASE("fn_mean_robust_cx_sparse_test") + { + SpMat > x; + x.sprandu(50, 75, 0.3); + for (SpMat >::iterator i = x.begin(); i != x.end(); ++i) + { + (*i) *= std::numeric_limits::max(); + } + cx_mat d(x); + + SpRow > rr = mean(x); + cx_rowvec drr = mean(d); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 75 ); + for (uword j = 0; j < 75; ++j) + { + REQUIRE( real(drr[j]) == Approx(real((std::complex) rr[j])) ); + REQUIRE( imag(drr[j]) == Approx(imag((std::complex) rr[j])) ); + } + + SpCol > cr = mean(x, 1); + cx_vec dcr = mean(d, 1); + + REQUIRE( cr.n_rows == 50 ); + REQUIRE( cr.n_cols == 1 ); + for (uword j = 0; j < 50; ++j) + { + REQUIRE( real(dcr[j]) == Approx(real((std::complex) cr[j])) ); + REQUIRE( imag(dcr[j]) == Approx(imag((std::complex) cr[j])) ); + } + + std::complex dr = mean(mean(x)); + std::complex ddr = mean(mean(d)); + + REQUIRE( real(dr) == Approx(real(ddr)) ); + REQUIRE( imag(dr) == Approx(imag(ddr)) ); + + // Now on a subview. + rr = mean(x.submat(11, 11, 30, 45), 0); + drr = mean(d.submat(11, 11, 30, 45), 0); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 35 ); + for (uword j = 0; j < 35; ++j) + { + REQUIRE( real(drr[j]) == Approx(real((std::complex) rr[j])) ); + REQUIRE( imag(drr[j]) == Approx(imag((std::complex) rr[j])) ); + } + + cr = mean(x.submat(11, 11, 30, 45), 1); + dcr = mean(d.submat(11, 11, 30, 45), 1); + + REQUIRE( cr.n_rows == 20 ); + REQUIRE( cr.n_cols == 1 ); + for (uword j = 0; j < 20; ++j) + { + REQUIRE( real(dcr[j]) == Approx(real((std::complex) cr[j])) ); + REQUIRE( imag(dcr[j]) == Approx(imag((std::complex) cr[j])) ); + } + + dr = mean(mean(x.submat(11, 11, 30, 45))); + ddr = mean(mean(d.submat(11, 11, 30, 45))); + + REQUIRE( real(dr) == Approx(real(ddr)) ); + REQUIRE( imag(dr) == Approx(imag(ddr)) ); + + // Now on an SpOp (spop_scalar_times) + rr = mean(0.5 * x); + drr = mean(0.5 * d); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 75 ); + for (uword j = 0; j < 75; ++j) + { + REQUIRE( real(drr[j]) == Approx(real((std::complex) rr[j])) ); + REQUIRE( imag(drr[j]) == Approx(imag((std::complex) rr[j])) ); + } + + cr = mean(0.7 * x, 1); + dcr = mean(0.7 * d, 1); + + REQUIRE( cr.n_rows == 50 ); + REQUIRE( cr.n_cols == 1 ); + for (uword j = 0; j < 50; ++j) + { + REQUIRE( real(dcr[j]) == Approx(real((std::complex) cr[j])) ); + REQUIRE( imag(dcr[j]) == Approx(imag((std::complex) cr[j])) ); + } + + dr = mean(mean(0.6 * x)); + ddr = mean(mean(0.6 * d)); + + REQUIRE( real(dr) == Approx(real(ddr)) ); + REQUIRE( imag(dr) == Approx(imag(ddr)) ); + + // Now on an SpGlue! + SpMat > y; + y.sprandu(50, 75, 0.3); + for (SpMat >::iterator i = y.begin(); i != y.end(); ++i) + { + (*i) *= std::numeric_limits::max(); + } + cx_mat e(y); + + rr = mean(0.5 * x + 0.5 * y); + drr = mean(0.5 * d + 0.5 * e); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 75 ); + for (uword j = 0; j < 75; ++j) + { + REQUIRE( real(drr[j]) == Approx(real((std::complex) rr[j])) ); + REQUIRE( imag(drr[j]) == Approx(imag((std::complex) rr[j])) ); + } + + cr = mean(0.5 * x + 0.5 * y, 1); + dcr = mean(0.5 * d + 0.5 * e, 1); + + REQUIRE( cr.n_rows == 50 ); + REQUIRE( cr.n_cols == 1 ); + for (uword j = 0; j < 50; ++j) + { + REQUIRE( real(dcr[j]) == Approx(real((std::complex) cr[j])) ); + REQUIRE( imag(dcr[j]) == Approx(imag((std::complex) cr[j])) ); + } + + dr = mean(mean(0.5 * x + 0.5 * y)); + ddr = mean(mean(0.5 * d + 0.5 * e)); + + REQUIRE( real(dr) == Approx(real(ddr)) ); + REQUIRE( imag(dr) == Approx(imag(ddr)) ); + } + + + +TEST_CASE("fn_mean_robust_sparse_vector_test") + { + // Test mean() on vectors. + SpCol c(1000); + + SpCol cr; + double ddcr; + + c.sprandu(1000, 1, 0.3); + for (SpCol::iterator i = c.begin(); i != c.end(); ++i) + { + (*i) *= (std::numeric_limits::max()); + } + vec dc(c); + + cr = mean(c, 0); + vec dcr = mean(dc, 0); + + REQUIRE( cr.n_rows == 1 ); + REQUIRE( cr.n_cols == 1 ); + REQUIRE( (double) cr[0] == Approx(dcr[0]) ); + + cr = mean(c, 1); + dcr = mean(dc, 1); + + REQUIRE( cr.n_rows == 1000 ); + REQUIRE( cr.n_cols == 1 ); + for (uword i = 0; i < 1000; ++i) + { + REQUIRE( (double) cr[i] == Approx(dcr[i]) ); + } + + ddcr = mean(c); + double dddr = mean(dc); + + REQUIRE( ddcr == Approx(dddr) ); + + SpRow r; + r.sprandu(1, 1000, 0.3); + for (SpRow::iterator i = r.begin(); i != r.end(); ++i) + { + (*i) *= (std::numeric_limits::max()); + } + rowvec dr(r); + + SpRow rr = mean(r, 0); + rowvec drr = mean(dr, 0); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 1000 ); + for (uword i = 0; i < 1000; ++i) + { + REQUIRE( (double) rr[i] == Approx(drr[i]) ); + } + + rr = mean(r, 1); + drr = mean(dr, 1); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 1 ); + REQUIRE( (double) rr[0] == Approx(drr[0]) ); + + ddcr = mean(r); + dddr = mean(dr); + + REQUIRE( ddcr == Approx(dddr) ); + } + + + +TEST_CASE("fn_mean_robust_cx_sparse_vector_test") + { + // Test mean() on vectors. + SpCol > c(1000); + + SpCol > cr; + std::complex ddcr; + + c.sprandu(1000, 1, 0.3); + for (SpCol >::iterator i = c.begin(); i != c.end(); ++i) + { + (*i) *= (std::numeric_limits::max()); + } + cx_vec dc(c); + + cr = mean(c, 0); + cx_vec dcr = mean(dc, 0); + + REQUIRE( cr.n_rows == 1 ); + REQUIRE( cr.n_cols == 1 ); + REQUIRE( real((std::complex) cr[0]) == Approx(real(dcr[0])) ); + REQUIRE( imag((std::complex) cr[0]) == Approx(imag(dcr[0])) ); + + cr = mean(c, 1); + dcr = mean(dc, 1); + + REQUIRE( cr.n_rows == 1000 ); + REQUIRE( cr.n_cols == 1 ); + for (uword i = 0; i < 1000; ++i) + { + REQUIRE( real((std::complex) cr[i]) == Approx(real(dcr[i])) ); + REQUIRE( imag((std::complex) cr[i]) == Approx(imag(dcr[i])) ); + } + + ddcr = mean(c); + std::complex dddr = mean(dc); + + REQUIRE( real(ddcr) == Approx(real(dddr)) ); + REQUIRE( imag(ddcr) == Approx(imag(dddr)) ); + + SpRow > r; + r.sprandu(1, 1000, 0.3); + cx_rowvec dr(r); + + SpRow > rr = mean(r, 0); + cx_rowvec drr = mean(dr, 0); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 1000 ); + for (uword i = 0; i < 1000; ++i) + { + REQUIRE( real((std::complex) rr[i]) == Approx(real(drr[i])) ); + REQUIRE( imag((std::complex) rr[i]) == Approx(imag(drr[i])) ); + } + + rr = mean(r, 1); + drr = mean(dr, 1); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 1 ); + REQUIRE( real((std::complex) rr[0]) == Approx(real(drr[0])) ); + REQUIRE( imag((std::complex) rr[0]) == Approx(imag(drr[0])) ); + + ddcr = mean(r); + dddr = mean(dr); + + REQUIRE( real(ddcr) == Approx(real(dddr)) ); + REQUIRE( imag(ddcr) == Approx(imag(dddr)) ); + } + + + +TEST_CASE("fn_mean_sparse_alias_test") + { + sp_mat s; + s.sprandu(70, 70, 0.3); + mat d(s); + + s = mean(s); + d = mean(d); + + REQUIRE( d.n_rows == s.n_rows ); + REQUIRE( d.n_cols == s.n_cols ); + for (uword i = 0; i < d.n_elem; ++i) + { + REQUIRE( d[i] == Approx((double) s[i]) ); + } + + s.sprandu(70, 70, 0.3); + d = s; + + s = mean(s, 1); + d = mean(d, 1); + for (uword i = 0; i < d.n_elem; ++i) + { + REQUIRE( d[i] == Approx((double) s[i]) ); + } + } diff -Nru armadillo-7.600.2+dfsg/tests/fn_min.cpp armadillo-7.950.1+dfsg/tests/fn_min.cpp --- armadillo-7.600.2+dfsg/tests/fn_min.cpp 1970-01-01 00:00:00.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_min.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -0,0 +1,452 @@ +// Copyright 2011-2017 Ryan Curtin (http://www.ratml.org/) +// Copyright 2017 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + +#include + +#include "catch.hpp" + +using namespace arma; + +TEST_CASE("fn_min_weird_operation") + { + mat a(10, 10); + mat b(25, 10); + a.randn(); + b.randn(); + + mat output = a * b.t(); + + uword real_min; + uword operation_min; + + const double mval = output.min(real_min); + const double other_mval = (a * b.t()).min(operation_min); + + REQUIRE( real_min == operation_min ); + REQUIRE( mval == Approx(other_mval) ); + } + + + +TEST_CASE("fn_min_weird_sparse_operation") + { + sp_mat a(10, 10); + sp_mat b(25, 10); + a.sprandn(10, 10, 0.3); + b.sprandn(25, 10, 0.3); + + sp_mat output = a * b.t(); + + uword real_min; + uword operation_min; + + const double mval = output.min(real_min); + const double other_mval = (a * b.t()).min(operation_min); + + REQUIRE( real_min == operation_min ); + REQUIRE( mval == Approx(other_mval) ); + } + + + +TEST_CASE("fn_min_sp_subview_test") + { + // We will assume subview.at() works and returns points within the bounds of + // the matrix, so we just have to ensure the results are the same as + // Mat.min()... + for (size_t r = 50; r < 150; ++r) + { + sp_mat x; + x.sprandn(r, r, 0.3); + + uword x_min; + uword x_subview_min1; + uword x_subview_min2; + uword x_subview_min3; + + const double mval = x.min(x_min); + const double mval1 = x.submat(0, 0, r - 1, r - 1).min(x_subview_min1); + const double mval2 = x.cols(0, r - 1).min(x_subview_min2); + const double mval3 = x.rows(0, r - 1).min(x_subview_min3); + + if (mval != 0.0) + { + REQUIRE( x_min == x_subview_min1 ); + REQUIRE( x_min == x_subview_min2 ); + REQUIRE( x_min == x_subview_min3 ); + + REQUIRE( mval == Approx(mval1) ); + REQUIRE( mval == Approx(mval2) ); + REQUIRE( mval == Approx(mval3) ); + } + } + } + + + +TEST_CASE("fn_min_spsubview_col_test") + { + for (size_t r = 10; r < 50; ++r) + { + sp_vec x; + x.sprandn(r, 1, 0.3); + + uword x_min; + uword x_subview_min1; + uword x_subview_min2; + + const double mval = x.min(x_min); + const double mval1 = x.submat(0, 0, r - 1, 0).min(x_subview_min1); + const double mval2 = x.rows(0, r - 1).min(x_subview_min2); + + if (mval != 0.0) + { + REQUIRE( x_min == x_subview_min1 ); + REQUIRE( x_min == x_subview_min2 ); + + REQUIRE( mval == Approx(mval1) ); + REQUIRE( mval == Approx(mval2) ); + } + } + } + + + +TEST_CASE("fn_min_spsubview_row_min_test") + { + for (size_t r = 10; r < 50; ++r) + { + sp_rowvec x; + x.sprandn(1, r, 0.3); + + uword x_min; + uword x_subview_min1; + uword x_subview_min2; + + const double mval = x.min(x_min); + const double mval1 = x.submat(0, 0, 0, r - 1).min(x_subview_min1); + const double mval2 = x.cols(0, r - 1).min(x_subview_min2); + + if (mval != 0.0) + { + REQUIRE( x_min == x_subview_min1 ); + REQUIRE( x_min == x_subview_min2 ); + + REQUIRE( mval == Approx(mval1) ); + REQUIRE( mval == Approx(mval2) ); + } + } + } + + + +TEST_CASE("fn_min_spincompletesubview_min_test") + { + for (size_t r = 50; r < 150; ++r) + { + sp_mat x; + x.sprandn(r, r, 0.3); + + uword x_min; + uword x_subview_min1; + uword x_subview_min2; + uword x_subview_min3; + + const double mval = x.min(x_min); + const double mval1 = x.submat(1, 1, r - 2, r - 2).min(x_subview_min1); + const double mval2 = x.cols(1, r - 2).min(x_subview_min2); + const double mval3 = x.rows(1, r - 2).min(x_subview_min3); + + uword row, col; + x.min(row, col); + + if (row != 0 && row != r - 1 && col != 0 && col != r - 1 && mval != 0.0) + { + uword srow, scol; + + srow = x_subview_min1 % (r - 2); + scol = x_subview_min1 / (r - 2); + REQUIRE( x_min == (srow + 1) + r * (scol + 1) ); + REQUIRE( x_min == x_subview_min2 + r ); + + srow = x_subview_min3 % (r - 2); + scol = x_subview_min3 / (r - 2); + REQUIRE( x_min == (srow + 1) + r * scol ); + + REQUIRE( mval == Approx(mval1) ); + REQUIRE( mval == Approx(mval2) ); + REQUIRE( mval == Approx(mval3) ); + } + } + } + + + +TEST_CASE("fn_min_spincompletesubview_col_min_test") + { + for (size_t r = 10; r < 50; ++r) + { + sp_vec x; + x.sprandu(r, 1, 0.3); + + uword x_min; + uword x_subview_min1; + uword x_subview_min2; + + const double mval = x.min(x_min); + const double mval1 = x.submat(1, 0, r - 2, 0).min(x_subview_min1); + const double mval2 = x.rows(1, r - 2).min(x_subview_min2); + + if (x_min != 0 && x_min != r - 1 && mval != 0.0) + { + REQUIRE( x_min == x_subview_min1 + 1 ); + REQUIRE( x_min == x_subview_min2 + 1 ); + + REQUIRE( mval == Approx(mval1) ); + REQUIRE( mval == Approx(mval2) ); + } + } + } + + + +TEST_CASE("fn_min_spincompletesubview_row_min_test") + { + for (size_t r = 10; r < 50; ++r) + { + sp_rowvec x; + x.sprandn(1, r, 0.3); + + uword x_min; + uword x_subview_min1; + uword x_subview_min2; + + const double mval = x.min(x_min); + const double mval1 = x.submat(0, 1, 0, r - 2).min(x_subview_min1); + const double mval2 = x.cols(1, r - 2).min(x_subview_min2); + + if (mval != 0.0 && x_min != 0 && x_min != r - 1) + { + REQUIRE( x_min == x_subview_min1 + 1 ); + REQUIRE( x_min == x_subview_min2 + 1 ); + + REQUIRE( mval == Approx(mval1) ); + REQUIRE( mval == Approx(mval2) ); + } + } + } + + + +TEST_CASE("fn_min_sp_cx_subview_min_test") + { + // We will assume subview.at() works and returns points within the bounds of + // the matrix, so we just have to ensure the results are the same as + // Mat.min()... + for (size_t r = 50; r < 150; ++r) + { + sp_cx_mat x; + x.sprandn(r, r, 0.3); + + uword x_min; + uword x_subview_min1; + uword x_subview_min2; + uword x_subview_min3; + + const std::complex mval = x.min(x_min); + const std::complex mval1 = x.submat(0, 0, r - 1, r - 1).min(x_subview_min1); + const std::complex mval2 = x.cols(0, r - 1).min(x_subview_min2); + const std::complex mval3 = x.rows(0, r - 1).min(x_subview_min3); + + if (mval != std::complex(0.0)) + { + REQUIRE( x_min == x_subview_min1 ); + REQUIRE( x_min == x_subview_min2 ); + REQUIRE( x_min == x_subview_min3 ); + + REQUIRE( mval.real() == Approx(mval1.real()) ); + REQUIRE( mval.imag() == Approx(mval1.imag()) ); + REQUIRE( mval.real() == Approx(mval2.real()) ); + REQUIRE( mval.imag() == Approx(mval2.imag()) ); + REQUIRE( mval.real() == Approx(mval3.real()) ); + REQUIRE( mval.imag() == Approx(mval3.imag()) ); + } + } + } + + + +TEST_CASE("fn_min_sp_cx_subview_col_min_test") + { + for (size_t r = 10; r < 50; ++r) + { + sp_cx_vec x; + x.sprandn(r, 1, 0.3); + + uword x_min; + uword x_subview_min1; + uword x_subview_min2; + + const std::complex mval = x.min(x_min); + const std::complex mval1 = x.submat(0, 0, r - 1, 0).min(x_subview_min1); + const std::complex mval2 = x.rows(0, r - 1).min(x_subview_min2); + + if (mval != std::complex(0.0)) + { + REQUIRE( x_min == x_subview_min1 ); + REQUIRE( x_min == x_subview_min2 ); + + REQUIRE( mval.real() == Approx(mval1.real()) ); + REQUIRE( mval.imag() == Approx(mval1.imag()) ); + REQUIRE( mval.real() == Approx(mval2.real()) ); + REQUIRE( mval.imag() == Approx(mval2.imag()) ); + } + } + } + + + +TEST_CASE("fn_min_sp_cx_subview_row_min_test") + { + for (size_t r = 10; r < 50; ++r) + { + sp_cx_rowvec x; + x.sprandn(1, r, 0.3); + + uword x_min; + uword x_subview_min1; + uword x_subview_min2; + + const std::complex mval = x.min(x_min); + const std::complex mval1 = x.submat(0, 0, 0, r - 1).min(x_subview_min1); + const std::complex mval2 = x.cols(0, r - 1).min(x_subview_min2); + + if (mval != std::complex(0.0)) + { + REQUIRE( x_min == x_subview_min1 ); + REQUIRE( x_min == x_subview_min2 ); + + REQUIRE( mval.real() == Approx(mval1.real()) ); + REQUIRE( mval.imag() == Approx(mval1.imag()) ); + REQUIRE( mval.real() == Approx(mval2.real()) ); + REQUIRE( mval.imag() == Approx(mval2.imag()) ); + } + } + } + + + +TEST_CASE("fn_min_sp_cx_incomplete_subview_min_test") + { + for (size_t r = 50; r < 150; ++r) + { + sp_cx_mat x; + x.sprandn(r, r, 0.3); + + uword x_min; + uword x_subview_min1; + uword x_subview_min2; + uword x_subview_min3; + + const std::complex mval = x.min(x_min); + const std::complex mval1 = x.submat(1, 1, r - 2, r - 2).min(x_subview_min1); + const std::complex mval2 = x.cols(1, r - 2).min(x_subview_min2); + const std::complex mval3 = x.rows(1, r - 2).min(x_subview_min3); + + uword row, col; + x.min(row, col); + + if (row != 0 && row != r - 1 && col != 0 && col != r - 1 && mval != std::complex(0.0)) + { + uword srow, scol; + + srow = x_subview_min1 % (r - 2); + scol = x_subview_min1 / (r - 2); + REQUIRE( x_min == (srow + 1) + r * (scol + 1) ); + REQUIRE( x_min == x_subview_min2 + r ); + + srow = x_subview_min3 % (r - 2); + scol = x_subview_min3 / (r - 2); + REQUIRE( x_min == (srow + 1) + r * scol ); + + REQUIRE( mval.real() == Approx(mval1.real()) ); + REQUIRE( mval.imag() == Approx(mval1.imag()) ); + REQUIRE( mval.real() == Approx(mval2.real()) ); + REQUIRE( mval.imag() == Approx(mval2.imag()) ); + REQUIRE( mval.real() == Approx(mval3.real()) ); + REQUIRE( mval.imag() == Approx(mval3.imag()) ); + } + } + } + + + +TEST_CASE("fn_min_sp_cx_incomplete_subview_col_min_test") + { + for (size_t r = 10; r < 50; ++r) + { + arma::sp_cx_vec x; + x.sprandn(r, 1, 0.3); + + uword x_min; + uword x_subview_min1; + uword x_subview_min2; + + const std::complex mval = x.min(x_min); + const std::complex mval1 = x.submat(1, 0, r - 2, 0).min(x_subview_min1); + const std::complex mval2 = x.rows(1, r - 2).min(x_subview_min2); + + if (x_min != 0 && x_min != r - 1 && mval != std::complex(0.0)) + { + REQUIRE( x_min == x_subview_min1 + 1 ); + REQUIRE( x_min == x_subview_min2 + 1 ); + + REQUIRE( mval.real() == Approx(mval1.real()) ); + REQUIRE( mval.imag() == Approx(mval1.imag()) ); + REQUIRE( mval.real() == Approx(mval2.real()) ); + REQUIRE( mval.imag() == Approx(mval2.imag()) ); + } + } + } + + + +TEST_CASE("fn_min_sp_cx_incomplete_subview_row_min_test") + { + for (size_t r = 10; r < 50; ++r) + { + sp_cx_rowvec x; + x.sprandn(1, r, 0.3); + + uword x_min; + uword x_subview_min1; + uword x_subview_min2; + + const std::complex mval = x.min(x_min); + const std::complex mval1 = x.submat(0, 1, 0, r - 2).min(x_subview_min1); + const std::complex mval2 = x.cols(1, r - 2).min(x_subview_min2); + + if (x_min != 0 && x_min != r - 1 && mval != std::complex(0.0)) + { + REQUIRE( x_min == x_subview_min1 + 1 ); + REQUIRE( x_min == x_subview_min2 + 1 ); + + REQUIRE( mval.real() == Approx(mval1.real()) ); + REQUIRE( mval.imag() == Approx(mval1.imag()) ); + REQUIRE( mval.real() == Approx(mval2.real()) ); + REQUIRE( mval.imag() == Approx(mval2.imag()) ); + } + } + } diff -Nru armadillo-7.600.2+dfsg/tests/fn_spsolve.cpp armadillo-7.950.1+dfsg/tests/fn_spsolve.cpp --- armadillo-7.600.2+dfsg/tests/fn_spsolve.cpp 1970-01-01 00:00:00.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_spsolve.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -0,0 +1,900 @@ +// Copyright 2011-2017 Ryan Curtin (http://www.ratml.org/) +// Copyright 2017 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + +#include + +#include "catch.hpp" + +using namespace arma; + +#if defined(ARMA_USE_SUPERLU) + +TEST_CASE("fn_spsolve_sparse_test") + { + // We want to spsolve a system of equations, AX = B, where we want to recover + // X and we have A and B, and A is sparse. + for (size_t t = 0; t < 10; ++t) + { + const uword size = 5 * (t + 1); + + mat rX; + rX.randu(size, size); + + sp_mat A; + A.sprandu(size, size, 0.25); + for (uword i = 0; i < size; ++i) + { + A(i, i) += rand(); + } + + mat B = A * rX; + + mat X; + bool result = spsolve(X, A, B); + REQUIRE( result ); + + // Dense solver. + mat dA(A); + mat dX = solve(dA, B); + + REQUIRE( X.n_cols == dX.n_cols ); + REQUIRE( X.n_rows == dX.n_rows ); + + for (uword i = 0; i < dX.n_cols; ++i) + { + for (uword j = 0; j < dX.n_rows; ++j) + { + REQUIRE( (double) X(j, i) == Approx((double) dX(j, i)) ); + } + } + } + } + + + +TEST_CASE("fn_spsolve_sparse_nonsymmetric_test") + { + for (size_t t = 0; t < 10; ++t) + { + const uword r_size = 5 * (t + 1); + const uword c_size = 3 * (t + 4); + + mat rX; + rX.randu(r_size, c_size); + + sp_mat A; + A.sprandu(r_size, r_size, 0.25); + for (uword i = 0; i < r_size; ++i) + { + A(i, i) += rand(); + } + + mat B = A * rX; + + mat X; + bool result = spsolve(X, A, B); + REQUIRE( result ); + + // Dense solver. + mat dA(A); + mat dX = solve(dA, B); + + REQUIRE( X.n_cols == dX.n_cols ); + REQUIRE( X.n_rows == dX.n_rows ); + + for (uword i = 0; i < dX.n_cols; ++i) + { + for (uword j = 0; j < dX.n_rows; ++j) + { + REQUIRE( (double) X(j, i) == Approx((double) dX(j, i)) ); + } + } + } + } + + + +TEST_CASE("fn_spsolve_sparse_float_test") + { + // We want to spsolve a system of equations, AX = B, where we want to recover + // X and we have A and B, and A is sparse. + for (size_t t = 0; t < 10; ++t) + { + const uword size = 5 * (t + 1); + + fmat rX; + rX.randu(size, size); + + SpMat A; + A.sprandu(size, size, 0.25); + for (uword i = 0; i < size; ++i) + { + A(i, i) += rand(); + } + + fmat B = A * rX; + + fmat X; + bool result = spsolve(X, A, B); + REQUIRE( result ); + + // Dense solver. + fmat dA(A); + fmat dX = solve(dA, B); + + REQUIRE( X.n_cols == dX.n_cols ); + REQUIRE( X.n_rows == dX.n_rows ); + + for (size_t i = 0; i < dX.n_cols; ++i) + { + for (size_t j = 0; j < dX.n_rows; ++j) + { + REQUIRE( (float) X(j, i) == Approx((float) dX(j, i)) ); + } + } + } + } + + + +TEST_CASE("fn_spsolve_sparse_nonsymmetric_float_test") + { + for (size_t t = 0; t < 10; ++t) + { + const uword r_size = 5 * (t + 1); + const uword c_size = 3 * (t + 4); + + fmat rX; + rX.randu(r_size, c_size); + + SpMat A; + A.sprandu(r_size, r_size, 0.25); + for (uword i = 0; i < r_size; ++i) + { + A(i, i) += rand(); + } + + fmat B = A * rX; + + fmat X; + bool result = spsolve(X, A, B); + REQUIRE( result ); + + // Dense solver. + fmat dA(A); + fmat dX = solve(dA, B); + + REQUIRE( X.n_cols == dX.n_cols ); + REQUIRE( X.n_rows == dX.n_rows ); + + for (uword i = 0; i < dX.n_cols; ++i) + { + for (uword j = 0; j < dX.n_rows; ++j) + { + REQUIRE( (float) X(j, i) == Approx((float) dX(j, i)) ); + } + } + } + } + + + +TEST_CASE("fn_spsolve_sparse_complex_float_test") + { + // We want to spsolve a system of equations, AX = B, where we want to recover + // X and we have A and B, and A is sparse. + for (size_t t = 0; t < 10; ++t) + { + const uword size = 5 * (t + 1); + + Mat > rX; + rX.randu(size, size); + + SpMat > A; + A.sprandu(size, size, 0.25); + for(uword i = 0; i < size; ++i) + { + A(i, i) += rand(); + } + + Mat > B = A * rX; + + Mat > X; + bool result = spsolve(X, A, B); + REQUIRE( result ); + + // Dense solver. + Mat > dA(A); + Mat > dX = solve(dA, B); + + REQUIRE( X.n_cols == dX.n_cols ); + REQUIRE( X.n_rows == dX.n_rows ); + + for (uword i = 0; i < dX.n_cols; ++i) + { + for (uword j = 0; j < dX.n_rows; ++j) + { + REQUIRE( (float) std::abs((std::complex) X(j, i)) == + Approx((float) std::abs((std::complex) dX(j, i))) ); + } + } + } + } + + + +TEST_CASE("fn_spsolve_sparse_nonsymmetric_complex_float_test") + { + for (size_t t = 0; t < 10; ++t) + { + const uword r_size = 5 * (t + 1); + const uword c_size = 3 * (t + 4); + + Mat > rX; + rX.randu(r_size, c_size); + + SpMat > A; + A.sprandu(r_size, r_size, 0.25); + for (uword i = 0; i < r_size; ++i) + { + A(i, i) += rand(); + } + + Mat > B = A * rX; + + Mat > X; + bool result = spsolve(X, A, B); + REQUIRE( result ); + + // Dense solver. + Mat > dA(A); + Mat > dX = solve(dA, B); + + REQUIRE( X.n_cols == dX.n_cols ); + REQUIRE( X.n_rows == dX.n_rows ); + + for (uword i = 0; i < dX.n_cols; ++i) + { + for (uword j = 0; j < dX.n_rows; ++j) + { + REQUIRE( (float) std::abs((std::complex) X(j, i)) == + Approx((float) std::abs((std::complex) dX(j, i))) ); + } + } + } + } + + + +TEST_CASE("fn_spsolve_sparse_complex_test") + { + // We want to spsolve a system of equations, AX = B, where we want to recover + // X and we have A and B, and A is sparse. + for (size_t t = 0; t < 10; ++t) + { + const uword size = 5 * (t + 1); + + Mat > rX; + rX.randu(size, size); + + SpMat > A; + A.sprandu(size, size, 0.25); + for (uword i = 0; i < size; ++i) + { + A(i, i) += rand(); + } + + Mat > B = A * rX; + + Mat > X; + bool result = spsolve(X, A, B); + REQUIRE( result ); + + // Dense solver. + Mat > dA(A); + Mat > dX = solve(dA, B); + + REQUIRE( X.n_cols == dX.n_cols ); + REQUIRE( X.n_rows == dX.n_rows ); + + for (uword i = 0; i < dX.n_cols; ++i) + { + for (uword j = 0; j < dX.n_rows; ++j) + { + REQUIRE( (double) std::abs((std::complex) X(j, i)) == + Approx((double) std::abs((std::complex) dX(j, i))) ); + } + } + } + } + + + +TEST_CASE("fn_spsolve_sparse_nonsymmetric_complex_test") + { + for (size_t t = 0; t < 10; ++t) + { + const uword r_size = 5 * (t + 1); + const uword c_size = 3 * (t + 4); + + Mat > rX; + rX.randu(r_size, c_size); + + SpMat > A; + A.sprandu(r_size, r_size, 0.25); + for (uword i = 0; i < r_size; ++i) + { + A(i, i) += rand(); + } + + Mat > B = A * rX; + + Mat > X; + bool result = spsolve(X, A, B); + REQUIRE( result ); + + // Dense solver. + Mat > dA(A); + Mat > dX = solve(dA, B); + + REQUIRE( X.n_cols == dX.n_cols ); + REQUIRE( X.n_rows == dX.n_rows ); + + for (uword i = 0; i < dX.n_cols; ++i) + { + for (uword j = 0; j < dX.n_rows; ++j) + { + REQUIRE( (double) std::abs((std::complex) X(j, i)) == + Approx((double) std::abs((std::complex) dX(j, i))) ); + } + } + } + } + + + +TEST_CASE("fn_spsolve_delayed_sparse_test") + { + const uword size = 10; + + mat rX; + rX.randu(size, size); + + sp_mat A; + A.sprandu(size, size, 0.25); + for (uword i = 0; i < size; ++i) + { + A(i, i) += rand(); + } + + mat B = A * rX; + + mat X; + bool result = spsolve(X, A, B); + REQUIRE( result ); + + mat dX = spsolve(A, B); + + REQUIRE( X.n_cols == dX.n_cols ); + REQUIRE( X.n_rows == dX.n_rows ); + + for (uword i = 0; i < dX.n_cols; ++i) + { + for (uword j = 0; j < dX.n_rows; ++j) + { + REQUIRE( (double) X(j, i) == Approx((double) dX(j, i)) ); + } + } + } + + + +TEST_CASE("fn_spsolve_superlu_solve_test") + { + // Solve this matrix, as in the examples: + // [[19 0 21 21 0] + // [12 21 0 0 0] + // [ 0 12 16 0 0] + // [ 0 0 0 5 21] + // [12 12 0 0 18]] + sp_mat b(5, 5); + b(0, 0) = 19; + b(0, 2) = 21; + b(0, 3) = 21; + b(1, 0) = 12; + b(1, 1) = 21; + b(2, 1) = 12; + b(2, 2) = 16; + b(3, 3) = 5; + b(3, 4) = 21; + b(4, 0) = 12; + b(4, 1) = 12; + b(4, 4) = 18; + + mat db(b); + + sp_mat a; + a.eye(5, 5); + mat da(a); + + mat x; + spsolve(x, a, db); + + mat dx = solve(da, db); + + for (uword i = 0; i < x.n_cols; ++i) + { + for (uword j = 0; j < x.n_rows; ++j) + { + REQUIRE( (double) x(j, i) == Approx(dx(j, i)) ); + } + } + } + + + +TEST_CASE("fn_spsolve_random_superlu_solve_test") + { + // Try to solve some random systems. + const size_t iterations = 10; + for (size_t it = 0; it < iterations; ++it) + { + sp_mat a; + a.sprandu(50, 50, 0.3); + sp_mat trueX; + trueX.sprandu(50, 50, 0.3); + + sp_mat b = a * trueX; + + // Get things into the right format. + mat db(b); + + mat x; + + spsolve(x, a, db); + + for (uword i = 0; i < x.n_cols; ++i) + { + for (uword j = 0; j < x.n_rows; ++j) + { + REQUIRE( x(j, i) == Approx((double) trueX(j, i)) ); + } + } + } + } + + + +TEST_CASE("fn_spsolve_float_superlu_solve_test") + { + // Solve this matrix, as in the examples: + // [[19 0 21 21 0] + // [12 21 0 0 0] + // [ 0 12 16 0 0] + // [ 0 0 0 5 21] + // [12 12 0 0 18]] + sp_fmat b(5, 5); + b(0, 0) = 19; + b(0, 2) = 21; + b(0, 3) = 21; + b(1, 0) = 12; + b(1, 1) = 21; + b(2, 1) = 12; + b(2, 2) = 16; + b(3, 3) = 5; + b(3, 4) = 21; + b(4, 0) = 12; + b(4, 1) = 12; + b(4, 4) = 18; + + fmat db(b); + + sp_fmat a; + a.eye(5, 5); + fmat da(a); + + fmat x; + spsolve(x, a, db); + + fmat dx = solve(da, db); + + for (uword i = 0; i < x.n_cols; ++i) + { + for (uword j = 0; j < x.n_rows; ++j) + { + REQUIRE( (float) x(j, i) == Approx(dx(j, i)) ); + } + } + } + + + +TEST_CASE("fn_spsolve_float_random_superlu_solve_test") + { + // Try to solve some random systems. + const size_t iterations = 10; + for (size_t it = 0; it < iterations; ++it) + { + sp_fmat a; + a.sprandu(50, 50, 0.3); + sp_fmat trueX; + trueX.sprandu(50, 50, 0.3); + + sp_fmat b = a * trueX; + + // Get things into the right format. + fmat db(b); + + fmat x; + + spsolve(x, a, db); + + for (uword i = 0; i < x.n_cols; ++i) + { + for (uword j = 0; j < x.n_rows; ++j) + { + if (std::abs(trueX(j, i)) < 0.001) + REQUIRE( std::abs(x(j, i)) < 0.005 ); + else + REQUIRE( trueX(j, i) == Approx((float) x(j, i)).epsilon(0.01) ); + } + } + } + } + + + +TEST_CASE("fn_spsolve_cx_float_superlu_solve_test") + { + // Solve this matrix, as in the examples: + // [[19 0 21 21 0] + // [12 21 0 0 0] + // [ 0 12 16 0 0] + // [ 0 0 0 5 21] + // [12 12 0 0 18]] (imaginary part is the same) + SpMat > b(5, 5); + b(0, 0) = std::complex(19, 19); + b(0, 2) = std::complex(21, 21); + b(0, 3) = std::complex(21, 21); + b(1, 0) = std::complex(12, 12); + b(1, 1) = std::complex(21, 21); + b(2, 1) = std::complex(12, 12); + b(2, 2) = std::complex(16, 16); + b(3, 3) = std::complex(5, 5); + b(3, 4) = std::complex(21, 21); + b(4, 0) = std::complex(12, 12); + b(4, 1) = std::complex(12, 12); + b(4, 4) = std::complex(18, 18); + + Mat > db(b); + + SpMat > a; + a.eye(5, 5); + Mat > da(a); + + Mat > x; + spsolve(x, a, db); + + Mat > dx = solve(da, db); + + for (uword i = 0; i < x.n_cols; ++i) + { + for (uword j = 0; j < x.n_rows; ++j) + { + if (std::abs(x(j, i)) < 0.001 ) + { + REQUIRE( std::abs(dx(j, i)) < 0.005 ); + } + else + { + REQUIRE( ((std::complex) x(j, i)).real() == + Approx(dx(j, i).real()).epsilon(0.01) ); + REQUIRE( ((std::complex) x(j, i)).imag() == + Approx(dx(j, i).imag()).epsilon(0.01) ); + } + } + } + } + + + +TEST_CASE("fn_spsolve_cx_float_random_superlu_solve_test") + { + // Try to solve some random systems. + const size_t iterations = 10; + for (size_t it = 0; it < iterations; ++it) + { + SpMat > a; + a.sprandu(50, 50, 0.3); + SpMat > trueX; + trueX.sprandu(50, 50, 0.3); + + SpMat > b = a * trueX; + + // Get things into the right format. + Mat > db(b); + + Mat > x; + + spsolve(x, a, db); + + for (uword i = 0; i < x.n_cols; ++i) + { + for (uword j = 0; j < x.n_rows; ++j) + { + if (std::abs((std::complex) trueX(j, i)) < 0.001 ) + { + REQUIRE( std::abs(x(j, i)) < 0.001 ); + } + else + { + REQUIRE( ((std::complex) trueX(j, i)).real() == + Approx(x(j, i).real()).epsilon(0.01) ); + REQUIRE( ((std::complex) trueX(j, i)).imag() == + Approx(x(j, i).imag()).epsilon(0.01) ); + } + } + } + } + } + + + +TEST_CASE("fn_spsolve_cx_superlu_solve_test") + { + // Solve this matrix, as in the examples: + // [[19 0 21 21 0] + // [12 21 0 0 0] + // [ 0 12 16 0 0] + // [ 0 0 0 5 21] + // [12 12 0 0 18]] (imaginary part is the same) + SpMat > b(5, 5); + b(0, 0) = std::complex(19, 19); + b(0, 2) = std::complex(21, 21); + b(0, 3) = std::complex(21, 21); + b(1, 0) = std::complex(12, 12); + b(1, 1) = std::complex(21, 21); + b(2, 1) = std::complex(12, 12); + b(2, 2) = std::complex(16, 16); + b(3, 3) = std::complex(5, 5); + b(3, 4) = std::complex(21, 21); + b(4, 0) = std::complex(12, 12); + b(4, 1) = std::complex(12, 12); + b(4, 4) = std::complex(18, 18); + + cx_mat db(b); + + sp_cx_mat a; + a.eye(5, 5); + cx_mat da(a); + + cx_mat x; + spsolve(x, a, db); + + cx_mat dx = solve(da, db); + + for (uword i = 0; i < x.n_cols; ++i) + { + for (uword j = 0; j < x.n_rows; ++j) + { + if (std::abs(x(j, i)) < 0.001) + { + REQUIRE( std::abs(dx(j, i)) < 0.005 ); + } + else + { + REQUIRE( ((std::complex) x(j, i)).real() == + Approx(dx(j, i).real()).epsilon(0.01) ); + REQUIRE( ((std::complex) x(j, i)).imag() == + Approx(dx(j, i).imag()).epsilon(0.01) ); + } + } + } + } + + + +TEST_CASE("fn_spsolve_cx_random_superlu_solve_test") + { + // Try to solve some random systems. + const size_t iterations = 10; + for (size_t it = 0; it < iterations; ++it) + { + sp_cx_mat a; + a.sprandu(50, 50, 0.3); + sp_cx_mat trueX; + trueX.sprandu(50, 50, 0.3); + + sp_cx_mat b = a * trueX; + + // Get things into the right format. + cx_mat db(b); + + cx_mat x; + + spsolve(x, a, db); + + for (uword i = 0; i < x.n_cols; ++i) + { + for (uword j = 0; j < x.n_rows; ++j) + { + if (std::abs((std::complex) trueX(j, i)) < 0.001) + { + REQUIRE( std::abs(x(j, i)) < 0.005 ); + } + else + { + REQUIRE( ((std::complex) trueX(j, i)).real() == + Approx(x(j, i).real()).epsilon(0.01) ); + REQUIRE( ((std::complex) trueX(j, i)).imag() == + Approx(x(j, i).imag()).epsilon(0.01) ); + } + } + } + } + } + + + +TEST_CASE("fn_spsolve_function_test") + { + sp_mat a; + a.sprandu(50, 50, 0.3); + sp_mat trueX; + trueX.sprandu(50, 50, 0.3); + + sp_mat b = a * trueX; + + // Get things into the right format. + mat db(b); + + mat x; + + // Mostly these are compilation tests. + spsolve(x, a, db); + x = spsolve(a, db); // Test another overload. + x = spsolve(a, db + 0.0); + spsolve(x, a, db + 0.0); + + for (uword i = 0; i < x.n_cols; ++i) + { + for (uword j = 0; j < x.n_rows; ++j) + { + REQUIRE( (double) trueX(j, i) == Approx(x(j, i)) ); + } + } + } + + + +TEST_CASE("fn_spsolve_float_function_test") + { + sp_fmat a; + a.sprandu(50, 50, 0.3); + sp_fmat trueX; + trueX.sprandu(50, 50, 0.3); + + sp_fmat b = a * trueX; + + // Get things into the right format. + fmat db(b); + + fmat x; + + // Mostly these are compilation tests. + spsolve(x, a, db); + x = spsolve(a, db); // Test another overload. + x = spsolve(a, db + 0.0); + spsolve(x, a, db + 0.0); + + for (uword i = 0; i < x.n_cols; ++i) + { + for (uword j = 0; j < x.n_rows; ++j) + { + if (std::abs(trueX(j, i)) < 0.001) + { + REQUIRE( std::abs(x(j, i)) < 0.001 ); + } + else + { + REQUIRE( (float) trueX(j, i) == Approx(x(j, i)).epsilon(0.01) ); + } + } + } + } + + + +TEST_CASE("fn_spsolve_cx_function_test") + { + sp_cx_mat a; + a.sprandu(50, 50, 0.3); + sp_cx_mat trueX; + trueX.sprandu(50, 50, 0.3); + + sp_cx_mat b = a * trueX; + + // Get things into the right format. + cx_mat db(b); + + cx_mat x; + + // Mostly these are compilation tests. + spsolve(x, a, db); + x = spsolve(a, db); // Test another overload. + x = spsolve(a, db + std::complex(0.0)); + spsolve(x, a, db + std::complex(0.0)); + + for (uword i = 0; i < x.n_cols; ++i) + { + for (uword j = 0; j < x.n_rows; ++j) + { + if (std::abs((std::complex) trueX(j, i)) < 0.001) + { + REQUIRE( std::abs(x(j, i)) < 0.005 ); + } + else + { + REQUIRE( ((std::complex) trueX(j, i)).real() == + Approx(x(j, i).real()).epsilon(0.01) ); + REQUIRE( ((std::complex) trueX(j, i)).imag() == + Approx(x(j, i).imag()).epsilon(0.01) ); + } + } + } + } + + + +TEST_CASE("fn_spsolve_cx_float_function_test") + { + sp_cx_fmat a; + a.sprandu(50, 50, 0.3); + sp_cx_fmat trueX; + trueX.sprandu(50, 50, 0.3); + + sp_cx_fmat b = a * trueX; + + // Get things into the right format. + cx_fmat db(b); + + cx_fmat x; + + // Mostly these are compilation tests. + spsolve(x, a, db); + x = spsolve(a, db); // Test another overload. + x = spsolve(a, db + std::complex(0.0)); + spsolve(x, a, db + std::complex(0.0)); + + for (uword i = 0; i < x.n_cols; ++i) + { + for (uword j = 0; j < x.n_rows; ++j) + { + if (std::abs((std::complex) trueX(j, i)) < 0.001 ) + { + REQUIRE( std::abs(x(j, i)) < 0.005 ); + } + else + { + REQUIRE( ((std::complex) trueX(j, i)).real() == + Approx(x(j, i).real()).epsilon(0.01) ); + REQUIRE( ((std::complex) trueX(j, i)).imag() == + Approx(x(j, i).imag()).epsilon(0.01) ); + } + } + } + } + +#endif diff -Nru armadillo-7.600.2+dfsg/tests/fn_sum.cpp armadillo-7.950.1+dfsg/tests/fn_sum.cpp --- armadillo-7.600.2+dfsg/tests/fn_sum.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_sum.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- -// -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include @@ -18,7 +24,7 @@ { vec a = linspace(1,5,5); vec b = linspace(1,5,6); - + REQUIRE(sum(a) == Approx(15.0)); REQUIRE(sum(b) == Approx(18.0)); } @@ -33,16 +39,16 @@ { 0.49345, -0.12020, 0.78987, 0.53124 }, { 0.73573, 0.52104, -0.22263, 0.40163 } }; - + rowvec colsums = { 0.44080, 1.09382, 0.97808, 1.83429 }; - + colvec rowsums = { 1.21686, 1.69436, 1.43577 }; - + REQUIRE( accu(abs(colsums - sum(A ))) == Approx(0.0) ); REQUIRE( accu(abs(colsums - sum(A,0))) == Approx(0.0) ); REQUIRE( accu(abs(rowsums - sum(A,1))) == Approx(0.0) ); @@ -57,22 +63,22 @@ { 0.49345, -0.12020, 0.78987, 0.53124 }, { 0.73573, 0.52104, -0.22263, 0.40163 } }; - + cx_mat A = cx_mat(AA, 0.5*AA); - + rowvec re_colsums = { 0.44080, 1.09382, 0.97808, 1.83429 }; - + cx_rowvec cx_colsums = cx_rowvec(re_colsums, 0.5*re_colsums); - + colvec re_rowsums = { 1.21686, 1.69436, 1.43577 }; - + cx_colvec cx_rowsums = cx_colvec(re_rowsums, 0.5*re_rowsums); - + REQUIRE( accu(abs(cx_colsums - sum(A ))) == Approx(0.0) ); REQUIRE( accu(abs(cx_colsums - sum(A,0))) == Approx(0.0) ); REQUIRE( accu(abs(cx_rowsums - sum(A,1))) == Approx(0.0) ); @@ -82,7 +88,69 @@ TEST_CASE("sum4") { mat X(100,101, fill::randu); - + REQUIRE( (sum(sum(X))/X.n_elem) == Approx(0.5).epsilon(0.01) ); REQUIRE( (sum(sum(X(span::all,span::all)))/X.n_elem) == Approx(0.5).epsilon(0.01) ); } + + + +TEST_CASE("sum_spmat") + { + SpCol a(5); + a(0) = 3.0; + a(2) = 1.5; + a(3) = 1.0; + + double res = sum(a); + REQUIRE( res == Approx(5.5) ); + + SpRow b(5); + b(1) = 1.3; + b(2) = 4.4; + b(4) = 1.0; + + res = sum(b); + REQUIRE( res == Approx(6.7) ); + + SpMat c(8, 8); + c(0, 0) = 3.0; + c(1, 0) = 2.5; + c(6, 0) = 2.1; + c(4, 1) = 3.2; + c(5, 1) = 1.1; + c(1, 2) = 1.3; + c(2, 3) = 4.1; + c(5, 5) = 2.3; + c(6, 5) = 3.1; + c(7, 5) = 1.2; + c(7, 7) = 3.4; + + SpMat result = sum(c, 0); + + REQUIRE( result.n_rows == 1 ); + REQUIRE( result.n_cols == 8 ); + REQUIRE( result.n_nonzero == 6 ); + REQUIRE( (double) result(0, 0) == Approx(7.6) ); + REQUIRE( (double) result(0, 1) == Approx(4.3) ); + REQUIRE( (double) result(0, 2) == Approx(1.3) ); + REQUIRE( (double) result(0, 3) == Approx(4.1) ); + REQUIRE( (double) result(0, 4) == Approx(0.0) ); + REQUIRE( (double) result(0, 5) == Approx(6.6) ); + REQUIRE( (double) result(0, 6) == Approx(0.0) ); + REQUIRE( (double) result(0, 7) == Approx(3.4) ); + + result = sum(c, 1); + + REQUIRE( result.n_rows == 8 ); + REQUIRE( result.n_cols == 1 ); + REQUIRE( result.n_nonzero == 7 ); + REQUIRE( (double) result(0, 0) == Approx(3.0) ); + REQUIRE( (double) result(1, 0) == Approx(3.8) ); + REQUIRE( (double) result(2, 0) == Approx(4.1) ); + REQUIRE( (double) result(3, 0) == Approx(0.0) ); + REQUIRE( (double) result(4, 0) == Approx(3.2) ); + REQUIRE( (double) result(5, 0) == Approx(3.4) ); + REQUIRE( (double) result(6, 0) == Approx(5.2) ); + REQUIRE( (double) result(7, 0) == Approx(4.6) ); + } diff -Nru armadillo-7.600.2+dfsg/tests/fn_symmat.cpp armadillo-7.950.1+dfsg/tests/fn_symmat.cpp --- armadillo-7.600.2+dfsg/tests/fn_symmat.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_symmat.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/fn_trace.cpp armadillo-7.950.1+dfsg/tests/fn_trace.cpp --- armadillo-7.600.2+dfsg/tests/fn_trace.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_trace.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- -// -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include @@ -16,7 +22,7 @@ TEST_CASE("fn_trace_1") { - mat A = + mat A = "\ 0.061198 0.201990 0.019678 -0.493936 -0.126745 0.051408;\ 0.437242 0.058956 -0.149362 -0.045465 0.296153 0.035437;\ @@ -24,14 +30,35 @@ 0.336352 0.411541 0.458476 -0.393139 -0.135040 0.373833;\ 0.239585 -0.428913 -0.406953 -0.291020 -0.353768 0.258704;\ "; - + vec diagonal = { 0.061198, 0.058956, 0.314156, -0.393139, -0.353768 }; - + REQUIRE( accu( trace(A) - accu(diagonal) ) == Approx(0.0) ); - + REQUIRE( accu( trace(2*A) - accu(2*diagonal) ) == Approx(0.0) ); - + REQUIRE( accu( trace(A+A) - accu(diagonal+diagonal) ) == Approx(0.0) ); - + // REQUIRE_THROWS( ); } + + + +TEST_CASE("fn_trace_spmat") + { + SpMat a(6, 6); + a(0, 0) = 3.0; + a(2, 1) = 4.4; + a(4, 1) = 1.2; + a(0, 2) = 3.1; + a(1, 2) = 3.2; + a(2, 2) = 3.3; + a(3, 3) = 4.0; + a(5, 3) = 6.0; + a(5, 4) = 5.9; + a(5, 5) = 1.2; + + REQUIRE( trace(a) == Approx(11.5) ); + + REQUIRE( trace(a.submat(2, 2, 4, 4)) == Approx(7.3) ); + } diff -Nru armadillo-7.600.2+dfsg/tests/fn_trans.cpp armadillo-7.950.1+dfsg/tests/fn_trans.cpp --- armadillo-7.600.2+dfsg/tests/fn_trans.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_trans.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- -// -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include @@ -16,7 +22,7 @@ TEST_CASE("fn_trans_1") { - mat A = + mat A = "\ 0.061198 0.201990 0.019678 -0.493936 -0.126745 0.051408;\ 0.437242 0.058956 -0.149362 -0.045465 0.296153 0.035437;\ @@ -24,8 +30,8 @@ 0.336352 0.411541 0.458476 -0.393139 -0.135040 0.373833;\ 0.239585 -0.428913 -0.406953 -0.291020 -0.353768 0.258704;\ "; - - mat At = + + mat At = "\ 0.061198 0.437242 -0.492474 0.336352 0.239585;\ 0.201990 0.058956 -0.031309 0.411541 -0.428913;\ @@ -34,9 +40,9 @@ -0.126745 0.296153 0.068317 -0.135040 -0.353768;\ 0.051408 0.035437 -0.454499 0.373833 0.258704;\ "; - + rowvec At_sum0 = { -0.28641, 0.63296, -0.17608, 1.05202, -0.98237 }; - + colvec At_sum1 = { 0.58190, @@ -46,10 +52,10 @@ -0.25108, 0.26488 }; - - + + rowvec A_col1_t = { 0.201990, 0.058956, -0.031309, 0.411541, -0.428913 }; - + colvec A_row1_t = { 0.437242, @@ -59,93 +65,93 @@ 0.296153, 0.035437 }; - - + + double accu_A_col1_t = 0.21227; double accu_A_row1_t = 0.63296; - + REQUIRE( accu(abs(mat(A.t().t()) - A)) == Approx(0.0) ); REQUIRE( accu(abs( A.t().t() - A)) == Approx(0.0) ); - + REQUIRE( accu(abs(mat(A.t() ) - At)) == Approx(0.0) ); REQUIRE( accu(abs(mat(A.st() ) - At)) == Approx(0.0) ); REQUIRE( accu(abs(mat(A.ht() ) - At)) == Approx(0.0) ); REQUIRE( accu(abs(mat( trans(A)) - At)) == Approx(0.0) ); REQUIRE( accu(abs(mat(strans(A)) - At)) == Approx(0.0) ); - + REQUIRE( accu(abs(A.t() - At)) == Approx(0.0) ); REQUIRE( accu(abs(A.st() - At)) == Approx(0.0) ); REQUIRE( accu(abs(A.ht() - At)) == Approx(0.0) ); REQUIRE( accu(abs( trans(A) - At)) == Approx(0.0) ); REQUIRE( accu(abs(strans(A) - At)) == Approx(0.0) ); - + REQUIRE( accu(abs(mat(At.t() ) - A)) == Approx(0.0) ); REQUIRE( accu(abs(mat(At.st() ) - A)) == Approx(0.0) ); REQUIRE( accu(abs(mat(At.ht() ) - A)) == Approx(0.0) ); REQUIRE( accu(abs(mat( trans(At)) - A)) == Approx(0.0) ); REQUIRE( accu(abs(mat(strans(At)) - A)) == Approx(0.0) ); - + REQUIRE( accu(abs(At.t() - A)) == Approx(0.0) ); REQUIRE( accu(abs(At.st() - A)) == Approx(0.0) ); REQUIRE( accu(abs(At.ht() - A)) == Approx(0.0) ); REQUIRE( accu(abs( trans(At) - A)) == Approx(0.0) ); REQUIRE( accu(abs(strans(At) - A)) == Approx(0.0) ); - + REQUIRE( accu(abs((0 + At.t() ) - A)) == Approx(0.0) ); REQUIRE( accu(abs((0 + At.st() ) - A)) == Approx(0.0) ); REQUIRE( accu(abs((0 + At.ht() ) - A)) == Approx(0.0) ); REQUIRE( accu(abs((0 + trans(At)) - A)) == Approx(0.0) ); REQUIRE( accu(abs((0 + strans(At)) - A)) == Approx(0.0) ); - + REQUIRE( accu(abs(mat(0 + At.t() ) - A)) == Approx(0.0) ); REQUIRE( accu(abs(mat(0 + At.st() ) - A)) == Approx(0.0) ); REQUIRE( accu(abs(mat(0 + At.ht() ) - A)) == Approx(0.0) ); REQUIRE( accu(abs(mat(0 + trans(At)) - A)) == Approx(0.0) ); REQUIRE( accu(abs(mat(0 + strans(At)) - A)) == Approx(0.0) ); - - + + REQUIRE( accu(abs(2*A.t() - 2*At)) == Approx(0.0) ); REQUIRE( accu(abs(2*trans(A) - 2*At)) == Approx(0.0) ); - + REQUIRE( accu(abs((2*A).t() - 2*At)) == Approx(0.0) ); REQUIRE( accu(abs(trans(2*A) - 2*At)) == Approx(0.0) ); - + REQUIRE( accu(abs((A+A).t() - 2*At)) == Approx(0.0) ); REQUIRE( accu(abs(trans(A+A) - 2*At)) == Approx(0.0) ); - + REQUIRE( accu(abs((A.t() + At) - 2*At)) == Approx(0.0) ); REQUIRE( accu(abs((trans(A) + At) - 2*At)) == Approx(0.0) ); - + REQUIRE( accu(abs(mat(2*A.t()) - 2*At)) == Approx(0.0) ); REQUIRE( accu(abs(mat(2*trans(A)) - 2*At)) == Approx(0.0) ); - + REQUIRE( accu(abs(mat((2*A).t()) - 2*At)) == Approx(0.0) ); REQUIRE( accu(abs(mat(trans(2*A)) - 2*At)) == Approx(0.0) ); - + REQUIRE( accu(abs(mat((A+A).t()) - 2*At)) == Approx(0.0) ); REQUIRE( accu(abs(mat(trans(A+A)) - 2*At)) == Approx(0.0) ); - + REQUIRE( accu(abs(mat(A.t() + At) - 2*At)) == Approx(0.0) ); REQUIRE( accu(abs(mat(trans(A) + At) - 2*At)) == Approx(0.0) ); - - + + REQUIRE( accu(abs(rowvec(A.col(1).t()) - A_col1_t)) == Approx(0.0) ); REQUIRE( accu(abs(colvec(A.row(1).t()) - A_row1_t)) == Approx(0.0) ); - + REQUIRE( accu(abs(A.col(1).t() - A_col1_t)) == Approx(0.0) ); REQUIRE( accu(abs(A.row(1).t() - A_row1_t)) == Approx(0.0) ); - + REQUIRE( accu(abs(2*A.col(1).t() - 2*A_col1_t)) == Approx(0.0) ); REQUIRE( accu(abs(2*A.row(1).t() - 2*A_row1_t)) == Approx(0.0) ); - + REQUIRE( accu(abs( (A.col(1).t() + A_col1_t) - 2*A_col1_t)) == Approx(0.0) ); REQUIRE( accu(abs( (A.row(1).t() + A_row1_t) - 2*A_row1_t)) == Approx(0.0) ); - - + + REQUIRE( abs( accu(A.col(1).t()) - accu_A_col1_t ) == Approx(0.0) ); REQUIRE( abs( accu(A.row(1).t()) - accu_A_row1_t ) == Approx(0.0) ); - + REQUIRE( abs( accu(A.col(1).t()) - accu(A.col(1)) ) == Approx(0.0) ); REQUIRE( abs( accu(A.row(1).t()) - accu(A.row(1)) ) == Approx(0.0) ); @@ -159,7 +165,7 @@ TEST_CASE("fn_trans_2") { - mat A = + mat A = "\ 0.061198 0.201990 0.019678 -0.493936 -0.126745 0.051408;\ 0.437242 0.058956 -0.149362 -0.045465 0.296153 0.035437;\ @@ -167,10 +173,10 @@ 0.336352 0.411541 0.458476 -0.393139 -0.135040 0.373833;\ 0.239585 -0.428913 -0.406953 -0.291020 -0.353768 0.258704;\ "; - + cx_mat C = cx_mat(A,fliplr(A)); - cx_mat Ct = + cx_mat Ct = { { cx_double( 0.061198, -0.051408), cx_double( 0.437242, -0.035437), cx_double(-0.492474, +0.454499), cx_double( 0.336352, -0.373833), cx_double( 0.239585, -0.258704) }, { cx_double( 0.201990, +0.126745), cx_double( 0.058956, -0.296153), cx_double(-0.031309, -0.068317), cx_double( 0.411541, +0.135040), cx_double(-0.428913, +0.353768) }, @@ -179,10 +185,10 @@ { cx_double(-0.126745, -0.201990), cx_double( 0.296153, -0.058956), cx_double( 0.068317, +0.031309), cx_double(-0.135040, -0.411541), cx_double(-0.353768, +0.428913) }, { cx_double( 0.051408, -0.061198), cx_double( 0.035437, -0.437242), cx_double(-0.454499, +0.492474), cx_double( 0.373833, -0.336352), cx_double( 0.258704, -0.239585) } }; - + cx_rowvec C_col1_t = { cx_double(0.201990, +0.126745), cx_double(0.058956, -0.296153), cx_double(-0.031309, -0.068317), cx_double(0.411541, +0.135040), cx_double(-0.428913, +0.353768) }; - - cx_colvec C_row1_t = + + cx_colvec C_row1_t = { cx_double( 0.437242, -0.035437), cx_double( 0.058956, -0.296153), @@ -191,96 +197,96 @@ cx_double( 0.296153, -0.058956), cx_double( 0.035437, -0.437242) }; - - + + REQUIRE( accu(abs(C.t().t() - C)) == Approx(0.0) ); - + REQUIRE( accu(abs(cx_mat(C.t() ) - Ct)) == Approx(0.0) ); REQUIRE( accu(abs(cx_mat(C.ht() ) - Ct)) == Approx(0.0) ); REQUIRE( accu(abs(cx_mat(trans(C)) - Ct)) == Approx(0.0) ); - + REQUIRE( accu(abs(C.t() - Ct)) == Approx(0.0) ); REQUIRE( accu(abs(C.ht() - Ct)) == Approx(0.0) ); REQUIRE( accu(abs(trans(C) - Ct)) == Approx(0.0) ); - + REQUIRE( accu(abs(cx_mat(Ct.t() ) - C)) == Approx(0.0) ); REQUIRE( accu(abs(cx_mat(Ct.ht() ) - C)) == Approx(0.0) ); REQUIRE( accu(abs(cx_mat(trans(Ct)) - C)) == Approx(0.0) ); - + REQUIRE( accu(abs(Ct.t() - C)) == Approx(0.0) ); REQUIRE( accu(abs(Ct.ht() - C)) == Approx(0.0) ); REQUIRE( accu(abs(trans(Ct) - C)) == Approx(0.0) ); - + REQUIRE( accu(abs(2*C.t() - 2*Ct)) == Approx(0.0) ); REQUIRE( accu(abs(2*trans(C) - 2*Ct)) == Approx(0.0) ); - + REQUIRE( accu(abs((2*C).t() - 2*Ct)) == Approx(0.0) ); REQUIRE( accu(abs(trans(2*C) - 2*Ct)) == Approx(0.0) ); - + REQUIRE( accu(abs((C+C).t() - 2*Ct)) == Approx(0.0) ); REQUIRE( accu(abs(trans(C+C) - 2*Ct)) == Approx(0.0) ); - + REQUIRE( accu(abs(cx_double(2,3)*C.t() - cx_double(2,3)*Ct)) == Approx(0.0) ); REQUIRE( accu(abs(cx_double(2,3)*trans(C) - cx_double(2,3)*Ct)) == Approx(0.0) ); - + REQUIRE( accu(abs(cx_mat(2*C.t()) - 2*Ct)) == Approx(0.0) ); REQUIRE( accu(abs(cx_mat(2*trans(C)) - 2*Ct)) == Approx(0.0) ); - + REQUIRE( accu(abs(cx_mat((2*C).t()) - 2*Ct)) == Approx(0.0) ); REQUIRE( accu(abs(cx_mat(trans(2*C)) - 2*Ct)) == Approx(0.0) ); - + REQUIRE( accu(abs(cx_mat((C+C).t()) - 2*Ct)) == Approx(0.0) ); REQUIRE( accu(abs(cx_mat(trans(C+C)) - 2*Ct)) == Approx(0.0) ); - + REQUIRE( accu(abs(cx_mat(cx_double(2,3)*C.t()) - cx_double(2,3)*Ct)) == Approx(0.0) ); REQUIRE( accu(abs(cx_mat(cx_double(2,3)*trans(C)) - cx_double(2,3)*Ct)) == Approx(0.0) ); - + REQUIRE( accu(abs((C.t() + Ct) - 2*Ct)) == Approx(0.0) ); REQUIRE( accu(abs((trans(C) + Ct) - 2*Ct)) == Approx(0.0) ); - + REQUIRE( accu(abs(cx_rowvec(C.col(1).t()) - C_col1_t)) == Approx(0.0) ); REQUIRE( accu(abs(cx_colvec(C.row(1).t()) - C_row1_t)) == Approx(0.0) ); - + REQUIRE( accu(abs(C.col(1).t() - C_col1_t)) == Approx(0.0) ); REQUIRE( accu(abs(C.row(1).t() - C_row1_t)) == Approx(0.0) ); - + REQUIRE( accu(abs(2*C.col(1).t() - 2*C_col1_t)) == Approx(0.0) ); REQUIRE( accu(abs(2*C.row(1).t() - 2*C_row1_t)) == Approx(0.0) ); - + REQUIRE( accu(abs( (C.col(1).t() + C_col1_t) - 2*C_col1_t)) == Approx(0.0) ); REQUIRE( accu(abs( (C.row(1).t() + C_row1_t) - 2*C_row1_t)) == Approx(0.0) ); - + // REQUIRE( accu(abs(cx_mat(C.st()) - conj(Ct))) == Approx(0.0) ); REQUIRE( accu(abs(cx_mat(strans(C)) - conj(Ct))) == Approx(0.0) ); - + REQUIRE( accu(abs(C.st() - conj(Ct))) == Approx(0.0) ); REQUIRE( accu(abs(strans(C) - conj(Ct))) == Approx(0.0) ); REQUIRE( accu(abs(2*C.st() - conj(2*Ct))) == Approx(0.0) ); REQUIRE( accu(abs(2*strans(C) - conj(2*Ct))) == Approx(0.0) ); - + REQUIRE( accu(abs(cx_double(2,3)*C.st() - cx_double(2,3)*conj(Ct))) == Approx(0.0) ); REQUIRE( accu(abs(cx_double(2,3)*strans(C) - cx_double(2,3)*conj(Ct))) == Approx(0.0) ); - + REQUIRE( accu(abs((C.st() + C.st()) - conj(2*Ct))) == Approx(0.0) ); REQUIRE( accu(abs((strans(C) + C.st()) - conj(2*Ct))) == Approx(0.0) ); - + REQUIRE( accu(abs(cx_rowvec(C.col(1).st()) - conj(C_col1_t))) == Approx(0.0) ); REQUIRE( accu(abs(cx_colvec(C.row(1).st()) - conj(C_row1_t))) == Approx(0.0) ); - + REQUIRE( accu(abs(C.col(1).st() - conj(C_col1_t))) == Approx(0.0) ); REQUIRE( accu(abs(C.row(1).st() - conj(C_row1_t))) == Approx(0.0) ); - + REQUIRE( accu(abs(2*C.col(1).st() - conj(2*C_col1_t))) == Approx(0.0) ); REQUIRE( accu(abs(2*C.row(1).st() - conj(2*C_row1_t))) == Approx(0.0) ); - + REQUIRE( accu(abs( (C.col(1).st() + conj(C_col1_t)) - conj(2*C_col1_t))) == Approx(0.0) ); REQUIRE( accu(abs( (C.row(1).st() + conj(C_row1_t)) - conj(2*C_row1_t))) == Approx(0.0) ); - + // - + REQUIRE_THROWS( C + C.t() ); } @@ -288,7 +294,7 @@ TEST_CASE("fn_trans_3") { - mat A = + mat A = "\ 0.061198 0.201990 0.019678 -0.493936 -0.126745 0.051408;\ 0.437242 0.058956 -0.149362 -0.045465 0.296153 0.035437;\ @@ -296,8 +302,8 @@ 0.336352 0.411541 0.458476 -0.393139 -0.135040 0.373833;\ 0.239585 -0.428913 -0.406953 -0.291020 -0.353768 0.258704;\ "; - - mat At = + + mat At = "\ 0.061198 0.437242 -0.492474 0.336352 0.239585;\ 0.201990 0.058956 -0.031309 0.411541 -0.428913;\ @@ -306,53 +312,53 @@ -0.126745 0.296153 0.068317 -0.135040 -0.353768;\ 0.051408 0.035437 -0.454499 0.373833 0.258704;\ "; - + mat B = A.head_cols(5); - + mat Bt = At.head_rows(5); - + mat X; mat Y; - + X = A; X = X.t(); Y = B; Y = Y.t(); - + REQUIRE( accu(abs(X - At)) == Approx(0.0) ); REQUIRE( accu(abs(Y - Bt)) == Approx(0.0) ); - + X = A; X = 0 + X.t(); Y = B; Y = 0 + Y.t(); - + REQUIRE( accu(abs(X - At)) == Approx(0.0) ); REQUIRE( accu(abs(Y - Bt)) == Approx(0.0) ); - + X = A; X = 2*X.t(); Y = B; Y = 2*Y.t(); - + REQUIRE( accu(abs(X - 2*At)) == Approx(0.0) ); REQUIRE( accu(abs(Y - 2*Bt)) == Approx(0.0) ); - + X = A; X = 0 + 2*X.t(); Y = B; Y = 0 + 2*Y.t(); - + REQUIRE( accu(abs(X - 2*At)) == Approx(0.0) ); REQUIRE( accu(abs(Y - 2*Bt)) == Approx(0.0) ); - + X = A; X = (2*X).t(); Y = B; Y = (2*Y).t(); - + REQUIRE( accu(abs(X - 2*At)) == Approx(0.0) ); REQUIRE( accu(abs(Y - 2*Bt)) == Approx(0.0) ); - + X = A; X = (X+X).t(); Y = B; Y = (Y+Y).t(); - + REQUIRE( accu(abs(X - 2*At)) == Approx(0.0) ); REQUIRE( accu(abs(Y - 2*Bt)) == Approx(0.0) ); - + colvec q = A.col(1); rowvec r = A.row(1); - + REQUIRE_THROWS( q = q.t() ); REQUIRE_THROWS( r = r.t() ); } @@ -361,7 +367,7 @@ TEST_CASE("fn_trans_4") { - mat A = + mat A = "\ 0.061198 0.201990 0.019678 -0.493936 -0.126745 0.051408;\ 0.437242 0.058956 -0.149362 -0.045465 0.296153 0.035437;\ @@ -369,10 +375,10 @@ 0.336352 0.411541 0.458476 -0.393139 -0.135040 0.373833;\ 0.239585 -0.428913 -0.406953 -0.291020 -0.353768 0.258704;\ "; - + cx_mat C = cx_mat(A,fliplr(A)); - cx_mat Ct = + cx_mat Ct = { { cx_double( 0.061198, -0.051408), cx_double( 0.437242, -0.035437), cx_double(-0.492474, +0.454499), cx_double( 0.336352, -0.373833), cx_double( 0.239585, -0.258704) }, { cx_double( 0.201990, +0.126745), cx_double( 0.058956, -0.296153), cx_double(-0.031309, -0.068317), cx_double( 0.411541, +0.135040), cx_double(-0.428913, +0.353768) }, @@ -381,102 +387,235 @@ { cx_double(-0.126745, -0.201990), cx_double( 0.296153, -0.058956), cx_double( 0.068317, +0.031309), cx_double(-0.135040, -0.411541), cx_double(-0.353768, +0.428913) }, { cx_double( 0.051408, -0.061198), cx_double( 0.035437, -0.437242), cx_double(-0.454499, +0.492474), cx_double( 0.373833, -0.336352), cx_double( 0.258704, -0.239585) } }; - + cx_mat D = C.head_cols(5); - + cx_mat Dt = Ct.head_rows(5); - + cx_mat X; cx_mat Y; - + // - + X = C; X = X.t(); Y = D; Y = Y.t(); - + REQUIRE( accu(abs(X - Ct)) == Approx(0.0) ); REQUIRE( accu(abs(Y - Dt)) == Approx(0.0) ); - + X = C; X = 0 + X.t(); Y = D; Y = 0 + Y.t(); - + REQUIRE( accu(abs(X - Ct)) == Approx(0.0) ); REQUIRE( accu(abs(Y - Dt)) == Approx(0.0) ); - + X = C; X = 2*X.t(); Y = D; Y = 2*Y.t(); - + REQUIRE( accu(abs(X - 2*Ct)) == Approx(0.0) ); REQUIRE( accu(abs(Y - 2*Dt)) == Approx(0.0) ); X = C; X = 0 + 2*X.t(); Y = D; Y = 0 + 2*Y.t(); - + REQUIRE( accu(abs(X - 2*Ct)) == Approx(0.0) ); REQUIRE( accu(abs(Y - 2*Dt)) == Approx(0.0) ); X = C; X = (2*X).t(); Y = D; Y = (2*Y).t(); - + REQUIRE( accu(abs(X - 2*Ct)) == Approx(0.0) ); REQUIRE( accu(abs(Y - 2*Dt)) == Approx(0.0) ); X = C; X = (X+X).t(); Y = D; Y = (Y+Y).t(); - + REQUIRE( accu(abs(X - 2*Ct)) == Approx(0.0) ); REQUIRE( accu(abs(Y - 2*Dt)) == Approx(0.0) ); X = C; X = cx_double(2,3)*X.t(); Y = D; Y = cx_double(2,3)*Y.t(); - + REQUIRE( accu(abs(X - cx_double(2,3)*Ct)) == Approx(0.0) ); REQUIRE( accu(abs(Y - cx_double(2,3)*Dt)) == Approx(0.0) ); - + // - + X = C; X = X.st(); Y = D; Y = Y.st(); - + REQUIRE( accu(abs(X - conj(Ct))) == Approx(0.0) ); REQUIRE( accu(abs(Y - conj(Dt))) == Approx(0.0) ); - + X = C; X = 0 + X.st(); Y = D; Y = 0 + Y.st(); - + REQUIRE( accu(abs(X - conj(Ct))) == Approx(0.0) ); REQUIRE( accu(abs(Y - conj(Dt))) == Approx(0.0) ); - + X = C; X = 2*X.st(); Y = D; Y = 2*Y.st(); - + REQUIRE( accu(abs(X - 2*conj(Ct))) == Approx(0.0) ); REQUIRE( accu(abs(Y - 2*conj(Dt))) == Approx(0.0) ); X = C; X = 0 + 2*X.st(); Y = D; Y = 0 + 2*Y.st(); - + REQUIRE( accu(abs(X - 2*conj(Ct))) == Approx(0.0) ); REQUIRE( accu(abs(Y - 2*conj(Dt))) == Approx(0.0) ); X = C; X = (2*X).st(); Y = D; Y = (2*Y).st(); - + REQUIRE( accu(abs(X - conj(2*Ct))) == Approx(0.0) ); REQUIRE( accu(abs(Y - conj(2*Dt))) == Approx(0.0) ); X = C; X = (X+X).st(); Y = D; Y = (Y+Y).st(); - + REQUIRE( accu(abs(X - conj(2*Ct))) == Approx(0.0) ); REQUIRE( accu(abs(Y - conj(2*Dt))) == Approx(0.0) ); X = C; X = cx_double(2,3)*X.st(); Y = D; Y = cx_double(2,3)*Y.st(); - + REQUIRE( accu(abs(X - cx_double(2,3)*conj(Ct))) == Approx(0.0) ); REQUIRE( accu(abs(Y - cx_double(2,3)*conj(Dt))) == Approx(0.0) ); } +TEST_CASE("op_trans_sp_mat") + { + SpMat a(4, 4); + a(1, 0) = 5; + a(2, 2) = 3; + a(3, 3) = 4; + a(1, 3) = 6; + a(3, 1) = 8; + + SpMat b = trans(a); + + REQUIRE( (unsigned int) b(0, 0) == 0 ); + REQUIRE( (unsigned int) b(1, 0) == 0 ); + REQUIRE( (unsigned int) b(2, 0) == 0 ); + REQUIRE( (unsigned int) b(3, 0) == 0 ); + REQUIRE( (unsigned int) b(0, 1) == 5 ); + REQUIRE( (unsigned int) b(1, 1) == 0 ); + REQUIRE( (unsigned int) b(2, 1) == 0 ); + REQUIRE( (unsigned int) b(3, 1) == 6 ); + REQUIRE( (unsigned int) b(0, 2) == 0 ); + REQUIRE( (unsigned int) b(1, 2) == 0 ); + REQUIRE( (unsigned int) b(2, 2) == 3 ); + REQUIRE( (unsigned int) b(3, 2) == 0 ); + REQUIRE( (unsigned int) b(0, 3) == 0 ); + REQUIRE( (unsigned int) b(1, 3) == 8 ); + REQUIRE( (unsigned int) b(2, 3) == 0 ); + REQUIRE( (unsigned int) b(3, 3) == 4 ); + + b = trans(b); // inplace + + REQUIRE( (unsigned int) b(0, 0) == 0 ); + REQUIRE( (unsigned int) b(1, 0) == 5 ); + REQUIRE( (unsigned int) b(2, 0) == 0 ); + REQUIRE( (unsigned int) b(3, 0) == 0 ); + REQUIRE( (unsigned int) b(0, 1) == 0 ); + REQUIRE( (unsigned int) b(1, 1) == 0 ); + REQUIRE( (unsigned int) b(2, 1) == 0 ); + REQUIRE( (unsigned int) b(3, 1) == 8 ); + REQUIRE( (unsigned int) b(0, 2) == 0 ); + REQUIRE( (unsigned int) b(1, 2) == 0 ); + REQUIRE( (unsigned int) b(2, 2) == 3 ); + REQUIRE( (unsigned int) b(3, 2) == 0 ); + REQUIRE( (unsigned int) b(0, 3) == 0 ); + REQUIRE( (unsigned int) b(1, 3) == 6 ); + REQUIRE( (unsigned int) b(2, 3) == 0 ); + REQUIRE( (unsigned int) b(3, 3) == 4 ); + + b = trans(a + a); // on an op + + REQUIRE( (unsigned int) b(0, 0) == 0 ); + REQUIRE( (unsigned int) b(1, 0) == 0 ); + REQUIRE( (unsigned int) b(2, 0) == 0 ); + REQUIRE( (unsigned int) b(3, 0) == 0 ); + REQUIRE( (unsigned int) b(0, 1) == 10 ); + REQUIRE( (unsigned int) b(1, 1) == 0 ); + REQUIRE( (unsigned int) b(2, 1) == 0 ); + REQUIRE( (unsigned int) b(3, 1) == 12 ); + REQUIRE( (unsigned int) b(0, 2) == 0 ); + REQUIRE( (unsigned int) b(1, 2) == 0 ); + REQUIRE( (unsigned int) b(2, 2) == 6 ); + REQUIRE( (unsigned int) b(3, 2) == 0 ); + REQUIRE( (unsigned int) b(0, 3) == 0 ); + REQUIRE( (unsigned int) b(1, 3) == 16 ); + REQUIRE( (unsigned int) b(2, 3) == 0 ); + REQUIRE( (unsigned int) b(3, 3) == 8 ); + + b = trans(trans(a)); // on another trans + + REQUIRE( (unsigned int) b(0, 0) == 0 ); + REQUIRE( (unsigned int) b(1, 0) == 5 ); + REQUIRE( (unsigned int) b(2, 0) == 0 ); + REQUIRE( (unsigned int) b(3, 0) == 0 ); + REQUIRE( (unsigned int) b(0, 1) == 0 ); + REQUIRE( (unsigned int) b(1, 1) == 0 ); + REQUIRE( (unsigned int) b(2, 1) == 0 ); + REQUIRE( (unsigned int) b(3, 1) == 8 ); + REQUIRE( (unsigned int) b(0, 2) == 0 ); + REQUIRE( (unsigned int) b(1, 2) == 0 ); + REQUIRE( (unsigned int) b(2, 2) == 3 ); + REQUIRE( (unsigned int) b(3, 2) == 0 ); + REQUIRE( (unsigned int) b(0, 3) == 0 ); + REQUIRE( (unsigned int) b(1, 3) == 6 ); + REQUIRE( (unsigned int) b(2, 3) == 0 ); + REQUIRE( (unsigned int) b(3, 3) == 4 ); + } + + +TEST_CASE("op_trans_sp_cxmat") + { + SpMat > a(10, 10); + for (uword c = 0; c < 7; ++c) + { + a(c, c) = std::complex(1.3, 2.4); + a(c + 1, c) = std::complex(0.0, -1.3); + a(c + 2, c) = std::complex(2.1, 0.0); + } + + SpMat > b = trans(a); + + REQUIRE( b.n_nonzero == a.n_nonzero ); + + for (uword r = 0; r < 10; ++r) + { + for (uword c = 0; c < 10; ++c) + { + double lr = real(std::complex(a(r, c))); + double rr = real(std::complex(b(c, r))); + double li = imag(std::complex(a(r, c))); + double ri = imag(std::complex(b(c, r))); + + REQUIRE( lr == Approx(rr) ); + REQUIRE( li == Approx(-ri) ); + } + } + + b = trans(a.submat(3, 3, 7, 7)); + + REQUIRE( b.n_nonzero == a.submat(3, 3, 7, 7).n_nonzero ); + + for (uword r = 0; r < 5; ++r) + { + for (uword c = 0; c < 5; ++c) + { + double lr = real(std::complex(a(r + 3, c + 3))); + double rr = real(std::complex(b(c, r))); + double li = imag(std::complex(a(r + 3, c + 3))); + double ri = imag(std::complex(b(c, r))); + + REQUIRE( lr == Approx(rr) ); + REQUIRE( li == Approx(-ri) ); + } + } + } diff -Nru armadillo-7.600.2+dfsg/tests/fn_var.cpp armadillo-7.950.1+dfsg/tests/fn_var.cpp --- armadillo-7.600.2+dfsg/tests/fn_var.cpp 1970-01-01 00:00:00.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_var.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -0,0 +1,549 @@ +// Copyright 2011-2017 Ryan Curtin (http://www.ratml.org/) +// Copyright 2017 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + +#include + +#include "catch.hpp" + +using namespace arma; + +TEST_CASE("fn_var_empty_sparse_test") + { + SpMat m(100, 100); + + SpRow result = var(m); + + REQUIRE( result.n_cols == 100 ); + REQUIRE( result.n_rows == 1 ); + for (uword i = 0; i < 100; ++i) + { + REQUIRE( (double) result[i] == Approx(0.0) ); + } + + result = var(m, 0, 0); + + REQUIRE( result.n_cols == 100 ); + REQUIRE( result.n_rows == 1 ); + for (uword i = 0; i < 100; ++i) + { + REQUIRE( (double) result[i] == Approx(0.0) ); + } + + result = var(m, 1, 0); + + REQUIRE( result.n_cols == 100 ); + REQUIRE( result.n_rows == 1 ); + for (uword i = 0; i < 100; ++i) + { + REQUIRE( (double) result[i] == Approx(0.0) ); + } + + result = var(m, 1); + + REQUIRE( result.n_cols == 100 ); + REQUIRE( result.n_rows == 1 ); + for (uword i = 0; i < 100; ++i) + { + REQUIRE( (double) result[i] == Approx(0.0) ); + } + + SpCol colres = var(m, 1, 1); + + REQUIRE( colres.n_cols == 1 ); + REQUIRE( colres.n_rows == 100 ); + for (uword i = 0; i < 100; ++i) + { + REQUIRE( (double) colres[i] == Approx(0.0) ); + } + + colres = var(m, 0, 1); + + REQUIRE( colres.n_cols == 1 ); + REQUIRE( colres.n_rows == 100 ); + for (uword i = 0; i < 100; ++i) + { + REQUIRE( (double) colres[i] == Approx(0.0) ); + } + } + + + +TEST_CASE("fn_var_empty_cx_sparse_test") + { + SpMat > m(100, 100); + + SpRow result = var(m); + + REQUIRE( result.n_cols == 100 ); + REQUIRE( result.n_rows == 1 ); + for (uword i = 0; i < 100; ++i) + { + REQUIRE( (double) result[i] == Approx(0.0) ); + } + + result = var(m, 0, 0); + + REQUIRE( result.n_cols == 100 ); + REQUIRE( result.n_rows == 1 ); + for (uword i = 0; i < 100; ++i) + { + REQUIRE( (double) result[i] == Approx(0.0) ); + } + + result = var(m, 1, 0); + + REQUIRE( result.n_cols == 100 ); + REQUIRE( result.n_rows == 1 ); + for (uword i = 0; i < 100; ++i) + { + REQUIRE( (double) result[i] == Approx(0.0) ); + } + + result = var(m, 1); + + REQUIRE( result.n_cols == 100 ); + REQUIRE( result.n_rows == 1 ); + for (uword i = 0; i < 100; ++i) + { + REQUIRE( (double) result[i] == Approx(0.0) ); + } + + SpCol colres = var(m, 1, 1); + + REQUIRE( colres.n_cols == 1 ); + REQUIRE( colres.n_rows == 100 ); + for (uword i = 0; i < 100; ++i) + { + REQUIRE( (double) colres[i] == Approx(0.0) ); + } + + colres = var(m, 0, 1); + + REQUIRE( colres.n_cols == 1 ); + REQUIRE( colres.n_rows == 100 ); + for (uword i = 0; i < 100; ++i) + { + REQUIRE( (double) colres[i] == Approx(0.0) ); + } + } + + + +TEST_CASE("fn_var_sparse_test") + { + // Create a random matrix and do variance testing on it, with varying levels + // of nonzero (eventually this becomes a fully dense matrix). + for (int i = 0; i < 10; ++i) + { + SpMat x; + x.sprandu(50, 75, ((double) (i + 1)) / 10); + mat d(x); + + SpRow rr = var(x); + rowvec drr = var(d); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 75 ); + for (uword j = 0; j < 75; ++j) + { + REQUIRE( drr[j] == Approx((double) rr[j]) ); + } + + rr = var(x, 0); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 75 ); + for (uword j = 0; j < 75; ++j) + { + REQUIRE( drr[j] == Approx((double) rr[j]) ); + } + + rr = var(x, 1, 0); + drr = var(d, 1, 0); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 75 ); + for (uword j = 0; j < 75; ++j) + { + REQUIRE( drr[j] == Approx((double) rr[j]) ); + } + + SpCol cr = var(x, 0, 1); + vec dcr = var(d, 0, 1); + + REQUIRE( cr.n_rows == 50 ); + REQUIRE( cr.n_cols == 1 ); + for (uword j = 0; j < 50; ++j) + { + REQUIRE( dcr[j] == Approx((double) cr[j]) ); + } + + cr = var(x, 1, 1); + dcr = var(d, 1, 1); + + REQUIRE( cr.n_rows == 50 ); + REQUIRE( cr.n_cols == 1 ); + for (uword j = 0; j < 50; ++j) + { + REQUIRE( dcr[j] == Approx((double) cr[j]) ); + } + + // Now on a subview. + rr = var(x.submat(11, 11, 30, 45), 0, 0); + drr = var(d.submat(11, 11, 30, 45), 0, 0); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 35 ); + for (uword j = 0; j < 35; ++j) + { + REQUIRE( drr[j] == Approx((double) rr[j]) ); + } + + rr = var(x.submat(11, 11, 30, 45), 1, 0); + drr = var(d.submat(11, 11, 30, 45), 1, 0); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 35 ); + for (uword j = 0; j < 35; ++j) + { + REQUIRE( drr[j] == Approx((double) rr[j]) ); + } + + cr = var(x.submat(11, 11, 30, 45), 0, 1); + dcr = var(d.submat(11, 11, 30, 45), 0, 1); + + REQUIRE( cr.n_rows == 20 ); + REQUIRE( cr.n_cols == 1 ); + for (uword j = 0; j < 20; ++j) + { + REQUIRE( dcr[j] == Approx((double) cr[j]) ); + } + + cr = var(x.submat(11, 11, 30, 45), 1, 1); + dcr = var(d.submat(11, 11, 30, 45), 1, 1); + + REQUIRE( cr.n_rows == 20 ); + REQUIRE( cr.n_cols == 1 ); + for (uword j = 0; j < 20; ++j) + { + REQUIRE( dcr[j] == Approx((double) cr[j]) ); + } + + // Now on an SpOp (spop_scalar_times) + rr = var(3.0 * x, 0, 0); + drr = var(3.0 * d, 0, 0); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 75 ); + for (uword j = 0; j < 75; ++j) + { + REQUIRE( drr[j] == Approx((double) rr[j]) ); + } + + rr = var(3.0 * x, 1, 0); + drr = var(3.0 * d, 1, 0); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 75 ); + for (uword j = 0; j < 75; ++j) + { + REQUIRE( drr[j] == Approx((double) rr[j]) ); + } + + cr = var(4.5 * x, 0, 1); + dcr = var(4.5 * d, 0, 1); + + REQUIRE( cr.n_rows == 50 ); + REQUIRE( cr.n_cols == 1 ); + for (uword j = 0; j < 50; ++j) + { + REQUIRE( dcr[j] == Approx((double) cr[j]) ); + } + + cr = var(4.5 * x, 1, 1); + dcr = var(4.5 * d, 1, 1); + + REQUIRE( cr.n_rows == 50 ); + REQUIRE( cr.n_cols == 1 ); + for (uword j = 0; j < 50; ++j) + { + REQUIRE( dcr[j] == Approx((double) cr[j]) ); + } + + // Now on an SpGlue! + SpMat y; + y.sprandu(50, 75, 0.3); + mat e(y); + + rr = var(x + y); + drr = var(d + e); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 75 ); + for (uword j = 0; j < 75; ++j) + { + REQUIRE( drr[j] == Approx((double) rr[j]) ); + } + + rr = var(x + y, 1); + drr = var(d + e, 1); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 75 ); + for (uword j = 0; j < 75; ++j) + { + REQUIRE( drr[j] == Approx((double) rr[j]) ); + } + + cr = var(x + y, 0, 1); + dcr = var(d + e, 0, 1); + + REQUIRE( cr.n_rows == 50 ); + REQUIRE( cr.n_cols == 1 ); + for (uword j = 0; j < 50; ++j) + { + REQUIRE( dcr[j] == Approx((double) cr[j]) ); + } + + cr = var(x + y, 1, 1); + dcr = var(d + e, 1, 1); + + REQUIRE( cr.n_rows == 50 ); + REQUIRE( cr.n_cols == 1 ); + for (uword j = 0; j < 50; ++j) + { + REQUIRE( dcr[j] == Approx((double) cr[j]) ); + } + } + } + + + +TEST_CASE("fn_var_sparse_cx_test") + { + // Create a random matrix and do variance testing on it, with varying levels + // of nonzero (eventually this becomes a fully dense matrix). + for (int i = 0; i < 10; ++i) + { + SpMat > x; + x.sprandu(50, 75, ((double) (i + 1)) / 10); + cx_mat d(x); + + SpRow rr = var(x); + rowvec drr = var(d); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 75 ); + for (uword j = 0; j < 75; ++j) + { + REQUIRE( drr[j] == Approx((double) rr[j]) ); + } + + rr = var(x, 0); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 75 ); + for (uword j = 0; j < 75; ++j) + { + REQUIRE( drr[j] == Approx((double) rr[j]) ); + } + + rr = var(x, 1, 0); + drr = var(d, 1, 0); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 75 ); + for (uword j = 0; j < 75; ++j) + { + REQUIRE( drr[j] == Approx((double) rr[j]) ); + } + + SpCol cr = var(x, 0, 1); + vec dcr = var(d, 0, 1); + + REQUIRE( cr.n_rows == 50 ); + REQUIRE( cr.n_cols == 1 ); + for (uword j = 0; j < 50; ++j) + { + REQUIRE( dcr[j] == Approx((double) cr[j]) ); + } + + cr = var(x, 1, 1); + dcr = var(d, 1, 1); + + REQUIRE( cr.n_rows == 50 ); + REQUIRE( cr.n_cols == 1 ); + for (uword j = 0; j < 50; ++j) + { + REQUIRE( dcr[j] == Approx((double) cr[j]) ); + } + + // Now on a subview. + rr = var(x.submat(11, 11, 30, 45), 0, 0); + drr = var(d.submat(11, 11, 30, 45), 0, 0); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 35 ); + for (uword j = 0; j < 35; ++j) + { + REQUIRE( drr[j] == Approx((double) rr[j]) ); + } + + rr = var(x.submat(11, 11, 30, 45), 1, 0); + drr = var(d.submat(11, 11, 30, 45), 1, 0); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 35 ); + for (uword j = 0; j < 35; ++j) + { + REQUIRE( drr[j] == Approx((double) rr[j]) ); + } + + cr = var(x.submat(11, 11, 30, 45), 0, 1); + dcr = var(d.submat(11, 11, 30, 45), 0, 1); + + REQUIRE( cr.n_rows == 20 ); + REQUIRE( cr.n_cols == 1 ); + for (uword j = 0; j < 20; ++j) + { + REQUIRE( dcr[j] == Approx((double) cr[j]) ); + } + + cr = var(x.submat(11, 11, 30, 45), 1, 1); + dcr = var(d.submat(11, 11, 30, 45), 1, 1); + + REQUIRE( cr.n_rows == 20 ); + REQUIRE( cr.n_cols == 1 ); + for (uword j = 0; j < 20; ++j) + { + REQUIRE( dcr[j] == Approx((double) cr[j]) ); + } + + // Now on an SpOp (spop_scalar_times) + rr = var(3.0 * x, 0, 0); + drr = var(3.0 * d, 0, 0); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 75 ); + for (uword j = 0; j < 75; ++j) + { + REQUIRE( drr[j] == Approx((double) rr[j]) ); + } + + rr = var(3.0 * x, 1, 0); + drr = var(3.0 * d, 1, 0); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 75 ); + for (uword j = 0; j < 75; ++j) + { + REQUIRE( drr[j] == Approx((double) rr[j]) ); + } + + cr = var(4.5 * x, 0, 1); + dcr = var(4.5 * d, 0, 1); + + REQUIRE( cr.n_rows == 50 ); + REQUIRE( cr.n_cols == 1 ); + for (uword j = 0; j < 50; ++j) + { + REQUIRE( dcr[j] == Approx((double) cr[j]) ); + } + + cr = var(4.5 * x, 1, 1); + dcr = var(4.5 * d, 1, 1); + + REQUIRE( cr.n_rows == 50 ); + REQUIRE( cr.n_cols == 1 ); + for (uword j = 0; j < 50; ++j) + { + REQUIRE( dcr[j] == Approx((double) cr[j]) ); + } + + // Now on an SpGlue! + SpMat > y; + y.sprandu(50, 75, 0.3); + cx_mat e(y); + + rr = var(x + y); + drr = var(d + e); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 75 ); + for (uword j = 0; j < 75; ++j) + { + REQUIRE( drr[j] == Approx((double) rr[j]) ); + } + + rr = var(x + y, 1); + drr = var(d + e, 1); + + REQUIRE( rr.n_rows == 1 ); + REQUIRE( rr.n_cols == 75 ); + for (uword j = 0; j < 75; ++j) + { + REQUIRE( drr[j] == Approx((double) rr[j]) ); + } + + cr = var(x + y, 0, 1); + dcr = var(d + e, 0, 1); + + REQUIRE( cr.n_rows == 50 ); + REQUIRE( cr.n_cols == 1 ); + for (uword j = 0; j < 50; ++j) + { + REQUIRE( dcr[j] == Approx((double) cr[j]) ); + } + + cr = var(x + y, 1, 1); + dcr = var(d + e, 1, 1); + + REQUIRE( cr.n_rows == 50 ); + REQUIRE( cr.n_cols == 1 ); + for (uword j = 0; j < 50; ++j) + { + REQUIRE( dcr[j] == Approx((double) cr[j]) ); + } + } + } + + + +TEST_CASE("fn_var_sparse_alias_test") + { + sp_mat s; + s.sprandu(70, 70, 0.3); + mat d(s); + + s = var(s); + d = var(d); + + REQUIRE( d.n_rows == s.n_rows ); + REQUIRE( d.n_cols == s.n_cols ); + for (uword i = 0; i < d.n_elem; ++i) + { + REQUIRE(d[i] == Approx((double) s[i]) ); + } + + s.sprandu(70, 70, 0.3); + d = s; + + s = var(s, 1); + d = var(d, 1); + for (uword i = 0; i < d.n_elem; ++i) + { + REQUIRE( d[i] == Approx((double) s[i]) ); + } + } diff -Nru armadillo-7.600.2+dfsg/tests/fn_vectorise.cpp armadillo-7.950.1+dfsg/tests/fn_vectorise.cpp --- armadillo-7.600.2+dfsg/tests/fn_vectorise.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/fn_vectorise.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/gen_linspace.cpp armadillo-7.950.1+dfsg/tests/gen_linspace.cpp --- armadillo-7.600.2+dfsg/tests/gen_linspace.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/gen_linspace.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/gen_ones.cpp armadillo-7.950.1+dfsg/tests/gen_ones.cpp --- armadillo-7.600.2+dfsg/tests/gen_ones.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/gen_ones.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/gen_randu.cpp armadillo-7.950.1+dfsg/tests/gen_randu.cpp --- armadillo-7.600.2+dfsg/tests/gen_randu.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/gen_randu.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- -// -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include @@ -18,36 +24,34 @@ { const uword n_rows = 100; const uword n_cols = 101; - + mat A(n_rows,n_cols, fill::randu); - + mat B(n_rows,n_cols); B.randu(); - + mat C; C.randu(n_rows,n_cols); - + REQUIRE( (accu(A)/A.n_elem) == Approx(0.5).epsilon(0.01) ); REQUIRE( (accu(B)/A.n_elem) == Approx(0.5).epsilon(0.01) ); REQUIRE( (accu(C)/A.n_elem) == Approx(0.5).epsilon(0.01) ); REQUIRE( (mean(vectorise(A))) == Approx(0.5).epsilon(0.01) ); } - + TEST_CASE("gen_randu_2") { mat A(50,60,fill::zeros); - + A(span(1,48),span(1,58)).randu(); - + REQUIRE( accu(A.head_cols(1)) == Approx(0.0) ); REQUIRE( accu(A.head_rows(1)) == Approx(0.0) ); - + REQUIRE( accu(A.tail_cols(1)) == Approx(0.0) ); REQUIRE( accu(A.tail_rows(1)) == Approx(0.0) ); - + REQUIRE( mean(vectorise(A(span(1,48),span(1,58)))) == Approx(double(0.5)).epsilon(0.01) ); } - - diff -Nru armadillo-7.600.2+dfsg/tests/gen_zeros.cpp armadillo-7.950.1+dfsg/tests/gen_zeros.cpp --- armadillo-7.600.2+dfsg/tests/gen_zeros.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/gen_zeros.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- -// -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include @@ -17,33 +23,33 @@ TEST_CASE("gen_zeros_1") { mat A(5,6,fill::zeros); - + REQUIRE( accu(A) == Approx(0.0) ); REQUIRE( A.n_rows == 5 ); REQUIRE( A.n_cols == 6 ); - + mat B(5,6,fill::randu); - + B.zeros(); - + REQUIRE( accu(B) == Approx(0.0) ); REQUIRE( B.n_rows == 5 ); REQUIRE( B.n_cols == 6 ); - + mat C = zeros(5,6); - + REQUIRE( accu(C) == Approx(0.0) ); REQUIRE( C.n_rows == 5 ); REQUIRE( C.n_cols == 6 ); - + mat D; D = zeros(5,6); - + REQUIRE( accu(D) == Approx(0.0) ); REQUIRE( D.n_rows == 5 ); REQUIRE( D.n_cols == 6 ); - + mat E; E = 2*zeros(5,6); - + REQUIRE( accu(E) == Approx(0.0) ); REQUIRE( E.n_rows == 5 ); REQUIRE( E.n_cols == 6 ); @@ -54,37 +60,37 @@ TEST_CASE("gen_zeros_2") { mat A(5,6,fill::ones); - + A.col(1).zeros(); - + REQUIRE( accu(A.col(0)) == Approx(double(A.n_rows)) ); REQUIRE( accu(A.col(1)) == Approx(0.0) ); REQUIRE( accu(A.col(2)) == Approx(double(A.n_rows)) ); - + mat B(5,6,fill::ones); - + B.row(1).zeros(); - + REQUIRE( accu(B.row(0)) == Approx(double(B.n_cols)) ); REQUIRE( accu(B.row(1)) == Approx(0.0) ); REQUIRE( accu(B.row(2)) == Approx(double(B.n_cols)) ); - + mat C(5,6,fill::ones); - + C(span(1,3),span(1,4)).zeros(); - + REQUIRE( accu(C.head_cols(1)) == Approx(double(5)) ); REQUIRE( accu(C.head_rows(1)) == Approx(double(6)) ); - + REQUIRE( accu(C.tail_cols(1)) == Approx(double(5)) ); REQUIRE( accu(C.tail_rows(1)) == Approx(double(6)) ); - + REQUIRE( accu(C(span(1,3),span(1,4))) == Approx(0.0) ); mat D(5,6,fill::ones); - + D.diag().zeros(); - + REQUIRE( accu(D.diag()) == Approx(0.0) ); } @@ -93,17 +99,40 @@ TEST_CASE("gen_zeros_3") { mat A(5,6,fill::ones); - + uvec indices = { 2, 4, 6 }; - + A(indices).zeros(); - + REQUIRE( accu(A) == Approx(double(5*6-3)) ); - + REQUIRE( A(0) == Approx(1.0) ); REQUIRE( A(A.n_elem-1) == Approx(1.0) ); - + REQUIRE( A(indices(0)) == Approx(0.0) ); REQUIRE( A(indices(1)) == Approx(0.0) ); REQUIRE( A(indices(2)) == Approx(0.0) ); } + + + +TEST_CASE("gen_zeros_sp_mat") + { + SpMat e(2, 2); + + e(0, 0) = 3.1; + e(1, 1) = 2.2; + + e *= zeros >(2, 2); + + REQUIRE( e.n_nonzero == 0 ); + REQUIRE( (unsigned int) e(0, 0) == 0 ); + REQUIRE( (unsigned int) e(1, 0) == 0 ); + REQUIRE( (unsigned int) e(0, 1) == 0 ); + REQUIRE( (unsigned int) e(1, 1) == 0 ); + + // Just test compilation here. + e = zeros >(5, 5); + e *= zeros >(5, 5); + e %= zeros >(5, 5); + } diff -Nru armadillo-7.600.2+dfsg/tests/hdf5.cpp armadillo-7.950.1+dfsg/tests/hdf5.cpp --- armadillo-7.600.2+dfsg/tests/hdf5.cpp 1970-01-01 00:00:00.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/hdf5.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -0,0 +1,719 @@ +// Copyright 2011-2017 Ryan Curtin (http://www.ratml.org/) +// Copyright 2017 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + +#include + +#include "catch.hpp" + +using namespace arma; + +#if defined(ARMA_USE_HDF5) + +TEST_CASE("hdf5_u8_test") + { + arma::Mat a; + a.randu(20, 20); + + // Save first. + a.save("file.h5", hdf5_binary); + + // Load as different matrix. + arma::Mat b; + b.load("file.h5", hdf5_binary); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == b[i] ); + } + + // Now autoload. + arma::Mat c; + c.load("file.h5"); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == c[i] ); + } + + remove("file.h5"); + } + + + +TEST_CASE("hdf5_u16_test") + { + arma::Mat a; + a.randu(20, 20); + + // Save first. + a.save("file.h5", hdf5_binary); + + // Load as different matrix. + arma::Mat b; + b.load("file.h5", hdf5_binary); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == b[i] ); + } + + // Now autoload. + arma::Mat c; + c.load("file.h5"); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == c[i] ); + } + + remove("file.h5"); + } + + + +TEST_CASE("hdf5_u32_test") + { + arma::Mat a; + a.randu(20, 20); + + // Save first. + a.save("file.h5", hdf5_binary); + + // Load as different matrix. + arma::Mat b; + b.load("file.h5", hdf5_binary); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == b[i] ); + } + + // Now autoload. + arma::Mat c; + c.load("file.h5"); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == c[i] ); + } + + remove("file.h5"); + } + + + +#ifdef ARMA_USE_U64S64 +TEST_CASE("hdf5_u64_test") + { + arma::Mat a; + a.randu(20, 20); + + // Save first. + a.save("file.h5", hdf5_binary); + + // Load as different matrix. + arma::Mat b; + b.load("file.h5", hdf5_binary); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == b[i] ); + } + + // Now autoload. + arma::Mat c; + c.load("file.h5"); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == c[i] ); + } + + remove("file.h5"); + } +#endif + + + +TEST_CASE("hdf5_s8_test") + { + arma::Mat a; + a.randu(20, 20); + + // Save first. + a.save("file.h5", hdf5_binary); + + // Load as different matrix. + arma::Mat b; + b.load("file.h5", hdf5_binary); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == b[i] ); + } + + // Now autoload. + arma::Mat c; + c.load("file.h5"); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == c[i] ); + } + + remove("file.h5"); + } + + + +TEST_CASE("hdf5_s16_test") + { + arma::Mat a; + a.randu(20, 20); + + // Save first. + a.save("file.h5", hdf5_binary); + + // Load as different matrix. + arma::Mat b; + b.load("file.h5", hdf5_binary); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == b[i] ); + } + + // Now autoload. + arma::Mat c; + c.load("file.h5"); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == c[i] ); + } + + remove("file.h5"); + } + + + +TEST_CASE("hdf5_s32_test") + { + arma::Mat a; + a.randu(20, 20); + + // Save first. + a.save("file.h5", hdf5_binary); + + // Load as different matrix. + arma::Mat b; + b.load("file.h5", hdf5_binary); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == b[i] ); + } + + // Now autoload. + arma::Mat c; + c.load("file.h5"); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == c[i] ); + } + + remove("file.h5"); + } + + + +#ifdef ARMA_USE_U64S64 +TEST_CASE("hdf5_s64_test") + { + arma::Mat a; + a.randu(20, 20); + + // Save first. + a.save("file.h5", hdf5_binary); + + // Load as different matrix. + arma::Mat b; + b.load("file.h5", hdf5_binary); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == b[i] ); + } + + // Now autoload. + arma::Mat c; + c.load("file.h5"); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == c[i] ); + } + + remove("file.h5"); + } +#endif + + + +TEST_CASE("hdf5_char_test") + { + arma::Mat a; + a.randu(20, 20); + + // Save first. + a.save("file.h5", hdf5_binary); + + // Load as different matrix. + arma::Mat b; + b.load("file.h5", hdf5_binary); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == b[i] ); + } + + // Now autoload. + arma::Mat c; + c.load("file.h5"); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == c[i] ); + } + + remove("file.h5"); + } + + + +TEST_CASE("hdf5_int_test") + { + arma::Mat a; + a.randu(20, 20); + + // Save first. + a.save("file.h5", hdf5_binary); + + // Load as different matrix. + arma::Mat b; + b.load("file.h5", hdf5_binary); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == b[i] ); + } + + // Now autoload. + arma::Mat c; + c.load("file.h5"); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == c[i] ); + } + + remove("file.h5"); + } + + + +TEST_CASE("hdf5_uint_test") + { + arma::Mat a; + a.randu(20, 20); + + // Save first. + a.save("file.h5", hdf5_binary); + + // Load as different matrix. + arma::Mat b; + b.load("file.h5", hdf5_binary); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == b[i] ); + } + + // Now autoload. + arma::Mat c; + c.load("file.h5"); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == c[i] ); + } + + remove("file.h5"); + } + + + +TEST_CASE("hdf5_short_test") + { + arma::Mat a; + a.randu(20, 20); + + // Save first. + a.save("file.h5", hdf5_binary); + + // Load as different matrix. + arma::Mat b; + b.load("file.h5", hdf5_binary); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == b[i] ); + } + + // Now autoload. + arma::Mat c; + c.load("file.h5"); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == c[i] ); + } + + remove("file.h5"); + } + + + +TEST_CASE("hdf5_ushort_test") + { + arma::Mat a; + a.randu(20, 20); + + // Save first. + a.save("file.h5", hdf5_binary); + + // Load as different matrix. + arma::Mat b; + b.load("file.h5", hdf5_binary); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == b[i] ); + } + + // Now autoload. + arma::Mat c; + c.load("file.h5"); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == c[i] ); + } + + remove("file.h5"); + } + + + +TEST_CASE("hdf5_long_test") + { + arma::Mat a; + a.randu(20, 20); + + // Save first. + a.save("file.h5", hdf5_binary); + + // Load as different matrix. + arma::Mat b; + b.load("file.h5", hdf5_binary); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == b[i] ); + } + + // Now autoload. + arma::Mat c; + c.load("file.h5"); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == c[i] ); + } + + remove("file.h5"); + } + + + +TEST_CASE("hdf5_ulong_test") + { + arma::Mat a; + a.randu(20, 20); + + // Save first. + a.save("file.h5", hdf5_binary); + + // Load as different matrix. + arma::Mat b; + b.load("file.h5", hdf5_binary); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == b[i] ); + } + + // Now autoload. + arma::Mat c; + c.load("file.h5"); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == c[i] ); + } + + remove("file.h5"); + } + + + +#ifdef ARMA_USE_U64S64 +TEST_CASE("hdf5_llong_test") + { + arma::Mat a; + a.randu(20, 20); + + // Save first. + a.save("file.h5", hdf5_binary); + + // Load as different matrix. + arma::Mat b; + b.load("file.h5", hdf5_binary); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == b[i] ); + } + + // Now autoload. + arma::Mat c; + c.load("file.h5"); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == c[i] ); + } + + remove("file.h5"); + } + + + +TEST_CASE("hdf5_ullong_test") + { + arma::Mat a; + a.randu(20, 20); + + // Save first. + a.save("file.h5", hdf5_binary); + + // Load as different matrix. + arma::Mat b; + b.load("file.h5", hdf5_binary); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == b[i] ); + } + + // Now autoload. + arma::Mat c; + c.load("file.h5"); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == c[i] ); + } + + remove("file.h5"); + } +#endif + + + +TEST_CASE("hdf5_float_test") + { + arma::Mat a; + a.randu(20, 20); + + // Save first. + a.save("file.h5", hdf5_binary); + + // Load as different matrix. + arma::Mat b; + b.load("file.h5", hdf5_binary); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == b[i] ); + } + + // Now autoload. + arma::Mat c; + c.load("file.h5"); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == c[i] ); + } + + remove("file.h5"); + } + + + +TEST_CASE("hdf5_double_test") + { + arma::Mat a; + a.randu(20, 20); + + // Save first. + a.save("file.h5", hdf5_binary); + + // Load as different matrix. + arma::Mat b; + b.load("file.h5", hdf5_binary); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == b[i] ); + } + + // Now autoload. + arma::Mat c; + c.load("file.h5"); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == c[i] ); + } + + remove("file.h5"); + } + + + +TEST_CASE("hdf5_complex_float_test") + { + arma::Mat > a; + a.randu(20, 20); + + // Save first. + a.save("file.h5", hdf5_binary); + + // Load as different matrix. + arma::Mat > b; + b.load("file.h5", hdf5_binary); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == b[i] ); + } + + // Now autoload. + arma::Mat > c; + c.load("file.h5"); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == c[i] ); + } + + remove("file.h5"); + } + + + +TEST_CASE("hdf5_complex_double_test") + { + arma::Mat > a; + a.randu(20, 20); + + // Save first. + a.save("file.h5", hdf5_binary); + + // Load as different matrix. + arma::Mat > b; + b.load("file.h5", hdf5_binary); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + REQUIRE( a[i] == b[i] ); + + // Now autoload. + arma::Mat > c; + c.load("file.h5"); + + // Check that they are the same. + for (uword i = 0; i < a.n_elem; ++i) + { + REQUIRE( a[i] == c[i] ); + } + + remove("file.h5"); + } + +#endif diff -Nru armadillo-7.600.2+dfsg/tests/init_auxmem.cpp armadillo-7.950.1+dfsg/tests/init_auxmem.cpp --- armadillo-7.600.2+dfsg/tests/init_auxmem.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/init_auxmem.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/init_fill.cpp armadillo-7.950.1+dfsg/tests/init_fill.cpp --- armadillo-7.600.2+dfsg/tests/init_fill.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/init_fill.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/init_misc.cpp armadillo-7.950.1+dfsg/tests/init_misc.cpp --- armadillo-7.600.2+dfsg/tests/init_misc.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/init_misc.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/instantiation.cpp armadillo-7.950.1+dfsg/tests/instantiation.cpp --- armadillo-7.600.2+dfsg/tests/instantiation.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/instantiation.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/main.cpp armadillo-7.950.1+dfsg/tests/main.cpp --- armadillo-7.600.2+dfsg/tests/main.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/main.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/Makefile armadillo-7.950.1+dfsg/tests/Makefile --- armadillo-7.600.2+dfsg/tests/Makefile 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/Makefile 2016-06-16 16:16:31.000000000 +0000 @@ -4,6 +4,7 @@ #LIB_FLAGS = -lopenblas -llapack CXX_FLAGS = -std=c++11 -Wshadow -Wall -pedantic -O0 +#CXX_FLAGS = -std=c++11 -Wshadow -Wall -pedantic -O0 -fopenmp #CXX_FLAGS = -std=c++11 -Wshadow -Wall -pedantic -O0 -DARMA_DONT_USE_WRAPPER #CXX_FLAGS = -std=c++11 -Wshadow -Wall -pedantic -O2 diff -Nru armadillo-7.600.2+dfsg/tests/mat_minus.cpp armadillo-7.950.1+dfsg/tests/mat_minus.cpp --- armadillo-7.600.2+dfsg/tests/mat_minus.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/mat_minus.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/mat_mul_cx.cpp armadillo-7.950.1+dfsg/tests/mat_mul_cx.cpp --- armadillo-7.600.2+dfsg/tests/mat_mul_cx.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/mat_mul_cx.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/mat_mul_real.cpp armadillo-7.950.1+dfsg/tests/mat_mul_real.cpp --- armadillo-7.600.2+dfsg/tests/mat_mul_real.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/mat_mul_real.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/mat_neg.cpp armadillo-7.950.1+dfsg/tests/mat_neg.cpp --- armadillo-7.600.2+dfsg/tests/mat_neg.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/mat_neg.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/mat_plus.cpp armadillo-7.950.1+dfsg/tests/mat_plus.cpp --- armadillo-7.600.2+dfsg/tests/mat_plus.cpp 2016-06-16 16:16:11.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/mat_plus.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -1,11 +1,17 @@ -// Copyright (C) 2015 National ICT Australia (NICTA) +// Copyright 2015 Conrad Sanderson (http://conradsanderson.id.au) +// Copyright 2015 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 -// file, You can obtain one at http://mozilla.org/MPL/2.0/. -// ------------------------------------------------------------------- +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 // -// Written by Conrad Sanderson - http://conradsanderson.id.au +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ #include diff -Nru armadillo-7.600.2+dfsg/tests/spcol.cpp armadillo-7.950.1+dfsg/tests/spcol.cpp --- armadillo-7.600.2+dfsg/tests/spcol.cpp 1970-01-01 00:00:00.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/spcol.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -0,0 +1,211 @@ +// Copyright 2011-2017 Ryan Curtin (http://www.ratml.org/) +// Copyright 2011-2012 Matthew Amidon +// Copyright 2011-2012 James Cline +// Copyright 2017 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + +#include + +#include "catch.hpp" + +using namespace arma; + +TEST_CASE("spcol_insert_test") + { + SpCol sp; + sp.set_size(10, 1); + // Ensure everything is empty. + for (size_t i = 0; i < 10; i++) + REQUIRE( sp(i) == 0.0 ); + + // Add an element. + sp(5, 0) = 43.234; + REQUIRE( sp.n_nonzero == 1 ); + REQUIRE( (double) sp(5, 0) == Approx(43.234) ); + + // Remove the element. + sp(5, 0) = 0.0; + REQUIRE( sp.n_nonzero == 0 ); + } + +TEST_CASE("col_iterator_test") + { + SpCol x(5, 1); + x(3) = 3.1; + x(0) = 4.2; + x(1) = 3.3; + x(1) = 5.5; // overwrite + x(2) = 4.5; + x(4) = 6.4; + + SpCol::iterator it = x.begin(); + REQUIRE( (double) *it == Approx(4.2) ); + REQUIRE( it.row() == 0 ); + REQUIRE( it.col() == 0 ); + it++; + + REQUIRE( (double) *it == Approx(5.5) ); + REQUIRE( it.row() == 1); + REQUIRE( it.col() == 0); + it++; + + REQUIRE( (double) *it == Approx(4.5) ); + REQUIRE( it.row() == 2 ); + REQUIRE( it.col() == 0 ); + it++; + + REQUIRE( (double) *it == Approx(3.1) ); + REQUIRE( it.row() == 3 ); + REQUIRE( it.col() == 0 ); + it++; + + REQUIRE( (double) *it == Approx(6.4) ); + REQUIRE( it.row() == 4 ); + REQUIRE( it.col() == 0 ); + it++; + + REQUIRE( it == x.end() ); + + // Now let's go backwards. + it--; // Get it off the end. + REQUIRE( (double) *it == Approx(6.4) ); + REQUIRE( it.row() == 4 ); + REQUIRE( it.col() == 0 ); + it--; + + REQUIRE( (double) *it == Approx(3.1) ); + REQUIRE( it.row() == 3); + REQUIRE( it.col() == 0); + it--; + + REQUIRE( (double) *it == Approx(4.5) ); + REQUIRE( it.row() == 2); + REQUIRE( it.col() == 0); + it--; + + REQUIRE( (double) *it == Approx(5.5) ); + REQUIRE( it.row() == 1 ); + REQUIRE( it.col() == 0 ); + it--; + + REQUIRE( (double) *it == Approx(4.2) ); + REQUIRE( it.row() == 0 ); + REQUIRE( it.col() == 0 ); + + REQUIRE( it == x.begin() ); + + // Try removing an element we itreated to. + it++; + it++; + *it = 0; + REQUIRE( x.n_nonzero == 4 ); + } + +TEST_CASE("basic_sp_col_operator_test") + { + // +=, -=, *=, /=, %= + SpCol a(6, 1); + a(0) = 3.4; + a(1) = 2.0; + + SpCol b(6, 1); + b(0) = 3.4; + b(3) = 0.4; + + double addResult[6] = {6.8, 2.0, 0.0, 0.4, 0.0, 0.0}; + double subResult[6] = {0.0, 2.0, 0.0, -0.4, 0.0, 0.0}; + + SpCol out = a; + out += b; + REQUIRE( out.n_nonzero == 3 ); + for (u32 r = 0; r < 6; r++) + { + REQUIRE( (double) out(r) == Approx(addResult[r]) ); + } + + out = a; + out -= b; + REQUIRE( out.n_nonzero == 2 ); + for (u32 r = 0; r < 6; r++) + { + REQUIRE( (double) out(r) == Approx(subResult[r]) ); + } + } + +/* +BOOST_AUTO_TEST_CASE(SparseSparseColMultiplicationTest) { + SpCol spaa(4, 1); + SpMat spbb(1, 4); + + spaa(0, 0) = 321.2; + spaa(1, 0) = .123; + spaa(2, 0) = 231.4; + spaa(3, 0) = .03214; + + spbb(0, 0) = 32.23; + spbb(0, 1) = 5.1; + spbb(0, 2) = 4.4; + spbb(0, 3) = .88; + + SpMat precision = spaa; + + precision *= spbb; //Wolfram alpha insisted on rounding.. + + spaa *= spbb; + + for (size_t i = 0; i < 4; i++) + for (size_t j = 0; j < 4; j++) + BOOST_REQUIRE_CLOSE((double) spaa(i, j), (double) precision(i, j), 1e-5); +} +*/ + +TEST_CASE("spcol_shed_row_test") + { + // On an SpCol + SpCol e(10); + e(1) = 5; + e(4) = 56; + e(5) = 6; + e(7) = 4; + e(8) = 2; + e(9) = -1; + e.shed_rows(4, 7); + + REQUIRE( e.n_cols == 1 ); + REQUIRE( e.n_rows == 6 ); + REQUIRE( e.n_nonzero == 3 ); + REQUIRE( (int) e[0] == 0 ); + REQUIRE( (int) e[1] == 5 ); + REQUIRE( (int) e[2] == 0 ); + REQUIRE( (int) e[3] == 0 ); + REQUIRE( (int) e[4] == 2 ); + REQUIRE( (int) e[5] == -1 ); + } + + + +TEST_CASE("spcol_col_constructor") + { + SpMat m(100, 100); + m.sprandu(100, 100, 0.3); + + SpCol c = m.col(0); + + vec v(c); + + for (uword i = 0; i < 100; ++i) + { + REQUIRE( v(i) == (double) c(i) ); + } + } diff -Nru armadillo-7.600.2+dfsg/tests/spmat.cpp armadillo-7.950.1+dfsg/tests/spmat.cpp --- armadillo-7.600.2+dfsg/tests/spmat.cpp 1970-01-01 00:00:00.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/spmat.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -0,0 +1,2745 @@ +// Copyright 2011-2017 Ryan Curtin (http://www.ratml.org/) +// Copyright 2011-2012 Matthew Amidon +// Copyright 2011-2012 James Cline +// Copyright 2017 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + +#include + +#include "catch.hpp" + +using namespace arma; + +// Does the matrix correctly report when it is empty? +TEST_CASE("empty_test") + { + bool testPassed = true; + + sp_imat test; + REQUIRE( test.is_empty() ); + + test.set_size(3, 4); + REQUIRE( test.is_empty() == false ); + } + +// Can we insert items into the matrix correctly? +TEST_CASE("insertion_test") + { + int correctResult[3][4] = + {{1, 0, 0, 0}, + {2, 3, 1, 0}, + {0, 9, 4, 0}}; + + // Now run the same test for the Armadillo sparse matrix. + SpMat arma_test; + arma_test.set_size(3, 4); + + // Fill the matrix (hopefully). + arma_test(0, 0) = 1; + arma_test(1, 0) = 2; + arma_test(1, 1) = 3; + arma_test(2, 1) = 9; + arma_test(1, 2) = 1; + arma_test(2, 2) = 4; + + for (size_t i = 0; i < 3; i++) + { + for (size_t j = 0; j < 4; j++) + { + REQUIRE( (int) arma_test(i, j) == correctResult[i][j] ); + } + } + } + +// Does sparse-sparse matrix multiplication work? +TEST_CASE("full_sparse_sparse_matrix_multiplication_test") + { + // Now perform the test again for SpMat. + SpMat spa(3, 3); + SpMat spb(3, 2); + int correctResult[3][2] = + {{ 46, 60}, + { 40, 52}, + {121, 160}}; + + spa(0, 0) = 1; + spa(0, 1) = 10; + spa(0, 2) = 3; + spa(1, 0) = 3; + spa(1, 1) = 4; + spa(1, 2) = 5; + spa(2, 0) = 12; + spa(2, 1) = 13; + spa(2, 2) = 14; + + spb(0, 0) = 1; + spb(0, 1) = 2; + spb(1, 0) = 3; + spb(1, 1) = 4; + spb(2, 0) = 5; + spb(2, 1) = 6; + + spa *= spb; + + REQUIRE( spa.n_rows == 3 ); + REQUIRE( spa.n_cols == 2 ); + + for (size_t i = 0; i < 3; i++) + { + for (size_t j = 0; j < 2; j++) + { + REQUIRE( (int) spa(i, j) == correctResult[i][j] ); + } + } + } + +TEST_CASE("sparse_sparse_matrix_multiplication_test") + { + SpMat spaa(10, 10); + spaa(1, 5) = 0.4; + spaa(0, 4) = 0.3; + spaa(0, 8) = 1.2; + spaa(3, 0) = 1.1; + spaa(3, 1) = 1.1; + spaa(3, 2) = 1.1; + spaa(4, 4) = 0.2; + spaa(4, 9) = 0.1; + spaa(6, 2) = 4.1; + spaa(6, 8) = 4.1; + spaa(7, 5) = 1.0; + spaa(8, 9) = 0.4; + spaa(9, 4) = 0.4; + + double correctResultB[10][10] = + {{ 0.00, 0.00, 0.00, 0.00, 0.06, 0.00, 0.00, 0.00, 0.00, 0.51 }, + { 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00 }, + { 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00 }, + { 0.00, 0.00, 0.00, 0.00, 0.33, 0.44, 0.00, 0.00, 1.32, 0.00 }, + { 0.00, 0.00, 0.00, 0.00, 0.08, 0.00, 0.00, 0.00, 0.00, 0.02 }, + { 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00 }, + { 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 1.64 }, + { 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00 }, + { 0.00, 0.00, 0.00, 0.00, 0.16, 0.00, 0.00, 0.00, 0.00, 0.00 }, + { 0.00, 0.00, 0.00, 0.00, 0.08, 0.00, 0.00, 0.00, 0.00, 0.04 }}; + + spaa *= spaa; + + for (size_t i = 0; i < 10; i++) + { + for (size_t j = 0; j < 10; j++) + { + REQUIRE( (double) spaa(i, j) == Approx(correctResultB[i][j]) ); + } + } + } + +TEST_CASE("hadamard_product_test") + { + SpMat a(4, 4), b(4, 4); + + a(1, 1) = 1; + a(2, 1) = 1; + a(3, 3) = 1; + a(3, 0) = 1; + a(0, 2) = 1; + + b(1, 1) = 1; + b(2, 2) = 1; + b(3, 3) = 1; + b(3, 0) = 1; + b(0, 3) = 1; + b(3, 1) = 1; + + double correctResult[4][4] = + {{ 0, 0, 0, 0 }, + { 0, 1, 0, 0 }, + { 0, 0, 0, 0 }, + { 1, 0, 0, 1 }}; + + a %= b; + + for (size_t i = 0; i < 4; i++) + { + for (size_t j = 0; j < 4; j++) + { + REQUIRE( a(i, j) == correctResult[i][j] ); + } + } + + + SpMat c, d; + c.sprandu(30, 25, 0.1); + d.sprandu(30, 25, 0.1); + + mat e, f; + e = c; + f = d; + + c %= d; + e %= f; + + for (uword i = 0; i < 25; ++i) + { + for(uword j = 0; j < 30; ++j) + { + REQUIRE( (double) c(j, i) == Approx(e(j, i)) ); + } + } + } + +TEST_CASE("division_test") + { + SpMat a(2, 2), b(2, 2); + + a(0, 1) = 0.5; + + b(0, 1) = 1.0; + b(1, 0) = 5.0; + + a /= b; + + REQUIRE( std::isnan((double) a(0, 0)) ); + REQUIRE( (double) a(0, 1) == Approx(0.5) ); + REQUIRE( (double) a(1, 0) == Approx(1e-5) ); + REQUIRE( std::isnan((double) a(1, 1)) ); + } + +TEST_CASE("insert_delete_test") + { + SpMat sp; + sp.set_size(10, 10); + + // Ensure everything is empty. + for (size_t i = 0; i < 100; i++) + { + REQUIRE( sp(i) == 0.0 ); + } + + // Add an element. + sp(5, 5) = 43.234; + REQUIRE( sp.n_nonzero == 1 ); + REQUIRE( (double) sp(5, 5) == Approx(43.234) ); + + // Remove the element. + sp(5, 5) = 0.0; + REQUIRE( sp.n_nonzero == 0 ); + } + +TEST_CASE("value_operator_test") + { + // Test operators that work with a single value. + // =(double), /=(double), *=(double) + SpMat sp(3, 4); + double correctResult[3][4] = {{1.5, 0.0, 0.0, 0.0}, + {2.1, 3.2, 0.9, 0.0}, + {0.0, 9.3, 4.0, -1.5}}; + sp(0, 0) = 1.5; + sp(1, 0) = 2.1; + sp(1, 1) = 3.2; + sp(1, 2) = 0.9; + sp(2, 1) = 9.3; + sp(2, 2) = 4.0; + sp(2, 3) = -1.5; + + // operator=(double) + SpMat work = sp; + work = 5.0; + REQUIRE( work.n_nonzero == 1 ); + REQUIRE( work.n_elem == 1 ); + REQUIRE( (double) work(0) == Approx(5.0) ); + + // operator*=(double) + work = sp; + work *= 2; + REQUIRE( work.n_nonzero == 7 ); + for (size_t i = 0; i < 3; i++) + { + for (size_t j = 0; j < 4; j++) + { + REQUIRE((double) work(i, j) == Approx(correctResult[i][j] * 2.0) ); + } + } + + // operator/=(double) + work = sp; + work /= 5.5; + REQUIRE( work.n_nonzero == 7 ); + for (size_t i = 0; i < 3; i++) + { + for (size_t j = 0; j < 4; j++) + { + REQUIRE((double) work(i, j) == Approx(correctResult[i][j] / 5.5) ); + } + } + } + +TEST_CASE("iterator_test") + { + SpMat x(5, 5); + x(4, 1) = 3.1; + x(1, 2) = 4.2; + x(1, 3) = 3.3; + x(1, 3) = 5.5; // overwrite + x(2, 3) = 4.5; + x(4, 4) = 6.4; + + SpMat::iterator it = x.begin(); + REQUIRE( (double) *it == Approx(3.1) ); + REQUIRE( it.row() == 4 ); + REQUIRE( it.col() == 1 ); + it++; + + REQUIRE( (double) *it == Approx(4.2) ); + REQUIRE( it.row() == 1 ); + REQUIRE( it.col() == 2 ); + it++; + + REQUIRE( (double) *it == Approx(5.5) ); + REQUIRE( it.row() == 1 ); + REQUIRE( it.col() == 3 ); + it++; + + REQUIRE( (double) *it == Approx(4.5) ); + REQUIRE( it.row() == 2 ); + REQUIRE( it.col() == 3 ); + it++; + + REQUIRE( (double) *it == Approx(6.4) ); + REQUIRE( it.row() == 4 ); + REQUIRE( it.col() == 4 ); + it++; + + REQUIRE( it == x.end() ); + + // Now let's go backwards. + it--; // Get it off the end. + REQUIRE( (double) *it == Approx(6.4) ); + REQUIRE( it.row() == 4 ); + REQUIRE( it.col() == 4 ); + it--; + + REQUIRE( (double) *it == Approx(4.5) ); + REQUIRE( it.row() == 2 ); + REQUIRE( it.col() == 3 ); + it--; + + REQUIRE( (double) *it == Approx(5.5) ); + REQUIRE( it.row() == 1 ); + REQUIRE( it.col() == 3 ); + it--; + + REQUIRE( (double) *it == Approx(4.2) ); + REQUIRE( it.row() == 1 ); + REQUIRE( it.col() == 2 ); + it--; + + REQUIRE( (double) *it == Approx(3.1) ); + REQUIRE( it.row() == 4 ); + REQUIRE( it.col() == 1 ); + + REQUIRE( it == x.begin() ); + + // Try removing an element we iterated to. + it++; + it++; + *it = 0; + REQUIRE( x.n_nonzero == 4 ); +} + +TEST_CASE("row_iterator_test") + { + SpMat x(5, 5); + x(4, 1) = 3.1; + x(1, 2) = 4.2; + x(1, 3) = 3.3; + x(1, 3) = 5.5; // overwrite + x(2, 3) = 4.5; + x(4, 4) = 6.4; + + SpMat::row_iterator it = x.begin_row(); + REQUIRE( (double) *it == Approx(4.2) ); + REQUIRE( it.row() == 1 ); + REQUIRE( it.col() == 2 ); + it++; + + REQUIRE( (double) *it == Approx(5.5) ); + REQUIRE( it.row() == 1 ); + REQUIRE( it.col() == 3 ); + it++; + + REQUIRE( (double) *it == Approx(4.5) ); + REQUIRE( it.row() == 2 ); + REQUIRE( it.col() == 3 ); + it++; + + REQUIRE( (double) *it == Approx(3.1) ); + REQUIRE( it.row() == 4 ); + REQUIRE( it.col() == 1 ); + it++; + + REQUIRE( (double) *it == Approx(6.4) ); + REQUIRE( it.row() == 4 ); + REQUIRE( it.col() == 4 ); + it++; + +// REQUIRE( it == x.end_row() ); + + // Now let's go backwards. + it--; // Get it off the end. + REQUIRE( (double) *it == Approx(6.4) ); + REQUIRE( it.row() == 4 ); + REQUIRE( it.col() == 4 ); + it--; + + REQUIRE( (double) *it == Approx(3.1) ); + REQUIRE( it.row() == 4 ); + REQUIRE( it.col() == 1 ); + it--; + + REQUIRE( (double) *it == Approx(4.5) ); + REQUIRE( it.row() == 2 ); + REQUIRE( it.col() == 3 ); + it--; + + REQUIRE( (double) *it == Approx(5.5) ); + REQUIRE( it.row() == 1 ); + REQUIRE( it.col() == 3 ); + it--; + + REQUIRE( (double) *it == Approx(4.2) ); + REQUIRE( it.row() == 1 ); + REQUIRE( it.col() == 2 ); + + REQUIRE( it == x.begin_row() ); + + // Try removing an element we itreated to. + it++; + it++; + *it = 0; + REQUIRE( x.n_nonzero == 4 ); + } + +TEST_CASE("basic_sp_mat_operator_test") + { + // +=, -=, *=, /=, %= + SpMat a(6, 5); + a(0, 0) = 3.4; + a(4, 1) = 4.1; + a(5, 1) = 1.5; + a(3, 2) = 2.6; + a(4, 2) = 3.0; + a(1, 3) = 9.8; + a(4, 3) = 0.1; + a(2, 4) = 0.2; + a(3, 4) = 0.2; + a(4, 4) = 0.2; + a(5, 4) = 8.3; + + SpMat b(6, 5); + b(0, 0) = 3.4; + b(3, 0) = 0.4; + b(3, 1) = 0.5; + b(4, 1) = 1.2; + b(4, 2) = 3.0; + b(5, 2) = 1.1; + b(1, 3) = 0.6; + b(3, 3) = 1.0; + b(4, 4) = 7.3; + b(5, 4) = 7.4; + + double addResult[6][5] = {{6.8 , 0 , 0 , 0 , 0 }, + {0 , 0 , 0 , 10.4, 0 }, + {0 , 0 , 0 , 0 , 0.2 }, + {0.4 , 0.5 , 2.6 , 1.0 , 0.2 }, + {0 , 5.3 , 6.0 , 0.1 , 7.5 }, + {0 , 1.5 , 1.1 , 0 , 15.7}}; + + double subResult[6][5] = {{0 , 0 , 0 , 0 , 0 }, + {0 , 0 , 0 , 9.2 , 0 }, + {0 , 0 , 0 , 0 , 0.2 }, + {-0.4, -0.5, 2.6 , -1.0, 0.2 }, + {0 , 2.9 , 0 , 0.1 , -7.1}, + {0 , 1.5 , -1.1, 0 , 0.9 }}; + + SpMat out = a; + out += b; + REQUIRE( out.n_nonzero == 15 ); + for (uword r = 0; r < 6; r++) + { + for (uword c = 0; c < 5; c++) + { + REQUIRE( (double) out(r, c) == Approx(addResult[r][c]) ); + } + } + + out = a; + out -= b; + REQUIRE( out.n_nonzero == 13 ); + for (uword r = 0; r < 6; r++) + { + for (uword c = 0; c < 5; c++) + { + REQUIRE( (double) out(r, c) == Approx(subResult[r][c]) ); + } + } + } + +TEST_CASE("min_max_test") + { + SpMat a(6, 5); + a(0, 0) = 3.4; + a(4, 1) = 4.1; + a(5, 1) = 1.5; + a(3, 2) = 2.6; + a(4, 2) = 3.0; + a(1, 3) = 9.8; + a(4, 3) = 0.1; + a(2, 4) = 0.2; + a(3, 4) = -0.2; + a(4, 4) = 0.2; + a(5, 4) = 8.3; + + uword index, row, col; + REQUIRE( a.min() == Approx(-0.2) ); + REQUIRE( a.min(index) == Approx(-0.2) ); + REQUIRE( index == 27 ); + REQUIRE( a.min(row, col) == Approx(-0.2) ); + REQUIRE( row == 3 ); + REQUIRE( col == 4 ); + + REQUIRE( a.max() == Approx(9.8) ); + REQUIRE( a.max(index) == Approx(9.8) ); + REQUIRE( index == 19 ); + REQUIRE( a.max(row, col) == Approx(9.8) ); + REQUIRE( row == 1 ); + REQUIRE( col == 3 ); + } + +TEST_CASE("swap_row_test") + { + SpMat a(6, 5); + a(0, 0) = 3.4; + a(4, 1) = 4.1; + a(5, 1) = 1.5; + a(3, 2) = 2.6; + a(4, 2) = 3.0; + a(1, 3) = 9.8; + a(4, 3) = 0.1; + a(2, 4) = 0.2; + a(3, 4) = -0.2; + a(4, 4) = 0.2; + a(5, 4) = 8.3; + + /** + * [[3.4 0.0 0.0 0.0 0.0] + * [0.0 0.0 0.0 9.8 0.0] + * [0.0 0.0 0.0 0.0 0.2] + * [0.0 0.0 2.6 0.0 -0.2] + * [0.0 4.1 3.0 0.1 0.2] + * [0.0 1.5 0.0 0.0 8.3]] + */ + double swapOne[6][5] = + {{ 0.0, 0.0, 2.6, 0.0, -0.2}, + { 0.0, 0.0, 0.0, 9.8, 0.0}, + { 0.0, 0.0, 0.0, 0.0, 0.2}, + { 3.4, 0.0, 0.0, 0.0, 0.0}, + { 0.0, 4.1, 3.0, 0.1, 0.2}, + { 0.0, 1.5, 0.0, 0.0, 8.3}}; + + double swapTwo[6][5] = + {{ 0.0, 0.0, 2.6, 0.0, -0.2}, + { 0.0, 0.0, 0.0, 9.8, 0.0}, + { 0.0, 0.0, 0.0, 0.0, 0.2}, + { 3.4, 0.0, 0.0, 0.0, 0.0}, + { 0.0, 1.5, 0.0, 0.0, 8.3}, + { 0.0, 4.1, 3.0, 0.1, 0.2}}; + + a.swap_rows(0, 3); + + for (uword row = 0; row < a.n_rows; row++) + { + for (uword col = 0; col < a.n_cols; col++) + { + REQUIRE( (double) a(row, col) == Approx(swapOne[row][col]) ); + } + } + + a.swap_rows(4, 5); + + for (uword row = 0; row < a.n_rows; row++) + { + for (uword col = 0; col < a.n_cols; col++) + { + REQUIRE( (double) a(row, col) == Approx(swapTwo[row][col]) ); + } + } + } + +TEST_CASE("swap_col_test") + { + SpMat a(6, 5); + a(0, 0) = 3.4; + a(4, 1) = 4.1; + a(5, 1) = 1.5; + a(3, 2) = 2.6; + a(4, 2) = 3.0; + a(1, 3) = 9.8; + a(4, 3) = 0.1; + a(2, 4) = 0.2; + a(3, 4) = -0.2; + a(4, 4) = 0.2; + a(5, 4) = 8.3; + + mat b(6, 5); + b.zeros(6, 5); + b(0, 0) = 3.4; + b(4, 1) = 4.1; + b(5, 1) = 1.5; + b(3, 2) = 2.6; + b(4, 2) = 3.0; + b(1, 3) = 9.8; + b(4, 3) = 0.1; + b(2, 4) = 0.2; + b(3, 4) = -0.2; + b(4, 4) = 0.2; + b(5, 4) = 8.3; + + /** + * [[3.4 0.0 0.0 0.0 0.0] + * [0.0 0.0 0.0 9.8 0.0] + * [0.0 0.0 0.0 0.0 0.2] + * [0.0 0.0 2.6 0.0 -0.2] + * [0.0 4.1 3.0 0.1 0.2] + * [0.0 1.5 0.0 0.0 8.3]] + */ + + a.swap_cols(2, 3); + b.swap_cols(2, 3); + + for (uword row = 0; row < a.n_rows; row++) + { + for (uword col = 0; col < a.n_cols; col++) + { + REQUIRE( (double) a(row, col) == Approx(b(row, col)) ); + } + } + + a.swap_cols(0, 4); + b.swap_cols(0, 4); + + for (uword row = 0; row < a.n_rows; row++) + { + for (uword col = 0; col < a.n_cols; col++) + { + REQUIRE( (double) a(row, col) == Approx(b(row, col)) ); + } + } + + a.swap_cols(1, 4); + b.swap_cols(1, 4); + + for (uword row = 0; row < a.n_rows; row++) + { + for (uword col = 0; col < a.n_cols; col++) + { + REQUIRE( (double) a(row, col) == Approx(b(row, col)) ); + } + } + } + +TEST_CASE("shed_col_test") + { + SpMat a(2, 2); + a(0, 0) = 1; + a(1, 1) = 1; + + /** + * [[1 0] + * [0 1]] + * + * becomes + * + * [[0] + * [1]] + */ + + a.shed_col(0); + REQUIRE( a.n_cols == 1 ); + REQUIRE( a.n_rows == 2 ); + REQUIRE( a.n_elem == 2 ); + REQUIRE( a.n_nonzero == 1 ); + REQUIRE( a(0, 0) == 0 ); + REQUIRE( a(1, 0) == 1 ); + } + +TEST_CASE("shed_cols_test") + { + SpMat a(3, 3); + a(0, 0) = 1; + a(1, 1) = 1; + a(2, 2) = 1; + SpMat b(3, 3); + b(0, 0) = 1; + b(1, 1) = 1; + b(2, 2) = 1; + SpMat c(3, 3); + c(0, 0) = 1; + c(1, 1) = 1; + c(2, 2) = 1; + + /** + * [[1 0 0] + * [0 1 0] + * [0 0 1]] + * + * becomes + * + * [[0] + * [0] + * [1]] + */ + + a.shed_cols(0, 1); + REQUIRE( a.n_cols == 1 ); + REQUIRE( a.n_rows == 3 ); + REQUIRE( a.n_elem == 3 ); + REQUIRE( a.n_nonzero == 1 ); + REQUIRE( a(0, 0) == 0 ); + REQUIRE( a(1, 0) == 0 ); + REQUIRE( a(2, 0) == 1 ); + + b.shed_cols(1, 2); + REQUIRE( b.n_cols == 1 ); + REQUIRE( b.n_rows == 3 ); + REQUIRE( b.n_elem == 3 ); + REQUIRE( b.n_nonzero == 1 ); + REQUIRE( b(0, 0) == 1 ); + REQUIRE( b(1, 0) == 0 ); + REQUIRE( b(2, 0) == 0 ); + + c.shed_cols(0, 0); + c.shed_cols(1, 1); + REQUIRE( c.n_cols == 1 ); + REQUIRE( c.n_rows == 3 ); + REQUIRE( c.n_elem == 3 ); + REQUIRE( c.n_nonzero == 1 ); + REQUIRE( c(0, 0) == 0 ); + REQUIRE( c(1, 0) == 1 ); + REQUIRE( c(2, 0) == 0 ); + } + +TEST_CASE("shed_row_test") + { + SpMat a(3, 3); + a(0, 0) = 1; + a(1, 1) = 1; + a(2, 2) = 1; + Mat b(3, 3); + b.zeros(3, 3); + b(0, 0) = 1; + b(1, 1) = 1; + b(2, 2) = 1; + + /** + * [[1 0 0] + * [0 1 0] + * [0 0 1]] + * + * becomes + * + * [[1 0 0] + * [0 1 0]] + */ + a.shed_row(2); + b.shed_row(2); + REQUIRE( a.n_cols == 3 ); + REQUIRE( a.n_rows == 2 ); + REQUIRE( a.n_elem == 6 ); + REQUIRE( a.n_nonzero == 2 ); + for (uword row = 0; row < a.n_rows; row++) + { + for (uword col = 0; col < a.n_cols; col++) + { + REQUIRE( (double) a(row, col) == Approx(b(row, col)) ); + } + } + } + +TEST_CASE("shed_rows_test") + { + SpMat a(5, 5); + a(0, 0) = 1; + a(1, 1) = 1; + a(2, 2) = 1; + a(3, 3) = 1; + a(4, 4) = 1; + Mat b(5, 5); + b.zeros(5, 5); + b(0, 0) = 1; + b(1, 1) = 1; + b(2, 2) = 1; + b(3, 3) = 1; + b(4, 4) = 1; + + SpMat c = a; + Mat d = b; + + /** + * [[1 0 0 0 0] + * [0 1 0 0 0] + * [0 0 1 0 0] + * [0 0 0 1 0] + * [0 0 0 0 1]] + * + * becomes + * + * [[1 0 0 0 0] + * [0 1 0 0 0]] + */ + a.shed_rows(2,4); + b.shed_rows(2,4); + REQUIRE( a.n_cols == 5 ); + REQUIRE( a.n_rows == 2 ); + REQUIRE( a.n_elem == 10 ); + REQUIRE( a.n_nonzero == 2 ); + for (uword row = 0; row < a.n_rows; row++) + { + for (uword col = 0; col < a.n_cols; col++) + { + REQUIRE( (double) a(row, col) == Approx(b(row, col)) ); + } + } + + c.shed_rows(0, 2); + d.shed_rows(0, 2); + REQUIRE( c.n_cols == 5 ); + REQUIRE( c.n_rows == 2 ); + REQUIRE( c.n_elem == 10 ); + REQUIRE( c.n_nonzero == 2 ); + for (uword row = 0; row < c.n_rows; ++row) + { + for (uword col = 0; col < c.n_cols; ++col) + { + REQUIRE( (int) c(row, col) == d(row, col) ); + } + } + } + +TEST_CASE("sp_mat_reshape_columnwise_test") + { + // Input matrix: + // [[0 2 0] + // [1 3 0] + // [0 0 5] + // [0 4 6]] + // + // Output matrix: + // [[0 0 0 0] + // [1 2 4 5] + // [0 3 0 6]] + SpMat ref(4, 3); + ref(1, 0) = 1; + ref(0, 1) = 2; + ref(1, 1) = 3; + ref(3, 1) = 4; + ref(2, 2) = 5; + ref(3, 2) = 6; + + // Now reshape. + ref.reshape(3, 4); + + // Check everything. + REQUIRE( ref.n_cols == 4 ); + REQUIRE( ref.n_rows == 3 ); + + REQUIRE( (unsigned int) ref(0, 0) == 0 ); + REQUIRE( (unsigned int) ref(1, 0) == 1 ); + REQUIRE( (unsigned int) ref(2, 0) == 0 ); + REQUIRE( (unsigned int) ref(0, 1) == 0 ); + REQUIRE( (unsigned int) ref(1, 1) == 2 ); + REQUIRE( (unsigned int) ref(2, 1) == 3 ); + REQUIRE( (unsigned int) ref(0, 2) == 0 ); + REQUIRE( (unsigned int) ref(1, 2) == 4 ); + REQUIRE( (unsigned int) ref(2, 2) == 0 ); + REQUIRE( (unsigned int) ref(0, 3) == 0 ); + REQUIRE( (unsigned int) ref(1, 3) == 5 ); + REQUIRE( (unsigned int) ref(2, 3) == 6 ); + } + +TEST_CASE("sp_mat_reshape_rowwise_test") + { + // Input matrix: + // [[0 2 0] + // [1 3 0] + // [0 0 5] + // [0 4 6]] + // + // Output matrix: + // [[0 2 0 1] + // [3 0 0 0] + // [5 0 4 6]] + SpMat ref(4, 3); + ref(1, 0) = 1; + ref(0, 1) = 2; + ref(1, 1) = 3; + ref(3, 1) = 4; + ref(2, 2) = 5; + ref(3, 2) = 6; + + // Now reshape. + ref.reshape(3, 4, 1 /* row-wise */); + + // Check everything. + REQUIRE( ref.n_cols == 4 ); + REQUIRE( ref.n_rows == 3 ); + + REQUIRE( (unsigned int) ref(0, 0) == 0 ); + REQUIRE( (unsigned int) ref(1, 0) == 3 ); + REQUIRE( (unsigned int) ref(2, 0) == 5 ); + REQUIRE( (unsigned int) ref(0, 1) == 2 ); + REQUIRE( (unsigned int) ref(1, 1) == 0 ); + REQUIRE( (unsigned int) ref(2, 1) == 0 ); + REQUIRE( (unsigned int) ref(0, 2) == 0 ); + REQUIRE( (unsigned int) ref(1, 2) == 0 ); + REQUIRE( (unsigned int) ref(2, 2) == 4 ); + REQUIRE( (unsigned int) ref(0, 3) == 1 ); + REQUIRE( (unsigned int) ref(1, 3) == 0 ); + REQUIRE( (unsigned int) ref(2, 3) == 6 ); + } + +TEST_CASE("sp_mat_zeros_tests") + { + SpMat m(4, 3); + m(1, 0) = 1; + m(0, 1) = 2; + m(1, 1) = 3; + m(3, 1) = 4; + m(2, 2) = 5; + m(3, 2) = 6; + + // Now zero it out. + SpMat d = m; + + d.zeros(); + + REQUIRE( d.values[0] == 0 ); + REQUIRE( d.row_indices[0] == 0); + REQUIRE( d.col_ptrs[0] == 0 ); + REQUIRE( d.col_ptrs[1] == 0 ); + REQUIRE( d.col_ptrs[2] == 0 ); + REQUIRE( d.col_ptrs[3] == 0 ); + REQUIRE( d.n_cols == 3 ); + REQUIRE( d.n_rows == 4 ); + REQUIRE( d.n_elem == 12 ); + REQUIRE( d.n_nonzero == 0 ); + + // Now zero it out again. + d = m; + d.zeros(10); + + REQUIRE( d.values[0] == 0 ); + REQUIRE( d.row_indices[0] == 0); + REQUIRE( d.col_ptrs[0] == 0 ); + REQUIRE( d.col_ptrs[1] == 0 ); + REQUIRE( d.n_cols == 1 ); + REQUIRE( d.n_rows == 10 ); + REQUIRE( d.n_elem == 10 ); + REQUIRE( d.n_nonzero == 0 ); + + // Now zero it out again. + d = m; + d.zeros(5, 5); + + REQUIRE( d.values[0] == 0 ); + REQUIRE( d.row_indices[0] == 0); + REQUIRE( d.col_ptrs[0] == 0 ); + REQUIRE( d.col_ptrs[1] == 0 ); + REQUIRE( d.col_ptrs[2] == 0 ); + REQUIRE( d.col_ptrs[3] == 0 ); + REQUIRE( d.col_ptrs[4] == 0 ); + REQUIRE( d.col_ptrs[5] == 0 ); + REQUIRE( d.n_cols == 5 ); + REQUIRE( d.n_rows == 5 ); + REQUIRE( d.n_elem == 25 ); + REQUIRE( d.n_nonzero == 0 ); + } + + + +/** + * Check that eye() works. + */ +TEST_CASE("sp_mat_eye_test") + { + SpMat e = eye >(5, 5); + + REQUIRE( e.n_elem == 25 ); + REQUIRE( e.n_rows == 5 ); + REQUIRE( e.n_cols == 5 ); + REQUIRE( e.n_nonzero == 5 ); + + for (uword i = 0; i < 5; i++) + { + for (uword j = 0; j < 5; j++) + { + if (i == j) + REQUIRE( (double) e(i, j) == Approx(1.0) ); + else + REQUIRE( (double) e(i, j) == Approx(1e-5) ); + } + } + + // Just check that these compile and run. + e = eye >(5, 5); + e *= eye >(5, 5); + e %= eye >(5, 5); + e /= eye >(5, 5); + } + +/** + * Check that pow works. + * +TEST_CASE("sp_mat_pow_test") + { + SpMat a(3, 3); + a(0, 2) = 4.3; + a(1, 1) = -5.5; + a(2, 2) = -6.3; + + a += pow(a, 2); + + REQUIRE( (double) a(0, 0) == 0 ); + REQUIRE( (double) a(1, 0) == 0 ); + REQUIRE( (double) a(2, 0) == 0 ); + REQUIRE( (double) a(0, 1) == 0 ); + REQUIRE( (double) a(1, 1) == Approx(24.75) ); + REQUIRE( (double) a(2, 1) == 0 ); + REQUIRE( (double) a(0, 2) == Approx(22.79) ); + REQUIRE( (double) a(1, 2) == 0 ); + REQUIRE( (double) a(2, 2) == Approx(33.39) ); + + a = pow(a, 2); + a *= pow(a, 2); + a %= pow(a, 2); + a /= pow(a, 2); + } +*/ + + +// I hate myself. +#undef TEST_OPERATOR +#define TEST_OPERATOR(EOP_TEST, EOP) \ +TEST_CASE(EOP_TEST) \ + {\ + SpMat a(3, 3);\ + a(0, 2) = 4.3;\ + a(1, 1) = -5.5;\ + a(2, 2) = -6.3;\ + a(1, 0) = 0.001;\ + Mat b(3, 3);\ + b.zeros();\ + b(0, 2) = 4.3;\ + b(1, 1) = -5.5;\ + b(2, 2) = -6.3;\ + b(1, 0) = 0.001;\ + \ + SpMat c = EOP(a);\ + Mat d = EOP(b);\ + \ + if (c(0, 0) == c(0, 0) && d(0, 0) == d(0, 0))\ + REQUIRE( c(0, 0) == d(0, 0) );\ + if (c(1, 0) == c(1, 0) && d(1, 0) == d(1, 0))\ + REQUIRE( c(1, 0) == d(1, 0) );\ + if (c(2, 0) == c(2, 0) && d(2, 0) == d(2, 0))\ + REQUIRE( c(2, 0) == d(2, 0) );\ + if (c(0, 1) == c(0, 1) && d(0, 1) == d(0, 1))\ + REQUIRE( c(0, 1) == d(0, 1) );\ + if (c(1, 1) == c(1, 1) && d(1, 1) == d(1, 1))\ + REQUIRE( c(1, 1) == d(1, 1) );\ + if (c(2, 1) == c(2, 1) && d(2, 1) == d(2, 1))\ + REQUIRE( c(2, 1) == d(2, 1) );\ + if (c(0, 2) == c(0, 2) && d(0, 2) == d(0, 2))\ + REQUIRE( c(0, 2) == d(0, 2) );\ + if (c(1, 2) == c(1, 2) && d(1, 2) == d(1, 2))\ + REQUIRE( c(1, 2) == d(1, 2) );\ + if (c(2, 2) == c(2, 2) && d(2, 2) == d(2, 2))\ + REQUIRE( c(2, 2) == d(2, 2) );\ + \ + c -= EOP(a);\ + d -= EOP(b);\ + \ + if (c(0, 0) == c(0, 0) && d(0, 0) == d(0, 0))\ + REQUIRE( c(0, 0) == d(0, 0) );\ + if (c(1, 0) == c(1, 0) && d(1, 0) == d(1, 0))\ + REQUIRE( c(1, 0) == d(1, 0) );\ + if (c(2, 0) == c(2, 0) && d(2, 0) == d(2, 0))\ + REQUIRE( c(2, 0) == d(2, 0) );\ + if (c(0, 1) == c(0, 1) && d(0, 1) == d(0, 1))\ + REQUIRE( c(0, 1) == d(0, 1) );\ + if (c(1, 1) == c(1, 1) && d(1, 1) == d(1, 1))\ + REQUIRE( c(1, 1) == d(1, 1) );\ + if (c(2, 1) == c(2, 1) && d(2, 1) == d(2, 1))\ + REQUIRE( c(2, 1) == d(2, 1) );\ + if (c(0, 2) == c(0, 2) && d(0, 2) == d(0, 2))\ + REQUIRE( c(0, 2) == d(0, 2) );\ + if (c(1, 2) == c(1, 2) && d(1, 2) == d(1, 2))\ + REQUIRE( c(1, 2) == d(1, 2) );\ + if (c(2, 2) == c(2, 2) && d(2, 2) == d(2, 2))\ + REQUIRE( c(2, 2) == d(2, 2) );\ + \ + c %= EOP(a);\ + d %= EOP(b);\ + \ + if (c(0, 0) == c(0, 0) && d(0, 0) == d(0, 0))\ + REQUIRE( c(0, 0) == d(0, 0) );\ + if (c(1, 0) == c(1, 0) && d(1, 0) == d(1, 0))\ + REQUIRE( c(1, 0) == d(1, 0) );\ + if (c(2, 0) == c(2, 0) && d(2, 0) == d(2, 0))\ + REQUIRE( c(2, 0) == d(2, 0) );\ + if (c(0, 1) == c(0, 1) && d(0, 1) == d(0, 1))\ + REQUIRE( c(0, 1) == d(0, 1) );\ + if (c(1, 1) == c(1, 1) && d(1, 1) == d(1, 1))\ + REQUIRE( c(1, 1) == d(1, 1) );\ + if (c(2, 1) == c(2, 1) && d(2, 1) == d(2, 1))\ + REQUIRE( c(2, 1) == d(2, 1) );\ + if (c(0, 2) == c(0, 2) && d(0, 2) == d(0, 2))\ + REQUIRE( c(0, 2) == d(0, 2) );\ + if (c(1, 2) == c(1, 2) && d(1, 2) == d(1, 2))\ + REQUIRE( c(1, 2) == d(1, 2) );\ + if (c(2, 2) == c(2, 2) && d(2, 2) == d(2, 2))\ + REQUIRE( c(2, 2) == d(2, 2) );\ + \ + c *= EOP(a);\ + d *= EOP(b);\ + \ + if (c(0, 0) == c(0, 0) && d(0, 0) == d(0, 0))\ + REQUIRE( c(0, 0) == d(0, 0) );\ + if (c(1, 0) == c(1, 0) && d(1, 0) == d(1, 0))\ + REQUIRE( c(1, 0) == d(1, 0) );\ + if (c(2, 0) == c(2, 0) && d(2, 0) == d(2, 0))\ + REQUIRE( c(2, 0) == d(2, 0) );\ + if (c(0, 1) == c(0, 1) && d(0, 1) == d(0, 1))\ + REQUIRE( c(0, 1) == d(0, 1) );\ + if (c(1, 1) == c(1, 1) && d(1, 1) == d(1, 1))\ + REQUIRE( c(1, 1) == d(1, 1) );\ + if (c(2, 1) == c(2, 1) && d(2, 1) == d(2, 1))\ + REQUIRE( c(2, 1) == d(2, 1) );\ + if (c(0, 2) == c(0, 2) && d(0, 2) == d(0, 2))\ + REQUIRE( c(0, 2) == d(0, 2) );\ + if (c(1, 2) == c(1, 2) && d(1, 2) == d(1, 2))\ + REQUIRE( c(1, 2) == d(1, 2) );\ + if (c(2, 2) == c(2, 2) && d(2, 2) == d(2, 2))\ + REQUIRE( c(2, 2) == d(2, 2) );\ + \ + c /= EOP(a);\ + d /= EOP(b);\ + \ + if (c(0, 0) == c(0, 0) && d(0, 0) == d(0, 0))\ + REQUIRE( c(0, 0) == d(0, 0) );\ + if (c(1, 0) == c(1, 0) && d(1, 0) == d(1, 0))\ + REQUIRE( c(1, 0) == d(1, 0) );\ + if (c(2, 0) == c(2, 0) && d(2, 0) == d(2, 0))\ + REQUIRE( c(2, 0) == d(2, 0) );\ + if (c(0, 1) == c(0, 1) && d(0, 1) == d(0, 1))\ + REQUIRE( c(0, 1) == d(0, 1) );\ + if (c(1, 1) == c(1, 1) && d(1, 1) == d(1, 1))\ + REQUIRE( c(1, 1) == d(1, 1) );\ + if (c(2, 1) == c(2, 1) && d(2, 1) == d(2, 1))\ + REQUIRE( c(2, 1) == d(2, 1) );\ + if (c(0, 2) == c(0, 2) && d(0, 2) == d(0, 2))\ + REQUIRE( c(0, 2) == d(0, 2) );\ + if (c(1, 2) == c(1, 2) && d(1, 2) == d(1, 2))\ + REQUIRE( c(1, 2) == d(1, 2) );\ + if (c(2, 2) == c(2, 2) && d(2, 2) == d(2, 2))\ + REQUIRE( c(2, 2) == d(2, 2) );\ + } + +// Now run all the operators... +TEST_OPERATOR("sp_mat_abs_test", abs) +//TEST_OPERATOR("sp_mat_eps_test", eps); +//TEST_OPERATOR(expTest, exp); +//TEST_OPERATOR(exp2Test, exp2); +//TEST_OPERATOR(exp10Test, exp10); +//TEST_OPERATOR(trunc_expTest, trunc_exp); +//TEST_OPERATOR(logTest, log); +//TEST_OPERATOR(log2Test, log2); +//TEST_OPERATOR(log10Test, log10); +//TEST_OPERATOR(trunc_logTest, trunc_log); +TEST_OPERATOR("sp_mat_sqrt_test", sqrt) +TEST_OPERATOR("sp_mat_square_test", square) +TEST_OPERATOR("sp_mat_floor_test", floor) +TEST_OPERATOR("sp_mat_ceil_test", ceil) +//TEST_OPERATOR(cosTest, cos); +//TEST_OPERATOR(acosTest, acos); +//TEST_OPERATOR(coshTest, cosh); +//TEST_OPERATOR(acoshTest, acosh); +//TEST_OPERATOR(sinTest, sin); +//TEST_OPERATOR(asinTest, asin); +//TEST_OPERATOR(sinhTest, sinh); +//TEST_OPERATOR(asinhTest, asinh); +//TEST_OPERATOR(tanTest, tan); +//TEST_OPERATOR(tanhTest, tanh); +//TEST_OPERATOR(atanTest, atan); +//TEST_OPERATOR(atanhTest, atanh); + +/* +TEST_CASE("spmat_diskio_tests") + { + std::string file_names[] = {"raw_ascii.txt", + "raw_binary.bin", + "arma_ascii.csv", + "csv_ascii.csv", + "arma_binary.bin", + "pgm_binary.bin", + "coord_ascii.txt"}; + diskio dio; + SpMat m(4, 3); + m(0, 0) = 1; + m(3, 0) = 2; + m(0, 2) = 3; + m(3, 2) = 4; + m(2, 1) = 5; + m(1, 2) = 6; + + // Save the matrix. + REQUIRE( dio.save_raw_ascii(m, file_names[0]) ); +// REQUIRE( dio.save_raw_binary(m, file_names[1]) ); +// REQUIRE( dio.save_arma_ascii(m, file_names[2]) ); +// REQUIRE( dio.save_csv_ascii(m, file_names[3]) ); + REQUIRE( dio.save_arma_binary(m, file_names[4]) ); +// REQUIRE( dio.save_pgm_binary(m, file_names[5]) ); + REQUIRE( dio.save_coord_ascii(m, file_names[6]) ); + + // Load the files. + SpMat lm[7]; + std::string err; + REQUIRE( dio.load_raw_ascii(lm[0], file_names[0], err) ); +// REQUIRE( dio.load_raw_binary(lm[1], file_names[1], err) ); +// REQUIRE( dio.load_arma_ascii(lm[2], file_names[2], err) ); +// REQUIRE( dio.load_csv_ascii(lm[3], file_names[3], err) ); + REQUIRE( dio.load_arma_binary(lm[4], file_names[4], err) ); +// REQUIRE( dio.load_pgm_binary(lm[5], file_names[5], err) ); + REQUIRE( dio.load_coord_ascii(lm[6], file_names[6], err) ); + + // Now make sure all the matrices are identical. + for (uword i = 0; i < 7; i++) + { + for (uword r = 0; r < 4; r++) + { + for (uword c = 0; c < 3; c++) + { + REQUIRE( m(r, c) == lm[i](r, c) ); + } + } + } + + for (size_t i = 0; i < 7; ++i) + { + remove(file_names[i].c_str()); + } + } +*/ + + +TEST_CASE("min_test") + { + SpCol a(5); + + a(0) = 3.0; + a(2) = 1.0; + + double res = min(a); + REQUIRE( res == Approx(1e-5) ); + + a(0) = -3.0; + a(2) = -1.0; + + res = min(a); + REQUIRE( res == Approx(-3.0) ); + + a(0) = 1.3; + a(1) = 2.4; + a(2) = 3.1; + a(3) = 4.4; + a(4) = 1.4; + + res = min(a); + REQUIRE( res == Approx(1.3) ); + + SpRow b(5); + + b(0) = 3.0; + b(2) = 1.0; + + res = min(b); + REQUIRE( res == Approx(1e-5) ); + + b(0) = -3.0; + b(2) = -1.0; + + res = min(b); + REQUIRE( res == Approx(-3.0) ); + + b(0) = 1.3; + b(1) = 2.4; + b(2) = 3.1; + b(3) = 4.4; + b(4) = 1.4; + + res = min(b); + REQUIRE( res == Approx(1.3) ); + + SpMat c(6, 5); + + c(0, 0) = 1.0; + c(1, 0) = 3.0; + c(2, 0) = 4.0; + c(3, 0) = 0.6; + c(4, 0) = 1.4; + c(5, 0) = 1.2; + c(3, 2) = 1.3; + c(2, 3) = -4.0; + c(4, 3) = -1.4; + c(5, 2) = -3.4; + c(5, 3) = -4.1; + + SpMat r = min(c, 0); + REQUIRE( r.n_rows == 1 ); + REQUIRE( r.n_cols == 5 ); + REQUIRE( (double) r(0, 0) == Approx(0.6) ); + REQUIRE( (double) r(0, 1) == Approx(1e-5) ); + REQUIRE( (double) r(0, 2) == Approx(-3.4) ); + REQUIRE( (double) r(0, 3) == Approx(-4.1) ); + REQUIRE( (double) r(0, 4) == Approx(1e-5) ); + + r = min(c, 1); + REQUIRE( r.n_rows == 6 ); + REQUIRE( r.n_cols == 1 ); + REQUIRE( (double) r(0, 0) == Approx(1e-5) ); + REQUIRE( (double) r(1, 0) == Approx(1e-5) ); + REQUIRE( (double) r(2, 0) == Approx(-4.0) ); + REQUIRE( (double) r(3, 0) == Approx(1e-5) ); + REQUIRE( (double) r(4, 0) == Approx(-1.4) ); + REQUIRE( (double) r(5, 0) == Approx(-4.1) ); + } + + +TEST_CASE("max_test") + { + SpCol a(5); + + a(0) = -3.0; + a(2) = -1.0; + + double resa = max(a); + REQUIRE( resa == Approx(1e-5) ); + + a(0) = 3.0; + a(2) = 1.0; + + resa = max(a); + REQUIRE( resa == Approx(3.0) ); + + a(0) = -1.3; + a(1) = -2.4; + a(2) = -3.1; + a(3) = -4.4; + a(4) = -1.4; + + resa = max(a); + REQUIRE( resa == Approx(-1.3) ); + + SpRow b(5); + + b(0) = -3.0; + b(2) = -1.0; + + resa = max(b); + REQUIRE( resa == Approx(1e-5) ); + + b(0) = 3.0; + b(2) = 1.0; + + resa = max(b); + REQUIRE( resa == Approx(3.0) ); + + b(0) = -1.3; + b(1) = -2.4; + b(2) = -3.1; + b(3) = -4.4; + b(4) = -1.4; + + resa = max(b); + REQUIRE( resa == Approx(-1.3) ); + + SpMat c(6, 5); + + c(0, 0) = 1.0; + c(1, 0) = 3.0; + c(2, 0) = 4.0; + c(3, 0) = 0.6; + c(4, 0) = -1.4; + c(5, 0) = 1.2; + c(3, 2) = 1.3; + c(2, 3) = -4.0; + c(4, 3) = -1.4; + c(5, 2) = -3.4; + c(5, 3) = -4.1; + + SpMat res = max(c, 0); + REQUIRE( res.n_rows == 1 ); + REQUIRE( res.n_cols == 5 ); + REQUIRE( (double) res(0, 0) == Approx(4.0) ); + REQUIRE( (double) res(0, 1) == Approx(1e-5) ); + REQUIRE( (double) res(0, 2) == Approx(1.3) ); + REQUIRE( (double) res(0, 3) == Approx(1e-5) ); + REQUIRE( (double) res(0, 4) == Approx(1e-5) ); + + res = max(c, 1); + REQUIRE( res.n_rows == 6 ); + REQUIRE( res.n_cols == 1 ); + REQUIRE( (double) res(0, 0) == Approx(1.0) ); + REQUIRE( (double) res(1, 0) == Approx(3.0) ); + REQUIRE( (double) res(2, 0) == Approx(4.0) ); + REQUIRE( (double) res(3, 0) == Approx(1.3) ); + REQUIRE( (double) res(4, 0) == Approx(1e-5) ); + REQUIRE( (double) res(5, 0) == Approx(1.2) ); + } + + +TEST_CASE("spmat_min_cx_test") +{ + SpCol > a(5); + + a(0) = std::complex(3.0, -2.0); + a(2) = std::complex(1.0, 1.0); + + std::complex res = min(a); + REQUIRE( res.real() == Approx(1e-5) ); + REQUIRE( res.imag() == Approx(1e-5) ); + + a(0) = std::complex(-3.0, -2.0); + a(2) = std::complex(-1.0, -1.0); + + res = min(a); + REQUIRE( res.real() == Approx(1e-5) ); + REQUIRE( res.imag() == Approx(1e-5) ); + + a(0) = std::complex(1.0, 0.5); + a(1) = std::complex(2.4, 1.4); + a(2) = std::complex(0.5, 0.5); + a(3) = std::complex(2.0, 2.0); + a(4) = std::complex(1.4, -1.4); + + res = min(a); + REQUIRE( res.real() == Approx(0.5) ); + REQUIRE( res.imag() == Approx(0.5) ); + + SpRow > b(5); + + b(0) = std::complex(3.0, -2.0); + b(2) = std::complex(1.0, 1.0); + + res = min(b); + REQUIRE( res.real() == Approx(1e-5) ); + REQUIRE( res.imag() == Approx(1e-5) ); + + b(0) = std::complex(-3.0, -2.0); + b(2) = std::complex(-1.0, -1.0); + + res = min(b); + REQUIRE( res.real() == Approx(1e-5) ); + REQUIRE( res.imag() == Approx(1e-5) ); + + b(0) = std::complex(1.0, 0.5); + b(1) = std::complex(2.4, 1.4); + b(2) = std::complex(0.5, 0.5); + b(3) = std::complex(2.0, 2.0); + b(4) = std::complex(1.4, -1.4); + + res = min(b); + REQUIRE( res.real() == Approx(0.5) ); + REQUIRE( res.imag() == Approx(0.5) ); + + SpMat > c(4, 3); + + c(0, 0) = std::complex(1.0, 2.0); + c(0, 1) = std::complex(0.5, 0.5); + c(0, 2) = std::complex(2.0, 4.0); + c(1, 1) = std::complex(-1.0, -2.0); + c(2, 1) = std::complex(-3.0, -3.0); + c(3, 1) = std::complex(0.25, 0.25); + + SpMat > r = min(c, 0); + REQUIRE( r.n_rows == 1 ); + REQUIRE( r.n_cols == 3 ); + REQUIRE( ((std::complex) r(0, 0)).real() == Approx(1e-5) ); + REQUIRE( ((std::complex) r(0, 0)).imag() == Approx(1e-5) ); + REQUIRE( ((std::complex) r(0, 1)).real() == Approx(0.25) ); + REQUIRE( ((std::complex) r(0, 1)).imag() == Approx(0.25) ); + REQUIRE( ((std::complex) r(0, 2)).real() == Approx(1e-5) ); + REQUIRE( ((std::complex) r(0, 2)).imag() == Approx(1e-5) ); + + r = min(c, 1); + REQUIRE( r.n_rows == 4 ); + REQUIRE( r.n_cols == 1 ); + REQUIRE( ((std::complex) r(0, 0)).real() == Approx(0.5) ); + REQUIRE( ((std::complex) r(0, 0)).imag() == Approx(0.5) ); + REQUIRE( ((std::complex) r(1, 0)).real() == Approx(1e-5) ); + REQUIRE( ((std::complex) r(1, 0)).imag() == Approx(1e-5) ); + REQUIRE( ((std::complex) r(2, 0)).real() == Approx(1e-5) ); + REQUIRE( ((std::complex) r(2, 0)).imag() == Approx(1e-5) ); + REQUIRE( ((std::complex) r(3, 0)).real() == Approx(1e-5) ); + REQUIRE( ((std::complex) r(3, 0)).imag() == Approx(1e-5) ); +} + + + +TEST_CASE("spmat_max_cx_test") +{ + SpCol > a(5); + + a(0) = std::complex(3.0, -2.0); + a(2) = std::complex(1.0, 1.0); + + std::complex res = max(a); + REQUIRE( res.real() == Approx(3.0) ); + REQUIRE( res.imag() == Approx(-2.0) ); + + a(0) = std::complex(0); + a(2) = std::complex(0); + + res = max(a); + REQUIRE( res.real() == Approx(1e-5) ); + REQUIRE( res.imag() == Approx(1e-5) ); + + a(0) = std::complex(1.0, 0.5); + a(1) = std::complex(2.4, 1.4); + a(2) = std::complex(0.5, 0.5); + a(3) = std::complex(2.0, 2.0); + a(4) = std::complex(1.4, -1.4); + + res = max(a); + REQUIRE( res.real() == Approx(2.0) ); + REQUIRE( res.imag() == Approx(2.0) ); + + SpRow > b(5); + + b(0) = std::complex(3.0, -2.0); + b(2) = std::complex(1.0, 1.0); + + res = max(b); + REQUIRE( res.real() == Approx(3.0) ); + REQUIRE( res.imag() == Approx(-2.0) ); + + b(0) = std::complex(0); + b(2) = std::complex(0); + + res = max(b); + REQUIRE( res.real() == Approx(1e-5) ); + REQUIRE( res.imag() == Approx(1e-5) ); + + b(0) = std::complex(1.0, 0.5); + b(1) = std::complex(2.4, 1.4); + b(2) = std::complex(0.5, 0.5); + b(3) = std::complex(2.0, 2.0); + b(4) = std::complex(1.4, -1.4); + + res = max(b); + REQUIRE( res.real() == Approx(2.0) ); + REQUIRE( res.imag() == Approx(2.0) ); + + SpMat > c(4, 3); + + c(0, 0) = std::complex(1.0, 2.0); + c(0, 1) = std::complex(0.5, 0.5); + c(1, 1) = std::complex(-1.0, -2.0); + c(2, 1) = std::complex(-3.0, -3.0); + c(3, 1) = std::complex(0.25, 0.25); + + SpMat > r = max(c, 0); + REQUIRE( r.n_rows == 1 ); + REQUIRE( r.n_cols == 3 ); + REQUIRE( ((std::complex) r(0, 0)).real() == Approx(1.0) ); + REQUIRE( ((std::complex) r(0, 0)).imag() == Approx(2.0) ); + REQUIRE( ((std::complex) r(0, 1)).real() == Approx(-3.0) ); + REQUIRE( ((std::complex) r(0, 1)).imag() == Approx(-3.0) ); + REQUIRE( ((std::complex) r(0, 2)).real() == Approx(1e-5) ); + REQUIRE( ((std::complex) r(0, 2)).imag() == Approx(1e-5) ); + + r = max(c, 1); + REQUIRE( r.n_rows == 4 ); + REQUIRE( r.n_cols == 1 ); + REQUIRE( ((std::complex) r(0, 0)).real() == Approx(1.0) ); + REQUIRE( ((std::complex) r(0, 0)).imag() == Approx(2.0) ); + REQUIRE( ((std::complex) r(1, 0)).real() == Approx(-1.0) ); + REQUIRE( ((std::complex) r(1, 0)).imag() == Approx(-2.0) ); + REQUIRE( ((std::complex) r(2, 0)).real() == Approx(-3.0) ); + REQUIRE( ((std::complex) r(2, 0)).imag() == Approx(-3.0) ); + REQUIRE( ((std::complex) r(3, 0)).real() == Approx(0.25) ); + REQUIRE( ((std::complex) r(3, 0)).imag() == Approx(0.25) ); + } + + + +TEST_CASE("spmat_complex_constructor_test") + { + // First make two sparse matrices. + SpMat a(8, 10); + SpMat b(8, 10); + + a(0, 0) = 4; + a(4, 2) = 5; + a(5, 3) = 6; + a(6, 3) = 7; + a(1, 4) = 1; + a(5, 4) = 6; + a(7, 6) = 3; + a(0, 7) = 2; + a(3, 7) = 3; + + b(0, 0) = 4; + b(4, 2) = 5; + b(7, 3) = 4; + b(1, 4) = 1; + b(3, 4) = 6; + b(5, 4) = -1; + b(6, 4) = 2; + b(7, 4) = 3; + b(6, 5) = 2; + b(6, 6) = 3; + b(3, 7) = 4; + b(6, 7) = 5; + + SpMat > c(a, b); + + REQUIRE( c.n_nonzero == 16 ); + REQUIRE( (std::complex) c(0, 0) == std::complex(4, 4) ); + REQUIRE( (std::complex) c(4, 2) == std::complex(5, 5) ); + REQUIRE( (std::complex) c(5, 3) == std::complex(6, 0) ); + REQUIRE( (std::complex) c(6, 3) == std::complex(7, 0) ); + REQUIRE( (std::complex) c(7, 3) == std::complex(0, 4) ); + REQUIRE( (std::complex) c(1, 4) == std::complex(1, 1) ); + REQUIRE( (std::complex) c(3, 4) == std::complex(0, 6) ); + REQUIRE( (std::complex) c(5, 4) == std::complex(6, -1) ); + REQUIRE( (std::complex) c(6, 4) == std::complex(0, 2) ); + REQUIRE( (std::complex) c(7, 4) == std::complex(0, 3) ); + REQUIRE( (std::complex) c(6, 5) == std::complex(0, 2) ); + REQUIRE( (std::complex) c(6, 6) == std::complex(0, 3) ); + REQUIRE( (std::complex) c(7, 6) == std::complex(3, 0) ); + REQUIRE( (std::complex) c(0, 7) == std::complex(2, 0) ); + REQUIRE( (std::complex) c(3, 7) == std::complex(3, 4) ); + REQUIRE( (std::complex) c(6, 7) == std::complex(0, 5) ); + } + + + +TEST_CASE("spmat_unary_operators_test") + { + SpMat a(3, 3); + SpMat b(3, 3); + + a(0, 0) = 1; + a(1, 2) = 4; + a(2, 2) = 5; + + b(0, 1) = 1; + b(1, 0) = 2; + b(1, 2) = -4; + b(2, 2) = 5; + + SpMat c = a + b; + + REQUIRE( c.n_nonzero == 4 ); + + REQUIRE( (double) c(0, 0) == 1 ); + REQUIRE( (double) c(1, 0) == 2 ); + REQUIRE( (double) c(2, 0) == 0 ); + REQUIRE( (double) c(0, 1) == 1 ); + REQUIRE( (double) c(1, 1) == 0 ); + REQUIRE( (double) c(2, 1) == 0 ); + REQUIRE( (double) c(0, 2) == 0 ); + REQUIRE( (double) c(1, 2) == 0 ); + REQUIRE( (double) c(2, 2) == 10 ); + + c = a - b; + + REQUIRE( c.n_nonzero == 4 ); + + REQUIRE( (double) c(0, 0) == 1 ); + REQUIRE( (double) c(1, 0) == -2 ); + REQUIRE( (double) c(2, 0) == 0 ); + REQUIRE( (double) c(0, 1) == -1 ); + REQUIRE( (double) c(1, 1) == 0 ); + REQUIRE( (double) c(2, 1) == 0 ); + REQUIRE( (double) c(0, 2) == 0 ); + REQUIRE( (double) c(1, 2) == 8 ); + REQUIRE( (double) c(2, 2) == 0 ); + + c = a % b; + + REQUIRE( c.n_nonzero == 2 ); + + REQUIRE( (double) c(0, 0) == 0 ); + REQUIRE( (double) c(1, 0) == 0 ); + REQUIRE( (double) c(2, 0) == 0 ); + REQUIRE( (double) c(0, 1) == 0 ); + REQUIRE( (double) c(1, 1) == 0 ); + REQUIRE( (double) c(2, 1) == 0 ); + REQUIRE( (double) c(0, 2) == 0 ); + REQUIRE( (double) c(1, 2) == -16 ); + REQUIRE( (double) c(2, 2) == 25 ); + + a(0, 0) = 4; + b(0, 0) = 2; +/* + c = a / b; + + REQUIRE( c.n_nonzero == 3 ); + + REQUIRE( (double) c(0, 0) == 2 ); + REQUIRE( (double) c(1, 0) == 0 ); + REQUIRE( (double) c(2, 0) == 0 ); + REQUIRE( (double) c(0, 1) == 0 ); + REQUIRE( (double) c(1, 1) == 0 ); + REQUIRE( (double) c(2, 1) == 0 ); + REQUIRE( (double) c(0, 2) == 0 ); + REQUIRE( (double) c(1, 2) == -1 ); + REQUIRE( (double) c(2, 2) == 1 ); +*/ + } + + + +TEST_CASE("spmat_unary_val_operators_test") + { + SpMat a(2, 2); + + a(0, 0) = 2.0; + a(1, 1) = -3.0; + + SpMat b = a * 3.0; + + REQUIRE( b.n_nonzero == 2 ); + REQUIRE( (double) b(0, 0) == Approx(6.0) ); + REQUIRE( (double) b(0, 1) == Approx(1e-5) ); + REQUIRE( (double) b(1, 0) == Approx(1e-5) ); + REQUIRE( (double) b(1, 1) == Approx(-9.0) ); + + b = a / 3.0; + + REQUIRE( b.n_nonzero == 2 ); + REQUIRE( (double) b(0, 0) == Approx(2.0 / 3.0) ); + REQUIRE( (double) b(0, 1) == Approx(1e-5) ); + REQUIRE( (double) b(1, 0) == Approx(1e-5) ); + REQUIRE( (double) b(1, 1) == Approx(-1.0) ); + } + + +TEST_CASE("spmat_sparse_unary_multiplication_test") + { + SpMat spaa(10, 10); + spaa(1, 5) = 0.4; + spaa(0, 4) = 0.3; + spaa(0, 8) = 1.2; + spaa(3, 0) = 1.1; + spaa(3, 1) = 1.1; + spaa(3, 2) = 1.1; + spaa(4, 4) = 0.2; + spaa(4, 9) = 0.1; + spaa(6, 2) = 4.1; + spaa(6, 8) = 4.1; + spaa(7, 5) = 1.0; + spaa(8, 9) = 0.4; + spaa(9, 4) = 0.4; + + double correctResultB[10][10] = + {{ 0.00, 0.00, 0.00, 0.00, 0.06, 0.00, 0.00, 0.00, 0.00, 0.51 }, + { 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00 }, + { 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00 }, + { 0.00, 0.00, 0.00, 0.00, 0.33, 0.44, 0.00, 0.00, 1.32, 0.00 }, + { 0.00, 0.00, 0.00, 0.00, 0.08, 0.00, 0.00, 0.00, 0.00, 0.02 }, + { 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00 }, + { 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 1.64 }, + { 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00 }, + { 0.00, 0.00, 0.00, 0.00, 0.16, 0.00, 0.00, 0.00, 0.00, 0.00 }, + { 0.00, 0.00, 0.00, 0.00, 0.08, 0.00, 0.00, 0.00, 0.00, 0.04 }}; + + SpMat spab = spaa * spaa; + + for (uword i = 0; i < 10; i++) + { + for (uword j = 0; j < 10; j++) + { + REQUIRE( (double) spab(i, j) == Approx(correctResultB[i][j]) ); + } + } + + SpMat spac(15, 15); + spac(6, 10) = 0.4; + spac(5, 9) = 0.3; + spac(5, 13) = 1.2; + spac(8, 5) = 1.1; + spac(8, 6) = 1.1; + spac(8, 7) = 1.1; + spac(9, 9) = 0.2; + spac(9, 14) = 0.1; + spac(11, 7) = 4.1; + spac(11, 13) = 4.1; + spac(12, 10) = 1.0; + spac(13, 14) = 0.4; + spac(14, 9) = 0.4; + + spab = spaa * spac.submat(5, 5, 14, 14); + + for (uword i = 0; i < 10; i++) + { + for (uword j = 0; j < 10; j++) + { + REQUIRE( (double) spab(i, j) == Approx(correctResultB[i][j]) ); + } + } + } + + + +TEST_CASE("spmat_unary_operator_test_2") + { + SpMat a(3, 3); + a(0, 0) = 1; + a(0, 2) = 3.5; + a(1, 2) = 4.0; + a(2, 2) = -3.0; + + mat b(3, 3); + b.fill(3.0); + + mat c = a + b; + + REQUIRE( c(0, 0) == Approx(4.0) ); + REQUIRE( c(1, 0) == Approx(3.0) ); + REQUIRE( c(2, 0) == Approx(3.0) ); + REQUIRE( c(0, 1) == Approx(3.0) ); + REQUIRE( c(1, 1) == Approx(3.0) ); + REQUIRE( c(2, 1) == Approx(3.0) ); + REQUIRE( c(0, 2) == Approx(6.5) ); + REQUIRE( c(1, 2) == Approx(7.0) ); + REQUIRE( c(2, 2) == Approx(1e-5) ); + + c = a - b; + + REQUIRE( c(0, 0) == Approx(-2.0) ); + REQUIRE( c(1, 0) == Approx(-3.0) ); + REQUIRE( c(2, 0) == Approx(-3.0) ); + REQUIRE( c(0, 1) == Approx(-3.0) ); + REQUIRE( c(1, 1) == Approx(-3.0) ); + REQUIRE( c(2, 1) == Approx(-3.0) ); + REQUIRE( c(0, 2) == Approx(0.5) ); + REQUIRE( c(1, 2) == Approx(1.0) ); + REQUIRE( c(2, 2) == Approx(-6.0) ); + + SpMat d = a % b; + + REQUIRE( d.n_nonzero == 4 ); + REQUIRE( (double) d(0, 0) == Approx(3.0) ); + REQUIRE( (double) d(1, 0) == Approx(1e-5) ); + REQUIRE( (double) d(2, 0) == Approx(1e-5) ); + REQUIRE( (double) d(0, 1) == Approx(1e-5) ); + REQUIRE( (double) d(1, 1) == Approx(1e-5) ); + REQUIRE( (double) d(2, 1) == Approx(1e-5) ); + REQUIRE( (double) d(0, 2) == Approx(10.5) ); + REQUIRE( (double) d(1, 2) == Approx(12.0) ); + REQUIRE( (double) d(2, 2) == Approx(-9.0) ); + + d = a / b; + + REQUIRE( d.n_nonzero == 4 ); + REQUIRE( (double) d(0, 0) == Approx((1.0 / 3.0)) ); + REQUIRE( (double) d(1, 0) == Approx(1e-5) ); + REQUIRE( (double) d(2, 0) == Approx(1e-5) ); + REQUIRE( (double) d(0, 1) == Approx(1e-5) ); + REQUIRE( (double) d(1, 1) == Approx(1e-5) ); + REQUIRE( (double) d(2, 1) == Approx(1e-5) ); + REQUIRE( (double) d(0, 2) == Approx((3.5 / 3.0)) ); + REQUIRE( (double) d(1, 2) == Approx((4.0 / 3.0)) ); + REQUIRE( (double) d(2, 2) == Approx(-1.0) ); + + c = a * b; + + REQUIRE( (double) c(0, 0) == Approx(13.5) ); + REQUIRE( (double) c(1, 0) == Approx(12.0) ); + REQUIRE( (double) c(2, 0) == Approx(-9.0) ); + REQUIRE( (double) c(0, 1) == Approx(13.5) ); + REQUIRE( (double) c(1, 1) == Approx(12.0) ); + REQUIRE( (double) c(2, 1) == Approx(-9.0) ); + REQUIRE( (double) c(0, 2) == Approx(13.5) ); + REQUIRE( (double) c(1, 2) == Approx(12.0) ); + REQUIRE( (double) c(2, 2) == Approx(-9.0) ); + + c = b * a; + + REQUIRE( (double) c(0, 0) == Approx(3.0) ); + REQUIRE( (double) c(1, 0) == Approx(3.0) ); + REQUIRE( (double) c(2, 0) == Approx(3.0) ); + REQUIRE( (double) c(0, 1) == Approx(1e-5) ); + REQUIRE( (double) c(1, 1) == Approx(1e-5) ); + REQUIRE( (double) c(2, 1) == Approx(1e-5) ); + REQUIRE( (double) c(0, 2) == Approx(13.5) ); + REQUIRE( (double) c(1, 2) == Approx(13.5) ); + REQUIRE( (double) c(2, 2) == Approx(13.5) ); + } + + + +TEST_CASE("spmat_mat_operator_tests") + { + SpMat a(3, 3); + a(0, 0) = 2.0; + a(1, 2) = 3.5; + a(2, 1) = -2.0; + a(2, 2) = 4.5; + + mat b(3, 3); + b.fill(2.0); + + mat c(b); + + c += a; + + REQUIRE( (double) c(0, 0) == Approx(4.0) ); + REQUIRE( (double) c(1, 0) == Approx(2.0) ); + REQUIRE( (double) c(2, 0) == Approx(2.0) ); + REQUIRE( (double) c(0, 1) == Approx(2.0) ); + REQUIRE( (double) c(1, 1) == Approx(2.0) ); + REQUIRE( (double) c(2, 1) == Approx(1e-5) ); + REQUIRE( (double) c(0, 2) == Approx(2.0) ); + REQUIRE( (double) c(1, 2) == Approx(5.5) ); + REQUIRE( (double) c(2, 2) == Approx(6.5) ); + + c = b + a; + + REQUIRE( (double) c(0, 0) == Approx(4.0) ); + REQUIRE( (double) c(1, 0) == Approx(2.0) ); + REQUIRE( (double) c(2, 0) == Approx(2.0) ); + REQUIRE( (double) c(0, 1) == Approx(2.0) ); + REQUIRE( (double) c(1, 1) == Approx(2.0) ); + REQUIRE( (double) c(2, 1) == Approx(1e-5) ); + REQUIRE( (double) c(0, 2) == Approx(2.0) ); + REQUIRE( (double) c(1, 2) == Approx(5.5) ); + REQUIRE( (double) c(2, 2) == Approx(6.5) ); + + c = b; + c -= a; + + REQUIRE( (double) c(0, 0) == Approx(1e-5) ); + REQUIRE( (double) c(1, 0) == Approx(2.0) ); + REQUIRE( (double) c(2, 0) == Approx(2.0) ); + REQUIRE( (double) c(0, 1) == Approx(2.0) ); + REQUIRE( (double) c(1, 1) == Approx(2.0) ); + REQUIRE( (double) c(2, 1) == Approx(4.0) ); + REQUIRE( (double) c(0, 2) == Approx(2.0) ); + REQUIRE( (double) c(1, 2) == Approx(-1.5) ); + REQUIRE( (double) c(2, 2) == Approx(-2.5) ); + + c = b - a; + + REQUIRE( (double) c(0, 0) == Approx(1e-5) ); + REQUIRE( (double) c(1, 0) == Approx(2.0) ); + REQUIRE( (double) c(2, 0) == Approx(2.0) ); + REQUIRE( (double) c(0, 1) == Approx(2.0) ); + REQUIRE( (double) c(1, 1) == Approx(2.0) ); + REQUIRE( (double) c(2, 1) == Approx(4.0) ); + REQUIRE( (double) c(0, 2) == Approx(2.0) ); + REQUIRE( (double) c(1, 2) == Approx(-1.5) ); + REQUIRE( (double) c(2, 2) == Approx(-2.5) ); + + c = b; + c *= a; + + REQUIRE( (double) c(0, 0) == Approx(4.0) ); + REQUIRE( (double) c(1, 0) == Approx(4.0) ); + REQUIRE( (double) c(2, 0) == Approx(4.0) ); + REQUIRE( (double) c(0, 1) == Approx(-4.0) ); + REQUIRE( (double) c(1, 1) == Approx(-4.0) ); + REQUIRE( (double) c(2, 1) == Approx(-4.0) ); + REQUIRE( (double) c(0, 2) == Approx(16.0) ); + REQUIRE( (double) c(1, 2) == Approx(16.0) ); + REQUIRE( (double) c(2, 2) == Approx(16.0) ); + + mat e = b * a; + + REQUIRE( (double) e(0, 0) == Approx(4.0) ); + REQUIRE( (double) e(1, 0) == Approx(4.0) ); + REQUIRE( (double) e(2, 0) == Approx(4.0) ); + REQUIRE( (double) e(0, 1) == Approx(-4.0) ); + REQUIRE( (double) e(1, 1) == Approx(-4.0) ); + REQUIRE( (double) e(2, 1) == Approx(-4.0) ); + REQUIRE( (double) e(0, 2) == Approx(16.0) ); + REQUIRE( (double) e(1, 2) == Approx(16.0) ); + REQUIRE( (double) e(2, 2) == Approx(16.0) ); + + c = b; + c %= a; + + REQUIRE( (double) c(0, 0) == Approx(4.0) ); + REQUIRE( (double) c(1, 0) == Approx(1e-5) ); + REQUIRE( (double) c(2, 0) == Approx(1e-5) ); + REQUIRE( (double) c(0, 1) == Approx(1e-5) ); + REQUIRE( (double) c(1, 1) == Approx(1e-5) ); + REQUIRE( (double) c(2, 1) == Approx(-4.0) ); + REQUIRE( (double) c(0, 2) == Approx(1e-5) ); + REQUIRE( (double) c(1, 2) == Approx(7.0) ); + REQUIRE( (double) c(2, 2) == Approx(9.0) ); + + SpMat d = b % a; + + REQUIRE( d.n_nonzero == 4 ); + REQUIRE( (double) c(0, 0) == Approx(4.0) ); + REQUIRE( (double) c(2, 1) == Approx(-4.0) ); + REQUIRE( (double) c(1, 2) == Approx(7.0) ); + REQUIRE( (double) c(2, 2) == Approx(9.0) ); + + c = b; + c /= a; + + REQUIRE( c(0, 0) == Approx(1.0) ); + REQUIRE( std::isinf(c(1, 0)) ); + REQUIRE( std::isinf(c(2, 0)) ); + REQUIRE( std::isinf(c(0, 1)) ); + REQUIRE( std::isinf(c(1, 1)) ); + REQUIRE( c(2, 1) == Approx(-1.0) ); + REQUIRE( std::isinf(c(0, 2)) ); + REQUIRE( c(1, 2) == Approx(2.0 / 3.5) ); + REQUIRE( c(2, 2) == Approx(2.0 / 4.5) ); + } + + +TEST_CASE("spmat_empty_hadamard") + { + SpMat x(5, 5), y(5, 5), z; + + z = x % y; + + REQUIRE( z.n_nonzero == 0 ); + REQUIRE( z.n_rows == 5 ); + REQUIRE( z.n_cols == 5 ); + } + + + +TEST_CASE("spmat_sparse_dense_in_place") + { + SpMat a; + a.sprandu(50, 50, 0.1); + mat b; + b.randu(50, 50); + mat d( a); + + for (uword c = 0; c < 50; ++c) + { + for (uword r = 0; r < 50; ++r) + { + if ((double) a(r, c) != 0) + REQUIRE( (double) a(r, c) == Approx(d(r, c)) ); + else + REQUIRE( d(r, c) == Approx(1e-5) ); + } + } + + SpMat x; + mat y; + + x = a; + y = d; + + x *= b; + y *= b; + + for (uword c = 0; c < 50; ++c) + { + for (uword r = 0; r < 50; ++r) + { + if ((double) a(r, c) != 0) + REQUIRE( (double) a(r, c) == Approx(d(r, c)) ); + else + REQUIRE( d(r, c) == Approx(1e-5) ); + } + } + + x = a; + y = d; + + x /= b; + y /= b; + + for (uword c = 0; c < 50; ++c) + { + for (uword r = 0; r < 50; ++r) + { + if ((double) a(r, c) != 0) + REQUIRE( (double) a(r, c) == Approx(d(r, c)) ); + else + REQUIRE( d(r, c) == Approx(1e-5) ); + } + } + + x = a; + y = d; + + x %= b; + y %= b; + + for (uword c = 0; c < 50; ++c) + { + for (uword r = 0; r < 50; ++r) + { + if ((double) a(r, c) != 0) + REQUIRE( (double) a(r, c) == Approx(d(r, c)) ); + else + REQUIRE(d(r, c) == Approx(1e-5) ); + } + } + } + + + +TEST_CASE("spmat_sparse_dense_not_in_place") + { + SpMat a; + a.sprandu(50, 50, 0.1); + mat b; + b.randu(50, 50); + mat d(a); + + SpMat x; + mat y; + mat z; + + y = a + b; + z = d + b; + + for (uword c = 0; c < 50; ++c) + { + for(uword r = 0; r < 50; ++r) + { + if ((double) y(r, c) != 0) + REQUIRE( (double) y(r, c) == Approx(z(r, c)) ); + else + REQUIRE( z(r, c) == Approx(1e-5) ); + } + } + + y = a - b; + z = d - b; + + for (uword c = 0; c < 50; ++c) + { + for (uword r = 0; r < 50; ++r) + { + if ((double) y(r, c) != 0) + REQUIRE( (double) y(r, c) == Approx(z(r, c)) ); + else + REQUIRE( z(r, c) == Approx(1e-5) ); + } + } + + y = a * b; + z = d * b; + + for (uword c = 0; c < 50; ++c) + { + for (uword r = 0; r < 50; ++r) + { + if ((double) y(r, c) != 0) + REQUIRE( (double) y(r, c) == Approx(z(r, c)) ); + else + REQUIRE( z(r, c) == Approx(1e-5) ); + } + } + + y = a % b; + z = d % b; + + for (uword c = 0; c < 50; ++c) + { + for (uword r = 0; r < 50; ++r) + { + if ((double) y(r, c) != 0) + REQUIRE( (double) y(r, c) == Approx(z(r, c)) ); + else + REQUIRE( z(r, c) == Approx(1e-5) ); + } + } + + y = a / b; + z = d / b; + + for (uword c = 0; c < 50; ++c) + { + for (uword r = 0; r < 50; ++r) + { + if ((double) y(r, c) != 0) + REQUIRE( (double) y(r, c) == Approx(z(r, c)) ); + else + REQUIRE( z(r, c) == Approx(1e-5) ); + } + } + + y = b + a; + z = b + d; + + for (uword c = 0; c < 50; ++c) + { + for (uword r = 0; r < 50; ++r) + { + if ((double) y(r, c) != 0) + REQUIRE( (double) y(r, c) == Approx(z(r, c)) ); + else + REQUIRE( z(r, c) == Approx(1e-5) ); + } + } + + y = b - a; + z = b - d; + + for (uword c = 0; c < 50; ++c) + { + for (uword r = 0; r < 50; ++r) + { + if ((double) y(r, c) != 0) + REQUIRE( (double) y(r, c) == Approx(z(r, c)) ); + else + REQUIRE( z(r, c) == Approx(1e-5) ); + } + } + + y = b * a; + z = b * d; + + for (uword c = 0; c < 50; ++c) + { + for (uword r = 0; r < 50; ++r) + { + if ((double) y(r, c) != 0) + REQUIRE( (double) y(r, c) == Approx(z(r, c)) ); + else + REQUIRE( z(r, c) == Approx(1e-5) ); + } + } + + y = b % a; + z = b % d; + + for (uword c = 0; c < 50; ++c) + { + for (uword r = 0; r < 50; ++r) + { + if ((double) y(r, c) != 0) + REQUIRE( (double) y(r, c) == Approx(z(r, c)) ); + else + REQUIRE( z(r, c) == Approx(1e-5) ); + } + } + } + + + +TEST_CASE("spmat_batch_insert_test") + { + Mat locations(2, 5); + locations(1, 0) = 1; + locations(0, 0) = 2; + locations(1, 1) = 1; + locations(0, 1) = 7; + locations(1, 2) = 4; + locations(0, 2) = 0; + locations(1, 3) = 4; + locations(0, 3) = 9; + locations(1, 4) = 5; + locations(0, 4) = 0; + + Col values(5); + values[0] = 1.5; + values[1] = -15.15; + values[2] = 2.2; + values[3] = 3.0; + values[4] = 5.0; + + SpMat m(locations, values, 10, 10, true); + + REQUIRE( m.n_nonzero == 5 ); + REQUIRE( m.n_rows == 10 ); + REQUIRE( m.n_cols == 10 ); + REQUIRE( (double) m(2, 1) == Approx(1.5) ); + REQUIRE( (double) m(7, 1) == Approx(-15.15) ); + REQUIRE( (double) m(0, 4) == Approx(2.2) ); + REQUIRE( (double) m(9, 4) == Approx(3.0) ); + REQUIRE( (double) m(0, 5) == Approx(5.0) ); + REQUIRE( m.col_ptrs[11] == std::numeric_limits::max() ); + + // Auto size detection. + SpMat n(locations, values, true); + + REQUIRE( n.n_nonzero == 5 ); + REQUIRE( n.n_rows == 10 ); + REQUIRE( n.n_cols == 6 ); + REQUIRE( (double) n(2, 1) == Approx(1.5) ); + REQUIRE( (double) n(7, 1) == Approx(-15.15) ); + REQUIRE( (double) n(0, 4) == Approx(2.2) ); + REQUIRE( (double) n(9, 4) == Approx(3.0) ); + REQUIRE( (double) n(0, 5) == Approx(5.0) ); + REQUIRE( n.col_ptrs[7] == std::numeric_limits::max() ); + } + + + +TEST_CASE("spmat_batch_insert_unsorted_test") + { + Mat locations(2, 5); + locations(1, 0) = 4; + locations(0, 0) = 0; + locations(1, 1) = 1; + locations(0, 1) = 2; + locations(1, 2) = 4; + locations(0, 2) = 9; + locations(1, 3) = 5; + locations(0, 3) = 0; + locations(1, 4) = 1; + locations(0, 4) = 7; + + Col values(5); + values[1] = 1.5; + values[4] = -15.15; + values[0] = 2.2; + values[2] = 3.0; + values[3] = 5.0; + + SpMat m(locations, values, 10, 10, true); + + REQUIRE( m.n_nonzero == 5 ); + REQUIRE( m.n_rows == 10 ); + REQUIRE( m.n_cols == 10 ); + REQUIRE( (double) m(2, 1) == Approx(1.5) ); + REQUIRE( (double) m(7, 1) == Approx(-15.15) ); + REQUIRE( (double) m(0, 4) == Approx(2.2) ); + REQUIRE( (double) m(9, 4) == Approx(3.0) ); + REQUIRE( (double) m(0, 5) == Approx(5.0) ); + + // Auto size detection. + SpMat n(locations, values, true); + + REQUIRE( n.n_nonzero == 5 ); + REQUIRE( n.n_rows == 10 ); + REQUIRE( n.n_cols == 6 ); + REQUIRE( (double) n(2, 1) == Approx(1.5) ); + REQUIRE( (double) n(7, 1) == Approx(-15.15) ); + REQUIRE( (double) n(0, 4) == Approx(2.2) ); + REQUIRE( (double) n(9, 4) == Approx(3.0) ); + REQUIRE( (double) n(0, 5) == Approx(5.0) ); + } + + + +TEST_CASE("spmat_batch_insert_empty_test") + { + Mat locations(2, 0); + Col values; + + SpMat m(locations, values, 10, 10, false); + + REQUIRE( m.n_nonzero == 0 ); + REQUIRE( m.n_rows == 10 ); + REQUIRE( m.n_cols == 10 ); + REQUIRE( m.col_ptrs[11] == std::numeric_limits::max() ); + + SpMat n(locations, values, false); + + REQUIRE( n.n_nonzero == 0 ); + REQUIRE( n.n_rows == 0 ); + REQUIRE( n.n_cols == 0 ); + REQUIRE( n.col_ptrs[1] == std::numeric_limits::max() ); + + SpMat o(locations, values, 10, 10, true); + + REQUIRE( o.n_nonzero == 0 ); + REQUIRE( o.n_rows == 10 ); + REQUIRE( o.n_cols == 10 ); + REQUIRE( o.col_ptrs[11] == std::numeric_limits::max() ); + + SpMat p(locations, values, true); + + REQUIRE( p.n_nonzero == 0 ); + REQUIRE( p.n_rows == 0 ); + REQUIRE( p.n_cols == 0 ); + REQUIRE( p.col_ptrs[1] == std::numeric_limits::max() ); + } + + +// Make sure a matrix is the same as the other one. +template +void CheckMatrices(const T1& a, const T2& b) +{ + REQUIRE( a.n_rows == b.n_rows ); + REQUIRE( a.n_cols == b.n_cols ); + for (uword i = 0; i < a.n_elem; ++i) + REQUIRE( (double) a[i] == Approx((double) b[i]) ); +} + +// Test the constructor written by Dirk. +TEST_CASE("spmat_dirk_constructor_test") + { + // Come up with some values and stuff. + vec values = "4.0 2.0 1.0 3.2 1.2 3.5"; + Col row_indices = "1 3 1 2 4 5"; + Col col_ptrs = "0 2 2 3 4 6"; + + // Ok, now make a matrix. + sp_mat M(row_indices, col_ptrs, values, 6, 5); + + // Make the equivalent dense matrix. + mat D(6, 5); + D.fill(0); + D(1, 0) = 4.0; + D(3, 0) = 2.0; + D(1, 2) = 1.0; + D(2, 3) = 3.2; + D(4, 4) = 1.2; + D(5, 4) = 3.5; + + // So now let's just do a bunch of operations and make sure everything is the + // same. + sp_mat dm = M * M.t(); + mat dd = D * D.t(); + + CheckMatrices(dm, dd); + + dm = M.t() * M; + dd = D.t() * D; + + CheckMatrices(dm, dd); + + sp_mat am = M + M; + mat ad = D + D; + + CheckMatrices(am, ad); + + dm = M + D; + ad = D + M; + + CheckMatrices(dm, ad); + } + + + +TEST_CASE("spmat_clear_test") + { + sp_mat x; + x.sprandu(10, 10, 0.6); + + x.clear(); + + REQUIRE( x.n_cols == 0 ); + REQUIRE( x.n_rows == 0 ); + REQUIRE( x.n_nonzero == 0 ); + } + + + +TEST_CASE("spmat_batch_insert_zeroes_test") + { + Mat locations(2, 5); + locations(1, 0) = 1; + locations(0, 0) = 2; + locations(1, 1) = 1; + locations(0, 1) = 7; + locations(1, 2) = 4; + locations(0, 2) = 0; + locations(1, 3) = 4; + locations(0, 3) = 9; + locations(1, 4) = 5; + locations(0, 4) = 0; + + Col values(5); + values[0] = 1.5; + values[1] = -15.15; + values[2] = 2.2; + values[3] = 0.0; + values[4] = 5.0; + + SpMat m(locations, values, 10, 10, false, true); + + REQUIRE( m.n_nonzero == 4 ); + REQUIRE( m.n_rows == 10 ); + REQUIRE( m.n_cols == 10 ); + REQUIRE( (double) m(2, 1) == Approx(1.5) ); + REQUIRE( (double) m(7, 1) == Approx(-15.15) ); + REQUIRE( (double) m(0, 4) == Approx(2.2) ); + REQUIRE( (double) m(9, 4) == Approx(1e-5) ); + REQUIRE( (double) m(0, 5) == Approx(5.0) ); + + // Auto size detection. + SpMat n(locations, values, false); + + REQUIRE( n.n_nonzero == 4 ); + REQUIRE( n.n_rows == 10 ); + REQUIRE( n.n_cols == 6 ); + REQUIRE( (double) n(2, 1) == Approx(1.5) ); + REQUIRE( (double) n(7, 1) == Approx(-15.15) ); + REQUIRE( (double) n(0, 4) == Approx(2.2) ); + REQUIRE( (double) n(9, 4) == Approx(1e-5) ); + REQUIRE( (double) n(0, 5) == Approx(5.0) ); + } + + + +TEST_CASE("spmat_batch_insert_unsorted_case_zeroes") + { + Mat locations(2, 5); + locations(1, 0) = 4; + locations(0, 0) = 0; + locations(1, 1) = 1; + locations(0, 1) = 2; + locations(1, 2) = 4; + locations(0, 2) = 9; + locations(1, 3) = 5; + locations(0, 3) = 0; + locations(1, 4) = 1; + locations(0, 4) = 7; + + Col values(5); + values[1] = 1.5; + values[4] = -15.15; + values[0] = 2.2; + values[2] = 0.0; + values[3] = 5.0; + + SpMat m(locations, values, 10, 10, true); + + REQUIRE( m.n_nonzero == 4 ); + REQUIRE( m.n_rows == 10 ); + REQUIRE( m.n_cols == 10 ); + REQUIRE( (double) m(2, 1) == Approx(1.5) ); + REQUIRE( (double) m(7, 1) == Approx(-15.15) ); + REQUIRE( (double) m(0, 4) == Approx(2.2) ); + REQUIRE( (double) m(9, 4) == Approx(1e-5) ); + REQUIRE( (double) m(0, 5) == Approx(5.0) ); + REQUIRE( m.col_ptrs[11] == std::numeric_limits::max() ); + + // Auto size detection. + SpMat n(locations, values, true); + + REQUIRE( n.n_nonzero == 4 ); + REQUIRE( n.n_rows == 10 ); + REQUIRE( n.n_cols == 6 ); + REQUIRE( (double) n(2, 1) == Approx(1.5) ); + REQUIRE( (double) n(7, 1) == Approx(-15.15) ); + REQUIRE( (double) n(0, 4) == Approx(2.2) ); + REQUIRE( (double) n(9, 4) == Approx(1e-5) ); + REQUIRE( (double) n(0, 5) == Approx(5.0) ); + REQUIRE( n.col_ptrs[7] == std::numeric_limits::max() ); + } + + + +TEST_CASE("spmat_const_row_col_iterator_test") + { + mat X; + X.zeros(5, 5); + for (uword i = 0; i < 5; ++i) + { + X.col(i) += i; + } + + for (uword i = 0; i < 5; ++i) + { + X.row(i) += 3 * i; + } + + // Make sure default constructor works okay. + mat::const_row_col_iterator it; + // Make sure ++ operator, operator* and comparison operators work fine. + size_t count = 0; + for (it = X.begin_row_col(); it != X.end_row_col(); it++) + { + // Check iterator value. + REQUIRE( *it == (count % 5) * 3 + (count / 5) ); + + // Check iterator position. + REQUIRE( it.row() == count % 5 ); + REQUIRE( it.col() == count / 5 ); + + count++; + } + REQUIRE( count == 25 ); + it = X.end_row_col(); + do + { + it--; + count--; + + // Check iterator value. + REQUIRE( *it == (count % 5) * 3 + (count / 5) ); + + // Check iterator position. + REQUIRE( it.row() == count % 5 ); + REQUIRE( it.col() == count / 5 ); + } while (it != X.begin_row_col()); + + REQUIRE( count == 0 ); + } + + + +TEST_CASE("spmat_row_col_iterator_test") + { + mat X; + X.zeros(5, 5); + for (size_t i = 0; i < 5; ++i) + { + X.col(i) += i; + } + + for (size_t i = 0; i < 5; ++i) + { + X.row(i) += 3 * i; + } + + // Make sure default constructor works okay. + mat::row_col_iterator it; + // Make sure ++ operator, operator* and comparison operators work fine. + size_t count = 0; + for (it = X.begin_row_col(); it != X.end_row_col(); it++) + { + // Check iterator value. + REQUIRE( *it == (count % 5) * 3 + (count / 5) ); + + // Check iterator position. + REQUIRE( it.row() == count % 5 ); + REQUIRE( it.col() == count / 5 ); + + count++; + } + REQUIRE( count == 25 ); + it = X.end_row_col(); + do + { + it--; + count--; + + // Check iterator value. + REQUIRE( *it == (count % 5) * 3 + (count / 5) ); + + // Check iterator position. + REQUIRE( it.row() == count % 5 ); + REQUIRE( it.col() == count / 5 ); + } while (it != X.begin_row_col()); + + REQUIRE( count == 0 ); + } + + + +TEST_CASE("spmat_const_sprow_col_iterator_test") + { + sp_mat X(5, 5); + for (size_t i = 0; i < 5; ++i) + { + X.col(i) += i; + } + + for (size_t i = 0; i < 5; ++i) + { + X.row(i) += 3 * i; + } + + // Make sure default constructor works okay. + sp_mat::const_row_col_iterator it; + // Make sure ++ operator, operator* and comparison operators work fine. + size_t count = 1; + for (it = X.begin_row_col(); it != X.end_row_col(); it++) + { + // Check iterator value. + REQUIRE( *it == (count % 5) * 3 + (count / 5) ); + + // Check iterator position. + REQUIRE( it.row() == count % 5 ); + REQUIRE( it.col() == count / 5 ); + + count++; + } + REQUIRE( count == 25 ); + it = X.end_row_col(); + do + { + it--; + count--; + + // Check iterator value. + REQUIRE( *it == (count % 5) * 3 + (count / 5) ); + + // Check iterator position. + REQUIRE( it.row() == count % 5 ); + REQUIRE( it.col() == count / 5 ); + } while (it != X.begin_row_col()); + + REQUIRE( count == 1 ); + } + + + +TEST_CASE("spmat_sprow_col_iterator_test") + { + sp_mat X(5, 5); + for (size_t i = 0; i < 5; ++i) + { + X.col(i) += i; + } + + for (size_t i = 0; i < 5; ++i) + { + X.row(i) += 3 * i; + } + + // Make sure default constructor works okay. + sp_mat::row_col_iterator it; + // Make sure ++ operator, operator* and comparison operators work fine. + size_t count = 1; + for (it = X.begin_row_col(); it != X.end_row_col(); it++) + { + // Check iterator value. + REQUIRE( *it == (count % 5) * 3 + (count / 5) ); + + // Check iterator position. + REQUIRE( it.row() == count % 5 ); + REQUIRE( it.col() == count / 5 ); + + count++; + } + REQUIRE( count == 25 ); + it = X.end_row_col(); + do + { + it--; + count--; + + // Check iterator value. + REQUIRE( *it == (count % 5) * 3 + (count / 5) ); + + // Check iterator position. + REQUIRE( it.row() == count % 5 ); + REQUIRE( it.col() == count / 5 ); + } while (it != X.begin_row_col()); + + REQUIRE( count == 1 ); + } diff -Nru armadillo-7.600.2+dfsg/tests/sprow.cpp armadillo-7.950.1+dfsg/tests/sprow.cpp --- armadillo-7.600.2+dfsg/tests/sprow.cpp 1970-01-01 00:00:00.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/sprow.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -0,0 +1,61 @@ +// Copyright 2011-2017 Ryan Curtin (http://www.ratml.org/) +// Copyright 2017 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + +#include + +#include "catch.hpp" + +using namespace arma; + +TEST_CASE("sprow_shed_col_test") + { + + SpRow d(10); + d[3] = 2; + d[4] = 6; + d[6] = 2; + d[7] = 9; + d[8] = 1; + d[9] = -2; + + d.shed_cols(4, 7); + REQUIRE( d.n_cols == 6 ); + REQUIRE( d.n_rows == 1 ); + REQUIRE( d.n_elem == 6 ); + REQUIRE( d.n_nonzero == 3 ); + REQUIRE( d[0] == 0 ); + REQUIRE( d[1] == 0 ); + REQUIRE( d[2] == 0 ); + REQUIRE( d[3] == 2 ); + REQUIRE( d[4] == 1 ); + REQUIRE( d[5] == -2 ); + } + + + +TEST_CASE("sprow_row_constructor_test") + { + SpMat m(100, 100); + m.sprandu(100, 100, 0.3); + + SpRow r = m.row(0); + + rowvec v(r); + + for (uword i = 0; i < 100; ++i) + { + REQUIRE( v(i) == (double) r(i) ); + } + } diff -Nru armadillo-7.600.2+dfsg/tests/spsubview.cpp armadillo-7.950.1+dfsg/tests/spsubview.cpp --- armadillo-7.600.2+dfsg/tests/spsubview.cpp 1970-01-01 00:00:00.000000000 +0000 +++ armadillo-7.950.1+dfsg/tests/spsubview.cpp 2016-06-16 16:16:31.000000000 +0000 @@ -0,0 +1,1449 @@ +// Copyright 2011-2017 Ryan Curtin (http://www.ratml.org/) +// Copyright 2017 National ICT Australia (NICTA) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ------------------------------------------------------------------------ + +#include + +#include "catch.hpp" + +using namespace arma; + +TEST_CASE("sp_subview_tests") + { + Mat ref(4,4); + ref.eye(4,4); + + SpMat X(4,4); + X.eye(4,4); + + /* + * [[1,0,0,0] [[2,0,0,0] + * [0,1,0,0] -> [0,2,0,0] + * [0,0,1,0] [0,0,2,0] + * [0,0,0,1]] [0,0,0,1]] + */ + ref.submat(0, 0, 2, 2) *= 2; + X.submat(0, 0, 2, 2) *= 2; + + for (uword i = 0; i < 4; i++) + { + for (uword j = 0; j < 4; j++) + { + REQUIRE( (double) ref(i, j) == Approx((double) X(i, j)) ); + } + } + + /* + * [[2,0,0,0] [[2,0,0,0] + * [0,2,0,0] -> [0,1,0,0] + * [0,0,2,0] [0,0,1,0] + * [0,0,0,1]] [0,0,0,.5]] + */ + ref.submat(1, 1, 3, 3) /= 2; + X.submat(1, 1, 3, 3) /= 2; + + for (uword i = 0; i < 4; i++) + { + for (uword j = 0; j < 4; j++) + { + REQUIRE( (double) ref(i, j) == Approx((double) X(i, j)) ); + } + } + + span s(1, 2); + ref.submat(s, s) += 10; + X.submat(s, s) += 10; + + for (uword i = 0; i < 4; i++) + { + for (uword j = 0; j < 4; j++) + { + REQUIRE( (double) ref(i, j) == Approx((double) X(i, j)) ); + } + } + } + + + +TEST_CASE("sp_subview_const_test") + { + Mat ref(4, 4); + ref.eye(4, 4); + + SpMat X(4, 4); + X.eye(4, 4); + + const SpSubview subX = X.submat(span(0, 2), span::all); +/* + X.print("x"); + for (size_t i = 0; i < 3; ++i) + { + for (size_t j = 0; j < 4; ++j) + { + printf("%f ", subX(i, j)); + } + printf("\n"); + } +*/ + } + + + +TEST_CASE("sp_subview_multiplication_test") + { + // Ensure matrix multiplication with subviews works correctly. + SpMat a(2, 5); + SpMat b(5, 2); + + a(1, 3) = 1; + a(0, 0) = 2; + a(1, 2) = 1.5; + + b(4, 1) = 3; + b(3, 0) = 2; + b(1, 0) = 1; + b(0, 0) = 0.6; + + b *= a; + + REQUIRE( b.n_cols == 5 ); + REQUIRE( b.n_rows == 5 ); + REQUIRE( b.n_elem == 25 ); + REQUIRE( b.n_nonzero == 5 ); + + REQUIRE( (double) b(0, 0) == Approx(1.2) ); + REQUIRE( (double) b(0, 1) == Approx(1e-5) ); + REQUIRE( (double) b(0, 2) == Approx(1e-5) ); + REQUIRE( (double) b(0, 3) == Approx(1e-5) ); + REQUIRE( (double) b(0, 4) == Approx(1e-5) ); + REQUIRE( (double) b(1, 0) == Approx(2.0) ); + REQUIRE( (double) b(1, 1) == Approx(1e-5) ); + REQUIRE( (double) b(1, 2) == Approx(1e-5) ); + REQUIRE( (double) b(1, 3) == Approx(1e-5) ); + REQUIRE( (double) b(1, 4) == Approx(1e-5) ); + REQUIRE( (double) b(2, 0) == Approx(1e-5) ); + REQUIRE( (double) b(2, 1) == Approx(1e-5) ); + REQUIRE( (double) b(2, 2) == Approx(1e-5) ); + REQUIRE( (double) b(2, 3) == Approx(1e-5) ); + REQUIRE( (double) b(2, 4) == Approx(1e-5) ); + REQUIRE( (double) b(3, 0) == Approx(4.0) ); + REQUIRE( (double) b(3, 1) == Approx(1e-5) ); + REQUIRE( (double) b(3, 2) == Approx(1e-5) ); + REQUIRE( (double) b(3, 3) == Approx(1e-5) ); + REQUIRE( (double) b(3, 4) == Approx(1e-5) ); + REQUIRE( (double) b(4, 0) == Approx(1e-5) ); + REQUIRE( (double) b(4, 1) == Approx(1e-5) ); + REQUIRE( (double) b(4, 2) == Approx(4.5) ); + REQUIRE( (double) b(4, 3) == Approx(3.0) ); + REQUIRE( (double) b(4, 4) == Approx(1e-5) ); + } + + + +TEST_CASE("sp_subview_multiplication_test_2") + { + // Ensure matrix multiplication with subviews works correctly. + SpMat a(4, 5); + SpMat b(5, 2); + + a(2, 3) = 1; + a(3, 1) = 1.4; + a(0, 0) = 2; + a(1, 0) = 2; + a(2, 2) = 1.5; + + b(4, 1) = 3; + b(3, 0) = 2; + b(1, 0) = 1; + b(0, 0) = 0.6; + + b *= a.rows(1, 2); + + REQUIRE( b.n_cols == 5 ); + REQUIRE( b.n_rows == 5 ); + REQUIRE( b.n_elem == 25 ); + REQUIRE( b.n_nonzero == 5 ); + + REQUIRE( (double) b(0, 0) == Approx(1.2) ); + REQUIRE( (double) b(0, 1) == Approx(1e-5) ); + REQUIRE( (double) b(0, 2) == Approx(1e-5) ); + REQUIRE( (double) b(0, 3) == Approx(1e-5) ); + REQUIRE( (double) b(0, 4) == Approx(1e-5) ); + REQUIRE( (double) b(1, 0) == Approx(2.0) ); + REQUIRE( (double) b(1, 1) == Approx(1e-5) ); + REQUIRE( (double) b(1, 2) == Approx(1e-5) ); + REQUIRE( (double) b(1, 3) == Approx(1e-5) ); + REQUIRE( (double) b(1, 4) == Approx(1e-5) ); + REQUIRE( (double) b(2, 0) == Approx(1e-5) ); + REQUIRE( (double) b(2, 1) == Approx(1e-5) ); + REQUIRE( (double) b(2, 2) == Approx(1e-5) ); + REQUIRE( (double) b(2, 3) == Approx(1e-5) ); + REQUIRE( (double) b(2, 4) == Approx(1e-5) ); + REQUIRE( (double) b(3, 0) == Approx(4.0) ); + REQUIRE( (double) b(3, 1) == Approx(1e-5) ); + REQUIRE( (double) b(3, 2) == Approx(1e-5) ); + REQUIRE( (double) b(3, 3) == Approx(1e-5) ); + REQUIRE( (double) b(3, 4) == Approx(1e-5) ); + REQUIRE( (double) b(4, 0) == Approx(1e-5) ); + REQUIRE( (double) b(4, 1) == Approx(1e-5) ); + REQUIRE( (double) b(4, 2) == Approx(4.5) ); + REQUIRE( (double) b(4, 3) == Approx(3.0) ); + REQUIRE( (double) b(4, 4) == Approx(1e-5) ); + } + + + +TEST_CASE("sp_subview_unary_operators_test") + { + SpMat a(3, 3); + SpMat b(5, 5); + + a(0, 0) = 1; + a(1, 2) = 4; + a(2, 2) = 5; + + b(2, 3) = 1; + b(3, 2) = 2; + b(3, 4) = -4; + b(4, 4) = 5; + + SpMat c = a + b.submat(2, 2, 4, 4); + + REQUIRE( c.n_nonzero == 4 ); + + REQUIRE( (double) c(0, 0) == 1 ); + REQUIRE( (double) c(1, 0) == 2 ); + REQUIRE( (double) c(2, 0) == 0 ); + REQUIRE( (double) c(0, 1) == 1 ); + REQUIRE( (double) c(1, 1) == 0 ); + REQUIRE( (double) c(2, 1) == 0 ); + REQUIRE( (double) c(0, 2) == 0 ); + REQUIRE( (double) c(1, 2) == 0 ); + REQUIRE( (double) c(2, 2) == 10 ); + + c = a - b.submat(2, 2, 4, 4); + + REQUIRE( c.n_nonzero == 4 ); + + REQUIRE( (double) c(0, 0) == 1 ); + REQUIRE( (double) c(1, 0) == -2 ); + REQUIRE( (double) c(2, 0) == 0 ); + REQUIRE( (double) c(0, 1) == -1 ); + REQUIRE( (double) c(1, 1) == 0 ); + REQUIRE( (double) c(2, 1) == 0 ); + REQUIRE( (double) c(0, 2) == 0 ); + REQUIRE( (double) c(1, 2) == 8 ); + REQUIRE( (double) c(2, 2) == 0 ); + + c = a % b.submat(2, 2, 4, 4); + + REQUIRE( c.n_nonzero == 2 ); + + REQUIRE( (double) c(0, 0) == 0 ); + REQUIRE( (double) c(1, 0) == 0 ); + REQUIRE( (double) c(2, 0) == 0 ); + REQUIRE( (double) c(0, 1) == 0 ); + REQUIRE( (double) c(1, 1) == 0 ); + REQUIRE( (double) c(2, 1) == 0 ); + REQUIRE( (double) c(0, 2) == 0 ); + REQUIRE( (double) c(1, 2) == -16 ); + REQUIRE( (double) c(2, 2) == 25 ); + + a(0, 0) = 4; + b(2, 2) = 2; +/* + c = a / b.submat(2, 2, 4, 4); + + REQUIRE( c.n_nonzero == 3 ); + + REQUIRE( (double) c(0, 0) == 2 ); + REQUIRE( (double) c(1, 0) == 0 ); + REQUIRE( (double) c(2, 0) == 0 ); + REQUIRE( (double) c(0, 1) == 0 ); + REQUIRE( (double) c(1, 1) == 0 ); + REQUIRE( (double) c(2, 1) == 0 ); + REQUIRE( (double) c(0, 2) == 0 ); + REQUIRE( (double) c(1, 2) == -1 ); + REQUIRE( (double) c(2, 2) == 1 ); +*/ + } + + +TEST_CASE("sp_subview_mat_operator_tests") + { + SpMat a(6, 10); + a(2, 2) = 2.0; + a(3, 4) = 3.5; + a(4, 3) = -2.0; + a(4, 4) = 4.5; + a(5, 1) = 3.2; + a(0, 1) = 1.3; + a(1, 1) = -4.0; + a(5, 3) = 5.3; + + mat b(3, 3); + b.fill(2.0); + + mat c(b); + + c += a.submat(2, 2, 4, 4); + + REQUIRE( (double) c(0, 0) == Approx(4.0) ); + REQUIRE( (double) c(1, 0) == Approx(2.0) ); + REQUIRE( (double) c(2, 0) == Approx(2.0) ); + REQUIRE( (double) c(0, 1) == Approx(2.0) ); + REQUIRE( (double) c(1, 1) == Approx(2.0) ); + REQUIRE( (double) c(2, 1) == Approx(1e-5) ); + REQUIRE( (double) c(0, 2) == Approx(2.0) ); + REQUIRE( (double) c(1, 2) == Approx(5.5) ); + REQUIRE( (double) c(2, 2) == Approx(6.5) ); + + c = b + a.submat(2, 2, 4, 4); + + REQUIRE( (double) c(0, 0) == Approx(4.0) ); + REQUIRE( (double) c(1, 0) == Approx(2.0) ); + REQUIRE( (double) c(2, 0) == Approx(2.0) ); + REQUIRE( (double) c(0, 1) == Approx(2.0) ); + REQUIRE( (double) c(1, 1) == Approx(2.0) ); + REQUIRE( (double) c(2, 1) == Approx(1e-5) ); + REQUIRE( (double) c(0, 2) == Approx(2.0) ); + REQUIRE( (double) c(1, 2) == Approx(5.5) ); + REQUIRE( (double) c(2, 2) == Approx(6.5) ); + + c = b; + c -= a.submat(2, 2, 4, 4); + + REQUIRE( (double) c(0, 0) == Approx(1e-5) ); + REQUIRE( (double) c(1, 0) == Approx(2.0) ); + REQUIRE( (double) c(2, 0) == Approx(2.0) ); + REQUIRE( (double) c(0, 1) == Approx(2.0) ); + REQUIRE( (double) c(1, 1) == Approx(2.0) ); + REQUIRE( (double) c(2, 1) == Approx(4.0) ); + REQUIRE( (double) c(0, 2) == Approx(2.0) ); + REQUIRE( (double) c(1, 2) == Approx(-1.5) ); + REQUIRE( (double) c(2, 2) == Approx(-2.5) ); + + c = b - a.submat(2, 2, 4, 4); + + REQUIRE( (double) c(0, 0) == Approx(1e-5) ); + REQUIRE( (double) c(1, 0) == Approx(2.0) ); + REQUIRE( (double) c(2, 0) == Approx(2.0) ); + REQUIRE( (double) c(0, 1) == Approx(2.0) ); + REQUIRE( (double) c(1, 1) == Approx(2.0) ); + REQUIRE( (double) c(2, 1) == Approx(4.0) ); + REQUIRE( (double) c(0, 2) == Approx(2.0) ); + REQUIRE( (double) c(1, 2) == Approx(-1.5) ); + REQUIRE( (double) c(2, 2) == Approx(-2.5) ); + + c = b; + c *= a.submat(2, 2, 4, 4); + + REQUIRE( (double) c(0, 0) == Approx(4.0) ); + REQUIRE( (double) c(1, 0) == Approx(4.0) ); + REQUIRE( (double) c(2, 0) == Approx(4.0) ); + REQUIRE( (double) c(0, 1) == Approx(-4.0) ); + REQUIRE( (double) c(1, 1) == Approx(-4.0) ); + REQUIRE( (double) c(2, 1) == Approx(-4.0) ); + REQUIRE( (double) c(0, 2) == Approx(16.0) ); + REQUIRE( (double) c(1, 2) == Approx(16.0) ); + REQUIRE( (double) c(2, 2) == Approx(16.0) ); + + mat e = b * a.submat(2, 2, 4, 4); + + REQUIRE( (double) e(0, 0) == Approx(4.0) ); + REQUIRE( (double) e(1, 0) == Approx(4.0) ); + REQUIRE( (double) e(2, 0) == Approx(4.0) ); + REQUIRE( (double) e(0, 1) == Approx(-4.0) ); + REQUIRE( (double) e(1, 1) == Approx(-4.0) ); + REQUIRE( (double) e(2, 1) == Approx(-4.0) ); + REQUIRE( (double) e(0, 2) == Approx(16.0) ); + REQUIRE( (double) e(1, 2) == Approx(16.0) ); + REQUIRE( (double) e(2, 2) == Approx(16.0) ); + + c = b; + c %= a.submat(2, 2, 4, 4); + + REQUIRE( (double) c(0, 0) == Approx(4.0) ); + REQUIRE( (double) c(1, 0) == Approx(1e-5) ); + REQUIRE( (double) c(2, 0) == Approx(1e-5) ); + REQUIRE( (double) c(0, 1) == Approx(1e-5) ); + REQUIRE( (double) c(1, 1) == Approx(1e-5) ); + REQUIRE( (double) c(2, 1) == Approx(-4.0) ); + REQUIRE( (double) c(0, 2) == Approx(1e-5) ); + REQUIRE( (double) c(1, 2) == Approx(7.0) ); + REQUIRE( (double) c(2, 2) == Approx(9.0) ); + + SpMat d = b % a.submat(2, 2, 4, 4); + + REQUIRE( d.n_nonzero == 4 ); + REQUIRE( (double) d(0, 0) == Approx(4.0) ); + REQUIRE( (double) d(2, 1) == Approx(-4.0) ); + REQUIRE( (double) d(1, 2) == Approx(7.0) ); + REQUIRE( (double) d(2, 2) == Approx(9.0) ); + + c = b; + c /= a.submat(2, 2, 4, 4); + + REQUIRE( c(0, 0) == Approx(1.0) ); + REQUIRE( std::isinf(c(1, 0)) ); + REQUIRE( std::isinf(c(2, 0)) ); + REQUIRE( std::isinf(c(0, 1)) ); + REQUIRE( std::isinf(c(1, 1)) ); + REQUIRE( c(2, 1) == Approx(-1.0) ); + REQUIRE( std::isinf(c(0, 2)) ); + REQUIRE( c(1, 2) == Approx(2.0 / 3.5) ); + REQUIRE( c(2, 2) == Approx(2.0 / 4.5) ); + } + + + +TEST_CASE("sp_subview_base_test") + { + SpMat a(6, 10); + a(2, 2) = 2.0; + a(3, 4) = 3.5; + a(4, 3) = -2.0; + a(4, 4) = 4.5; + a(5, 1) = 3.2; + a(0, 1) = 1.3; + a(1, 1) = -4.0; + a(5, 3) = 5.3; + + mat b(3, 3); + b.fill(2.0); + + SpMat c = a; + c.submat(2, 2, 4, 4) = b; + + REQUIRE( c.n_nonzero == 13 ); + REQUIRE( (double) c(2, 2) == Approx(2.0) ); + REQUIRE( (double) c(3, 2) == Approx(2.0) ); + REQUIRE( (double) c(4, 2) == Approx(2.0) ); + REQUIRE( (double) c(2, 3) == Approx(2.0) ); + REQUIRE( (double) c(3, 3) == Approx(2.0) ); + REQUIRE( (double) c(4, 3) == Approx(2.0) ); + REQUIRE( (double) c(2, 4) == Approx(2.0) ); + REQUIRE( (double) c(3, 4) == Approx(2.0) ); + REQUIRE( (double) c(4, 4) == Approx(2.0) ); + + c = a; + c.submat(2, 2, 4, 4) += b; + + REQUIRE( c.n_nonzero == 12 ); + REQUIRE( (double) c(2, 2) == Approx(4.0) ); + REQUIRE( (double) c(3, 2) == Approx(2.0) ); + REQUIRE( (double) c(4, 2) == Approx(2.0) ); + REQUIRE( (double) c(2, 3) == Approx(2.0) ); + REQUIRE( (double) c(3, 3) == Approx(2.0) ); + REQUIRE( (double) c(4, 3) == Approx(1e-5) ); + REQUIRE( (double) c(2, 4) == Approx(2.0) ); + REQUIRE( (double) c(3, 4) == Approx(5.5) ); + REQUIRE( (double) c(4, 4) == Approx(6.5) ); + + Mat d = a.submat(2, 2, 4, 4) + b; + c = a.submat(2, 2, 4, 4) + b; + + REQUIRE( c.n_nonzero == 8 ); + REQUIRE( (double) c(0, 0) == Approx(4.0) ); + REQUIRE( (double) c(1, 0) == Approx(2.0) ); + REQUIRE( (double) c(2, 0) == Approx(2.0) ); + REQUIRE( (double) c(0, 1) == Approx(2.0) ); + REQUIRE( (double) c(1, 1) == Approx(2.0) ); + REQUIRE( (double) c(2, 1) == Approx(1e-5) ); + REQUIRE( (double) c(0, 2) == Approx(2.0) ); + REQUIRE( (double) c(1, 2) == Approx(5.5) ); + REQUIRE( (double) c(2, 2) == Approx(6.5) ); + + c = a; + c.submat(2, 2, 4, 4) -= b; + + REQUIRE( c.n_nonzero == 12 ); + REQUIRE( (double) c(2, 2) == Approx(1e-5) ); + REQUIRE( (double) c(3, 2) == Approx(-2.0) ); + REQUIRE( (double) c(4, 2) == Approx(-2.0) ); + REQUIRE( (double) c(2, 3) == Approx(-2.0) ); + REQUIRE( (double) c(3, 3) == Approx(-2.0) ); + REQUIRE( (double) c(4, 3) == Approx(-4.0) ); + REQUIRE( (double) c(2, 4) == Approx(-2.0) ); + REQUIRE( (double) c(3, 4) == Approx(1.5) ); + REQUIRE( (double) c(4, 4) == Approx(2.5) ); + + c = a.submat(2, 2, 4, 4) - b; + + REQUIRE( c.n_nonzero == 8 ); + REQUIRE( (double) c(0, 0) == Approx(1e-5) ); + REQUIRE( (double) c(1, 0) == Approx(-2.0) ); + REQUIRE( (double) c(2, 0) == Approx(-2.0) ); + REQUIRE( (double) c(0, 1) == Approx(-2.0) ); + REQUIRE( (double) c(1, 1) == Approx(-2.0) ); + REQUIRE( (double) c(2, 1) == Approx(-4.0) ); + REQUIRE( (double) c(0, 2) == Approx(-2.0) ); + REQUIRE( (double) c(1, 2) == Approx(1.5) ); + REQUIRE( (double) c(2, 2) == Approx(2.5) ); + + c = a; + c.submat(2, 2, 4, 4) *= b; + + REQUIRE( c.n_nonzero == 13 ); + REQUIRE( (double) c(2, 2) == Approx(4.0) ); + REQUIRE( (double) c(3, 2) == Approx(7.0) ); + REQUIRE( (double) c(4, 2) == Approx(5.0) ); + REQUIRE( (double) c(2, 3) == Approx(4.0) ); + REQUIRE( (double) c(3, 3) == Approx(7.0) ); + REQUIRE( (double) c(4, 3) == Approx(5.0) ); + REQUIRE( (double) c(2, 4) == Approx(4.0) ); + REQUIRE( (double) c(3, 4) == Approx(7.0) ); + REQUIRE( (double) c(4, 4) == Approx(5.0) ); + + c = a.submat(2, 2, 4, 4) * b; + + REQUIRE( c.n_nonzero == 9 ); + REQUIRE( (double) c(0, 0) == Approx(4.0) ); + REQUIRE( (double) c(1, 0) == Approx(7.0) ); + REQUIRE( (double) c(2, 0) == Approx(5.0) ); + REQUIRE( (double) c(0, 1) == Approx(4.0) ); + REQUIRE( (double) c(1, 1) == Approx(7.0) ); + REQUIRE( (double) c(2, 1) == Approx(5.0) ); + REQUIRE( (double) c(0, 2) == Approx(4.0) ); + REQUIRE( (double) c(1, 2) == Approx(7.0) ); + REQUIRE( (double) c(2, 2) == Approx(5.0) ); + + c = a.submat(2, 2, 4, 4) % b; + + REQUIRE( c.n_nonzero == 4 ); + REQUIRE( (double) c(0, 0) == Approx(4.0) ); + REQUIRE( (double) c(2, 1) == Approx(-4.0) ); + REQUIRE( (double) c(1, 2) == Approx(7.0) ); + REQUIRE( (double) c(2, 2) == Approx(9.0) ); + + c = a; + c.submat(2, 2, 4, 4) %= b; + + REQUIRE( c.n_nonzero == 8 ); + REQUIRE( (double) c(2, 2) == Approx(4.0) ); + REQUIRE( (double) c(4, 3) == Approx(-4.0) ); + REQUIRE( (double) c(3, 4) == Approx(7.0) ); + REQUIRE( (double) c(4, 4) == Approx(9.0) ); + + c = a.submat(2, 2, 4, 4) / b; + + REQUIRE( c.n_nonzero == 4 ); + REQUIRE( (double) c(0, 0) == Approx(1.0) ); + REQUIRE( (double) c(2, 1) == Approx(-1.0) ); + REQUIRE( (double) c(1, 2) == Approx(3.5 / 2.0) ); + REQUIRE( (double) c(2, 2) == Approx(4.5 / 2.0) ); + + c = a; + c.submat(2, 2, 4, 4) /= b; + + REQUIRE( c.n_nonzero == 8 ); + REQUIRE( (double) c(2, 2) == Approx(1.0) ); + REQUIRE( (double) c(4, 3) == Approx(-1.0) ); + REQUIRE( (double) c(3, 4) == Approx(3.5 / 2.0) ); + REQUIRE( (double) c(4, 4) == Approx(4.5 / 2.0) ); + } + + + +TEST_CASE("sp_subview_sp_mat_test") + { + SpMat a(6, 10); + a(2, 2) = 2.0; + a(3, 4) = 3.5; + a(4, 3) = -2.0; + a(4, 4) = 4.5; + a(5, 1) = 3.2; + a(0, 1) = 1.3; + a(1, 1) = -4.0; + a(5, 3) = 5.3; + + SpMat b(3, 3); + b(0, 0) = 2.0; + b(1, 2) = 1.5; + b(2, 1) = 2.0; + + SpMat c = a; + c.submat(2, 2, 4, 4) = b; + + REQUIRE( c.n_nonzero == 7 ); + REQUIRE( (double) c(2, 2) == Approx(2.0) ); + REQUIRE( (double) c(3, 4) == Approx(1.5) ); + REQUIRE( (double) c(4, 3) == Approx(2.0) ); + + c = a; + c.submat(2, 2, 4, 4) += b; + + REQUIRE( c.n_nonzero == 7 ); + REQUIRE( (double) c(2, 2) == Approx(4.0) ); + REQUIRE( (double) c(3, 4) == Approx(5.0) ); + REQUIRE( (double) c(4, 4) == Approx(4.5) ); + + c = a.submat(2, 2, 4, 4) + b; + + REQUIRE( c.n_nonzero == 3 ); + REQUIRE( (double) c(0, 0) == Approx(4.0) ); + REQUIRE( (double) c(1, 2) == Approx(5.0) ); + REQUIRE( (double) c(2, 2) == Approx(4.5) ); + + c = a; + c.submat(2, 2, 4, 4) -= b; + + REQUIRE( c.n_nonzero == 7 ); + REQUIRE( (double) c(2, 2) == Approx(1e-5) ); + REQUIRE( (double) c(3, 2) == Approx(1e-5) ); + REQUIRE( (double) c(4, 2) == Approx(1e-5) ); + REQUIRE( (double) c(2, 3) == Approx(1e-5) ); + REQUIRE( (double) c(3, 3) == Approx(1e-5) ); + REQUIRE( (double) c(4, 3) == Approx(-4.0) ); + REQUIRE( (double) c(2, 4) == Approx(1e-5) ); + REQUIRE( (double) c(3, 4) == Approx(2.0) ); + REQUIRE( (double) c(4, 4) == Approx(4.5) ); + + c = a.submat(2, 2, 4, 4) - b; + + REQUIRE( c.n_nonzero == 3 ); + REQUIRE( (double) c(2, 1) == Approx(-4.0) ); + REQUIRE( (double) c(1, 2) == Approx(2.0) ); + REQUIRE( (double) c(2, 2) == Approx(4.5) ); + + c = a; + c.submat(2, 2, 4, 4) *= b; + + REQUIRE( c.n_nonzero == 8 ); + REQUIRE( (double) c(2, 2) == Approx(4.0) ); + REQUIRE( (double) c(3, 3) == Approx(7.0) ); + REQUIRE( (double) c(4, 3) == Approx(9.0) ); + REQUIRE( (double) c(4, 4) == Approx(-3.0) ); + + c = a.submat(2, 2, 4, 4) * b; + + REQUIRE( c.n_nonzero == 4 ); + REQUIRE( (double) c(0, 0) == Approx(4.0) ); + REQUIRE( (double) c(1, 1) == Approx(7.0) ); + REQUIRE( (double) c(2, 1) == Approx(9.0) ); + REQUIRE( (double) c(2, 2) == Approx(-3.0) ); + c = a.submat(2, 2, 4, 4) % b; + + REQUIRE( c.n_nonzero == 3 ); + REQUIRE( (double) c(0, 0) == Approx(4.0) ); + REQUIRE( (double) c(2, 1) == Approx(-4.0) ); + REQUIRE( (double) c(1, 2) == Approx(5.25) ); + REQUIRE( (double) c(2, 2) == Approx(1e-5) ); + + c = a; + c.submat(2, 2, 4, 4) %= b; + + REQUIRE( c.n_nonzero == 7 ); + REQUIRE( (double) c(2, 2) == Approx(4.0) ); + REQUIRE( (double) c(4, 3) == Approx(-4.0) ); + REQUIRE( (double) c(3, 4) == Approx(5.25) ); + REQUIRE( (double) c(4, 4) == Approx(1e-5) ); + +// c = a.submat(2, 2, 4, 4) / b; + +// REQUIRE( c.n_nonzero == 9 ); +// REQUIRE( (double) c(0, 0) == Approx(1.0) ); +// REQUIRE( (double) c(1, 0) != (double) c(1, 0) ); +// REQUIRE( (double) c(2, 0) != (double) c(2, 0) ); +// REQUIRE( (double) c(0, 1) != (double) c(0, 1) ); +// REQUIRE( (double) c(1, 1) != (double) c(1, 1) ); +// REQUIRE( (double) c(2, 1) == Approx(-1.0) ); +// REQUIRE( (double) c(0, 2) != (double) c(0, 2) ); +// REQUIRE( (double) c(1, 2) == Approx((3.5 / 1.5)) ); +// REQUIRE( std::isinf((double) c(2, 2)) ); + + c = a; + c.submat(2, 2, 4, 4) /= b; + + REQUIRE( c.n_nonzero == 13 ); + REQUIRE( (double) c(2, 2) == Approx(1.0) ); + REQUIRE( (double) c(3, 2) != (double) c(3, 2)); + REQUIRE( (double) c(4, 2) != (double) c(4, 2)); + REQUIRE( (double) c(2, 3) != (double) c(2, 3)); + REQUIRE( (double) c(3, 3) != (double) c(3, 3)); + REQUIRE( (double) c(4, 3) == Approx(-1.0) ); + REQUIRE( (double) c(2, 4) != (double) c(2, 4) ); + REQUIRE( (double) c(3, 4) == Approx((3.5 / 1.5)) ); + REQUIRE( std::isinf((double) c(4, 4)) ); + } + + + +TEST_CASE("sp_subview_sp_subview_tests") + { + SpMat a(6, 10); + a(2, 2) = 2.0; + a(3, 4) = 3.5; + a(4, 3) = -2.0; + a(4, 4) = 4.5; + a(5, 1) = 3.2; + a(0, 1) = 1.3; + a(1, 1) = -4.0; + a(5, 3) = 5.3; + + SpMat b(5, 5); + b(0, 0) = 1.0; + b(0, 1) = 1.0; + b(0, 2) = 1.0; + b(0, 3) = 1.0; + b(0, 4) = 1.0; + b(1, 0) = 1.0; + b(2, 0) = 1.0; + b(3, 0) = 1.0; + b(4, 0) = 1.0; + b(4, 1) = 1.0; + b(4, 2) = 1.0; + b(4, 3) = 1.0; + b(4, 4) = 1.0; + b(3, 4) = 1.0; + b(2, 4) = 1.0; + b(1, 4) = 1.0; + b(1, 1) = 2.0; + b(2, 3) = 1.5; + b(3, 2) = 2.0; + + SpMat c = a; + c.submat(2, 2, 4, 4) = b.submat(1, 1, 3, 3); + + REQUIRE( c.n_nonzero == 7 ); + REQUIRE( (double) c(2, 2) == Approx(2.0) ); + REQUIRE( (double) c(3, 4) == Approx(1.5) ); + REQUIRE( (double) c(4, 3) == Approx(2.0) ); + + c = a; + c.submat(2, 2, 4, 4) += b.submat(1, 1, 3, 3); + + REQUIRE( c.n_nonzero == 7 ); + REQUIRE( (double) c(2, 2) == Approx(4.0) ); + REQUIRE( (double) c(3, 4) == Approx(5.0) ); + REQUIRE( (double) c(4, 4) == Approx(4.5) ); + + c = a.submat(2, 2, 4, 4) + b.submat(1, 1, 3, 3); + + REQUIRE( c.n_nonzero == 3 ); + REQUIRE( (double) c(0, 0) == Approx(4.0) ); + REQUIRE( (double) c(1, 2) == Approx(5.0) ); + REQUIRE( (double) c(2, 2) == Approx(4.5) ); + + c = a; + c.submat(2, 2, 4, 4) -= b.submat(1, 1, 3, 3); + + REQUIRE( c.n_nonzero == 7 ); + REQUIRE( (double) c(2, 2) == Approx(1e-5) ); + REQUIRE( (double) c(3, 2) == Approx(1e-5) ); + REQUIRE( (double) c(4, 2) == Approx(1e-5) ); + REQUIRE( (double) c(2, 3) == Approx(1e-5) ); + REQUIRE( (double) c(3, 3) == Approx(1e-5) ); + REQUIRE( (double) c(4, 3) == Approx(-4.0) ); + REQUIRE( (double) c(2, 4) == Approx(1e-5) ); + REQUIRE( (double) c(3, 4) == Approx(2.0) ); + REQUIRE( (double) c(4, 4) == Approx(4.5) ); + + c = a.submat(2, 2, 4, 4) - b.submat(1, 1, 3, 3); + + REQUIRE( c.n_nonzero == 3 ); + REQUIRE( (double) c(2, 1) == Approx(-4.0) ); + REQUIRE( (double) c(1, 2) == Approx(2.0) ); + REQUIRE( (double) c(2, 2) == Approx(4.5) ); + + c = a; + c.submat(2, 2, 4, 4) *= b.submat(1, 1, 3, 3); + + REQUIRE( c.n_nonzero == 8 ); + REQUIRE( (double) c(2, 2) == Approx(4.0) ); + REQUIRE( (double) c(3, 3) == Approx(7.0) ); + REQUIRE( (double) c(4, 3) == Approx(9.0) ); + REQUIRE( (double) c(4, 4) == Approx(-3.0) ); + c = a.submat(2, 2, 4, 4) * b.submat(1, 1, 3, 3); + + REQUIRE( c.n_nonzero == 4 ); + REQUIRE( (double) c(0, 0) == Approx(4.0) ); + REQUIRE( (double) c(1, 1) == Approx(7.0) ); + REQUIRE( (double) c(2, 1) == Approx(9.0) ); + REQUIRE( (double) c(2, 2) == Approx(-3.0) ); + + c = a.submat(2, 2, 4, 4) % b.submat(1, 1, 3, 3); + + REQUIRE( c.n_nonzero == 3 ); + REQUIRE( (double) c(0, 0) == Approx(4.0) ); + REQUIRE( (double) c(2, 1) == Approx(-4.0) ); + REQUIRE( (double) c(1, 2) == Approx(5.25) ); + REQUIRE( (double) c(2, 2) == Approx(1e-5) ); + + c = a; + c.submat(2, 2, 4, 4) %= b.submat(1, 1, 3, 3); + + REQUIRE( c.n_nonzero == 7 ); + REQUIRE( (double) c(2, 2) == Approx(4.0) ); + REQUIRE( (double) c(4, 3) == Approx(-4.0) ); + REQUIRE( (double) c(3, 4) == Approx(5.25) ); + REQUIRE( (double) c(4, 4) == Approx(1e-5) ); + +// c = a.submat(2, 2, 4, 4) / b.submat(1, 1, 3, 3); + +// REQUIRE( c.n_nonzero == 9 ); +// REQUIRE( (double) c(0, 0) == Approx(1.0) ); +// REQUIRE( (double) c(1, 0) != (double) c(1, 0) ); +// REQUIRE( (double) c(2, 0) != (double) c(2, 0) ); +// REQUIRE( (double) c(0, 1) != (double) c(0, 1) ); +// REQUIRE( (double) c(1, 1) != (double) c(1, 1) ); +// REQUIRE( (double) c(2, 1) == Approx(-1.0) ); +// REQUIRE( (double) c(0, 2) != (double) c(0, 2) ); +// REQUIRE( (double) c(1, 2) == Approx((3.5 / 1.5)) ); +// REQUIRE( std::isinf((double) c(2, 2)) ); + + c = a; + c.submat(2, 2, 4, 4) /= b.submat(1, 1, 3, 3); + + REQUIRE( c.n_nonzero == 13 ); + REQUIRE( (double) c(2, 2) == Approx(1.0) ); + REQUIRE( (double) c(3, 2) != (double) c(3, 2) ); + REQUIRE( (double) c(4, 2) != (double) c(4, 2) ); + REQUIRE( (double) c(2, 3) != (double) c(2, 3) ); + REQUIRE( (double) c(3, 3) != (double) c(3, 3) ); + REQUIRE( (double) c(4, 3) == Approx(-1.0) ); + REQUIRE( (double) c(2, 4) != (double) c(2, 4) ); + REQUIRE( (double) c(3, 4) == Approx((3.5 / 1.5)) ); + REQUIRE( std::isinf((double) c(4, 4)) ); + } + + + +TEST_CASE("sp_subview_iterators_test") + { + SpMat b(5, 5); + b(0, 0) = 1.0; + b(0, 1) = 1.0; + b(0, 2) = 1.0; + b(0, 3) = 1.0; + b(0, 4) = 1.0; + b(1, 0) = 1.0; + b(2, 0) = 1.0; + b(3, 0) = 1.0; + b(4, 0) = 1.0; + b(4, 1) = 1.0; + b(4, 2) = 1.0; + b(4, 3) = 1.0; + b(4, 4) = 1.0; + b(3, 4) = 1.0; + b(2, 4) = 1.0; + b(1, 4) = 1.0; + b(1, 1) = 2.0; + b(2, 3) = 1.5; + b(3, 2) = 2.0; + + // [[1.0 1.0 1.0 1.0 1.0] + // [1.0 2.0 0.0 0.0 1.0] + // [1.0 0.0 0.0 1.5 1.0] + // [1.0 0.0 2.0 0.0 1.0] + // [1.0 1.0 1.0 1.0 1.0]] + SpSubview s = b.submat(1, 1, 3, 3); + + SpSubview::iterator it = s.begin(); + + REQUIRE( it.pos() == 0 ); + REQUIRE( it.skip_pos == 6 ); + REQUIRE( it.row() == 0 ); + REQUIRE( it.col() == 0 ); + REQUIRE( (double) (*it) == Approx(2.0) ); + + ++it; + + REQUIRE( it.pos() == 1 ); + REQUIRE( it.skip_pos == 8 ); + REQUIRE( it.row() == 2 ); + REQUIRE( it.col() == 1 ); + REQUIRE( (double) (*it) == Approx(2.0) ); + + ++it; + + REQUIRE( it.pos() == 2 ); + REQUIRE( it.skip_pos == 10 ); + REQUIRE( it.row() == 1 ); + REQUIRE( it.col() == 2 ); + REQUIRE( (double) (*it) == Approx(1.5) ); + + *it = 4.3; + + REQUIRE( (double) (*it) == Approx(4.3) ); + + ++it; + + REQUIRE( it.pos() == s.n_nonzero ); + + --it; + + REQUIRE( it.pos() == 2 ); + REQUIRE( it.skip_pos == 10 ); + REQUIRE( it.row() == 1 ); + REQUIRE( it.col() == 2 ); + REQUIRE( (double) (*it) == Approx(4.3) ); + + --it; + + REQUIRE( it.pos() == 1 ); + REQUIRE( it.skip_pos == 8 ); + REQUIRE( it.row() == 2 ); + REQUIRE( it.col() == 1 ); + REQUIRE( (double) (*it) == Approx(2.0) ); + + --it; + + REQUIRE( it.pos() == 0 ); + REQUIRE( it.skip_pos == 6 ); + REQUIRE( it.row() == 0 ); + REQUIRE( it.col() == 0 ); + REQUIRE( (double) (*it) == Approx(2.0) ); + + SpMat c(5, 5); + c(1, 1) = 2.0; + c(2, 3) = 1.5; + c(3, 2) = 2.0; + + SpSubview ss = c.submat(1, 1, 3, 3); + + SpSubview::iterator sit = ss.begin(); + + REQUIRE( sit.pos() == 0 ); + REQUIRE( sit.skip_pos == 0 ); + REQUIRE( sit.row() == 0 ); + REQUIRE( sit.col() == 0 ); + REQUIRE( (double) (*sit) == Approx(2.0) ); + + ++sit; + + REQUIRE( sit.pos() == 1 ); + REQUIRE( sit.skip_pos == 0 ); + REQUIRE( sit.row() == 2 ); + REQUIRE( sit.col() == 1 ); + REQUIRE( (double) (*sit) == Approx(2.0) ); + + ++sit; + + REQUIRE( sit.pos() == 2 ); + REQUIRE( sit.skip_pos == 0 ); + REQUIRE( sit.row() == 1 ); + REQUIRE( sit.col() == 2 ); + REQUIRE( (double) (*sit) == Approx(1.5) ); + + *sit = 4.2; + + REQUIRE( (double) (*sit) == Approx(4.2) ); + + ++sit; + + REQUIRE( sit.pos() == ss.n_nonzero ); + + --sit; + + REQUIRE( sit.pos() == 2 ); + REQUIRE( sit.skip_pos == 0 ); + REQUIRE( sit.row() == 1 ); + REQUIRE( sit.col() == 2 ); + REQUIRE( (double) (*sit) == Approx(4.2) ); + + --sit; + + REQUIRE( sit.pos() == 1 ); + REQUIRE( sit.skip_pos == 0 ); + REQUIRE( sit.row() == 2 ); + REQUIRE( sit.col() == 1 ); + REQUIRE( (double) (*sit) == Approx(2.0) ); + + --sit; + + REQUIRE( sit.pos() == 0 ); + REQUIRE( sit.skip_pos == 0 ); + REQUIRE( sit.row() == 0 ); + REQUIRE( sit.col() == 0 ); + REQUIRE( (double) (*sit) == Approx(2.0) ); + } + + +TEST_CASE("sp_subview_row_iterators_test") + { + SpMat b(5, 5); + b(0, 0) = 1.0; + b(0, 1) = 1.0; + b(0, 2) = 1.0; + b(0, 3) = 1.0; + b(0, 4) = 1.0; + b(1, 0) = 1.0; + b(2, 0) = 1.0; + b(3, 0) = 1.0; + b(4, 0) = 1.0; + b(4, 1) = 1.0; + b(4, 2) = 1.0; + b(4, 3) = 1.0; + b(4, 4) = 1.0; + b(3, 4) = 1.0; + b(2, 4) = 1.0; + b(1, 4) = 1.0; + b(1, 1) = 2.0; + b(2, 3) = 1.5; + b(3, 2) = 2.0; + + // [[1.0 1.0 1.0 1.0 1.0] + // [1.0 2.0 0.0 0.0 1.0] + // [1.0 0.0 0.0 1.5 1.0] + // [1.0 0.0 2.0 0.0 1.0] + // [1.0 1.0 1.0 1.0 1.0]] + SpSubview s = b.submat(1, 1, 3, 3); + + SpSubview::row_iterator it = s.begin_row(); + + REQUIRE( it.pos() == 0 ); + REQUIRE( it.row() == 0 ); + REQUIRE( it.col() == 0 ); + REQUIRE( it.actual_pos == 6 ); + REQUIRE( (double) (*it) == Approx(2.0) ); + + ++it; + + REQUIRE( it.pos() == 1 ); + REQUIRE( it.row() == 1 ); + REQUIRE( it.col() == 2 ); + REQUIRE( it.actual_pos == 12 ); + REQUIRE( (double) (*it) == Approx(1.5) ); + + ++it; + + REQUIRE( it.pos() == 2 ); + REQUIRE( it.row() == 2 ); + REQUIRE( it.col() == 1 ); + REQUIRE( it.actual_pos == 9 ); + REQUIRE( (double) (*it) == Approx(2.0) ); + + ++it; + + REQUIRE( it.pos() == s.n_nonzero ); + + --it; + + REQUIRE( it.pos() == 2 ); + REQUIRE( it.row() == 2 ); + REQUIRE( it.col() == 1 ); + REQUIRE( it.actual_pos == 9 ); + REQUIRE( (double) (*it) == Approx(2.0) ); + + (*it) = 4.0; + + REQUIRE( (double) (*it) == Approx(4.0) ); + + --it; + + REQUIRE( it.pos() == 1 ); + REQUIRE( it.row() == 1 ); + REQUIRE( it.col() == 2 ); + REQUIRE( it.actual_pos == 12 ); + REQUIRE( (double) (*it) == Approx(1.5) ); + + --it; + + REQUIRE( it.pos() == 0 ); + REQUIRE( it.row() == 0 ); + REQUIRE( it.col() == 0 ); + REQUIRE( it.actual_pos == 6 ); + REQUIRE( (double) (*it) == Approx(2.0) ); + + // now a different matrix + SpMat c(5, 5); + c(1, 1) = 2.0; + c(2, 3) = 1.5; + c(3, 2) = 2.0; + + SpSubview ss = c.submat(0, 0, 3, 3); + + SpSubview::row_iterator sit = ss.begin_row(); + + REQUIRE( sit.pos() == 0 ); + REQUIRE( sit.row() == 1 ); + REQUIRE( sit.col() == 1 ); + REQUIRE( (double) (*sit) == Approx(2.0) ); + + ++sit; + + REQUIRE( sit.pos() == 1 ); + REQUIRE( sit.row() == 2 ); + REQUIRE( sit.col() == 3 ); + REQUIRE( (double) (*sit) == Approx(1.5) ); + + ++sit; + + REQUIRE( sit.pos() == 2 ); + REQUIRE( sit.row() == 3 ); + REQUIRE( sit.col() == 2 ); + REQUIRE( (double) (*sit) == Approx(2.0) ); + + ++sit; + + REQUIRE( sit.pos() == ss.n_nonzero ); + + --sit; + + REQUIRE( sit.pos() == 2 ); + REQUIRE( sit.row() == 3 ); + REQUIRE( sit.col() == 2 ); + REQUIRE( (double) (*sit) == Approx(2.0) ); + + (*sit) = 4.0; + + REQUIRE( (double) (*sit) == Approx(4.0) ); + + --sit; + + REQUIRE( sit.pos() == 1 ); + REQUIRE( sit.row() == 2 ); + REQUIRE( sit.col() == 3 ); + REQUIRE( (double) (*sit) == Approx(1.5) ); + + --sit; + + REQUIRE( sit.pos() == 0 ); + REQUIRE( sit.row() == 1 ); + REQUIRE( sit.col() == 1 ); + REQUIRE( (double) (*sit) == Approx(2.0) ); + } + + +TEST_CASE("sp_subview_sp_base_add_subtract_modulo") + { + SpMat m; + m.sprandu(100, 100, 0.1); + + SpMat n; + n.sprandu(50, 50, 0.1); + + Mat x(m); + Mat y(n); + + m.submat(25, 25, 74, 74) += n; + x.submat(25, 25, 74, 74) += y; + + for (uword c = 0; c < 100; ++c) + { + for (uword r = 0; r < 100; ++r) + { + REQUIRE( (double) m(r, c) == Approx(x(r, c)) ); + } + } + + m.sprandu(100, 100, 0.1); + n.sprandu(50, 50, 0.1); + + x = m; + y = n; + + m.submat(25, 25, 74, 74) -= n; + x.submat(25, 25, 74, 74) -= y; + + for (uword c = 0; c < 100; ++c) + { + for (uword r = 0; r < 100; ++r) + { + REQUIRE( (double) m(r, c) == Approx(x(r, c)) ); + } + } + + m.sprandu(100, 100, 0.1); + n.sprandu(50, 50, 0.1); + + x = m; + y = n; + + m.submat(25, 25, 74, 74) %= n; + x.submat(25, 25, 74, 74) %= y; + + for( uword c = 0; c < 100; ++c) + { + for( uword r = 0; r < 100; ++r) + { + REQUIRE( (double) m(r, c) == Approx(x(r, c)) ); + } + } + } + +TEST_CASE("sp_subview_hadamard") + { + SpMat x; + x.sprandu(100, 100, 0.1); + Mat d(x); + + SpMat y; + y.sprandu(200, 200, 0.1); + Mat dy(y); + + x %= y.submat(50, 50, 149, 149); + d %= dy.submat(50, 50, 149, 149); + + for (uword c = 0; c < 100; ++c) + { + for (uword r = 0; r < 100; ++r) + { + REQUIRE( (double) x(r, c) == Approx(d(r, c)) ); + } + } + } + + +TEST_CASE("sp_subview_subviews_test") + { + SpMat m(20, 20); + m.sprandu(20, 20, 0.3); + + // Get a subview. + SpSubview s = m.submat(1, 1, 10, 10); // 10x10 + const SpSubview c = m.submat(1, 1, 10, 10); + + SpSubview t = s.row(1); + const SpSubview d = c.row(1); + + REQUIRE( t.n_rows == 1 ); + REQUIRE( t.n_cols == 10 ); + REQUIRE( d.n_rows == 1 ); + REQUIRE( d.n_cols == 10 ); + REQUIRE( t.aux_row1 == 2 ); + REQUIRE( t.aux_col1 == 1 ); + for (uword i = 0; i < 10; ++i) + { + REQUIRE( (double) t[i] == (double) m(2, i + 1) ); + REQUIRE( d[i] == (double) m(2, i + 1) ); + } + + SpSubview t1 = s.col(2); + const SpSubview d1 = c.col(2); + + REQUIRE( t1.n_rows == 10 ); + REQUIRE( t1.n_cols == 1 ); + REQUIRE( d1.n_rows == 10 ); + REQUIRE( d1.n_cols == 1 ); + for (uword i = 0; i < 10; ++i) + { + REQUIRE( (double) t1[i] == (double) m(i + 1, 3) ); + REQUIRE( d1[i] == (double) m(i + 1, 3) ); + } + + SpSubview t2 = s.rows(3, 5); + const SpSubview d2 = c.rows(3, 5); + + REQUIRE( t2.n_rows == 3 ); + REQUIRE( t2.n_cols == 10 ); + REQUIRE( d2.n_rows == 3 ); + REQUIRE( d2.n_cols == 10 ); + for (uword j = 0; j < 3; ++j) + { + for (uword i = 0; i < 10; ++i) + { + REQUIRE( (double) t2(j, i) == (double) m(4 + j, i + 1) ); + REQUIRE( d2(j, i) == (double) m(4 + j, i + 1) ); + } + } + + SpSubview t3 = s.cols(4, 6); + const SpSubview d3 = c.cols(4, 6); + + REQUIRE( t3.n_rows == 10 ); + REQUIRE( t3.n_cols == 3 ); + REQUIRE( d3.n_rows == 10 ); + REQUIRE( d3.n_cols == 3 ); + for (uword j = 0; j < 3; ++j) + { + for (uword i = 0; i < 10; ++i) + { + REQUIRE( (double) t3(i, j) == (double) m(i + 1, 5 + j) ); + REQUIRE( d3(i, j) == (double) m(i + 1, 5 + j) ); + } + } + + SpSubview t4 = s.submat(1, 1, 6, 6); + const SpSubview d4 = c.submat(1, 1, 6, 6); + + REQUIRE( t4.n_rows == 6 ); + REQUIRE( t4.n_cols == 6 ); + REQUIRE( d4.n_rows == 6 ); + REQUIRE( d4.n_cols == 6 ); + for (uword j = 0; j < 6; ++j) + { + for (uword i = 0; i < 6; ++i) + { + REQUIRE( (double) t4(i, j) == (double) m(i + 2, 2 + j) ); + REQUIRE( d4(i, j) == (double) m(i + 2, 2 + j) ); + } + } + + SpSubview t5 = s.submat(span(2, 8), span(2, 5)); + const SpSubview d5 = c.submat(span(2, 8), span(2, 5)); + + REQUIRE( t5.n_rows == 7 ); + REQUIRE( t5.n_cols == 4 ); + REQUIRE( d5.n_rows == 7 ); + REQUIRE( d5.n_cols == 4 ); + for (uword j = 0; j < 4; ++j) + { + for (uword i = 0; i < 7; ++i) + { + REQUIRE( (double) t5(i, j) == (double) m(i + 3, 3 + j) ); + REQUIRE( d5(i, j) == (double) m(i + 3, 3 + j) ); + } + } + + SpSubview t6 = s(4, span(1, 5)); + const SpSubview d6 = c(4, span(1, 5)); + + REQUIRE( t6.n_rows == 1 ); + REQUIRE( t6.n_cols == 5 ); + REQUIRE( d6.n_rows == 1 ); + REQUIRE( d6.n_cols == 5 ); + for (uword i = 0; i < 5; ++i) + { + REQUIRE( (double) t6(i) == (double) m(5, 2 + i) ); + REQUIRE( d6(i) == (double) m(5, 2 + i) ); + } + + SpSubview t7 = s(span(1, 5), 4); + const SpSubview d7 = c(span(1, 5), 4); + + REQUIRE( t7.n_rows == 5 ); + REQUIRE( t7.n_cols == 1 ); + REQUIRE( d7.n_rows == 5 ); + REQUIRE( d7.n_cols == 1 ); + for (uword i = 0; i < 5; ++i) + { + REQUIRE( (double) t7(i) == (double) m(2 + i, 5) ); + REQUIRE( d7(i) == (double) m(2 + i, 5) ); + } + + SpSubview t8 = s(span(1, 9), span(7, 8)); + const SpSubview d8 = c(span(1, 9), span(7, 8)); + + REQUIRE( t8.n_rows == 9 ); + REQUIRE( t8.n_cols == 2 ); + REQUIRE( d8.n_rows == 9 ); + REQUIRE( d8.n_cols == 2 ); + for (uword j = 0; j < 2; ++j) + { + for (uword i = 0; i < 9; ++i) + { + REQUIRE( (double) t8(i, j) == (double) m(i + 2, 8 + j) ); + REQUIRE( d8(i, j) == (double) m(i + 2, 8 + j) ); + } + } + } + + + +TEST_CASE("sp_subview_assignment_sp_base") + { + mat d(51, 51); + d.fill(7.0); // Why not? + mat dd(d); + + sp_mat e; + e.sprandu(50, 50, 0.3); + mat ed(e); // Dense copy. + + d.submat(0, 0, 49, 49) = e; + dd.submat(0, 0, 49, 49) = ed; + + for (uword i = 0; i < d.n_elem; ++i) + { + REQUIRE( d[i] == Approx(dd[i]) ); + } + } + + + +TEST_CASE("sp_subview_addition_sp_base") + { + mat d(51, 51); + d.fill(7.0); // Why not? + mat dd(d); + + sp_mat e; + e.sprandu(50, 50, 0.3); + mat ed(e); // Dense copy. + + d.submat(0, 0, 49, 49) += e; + dd.submat(0, 0, 49, 49) += ed; + + for (uword i = 0; i < d.n_elem; ++i) + { + REQUIRE( d[i] == Approx(dd[i]) ); + } + } + + +TEST_CASE("sp_subview_subtraction_sp_base") + { + mat d(51, 51); + d.fill(7.0); // Why not? + mat dd(d); + + sp_mat e; + e.sprandu(50, 50, 0.3); + mat ed(e); // Dense copy. + + d.submat(0, 0, 49, 49) -= e; + dd.submat(0, 0, 49, 49) -= ed; + + for (uword i = 0; i < d.n_elem; ++i) + { + REQUIRE( d[i] == Approx(dd[i]) ); + } + } + + + +TEST_CASE("sp_subview_schur_sp_base") + { + mat d(51, 51); + d.fill(7.0); // Why not? + mat dd(d); + + sp_mat e; + e.sprandu(50, 50, 0.3); + mat ed(e); // Dense copy. + + d.submat(0, 0, 49, 49) %= e; + dd.submat(0, 0, 49, 49) %= ed; + + for (uword i = 0; i < d.n_elem; ++i) + { + REQUIRE( d[i] == Approx(dd[i]) ); + } + } + + + +TEST_CASE("sp_subview_division_sp_base") + { + mat d(51, 51); + d.fill(7.0); // Why not? + mat dd(d); + + sp_mat e; + e.sprandu(50, 50, 0.3); + mat ed(e); // Dense copy. + + d.submat(0, 0, 49, 49) /= e; + dd.submat(0, 0, 49, 49) /= ed; + + for (uword i = 0; i < d.n_elem; ++i) + { + if (std::isinf(d[i])) + REQUIRE( std::isinf(dd[i]) ); + else + REQUIRE( d[i] == Approx(dd[i]) ); + } + }