Compare commits

...
46 Commits
Author SHA1 Message Date
conrad 03b9e4e8f9 use internal function 2025-09-15 10:19:38 +10:00
conrad 5fe5a0303a patch bump 2025-08-25 20:21:06 +10:00
conrad 58d012deaf better wording 2025-07-12 18:46:57 +10:00
conrad f459f8c05b fix 2025-07-12 11:19:26 +10:00
conrad f1e256cdc2 cleanup 2025-07-07 15:43:29 +10:00
conrad 9f9bc041a0 cleanup wordiing 2025-07-04 19:37:49 +10:00
conrad 5ab05fc6a1 fix 2025-06-30 12:42:43 +10:00
conrad 2c15e54506 fix 2025-06-12 12:07:00 +10:00
conrad 8ab2cf9589 patch bump 2025-05-21 15:14:53 +10:00
conrad 90f305d153 take into account possible inf and nan 2025-05-21 10:20:08 +10:00
conrad 4ddb01bfd7 restore previous attributes due to false positives in gcc 14.2 2025-05-20 13:46:33 +10:00
conrad c4ffcac263 remove no longer needed typedef 2025-05-20 13:40:59 +10:00
conrad 83a38cc999 fix comment 2025-05-20 13:02:35 +10:00
conrad 5a80708b4a optimisation for empty matrices 2025-05-20 12:46:37 +10:00
conrad 365af48910 take into account possible inf and nan 2025-05-20 12:33:58 +10:00
conrad 4a2cdf78e0 take into account possible inf and nan 2025-05-20 01:15:25 +10:00
conrad e3f0ff95b9 minor layout fix 2025-05-19 12:49:25 +10:00
conrad 8cb64ddc3d fix handling of corner-cases with nan and inf 2025-05-19 12:40:55 +10:00
conrad fa1cc1925e improve short summary for shift() 2025-05-18 16:24:52 +10:00
conrad 25f6093cef conditionally undefine ARMA_IGNORE_DEPRECATED_MARKER 2025-05-15 13:33:25 +10:00
conrad 5d93b06328 better wording 2025-05-14 13:18:02 +10:00
conrad 210936459e use .is_finite() 2025-05-13 16:20:20 +10:00
conrad c36c50476a add DOI 2025-05-12 23:31:03 +10:00
conrad ef46b50c0c deprecate stand-alone is_finite() 2025-05-07 12:56:51 +10:00
conrad 4d9a82294a issue compile time warning for unused outputs 2025-05-02 14:14:07 +10:00
conrad 0ccf188ecd use std:: prefix 2025-04-26 00:29:02 +10:00
conrad caf55b8129 patch bump 2025-04-25 23:59:11 +10:00
conrad 70ad84b6fc update pdf 2025-04-25 23:57:15 +10:00
conrad 413197f906 remove old papers 2025-04-25 23:55:18 +10:00
conrad 75a08f29d9 workaround for bugs in clang 20.1 2025-04-24 15:18:05 +10:00
conrad 10b1286069 refactor to use superlu::int_t 2025-04-23 16:27:05 +10:00
conrad ff07666ca1 fix layout 2025-04-23 14:48:20 +10:00
conrad f745a4fd64 embed icon image into html 2025-04-23 14:45:53 +10:00
conrad e4dbea66f2 update paper links 2025-04-23 14:30:42 +10:00
conrad c51a929a95 better wording 2025-04-23 14:28:26 +10:00
conrad 9384470685 better wording 2025-04-23 14:27:27 +10:00
conrad df8c66b33d bump min version of CMake 2025-04-23 14:26:51 +10:00
conrad 38db8d899e add compile time warning 2025-04-23 14:08:11 +10:00
conrad 08bcbadd40 add compile time warning 2025-04-23 14:05:24 +10:00
conrad f7d5691c0c add support for superlu 7.0 2025-04-23 13:38:59 +10:00
conrad c22443e423 rename 2025-04-23 13:33:39 +10:00
conrad 92a91a20d7 fix speed regression for inv of tiny matrices 2025-04-23 13:31:13 +10:00
conrad c4a99aae01 add trace reduction 2025-04-23 13:25:35 +10:00
conrad b613bdb306 fix calculation of s 2025-04-23 13:24:40 +10:00
conrad f77f5c3d0f simplifications 2025-04-11 11:50:11 +10:00
conrad 4e64c2e1b4 improve docs for element access via better ordering 2025-04-07 14:42:42 +10:00
39 changed files with 489 additions and 459 deletions
+10 -9
View File
@@ -16,23 +16,24 @@
# ------------------------------------------------------------------------
## NOTE: This installation script by default generates a runtime wrapper library,
## NOTE: This installation script generates a runtime wrapper library by default,
## NOTE: which links with OpenBLAS, LAPACK, etc.
## NOTE:
## NOTE: If you prefer to link your programs directly with OpenBLAS, LAPACK, etc
## NOTE: there are two options:
## NOTE:
## NOTE: (1) use the HEADER_ONLY option when running this installation script,
## NOTE: or
## NOTE: (2) do not use this installation script, and instead compile your programs
## NOTE: using the include folder directly obtained from the armadillo archive.
## NOTE: (2) do not use this installation script; instead compile your programs
## NOTE: using the include folder directly obtained from the armadillo archive.
## NOTE:
## NOTE: To forcefully disable use of the runtime wrapper library,
## NOTE: compile your programs with ARMA_DONT_USE_WRAPPER enabled.
## NOTE: For example:
## NOTE: Example:
## NOTE: g++ prog.cpp -o prog -O2 -I /home/user/armadillo-14.0.0/include -DARMA_DONT_USE_WRAPPER -lopenblas -llapack
## NOTE:
## NOTE: The above command line assumes that you have unpacked the armadillo archive into /home/user/
## NOTE: This needs to be adjusted for newer versions of Armadillo (ie. change "14.0.0"),
## NOTE: The above assumes that the armadillo archive is unpacked into /home/user/
## NOTE: Adjust for newer versions of Armadillo (change "14.0.0"),
## NOTE: and/or if the armadillo archive has been unpacked into a different folder.
## NOTE:
## NOTE: Replace -lopenblas with -lblas if you don't have OpenBLAS.
@@ -40,7 +41,7 @@
## NOTE: More details: https://arma.sourceforge.net/faq.html
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
cmake_minimum_required(VERSION 3.5...3.10 FATAL_ERROR)
if(POLICY CMP0025)
# enable differentiation between vanilla Clang and AppleClang
@@ -73,7 +74,7 @@ set(ARMA_USE_LAPACK false)
set(ARMA_USE_BLAS false)
set(ARMA_USE_ATLAS false)
set(ARMA_USE_ARPACK false)
set(ARMA_USE_SUPERLU false) # Caveat: only SuperLU version 5.x can be used!
set(ARMA_USE_SUPERLU false)
# extract version from sources
@@ -469,7 +470,7 @@ if(ARPACK_FOUND)
set(ARMA_LIBS ${ARMA_LIBS} ${ARPACK_LIBRARY})
endif()
include(ARMA_FindSuperLU5)
include(ARMA_FindSuperLU)
message(STATUS "SuperLU_FOUND = ${SuperLU_FOUND}")
if(SuperLU_FOUND)
+3 -3
View File
@@ -129,8 +129,8 @@ On Windows systems, the MinGW toolset or Visual Studio C++ 2019 (MSVC) can be us
Caveats on the use of SuperLU:
- SuperLU must be available as a shared library
- Only the following SuperLU versions are supported: 5.2.x, 5.3.x, 6.0.x
- SuperLU 6.0.x must be compiled with default integer size (32 bits)
- Only the following SuperLU versions are supported: 5.2.x, 5.3.x, 6.0.x, 7.0.x
- SuperLU 6.0.x and 7.0.x must be compiled with default integer size (32 bits)
---
@@ -369,7 +369,7 @@ Comment out the line containing:
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
Armadillo has a template meta-programming framework which creates short-lived temporaries
that are not properly handled by `auto`.
---
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 432 B

Binary file not shown.
Binary file not shown.
Binary file not shown.
+97
View File
@@ -0,0 +1,97 @@
# Try to find suitable version of SuperLU
# Once done, this will define
#
# SuperLU_FOUND - system has SuperLU
# SuperLU_LIBRARY - Link this to use SuperLU
# SuperLU_INCLUDE_DIR - directory of SuperLU headers
find_path(SuperLU_INCLUDE_DIR slu_ddefs.h
PATHS ${CMAKE_SYSTEM_INCLUDE_PATH} /usr/include /usr/local/include /opt/local/include
PATH_SUFFIXES superlu SuperLU ""
)
find_library(SuperLU_LIBRARY
NAMES superlu
PATHS ${CMAKE_SYSTEM_LIBRARY_PATH} /usr/lib64 /usr/lib /usr/local/lib64 /usr/local/lib /opt/local/lib64 /opt/local/lib
)
set(SuperLU_FOUND NO)
if(NOT SuperLU_FIND_QUIETLY)
message(STATUS "Looking for suitable version of SuperLU")
endif()
if(SuperLU_LIBRARY AND SuperLU_INCLUDE_DIR)
# determine if this is a suitable version of SuperLU
if(EXISTS "${SuperLU_INCLUDE_DIR}/slu_ddefs.h")
file(READ "${SuperLU_INCLUDE_DIR}/slu_ddefs.h" _slu_HEADER_CONTENTS)
string(REGEX REPLACE ".*version ([0-9]).*" "\\1" SLU_VERSION_MAJOR "${_slu_HEADER_CONTENTS}")
if("${SLU_VERSION_MAJOR}" EQUAL "7")
set(SuperLU_FOUND YES)
endif()
if("${SLU_VERSION_MAJOR}" EQUAL "6")
set(SuperLU_FOUND YES)
endif()
if("${SLU_VERSION_MAJOR}" EQUAL "5")
set(SuperLU_FOUND YES)
endif()
if("${SLU_VERSION_MAJOR}" EQUAL "4")
# NOTE: SLU_VERSION_MAJOR = 4 is not 100% reliable, as the version string in slu_ddefs.h wasn't updated in SuperLU 5.0, 5.1, 5.2
# NOTE: We need to explicitly check the prototype of dgssvx() to determine whether this is version 4 or 5.
string(FIND "${_slu_HEADER_CONTENTS}" "dgssvx" _slu_dgssvx_start)
if("${_slu_dgssvx_start}" GREATER 0)
string(SUBSTRING "${_slu_HEADER_CONTENTS}" ${_slu_dgssvx_start} -1 _slu_dgssvx_tmp)
string(FIND "${_slu_dgssvx_tmp}" ";" _slu_dgssvx_len)
string(SUBSTRING "${_slu_HEADER_CONTENTS}" ${_slu_dgssvx_start} ${_slu_dgssvx_len} _slu_dgssvx_proto)
string(FIND "${_slu_dgssvx_proto}" "GlobalLU_t" _slu_dgssvx_check)
if("${_slu_dgssvx_check}" EQUAL -1)
# in version 4, dgssvx() doesn't have a GlobalLU_t argument
if(NOT SuperLU_FIND_QUIETLY)
message(STATUS "Found SuperLU 4, which is insufficient")
endif()
else()
set(SuperLU_FOUND YES)
endif()
endif()
endif()
else()
message(STATUS "Could not read ${SuperLU_INCLUDE_DIR}/slu_ddefs.h to verify suitable version")
endif()
endif()
if(SuperLU_LIBRARY AND NOT SuperLU_INCLUDE_DIR)
if(NOT SuperLU_FIND_QUIETLY)
message(STATUS "Incomplete installation of SuperLU: no SuperLU headers found")
endif()
endif()
if(NOT SuperLU_FOUND)
if(NOT SuperLU_FIND_QUIETLY)
message(STATUS "Could not find suitable version of SuperLU")
endif()
else()
message(STATUS "Found SuperLU library: ${SuperLU_LIBRARY}")
endif()
-90
View File
@@ -1,90 +0,0 @@
# Try to find SuperLU 5.x
# Once done, this will define
#
# SuperLU_FOUND - system has SuperLU
# SuperLU_LIBRARY - Link this to use SuperLU
# SuperLU_INCLUDE_DIR - directory of SuperLU headers
find_path(SuperLU_INCLUDE_DIR slu_ddefs.h
PATHS ${CMAKE_SYSTEM_INCLUDE_PATH} /usr/include /usr/local/include /opt/local/include
PATH_SUFFIXES superlu SuperLU ""
)
find_library(SuperLU_LIBRARY
NAMES superlu
PATHS ${CMAKE_SYSTEM_LIBRARY_PATH} /usr/lib64 /usr/lib /usr/local/lib64 /usr/local/lib /opt/local/lib64 /opt/local/lib
)
set(SuperLU_FOUND NO)
if(NOT SuperLU_FIND_QUIETLY)
message(STATUS "Looking for SuperLU version 5")
endif()
if(SuperLU_LIBRARY AND SuperLU_INCLUDE_DIR)
# Now determine if the version is version 5.
# This voodoo is required as SuperLU developers like to keep things messy.
if(EXISTS "${SuperLU_INCLUDE_DIR}/slu_ddefs.h")
file(READ "${SuperLU_INCLUDE_DIR}/slu_ddefs.h" _slu_HEADER_CONTENTS)
string(REGEX REPLACE ".*version ([0-9]).*" "\\1" SLU_VERSION_MAJOR "${_slu_HEADER_CONTENTS}")
if("${SLU_VERSION_MAJOR}" EQUAL "5")
set(SuperLU_FOUND YES)
else()
if("${SLU_VERSION_MAJOR}" EQUAL "4")
# NOTE: SLU_VERSION_MAJOR = 4 is not 100% reliable, as the version string in slu_ddefs.h wasn't updated in SuperLU 5.0, 5.1, 5.2
# NOTE: We need to explicitly check the prototype of dgssvx() to determine whether this is version 4 or 5.
string(FIND "${_slu_HEADER_CONTENTS}" "dgssvx" _slu_dgssvx_start)
if("${_slu_dgssvx_start}" GREATER 0)
string(SUBSTRING "${_slu_HEADER_CONTENTS}" ${_slu_dgssvx_start} -1 _slu_dgssvx_tmp)
string(FIND "${_slu_dgssvx_tmp}" ";" _slu_dgssvx_len)
string(SUBSTRING "${_slu_HEADER_CONTENTS}" ${_slu_dgssvx_start} ${_slu_dgssvx_len} _slu_dgssvx_proto)
string(FIND "${_slu_dgssvx_proto}" "GlobalLU_t" _slu_dgssvx_check)
if("${_slu_dgssvx_check}" EQUAL -1)
# in version 4, dgssvx() doesn't have a GlobalLU_t argument
if(NOT SuperLU_FIND_QUIETLY)
message(STATUS "Found SuperLU, but it doesn't appear to be version 5")
endif()
else()
set(SuperLU_FOUND YES)
endif()
endif()
else()
if(NOT SuperLU_FIND_QUIETLY)
message(STATUS "Found SuperLU version ${SLU_VERSION_MAJOR}, but version 5 is required")
endif()
endif()
endif()
else()
if(NOT SuperLU_FIND_QUIETLY)
message(STATUS "Found SuperLU and headers, but could not verify version 5")
endif()
endif()
endif()
if(SuperLU_LIBRARY AND NOT SuperLU_INCLUDE_DIR)
if(NOT SuperLU_FIND_QUIETLY)
message(STATUS "Incomplete installation of SuperLU: no SuperLU headers found")
endif()
endif()
if(NOT SuperLU_FOUND)
if(NOT SuperLU_FIND_QUIETLY)
message(STATUS "Could not find SuperLU")
endif()
else()
message(STATUS "Found SuperLU: ${SuperLU_LIBRARY}")
endif()
+60 -42
View File
@@ -20,7 +20,7 @@ limitations under the License.
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title>Armadillo: API Documentation</title>
<link rel="icon" href="armadillo_icon.png" type="image/png">
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAARpJREFUOMtjYMABzFuiGYE4BohPA/FvIP6Phv8CMTcuzVxAvAGqeTYQT0HCd6AG3MSlmRWIdwNxLhY5MyC+ADVgLS4DyqAK2NDEBaAuiobKt+Ay4CZUgQRaeKwCYj8gTofKR+My4CNUQSSSWCYQT4ay+6HyprgMOADEs4BYFso3AOITQMwB5W+HGsCPMxCR2LxAfA6INZHE7gHxGwZCAOrvFUDcCsQqUKwFxP+A+CQxBpRgSTwwvIKQZm8gfgbEVkCsgYRToQZ049NsBtVshEUuA2pAAYpfoTQzEEcB8QsgtsdheA/UgFhkwV1AfBuIPwDxOyC2xeO6jVAD5kBd6gQS/AbEX4F4JRDLEwgbUHp4CsRboLETzkApAADMF8+Pl3d18QAAAABJRU5ErkJggg==">
<style type="text/css">
<!--
body
@@ -434,7 +434,7 @@ Conrad Sanderson and Ryan Curtin.
<tr style="background-color: #F5F5F5;"><td><a href="#resize">resize</a></td><td>&nbsp;</td><td>change size while keeping elements and preserving layout</td></tr>
<tr style="background-color: #F5F5F5;"><td><a href="#reverse">reverse</a></td><td>&nbsp;</td><td>reverse order of elements</td></tr>
<tr><td><a href="#roots">roots</a></td><td>&nbsp;</td><td>roots of polynomial</td></tr>
<tr><td><a href="#shift">shift</a></td><td>&nbsp;</td><td>shift elements</td></tr>
<tr><td><a href="#shift">shift</a></td><td>&nbsp;</td><td>circular shift of elements</td></tr>
<tr><td><a href="#shuffle">shuffle</a></td><td>&nbsp;</td><td>randomly shuffle elements</td></tr>
<tr style="background-color: #F5F5F5;"><td><a href="#size">size</a></td><td>&nbsp;</td><td>obtain dimensions of given object</td></tr>
<tr style="background-color: #F5F5F5;"><td><a href="#sort">sort</a></td><td>&nbsp;</td><td>sort elements</td></tr>
@@ -604,7 +604,7 @@ The root matrix class is <b>Mat&lt;</b><i>type</i><b>&gt;</b>, where <i>type</i>
</li>
<br>
<li>
For convenience the following typedefs have been defined:
For convenience, the following typedefs are defined:
<ul>
<table style="text-align: left;" border="0" cellpadding="2" cellspacing="2">
<tbody>
@@ -918,7 +918,7 @@ and inherits most of the member functions
</li>
<br>
<li>
For convenience the following typedefs have been defined:
For convenience, the following typedefs are defined:
<ul>
<table style="text-align: left;" border="0" cellpadding="2" cellspacing="2">
<tbody>
@@ -1217,7 +1217,7 @@ and inherits most of the member functions
</li>
<br>
<li>
For convenience the following typedefs have been defined:
For convenience, the following typedefs are defined:
<ul>
<table style="text-align: left;" border="0" cellpadding="2" cellspacing="2">
<tbody>
@@ -1475,7 +1475,7 @@ The root cube class is <b>Cube&lt;</b><i>type</i><b>&gt;</b>, where <i>type</i>
</li>
<br>
<li>
For convenience the following typedefs have been defined:
For convenience, the following typedefs are defined:
<ul>
<table style="text-align: left;" border="0" cellpadding="2" cellspacing="2">
<tbody>
@@ -1821,7 +1821,7 @@ The root sparse matrix class is <b>SpMat&lt;</b><i>type</i><b>&gt;</b>, where <i
</li>
<br>
<li>
For convenience the following typedefs have been defined:
For convenience, the following typedefs are defined:
<ul>
<table style="text-align: left;" border="0" cellpadding="2" cellspacing="2">
<tbody>
@@ -2266,10 +2266,8 @@ umat ZZ = (AA >= BB);
See also:
<ul>
<li><a href="#approx_equal">approx_equal()</a></li>
<li><a href="#pow">pow()</a></li>
<li><a href="#any">any()</a></li>
<li><a href="#all">all()</a></li>
<li><a href="#affmul">affmul()</a></li>
<li><a href="#accu">accu()</a></li>
<li><a href="#as_scalar">as_scalar()</a></li>
<li><a href="#find">find()</a></li>
@@ -2423,21 +2421,6 @@ An exception is thrown if the requested element is out of bounds.
</tr>
<tr>
<td style="vertical-align: top;">
<code>.at(i)</code>&nbsp;&nbsp;or&nbsp;&nbsp;<code>[i]</code>&nbsp;
</td>
<td style="vertical-align: top;"><br>
</td>
<td style="vertical-align: top;">
As for <code>(i)</code>, but without a bounds check; not recommended; see the caveats below
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td style="vertical-align: top;">
<code>(r,c)</code>
</td>
<td style="vertical-align: top;"><br>
@@ -2454,6 +2437,37 @@ An exception is thrown if the requested element is out of bounds.
</tr>
<tr>
<td style="vertical-align: top;">
<code>(r,c,s)</code>
</td>
<td style="vertical-align: top;"><br>
</td>
<td style="vertical-align: top;">
For <i>cube</i> and <i>3D field</i> classes, access the element/object stored at row <i>r</i>, column <i>c</i>, and slice <i>s</i>.
An exception is thrown if the requested element is out of bounds.
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td style="vertical-align: top;">
<code>.at(i)</code>&nbsp;&nbsp;or&nbsp;&nbsp;<code>[i]</code>&nbsp;
</td>
<td style="vertical-align: top;"><br>
</td>
<td style="vertical-align: top;">
As for <code>(i)</code>, but without a bounds check; not recommended; see the caveats below
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td style="vertical-align: top;">
<code>.at(r,c)</code>
</td>
<td style="vertical-align: top;"><br>
@@ -2471,22 +2485,6 @@ As for <code>(r,c)</code>, but without a bounds check; not recommended; see the
</tr>
<tr>
<td style="vertical-align: top;">
<code>(r,c,s)</code>
</td>
<td style="vertical-align: top;"><br>
</td>
<td style="vertical-align: top;">
For <i>cube</i> and <i>3D field</i> classes, access the element/object stored at row <i>r</i>, column <i>c</i>, and slice <i>s</i>.
An exception is thrown if the requested element is out of bounds.
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td style="vertical-align: top;">
<code>.at(r,c,s)</code>
</td>
<td style="vertical-align: top;"><br>
@@ -2550,7 +2548,6 @@ double y = v(0);
<li><a href="#iterators_mat">iterators (dense matrices)</a></li>
<li><a href="#iterators_cube">iterators (cubes)</a></li>
<li><a href="#iterators_spmat">iterators (sparse matrices)</a></li>
<li><a href="#config_hpp">config.hpp</a></li>
</ul>
</li>
<br>
@@ -19722,6 +19719,28 @@ Use "long&nbsp;long" instead of "int" when calling BLAS and LAPACK functions; th
</tr>
<tr>
<td style="vertical-align: top;">
<code>ARMA_SUPERLU_64BIT_INT</code>
</td>
<td style="vertical-align: top;">
&nbsp;
</td>
<td style="vertical-align: top;">
Use "std::int64_t" instead of "int" when calling SuperLU functions
</td>
</tr>
<tr>
<td style="vertical-align: top;">
&nbsp;
</td>
<td style="vertical-align: top;">
&nbsp;
</td>
<td style="vertical-align: top;">
&nbsp;
</td>
</tr>
<tr>
<td style="vertical-align: top;">
<code>ARMA_USE_FORTRAN_HIDDEN_ARGS</code>
</td>
<td style="vertical-align: top;">
@@ -19847,7 +19866,6 @@ You may also need to enable one or more of the following options:
Use 64 bit integers for matrix and vector sizes.
Automatically enabled when using a 64-bit platform, except when using Armadillo in the R environment (via RcppArmadillo).
Useful if matrices/vectors capable of holding more than 4 billion elements are required.
<!-- Your machine and compiler must have support for 64 bit integers (eg. via "long" or "long&nbsp;long"). -->
This can also be enabled by adding <code>#define&nbsp;ARMA_64BIT_WORD</code> before each instance of <code>#include&nbsp;&lt;armadillo&gt;</code>.
<br>See also the <code>ARMA_BLAS_LONG_LONG</code> option.
</td>
+31 -49
View File
@@ -970,18 +970,17 @@ MapMat_val<eT>::operator*=(const eT in_val)
if(it != it_end)
{
if(in_val != eT(0))
{
eT& val = (*it).second;
val *= in_val;
if(val == eT(0)) { map_ref.erase(it); }
}
else
{
map_ref.erase(it);
}
eT& val = (*it).second;
val *= in_val;
if(val == eT(0)) { map_ref.erase(it); }
}
else
{
const eT val = eT(0) * in_val; // in case in_val is inf or nan
if(val != eT(0)) { parent.set_val(index, val); }
}
}
@@ -1009,9 +1008,7 @@ MapMat_val<eT>::operator/=(const eT in_val)
}
else
{
// silly operation, but included for completeness
const eT val = eT(0) / in_val;
const eT val = eT(0) / in_val; // in case in_val is zero or nan
if(val != eT(0)) { parent.set_val(index, val); }
}
@@ -1481,18 +1478,11 @@ SpMat_MapMat_val<eT>::mul(const eT in_val)
if(it != it_end)
{
if(in_val != eT(0))
{
eT& val = (*it).second;
val *= in_val;
if(val == eT(0)) { map_ref.erase(it); }
}
else
{
map_ref.erase(it);
}
eT& val = (*it).second;
val *= in_val;
if(val == eT(0)) { map_ref.erase(it); }
s_parent.sync_state = 1;
@@ -1500,19 +1490,15 @@ SpMat_MapMat_val<eT>::mul(const eT in_val)
}
else
{
// element not found, ie. it's zero; zero multiplied by anything is zero, except for nan and inf
if(arma_isfinite(in_val) == false)
const eT result = eT(0) * in_val; // in case in_val is inf or nan
if(result != eT(0))
{
const eT result = eT(0) * in_val;
m_parent.set_val(index, result);
if(result != eT(0)) // paranoia, in case compiling with -ffast-math
{
m_parent.set_val(index, result);
s_parent.sync_state = 1;
access::rw(s_parent.n_nonzero) = m_parent.get_n_nonzero();
}
s_parent.sync_state = 1;
access::rw(s_parent.n_nonzero) = m_parent.get_n_nonzero();
}
}
}
@@ -1554,19 +1540,15 @@ SpMat_MapMat_val<eT>::div(const eT in_val)
}
else
{
// element not found, ie. it's zero; zero divided by anything is zero, except for zero and nan
if( (in_val == eT(0)) || (arma_isnan(in_val)) )
const eT result = eT(0) / in_val; // in case in_val is zero or nan
if(result != eT(0))
{
const eT result = eT(0) / in_val;
m_parent.set_val(index, result);
if(result != eT(0)) // paranoia, in case compiling with -ffast-math
{
m_parent.set_val(index, result);
s_parent.sync_state = 1;
access::rw(s_parent.n_nonzero) = m_parent.get_n_nonzero();
}
s_parent.sync_state = 1;
access::rw(s_parent.n_nonzero) = m_parent.get_n_nonzero();
}
}
}
+15 -22
View File
@@ -612,33 +612,26 @@ SpMat<eT>::operator*=(const eT val)
{
arma_debug_sigprint();
if(val != eT(0))
sync_csc();
invalidate_cache();
const uword n_nz = n_nonzero;
eT* vals = access::rwp(values);
bool has_zero = false;
for(uword i=0; i<n_nz; ++i)
{
sync_csc();
invalidate_cache();
eT& vals_i = vals[i];
const uword n_nz = n_nonzero;
vals_i *= val;
eT* vals = access::rwp(values);
bool has_zero = false;
for(uword i=0; i<n_nz; ++i)
{
eT& vals_i = vals[i];
vals_i *= val;
if(vals_i == eT(0)) { has_zero = true; }
}
if(has_zero) { remove_zeros(); }
}
else
{
(*this).zeros();
if(vals_i == eT(0)) { has_zero = true; }
}
if(has_zero) { remove_zeros(); }
return *this;
}
@@ -253,8 +253,6 @@ SpSubview_col_list<eT,T1>::operator*= (const eT val)
{
arma_debug_sigprint();
if(val == eT(0)) { (*this).zeros(); return; }
SpMat<eT>& m_local = const_cast< SpMat<eT>& >(m);
const umat& ci = U_ci.M;
@@ -157,8 +157,6 @@ SpSubview<eT>::operator*=(const eT val)
{
arma_debug_sigprint();
if(val == eT(0)) { (*this).zeros(); return *this; }
if((n_elem == 0) || (n_nonzero == 0)) { return *this; }
m.sync_csc();
+14 -41
View File
@@ -148,24 +148,17 @@ inline
SpValProxy<T1>&
SpValProxy<T1>::operator*=(const eT rhs)
{
if(rhs != eT(0))
if(val_ptr)
{
if(val_ptr)
{
// The value already exists and merely needs to be updated.
*val_ptr *= rhs;
parent.invalidate_cache();
check_zero();
}
*val_ptr *= rhs;
parent.invalidate_cache();
check_zero();
}
else
{
if(val_ptr)
{
// Since we are multiplying by zero, the value can be deleted.
parent.delete_element(row, col);
val_ptr = nullptr;
}
const eT val = eT(0) * rhs; // in case rhs is inf or nan
if(val != eT(0)) { val_ptr = &parent.insert_element(row, col, val); }
}
return *this;
@@ -178,37 +171,17 @@ inline
SpValProxy<T1>&
SpValProxy<T1>::operator/=(const eT rhs)
{
if(rhs != eT(0)) // I hope this is true!
if(val_ptr)
{
if(val_ptr)
{
*val_ptr /= rhs;
parent.invalidate_cache();
check_zero();
}
*val_ptr /= rhs;
parent.invalidate_cache();
check_zero();
}
else
{
if(val_ptr)
{
*val_ptr /= rhs; // That is where it gets ugly.
// Now check if it's 0.
if(*val_ptr == eT(0))
{
parent.delete_element(row, col);
val_ptr = nullptr;
}
}
else
{
eT val = eT(0) / rhs; // This may vary depending on type and implementation.
if(val != eT(0))
{
// Ok, now we have to insert it.
val_ptr = &parent.insert_element(row, col, val);
}
}
const eT val = eT(0) / rhs; // in case rhs is zero or nan
if(val != eT(0)) { val_ptr = &parent.insert_element(row, col, val); }
}
return *this;
+1 -1
View File
@@ -23,7 +23,7 @@
#define ARMA_VERSION_MAJOR 14
#define ARMA_VERSION_MINOR 4
#define ARMA_VERSION_PATCH 1
#define ARMA_VERSION_PATCH 4
#define ARMA_VERSION_NAME "Filtered Espresso"
+1 -4
View File
@@ -169,7 +169,7 @@
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57580
#if (ARMA_GCC_VERSION < 80100)
#pragma message("INFO: support for GCC versions older than 8.1 is deprecated"
#pragma message("INFO: support for GCC versions older than 8.1 is deprecated")
#endif
#define ARMA_GOOD_COMPILER
@@ -477,9 +477,6 @@
#undef major
// WARNING: option 'ARMA_IGNORE_DEPRECATED_MARKER' will be removed;
// WARNING: disabling deprecation messages is counter-productive
#if defined(ARMA_IGNORE_DEPRECATED_MARKER)
#undef arma_deprecated
#define arma_deprecated
+16 -9
View File
@@ -211,7 +211,7 @@
#if defined(ARMA_DEFAULT_OSTREAM)
#pragma message ("WARNING: support for ARMA_DEFAULT_OSTREAM is deprecated and will be removed;")
#pragma message ("WARNING: option ARMA_DEFAULT_OSTREAM is deprecated and will be removed;")
#pragma message ("WARNING: use ARMA_COUT_STREAM and ARMA_CERR_STREAM instead")
#endif
@@ -290,7 +290,7 @@
// for compatibility with earlier versions of Armadillo
#if defined(ARMA_DONT_USE_CXX11_MUTEX)
#pragma message ("WARNING: support for ARMA_DONT_USE_CXX11_MUTEX is deprecated and will be removed;")
#pragma message ("WARNING: option ARMA_DONT_USE_CXX11_MUTEX is deprecated and will be removed;")
#pragma message ("WARNING: use ARMA_DONT_USE_STD_MUTEX instead")
#undef ARMA_USE_STD_MUTEX
#endif
@@ -303,6 +303,18 @@
#undef ARMA_64BIT_WORD
#endif
#if (defined(ARMA_BLAS_LONG_LONG) && defined(ARMA_USE_WRAPPER))
#pragma message ("WARNING: use of ARMA_BLAS_LONG_LONG in conjunction with ARMA_USE_WRAPPER is not supported")
#endif
#if (defined(ARMA_BLAS_64BIT_INT) && defined(ARMA_USE_WRAPPER))
#pragma message ("WARNING: use of ARMA_BLAS_64BIT_INT in conjunction with ARMA_USE_WRAPPER is not supported")
#endif
#if (defined(ARMA_SUPERLU_64BIT_INT) && defined(ARMA_USE_WRAPPER))
#pragma message ("WARNING: use of ARMA_SUPERLU_64BIT_INT in conjunction with ARMA_USE_WRAPPER is not supported")
#endif
// for compatibility with earlier versions of Armadillo
#if defined(ARMA_BLAS_LONG) || defined(ARMA_BLAS_LONG_LONG)
#undef ARMA_BLAS_64BIT_INT
@@ -366,14 +378,9 @@
#undef ARMA_CRIPPLED_LAPACK
#endif
// WARNING: option ARMA_IGNORE_DEPRECATED_MARKER will be removed
// WARNING: option ARMA_CRIPPLED_LAPACK will be removed
#if defined(ARMA_CRIPPLED_LAPACK)
#if (!defined(ARMA_IGNORE_DEPRECATED_MARKER))
#pragma message ("option ARMA_CRIPPLED_LAPACK is deprecated and will be removed")
#endif
#endif
// WARNING: option ARMA_CRIPPLED_LAPACK is deprecated and will be removed
// WARNING: option ARMA_IGNORE_DEPRECATED_MARKER is deprecated and will be removed
// if Armadillo was installed on this system via CMake and ARMA_USE_WRAPPER is not defined,
+16 -9
View File
@@ -211,7 +211,7 @@
#if defined(ARMA_DEFAULT_OSTREAM)
#pragma message ("WARNING: support for ARMA_DEFAULT_OSTREAM is deprecated and will be removed;")
#pragma message ("WARNING: option ARMA_DEFAULT_OSTREAM is deprecated and will be removed;")
#pragma message ("WARNING: use ARMA_COUT_STREAM and ARMA_CERR_STREAM instead")
#endif
@@ -290,7 +290,7 @@
// for compatibility with earlier versions of Armadillo
#if defined(ARMA_DONT_USE_CXX11_MUTEX)
#pragma message ("WARNING: support for ARMA_DONT_USE_CXX11_MUTEX is deprecated and will be removed;")
#pragma message ("WARNING: option ARMA_DONT_USE_CXX11_MUTEX is deprecated and will be removed;")
#pragma message ("WARNING: use ARMA_DONT_USE_STD_MUTEX instead")
#undef ARMA_USE_STD_MUTEX
#endif
@@ -303,6 +303,18 @@
#undef ARMA_64BIT_WORD
#endif
#if (defined(ARMA_BLAS_LONG_LONG) && defined(ARMA_USE_WRAPPER))
#pragma message ("WARNING: use of ARMA_BLAS_LONG_LONG in conjunction with ARMA_USE_WRAPPER is not supported")
#endif
#if (defined(ARMA_BLAS_64BIT_INT) && defined(ARMA_USE_WRAPPER))
#pragma message ("WARNING: use of ARMA_BLAS_64BIT_INT in conjunction with ARMA_USE_WRAPPER is not supported")
#endif
#if (defined(ARMA_SUPERLU_64BIT_INT) && defined(ARMA_USE_WRAPPER))
#pragma message ("WARNING: use of ARMA_SUPERLU_64BIT_INT in conjunction with ARMA_USE_WRAPPER is not supported")
#endif
// for compatibility with earlier versions of Armadillo
#if defined(ARMA_BLAS_LONG) || defined(ARMA_BLAS_LONG_LONG)
#undef ARMA_BLAS_64BIT_INT
@@ -366,14 +378,9 @@
#undef ARMA_CRIPPLED_LAPACK
#endif
// WARNING: option ARMA_IGNORE_DEPRECATED_MARKER will be removed
// WARNING: option ARMA_CRIPPLED_LAPACK will be removed
#if defined(ARMA_CRIPPLED_LAPACK)
#if (!defined(ARMA_IGNORE_DEPRECATED_MARKER))
#pragma message ("option ARMA_CRIPPLED_LAPACK is deprecated and will be removed")
#endif
#endif
// WARNING: option ARMA_CRIPPLED_LAPACK is deprecated and will be removed
// WARNING: option ARMA_IGNORE_DEPRECATED_MARKER is deprecated and will be removed
// if Armadillo was installed on this system via CMake and ARMA_USE_WRAPPER is not defined,
+12 -12
View File
@@ -19,20 +19,20 @@
extern "C"
{
extern void arma_wrapper(sgssv)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperLUStat_t*, int*);
extern void arma_wrapper(dgssv)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperLUStat_t*, int*);
extern void arma_wrapper(cgssv)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperLUStat_t*, int*);
extern void arma_wrapper(zgssv)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperLUStat_t*, int*);
extern void arma_wrapper(sgssv)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperLUStat_t*, superlu::int_t*);
extern void arma_wrapper(dgssv)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperLUStat_t*, superlu::int_t*);
extern void arma_wrapper(cgssv)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperLUStat_t*, superlu::int_t*);
extern void arma_wrapper(zgssv)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperLUStat_t*, superlu::int_t*);
extern void arma_wrapper(sgssvx)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, int*, char*, float*, float*, superlu::SuperMatrix*, superlu::SuperMatrix*, void*, int, superlu::SuperMatrix*, superlu::SuperMatrix*, float*, float*, float*, float*, superlu::GlobalLU_t*, superlu::mem_usage_t*, superlu::SuperLUStat_t*, int*);
extern void arma_wrapper(dgssvx)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, int*, char*, double*, double*, superlu::SuperMatrix*, superlu::SuperMatrix*, void*, int, superlu::SuperMatrix*, superlu::SuperMatrix*, double*, double*, double*, double*, superlu::GlobalLU_t*, superlu::mem_usage_t*, superlu::SuperLUStat_t*, int*);
extern void arma_wrapper(cgssvx)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, int*, char*, float*, float*, superlu::SuperMatrix*, superlu::SuperMatrix*, void*, int, superlu::SuperMatrix*, superlu::SuperMatrix*, float*, float*, float*, float*, superlu::GlobalLU_t*, superlu::mem_usage_t*, superlu::SuperLUStat_t*, int*);
extern void arma_wrapper(zgssvx)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, int*, char*, double*, double*, superlu::SuperMatrix*, superlu::SuperMatrix*, void*, int, superlu::SuperMatrix*, superlu::SuperMatrix*, double*, double*, double*, double*, superlu::GlobalLU_t*, superlu::mem_usage_t*, superlu::SuperLUStat_t*, int*);
extern void arma_wrapper(sgssvx)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, int*, char*, float*, float*, superlu::SuperMatrix*, superlu::SuperMatrix*, void*, superlu::int_t, superlu::SuperMatrix*, superlu::SuperMatrix*, float*, float*, float*, float*, superlu::GlobalLU_t*, superlu::mem_usage_t*, superlu::SuperLUStat_t*, superlu::int_t*);
extern void arma_wrapper(dgssvx)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, int*, char*, double*, double*, superlu::SuperMatrix*, superlu::SuperMatrix*, void*, superlu::int_t, superlu::SuperMatrix*, superlu::SuperMatrix*, double*, double*, double*, double*, superlu::GlobalLU_t*, superlu::mem_usage_t*, superlu::SuperLUStat_t*, superlu::int_t*);
extern void arma_wrapper(cgssvx)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, int*, char*, float*, float*, superlu::SuperMatrix*, superlu::SuperMatrix*, void*, superlu::int_t, superlu::SuperMatrix*, superlu::SuperMatrix*, float*, float*, float*, float*, superlu::GlobalLU_t*, superlu::mem_usage_t*, superlu::SuperLUStat_t*, superlu::int_t*);
extern void arma_wrapper(zgssvx)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, int*, char*, double*, double*, superlu::SuperMatrix*, superlu::SuperMatrix*, void*, superlu::int_t, superlu::SuperMatrix*, superlu::SuperMatrix*, double*, double*, double*, double*, superlu::GlobalLU_t*, superlu::mem_usage_t*, superlu::SuperLUStat_t*, superlu::int_t*);
extern void arma_wrapper(sgstrf)(superlu::superlu_options_t*, superlu::SuperMatrix*, int, int, int*, void*, int, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::GlobalLU_t*, superlu::SuperLUStat_t*, int*);
extern void arma_wrapper(dgstrf)(superlu::superlu_options_t*, superlu::SuperMatrix*, int, int, int*, void*, int, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::GlobalLU_t*, superlu::SuperLUStat_t*, int*);
extern void arma_wrapper(cgstrf)(superlu::superlu_options_t*, superlu::SuperMatrix*, int, int, int*, void*, int, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::GlobalLU_t*, superlu::SuperLUStat_t*, int*);
extern void arma_wrapper(zgstrf)(superlu::superlu_options_t*, superlu::SuperMatrix*, int, int, int*, void*, int, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::GlobalLU_t*, superlu::SuperLUStat_t*, int*);
extern void arma_wrapper(sgstrf)(superlu::superlu_options_t*, superlu::SuperMatrix*, int, int, int*, void*, superlu::int_t, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::GlobalLU_t*, superlu::SuperLUStat_t*, superlu::int_t*);
extern void arma_wrapper(dgstrf)(superlu::superlu_options_t*, superlu::SuperMatrix*, int, int, int*, void*, superlu::int_t, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::GlobalLU_t*, superlu::SuperLUStat_t*, superlu::int_t*);
extern void arma_wrapper(cgstrf)(superlu::superlu_options_t*, superlu::SuperMatrix*, int, int, int*, void*, superlu::int_t, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::GlobalLU_t*, superlu::SuperLUStat_t*, superlu::int_t*);
extern void arma_wrapper(zgstrf)(superlu::superlu_options_t*, superlu::SuperMatrix*, int, int, int*, void*, superlu::int_t, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::GlobalLU_t*, superlu::SuperLUStat_t*, superlu::int_t*);
extern void arma_wrapper(sgstrs)(superlu::trans_t, superlu::SuperMatrix*, superlu::SuperMatrix*, int*, int*, superlu::SuperMatrix*, superlu::SuperLUStat_t*, int*);
extern void arma_wrapper(dgstrs)(superlu::trans_t, superlu::SuperMatrix*, superlu::SuperMatrix*, int*, int*, superlu::SuperMatrix*, superlu::SuperLUStat_t*, int*);
+6
View File
@@ -1121,6 +1121,8 @@ accu(const SpGlue<T1,T2,spglue_schur>& expr)
arma_conform_assert_same_size(px.get_n_rows(), px.get_n_cols(), py.get_n_rows(), py.get_n_cols(), "element-wise multiplication");
if( (px.get_n_nonzero() == 0) && (py.get_n_nonzero() == 0) ) { return eT(0); }
typedef typename SpProxy<T1>::stored_type px_Q_type;
typedef typename SpProxy<T2>::stored_type py_Q_type;
@@ -1162,10 +1164,14 @@ accu(const SpGlue<T1,T2,spglue_schur>& expr)
if((x_it_col < y_it_col) || ((x_it_col == y_it_col) && (x_it_row < y_it_row))) // if y is closer to the end
{
acc += (*x_it) * eT(0); // in case (*x_it) is inf or nan
++x_it;
}
else // x is closer to the end
{
acc += eT(0) * (*y_it); // in case (*y_it) is inf or nan
++y_it;
}
}
+5 -5
View File
@@ -149,8 +149,8 @@ logspace(const double A, const double B, const uword N = 50u)
//! kept for compatibility with old user code
template<typename eT>
arma_warn_unused
arma_inline
arma_frown("change arma::is_finite(val) to std::isfinite(val)")
inline
bool
is_finite(const eT x, const typename arma_scalar_only<eT>::result* junk = nullptr)
{
@@ -163,7 +163,7 @@ is_finite(const eT x, const typename arma_scalar_only<eT>::result* junk = nullpt
//! kept for compatibility with old user code
template<typename T1>
arma_warn_unused
arma_frown("change arma::is_finite(X) to X.is_finite()")
inline
bool
is_finite(const Base<typename T1::elem_type,T1>& X)
@@ -177,7 +177,7 @@ is_finite(const Base<typename T1::elem_type,T1>& X)
//! kept for compatibility with old user code
template<typename T1>
arma_warn_unused
arma_frown("change arma::is_finite(X) to X.is_finite()")
inline
bool
is_finite(const SpBase<typename T1::elem_type,T1>& X)
@@ -191,7 +191,7 @@ is_finite(const SpBase<typename T1::elem_type,T1>& X)
//! kept for compatibility with old user code
template<typename T1>
arma_warn_unused
arma_frown("change arma::is_finite(X) to X.is_finite()")
inline
bool
is_finite(const BaseCube<typename T1::elem_type,T1>& X)
+1 -1
View File
@@ -109,7 +109,7 @@ glue_hist::apply_noalias(Mat<uword>& out, const Mat<eT>& X, const Mat<eT>& C, co
{
const eT val = X_mem[i];
if(is_finite(val))
if(arma_isfinite(val))
{
eT opt_dist = (val >= center_0) ? (val - center_0) : (center_0 - val);
uword opt_index = 0;
@@ -104,6 +104,40 @@ glue_times_redirect2_helper<true>::apply(Mat<typename T1::elem_type>& out, const
const strip_inv<T1> A_strip(X.A);
typedef typename strip_inv<T1>::stored_type T1_stripped;
if( (is_cx<eT>::no) && (strip_inv<T1>::do_inv_gen) && (is_Mat<T1_stripped>::value) && (is_Mat<T2>::value) )
{
const unwrap<T1_stripped> UA(A_strip.M);
const unwrap<T2 > UB(X.B);
const typename unwrap<T1_stripped>::stored_type& A = UA.M;
const typename unwrap<T2 >::stored_type& B = UB.M;
const uword N = A.n_rows;
if( (N > 0) && (N <= uword(3)) && (N == A.n_cols) && (N == B.n_rows) && (void_ptr(&out) != void_ptr(&B)) )
{
arma_debug_print("glue_times_redirect<2>::apply(): inv tiny matrix optimisation");
Mat<eT> AA(N, N, arma_nozeros_indicator());
arrayops::copy(AA.memptr(), A.memptr(), AA.n_elem);
bool inv_status = false;
if(N == 1) { const eT a = AA[0]; AA[0] = eT(1) / a; inv_status = (a != eT(0)); }
if(N == 2) { inv_status = op_inv_gen_full::apply_tiny_2x2(AA); }
if(N == 3) { inv_status = op_inv_gen_full::apply_tiny_3x3(AA); }
if(inv_status) { glue_times::apply<eT,false,false,false>(out, AA, B, eT(0)); return; }
arma_debug_print("glue_times_redirect<2>::apply(): inv tiny matrix optimisation failed");
// fallthrough if optimisation failed
}
}
Mat<eT> A = A_strip.M;
arma_conform_check( (A.is_square() == false), "inv(): given matrix must be square sized" );
+52 -45
View File
@@ -16,7 +16,7 @@
//
// ------------------------------------------------------------------------
//
// This file includes portions of SuperLU 5.2 software,
// This file includes portions of SuperLU 7.0 software,
// licensed under the following conditions.
//
// Copyright (c) 2003, The Regents of the University of California, through
@@ -64,16 +64,23 @@
// and manually specify a few SuperLU structures and function prototypes.
//
// CAVEAT:
// This code requires SuperLU version 5.2,
// and assumes that newer 5.x versions will have no API changes.
// This code requires SuperLU version 7.0, and assumes that newer 7.x versions have no API changes.
namespace arma
{
namespace superlu
{
// slu_*defs.h has int typedefed to int_t.
// I'll just write it as int for simplicity, where I can, but supermatrix.h needs int_t.
typedef int int_t;
// superlu_config.h uses either int or int64_t as int_t
#if defined(ARMA_SUPERLU_64BIT_INT)
#if defined(INT64_MAX)
typedef std::int64_t int_t;
#else
typedef long long int_t;
#endif
#else
typedef int int_t;
#endif
}
}
@@ -84,7 +91,7 @@ namespace arma
namespace superlu
{
// Include supermatrix.h. This gives us SuperMatrix.
// Put it in the slu namespace.
// Put it in the superlu namespace.
// For versions of SuperLU I am familiar with, supermatrix.h does not include any other files.
// Therefore, putting it in the superlu namespace is reasonably safe.
// This same reasoning is true for superlu_enum_consts.h.
@@ -120,7 +127,7 @@ namespace superlu
#undef ARMA_SLU_STR1
#undef ARMA_SLU_STR2
#undef ARMA_SLU_HEADER_A
#undef ARMA_SLU_HEADER_B
@@ -130,7 +137,7 @@ namespace superlu
{
int* panel_histo;
double* utime;
float* ops;
float* ops; // NOTE: orig definition is flops_t* ops, where flops_t = float
int TinyPivots;
int RefineSteps;
int expansions;
@@ -174,16 +181,16 @@ namespace superlu
typedef struct e_node
{
int size;
int_t size;
void* mem;
} ExpHeader;
typedef struct
{
int size;
int used;
int top1;
int top2;
int_t size;
int_t used;
int_t top1;
int_t top2;
void* array;
} LU_stack_t;
@@ -191,16 +198,16 @@ namespace superlu
{
int* xsup;
int* supno;
int* lsub;
int* xlsub;
int_t* lsub;
int_t* xlsub;
void* lusup;
int* xlusup;
int_t* xlusup;
void* ucol;
int* usub;
int* xusub;
int nzlmax;
int nzumax;
int nzlumax;
int_t* usub;
int_t* xusub;
int_t nzlmax;
int_t nzumax;
int_t nzlumax;
int n;
LU_space_t MemModel;
int num_expansions;
@@ -283,23 +290,23 @@ namespace superlu
{
int* panel_histo;
double* utime;
float* ops;
float* ops; // NOTE: orig definition is flops_t* ops, where flops_t = float
int TinyPivots;
int RefineSteps;
int expansions;
} SuperLUStat_t;
typedef enum {NO, YES} yes_no_t;
typedef enum {NO, YES} yes_no_t;
typedef enum {DOFACT, SamePattern, SamePattern_SameRowPerm, FACTORED} fact_t;
typedef enum {NOROWPERM, LargeDiag, MY_PERMR} rowperm_t;
typedef enum {NOROWPERM, LargeDiag_MC64, LargeDiag_HWPM, MY_PERMR} rowperm_t;
typedef enum {NATURAL, MMD_ATA, MMD_AT_PLUS_A, COLAMD,
METIS_AT_PLUS_A, PARMETIS, ZOLTAN, MY_PERMC} colperm_t;
typedef enum {NOTRANS, TRANS, CONJ} trans_t;
typedef enum {NOREFINE, SLU_SINGLE=1, SLU_DOUBLE, SLU_EXTRA} IterRefine_t;
typedef enum {SYSTEM, USER} LU_space_t;
typedef enum {ONE_NORM, TWO_NORM, INF_NORM} norm_t;
typedef enum {SILU, SMILU_1, SMILU_2, SMILU_3} milu_t;
METIS_AT_PLUS_A, PARMETIS, METIS_ATA, ZOLTAN, MY_PERMC} colperm_t;
typedef enum {NOTRANS, TRANS, CONJ} trans_t;
typedef enum {NOREFINE, SLU_SINGLE=1, SLU_DOUBLE, SLU_EXTRA} IterRefine_t;
typedef enum {SYSTEM, USER} LU_space_t;
typedef enum {ONE_NORM, TWO_NORM, INF_NORM} norm_t;
typedef enum {SILU, SMILU_1, SMILU_2, SMILU_3} milu_t;
typedef struct
{
fact_t Fact;
@@ -352,16 +359,16 @@ namespace superlu
typedef struct e_node
{
int size;
int_t size;
void* mem;
} ExpHeader;
typedef struct
{
int size;
int used;
int top1;
int top2;
int_t size;
int_t used;
int_t top1;
int_t top2;
void* array;
} LU_stack_t;
@@ -369,16 +376,16 @@ namespace superlu
{
int* xsup;
int* supno;
int* lsub;
int* xlsub;
int_t* lsub;
int_t* xlsub;
void* lusup;
int* xlusup;
int_t* xlusup;
void* ucol;
int* usub;
int* xusub;
int nzlmax;
int nzumax;
int nzlumax;
int_t* usub;
int_t* xusub;
int_t nzlmax;
int_t nzumax;
int_t nzlumax;
int n;
LU_space_t MemModel;
int num_expansions;
+21 -4
View File
@@ -104,15 +104,29 @@ op_expmat::apply_direct(Mat<typename T1::elem_type>& out, const Base<typename T1
return true;
}
// trace reduction
const eT diag_shift = arma::trace(A) / T(A.n_rows);
const eT exp_diag_shift = std::exp(diag_shift);
const bool do_trace_reduction = arma_isfinite(diag_shift) && arma_isfinite(exp_diag_shift) && (exp_diag_shift != eT(0)) && ( (is_cx<eT>::yes) ? (std::abs(diag_shift) > T(0)) : (access::tmp_real(diag_shift) > T(0)) );
if(do_trace_reduction)
{
arma_debug_print("op_expmat: diag_shift: ", diag_shift);
A.diag() -= diag_shift;
}
const T norm_val = arma::norm(A, "inf");
if(arma_isfinite(norm_val) == false) { return false; }
const double log2_val = (norm_val > T(0)) ? double(eop_aux::log2(norm_val)) : double(0);
int exponent = int(0); std::frexp(norm_val, &exponent);
int exponent = int(0); std::frexp(log2_val, &exponent);
const uword s = (std::min)( uword( (std::max)(int(0), exponent) ), uword(1023) );
const uword s = uword( (std::max)(int(0), exponent + int(1)) );
arma_debug_print("op_expmat: s: ", s);
A /= eT(eop_aux::pow(double(2), double(s)));
@@ -125,7 +139,7 @@ op_expmat::apply_direct(Mat<typename T1::elem_type>& out, const Base<typename T1
bool positive = true;
const uword N = 6;
const uword N = 8;
for(uword i = 2; i <= N; ++i)
{
@@ -148,6 +162,9 @@ op_expmat::apply_direct(Mat<typename T1::elem_type>& out, const Base<typename T1
for(uword i=0; i < s; ++i) { out = out * out; }
// inverse trace reduction
if(do_trace_reduction) { out *= exp_diag_shift; }
return true;
}
+1 -1
View File
@@ -41,7 +41,7 @@ op_median::apply(Mat<typename T1::elem_type>& out, const Op<T1,op_median>& expr)
{
Mat<eT> tmp;
op_median::apply_noalias(out, U.M, dim);
op_median::apply_noalias(tmp, U.M, dim);
out.steal_mem(tmp);
}
+4 -4
View File
@@ -25,11 +25,11 @@ class op_sp_sum
{
public:
template<typename T1>
inline static void apply(Mat<typename T1::elem_type>& out, const mtSpReduceOp<typename T1::elem_type, T1, op_sp_sum>& in);
template<typename eT, typename T1>
inline static void apply(Mat<eT>& out, const mtSpReduceOp<eT, T1, op_sp_sum>& in);
template<typename T1>
inline static void apply(Mat<typename T1::elem_type>& out, const mtSpReduceOp<typename T1::elem_type, SpOp<T1, spop_square>, op_sp_sum>& in);
template<typename eT, typename T1>
inline static void apply(Mat<eT>& out, const mtSpReduceOp<eT, SpOp<T1, spop_square>, op_sp_sum>& in);
};
+6 -6
View File
@@ -21,14 +21,14 @@
template<typename T1>
template<typename eT, typename T1>
inline
void
op_sp_sum::apply(Mat<typename T1::elem_type>& out, const mtSpReduceOp<typename T1::elem_type, T1, op_sp_sum>& in)
op_sp_sum::apply(Mat<eT>& out, const mtSpReduceOp<eT, T1, op_sp_sum>& in)
{
arma_debug_sigprint();
typedef typename T1::elem_type eT;
// NOTE: assuming that eT is the same as T1::elem_type
const uword dim = in.aux_uword_a;
@@ -83,14 +83,14 @@ op_sp_sum::apply(Mat<typename T1::elem_type>& out, const mtSpReduceOp<typename T
template<typename T1>
template<typename eT, typename T1>
inline
void
op_sp_sum::apply(Mat<typename T1::elem_type>& out, const mtSpReduceOp<typename T1::elem_type, SpOp<T1, spop_square>, op_sp_sum>& in)
op_sp_sum::apply(Mat<eT>& out, const mtSpReduceOp<eT, SpOp<T1, spop_square>, op_sp_sum>& in)
{
arma_debug_sigprint();
typedef typename T1::elem_type eT;
// NOTE: assuming that eT is the same as T1::elem_type
const uword dim = in.aux_uword_a;
+18 -13
View File
@@ -1237,21 +1237,21 @@ sp_auxlib::spsolve_simple(Mat<typename T1::elem_type>& X, const SpBase<typename
superlu_stat_wrangler stat;
int info = 0; // Return code.
superlu::int_t info = 0; // Return code.
arma_debug_print("superlu::gssv()");
superlu::gssv<eT>(&options, a.get_ptr(), perm_c.get_ptr(), perm_r.get_ptr(), l.get_ptr(), u.get_ptr(), x.get_ptr(), stat.get_ptr(), &info);
// Process the return code.
if( (info > 0) && (info <= int(A.n_cols)) )
if( (info > 0) && (info <= superlu::int_t(A.n_cols)) )
{
// std::ostringstream tmp;
// tmp << "spsolve(): could not solve system; LU factorisation completed, but detected zero in U(" << (info-1) << ',' << (info-1) << ')';
// arma_warn(1, tmp.str());
}
else
if(info > int(A.n_cols))
if(info > superlu::int_t(A.n_cols))
{
arma_warn(1, "spsolve(): memory allocation failure");
}
@@ -1381,10 +1381,11 @@ sp_auxlib::spsolve_refine(Mat<typename T1::elem_type>& X, typename T1::pod_type&
char equed[8] = {}; // extra characters for paranoia
T rpg = T(0);
T rcond = T(0);
int info = int(0); // Return code.
char work[8] = {};
int lwork = int(0); // 0 means superlu will allocate memory
char work[8] = {};
superlu::int_t lwork = 0; // 0 means superlu will allocate memory
superlu::int_t info = 0; // Return code.
arma_debug_print("superlu::gssvx()");
superlu::gssvx<eT>(&options, a.get_ptr(), perm_c.get_ptr(), perm_r.get_ptr(), etree.get_ptr(), equed, R.get_ptr(), C.get_ptr(), l.get_ptr(), u.get_ptr(), &work[0], lwork, b.get_ptr(), x.get_ptr(), &rpg, &rcond, ferr.get_ptr(), berr.get_ptr(), &glu, &mu, stat.get_ptr(), &info);
@@ -1396,20 +1397,20 @@ sp_auxlib::spsolve_refine(Mat<typename T1::elem_type>& X, typename T1::pod_type&
{
status = true;
}
if( (info > 0) && (info <= int(A.n_cols)) )
if( (info > 0) && (info <= superlu::int_t(A.n_cols)) )
{
// std::ostringstream tmp;
// tmp << "spsolve(): could not solve system; LU factorisation completed, but detected zero in U(" << (info-1) << ',' << (info-1) << ')';
// arma_warn(1, tmp.str());
}
else
if( (info == int(A.n_cols+1)) && (user_opts.allow_ugly) )
if( (info == superlu::int_t(A.n_cols+1)) && (user_opts.allow_ugly) )
{
arma_warn(2, "spsolve(): system is singular to working precision (rcond: ", rcond, ")");
status = true;
}
else
if(info > int(A.n_cols+1))
if(info > superlu::int_t(A.n_cols+1))
{
arma_warn(1, "spsolve(): memory allocation failure");
}
@@ -2027,6 +2028,7 @@ sp_auxlib::run_aupd_plain
arma_ignore(n_eigvals);
arma_ignore(which);
arma_ignore(X);
arma_ignore(Xst);
arma_ignore(sym);
arma_ignore(n);
arma_ignore(tol);
@@ -2123,7 +2125,7 @@ sp_auxlib::run_aupd_shiftinvert
superlu_opts superlu_opts_default;
superlu::superlu_options_t options;
sp_auxlib::set_superlu_opts(options, superlu_opts_default);
int lwork = 0;
superlu::trans_t trans = superlu::NOTRANS;
superlu::GlobalLU_t Glu; /* Not needed on return. */
@@ -2176,7 +2178,9 @@ sp_auxlib::run_aupd_shiftinvert
int panel_size = superlu::sp_ispec_environ(1);
int relax = superlu::sp_ispec_environ(2);
int slu_info = 0; // Return code.
superlu::int_t lwork = 0;
superlu::int_t slu_info = 0; // Return code.
arma_debug_print("superlu::gstrf()");
superlu::get_permutation_c(options.ColPerm, x.get_ptr(), perm_c.get_ptr());
@@ -2704,8 +2708,9 @@ superlu_worker<eT>::factorise(typename get_pod_type<eT>::result& out_rcond, cons
int panel_size = superlu::sp_ispec_environ(1);
int relax = superlu::sp_ispec_environ(2);
int lwork = 0;
int info = 0;
superlu::int_t lwork = 0;
superlu::int_t info = 0;
arma_debug_print("superlu::superlu::get_permutation_c()");
superlu::get_permutation_c(options.ColPerm, AA.get_ptr(), perm_c.get_ptr());
@@ -134,8 +134,6 @@ spdiagview<eT>::operator*=(const eT val)
{
arma_debug_sigprint();
if(val == eT(0)) { (*this).zeros(); return; }
SpMat<eT>& t_m = const_cast< SpMat<eT>& >(m);
const uword t_n_elem = n_elem;
+25 -12
View File
@@ -60,13 +60,13 @@ spglue_schur::apply_noalias(SpMat<eT>& out, const SpProxy<T1>& pa, const SpProxy
arma_conform_assert_same_size(pa.get_n_rows(), pa.get_n_cols(), pb.get_n_rows(), pb.get_n_cols(), "element-wise multiplication");
if( (pa.get_n_nonzero() == 0) || (pb.get_n_nonzero() == 0) )
if( (pa.get_n_nonzero() == 0) && (pb.get_n_nonzero() == 0) )
{
out.zeros(pa.get_n_rows(), pa.get_n_cols());
return;
}
const uword max_n_nonzero = (std::min)(pa.get_n_nonzero(), pb.get_n_nonzero());
const uword max_n_nonzero = pa.get_n_nonzero() + pb.get_n_nonzero();
// Resize memory to upper bound
out.reserve(pa.get_n_rows(), pa.get_n_cols(), max_n_nonzero);
@@ -82,24 +82,19 @@ spglue_schur::apply_noalias(SpMat<eT>& out, const SpProxy<T1>& pa, const SpProxy
while( (x_it != x_end) || (y_it != y_end) )
{
eT out_val;
const uword x_it_row = x_it.row();
const uword x_it_col = x_it.col();
const uword y_it_row = y_it.row();
const uword y_it_col = y_it.col();
bool use_y_loc = false;
if(x_it == y_it)
{
const eT out_val = (*x_it) * (*y_it);
if(out_val != eT(0))
{
access::rw(out.values[count]) = out_val;
access::rw(out.row_indices[count]) = x_it_row;
access::rw(out.col_ptrs[x_it_col + 1])++;
++count;
}
out_val = (*x_it) * (*y_it);
++x_it;
++y_it;
@@ -108,14 +103,32 @@ spglue_schur::apply_noalias(SpMat<eT>& out, const SpProxy<T1>& pa, const SpProxy
{
if((x_it_col < y_it_col) || ((x_it_col == y_it_col) && (x_it_row < y_it_row))) // if y is closer to the end
{
out_val = (*x_it) * eT(0); // in case (*x_it) is inf or nan
++x_it;
}
else
{
out_val = eT(0) * (*y_it); // in case (*y_it) is inf or nan
++y_it;
use_y_loc = true;
}
}
if(out_val != eT(0))
{
access::rw(out.values[count]) = out_val;
const uword out_row = (use_y_loc == false) ? x_it_row : y_it_row;
const uword out_col = (use_y_loc == false) ? x_it_col : y_it_col;
access::rw(out.row_indices[count]) = out_row;
access::rw(out.col_ptrs[out_col + 1])++;
++count;
}
arma_check( (count > max_n_nonzero), "internal error: spglue_schur::apply_noalias(): count > max_n_nonzero" );
}
+3 -22
View File
@@ -45,16 +45,7 @@ spop_scalar_times::apply(SpMat<typename T1::elem_type>& out, const SpOp<T1,spop_
typedef typename T1::elem_type eT;
if(in.aux != eT(0))
{
out.init_xform(in.m, priv::functor_scalar_times<eT>(in.aux));
}
else
{
const SpProxy<T1> P(in.m);
out.zeros( P.get_n_rows(), P.get_n_cols() );
}
out.init_xform(in.m, priv::functor_scalar_times<eT>(in.aux));
}
@@ -83,19 +74,9 @@ spop_cx_scalar_times::apply(SpMat< std::complex<typename T1::pod_type> >& out, c
{
arma_debug_sigprint();
typedef typename T1::pod_type T;
typedef typename std::complex<T> out_eT;
typedef typename T1::pod_type T;
if(in.aux_out_eT != out_eT(0))
{
out.init_xform_mt(in.m, priv::functor_cx_scalar_times<T>(in.aux_out_eT));
}
else
{
const SpProxy<T1> P(in.m);
out.zeros( P.get_n_rows(), P.get_n_cols() );
}
out.init_xform_mt(in.m, priv::functor_cx_scalar_times<T>(in.aux_out_eT));
}
+6 -6
View File
@@ -26,7 +26,7 @@ namespace superlu
template<typename eT>
inline
void
gssv(superlu_options_t* options, SuperMatrix* A, int* perm_c, int* perm_r, SuperMatrix* L, SuperMatrix* U, SuperMatrix* B, SuperLUStat_t* stat, int* info)
gssv(superlu_options_t* options, SuperMatrix* A, int* perm_c, int* perm_r, SuperMatrix* L, SuperMatrix* U, SuperMatrix* B, SuperLUStat_t* stat, superlu::int_t* info)
{
arma_type_check(( is_supported_blas_type<eT>::value == false ));
@@ -63,11 +63,11 @@ namespace superlu
int* etree, char* equed,
typename get_pod_type<eT>::result* R, typename get_pod_type<eT>::result* C,
SuperMatrix* L, SuperMatrix* U,
void* work, int lwork,
void* work, superlu::int_t lwork,
SuperMatrix* B, SuperMatrix* X,
typename get_pod_type<eT>::result* rpg, typename get_pod_type<eT>::result* rcond,
typename get_pod_type<eT>::result* ferr, typename get_pod_type<eT>::result* berr,
GlobalLU_t* glu, mem_usage_t* mu, SuperLUStat_t* stat, int* info
GlobalLU_t* glu, mem_usage_t* mu, SuperLUStat_t* stat, superlu::int_t* info
)
{
arma_type_check(( is_supported_blas_type<eT>::value == false ));
@@ -105,11 +105,11 @@ namespace superlu
gstrf(superlu_options_t* options,
SuperMatrix* A,
int relax,
int panel_size, int *etree,
void *work, int lwork,
int panel_size, int* etree,
void* work, superlu::int_t lwork,
int* perm_c, int* perm_r,
SuperMatrix* L, SuperMatrix* U,
GlobalLU_t* Glu, SuperLUStat_t* stat, int* info
GlobalLU_t* Glu, SuperLUStat_t* stat, superlu::int_t* info
)
{
arma_type_check(( is_supported_blas_type<eT>::value == false ));
+3 -15
View File
@@ -15,10 +15,10 @@
</li>
</ul>
<ul>
<li>Article with overview of functionality in Armadillo
<li>Paper with overview of functionality in Armadillo
<ul>
<li><a href="https://arma.sourceforge.net/armadillo_joss_2016.pdf">armadillo_joss_2016.pdf</a> &nbsp; (online copy)</li>
<li><a href="armadillo_joss_2016.pdf">armadillo_joss_2016.pdf</a> &nbsp; (local copy)</li>
<li><a href="https://arma.sourceforge.net/armadillo_iccae_2025.pdf">armadillo_iccae_2025.pdf</a> &nbsp; (online copy)</li>
<li><a href="armadillo_iccae_2025.pdf">armadillo_iccae_2025.pdf</a> &nbsp; (local copy)</li>
</ul>
</li>
</ul>
@@ -27,10 +27,6 @@
<ul>
<li><a href="https://arma.sourceforge.net/armadillo_mca_2019.pdf">armadillo_mca_2019.pdf</a> &nbsp; (online copy)</li>
<li><a href="armadillo_mca_2019.pdf">armadillo_mca_2019.pdf</a> &nbsp; (local copy)</li>
<!--
<li><a href="https://arma.sourceforge.net/armadillo_lncs_2018.pdf">armadillo_lncs_2018.pdf</a> &nbsp; (online copy)</li>
<li><a href="armadillo_lncs_2018.pdf">armadillo_lncs_2018.pdf</a> &nbsp; (local copy)</li>
-->
</ul>
</li>
</ul>
@@ -51,14 +47,6 @@
</li>
</ul>
<ul>
<li>Overview technical report (old)
<ul>
<li><a href="https://arma.sourceforge.net/armadillo_nicta_2010.pdf">armadillo_nicta_2010.pdf</a> &nbsp; (online copy)</li>
<li><a href="armadillo_nicta_2010.pdf">armadillo_nicta_2010.pdf</a> &nbsp; (local copy)</li>
</ul>
</li>
</ul>
<ul>
<li>Article on integration of Armadillo with R:
<ul>
<li><a href="https://arma.sourceforge.net/armadillo_rcpp_2014.pdf">armadillo_rcpp_2014.pdf</a> &nbsp; (online copy)</li>
+12 -12
View File
@@ -1458,22 +1458,22 @@ extern "C"
#if defined(ARMA_USE_SUPERLU)
void wrapper_sgssv(superlu::superlu_options_t* a, superlu::SuperMatrix* b, int* c, int* d, superlu::SuperMatrix* e, superlu::SuperMatrix* f, superlu::SuperMatrix* g, superlu::SuperLUStat_t* h, int* i)
void wrapper_sgssv(superlu::superlu_options_t* a, superlu::SuperMatrix* b, int* c, int* d, superlu::SuperMatrix* e, superlu::SuperMatrix* f, superlu::SuperMatrix* g, superlu::SuperLUStat_t* h, superlu::int_t* i)
{
sgssv(a,b,c,d,e,f,g,h,i);
}
void wrapper_dgssv(superlu::superlu_options_t* a, superlu::SuperMatrix* b, int* c, int* d, superlu::SuperMatrix* e, superlu::SuperMatrix* f, superlu::SuperMatrix* g, superlu::SuperLUStat_t* h, int* i)
void wrapper_dgssv(superlu::superlu_options_t* a, superlu::SuperMatrix* b, int* c, int* d, superlu::SuperMatrix* e, superlu::SuperMatrix* f, superlu::SuperMatrix* g, superlu::SuperLUStat_t* h, superlu::int_t* i)
{
dgssv(a,b,c,d,e,f,g,h,i);
}
void wrapper_cgssv(superlu::superlu_options_t* a, superlu::SuperMatrix* b, int* c, int* d, superlu::SuperMatrix* e, superlu::SuperMatrix* f, superlu::SuperMatrix* g, superlu::SuperLUStat_t* h, int* i)
void wrapper_cgssv(superlu::superlu_options_t* a, superlu::SuperMatrix* b, int* c, int* d, superlu::SuperMatrix* e, superlu::SuperMatrix* f, superlu::SuperMatrix* g, superlu::SuperLUStat_t* h, superlu::int_t* i)
{
cgssv(a,b,c,d,e,f,g,h,i);
}
void wrapper_zgssv(superlu::superlu_options_t* a, superlu::SuperMatrix* b, int* c, int* d, superlu::SuperMatrix* e, superlu::SuperMatrix* f, superlu::SuperMatrix* g, superlu::SuperLUStat_t* h, int* i)
void wrapper_zgssv(superlu::superlu_options_t* a, superlu::SuperMatrix* b, int* c, int* d, superlu::SuperMatrix* e, superlu::SuperMatrix* f, superlu::SuperMatrix* g, superlu::SuperLUStat_t* h, superlu::int_t* i)
{
zgssv(a,b,c,d,e,f,g,h,i);
}
@@ -1481,22 +1481,22 @@ extern "C"
void wrapper_sgssvx(superlu::superlu_options_t* a, superlu::SuperMatrix* b, int* c, int* d, int* e, char* f, float* g, float* h, superlu::SuperMatrix* i, superlu::SuperMatrix* j, void* k, int l, superlu::SuperMatrix* m, superlu::SuperMatrix* n, float* o, float* p, float* q, float* r, superlu::GlobalLU_t* s, superlu::mem_usage_t* t, superlu::SuperLUStat_t* u, int* v)
void wrapper_sgssvx(superlu::superlu_options_t* a, superlu::SuperMatrix* b, int* c, int* d, int* e, char* f, float* g, float* h, superlu::SuperMatrix* i, superlu::SuperMatrix* j, void* k, superlu::int_t l, superlu::SuperMatrix* m, superlu::SuperMatrix* n, float* o, float* p, float* q, float* r, superlu::GlobalLU_t* s, superlu::mem_usage_t* t, superlu::SuperLUStat_t* u, superlu::int_t* v)
{
sgssvx(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v);
}
void wrapper_dgssvx(superlu::superlu_options_t* a, superlu::SuperMatrix* b, int* c, int* d, int* e, char* f, double* g, double* h, superlu::SuperMatrix* i, superlu::SuperMatrix* j, void* k, int l, superlu::SuperMatrix* m, superlu::SuperMatrix* n, double* o, double* p, double* q, double* r, superlu::GlobalLU_t* s, superlu::mem_usage_t* t, superlu::SuperLUStat_t* u, int* v)
void wrapper_dgssvx(superlu::superlu_options_t* a, superlu::SuperMatrix* b, int* c, int* d, int* e, char* f, double* g, double* h, superlu::SuperMatrix* i, superlu::SuperMatrix* j, void* k, superlu::int_t l, superlu::SuperMatrix* m, superlu::SuperMatrix* n, double* o, double* p, double* q, double* r, superlu::GlobalLU_t* s, superlu::mem_usage_t* t, superlu::SuperLUStat_t* u, superlu::int_t* v)
{
dgssvx(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v);
}
void wrapper_cgssvx(superlu::superlu_options_t* a, superlu::SuperMatrix* b, int* c, int* d, int* e, char* f, float* g, float* h, superlu::SuperMatrix* i, superlu::SuperMatrix* j, void* k, int l, superlu::SuperMatrix* m, superlu::SuperMatrix* n, float* o, float* p, float* q, float* r, superlu::GlobalLU_t* s, superlu::mem_usage_t* t, superlu::SuperLUStat_t* u, int* v)
void wrapper_cgssvx(superlu::superlu_options_t* a, superlu::SuperMatrix* b, int* c, int* d, int* e, char* f, float* g, float* h, superlu::SuperMatrix* i, superlu::SuperMatrix* j, void* k, superlu::int_t l, superlu::SuperMatrix* m, superlu::SuperMatrix* n, float* o, float* p, float* q, float* r, superlu::GlobalLU_t* s, superlu::mem_usage_t* t, superlu::SuperLUStat_t* u, superlu::int_t* v)
{
cgssvx(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v);
}
void wrapper_zgssvx(superlu::superlu_options_t* a, superlu::SuperMatrix* b, int* c, int* d, int* e, char* f, double* g, double* h, superlu::SuperMatrix* i, superlu::SuperMatrix* j, void* k, int l, superlu::SuperMatrix* m, superlu::SuperMatrix* n, double* o, double* p, double* q, double* r, superlu::GlobalLU_t* s, superlu::mem_usage_t* t, superlu::SuperLUStat_t* u, int* v)
void wrapper_zgssvx(superlu::superlu_options_t* a, superlu::SuperMatrix* b, int* c, int* d, int* e, char* f, double* g, double* h, superlu::SuperMatrix* i, superlu::SuperMatrix* j, void* k, superlu::int_t l, superlu::SuperMatrix* m, superlu::SuperMatrix* n, double* o, double* p, double* q, double* r, superlu::GlobalLU_t* s, superlu::mem_usage_t* t, superlu::SuperLUStat_t* u, superlu::int_t* v)
{
zgssvx(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v);
}
@@ -1504,22 +1504,22 @@ extern "C"
void wrapper_sgstrf(superlu::superlu_options_t* a, superlu::SuperMatrix* b, int d, int e, int* f, void* g, int h, int* i, int* j, superlu::SuperMatrix* k, superlu::SuperMatrix* l, superlu::GlobalLU_t* m, superlu::SuperLUStat_t* n, int* o)
void wrapper_sgstrf(superlu::superlu_options_t* a, superlu::SuperMatrix* b, int d, int e, int* f, void* g, superlu::int_t h, int* i, int* j, superlu::SuperMatrix* k, superlu::SuperMatrix* l, superlu::GlobalLU_t* m, superlu::SuperLUStat_t* n, superlu::int_t* o)
{
sgstrf(a, b, d, e, f, g, h, i, j, k, l, m, n, o);
}
void wrapper_dgstrf(superlu::superlu_options_t* a, superlu::SuperMatrix* b, int d, int e, int* f, void* g, int h, int* i, int* j, superlu::SuperMatrix* k, superlu::SuperMatrix* l, superlu::GlobalLU_t* m, superlu::SuperLUStat_t* n, int* o)
void wrapper_dgstrf(superlu::superlu_options_t* a, superlu::SuperMatrix* b, int d, int e, int* f, void* g, superlu::int_t h, int* i, int* j, superlu::SuperMatrix* k, superlu::SuperMatrix* l, superlu::GlobalLU_t* m, superlu::SuperLUStat_t* n, superlu::int_t* o)
{
dgstrf(a, b, d, e, f, g, h, i, j, k, l, m, n, o);
}
void wrapper_cgstrf(superlu::superlu_options_t* a, superlu::SuperMatrix* b, int d, int e, int* f, void* g, int h, int* i, int* j, superlu::SuperMatrix* k, superlu::SuperMatrix* l, superlu::GlobalLU_t* m, superlu::SuperLUStat_t* n, int* o)
void wrapper_cgstrf(superlu::superlu_options_t* a, superlu::SuperMatrix* b, int d, int e, int* f, void* g, superlu::int_t h, int* i, int* j, superlu::SuperMatrix* k, superlu::SuperMatrix* l, superlu::GlobalLU_t* m, superlu::SuperLUStat_t* n, superlu::int_t* o)
{
cgstrf(a, b, d, e, f, g, h, i, j, k, l, m, n, o);
}
void wrapper_zgstrf(superlu::superlu_options_t* a, superlu::SuperMatrix* b, int d, int e, int* f, void* g, int h, int* i, int* j, superlu::SuperMatrix* k, superlu::SuperMatrix* l, superlu::GlobalLU_t* m, superlu::SuperLUStat_t* n, int* o)
void wrapper_zgstrf(superlu::superlu_options_t* a, superlu::SuperMatrix* b, int d, int e, int* f, void* g, superlu::int_t h, int* i, int* j, superlu::SuperMatrix* k, superlu::SuperMatrix* l, superlu::GlobalLU_t* m, superlu::SuperLUStat_t* n, superlu::int_t* o)
{
zgstrf(a, b, d, e, f, g, h, i, j, k, l, m, n, o);
}
+1 -1
View File
@@ -41,5 +41,5 @@ TEST_CASE("fn_cond_2")
{
mat A = zeros<mat>(5,6);
REQUIRE( is_finite(cond(A)) == false );
REQUIRE( std::isfinite(cond(A)) == false );
}
+9 -9
View File
@@ -37,17 +37,17 @@ TEST_CASE("fn_is_finite_1")
mat C = A; C(2,4) = datum::nan;
REQUIRE( is_finite(A) == true );
REQUIRE( is_finite(B) == false );
REQUIRE( is_finite(C) == false );
REQUIRE( (A).is_finite() == true );
REQUIRE( (B).is_finite() == false );
REQUIRE( (C).is_finite() == false );
REQUIRE( is_finite(A+A) == true );
REQUIRE( is_finite(B+B) == false );
REQUIRE( is_finite(C+C) == false );
REQUIRE( (A+A).is_finite() == true );
REQUIRE( (B+B).is_finite() == false );
REQUIRE( (C+C).is_finite() == false );
REQUIRE( is_finite(2*A) == true );
REQUIRE( is_finite(2*B) == false );
REQUIRE( is_finite(2*C) == false );
REQUIRE( (2*A).is_finite() == true );
REQUIRE( (2*B).is_finite() == false );
REQUIRE( (2*C).is_finite() == false );
// REQUIRE_THROWS( );
}
+6 -6
View File
@@ -151,14 +151,14 @@ TEST_CASE("fn_trans_1")
REQUIRE( accu(abs( (A.row(1).t() + A_row1_t) - 2*A_row1_t)) == Approx(0.0).margin(0.001) );
REQUIRE( abs( accu(A.col(1).t()) - accu_A_col1_t ) == Approx(0.0).margin(0.001) );
REQUIRE( abs( accu(A.row(1).t()) - accu_A_row1_t ) == Approx(0.0).margin(0.001) );
REQUIRE( std::abs( accu(A.col(1).t()) - accu_A_col1_t ) == Approx(0.0).margin(0.001) );
REQUIRE( std::abs( accu(A.row(1).t()) - accu_A_row1_t ) == Approx(0.0).margin(0.001) );
REQUIRE( abs( accu(A.col(1).t()) - accu(A.col(1)) ) == Approx(0.0).margin(0.001) );
REQUIRE( abs( accu(A.row(1).t()) - accu(A.row(1)) ) == Approx(0.0).margin(0.001) );
REQUIRE( std::abs( accu(A.col(1).t()) - accu(A.col(1)) ) == Approx(0.0).margin(0.001) );
REQUIRE( std::abs( accu(A.row(1).t()) - accu(A.row(1)) ) == Approx(0.0).margin(0.001) );
REQUIRE( abs( sum(A.col(1).t()) - accu_A_col1_t ) == Approx(0.0).margin(0.001) );
REQUIRE( abs( sum(A.row(1).t()) - accu_A_row1_t ) == Approx(0.0).margin(0.001) );
REQUIRE( std::abs( sum(A.col(1).t()) - accu_A_col1_t ) == Approx(0.0).margin(0.001) );
REQUIRE( std::abs( sum(A.row(1).t()) - accu_A_row1_t ) == Approx(0.0).margin(0.001) );
mat B;
REQUIRE_THROWS( B = A + A.t() );