Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c2b1eea864 | ||
|
|
6eb9394e13 | ||
|
|
391a1df2e8 | ||
|
|
7b718b1ae9 | ||
|
|
bc18db7a51 | ||
|
|
505339b6e5 | ||
|
|
f015fac562 | ||
|
|
502cbca4ba | ||
|
|
5e5331acd4 | ||
|
|
2dddc1367e | ||
|
|
5ca720b31f | ||
|
|
f72922fa68 | ||
|
|
c18e7f0aff | ||
|
|
0c40604508 | ||
|
|
f16c95c5c5 | ||
|
|
65c42d01cd | ||
|
|
485b705757 | ||
|
|
0b77330a4d | ||
|
|
4b93b36b3b | ||
|
|
475b97464d | ||
|
|
09e213b8ee | ||
|
|
16d8d9184a | ||
|
|
db9a72e616 | ||
|
|
a091e28200 | ||
|
|
f0b85ca5f6 | ||
|
|
df0d597efe | ||
|
|
43175ea30a | ||
|
|
5c89440ae6 | ||
|
|
6c9939308c | ||
|
|
fd42b70761 | ||
|
|
edfa27d837 | ||
|
|
1549c14df7 | ||
|
|
5d312b07c1 | ||
|
|
91b672bd1a | ||
|
|
59707c1ae4 | ||
|
|
b2668ee071 | ||
|
|
f447f144fe | ||
|
|
ce914cdf47 | ||
|
|
dc613842b1 | ||
|
|
f290389fbe | ||
|
|
3a7185c261 | ||
|
|
c7861f1fd0 | ||
|
|
63763b6b63 | ||
|
|
8ebb6ac0a2 | ||
|
|
5245bfc6fe | ||
|
|
4f9486699c | ||
|
|
9a45f6cb87 | ||
|
|
f232dde0e4 | ||
|
|
db7395173f | ||
|
|
ba2af98edf | ||
|
|
0998f46768 | ||
|
|
1816783f33 | ||
|
|
c1a8093c81 | ||
|
|
a50f35ea01 | ||
|
|
3ac6dae148 | ||
|
|
289630982c | ||
|
|
d0c03a8854 | ||
|
|
a7d1061a91 | ||
|
|
51e05c104c | ||
|
|
6fea1054d4 | ||
|
|
1d5981c084 | ||
|
|
8d75ca051d | ||
|
|
3d30c3c98b | ||
|
|
6b9b3ee8ca | ||
|
|
0d53547bd7 | ||
|
|
4dbc73b36d | ||
|
|
2784d6c912 | ||
|
|
5ea56be3b7 | ||
|
|
c33258d10c | ||
|
|
db0f9bb7eb | ||
|
|
f44ddefe87 | ||
|
|
27f50ccc77 | ||
|
|
cf989effe6 | ||
|
|
b18e38ed2b | ||
|
|
5b8b5813dc | ||
|
|
5bafc30a2a | ||
|
|
7a63aad350 | ||
|
|
56b74f982e | ||
|
|
05740be686 | ||
|
|
7e67ab4d9a | ||
|
|
0ad1fa65f6 | ||
|
|
7fd68b3333 | ||
|
|
356be8fdf0 | ||
|
|
2f0b2aaf83 | ||
|
|
355cc6adad | ||
|
|
a189f683c4 | ||
|
|
5b64691308 | ||
|
|
f487d19327 | ||
|
|
544afa8b21 | ||
|
|
ab6d553c18 | ||
|
|
ec9abaf635 | ||
|
|
d896f56e06 | ||
|
|
bae404906c | ||
|
|
85b987e5c9 | ||
|
|
0c54c27517 | ||
|
|
e116139d6d | ||
|
|
f441ee87b7 | ||
|
|
787654c911 | ||
|
|
1bb4f5e350 | ||
|
|
24586267cf | ||
|
|
71142882e9 | ||
|
|
c9f960afa9 | ||
|
|
50ff9c704e | ||
|
|
86d6ae5b4c | ||
|
|
9ace567ad4 | ||
|
|
cdb7166177 | ||
|
|
7e560dadd0 | ||
|
|
6ba4f99302 | ||
|
|
712596cd5e | ||
|
|
7ee11c94ec | ||
|
|
8d68fefa48 | ||
|
|
cd1944d9ed | ||
|
|
877568668d | ||
|
|
108adbdf97 | ||
|
|
f76cf14794 | ||
|
|
c4033d8838 | ||
|
|
ced2325184 | ||
|
|
fe9a74bf75 | ||
|
|
6ddb55c173 | ||
|
|
c029b2a22f | ||
|
|
8a9f6482bd | ||
|
|
bae84c796b | ||
|
|
4b0636d0d8 | ||
|
|
cbbf66efc8 | ||
|
|
3a23c33fad | ||
|
|
7de06ecddf | ||
|
|
d59269511f | ||
|
|
38795499cc | ||
|
|
f5ebe93f9f | ||
|
|
8ffcf5383e | ||
|
|
fdd94a2c81 | ||
|
|
2ca675d242 | ||
|
|
9d5cfe2016 | ||
|
|
9e1a000e4b | ||
|
|
e10f142788 | ||
|
|
4639edc493 | ||
|
|
fcd771fda7 | ||
|
|
e22c9e7cff | ||
|
|
69bd3b3693 | ||
|
|
75c40c6549 | ||
|
|
d44d24fd97 | ||
|
|
534b3ab79c | ||
|
|
b247c9618e | ||
|
|
17f02679a9 | ||
|
|
88fdc045cd | ||
|
|
4d2e63c686 | ||
|
|
e073e64481 | ||
|
|
a7a92724d5 | ||
|
|
27a9de7f7d | ||
|
|
2eb4bcb4f3 | ||
|
|
f95602aba2 | ||
|
|
5b65d1ad2a | ||
|
|
6b45328103 | ||
|
|
2be7d8c60f | ||
|
|
e14cc6fac1 | ||
|
|
1ccc7dbd73 | ||
|
|
f3cc6c475a | ||
|
|
db550a6579 | ||
|
|
5b88b2323a | ||
|
|
28ac91cb67 | ||
|
|
83452a0627 | ||
|
|
c5cc28a737 | ||
|
|
9f785eff7e | ||
|
|
cc89707913 | ||
|
|
1a46e0e83b | ||
|
|
39db5b5095 | ||
|
|
efc2bcf316 | ||
|
|
e38cbaab8e | ||
|
|
a30ad16ebe | ||
|
|
d0da492c26 | ||
|
|
3f5d4784fc | ||
|
|
7a15d37a99 | ||
|
|
1e40f043ff | ||
|
|
21f2bf28d2 | ||
|
|
4a5c3d8f27 | ||
|
|
2b49392e7c | ||
|
|
26dcdbbf0a | ||
|
|
16b0912a6f | ||
|
|
644cc2908a | ||
|
|
bfdb9b4d1c | ||
|
|
b3b260c00c | ||
|
|
6991c9aa25 | ||
|
|
e8027c3e14 | ||
|
|
3a719ad581 | ||
|
|
012acbea12 | ||
|
|
8f89982b74 | ||
|
|
3f6aee0ccb | ||
|
|
b2489b2d87 | ||
|
|
925d5c7318 | ||
|
|
3de20fe5cb | ||
|
|
dd1be88826 | ||
|
|
0c8e97e10e | ||
|
|
fa4b928937 | ||
|
|
4001efe359 | ||
|
|
c294a16d84 | ||
|
|
28670b8854 | ||
|
|
c5613778a8 | ||
|
|
d7d3326003 | ||
|
|
2c60189b8f | ||
|
|
3cfd3f90b4 | ||
|
|
db49fc5bb5 | ||
|
|
2eb334e0ab | ||
|
|
52cd25c365 | ||
|
|
43786efafe | ||
|
|
624da4833a | ||
|
|
5bf5668272 | ||
|
|
c94b17927c | ||
|
|
d5e8bae784 | ||
|
|
567d6ccd2c | ||
|
|
7eca200236 | ||
|
|
e7b39cf480 | ||
|
|
51d4f2e898 | ||
|
|
8047a5f342 | ||
|
|
600642f829 | ||
|
|
9d68301372 | ||
|
|
20ca20b31b | ||
|
|
972f2f648f | ||
|
|
273b91efab | ||
|
|
c3b3a42f46 | ||
|
|
8bf1eb2af8 | ||
|
|
9072a2f7c8 | ||
|
|
8abea07d35 | ||
|
|
2fe2b5fa36 | ||
|
|
aba91e9610 | ||
|
|
72f7db891f | ||
|
|
89e7703875 | ||
|
|
276c968a6b | ||
|
|
1e3001be06 | ||
|
|
648710482d | ||
|
|
839f895bbb | ||
|
|
866dcdbd2c | ||
|
|
723676eb7f | ||
|
|
6b63c96af1 | ||
|
|
35f3394324 | ||
|
|
39be977b55 | ||
|
|
95fda0d2e3 | ||
|
|
3f577dc19c | ||
|
|
c9d547c862 | ||
|
|
854d470c63 | ||
|
|
4af55d5abb | ||
|
|
13e400d50e | ||
|
|
e798206b1a | ||
|
|
9302d2911b | ||
|
|
e727967b39 | ||
|
|
92837026c3 | ||
|
|
c28db14b6f | ||
|
|
e218004dbf | ||
|
|
583efe0eb0 | ||
|
|
59fccc4457 | ||
|
|
0bb7d88a3e | ||
|
|
03ee00c429 | ||
|
|
24dd81d2cc | ||
|
|
d37ef70517 | ||
|
|
52b563703e | ||
|
|
08817332b7 | ||
|
|
34722ecab1 | ||
|
|
a3a1372972 | ||
|
|
87f74241f7 | ||
|
|
9237785486 | ||
|
|
4fecf1e97f | ||
|
|
0c9034e3b9 | ||
|
|
b0b031e152 | ||
|
|
9e084f7dab | ||
|
|
cce74c0e49 | ||
|
|
0db44c0fa8 | ||
|
|
fb2fd4a049 | ||
|
|
996bb45534 | ||
|
|
0601761cf2 | ||
|
|
084a695129 | ||
|
|
344f123ac4 | ||
|
|
deaf5c413a | ||
|
|
9fcd2f3449 | ||
|
|
71eeb56cee | ||
|
|
a135bbcb94 | ||
|
|
5f334da813 | ||
|
|
ad478221e1 | ||
|
|
7dc07e12b2 | ||
|
|
8c295b058e | ||
|
|
0e117986aa | ||
|
|
9c9a25f7f6 | ||
|
|
15e03f9bac | ||
|
|
484acbecd6 | ||
|
|
a8200a6bb5 | ||
|
|
511ce72db2 | ||
|
|
677bdb3bad | ||
|
|
79f6b87781 | ||
|
|
39b2a52bd0 | ||
|
|
ac3fcabca8 | ||
|
|
4aaf66547e | ||
|
|
d676e4cfa2 | ||
|
|
3b1ac86a9f | ||
|
|
460e13a272 | ||
|
|
ef4c5a7844 | ||
|
|
d8f31aa94f | ||
|
|
382b0f02d6 | ||
|
|
5155b0bb38 | ||
|
|
69d6fc1319 | ||
|
|
d9d5098203 | ||
|
|
bfb650ea5d | ||
|
|
7369ee1086 | ||
|
|
f06c6ab8f8 | ||
|
|
206606d40d | ||
|
|
1e731455ec | ||
|
|
c87cf374c4 | ||
|
|
bbe5dcf225 | ||
|
|
6fd1531d80 | ||
|
|
30ee79ee37 | ||
|
|
9264db2876 | ||
|
|
35668ad125 | ||
|
|
4e6392f0c2 | ||
|
|
5f833e68ce | ||
|
|
28d1515afa | ||
|
|
0820f68e69 | ||
|
|
c3db1ead03 | ||
|
|
7dadab9eb1 | ||
|
|
46de13b363 | ||
|
|
98df75f7d7 | ||
|
|
91065683da | ||
|
|
ee663d08f6 | ||
|
|
d3c2a9ebd0 | ||
|
|
35610a4944 | ||
|
|
c2175c86ee | ||
|
|
8239b26f62 | ||
|
|
a32600ae17 | ||
|
|
15ffdaf72a | ||
|
|
edbe0c1ed5 | ||
|
|
168e9b9e36 | ||
|
|
4ce154033a | ||
|
|
8155fe8b26 | ||
|
|
2671a1c8d0 | ||
|
|
7e2378d1a0 | ||
|
|
9dea1a92be | ||
|
|
bfd7c162f3 | ||
|
|
f07af5a111 | ||
|
|
d53fcc7e9e | ||
|
|
252d43ae35 | ||
|
|
8e154ddd13 | ||
|
|
feb342fcc1 | ||
|
|
a57df05fd0 | ||
|
|
8039076f07 | ||
|
|
00d75f3962 | ||
|
|
9f8a5cba11 | ||
|
|
78aeb5401b | ||
|
|
f06e5ce249 | ||
|
|
b1a9f62bc5 | ||
|
|
25e0945a29 | ||
|
|
562ea70276 |
+2
-2
@@ -1,12 +1,12 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
# Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
# https://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,
|
||||
|
||||
@@ -30,15 +30,15 @@ Copyright 2017-2025 Data61 / CSIRO
|
||||
8. [Windows: Compiling and Linking](#8-windows-compiling-and-linking)
|
||||
|
||||
9. [Support for OpenBLAS and Intel MKL](#9-support-for-openblas-and-intel-mkl)
|
||||
10. [Caveat on use of C++11 auto Keyword](#10-caveat-on-use-of-c11-auto-keyword)
|
||||
11. [Support for OpenMP](#11-support-for-openmp)
|
||||
10. [Support for OpenMP](#10-support-for-openmp)
|
||||
|
||||
11. [Documentation of Functions and Classes](#11-documentation-of-functions-and-classes)
|
||||
12. [Caveat on use of C++11 auto Keyword](#12-caveat-on-use-of-c11-auto-keyword)
|
||||
|
||||
12. [Documentation of Functions and Classes](#12-documentation-of-functions-and-classes)
|
||||
13. [API Stability and Version Policy](#13-api-stability-and-version-policy)
|
||||
14. [Bug Reports and Frequently Asked Questions](#14-bug-reports-and-frequently-asked-questions)
|
||||
|
||||
15. [MEX Interface to Octave/Matlab](#15-mex-interface-to-octavematlab)
|
||||
16. [Related Software Using Armadillo](#16-related-software-using-armadillo)
|
||||
15. [Related Software Using Armadillo](#15-related-software-using-armadillo)
|
||||
|
||||
---
|
||||
|
||||
@@ -365,27 +365,18 @@ Comment out the line containing:
|
||||
|
||||
---
|
||||
|
||||
### 10: Caveat on use of C++11 auto Keyword
|
||||
|
||||
Use of the C++11 `auto` keyword is not recommended with Armadillo objects and expressions.
|
||||
|
||||
Armadillo has a template meta-programming framework which creates short-lived temporaries
|
||||
that are not properly handled by `auto`.
|
||||
|
||||
---
|
||||
|
||||
### 11: Support for OpenMP
|
||||
### 10: 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++ compiler with OpenMP 3.1+ support.
|
||||
This requires a C++ compiler with OpenMP 4.0+ support.
|
||||
|
||||
For GCC and Clang compilers, use the following option to enable OpenMP:
|
||||
`-fopenmp`
|
||||
|
||||
---
|
||||
|
||||
### 12: Documentation of Functions and Classes
|
||||
### 11: Documentation of Functions and Classes
|
||||
|
||||
The documentation of Armadillo functions and classes is available at:
|
||||
https://arma.sourceforge.net/docs.html
|
||||
@@ -395,6 +386,15 @@ Use a web browser to view it.
|
||||
|
||||
---
|
||||
|
||||
### 12: Caveat on use of C++11 auto Keyword
|
||||
|
||||
Use of the C++11 `auto` keyword is not recommended with Armadillo objects and expressions.
|
||||
|
||||
Armadillo has a template meta-programming framework which creates short-lived temporaries
|
||||
that are not properly handled by `auto`.
|
||||
|
||||
---
|
||||
|
||||
### 13: API Stability and Version Policy
|
||||
|
||||
Each release of Armadillo has its public API (functions, classes, constants)
|
||||
@@ -451,14 +451,7 @@ https://arma.sourceforge.net/faq.html
|
||||
|
||||
---
|
||||
|
||||
### 15: MEX Interface to Octave/Matlab
|
||||
|
||||
The `mex_interface` folder contains examples of how to interface
|
||||
Octave/Matlab with C++ code that uses Armadillo matrices.
|
||||
|
||||
---
|
||||
|
||||
### 16: Related Software Using Armadillo
|
||||
### 15: Related Software Using Armadillo
|
||||
|
||||
* MLPACK: extensive library of machine learning algorithms
|
||||
https://mlpack.org
|
||||
|
||||
+2
-2
@@ -7,11 +7,11 @@ If you have installed Armadillo via the CMake installer:
|
||||
g++ example1.cpp -o example1 -std=c++14 -O2 -larmadillo
|
||||
|
||||
Otherwise, if you want to use Armadillo without installation:
|
||||
g++ example1.cpp -o example1 -std=c++14 -O2 -I /home/user/armadillo-14.0.0/include -DARMA_DONT_USE_WRAPPER -lopenblas
|
||||
g++ example1.cpp -o example1 -std=c++14 -O2 -I /home/user/armadillo-15.0.0/include -DARMA_DONT_USE_WRAPPER -lopenblas
|
||||
|
||||
The above command assumes that the armadillo archive was unpacked into /home/user/
|
||||
The command needs to be adjusted if the archive was unpacked into a different directory,
|
||||
and/or for each specific version of Armadillo (ie. "14.0.0" needs to be changed).
|
||||
and/or for each specific version of Armadillo (ie. "15.0.0" needs to be changed).
|
||||
|
||||
If you don't have OpenBLAS, on Linux change -lopenblas to -lblas -llapack
|
||||
and on macOS change -lopenblas to -framework Accelerate
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
The lib and dll files in this folder are for MSVC running on Windows 10 (64 bit).
|
||||
|
||||
The files were obtained from a pre-compiled release of OpenBLAS 0.3.27:
|
||||
https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.27/OpenBLAS-0.3.27-x64.zip
|
||||
The files were obtained from a pre-compiled release of OpenBLAS 0.3.30:
|
||||
https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.30/OpenBLAS-0.3.30-x64.zip
|
||||
|
||||
The compilation was done by a third party. USE AT YOUR OWN RISK.
|
||||
|
||||
libopenblas.dll is a copy of OpenBLAS-0.3.27-x64/bin/libopenblas.dll
|
||||
libopenblas.lib is a copy of OpenBLAS-0.3.27-x64/lib/libopenblas.dll.a
|
||||
libopenblas.dll is a copy of OpenBLAS-0.3.30-x64/bin/libopenblas.dll
|
||||
libopenblas.lib is a copy of OpenBLAS-0.3.30-x64/lib/libopenblas.dll.a
|
||||
|
||||
OpenBLAS is a high-performance implementation of BLAS and LAPACK.
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
+35
-13
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -54,7 +54,16 @@
|
||||
#include <atomic>
|
||||
|
||||
#if defined(ARMA_USE_STD_MUTEX)
|
||||
#include <mutex>
|
||||
#if defined(__has_include)
|
||||
#if __has_include(<mutex>)
|
||||
#include <mutex>
|
||||
#else
|
||||
#undef ARMA_USE_STD_MUTEX
|
||||
#pragma message ("WARNING: use of std::mutex disabled; mutex header not found")
|
||||
#endif
|
||||
#else
|
||||
#include <mutex>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// #if defined(ARMA_HAVE_CXX17)
|
||||
@@ -62,6 +71,16 @@
|
||||
// #include <system_error>
|
||||
// #endif
|
||||
|
||||
#if defined(ARMA_HAVE_CXX23)
|
||||
#if defined(__has_include)
|
||||
#if __has_include(<stdfloat>)
|
||||
#include <stdfloat>
|
||||
#endif
|
||||
#else
|
||||
#include <stdfloat>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ( defined(__unix__) || defined(__unix) || defined(_POSIX_C_SOURCE) || (defined(__APPLE__) && defined(__MACH__)) ) && !defined(_WIN32)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
@@ -139,6 +158,7 @@ namespace arma
|
||||
#include "armadillo_bits/constants_old.hpp"
|
||||
#include "armadillo_bits/mp_misc.hpp"
|
||||
#include "armadillo_bits/arma_rel_comparators.hpp"
|
||||
#include "armadillo_bits/cond_rel.hpp"
|
||||
#include "armadillo_bits/fill.hpp"
|
||||
|
||||
#if defined(ARMA_RNG_ALT)
|
||||
@@ -171,7 +191,6 @@ namespace arma
|
||||
#include "armadillo_bits/translate_superlu.hpp"
|
||||
#include "armadillo_bits/translate_fftw3.hpp"
|
||||
|
||||
#include "armadillo_bits/cond_rel_bones.hpp"
|
||||
#include "armadillo_bits/arrayops_bones.hpp"
|
||||
#include "armadillo_bits/podarray_bones.hpp"
|
||||
#include "armadillo_bits/auxlib_bones.hpp"
|
||||
@@ -275,7 +294,7 @@ namespace arma
|
||||
#include "armadillo_bits/op_resize_bones.hpp"
|
||||
#include "armadillo_bits/op_cov_bones.hpp"
|
||||
#include "armadillo_bits/op_cor_bones.hpp"
|
||||
#include "armadillo_bits/op_shift_bones.hpp"
|
||||
#include "armadillo_bits/op_circshift_bones.hpp"
|
||||
#include "armadillo_bits/op_shuffle_bones.hpp"
|
||||
#include "armadillo_bits/op_prod_bones.hpp"
|
||||
#include "armadillo_bits/op_pinv_bones.hpp"
|
||||
@@ -283,7 +302,7 @@ namespace arma
|
||||
#include "armadillo_bits/op_flip_bones.hpp"
|
||||
#include "armadillo_bits/op_reverse_bones.hpp"
|
||||
#include "armadillo_bits/op_princomp_bones.hpp"
|
||||
#include "armadillo_bits/op_misc_bones.hpp"
|
||||
#include "armadillo_bits/op_elem_bones.hpp"
|
||||
#include "armadillo_bits/op_orth_null_bones.hpp"
|
||||
#include "armadillo_bits/op_relational_bones.hpp"
|
||||
#include "armadillo_bits/op_find_bones.hpp"
|
||||
@@ -321,6 +340,7 @@ namespace arma
|
||||
#include "armadillo_bits/op_rank_bones.hpp"
|
||||
#include "armadillo_bits/op_row_as_mat_bones.hpp"
|
||||
#include "armadillo_bits/op_col_as_mat_bones.hpp"
|
||||
#include "armadillo_bits/op_accu_bones.hpp"
|
||||
#include "armadillo_bits/op_sp_plus_bones.hpp"
|
||||
#include "armadillo_bits/op_sp_minus_bones.hpp"
|
||||
#include "armadillo_bits/op_sp_sum_bones.hpp"
|
||||
@@ -376,9 +396,10 @@ namespace arma
|
||||
#include "armadillo_bits/spop_repmat_bones.hpp"
|
||||
#include "armadillo_bits/spop_vectorise_bones.hpp"
|
||||
#include "armadillo_bits/spop_norm_bones.hpp"
|
||||
#include "armadillo_bits/spop_shift_bones.hpp"
|
||||
#include "armadillo_bits/spop_circshift_bones.hpp"
|
||||
#include "armadillo_bits/spop_relational_bones.hpp"
|
||||
#include "armadillo_bits/spop_omit_bones.hpp"
|
||||
#include "armadillo_bits/spop_accu_bones.hpp"
|
||||
|
||||
#include "armadillo_bits/spglue_plus_bones.hpp"
|
||||
#include "armadillo_bits/spglue_minus_bones.hpp"
|
||||
@@ -525,10 +546,9 @@ namespace arma
|
||||
#include "armadillo_bits/fn_resize.hpp"
|
||||
#include "armadillo_bits/fn_cov.hpp"
|
||||
#include "armadillo_bits/fn_cor.hpp"
|
||||
#include "armadillo_bits/fn_shift.hpp"
|
||||
#include "armadillo_bits/fn_circshift.hpp"
|
||||
#include "armadillo_bits/fn_shuffle.hpp"
|
||||
#include "armadillo_bits/fn_prod.hpp"
|
||||
#include "armadillo_bits/fn_eps.hpp"
|
||||
#include "armadillo_bits/fn_pinv.hpp"
|
||||
#include "armadillo_bits/fn_rank.hpp"
|
||||
#include "armadillo_bits/fn_kron.hpp"
|
||||
@@ -561,6 +581,7 @@ namespace arma
|
||||
#include "armadillo_bits/fn_inplace_trans.hpp"
|
||||
#include "armadillo_bits/fn_randi.hpp"
|
||||
#include "armadillo_bits/fn_randg.hpp"
|
||||
#include "armadillo_bits/fn_rande.hpp"
|
||||
#include "armadillo_bits/fn_cond_rcond.hpp"
|
||||
#include "armadillo_bits/fn_normalise.hpp"
|
||||
#include "armadillo_bits/fn_clamp.hpp"
|
||||
@@ -662,7 +683,6 @@ namespace arma
|
||||
#include "armadillo_bits/eop_core_meat.hpp"
|
||||
#include "armadillo_bits/eglue_core_meat.hpp"
|
||||
|
||||
#include "armadillo_bits/cond_rel_meat.hpp"
|
||||
#include "armadillo_bits/arrayops_meat.hpp"
|
||||
#include "armadillo_bits/podarray_meat.hpp"
|
||||
#include "armadillo_bits/auxlib_meat.hpp"
|
||||
@@ -733,7 +753,7 @@ namespace arma
|
||||
#include "armadillo_bits/op_resize_meat.hpp"
|
||||
#include "armadillo_bits/op_cov_meat.hpp"
|
||||
#include "armadillo_bits/op_cor_meat.hpp"
|
||||
#include "armadillo_bits/op_shift_meat.hpp"
|
||||
#include "armadillo_bits/op_circshift_meat.hpp"
|
||||
#include "armadillo_bits/op_shuffle_meat.hpp"
|
||||
#include "armadillo_bits/op_prod_meat.hpp"
|
||||
#include "armadillo_bits/op_pinv_meat.hpp"
|
||||
@@ -741,7 +761,7 @@ namespace arma
|
||||
#include "armadillo_bits/op_flip_meat.hpp"
|
||||
#include "armadillo_bits/op_reverse_meat.hpp"
|
||||
#include "armadillo_bits/op_princomp_meat.hpp"
|
||||
#include "armadillo_bits/op_misc_meat.hpp"
|
||||
#include "armadillo_bits/op_elem_meat.hpp"
|
||||
#include "armadillo_bits/op_orth_null_meat.hpp"
|
||||
#include "armadillo_bits/op_relational_meat.hpp"
|
||||
#include "armadillo_bits/op_find_meat.hpp"
|
||||
@@ -779,6 +799,7 @@ namespace arma
|
||||
#include "armadillo_bits/op_rank_meat.hpp"
|
||||
#include "armadillo_bits/op_row_as_mat_meat.hpp"
|
||||
#include "armadillo_bits/op_col_as_mat_meat.hpp"
|
||||
#include "armadillo_bits/op_accu_meat.hpp"
|
||||
#include "armadillo_bits/op_sp_plus_meat.hpp"
|
||||
#include "armadillo_bits/op_sp_minus_meat.hpp"
|
||||
#include "armadillo_bits/op_sp_sum_meat.hpp"
|
||||
@@ -834,9 +855,10 @@ namespace arma
|
||||
#include "armadillo_bits/spop_repmat_meat.hpp"
|
||||
#include "armadillo_bits/spop_vectorise_meat.hpp"
|
||||
#include "armadillo_bits/spop_norm_meat.hpp"
|
||||
#include "armadillo_bits/spop_shift_meat.hpp"
|
||||
#include "armadillo_bits/spop_circshift_meat.hpp"
|
||||
#include "armadillo_bits/spop_relational_meat.hpp"
|
||||
#include "armadillo_bits/spop_omit_meat.hpp"
|
||||
#include "armadillo_bits/spop_accu_meat.hpp"
|
||||
|
||||
#include "armadillo_bits/spglue_plus_meat.hpp"
|
||||
#include "armadillo_bits/spglue_minus_meat.hpp"
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -109,7 +109,7 @@ struct Base_trans<derived, false> { typedef Base_trans_default<derived> result;
|
||||
|
||||
template<typename elem_type, typename derived>
|
||||
struct Base
|
||||
: public Base_extra<elem_type, derived, is_supported_blas_type<elem_type>::value>::result
|
||||
: public Base_extra<elem_type, derived, is_blas_type<elem_type>::value>::result
|
||||
, public Base_eval<elem_type, derived, is_Mat<derived>::value>::result
|
||||
, public Base_trans<derived, is_cx<elem_type>::value>::result
|
||||
{
|
||||
@@ -127,11 +127,11 @@ struct Base
|
||||
arma_warn_unused inline elem_type min() const;
|
||||
arma_warn_unused inline elem_type max() const;
|
||||
|
||||
arma_frown("use .index_min() instead") inline elem_type min(uword& index_of_min_val) const;
|
||||
arma_frown("use .index_max() instead") inline elem_type max(uword& index_of_max_val) const;
|
||||
[[deprecated("use .index_min() instead")]] inline elem_type min(uword& index_of_min_val) const;
|
||||
[[deprecated("use .index_max() instead")]] inline elem_type max(uword& index_of_max_val) const;
|
||||
|
||||
arma_frown("use .index_min() with ind2sub() instead") inline elem_type min(uword& row_of_min_val, uword& col_of_min_val) const;
|
||||
arma_frown("use .index_max() with ind2sub() instead") inline elem_type max(uword& row_of_max_val, uword& col_of_max_val) const;
|
||||
[[deprecated("use .index_min() with ind2sub() instead")]] inline elem_type min(uword& row_of_min_val, uword& col_of_min_val) const;
|
||||
[[deprecated("use .index_max() with ind2sub() instead")]] inline elem_type max(uword& row_of_max_val, uword& col_of_max_val) const;
|
||||
|
||||
arma_warn_unused inline uword index_min() const;
|
||||
arma_warn_unused inline uword index_max() const;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -667,7 +667,7 @@ Base<elem_type,derived>::is_finite() const
|
||||
|
||||
if(arma_config::fast_math_warn) { arma_warn(1, "is_finite(): detection of non-finite values is not reliable in fast math mode"); }
|
||||
|
||||
if(is_Mat<typename Proxy<derived>::stored_type>::value)
|
||||
if( (quasi_unwrap<derived>::has_orig_mem) || (is_Mat<typename Proxy<derived>::stored_type>::value) )
|
||||
{
|
||||
const quasi_unwrap<derived> U( (*this).get_ref() );
|
||||
|
||||
@@ -715,7 +715,7 @@ Base<elem_type,derived>::has_inf() const
|
||||
|
||||
if(arma_config::fast_math_warn) { arma_warn(1, "has_inf(): detection of non-finite values is not reliable in fast math mode"); }
|
||||
|
||||
if(is_Mat<typename Proxy<derived>::stored_type>::value)
|
||||
if( (quasi_unwrap<derived>::has_orig_mem) || (is_Mat<typename Proxy<derived>::stored_type>::value) )
|
||||
{
|
||||
const quasi_unwrap<derived> U( (*this).get_ref() );
|
||||
|
||||
@@ -763,7 +763,7 @@ Base<elem_type,derived>::has_nan() const
|
||||
|
||||
if(arma_config::fast_math_warn) { arma_warn(1, "has_nan(): detection of non-finite values is not reliable in fast math mode"); }
|
||||
|
||||
if(is_Mat<typename Proxy<derived>::stored_type>::value)
|
||||
if( (quasi_unwrap<derived>::has_orig_mem) || (is_Mat<typename Proxy<derived>::stored_type>::value) )
|
||||
{
|
||||
const quasi_unwrap<derived> U( (*this).get_ref() );
|
||||
|
||||
@@ -811,7 +811,7 @@ Base<elem_type,derived>::has_nonfinite() const
|
||||
|
||||
if(arma_config::fast_math_warn) { arma_warn(1, "has_nonfinite(): detection of non-finite values is not reliable in fast math mode"); }
|
||||
|
||||
if(is_Mat<typename Proxy<derived>::stored_type>::value)
|
||||
if( (quasi_unwrap<derived>::has_orig_mem) || (is_Mat<typename Proxy<derived>::stored_type>::value) )
|
||||
{
|
||||
const quasi_unwrap<derived> U( (*this).get_ref() );
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -91,7 +91,7 @@ class Col : public Mat<eT>
|
||||
inline Col(const subview_cube<eT>& X);
|
||||
inline Col& operator=(const subview_cube<eT>& X);
|
||||
|
||||
arma_frown("use braced initialiser list instead") inline mat_injector<Col> operator<<(const eT val);
|
||||
[[deprecated("use braced initialiser list instead")]] inline mat_injector<Col> operator<<(const eT val);
|
||||
|
||||
arma_warn_unused arma_inline const Op<Col<eT>,op_htrans> t() const;
|
||||
arma_warn_unused arma_inline const Op<Col<eT>,op_htrans> ht() const;
|
||||
@@ -141,8 +141,8 @@ class Col : public Mat<eT>
|
||||
|
||||
template<typename T1> inline void shed_rows(const Base<uword, T1>& indices);
|
||||
|
||||
arma_deprecated inline void insert_rows(const uword row_num, const uword N, const bool set_to_zero);
|
||||
inline void insert_rows(const uword row_num, const uword N);
|
||||
[[deprecated]] inline void insert_rows(const uword row_num, const uword N, const bool set_to_zero);
|
||||
inline void insert_rows(const uword row_num, const uword N);
|
||||
|
||||
template<typename T1> inline void insert_rows(const uword row_num, const Base<eT,T1>& X);
|
||||
|
||||
@@ -154,6 +154,11 @@ class Col : public Mat<eT>
|
||||
arma_warn_unused arma_inline const eT& at(const uword in_row, const uword in_col) const;
|
||||
|
||||
|
||||
inline constexpr bool is_vec() const { return true; }
|
||||
inline constexpr bool is_rowvec() const { return false; }
|
||||
inline constexpr bool is_colvec() const { return true; }
|
||||
|
||||
|
||||
typedef eT* row_iterator;
|
||||
typedef const eT* const_row_iterator;
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -483,7 +483,7 @@ Col<eT>::operator=(Col<eT>&& X)
|
||||
// if(X.n_cols != 1) { const Mat<eT>& XX = X; Mat<eT>::operator=(XX); return *this; }
|
||||
//
|
||||
// (*this).steal_mem(X, true);
|
||||
//
|
||||
//
|
||||
// return *this;
|
||||
// }
|
||||
|
||||
@@ -521,11 +521,9 @@ template<typename eT>
|
||||
template<typename T1>
|
||||
inline
|
||||
Col<eT>::Col(const Base<eT,T1>& X)
|
||||
: Mat<eT>(arma_vec_indicator(), 1)
|
||||
: Mat<eT>(X.get_ref(), arma_vec_indicator(), 1)
|
||||
{
|
||||
arma_debug_sigprint();
|
||||
|
||||
Mat<eT>::operator=(X.get_ref());
|
||||
arma_debug_sigprint_this(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -549,11 +547,9 @@ template<typename eT>
|
||||
template<typename T1>
|
||||
inline
|
||||
Col<eT>::Col(const SpBase<eT,T1>& X)
|
||||
: Mat<eT>(arma_vec_indicator(), 1)
|
||||
: Mat<eT>(X.get_ref(), arma_vec_indicator(), 1)
|
||||
{
|
||||
arma_debug_sigprint_this(this);
|
||||
|
||||
Mat<eT>::operator=(X.get_ref());
|
||||
}
|
||||
|
||||
|
||||
@@ -607,12 +603,9 @@ Col<eT>::Col
|
||||
const Base<typename Col<eT>::pod_type, T1>& A,
|
||||
const Base<typename Col<eT>::pod_type, T2>& B
|
||||
)
|
||||
: Mat<eT>(A.get_ref(), B.get_ref(), arma_vec_indicator(), 1)
|
||||
{
|
||||
arma_debug_sigprint();
|
||||
|
||||
access::rw(Mat<eT>::vec_state) = 1;
|
||||
|
||||
Mat<eT>::init(A,B);
|
||||
arma_debug_sigprint_this(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -621,12 +614,9 @@ template<typename eT>
|
||||
template<typename T1>
|
||||
inline
|
||||
Col<eT>::Col(const BaseCube<eT,T1>& X)
|
||||
: Mat<eT>(X.get_ref(), arma_vec_indicator(), 1)
|
||||
{
|
||||
arma_debug_sigprint();
|
||||
|
||||
access::rw(Mat<eT>::vec_state) = 1;
|
||||
|
||||
Mat<eT>::operator=(X);
|
||||
arma_debug_sigprint_this(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -649,12 +639,9 @@ Col<eT>::operator=(const BaseCube<eT,T1>& X)
|
||||
template<typename eT>
|
||||
inline
|
||||
Col<eT>::Col(const subview_cube<eT>& X)
|
||||
: Mat<eT>(X, arma_vec_indicator(), 1)
|
||||
{
|
||||
arma_debug_sigprint();
|
||||
|
||||
access::rw(Mat<eT>::vec_state) = 1;
|
||||
|
||||
Mat<eT>::operator=(X);
|
||||
arma_debug_sigprint_this(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -1277,6 +1264,13 @@ Col<eT>::end_row(const uword row_num) const
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
template<uword fixed_n_elem>
|
||||
arma_inline
|
||||
@@ -1872,6 +1866,10 @@ Col<eT>::fixed<fixed_n_elem>::ones()
|
||||
|
||||
|
||||
|
||||
//
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
inline
|
||||
Col<eT>::Col(const arma_fixed_indicator&, const uword in_n_elem, const eT* in_mem)
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -22,10 +22,8 @@
|
||||
|
||||
|
||||
template<typename T1, typename op_type>
|
||||
class CubeToMatOp : public Base< typename T1::elem_type, CubeToMatOp<T1, op_type> >
|
||||
struct CubeToMatOp : public Base< typename T1::elem_type, CubeToMatOp<T1, op_type> >
|
||||
{
|
||||
public:
|
||||
|
||||
typedef typename T1::elem_type elem_type;
|
||||
typedef typename get_pod_type<elem_type>::result pod_type;
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -218,9 +218,9 @@ class Cube : public BaseCube< eT, Cube<eT> >
|
||||
|
||||
template<typename T1> inline void shed_slices(const Base<uword, T1>& indices);
|
||||
|
||||
arma_deprecated inline void insert_rows(const uword row_num, const uword N, const bool set_to_zero);
|
||||
arma_deprecated inline void insert_cols(const uword row_num, const uword N, const bool set_to_zero);
|
||||
arma_deprecated inline void insert_slices(const uword slice_num, const uword N, const bool set_to_zero);
|
||||
[[deprecated]] inline void insert_rows(const uword row_num, const uword N, const bool set_to_zero);
|
||||
[[deprecated]] inline void insert_cols(const uword row_num, const uword N, const bool set_to_zero);
|
||||
[[deprecated]] inline void insert_slices(const uword slice_num, const uword N, const bool set_to_zero);
|
||||
|
||||
inline void insert_rows(const uword row_num, const uword N);
|
||||
inline void insert_cols(const uword row_num, const uword N);
|
||||
@@ -387,11 +387,11 @@ class Cube : public BaseCube< eT, Cube<eT> >
|
||||
arma_warn_unused inline eT min() const;
|
||||
arma_warn_unused inline eT max() const;
|
||||
|
||||
arma_frown("use .index_min() instead") inline eT min(uword& index_of_min_val) const;
|
||||
arma_frown("use .index_max() instead") inline eT max(uword& index_of_max_val) const;
|
||||
[[deprecated("use .index_min() instead")]] inline eT min(uword& index_of_min_val) const;
|
||||
[[deprecated("use .index_max() instead")]] inline eT max(uword& index_of_max_val) const;
|
||||
|
||||
arma_frown("use .index_min() with ind2sub() instead") inline eT min(uword& row_of_min_val, uword& col_of_min_val, uword& slice_of_min_val) const;
|
||||
arma_frown("use .index_max() with ind2sub() instead") inline eT max(uword& row_of_max_val, uword& col_of_max_val, uword& slice_of_max_val) const;
|
||||
[[deprecated("use .index_min() with ind2sub() instead")]] inline eT min(uword& row_of_min_val, uword& col_of_min_val, uword& slice_of_min_val) const;
|
||||
[[deprecated("use .index_max() with ind2sub() instead")]] inline eT max(uword& row_of_max_val, uword& col_of_max_val, uword& slice_of_max_val) const;
|
||||
|
||||
arma_cold inline bool save(const std::string name, const file_type type = arma_binary) const;
|
||||
arma_cold inline bool save(const hdf5_name& spec, const file_type type = hdf5_binary) const;
|
||||
@@ -401,13 +401,13 @@ class Cube : public BaseCube< eT, Cube<eT> >
|
||||
arma_cold inline bool load(const hdf5_name& spec, const file_type type = hdf5_binary);
|
||||
arma_cold inline bool load( std::istream& is, const file_type type = auto_detect);
|
||||
|
||||
arma_deprecated inline bool quiet_save(const std::string name, const file_type type = arma_binary) const;
|
||||
arma_deprecated inline bool quiet_save(const hdf5_name& spec, const file_type type = hdf5_binary) const;
|
||||
arma_deprecated inline bool quiet_save( std::ostream& os, const file_type type = arma_binary) const;
|
||||
[[deprecated("use save() instead")]] inline bool quiet_save(const std::string name, const file_type type = arma_binary) const;
|
||||
[[deprecated("use save() instead")]] inline bool quiet_save(const hdf5_name& spec, const file_type type = hdf5_binary) const;
|
||||
[[deprecated("use save() instead")]] inline bool quiet_save( std::ostream& os, const file_type type = arma_binary) const;
|
||||
|
||||
arma_deprecated inline bool quiet_load(const std::string name, const file_type type = auto_detect);
|
||||
arma_deprecated inline bool quiet_load(const hdf5_name& spec, const file_type type = hdf5_binary);
|
||||
arma_deprecated inline bool quiet_load( std::istream& is, const file_type type = auto_detect);
|
||||
[[deprecated("use load() instead")]] inline bool quiet_load(const std::string name, const file_type type = auto_detect);
|
||||
[[deprecated("use load() instead")]] inline bool quiet_load(const hdf5_name& spec, const file_type type = hdf5_binary);
|
||||
[[deprecated("use load() instead")]] inline bool quiet_load( std::istream& is, const file_type type = auto_detect);
|
||||
|
||||
|
||||
// iterators
|
||||
@@ -464,11 +464,12 @@ class Cube : public BaseCube< eT, Cube<eT> >
|
||||
inline Mat<eT>* create_mat_ptr(const uword in_slice) const;
|
||||
inline Mat<eT>* get_mat_ptr(const uword in_slice) const;
|
||||
|
||||
friend class glue_join;
|
||||
friend class op_reshape;
|
||||
friend class op_resize;
|
||||
friend class subview_cube<eT>;
|
||||
|
||||
friend struct glue_join;
|
||||
friend struct op_reshape;
|
||||
friend struct op_resize;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -615,7 +615,7 @@ Cube<eT>::get_mat_ptr(const uword in_slice) const
|
||||
|
||||
#if defined(ARMA_USE_OPENMP)
|
||||
{
|
||||
#pragma omp atomic read
|
||||
#pragma omp atomic read seq_cst
|
||||
mat_ptr = mat_ptrs[in_slice];
|
||||
}
|
||||
#elif defined(ARMA_USE_STD_MUTEX)
|
||||
@@ -634,12 +634,12 @@ Cube<eT>::get_mat_ptr(const uword in_slice) const
|
||||
{
|
||||
#pragma omp critical (arma_Cube_mat_ptrs)
|
||||
{
|
||||
#pragma omp atomic read
|
||||
#pragma omp atomic read seq_cst
|
||||
mat_ptr = mat_ptrs[in_slice];
|
||||
|
||||
if(mat_ptr == nullptr) { mat_ptr = create_mat_ptr(in_slice); }
|
||||
|
||||
#pragma omp atomic write
|
||||
#pragma omp atomic write seq_cst
|
||||
mat_ptrs[in_slice] = mat_ptr;
|
||||
}
|
||||
}
|
||||
@@ -2872,12 +2872,12 @@ Cube<eT>::Cube(const eOpCube<T1, eop_type>& X)
|
||||
|
||||
init_cold();
|
||||
|
||||
if(is_same_type<eop_type, eop_pow>::value)
|
||||
if(arma_config::optimise_powexpr && is_same_type<eop_type, eop_pow>::value)
|
||||
{
|
||||
constexpr bool eT_non_int = is_non_integral<eT>::value;
|
||||
constexpr bool eT_ok = is_real_or_cx<eT>::value;
|
||||
|
||||
if( X.aux == eT(2) ) { eop_square::apply(*this, reinterpret_cast< const eOpCube<T1, eop_square>& >(X)); return; }
|
||||
if(eT_non_int && (X.aux == eT(0.5))) { eop_sqrt::apply(*this, reinterpret_cast< const eOpCube<T1, eop_sqrt >& >(X)); return; }
|
||||
if( X.aux == eT(2) ) { eop_square::apply(*this, reinterpret_cast< const eOpCube<T1, eop_square>& >(X)); return; }
|
||||
if(eT_ok && (X.aux == eT(0.5))) { eop_sqrt::apply(*this, reinterpret_cast< const eOpCube<T1, eop_sqrt >& >(X)); return; }
|
||||
}
|
||||
|
||||
eop_type::apply(*this, X);
|
||||
@@ -2902,12 +2902,12 @@ Cube<eT>::operator=(const eOpCube<T1, eop_type>& X)
|
||||
|
||||
init_warm(X.get_n_rows(), X.get_n_cols(), X.get_n_slices());
|
||||
|
||||
if(is_same_type<eop_type, eop_pow>::value)
|
||||
if(arma_config::optimise_powexpr && is_same_type<eop_type, eop_pow>::value)
|
||||
{
|
||||
constexpr bool eT_non_int = is_non_integral<eT>::value;
|
||||
constexpr bool eT_ok = is_real_or_cx<eT>::value;
|
||||
|
||||
if( X.aux == eT(2) ) { eop_square::apply(*this, reinterpret_cast< const eOpCube<T1, eop_square>& >(X)); return *this; }
|
||||
if(eT_non_int && (X.aux == eT(0.5))) { eop_sqrt::apply(*this, reinterpret_cast< const eOpCube<T1, eop_sqrt >& >(X)); return *this; }
|
||||
if( X.aux == eT(2) ) { eop_square::apply(*this, reinterpret_cast< const eOpCube<T1, eop_square>& >(X)); return *this; }
|
||||
if(eT_ok && (X.aux == eT(0.5))) { eop_sqrt::apply(*this, reinterpret_cast< const eOpCube<T1, eop_sqrt >& >(X)); return *this; }
|
||||
}
|
||||
|
||||
eop_type::apply(*this, X);
|
||||
@@ -2932,12 +2932,12 @@ Cube<eT>::operator+=(const eOpCube<T1, eop_type>& X)
|
||||
|
||||
if(bad_alias) { const Cube<eT> tmp(X); return (*this).operator+=(tmp); }
|
||||
|
||||
if(is_same_type<eop_type, eop_pow>::value)
|
||||
if(arma_config::optimise_powexpr && is_same_type<eop_type, eop_pow>::value)
|
||||
{
|
||||
constexpr bool eT_non_int = is_non_integral<eT>::value;
|
||||
constexpr bool eT_ok = is_real_or_cx<eT>::value;
|
||||
|
||||
if( X.aux == eT(2) ) { eop_square::apply_inplace_plus(*this, reinterpret_cast< const eOpCube<T1, eop_square>& >(X)); return *this; }
|
||||
if(eT_non_int && (X.aux == eT(0.5))) { eop_sqrt::apply_inplace_plus(*this, reinterpret_cast< const eOpCube<T1, eop_sqrt >& >(X)); return *this; }
|
||||
if( X.aux == eT(2) ) { eop_square::apply_inplace_plus(*this, reinterpret_cast< const eOpCube<T1, eop_square>& >(X)); return *this; }
|
||||
if(eT_ok && (X.aux == eT(0.5))) { eop_sqrt::apply_inplace_plus(*this, reinterpret_cast< const eOpCube<T1, eop_sqrt >& >(X)); return *this; }
|
||||
}
|
||||
|
||||
eop_type::apply_inplace_plus(*this, X);
|
||||
@@ -2962,12 +2962,12 @@ Cube<eT>::operator-=(const eOpCube<T1, eop_type>& X)
|
||||
|
||||
if(bad_alias) { const Cube<eT> tmp(X); return (*this).operator-=(tmp); }
|
||||
|
||||
if(is_same_type<eop_type, eop_pow>::value)
|
||||
if(arma_config::optimise_powexpr && is_same_type<eop_type, eop_pow>::value)
|
||||
{
|
||||
constexpr bool eT_non_int = is_non_integral<eT>::value;
|
||||
constexpr bool eT_ok = is_real_or_cx<eT>::value;
|
||||
|
||||
if( X.aux == eT(2) ) { eop_square::apply_inplace_minus(*this, reinterpret_cast< const eOpCube<T1, eop_square>& >(X)); return *this; }
|
||||
if(eT_non_int && (X.aux == eT(0.5))) { eop_sqrt::apply_inplace_minus(*this, reinterpret_cast< const eOpCube<T1, eop_sqrt >& >(X)); return *this; }
|
||||
if( X.aux == eT(2) ) { eop_square::apply_inplace_minus(*this, reinterpret_cast< const eOpCube<T1, eop_square>& >(X)); return *this; }
|
||||
if(eT_ok && (X.aux == eT(0.5))) { eop_sqrt::apply_inplace_minus(*this, reinterpret_cast< const eOpCube<T1, eop_sqrt >& >(X)); return *this; }
|
||||
}
|
||||
|
||||
eop_type::apply_inplace_minus(*this, X);
|
||||
@@ -2992,12 +2992,12 @@ Cube<eT>::operator%=(const eOpCube<T1, eop_type>& X)
|
||||
|
||||
if(bad_alias) { const Cube<eT> tmp(X); return (*this).operator%=(tmp); }
|
||||
|
||||
if(is_same_type<eop_type, eop_pow>::value)
|
||||
if(arma_config::optimise_powexpr && is_same_type<eop_type, eop_pow>::value)
|
||||
{
|
||||
constexpr bool eT_non_int = is_non_integral<eT>::value;
|
||||
constexpr bool eT_ok = is_real_or_cx<eT>::value;
|
||||
|
||||
if( X.aux == eT(2) ) { eop_square::apply_inplace_schur(*this, reinterpret_cast< const eOpCube<T1, eop_square>& >(X)); return *this; }
|
||||
if(eT_non_int && (X.aux == eT(0.5))) { eop_sqrt::apply_inplace_schur(*this, reinterpret_cast< const eOpCube<T1, eop_sqrt >& >(X)); return *this; }
|
||||
if( X.aux == eT(2) ) { eop_square::apply_inplace_schur(*this, reinterpret_cast< const eOpCube<T1, eop_square>& >(X)); return *this; }
|
||||
if(eT_ok && (X.aux == eT(0.5))) { eop_sqrt::apply_inplace_schur(*this, reinterpret_cast< const eOpCube<T1, eop_sqrt >& >(X)); return *this; }
|
||||
}
|
||||
|
||||
eop_type::apply_inplace_schur(*this, X);
|
||||
@@ -3022,12 +3022,12 @@ Cube<eT>::operator/=(const eOpCube<T1, eop_type>& X)
|
||||
|
||||
if(bad_alias) { const Cube<eT> tmp(X); return (*this).operator/=(tmp); }
|
||||
|
||||
if(is_same_type<eop_type, eop_pow>::value)
|
||||
if(arma_config::optimise_powexpr && is_same_type<eop_type, eop_pow>::value)
|
||||
{
|
||||
constexpr bool eT_non_int = is_non_integral<eT>::value;
|
||||
constexpr bool eT_ok = is_real_or_cx<eT>::value;
|
||||
|
||||
if( X.aux == eT(2) ) { eop_square::apply_inplace_div(*this, reinterpret_cast< const eOpCube<T1, eop_square>& >(X)); return *this; }
|
||||
if(eT_non_int && (X.aux == eT(0.5))) { eop_sqrt::apply_inplace_div(*this, reinterpret_cast< const eOpCube<T1, eop_sqrt >& >(X)); return *this; }
|
||||
if( X.aux == eT(2) ) { eop_square::apply_inplace_div(*this, reinterpret_cast< const eOpCube<T1, eop_square>& >(X)); return *this; }
|
||||
if(eT_ok && (X.aux == eT(0.5))) { eop_sqrt::apply_inplace_div(*this, reinterpret_cast< const eOpCube<T1, eop_sqrt >& >(X)); return *this; }
|
||||
}
|
||||
|
||||
eop_type::apply_inplace_div(*this, X);
|
||||
@@ -3148,7 +3148,7 @@ Cube<eT>::Cube(const GlueCube<T1, T2, glue_type>& X)
|
||||
{
|
||||
arma_debug_sigprint_this(this);
|
||||
|
||||
this->operator=(X);
|
||||
(*this).operator=(X);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -22,11 +22,9 @@
|
||||
|
||||
//! support class for generator functions (zeros, ones)
|
||||
template<typename eT, typename gen_type>
|
||||
class GenCube
|
||||
struct GenCube
|
||||
: public BaseCube< eT, GenCube<eT, gen_type> >
|
||||
{
|
||||
public:
|
||||
|
||||
typedef eT elem_type;
|
||||
typedef typename get_pod_type<elem_type>::result pod_type;
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -22,11 +22,9 @@
|
||||
|
||||
//! support class for generator functions (zeros, ones, eye)
|
||||
template<typename T1, typename gen_type>
|
||||
class Gen
|
||||
struct Gen
|
||||
: public Base< typename T1::elem_type, Gen<T1, gen_type> >
|
||||
{
|
||||
public:
|
||||
|
||||
typedef typename T1::elem_type elem_type;
|
||||
typedef typename get_pod_type<elem_type>::result pod_type;
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -23,10 +23,8 @@
|
||||
|
||||
//! analog of the Glue class, intended for Cube objects
|
||||
template<typename T1, typename T2, typename glue_type>
|
||||
class GlueCube : public BaseCube< typename T1::elem_type, GlueCube<T1, T2, glue_type> >
|
||||
struct GlueCube : public BaseCube< typename T1::elem_type, GlueCube<T1, T2, glue_type> >
|
||||
{
|
||||
public:
|
||||
|
||||
typedef typename T1::elem_type elem_type;
|
||||
typedef typename get_pod_type<elem_type>::result pod_type;
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -43,12 +43,10 @@ struct Glue_traits<T1, T2, glue_type, false>
|
||||
|
||||
|
||||
template<typename T1, typename T2, typename glue_type>
|
||||
class Glue
|
||||
struct Glue
|
||||
: public Base< typename T1::elem_type, Glue<T1, T2, glue_type> >
|
||||
, public Glue_traits<T1, T2, glue_type, has_nested_glue_traits<glue_type>::value>
|
||||
{
|
||||
public:
|
||||
|
||||
typedef typename T1::elem_type elem_type;
|
||||
typedef typename get_pod_type<elem_type>::result pod_type;
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -99,6 +99,7 @@ class Mat : public Base< eT, Mat<eT> >
|
||||
inline Mat& operator*=(const eT val);
|
||||
inline Mat& operator/=(const eT val);
|
||||
|
||||
inline Mat(const Mat& m, const arma_vec_indicator&, const uhword in_vec_state);
|
||||
inline Mat(const Mat& m);
|
||||
inline Mat& operator= (const Mat& m);
|
||||
inline Mat& operator+=(const Mat& m);
|
||||
@@ -107,6 +108,7 @@ class Mat : public Base< eT, Mat<eT> >
|
||||
inline Mat& operator%=(const Mat& m);
|
||||
inline Mat& operator/=(const Mat& m);
|
||||
|
||||
template<typename T1> inline Mat(const BaseCube<eT,T1>& X, const arma_vec_indicator&, const uhword in_vec_state);
|
||||
template<typename T1> inline Mat(const BaseCube<eT,T1>& X);
|
||||
template<typename T1> inline Mat& operator= (const BaseCube<eT,T1>& X);
|
||||
template<typename T1> inline Mat& operator+=(const BaseCube<eT,T1>& X);
|
||||
@@ -115,11 +117,12 @@ class Mat : public Base< eT, Mat<eT> >
|
||||
template<typename T1> inline Mat& operator%=(const BaseCube<eT,T1>& X);
|
||||
template<typename T1> inline Mat& operator/=(const BaseCube<eT,T1>& X);
|
||||
|
||||
template<typename T1, typename T2>
|
||||
inline explicit Mat(const Base<pod_type,T1>& A, const Base<pod_type,T2>& B);
|
||||
template<typename T1, typename T2> inline explicit Mat(const Base<pod_type,T1>& A, const Base<pod_type,T2>& B, const arma_vec_indicator&, const uhword in_vec_state);
|
||||
template<typename T1, typename T2> inline explicit Mat(const Base<pod_type,T1>& A, const Base<pod_type,T2>& B);
|
||||
|
||||
inline explicit Mat(const subview<eT>& X, const bool use_colmem); // only to be used by the quasi_unwrap class
|
||||
inline explicit Mat(const subview<eT>& X, const bool reuse_mem); // only to be used by quasi_unwrap and partial_unwrap
|
||||
|
||||
inline Mat(const subview<eT>& X, const arma_vec_indicator&, const uhword in_vec_state);
|
||||
inline Mat(const subview<eT>& X);
|
||||
inline Mat& operator= (const subview<eT>& X);
|
||||
inline Mat& operator+=(const subview<eT>& X);
|
||||
@@ -135,6 +138,7 @@ class Mat : public Base< eT, Mat<eT> >
|
||||
template<bool do_conj>
|
||||
inline Mat(const xtrans_mat<eT,do_conj>& X); // xtrans_mat can only be generated by the Proxy class
|
||||
|
||||
inline Mat(const subview_cube<eT>& X, const arma_vec_indicator&, const uhword in_vec_state);
|
||||
inline Mat(const subview_cube<eT>& X);
|
||||
inline Mat& operator= (const subview_cube<eT>& X);
|
||||
inline Mat& operator+=(const subview_cube<eT>& X);
|
||||
@@ -143,6 +147,7 @@ class Mat : public Base< eT, Mat<eT> >
|
||||
inline Mat& operator%=(const subview_cube<eT>& X);
|
||||
inline Mat& operator/=(const subview_cube<eT>& X);
|
||||
|
||||
inline Mat(const diagview<eT>& X, const arma_vec_indicator&, const uhword in_vec_state);
|
||||
inline Mat(const diagview<eT>& X);
|
||||
inline Mat& operator= (const diagview<eT>& X);
|
||||
inline Mat& operator+=(const diagview<eT>& X);
|
||||
@@ -151,6 +156,7 @@ class Mat : public Base< eT, Mat<eT> >
|
||||
inline Mat& operator%=(const diagview<eT>& X);
|
||||
inline Mat& operator/=(const diagview<eT>& X);
|
||||
|
||||
template<typename T1> inline Mat(const subview_elem1<eT,T1>& X, const arma_vec_indicator&, const uhword in_vec_state);
|
||||
template<typename T1> inline Mat(const subview_elem1<eT,T1>& X);
|
||||
template<typename T1> inline Mat& operator= (const subview_elem1<eT,T1>& X);
|
||||
template<typename T1> inline Mat& operator+=(const subview_elem1<eT,T1>& X);
|
||||
@@ -159,6 +165,7 @@ class Mat : public Base< eT, Mat<eT> >
|
||||
template<typename T1> inline Mat& operator%=(const subview_elem1<eT,T1>& X);
|
||||
template<typename T1> inline Mat& operator/=(const subview_elem1<eT,T1>& X);
|
||||
|
||||
template<typename T1, typename T2> inline Mat(const subview_elem2<eT,T1,T2>& X, const arma_vec_indicator&, const uhword in_vec_state);
|
||||
template<typename T1, typename T2> inline Mat(const subview_elem2<eT,T1,T2>& X);
|
||||
template<typename T1, typename T2> inline Mat& operator= (const subview_elem2<eT,T1,T2>& X);
|
||||
template<typename T1, typename T2> inline Mat& operator+=(const subview_elem2<eT,T1,T2>& X);
|
||||
@@ -168,6 +175,7 @@ class Mat : public Base< eT, Mat<eT> >
|
||||
template<typename T1, typename T2> inline Mat& operator/=(const subview_elem2<eT,T1,T2>& X);
|
||||
|
||||
// Operators on sparse matrices (and subviews)
|
||||
template<typename T1> inline explicit Mat(const SpBase<eT, T1>& m, const arma_vec_indicator&, const uhword in_vec_state);
|
||||
template<typename T1> inline explicit Mat(const SpBase<eT, T1>& m);
|
||||
template<typename T1> inline Mat& operator= (const SpBase<eT, T1>& m);
|
||||
template<typename T1> inline Mat& operator+=(const SpBase<eT, T1>& m);
|
||||
@@ -176,11 +184,13 @@ class Mat : public Base< eT, Mat<eT> >
|
||||
template<typename T1> inline Mat& operator%=(const SpBase<eT, T1>& m);
|
||||
template<typename T1> inline Mat& operator/=(const SpBase<eT, T1>& m);
|
||||
|
||||
inline explicit Mat(const SpSubview<eT>& X, const arma_vec_indicator&, const uhword in_vec_state);
|
||||
inline explicit Mat(const SpSubview<eT>& X);
|
||||
inline Mat& operator= (const SpSubview<eT>& X);
|
||||
inline Mat& operator+=(const SpSubview<eT>& X);
|
||||
inline Mat& operator-=(const SpSubview<eT>& X);
|
||||
|
||||
inline explicit Mat(const spdiagview<eT>& X, const arma_vec_indicator&, const uhword in_vec_state);
|
||||
inline explicit Mat(const spdiagview<eT>& X);
|
||||
inline Mat& operator= (const spdiagview<eT>& X);
|
||||
inline Mat& operator+=(const spdiagview<eT>& X);
|
||||
@@ -190,8 +200,8 @@ class Mat : public Base< eT, Mat<eT> >
|
||||
inline Mat& operator/=(const spdiagview<eT>& X);
|
||||
|
||||
|
||||
arma_frown("use braced initialiser list instead") inline mat_injector<Mat> operator<<(const eT val);
|
||||
arma_frown("use braced initialiser list instead") inline mat_injector<Mat> operator<<(const injector_end_of_row<>& x);
|
||||
[[deprecated("use braced initialiser list instead")]] inline mat_injector<Mat> operator<<(const eT val);
|
||||
[[deprecated("use braced initialiser list instead")]] inline mat_injector<Mat> operator<<(const injector_end_of_row<>& x);
|
||||
|
||||
|
||||
arma_inline subview_row<eT> row(const uword row_num);
|
||||
@@ -310,8 +320,8 @@ class Mat : public Base< eT, Mat<eT> >
|
||||
template<typename T1> inline void shed_rows(const Base<uword, T1>& indices);
|
||||
template<typename T1> inline void shed_cols(const Base<uword, T1>& indices);
|
||||
|
||||
arma_frown("use insert_rows(row_num, N) instead") inline void insert_rows(const uword row_num, const uword N, const bool set_to_zero);
|
||||
arma_frown("use insert_cols(col_num, N) instead") inline void insert_cols(const uword col_num, const uword N, const bool set_to_zero);
|
||||
[[deprecated("use insert_rows(row_num, N) instead")]] inline void insert_rows(const uword row_num, const uword N, const bool set_to_zero);
|
||||
[[deprecated("use insert_cols(col_num, N) instead")]] inline void insert_cols(const uword col_num, const uword N, const bool set_to_zero);
|
||||
|
||||
inline void insert_rows(const uword row_num, const uword N);
|
||||
inline void insert_cols(const uword col_num, const uword N);
|
||||
@@ -320,6 +330,7 @@ class Mat : public Base< eT, Mat<eT> >
|
||||
template<typename T1> inline void insert_cols(const uword col_num, const Base<eT,T1>& X);
|
||||
|
||||
|
||||
template<typename T1, typename gen_type> inline Mat(const Gen<T1, gen_type>& X, const arma_vec_indicator&, const uhword in_vec_state);
|
||||
template<typename T1, typename gen_type> inline Mat(const Gen<T1, gen_type>& X);
|
||||
template<typename T1, typename gen_type> inline Mat& operator= (const Gen<T1, gen_type>& X);
|
||||
template<typename T1, typename gen_type> inline Mat& operator+=(const Gen<T1, gen_type>& X);
|
||||
@@ -328,6 +339,7 @@ class Mat : public Base< eT, Mat<eT> >
|
||||
template<typename T1, typename gen_type> inline Mat& operator%=(const Gen<T1, gen_type>& X);
|
||||
template<typename T1, typename gen_type> inline Mat& operator/=(const Gen<T1, gen_type>& X);
|
||||
|
||||
template<typename T1, typename op_type> inline Mat(const Op<T1, op_type>& X, const arma_vec_indicator&, const uhword in_vec_state);
|
||||
template<typename T1, typename op_type> inline Mat(const Op<T1, op_type>& X);
|
||||
template<typename T1, typename op_type> inline Mat& operator= (const Op<T1, op_type>& X);
|
||||
template<typename T1, typename op_type> inline Mat& operator+=(const Op<T1, op_type>& X);
|
||||
@@ -336,6 +348,7 @@ class Mat : public Base< eT, Mat<eT> >
|
||||
template<typename T1, typename op_type> inline Mat& operator%=(const Op<T1, op_type>& X);
|
||||
template<typename T1, typename op_type> inline Mat& operator/=(const Op<T1, op_type>& X);
|
||||
|
||||
template<typename T1, typename eop_type> inline Mat(const eOp<T1, eop_type>& X, const arma_vec_indicator&, const uhword in_vec_state);
|
||||
template<typename T1, typename eop_type> inline Mat(const eOp<T1, eop_type>& X);
|
||||
template<typename T1, typename eop_type> inline Mat& operator= (const eOp<T1, eop_type>& X);
|
||||
template<typename T1, typename eop_type> inline Mat& operator+=(const eOp<T1, eop_type>& X);
|
||||
@@ -344,6 +357,7 @@ class Mat : public Base< eT, Mat<eT> >
|
||||
template<typename T1, typename eop_type> inline Mat& operator%=(const eOp<T1, eop_type>& X);
|
||||
template<typename T1, typename eop_type> inline Mat& operator/=(const eOp<T1, eop_type>& X);
|
||||
|
||||
template<typename T1, typename op_type> inline Mat(const mtOp<eT, T1, op_type>& X, const arma_vec_indicator&, const uhword in_vec_state);
|
||||
template<typename T1, typename op_type> inline Mat(const mtOp<eT, T1, op_type>& X);
|
||||
template<typename T1, typename op_type> inline Mat& operator= (const mtOp<eT, T1, op_type>& X);
|
||||
template<typename T1, typename op_type> inline Mat& operator+=(const mtOp<eT, T1, op_type>& X);
|
||||
@@ -352,6 +366,7 @@ class Mat : public Base< eT, Mat<eT> >
|
||||
template<typename T1, typename op_type> inline Mat& operator%=(const mtOp<eT, T1, op_type>& X);
|
||||
template<typename T1, typename op_type> inline Mat& operator/=(const mtOp<eT, T1, op_type>& X);
|
||||
|
||||
template<typename T1, typename op_type> inline Mat(const CubeToMatOp<T1, op_type>& X, const arma_vec_indicator&, const uhword in_vec_state);
|
||||
template<typename T1, typename op_type> inline Mat(const CubeToMatOp<T1, op_type>& X);
|
||||
template<typename T1, typename op_type> inline Mat& operator= (const CubeToMatOp<T1, op_type>& X);
|
||||
template<typename T1, typename op_type> inline Mat& operator+=(const CubeToMatOp<T1, op_type>& X);
|
||||
@@ -360,6 +375,7 @@ class Mat : public Base< eT, Mat<eT> >
|
||||
template<typename T1, typename op_type> inline Mat& operator%=(const CubeToMatOp<T1, op_type>& X);
|
||||
template<typename T1, typename op_type> inline Mat& operator/=(const CubeToMatOp<T1, op_type>& X);
|
||||
|
||||
template<typename T1, typename op_type> inline Mat(const SpToDOp<T1, op_type>& X, const arma_vec_indicator&, const uhword in_vec_state);
|
||||
template<typename T1, typename op_type> inline Mat(const SpToDOp<T1, op_type>& X);
|
||||
template<typename T1, typename op_type> inline Mat& operator= (const SpToDOp<T1, op_type>& X);
|
||||
template<typename T1, typename op_type> inline Mat& operator+=(const SpToDOp<T1, op_type>& X);
|
||||
@@ -368,6 +384,7 @@ class Mat : public Base< eT, Mat<eT> >
|
||||
template<typename T1, typename op_type> inline Mat& operator%=(const SpToDOp<T1, op_type>& X);
|
||||
template<typename T1, typename op_type> inline Mat& operator/=(const SpToDOp<T1, op_type>& X);
|
||||
|
||||
template<typename T1, typename op_type> inline explicit Mat(const mtSpReduceOp<eT, T1, op_type>& X, const arma_vec_indicator&, const uhword in_vec_state);
|
||||
template<typename T1, typename op_type> inline explicit Mat(const mtSpReduceOp<eT, T1, op_type>& X);
|
||||
template<typename T1, typename op_type> inline Mat& operator= (const mtSpReduceOp<eT, T1, op_type>& X);
|
||||
template<typename T1, typename op_type> inline Mat& operator+=(const mtSpReduceOp<eT, T1, op_type>& X);
|
||||
@@ -376,6 +393,7 @@ class Mat : public Base< eT, Mat<eT> >
|
||||
template<typename T1, typename op_type> inline Mat& operator%=(const mtSpReduceOp<eT, T1, op_type>& X);
|
||||
template<typename T1, typename op_type> inline Mat& operator/=(const mtSpReduceOp<eT, T1, op_type>& X);
|
||||
|
||||
template<typename T1, typename T2, typename glue_type> inline Mat(const Glue<T1, T2, glue_type>& X, const arma_vec_indicator&, const uhword in_vec_state);
|
||||
template<typename T1, typename T2, typename glue_type> inline Mat(const Glue<T1, T2, glue_type>& X);
|
||||
template<typename T1, typename T2, typename glue_type> inline Mat& operator= (const Glue<T1, T2, glue_type>& X);
|
||||
template<typename T1, typename T2, typename glue_type> inline Mat& operator+=(const Glue<T1, T2, glue_type>& X);
|
||||
@@ -387,6 +405,7 @@ class Mat : public Base< eT, Mat<eT> >
|
||||
template<typename T1, typename T2> inline Mat& operator+=(const Glue<T1, T2, glue_times>& X);
|
||||
template<typename T1, typename T2> inline Mat& operator-=(const Glue<T1, T2, glue_times>& X);
|
||||
|
||||
template<typename T1, typename T2, typename eglue_type> inline Mat(const eGlue<T1, T2, eglue_type>& X, const arma_vec_indicator&, const uhword in_vec_state);
|
||||
template<typename T1, typename T2, typename eglue_type> inline Mat(const eGlue<T1, T2, eglue_type>& X);
|
||||
template<typename T1, typename T2, typename eglue_type> inline Mat& operator= (const eGlue<T1, T2, eglue_type>& X);
|
||||
template<typename T1, typename T2, typename eglue_type> inline Mat& operator+=(const eGlue<T1, T2, eglue_type>& X);
|
||||
@@ -395,6 +414,7 @@ class Mat : public Base< eT, Mat<eT> >
|
||||
template<typename T1, typename T2, typename eglue_type> inline Mat& operator%=(const eGlue<T1, T2, eglue_type>& X);
|
||||
template<typename T1, typename T2, typename eglue_type> inline Mat& operator/=(const eGlue<T1, T2, eglue_type>& X);
|
||||
|
||||
template<typename T1, typename T2, typename glue_type> inline Mat(const mtGlue<eT, T1, T2, glue_type>& X, const arma_vec_indicator&, const uhword in_vec_state);
|
||||
template<typename T1, typename T2, typename glue_type> inline Mat(const mtGlue<eT, T1, T2, glue_type>& X);
|
||||
template<typename T1, typename T2, typename glue_type> inline Mat& operator= (const mtGlue<eT, T1, T2, glue_type>& X);
|
||||
template<typename T1, typename T2, typename glue_type> inline Mat& operator+=(const mtGlue<eT, T1, T2, glue_type>& X);
|
||||
@@ -403,6 +423,7 @@ class Mat : public Base< eT, Mat<eT> >
|
||||
template<typename T1, typename T2, typename glue_type> inline Mat& operator%=(const mtGlue<eT, T1, T2, glue_type>& X);
|
||||
template<typename T1, typename T2, typename glue_type> inline Mat& operator/=(const mtGlue<eT, T1, T2, glue_type>& X);
|
||||
|
||||
template<typename T1, typename T2, typename glue_type> inline Mat(const SpToDGlue<T1, T2, glue_type>& X, const arma_vec_indicator&, const uhword in_vec_state);
|
||||
template<typename T1, typename T2, typename glue_type> inline Mat(const SpToDGlue<T1, T2, glue_type>& X);
|
||||
template<typename T1, typename T2, typename glue_type> inline Mat& operator= (const SpToDGlue<T1, T2, glue_type>& X);
|
||||
template<typename T1, typename T2, typename glue_type> inline Mat& operator+=(const SpToDGlue<T1, T2, glue_type>& X);
|
||||
@@ -485,7 +506,7 @@ class Mat : public Base< eT, Mat<eT> >
|
||||
inline Mat& reshape(const uword new_n_rows, const uword new_n_cols);
|
||||
inline Mat& reshape(const SizeMat& s);
|
||||
|
||||
arma_frown("use reshape(n_rows, n_cols) instead") inline void reshape(const uword new_n_rows, const uword new_n_cols, const uword dim); //!< NOTE: don't use this form: it will be removed
|
||||
[[deprecated("use reshape(n_rows, n_cols) instead")]] inline void reshape(const uword new_n_rows, const uword new_n_cols, const uword dim); //!< NOTE: don't use this form: it will be removed
|
||||
|
||||
|
||||
template<typename functor> inline Mat& for_each(functor F);
|
||||
@@ -541,11 +562,11 @@ class Mat : public Base< eT, Mat<eT> >
|
||||
arma_warn_unused inline eT min() const;
|
||||
arma_warn_unused inline eT max() const;
|
||||
|
||||
arma_frown("use .index_min() instead") inline eT min(uword& index_of_min_val) const;
|
||||
arma_frown("use .index_max() instead") inline eT max(uword& index_of_max_val) const;
|
||||
[[deprecated("use .index_min() instead")]] inline eT min(uword& index_of_min_val) const;
|
||||
[[deprecated("use .index_max() instead")]] inline eT max(uword& index_of_max_val) const;
|
||||
|
||||
arma_frown("use .index_min() with ind2sub() instead") inline eT min(uword& row_of_min_val, uword& col_of_min_val) const;
|
||||
arma_frown("use .index_max() with ind2sub() instead") inline eT max(uword& row_of_max_val, uword& col_of_max_val) const;
|
||||
[[deprecated("use .index_min() with ind2sub() instead")]] inline eT min(uword& row_of_min_val, uword& col_of_min_val) const;
|
||||
[[deprecated("use .index_max() with ind2sub() instead")]] inline eT max(uword& row_of_max_val, uword& col_of_max_val) const;
|
||||
|
||||
|
||||
arma_cold inline bool save(const std::string name, const file_type type = arma_binary) const;
|
||||
@@ -558,15 +579,15 @@ class Mat : public Base< eT, Mat<eT> >
|
||||
arma_cold inline bool load(const csv_name& spec, const file_type type = csv_ascii);
|
||||
arma_cold inline bool load( std::istream& is, const file_type type = auto_detect);
|
||||
|
||||
arma_frown("use save() instead") inline bool quiet_save(const std::string name, const file_type type = arma_binary) const;
|
||||
arma_frown("use save() instead") inline bool quiet_save(const hdf5_name& spec, const file_type type = hdf5_binary) const;
|
||||
arma_frown("use save() instead") inline bool quiet_save(const csv_name& spec, const file_type type = csv_ascii) const;
|
||||
arma_frown("use save() instead") inline bool quiet_save( std::ostream& os, const file_type type = arma_binary) const;
|
||||
[[deprecated("use save() instead")]] inline bool quiet_save(const std::string name, const file_type type = arma_binary) const;
|
||||
[[deprecated("use save() instead")]] inline bool quiet_save(const hdf5_name& spec, const file_type type = hdf5_binary) const;
|
||||
[[deprecated("use save() instead")]] inline bool quiet_save(const csv_name& spec, const file_type type = csv_ascii) const;
|
||||
[[deprecated("use save() instead")]] inline bool quiet_save( std::ostream& os, const file_type type = arma_binary) const;
|
||||
|
||||
arma_frown("use load() instead") inline bool quiet_load(const std::string name, const file_type type = auto_detect);
|
||||
arma_frown("use load() instead") inline bool quiet_load(const hdf5_name& spec, const file_type type = hdf5_binary);
|
||||
arma_frown("use load() instead") inline bool quiet_load(const csv_name& spec, const file_type type = csv_ascii);
|
||||
arma_frown("use load() instead") inline bool quiet_load( std::istream& is, const file_type type = auto_detect);
|
||||
[[deprecated("use load() instead")]] inline bool quiet_load(const std::string name, const file_type type = auto_detect);
|
||||
[[deprecated("use load() instead")]] inline bool quiet_load(const hdf5_name& spec, const file_type type = hdf5_binary);
|
||||
[[deprecated("use load() instead")]] inline bool quiet_load(const csv_name& spec, const file_type type = csv_ascii);
|
||||
[[deprecated("use load() instead")]] inline bool quiet_load( std::istream& is, const file_type type = auto_detect);
|
||||
|
||||
|
||||
// for container-like functionality
|
||||
@@ -801,13 +822,14 @@ class Mat : public Base< eT, Mat<eT> >
|
||||
|
||||
friend class Cube<eT>;
|
||||
friend class subview_cube<eT>;
|
||||
friend class glue_join;
|
||||
friend class op_strans;
|
||||
friend class op_htrans;
|
||||
friend class op_resize;
|
||||
friend class op_mean;
|
||||
friend class op_max;
|
||||
friend class op_min;
|
||||
|
||||
friend struct glue_join;
|
||||
friend struct op_strans;
|
||||
friend struct op_htrans;
|
||||
friend struct op_resize;
|
||||
friend struct op_mean;
|
||||
friend struct op_max;
|
||||
friend struct op_min;
|
||||
|
||||
|
||||
public:
|
||||
@@ -957,4 +979,8 @@ class Mat_aux
|
||||
|
||||
|
||||
|
||||
template<typename eT> class Mat_noalias : public Mat<eT> {};
|
||||
|
||||
|
||||
|
||||
//! @}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -880,7 +880,26 @@ Mat<eT>::operator/=(const eT val)
|
||||
|
||||
|
||||
|
||||
//! construct a matrix from a given matrix
|
||||
template<typename eT>
|
||||
inline
|
||||
Mat<eT>::Mat(const Mat<eT>& in_mat, const arma_vec_indicator&, const uhword in_vec_state)
|
||||
: n_rows( (in_vec_state == 2) ? 1 : 0 )
|
||||
, n_cols( (in_vec_state == 1) ? 1 : 0 )
|
||||
, n_elem(0)
|
||||
, n_alloc(0)
|
||||
, vec_state(in_vec_state)
|
||||
, mem_state(0)
|
||||
, mem()
|
||||
{
|
||||
arma_debug_sigprint(arma_str::format("this: %x; in_mat: %x") % this % &in_mat);
|
||||
|
||||
init_warm(in_mat.n_rows, in_mat.n_cols);
|
||||
|
||||
arrayops::copy( memptr(), in_mat.mem, in_mat.n_elem );
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
inline
|
||||
Mat<eT>::Mat(const Mat<eT>& in_mat)
|
||||
@@ -901,7 +920,6 @@ Mat<eT>::Mat(const Mat<eT>& in_mat)
|
||||
|
||||
|
||||
|
||||
//! construct a matrix from a given matrix
|
||||
template<typename eT>
|
||||
inline
|
||||
Mat<eT>&
|
||||
@@ -1496,6 +1514,25 @@ Mat<eT>::operator/=(const Mat<eT>& m)
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
template<typename T1>
|
||||
inline
|
||||
Mat<eT>::Mat(const BaseCube<eT,T1>& X, const arma_vec_indicator&, const uhword in_vec_state)
|
||||
: n_rows( (in_vec_state == 2) ? 1 : 0 )
|
||||
, n_cols( (in_vec_state == 1) ? 1 : 0 )
|
||||
, n_elem(0)
|
||||
, n_alloc(0)
|
||||
, vec_state(in_vec_state)
|
||||
, mem_state(0)
|
||||
, mem()
|
||||
{
|
||||
arma_debug_sigprint_this(this);
|
||||
|
||||
(*this).operator=(X);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
template<typename T1>
|
||||
inline
|
||||
@@ -1943,15 +1980,30 @@ Mat<eT>::operator/=(const BaseCube<eT,T1>& X)
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
template<typename T1, typename T2>
|
||||
inline
|
||||
Mat<eT>::Mat(const Base<typename Mat<eT>::pod_type,T1>& A, const Base<typename Mat<eT>::pod_type,T2>& B, const arma_vec_indicator&, const uhword in_vec_state)
|
||||
: n_rows( (in_vec_state == 2) ? 1 : 0 )
|
||||
, n_cols( (in_vec_state == 1) ? 1 : 0 )
|
||||
, n_elem(0)
|
||||
, n_alloc(0)
|
||||
, vec_state(in_vec_state)
|
||||
, mem_state(0)
|
||||
, mem()
|
||||
{
|
||||
arma_debug_sigprint_this(this);
|
||||
|
||||
init(A,B);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! for constructing a complex matrix out of two non-complex matrices
|
||||
template<typename eT>
|
||||
template<typename T1, typename T2>
|
||||
inline
|
||||
Mat<eT>::Mat
|
||||
(
|
||||
const Base<typename Mat<eT>::pod_type,T1>& A,
|
||||
const Base<typename Mat<eT>::pod_type,T2>& B
|
||||
)
|
||||
Mat<eT>::Mat(const Base<typename Mat<eT>::pod_type,T1>& A, const Base<typename Mat<eT>::pod_type,T2>& B)
|
||||
: n_rows(0)
|
||||
, n_cols(0)
|
||||
, n_elem(0)
|
||||
@@ -1969,18 +2021,18 @@ Mat<eT>::Mat
|
||||
|
||||
template<typename eT>
|
||||
inline
|
||||
Mat<eT>::Mat(const subview<eT>& X, const bool use_colmem)
|
||||
Mat<eT>::Mat(const subview<eT>& X, const bool reuse_mem)
|
||||
: n_rows(X.n_rows)
|
||||
, n_cols(X.n_cols)
|
||||
, n_elem(X.n_elem)
|
||||
, n_alloc(0)
|
||||
, vec_state(0)
|
||||
, mem_state(use_colmem ? 3 : 0)
|
||||
, mem (use_colmem ? X.colptr(0) : nullptr)
|
||||
, mem_state(reuse_mem ? 3 : 0 )
|
||||
, mem (reuse_mem ? X.colptr(0) : nullptr)
|
||||
{
|
||||
arma_debug_sigprint_this(this);
|
||||
|
||||
if(use_colmem)
|
||||
if(reuse_mem)
|
||||
{
|
||||
arma_debug_print("Mat::Mat(): using existing memory in a submatrix");
|
||||
}
|
||||
@@ -1994,6 +2046,26 @@ Mat<eT>::Mat(const subview<eT>& X, const bool use_colmem)
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
inline
|
||||
Mat<eT>::Mat(const subview<eT>& X, const arma_vec_indicator&, const uhword in_vec_state)
|
||||
: n_rows( (in_vec_state == 2) ? 1 : 0 )
|
||||
, n_cols( (in_vec_state == 1) ? 1 : 0 )
|
||||
, n_elem(0)
|
||||
, n_alloc(0)
|
||||
, vec_state(in_vec_state)
|
||||
, mem_state(0)
|
||||
, mem()
|
||||
{
|
||||
arma_debug_sigprint_this(this);
|
||||
|
||||
init_warm(X.n_rows, X.n_cols);
|
||||
|
||||
subview<eT>::extract(*this, X);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! construct a matrix from subview (eg. construct a matrix from a delayed submatrix operation)
|
||||
template<typename eT>
|
||||
inline
|
||||
@@ -2197,6 +2269,24 @@ Mat<eT>::Mat(const xtrans_mat<eT,do_conj>& X)
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
inline
|
||||
Mat<eT>::Mat(const subview_cube<eT>& x, const arma_vec_indicator&, const uhword in_vec_state)
|
||||
: n_rows( (in_vec_state == 2) ? 1 : 0 )
|
||||
, n_cols( (in_vec_state == 1) ? 1 : 0 )
|
||||
, n_elem(0)
|
||||
, n_alloc(0)
|
||||
, vec_state(in_vec_state)
|
||||
, mem_state(0)
|
||||
, mem()
|
||||
{
|
||||
arma_debug_sigprint_this(this);
|
||||
|
||||
(*this).operator=(x);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! construct a matrix from a subview_cube instance
|
||||
template<typename eT>
|
||||
inline
|
||||
@@ -2211,7 +2301,7 @@ Mat<eT>::Mat(const subview_cube<eT>& x)
|
||||
{
|
||||
arma_debug_sigprint_this(this);
|
||||
|
||||
this->operator=(x);
|
||||
(*this).operator=(x);
|
||||
}
|
||||
|
||||
|
||||
@@ -2308,6 +2398,26 @@ Mat<eT>::operator/=(const subview_cube<eT>& X)
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
inline
|
||||
Mat<eT>::Mat(const diagview<eT>& X, const arma_vec_indicator&, const uhword in_vec_state)
|
||||
: n_rows( (in_vec_state == 2) ? 1 : 0 )
|
||||
, n_cols( (in_vec_state == 1) ? 1 : 0 )
|
||||
, n_elem(0)
|
||||
, n_alloc(0)
|
||||
, vec_state(in_vec_state)
|
||||
, mem_state(0)
|
||||
, mem()
|
||||
{
|
||||
arma_debug_sigprint_this(this);
|
||||
|
||||
init_warm(X.n_rows, X.n_cols);
|
||||
|
||||
diagview<eT>::extract(*this, X);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! construct a matrix from diagview (eg. construct a matrix from a delayed diag operation)
|
||||
template<typename eT>
|
||||
inline
|
||||
@@ -2432,6 +2542,25 @@ Mat<eT>::operator/=(const diagview<eT>& X)
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
template<typename T1>
|
||||
inline
|
||||
Mat<eT>::Mat(const subview_elem1<eT,T1>& X, const arma_vec_indicator&, const uhword in_vec_state)
|
||||
: n_rows( (in_vec_state == 2) ? 1 : 0 )
|
||||
, n_cols( (in_vec_state == 1) ? 1 : 0 )
|
||||
, n_elem(0)
|
||||
, n_alloc(0)
|
||||
, vec_state(in_vec_state)
|
||||
, mem_state(0)
|
||||
, mem()
|
||||
{
|
||||
arma_debug_sigprint_this(this);
|
||||
|
||||
(*this).operator=(X);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
template<typename T1>
|
||||
inline
|
||||
@@ -2446,7 +2575,7 @@ Mat<eT>::Mat(const subview_elem1<eT,T1>& X)
|
||||
{
|
||||
arma_debug_sigprint_this(this);
|
||||
|
||||
this->operator=(X);
|
||||
(*this).operator=(X);
|
||||
}
|
||||
|
||||
|
||||
@@ -2541,6 +2670,25 @@ Mat<eT>::operator/=(const subview_elem1<eT,T1>& X)
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
template<typename T1, typename T2>
|
||||
inline
|
||||
Mat<eT>::Mat(const subview_elem2<eT,T1,T2>& X, const arma_vec_indicator&, const uhword in_vec_state)
|
||||
: n_rows( (in_vec_state == 2) ? 1 : 0 )
|
||||
, n_cols( (in_vec_state == 1) ? 1 : 0 )
|
||||
, n_elem(0)
|
||||
, n_alloc(0)
|
||||
, vec_state(in_vec_state)
|
||||
, mem_state(0)
|
||||
, mem()
|
||||
{
|
||||
arma_debug_sigprint_this(this);
|
||||
|
||||
(*this).operator=(X);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
template<typename T1, typename T2>
|
||||
inline
|
||||
@@ -2555,7 +2703,7 @@ Mat<eT>::Mat(const subview_elem2<eT,T1,T2>& X)
|
||||
{
|
||||
arma_debug_sigprint_this(this);
|
||||
|
||||
this->operator=(X);
|
||||
(*this).operator=(X);
|
||||
}
|
||||
|
||||
|
||||
@@ -2650,6 +2798,25 @@ Mat<eT>::operator/=(const subview_elem2<eT,T1,T2>& X)
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
template<typename T1>
|
||||
inline
|
||||
Mat<eT>::Mat(const SpBase<eT, T1>& m, const arma_vec_indicator&, const uhword in_vec_state)
|
||||
: n_rows( (in_vec_state == 2) ? 1 : 0 )
|
||||
, n_cols( (in_vec_state == 1) ? 1 : 0 )
|
||||
, n_elem(0)
|
||||
, n_alloc(0)
|
||||
, vec_state(in_vec_state)
|
||||
, mem_state(0)
|
||||
, mem()
|
||||
{
|
||||
arma_debug_sigprint_this(this);
|
||||
|
||||
(*this).operator=(m);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
template<typename T1>
|
||||
inline
|
||||
@@ -2835,6 +3002,24 @@ Mat<eT>::operator/=(const SpBase<eT, T1>& m)
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
inline
|
||||
Mat<eT>::Mat(const SpSubview<eT>& X, const arma_vec_indicator&, const uhword in_vec_state)
|
||||
: n_rows( (in_vec_state == 2) ? 1 : 0 )
|
||||
, n_cols( (in_vec_state == 1) ? 1 : 0 )
|
||||
, n_elem(0)
|
||||
, n_alloc(0)
|
||||
, vec_state(in_vec_state)
|
||||
, mem_state(0)
|
||||
, mem()
|
||||
{
|
||||
arma_debug_sigprint_this(this);
|
||||
|
||||
(*this).operator=(X);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
inline
|
||||
Mat<eT>::Mat(const SpSubview<eT>& X)
|
||||
@@ -3018,6 +3203,26 @@ Mat<eT>::operator-=(const SpSubview<eT>& X)
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
inline
|
||||
Mat<eT>::Mat(const spdiagview<eT>& X, const arma_vec_indicator&, const uhword in_vec_state)
|
||||
: n_rows( (in_vec_state == 2) ? 1 : 0 )
|
||||
, n_cols( (in_vec_state == 1) ? 1 : 0 )
|
||||
, n_elem(0)
|
||||
, n_alloc(0)
|
||||
, vec_state(in_vec_state)
|
||||
, mem_state(0)
|
||||
, mem()
|
||||
{
|
||||
arma_debug_sigprint_this(this);
|
||||
|
||||
init_warm(X.n_rows, X.n_cols);
|
||||
|
||||
spdiagview<eT>::extract(*this, X);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
inline
|
||||
Mat<eT>::Mat(const spdiagview<eT>& X)
|
||||
@@ -4925,6 +5130,29 @@ Mat<eT>::insert_cols(const uword col_num, const Base<eT,T1>& X)
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
template<typename T1, typename gen_type>
|
||||
inline
|
||||
Mat<eT>::Mat(const Gen<T1, gen_type>& X, const arma_vec_indicator&, const uhword in_vec_state)
|
||||
: n_rows( (in_vec_state == 2) ? 1 : 0 )
|
||||
, n_cols( (in_vec_state == 1) ? 1 : 0 )
|
||||
, n_elem(0)
|
||||
, n_alloc(0)
|
||||
, vec_state(in_vec_state)
|
||||
, mem_state(0)
|
||||
, mem()
|
||||
{
|
||||
arma_debug_sigprint_this(this);
|
||||
|
||||
arma_type_check(( is_same_type< eT, typename T1::elem_type >::no ));
|
||||
|
||||
init_warm(X.n_rows, X.n_cols);
|
||||
|
||||
X.apply(*this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
template<typename T1, typename gen_type>
|
||||
inline
|
||||
@@ -5052,6 +5280,27 @@ Mat<eT>::operator/=(const Gen<T1, gen_type>& X)
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
template<typename T1, typename op_type>
|
||||
inline
|
||||
Mat<eT>::Mat(const Op<T1, op_type>& X, const arma_vec_indicator&, const uhword in_vec_state)
|
||||
: n_rows( (in_vec_state == 2) ? 1 : 0 )
|
||||
, n_cols( (in_vec_state == 1) ? 1 : 0 )
|
||||
, n_elem(0)
|
||||
, n_alloc(0)
|
||||
, vec_state(in_vec_state)
|
||||
, mem_state(0)
|
||||
, mem()
|
||||
{
|
||||
arma_debug_sigprint_this(this);
|
||||
|
||||
arma_type_check(( is_same_type< eT, typename T1::elem_type >::no ));
|
||||
|
||||
op_type::apply(static_cast< Mat_noalias<eT>& >(*this), X);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! create a matrix from Op, ie. run the previously delayed unary operations
|
||||
template<typename eT>
|
||||
template<typename T1, typename op_type>
|
||||
@@ -5066,10 +5315,10 @@ Mat<eT>::Mat(const Op<T1, op_type>& X)
|
||||
, mem()
|
||||
{
|
||||
arma_debug_sigprint_this(this);
|
||||
|
||||
|
||||
arma_type_check(( is_same_type< eT, typename T1::elem_type >::no ));
|
||||
|
||||
op_type::apply(*this, X);
|
||||
op_type::apply(static_cast< Mat_noalias<eT>& >(*this), X);
|
||||
}
|
||||
|
||||
|
||||
@@ -5082,7 +5331,7 @@ Mat<eT>&
|
||||
Mat<eT>::operator=(const Op<T1, op_type>& X)
|
||||
{
|
||||
arma_debug_sigprint();
|
||||
|
||||
|
||||
arma_type_check(( is_same_type< eT, typename T1::elem_type >::no ));
|
||||
|
||||
op_type::apply(*this, X);
|
||||
@@ -5182,6 +5431,37 @@ Mat<eT>::operator/=(const Op<T1, op_type>& X)
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
template<typename T1, typename eop_type>
|
||||
inline
|
||||
Mat<eT>::Mat(const eOp<T1, eop_type>& X, const arma_vec_indicator&, const uhword in_vec_state)
|
||||
: n_rows( (in_vec_state == 2) ? 1 : 0 )
|
||||
, n_cols( (in_vec_state == 1) ? 1 : 0 )
|
||||
, n_elem(0)
|
||||
, n_alloc(0)
|
||||
, vec_state(in_vec_state)
|
||||
, mem_state(0)
|
||||
, mem()
|
||||
{
|
||||
arma_debug_sigprint_this(this);
|
||||
|
||||
arma_type_check(( is_same_type< eT, typename T1::elem_type >::no ));
|
||||
|
||||
init_warm(X.get_n_rows(), X.get_n_cols());
|
||||
|
||||
if(arma_config::optimise_powexpr && is_same_type<eop_type, eop_pow>::value)
|
||||
{
|
||||
constexpr bool eT_ok = is_real_or_cx<eT>::value;
|
||||
|
||||
if( X.aux == eT(2) ) { eop_square::apply(*this, reinterpret_cast< const eOp<T1, eop_square>& >(X)); return; }
|
||||
if(eT_ok && (X.aux == eT(0.5))) { eop_sqrt::apply(*this, reinterpret_cast< const eOp<T1, eop_sqrt >& >(X)); return; }
|
||||
}
|
||||
|
||||
eop_type::apply(*this, X);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! create a matrix from eOp, ie. run the previously delayed unary operations
|
||||
template<typename eT>
|
||||
template<typename T1, typename eop_type>
|
||||
@@ -5201,12 +5481,12 @@ Mat<eT>::Mat(const eOp<T1, eop_type>& X)
|
||||
|
||||
init_cold();
|
||||
|
||||
if(is_same_type<eop_type, eop_pow>::value)
|
||||
if(arma_config::optimise_powexpr && is_same_type<eop_type, eop_pow>::value)
|
||||
{
|
||||
constexpr bool eT_non_int = is_non_integral<eT>::value;
|
||||
constexpr bool eT_ok = is_real_or_cx<eT>::value;
|
||||
|
||||
if( X.aux == eT(2) ) { eop_square::apply(*this, reinterpret_cast< const eOp<T1, eop_square>& >(X)); return; }
|
||||
if(eT_non_int && (X.aux == eT(0.5))) { eop_sqrt::apply(*this, reinterpret_cast< const eOp<T1, eop_sqrt >& >(X)); return; }
|
||||
if( X.aux == eT(2) ) { eop_square::apply(*this, reinterpret_cast< const eOp<T1, eop_square>& >(X)); return; }
|
||||
if(eT_ok && (X.aux == eT(0.5))) { eop_sqrt::apply(*this, reinterpret_cast< const eOp<T1, eop_sqrt >& >(X)); return; }
|
||||
}
|
||||
|
||||
eop_type::apply(*this, X);
|
||||
@@ -5231,12 +5511,12 @@ Mat<eT>::operator=(const eOp<T1, eop_type>& X)
|
||||
|
||||
init_warm(X.get_n_rows(), X.get_n_cols());
|
||||
|
||||
if(is_same_type<eop_type, eop_pow>::value)
|
||||
if(arma_config::optimise_powexpr && is_same_type<eop_type, eop_pow>::value)
|
||||
{
|
||||
constexpr bool eT_non_int = is_non_integral<eT>::value;
|
||||
constexpr bool eT_ok = is_real_or_cx<eT>::value;
|
||||
|
||||
if( X.aux == eT(2) ) { eop_square::apply(*this, reinterpret_cast< const eOp<T1, eop_square>& >(X)); return *this; }
|
||||
if(eT_non_int && (X.aux == eT(0.5))) { eop_sqrt::apply(*this, reinterpret_cast< const eOp<T1, eop_sqrt >& >(X)); return *this; }
|
||||
if( X.aux == eT(2) ) { eop_square::apply(*this, reinterpret_cast< const eOp<T1, eop_square>& >(X)); return *this; }
|
||||
if(eT_ok && (X.aux == eT(0.5))) { eop_sqrt::apply(*this, reinterpret_cast< const eOp<T1, eop_sqrt >& >(X)); return *this; }
|
||||
}
|
||||
|
||||
eop_type::apply(*this, X);
|
||||
@@ -5260,12 +5540,12 @@ Mat<eT>::operator+=(const eOp<T1, eop_type>& X)
|
||||
|
||||
if(bad_alias) { const Mat<eT> tmp(X); return (*this).operator+=(tmp); }
|
||||
|
||||
if(is_same_type<eop_type, eop_pow>::value)
|
||||
if(arma_config::optimise_powexpr && is_same_type<eop_type, eop_pow>::value)
|
||||
{
|
||||
constexpr bool eT_non_int = is_non_integral<eT>::value;
|
||||
constexpr bool eT_ok = is_real_or_cx<eT>::value;
|
||||
|
||||
if( X.aux == eT(2) ) { eop_square::apply_inplace_plus(*this, reinterpret_cast< const eOp<T1, eop_square>& >(X)); return *this; }
|
||||
if(eT_non_int && (X.aux == eT(0.5))) { eop_sqrt::apply_inplace_plus(*this, reinterpret_cast< const eOp<T1, eop_sqrt >& >(X)); return *this; }
|
||||
if( X.aux == eT(2) ) { eop_square::apply_inplace_plus(*this, reinterpret_cast< const eOp<T1, eop_square>& >(X)); return *this; }
|
||||
if(eT_ok && (X.aux == eT(0.5))) { eop_sqrt::apply_inplace_plus(*this, reinterpret_cast< const eOp<T1, eop_sqrt >& >(X)); return *this; }
|
||||
}
|
||||
|
||||
eop_type::apply_inplace_plus(*this, X);
|
||||
@@ -5289,12 +5569,12 @@ Mat<eT>::operator-=(const eOp<T1, eop_type>& X)
|
||||
|
||||
if(bad_alias) { const Mat<eT> tmp(X); return (*this).operator-=(tmp); }
|
||||
|
||||
if(is_same_type<eop_type, eop_pow>::value)
|
||||
if(arma_config::optimise_powexpr && is_same_type<eop_type, eop_pow>::value)
|
||||
{
|
||||
constexpr bool eT_non_int = is_non_integral<eT>::value;
|
||||
constexpr bool eT_ok = is_real_or_cx<eT>::value;
|
||||
|
||||
if( X.aux == eT(2) ) { eop_square::apply_inplace_minus(*this, reinterpret_cast< const eOp<T1, eop_square>& >(X)); return *this; }
|
||||
if(eT_non_int && (X.aux == eT(0.5))) { eop_sqrt::apply_inplace_minus(*this, reinterpret_cast< const eOp<T1, eop_sqrt >& >(X)); return *this; }
|
||||
if( X.aux == eT(2) ) { eop_square::apply_inplace_minus(*this, reinterpret_cast< const eOp<T1, eop_square>& >(X)); return *this; }
|
||||
if(eT_ok && (X.aux == eT(0.5))) { eop_sqrt::apply_inplace_minus(*this, reinterpret_cast< const eOp<T1, eop_sqrt >& >(X)); return *this; }
|
||||
}
|
||||
|
||||
eop_type::apply_inplace_minus(*this, X);
|
||||
@@ -5335,12 +5615,12 @@ Mat<eT>::operator%=(const eOp<T1, eop_type>& X)
|
||||
|
||||
if(bad_alias) { const Mat<eT> tmp(X); return (*this).operator%=(tmp); }
|
||||
|
||||
if(is_same_type<eop_type, eop_pow>::value)
|
||||
if(arma_config::optimise_powexpr && is_same_type<eop_type, eop_pow>::value)
|
||||
{
|
||||
constexpr bool eT_non_int = is_non_integral<eT>::value;
|
||||
constexpr bool eT_ok = is_real_or_cx<eT>::value;
|
||||
|
||||
if( X.aux == eT(2) ) { eop_square::apply_inplace_schur(*this, reinterpret_cast< const eOp<T1, eop_square>& >(X)); return *this; }
|
||||
if(eT_non_int && (X.aux == eT(0.5))) { eop_sqrt::apply_inplace_schur(*this, reinterpret_cast< const eOp<T1, eop_sqrt >& >(X)); return *this; }
|
||||
if( X.aux == eT(2) ) { eop_square::apply_inplace_schur(*this, reinterpret_cast< const eOp<T1, eop_square>& >(X)); return *this; }
|
||||
if(eT_ok && (X.aux == eT(0.5))) { eop_sqrt::apply_inplace_schur(*this, reinterpret_cast< const eOp<T1, eop_sqrt >& >(X)); return *this; }
|
||||
}
|
||||
|
||||
eop_type::apply_inplace_schur(*this, X);
|
||||
@@ -5364,12 +5644,12 @@ Mat<eT>::operator/=(const eOp<T1, eop_type>& X)
|
||||
|
||||
if(bad_alias) { const Mat<eT> tmp(X); return (*this).operator/=(tmp); }
|
||||
|
||||
if(is_same_type<eop_type, eop_pow>::value)
|
||||
if(arma_config::optimise_powexpr && is_same_type<eop_type, eop_pow>::value)
|
||||
{
|
||||
constexpr bool eT_non_int = is_non_integral<eT>::value;
|
||||
constexpr bool eT_ok = is_real_or_cx<eT>::value;
|
||||
|
||||
if( X.aux == eT(2) ) { eop_square::apply_inplace_div(*this, reinterpret_cast< const eOp<T1, eop_square>& >(X)); return *this; }
|
||||
if(eT_non_int && (X.aux == eT(0.5))) { eop_sqrt::apply_inplace_div(*this, reinterpret_cast< const eOp<T1, eop_sqrt >& >(X)); return *this; }
|
||||
if( X.aux == eT(2) ) { eop_square::apply_inplace_div(*this, reinterpret_cast< const eOp<T1, eop_square>& >(X)); return *this; }
|
||||
if(eT_ok && (X.aux == eT(0.5))) { eop_sqrt::apply_inplace_div(*this, reinterpret_cast< const eOp<T1, eop_sqrt >& >(X)); return *this; }
|
||||
}
|
||||
|
||||
eop_type::apply_inplace_div(*this, X);
|
||||
@@ -5379,6 +5659,25 @@ Mat<eT>::operator/=(const eOp<T1, eop_type>& X)
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
template<typename T1, typename op_type>
|
||||
inline
|
||||
Mat<eT>::Mat(const mtOp<eT, T1, op_type>& X, const arma_vec_indicator&, const uhword in_vec_state)
|
||||
: n_rows( (in_vec_state == 2) ? 1 : 0 )
|
||||
, n_cols( (in_vec_state == 1) ? 1 : 0 )
|
||||
, n_elem(0)
|
||||
, n_alloc(0)
|
||||
, vec_state(in_vec_state)
|
||||
, mem_state(0)
|
||||
, mem()
|
||||
{
|
||||
arma_debug_sigprint_this(this);
|
||||
|
||||
op_type::apply(static_cast< Mat_noalias<eT>& >(*this), X);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
template<typename T1, typename op_type>
|
||||
inline
|
||||
@@ -5393,7 +5692,7 @@ Mat<eT>::Mat(const mtOp<eT, T1, op_type>& X)
|
||||
{
|
||||
arma_debug_sigprint_this(this);
|
||||
|
||||
op_type::apply(*this, X);
|
||||
op_type::apply(static_cast< Mat_noalias<eT>& >(*this), X);
|
||||
}
|
||||
|
||||
|
||||
@@ -5488,6 +5787,27 @@ Mat<eT>::operator/=(const mtOp<eT, T1, op_type>& X)
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
template<typename T1, typename op_type>
|
||||
inline
|
||||
Mat<eT>::Mat(const CubeToMatOp<T1, op_type>& X, const arma_vec_indicator&, const uhword in_vec_state)
|
||||
: n_rows( (in_vec_state == 2) ? 1 : 0 )
|
||||
, n_cols( (in_vec_state == 1) ? 1 : 0 )
|
||||
, n_elem(0)
|
||||
, n_alloc(0)
|
||||
, vec_state(in_vec_state)
|
||||
, mem_state(0)
|
||||
, mem()
|
||||
{
|
||||
arma_debug_sigprint_this(this);
|
||||
|
||||
arma_type_check(( is_same_type< eT, typename T1::elem_type >::no ));
|
||||
|
||||
op_type::apply(*this, X);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
template<typename T1, typename op_type>
|
||||
inline
|
||||
@@ -5501,9 +5821,9 @@ Mat<eT>::Mat(const CubeToMatOp<T1, op_type>& X)
|
||||
, mem()
|
||||
{
|
||||
arma_debug_sigprint_this(this);
|
||||
|
||||
|
||||
arma_type_check(( is_same_type< eT, typename T1::elem_type >::no ));
|
||||
|
||||
|
||||
op_type::apply(*this, X);
|
||||
}
|
||||
|
||||
@@ -5516,7 +5836,7 @@ Mat<eT>&
|
||||
Mat<eT>::operator=(const CubeToMatOp<T1, op_type>& X)
|
||||
{
|
||||
arma_debug_sigprint();
|
||||
|
||||
|
||||
arma_type_check(( is_same_type< eT, typename T1::elem_type >::no ));
|
||||
|
||||
op_type::apply(*this, X);
|
||||
@@ -5611,6 +5931,27 @@ Mat<eT>::operator/=(const CubeToMatOp<T1, op_type>& X)
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
template<typename T1, typename op_type>
|
||||
inline
|
||||
Mat<eT>::Mat(const SpToDOp<T1, op_type>& X, const arma_vec_indicator&, const uhword in_vec_state)
|
||||
: n_rows( (in_vec_state == 2) ? 1 : 0 )
|
||||
, n_cols( (in_vec_state == 1) ? 1 : 0 )
|
||||
, n_elem(0)
|
||||
, n_alloc(0)
|
||||
, vec_state(in_vec_state)
|
||||
, mem_state(0)
|
||||
, mem()
|
||||
{
|
||||
arma_debug_sigprint_this(this);
|
||||
|
||||
arma_type_check(( is_same_type< eT, typename T1::elem_type >::no ));
|
||||
|
||||
op_type::apply(*this, X);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
template<typename T1, typename op_type>
|
||||
inline
|
||||
@@ -5624,9 +5965,9 @@ Mat<eT>::Mat(const SpToDOp<T1, op_type>& X)
|
||||
, mem()
|
||||
{
|
||||
arma_debug_sigprint_this(this);
|
||||
|
||||
|
||||
arma_type_check(( is_same_type< eT, typename T1::elem_type >::no ));
|
||||
|
||||
|
||||
op_type::apply(*this, X);
|
||||
}
|
||||
|
||||
@@ -5640,7 +5981,7 @@ Mat<eT>&
|
||||
Mat<eT>::operator=(const SpToDOp<T1, op_type>& X)
|
||||
{
|
||||
arma_debug_sigprint();
|
||||
|
||||
|
||||
arma_type_check(( is_same_type< eT, typename T1::elem_type >::no ));
|
||||
|
||||
op_type::apply(*this, X);
|
||||
@@ -5740,6 +6081,25 @@ Mat<eT>::operator/=(const SpToDOp<T1, op_type>& X)
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
template<typename T1, typename op_type>
|
||||
inline
|
||||
Mat<eT>::Mat(const mtSpReduceOp<eT, T1, op_type>& X, const arma_vec_indicator&, const uhword in_vec_state)
|
||||
: n_rows( (in_vec_state == 2) ? 1 : 0 )
|
||||
, n_cols( (in_vec_state == 1) ? 1 : 0 )
|
||||
, n_elem(0)
|
||||
, n_alloc(0)
|
||||
, vec_state(in_vec_state)
|
||||
, mem_state(0)
|
||||
, mem()
|
||||
{
|
||||
arma_debug_sigprint_this(this);
|
||||
|
||||
op_type::apply(*this, X);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
template<typename T1, typename op_type>
|
||||
inline
|
||||
@@ -5753,7 +6113,7 @@ Mat<eT>::Mat(const mtSpReduceOp<eT, T1, op_type>& X)
|
||||
, mem()
|
||||
{
|
||||
arma_debug_sigprint_this(this);
|
||||
|
||||
|
||||
op_type::apply(*this, X);
|
||||
}
|
||||
|
||||
@@ -5766,7 +6126,7 @@ Mat<eT>&
|
||||
Mat<eT>::operator=(const mtSpReduceOp<eT, T1, op_type>& X)
|
||||
{
|
||||
arma_debug_sigprint();
|
||||
|
||||
|
||||
op_type::apply(*this, X);
|
||||
|
||||
return *this;
|
||||
@@ -5849,6 +6209,28 @@ Mat<eT>::operator/=(const mtSpReduceOp<eT, T1, op_type>& X)
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
template<typename T1, typename T2, typename glue_type>
|
||||
inline
|
||||
Mat<eT>::Mat(const Glue<T1, T2, glue_type>& X, const arma_vec_indicator&, const uhword in_vec_state)
|
||||
: n_rows( (in_vec_state == 2) ? 1 : 0 )
|
||||
, n_cols( (in_vec_state == 1) ? 1 : 0 )
|
||||
, n_elem(0)
|
||||
, n_alloc(0)
|
||||
, vec_state(in_vec_state)
|
||||
, mem_state(0)
|
||||
, mem()
|
||||
{
|
||||
arma_debug_sigprint_this(this);
|
||||
|
||||
arma_type_check(( is_same_type< eT, typename T1::elem_type >::no ));
|
||||
arma_type_check(( is_same_type< eT, typename T2::elem_type >::no ));
|
||||
|
||||
glue_type::apply(static_cast< Mat_noalias<eT>& >(*this), X);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! create a matrix from Glue, ie. run the previously delayed binary operations
|
||||
template<typename eT>
|
||||
template<typename T1, typename T2, typename glue_type>
|
||||
@@ -5867,7 +6249,7 @@ Mat<eT>::Mat(const Glue<T1, T2, glue_type>& X)
|
||||
arma_type_check(( is_same_type< eT, typename T1::elem_type >::no ));
|
||||
arma_type_check(( is_same_type< eT, typename T2::elem_type >::no ));
|
||||
|
||||
glue_type::apply(*this, X);
|
||||
glue_type::apply(static_cast< Mat_noalias<eT>& >(*this), X);
|
||||
}
|
||||
|
||||
|
||||
@@ -6016,6 +6398,30 @@ Mat<eT>::operator-=(const Glue<T1, T2, glue_times>& X)
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
template<typename T1, typename T2, typename eglue_type>
|
||||
inline
|
||||
Mat<eT>::Mat(const eGlue<T1, T2, eglue_type>& X, const arma_vec_indicator&, const uhword in_vec_state)
|
||||
: n_rows( (in_vec_state == 2) ? 1 : 0 )
|
||||
, n_cols( (in_vec_state == 1) ? 1 : 0 )
|
||||
, n_elem(0)
|
||||
, n_alloc(0)
|
||||
, vec_state(in_vec_state)
|
||||
, mem_state(0)
|
||||
, mem()
|
||||
{
|
||||
arma_debug_sigprint_this(this);
|
||||
|
||||
arma_type_check(( is_same_type< eT, typename T1::elem_type >::no ));
|
||||
arma_type_check(( is_same_type< eT, typename T2::elem_type >::no ));
|
||||
|
||||
init_warm(X.get_n_rows(), X.get_n_cols());
|
||||
|
||||
eglue_type::apply(*this, X);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! create a matrix from eGlue, ie. run the previously delayed binary operations
|
||||
template<typename eT>
|
||||
template<typename T1, typename T2, typename eglue_type>
|
||||
@@ -6199,6 +6605,25 @@ Mat<eT>::operator/=(const eGlue<T1, T2, eglue_type>& X)
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
template<typename T1, typename T2, typename glue_type>
|
||||
inline
|
||||
Mat<eT>::Mat(const mtGlue<eT, T1, T2, glue_type>& X, const arma_vec_indicator&, const uhword in_vec_state)
|
||||
: n_rows( (in_vec_state == 2) ? 1 : 0 )
|
||||
, n_cols( (in_vec_state == 1) ? 1 : 0 )
|
||||
, n_elem(0)
|
||||
, n_alloc(0)
|
||||
, vec_state(in_vec_state)
|
||||
, mem_state(0)
|
||||
, mem()
|
||||
{
|
||||
arma_debug_sigprint_this(this);
|
||||
|
||||
glue_type::apply(static_cast< Mat_noalias<eT>& >(*this), X);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
template<typename T1, typename T2, typename glue_type>
|
||||
inline
|
||||
@@ -6213,7 +6638,7 @@ Mat<eT>::Mat(const mtGlue<eT, T1, T2, glue_type>& X)
|
||||
{
|
||||
arma_debug_sigprint_this(this);
|
||||
|
||||
glue_type::apply(*this, X);
|
||||
glue_type::apply(static_cast< Mat_noalias<eT>& >(*this), X);
|
||||
}
|
||||
|
||||
|
||||
@@ -6310,6 +6735,28 @@ Mat<eT>::operator/=(const mtGlue<eT, T1, T2, glue_type>& X)
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
template<typename T1, typename T2, typename glue_type>
|
||||
inline
|
||||
Mat<eT>::Mat(const SpToDGlue<T1, T2, glue_type>& X, const arma_vec_indicator&, const uhword in_vec_state)
|
||||
: n_rows( (in_vec_state == 2) ? 1 : 0 )
|
||||
, n_cols( (in_vec_state == 1) ? 1 : 0 )
|
||||
, n_elem(0)
|
||||
, n_alloc(0)
|
||||
, vec_state(in_vec_state)
|
||||
, mem_state(0)
|
||||
, mem()
|
||||
{
|
||||
arma_debug_sigprint_this(this);
|
||||
|
||||
arma_type_check(( is_same_type< eT, typename T1::elem_type >::no ));
|
||||
arma_type_check(( is_same_type< eT, typename T2::elem_type >::no ));
|
||||
|
||||
glue_type::apply(*this, X);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
template<typename T1, typename T2, typename glue_type>
|
||||
inline
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -21,10 +21,8 @@
|
||||
|
||||
|
||||
template<typename T1, typename op_type>
|
||||
class OpCube : public BaseCube< typename T1::elem_type, OpCube<T1, op_type> >
|
||||
struct OpCube : public BaseCube< typename T1::elem_type, OpCube<T1, op_type> >
|
||||
{
|
||||
public:
|
||||
|
||||
typedef typename T1::elem_type elem_type;
|
||||
typedef typename get_pod_type<elem_type>::result pod_type;
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -43,12 +43,10 @@ struct Op_traits<T1, op_type, false>
|
||||
|
||||
|
||||
template<typename T1, typename op_type>
|
||||
class Op
|
||||
struct Op
|
||||
: public Base< typename T1::elem_type, Op<T1, op_type> >
|
||||
, public Op_traits<T1, op_type, has_nested_op_traits<op_type>::value>
|
||||
{
|
||||
public:
|
||||
|
||||
typedef typename T1::elem_type elem_type;
|
||||
typedef typename get_pod_type<elem_type>::result pod_type;
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -20,7 +20,7 @@
|
||||
//! @{
|
||||
|
||||
|
||||
// within each specialisation of the Proxy class:
|
||||
// within each specialisation of the Proxy struct:
|
||||
//
|
||||
// elem_type = type of the elements obtained from object Q
|
||||
// pod_type = underlying type of elements if elem_type is std::complex
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -91,7 +91,7 @@ class Row : public Mat<eT>
|
||||
inline Row(const subview_cube<eT>& X);
|
||||
inline Row& operator=(const subview_cube<eT>& X);
|
||||
|
||||
arma_frown("use braced initialiser list instead") inline mat_injector<Row> operator<<(const eT val);
|
||||
[[deprecated("use braced initialiser list instead")]] inline mat_injector<Row> operator<<(const eT val);
|
||||
|
||||
arma_warn_unused arma_inline const Op<Row<eT>,op_htrans> t() const;
|
||||
arma_warn_unused arma_inline const Op<Row<eT>,op_htrans> ht() const;
|
||||
@@ -141,8 +141,8 @@ class Row : public Mat<eT>
|
||||
|
||||
template<typename T1> inline void shed_cols(const Base<uword, T1>& indices);
|
||||
|
||||
arma_deprecated inline void insert_cols(const uword col_num, const uword N, const bool set_to_zero);
|
||||
inline void insert_cols(const uword col_num, const uword N);
|
||||
[[deprecated]] inline void insert_cols(const uword col_num, const uword N, const bool set_to_zero);
|
||||
inline void insert_cols(const uword col_num, const uword N);
|
||||
|
||||
template<typename T1> inline void insert_cols(const uword col_num, const Base<eT,T1>& X);
|
||||
|
||||
@@ -154,6 +154,11 @@ class Row : public Mat<eT>
|
||||
arma_warn_unused arma_inline const eT& at(const uword in_row, const uword in_col) const;
|
||||
|
||||
|
||||
inline constexpr bool is_vec() const { return true; }
|
||||
inline constexpr bool is_rowvec() const { return true; }
|
||||
inline constexpr bool is_colvec() const { return false; }
|
||||
|
||||
|
||||
typedef eT* row_iterator;
|
||||
typedef const eT* const_row_iterator;
|
||||
|
||||
@@ -164,6 +169,9 @@ class Row : public Mat<eT>
|
||||
inline const_row_iterator end_row (const uword row_num) const;
|
||||
|
||||
|
||||
inline explicit Row(const subview<eT>& X, const bool reuse_mem); // only to be used by the partial_unwrap class
|
||||
|
||||
|
||||
template<uword fixed_n_elem> class fixed;
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -521,11 +521,9 @@ template<typename eT>
|
||||
template<typename T1>
|
||||
inline
|
||||
Row<eT>::Row(const Base<eT,T1>& X)
|
||||
: Mat<eT>(arma_vec_indicator(), 2)
|
||||
: Mat<eT>(X.get_ref(), arma_vec_indicator(), 2)
|
||||
{
|
||||
arma_debug_sigprint();
|
||||
|
||||
Mat<eT>::operator=(X.get_ref());
|
||||
arma_debug_sigprint_this(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -549,11 +547,9 @@ template<typename eT>
|
||||
template<typename T1>
|
||||
inline
|
||||
Row<eT>::Row(const SpBase<eT,T1>& X)
|
||||
: Mat<eT>(arma_vec_indicator(), 2)
|
||||
: Mat<eT>(X.get_ref(), arma_vec_indicator(), 2)
|
||||
{
|
||||
arma_debug_sigprint();
|
||||
|
||||
Mat<eT>::operator=(X.get_ref());
|
||||
arma_debug_sigprint_this(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -607,12 +603,9 @@ Row<eT>::Row
|
||||
const Base<typename Row<eT>::pod_type, T1>& A,
|
||||
const Base<typename Row<eT>::pod_type, T2>& B
|
||||
)
|
||||
: Mat<eT>(A.get_ref(), B.get_ref(), arma_vec_indicator(), 2)
|
||||
{
|
||||
arma_debug_sigprint();
|
||||
|
||||
access::rw(Mat<eT>::vec_state) = 2;
|
||||
|
||||
Mat<eT>::init(A,B);
|
||||
arma_debug_sigprint_this(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -621,12 +614,9 @@ template<typename eT>
|
||||
template<typename T1>
|
||||
inline
|
||||
Row<eT>::Row(const BaseCube<eT,T1>& X)
|
||||
: Mat<eT>(X.get_ref(), arma_vec_indicator(), 2)
|
||||
{
|
||||
arma_debug_sigprint();
|
||||
|
||||
access::rw(Mat<eT>::vec_state) = 2;
|
||||
|
||||
Mat<eT>::operator=(X);
|
||||
arma_debug_sigprint_this(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -649,12 +639,9 @@ Row<eT>::operator=(const BaseCube<eT,T1>& X)
|
||||
template<typename eT>
|
||||
inline
|
||||
Row<eT>::Row(const subview_cube<eT>& X)
|
||||
: Mat<eT>(X, arma_vec_indicator(), 2)
|
||||
{
|
||||
arma_debug_sigprint();
|
||||
|
||||
access::rw(Mat<eT>::vec_state) = 2;
|
||||
|
||||
Mat<eT>::operator=(X);
|
||||
arma_debug_sigprint_this(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -1277,6 +1264,20 @@ Row<eT>::end_row(const uword row_num) const
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
inline
|
||||
Row<eT>::Row(const subview<eT>& X, const bool reuse_mem)
|
||||
: Mat<eT>(X, reuse_mem)
|
||||
{
|
||||
arma_debug_sigprint_this(this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
template<uword fixed_n_elem>
|
||||
arma_inline
|
||||
@@ -1872,6 +1873,10 @@ Row<eT>::fixed<fixed_n_elem>::ones()
|
||||
|
||||
|
||||
|
||||
//
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
inline
|
||||
Row<eT>::Row(const arma_fixed_indicator&, const uword in_n_elem, const eT* in_mem)
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -21,10 +21,8 @@
|
||||
|
||||
|
||||
|
||||
class SizeCube
|
||||
struct SizeCube
|
||||
{
|
||||
public:
|
||||
|
||||
const uword n_rows;
|
||||
const uword n_cols;
|
||||
const uword n_slices;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -21,10 +21,8 @@
|
||||
|
||||
|
||||
|
||||
class SizeMat
|
||||
struct SizeMat
|
||||
{
|
||||
public:
|
||||
|
||||
const uword n_rows;
|
||||
const uword n_cols;
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -76,11 +76,11 @@ struct SpBase
|
||||
arma_warn_unused inline elem_type min() const;
|
||||
arma_warn_unused inline elem_type max() const;
|
||||
|
||||
arma_frown("use .index_min() instead") inline elem_type min(uword& index_of_min_val) const;
|
||||
arma_frown("use .index_max() instead") inline elem_type max(uword& index_of_max_val) const;
|
||||
[[deprecated("use .index_min() instead")]] inline elem_type min(uword& index_of_min_val) const;
|
||||
[[deprecated("use .index_max() instead")]] inline elem_type max(uword& index_of_max_val) const;
|
||||
|
||||
arma_frown("use .index_min() with ind2sub() instead") inline elem_type min(uword& row_of_min_val, uword& col_of_min_val) const;
|
||||
arma_frown("use .index_max() with ind2sub() instead") inline elem_type max(uword& row_of_max_val, uword& col_of_max_val) const;
|
||||
[[deprecated("use .index_min() with ind2sub() instead")]] inline elem_type min(uword& row_of_min_val, uword& col_of_min_val) const;
|
||||
[[deprecated("use .index_max() with ind2sub() instead")]] inline elem_type max(uword& row_of_max_val, uword& col_of_max_val) const;
|
||||
|
||||
arma_warn_unused inline uword index_min() const;
|
||||
arma_warn_unused inline uword index_max() const;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -22,10 +22,8 @@
|
||||
|
||||
|
||||
template<typename T1, typename T2, typename spglue_type>
|
||||
class SpGlue : public SpBase< typename T1::elem_type, SpGlue<T1, T2, spglue_type> >
|
||||
struct SpGlue : public SpBase< typename T1::elem_type, SpGlue<T1, T2, spglue_type> >
|
||||
{
|
||||
public:
|
||||
|
||||
typedef typename T1::elem_type elem_type;
|
||||
typedef typename get_pod_type<elem_type>::result pod_type;
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -399,11 +399,11 @@ class SpMat : public SpBase< eT, SpMat<eT> >
|
||||
arma_cold inline bool load(const csv_name& spec, const file_type type = csv_ascii);
|
||||
arma_cold inline bool load( std::istream& is, const file_type type = arma_binary);
|
||||
|
||||
arma_frown("use save() instead") inline bool quiet_save(const std::string name, const file_type type = arma_binary) const;
|
||||
arma_frown("use save() instead") inline bool quiet_save( std::ostream& os, const file_type type = arma_binary) const;
|
||||
[[deprecated("use save() instead")]] inline bool quiet_save(const std::string name, const file_type type = arma_binary) const;
|
||||
[[deprecated("use save() instead")]] inline bool quiet_save( std::ostream& os, const file_type type = arma_binary) const;
|
||||
|
||||
arma_frown("use load() instead") inline bool quiet_load(const std::string name, const file_type type = arma_binary);
|
||||
arma_frown("use load() instead") inline bool quiet_load( std::istream& is, const file_type type = arma_binary);
|
||||
[[deprecated("use load() instead")]] inline bool quiet_load(const std::string name, const file_type type = arma_binary);
|
||||
[[deprecated("use load() instead")]] inline bool quiet_load( std::istream& is, const file_type type = arma_binary);
|
||||
|
||||
|
||||
|
||||
@@ -741,6 +741,10 @@ class SpMat_aux
|
||||
|
||||
|
||||
|
||||
template<typename eT> class SpMat_noalias : public SpMat<eT> {};
|
||||
|
||||
|
||||
|
||||
#define ARMA_HAS_SPMAT
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -1666,7 +1666,7 @@ SpMat<eT>::SpMat(const SpOp<T1, spop_type>& X)
|
||||
|
||||
arma_type_check(( is_same_type< eT, typename T1::elem_type >::no ));
|
||||
|
||||
spop_type::apply(*this, X);
|
||||
spop_type::apply(static_cast< SpMat_noalias<eT>& >(*this), X);
|
||||
|
||||
sync_csc(); // in case apply() used element accessors
|
||||
invalidate_cache(); // in case apply() modified the CSC representation
|
||||
@@ -1806,7 +1806,7 @@ SpMat<eT>::SpMat(const SpGlue<T1, T2, spglue_type>& X)
|
||||
|
||||
arma_type_check(( is_same_type< eT, typename T1::elem_type >::no ));
|
||||
|
||||
spglue_type::apply(*this, X);
|
||||
spglue_type::apply(static_cast< SpMat_noalias<eT>& >(*this), X);
|
||||
|
||||
sync_csc(); // in case apply() used element accessors
|
||||
invalidate_cache(); // in case apply() modified the CSC representation
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -22,10 +22,8 @@
|
||||
|
||||
|
||||
template<typename T1, typename op_type>
|
||||
class SpOp : public SpBase< typename T1::elem_type, SpOp<T1, op_type> >
|
||||
struct SpOp : public SpBase< typename T1::elem_type, SpOp<T1, op_type> >
|
||||
{
|
||||
public:
|
||||
|
||||
typedef typename T1::elem_type elem_type;
|
||||
typedef typename get_pod_type<elem_type>::result pod_type;
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -23,7 +23,7 @@
|
||||
// TODO: clarify and check which variables and functions are valid when 'use_iterator' is either true or false
|
||||
|
||||
|
||||
// within each specialisation of the Proxy class:
|
||||
// within each specialisation of the SpProxy struct:
|
||||
//
|
||||
// elem_type = type of the elements obtained from object Q
|
||||
// pod_type = underlying type of elements if elem_type is std::complex
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -22,10 +22,8 @@
|
||||
|
||||
|
||||
template<typename T1, typename T2, typename glue_type>
|
||||
class SpToDGlue : public Base< typename T1::elem_type, SpToDGlue<T1, T2, glue_type> >
|
||||
struct SpToDGlue : public Base< typename T1::elem_type, SpToDGlue<T1, T2, glue_type> >
|
||||
{
|
||||
public:
|
||||
|
||||
typedef typename T1::elem_type elem_type;
|
||||
typedef typename get_pod_type<elem_type>::result pod_type;
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -23,10 +23,8 @@
|
||||
// NOTE: SpToDOp is dedicated for unary operations on sparse matrices that result in dense matrices.
|
||||
|
||||
template<typename T1, typename op_type>
|
||||
class SpToDOp : public Base< typename T1::elem_type, SpToDOp<T1, op_type> >
|
||||
struct SpToDOp : public Base< typename T1::elem_type, SpToDOp<T1, op_type> >
|
||||
{
|
||||
public:
|
||||
|
||||
typedef typename T1::elem_type elem_type;
|
||||
typedef typename get_pod_type<elem_type>::result pod_type;
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -73,8 +73,8 @@ class SpValProxy
|
||||
// Deletes the element if it is zero; NOTE: does not check if val_ptr == nullptr
|
||||
arma_inline void check_zero();
|
||||
|
||||
arma_aligned const uword row;
|
||||
arma_aligned const uword col;
|
||||
const uword row;
|
||||
const uword col;
|
||||
|
||||
arma_aligned eT* val_ptr;
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -20,24 +20,22 @@
|
||||
//! @{
|
||||
|
||||
|
||||
class access
|
||||
struct access
|
||||
{
|
||||
public:
|
||||
|
||||
//! internal function to allow modification of data declared as read-only (use with caution)
|
||||
template<typename T1> constexpr static T1& rw (const T1& x) { return const_cast<T1& >(x); }
|
||||
template<typename T1> constexpr static T1*& rwp(const T1* const& x) { return const_cast<T1*&>(x); }
|
||||
template<typename T1> static constexpr T1& rw (const T1& x) { return const_cast<T1& >(x); }
|
||||
template<typename T1> static constexpr T1*& rwp(const T1* const& x) { return const_cast<T1*&>(x); }
|
||||
|
||||
//! internal function to obtain the real part of either a plain number or a complex number
|
||||
template<typename eT> constexpr static const eT& tmp_real(const eT& X) { return X; }
|
||||
template<typename T> constexpr static const T tmp_real(const std::complex<T>& X) { return X.real(); }
|
||||
template<typename eT> static constexpr const eT& tmp_real(const eT& X) { return X; }
|
||||
template<typename T> static constexpr const T tmp_real(const std::complex<T>& X) { return X.real(); }
|
||||
|
||||
//! internal function to obtain the imag part of either a plain number or a complex number
|
||||
template<typename eT> constexpr static const eT tmp_imag(const eT ) { return eT(0); }
|
||||
template<typename T> constexpr static const T tmp_imag(const std::complex<T>& X) { return X.imag(); }
|
||||
template<typename eT> static constexpr const eT tmp_imag(const eT ) { return eT(0); }
|
||||
template<typename T> static constexpr const T tmp_imag(const std::complex<T>& X) { return X.imag(); }
|
||||
|
||||
//! internal function to work around braindead compilers
|
||||
template<typename eT> constexpr static const typename enable_if2<is_cx<eT>::no, const eT&>::result alt_conj(const eT& X) { return X; }
|
||||
template<typename eT> static constexpr const typename enable_if2<is_cx<eT>::no, const eT&>::result alt_conj(const eT& X) { return X; }
|
||||
template<typename eT> arma_inline static const typename enable_if2<is_cx<eT>::yes, const eT >::result alt_conj(const eT& X) { return std::conj(X); }
|
||||
};
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -198,6 +198,21 @@ arma_isnan(const std::complex<T>& x)
|
||||
|
||||
|
||||
|
||||
//
|
||||
// wrapper for pow; see also the associated FP16 specialisation
|
||||
|
||||
|
||||
|
||||
template<typename eT, typename exponent_eT>
|
||||
inline
|
||||
eT
|
||||
arma_pow(eT base, exponent_eT pow)
|
||||
{
|
||||
return std::pow(base, pow);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// implementation of arma_sign()
|
||||
|
||||
@@ -207,7 +222,9 @@ constexpr
|
||||
typename arma_unsigned_integral_only<eT>::result
|
||||
arma_sign(const eT x)
|
||||
{
|
||||
return (x > eT(0)) ? eT(+1) : eT(0);
|
||||
constexpr eT eT_zero = eT(0);
|
||||
|
||||
return (x > eT_zero) ? eT(+1) : eT_zero;
|
||||
}
|
||||
|
||||
|
||||
@@ -217,7 +234,9 @@ constexpr
|
||||
typename arma_signed_integral_only<eT>::result
|
||||
arma_sign(const eT x)
|
||||
{
|
||||
return (x > eT(0)) ? eT(+1) : ( (x < eT(0)) ? eT(-1) : eT(0) );
|
||||
constexpr eT eT_zero = eT(0);
|
||||
|
||||
return (x > eT_zero) ? eT(+1) : ( (x < eT_zero) ? eT(-1) : eT_zero );
|
||||
}
|
||||
|
||||
|
||||
@@ -227,7 +246,9 @@ constexpr
|
||||
typename arma_real_only<eT>::result
|
||||
arma_sign(const eT x)
|
||||
{
|
||||
return (x > eT(0)) ? eT(+1) : ( (x < eT(0)) ? eT(-1) : ((x == eT(0)) ? eT(0) : x) );
|
||||
constexpr eT eT_zero = eT(0);
|
||||
|
||||
return (x > eT_zero) ? eT(+1) : ( (x < eT_zero) ? eT(-1) : ((x == eT_zero) ? eT_zero : x) );
|
||||
}
|
||||
|
||||
|
||||
@@ -417,4 +438,95 @@ struct arma_arg< std::complex<double> >
|
||||
|
||||
|
||||
|
||||
//
|
||||
// extensions for half-precision fp16
|
||||
|
||||
#if defined(ARMA_HAVE_FP16)
|
||||
|
||||
template<>
|
||||
inline
|
||||
bool
|
||||
arma_isfinite(fp16 x)
|
||||
{
|
||||
return std::isfinite(x);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<>
|
||||
inline
|
||||
bool
|
||||
arma_isnonfinite(fp16 x)
|
||||
{
|
||||
return (std::isfinite(x) == false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<>
|
||||
inline
|
||||
bool
|
||||
arma_isinf(fp16 x)
|
||||
{
|
||||
return std::isinf(x);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<>
|
||||
inline
|
||||
bool
|
||||
arma_isnan(fp16 x)
|
||||
{
|
||||
return std::isnan(x);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<typename exponent_eT>
|
||||
inline
|
||||
fp16
|
||||
arma_pow(fp16 base, exponent_eT pow)
|
||||
{
|
||||
return std::pow(base, fp16(pow));
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<>
|
||||
inline
|
||||
fp16
|
||||
arma_hypot(const fp16 x, const fp16 y)
|
||||
{
|
||||
return std::hypot(x, y);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<>
|
||||
inline
|
||||
fp16
|
||||
arma_sinc(const fp16 x)
|
||||
{
|
||||
return arma_sinc_generic(x);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<>
|
||||
struct arma_arg<fp16>
|
||||
{
|
||||
static
|
||||
inline
|
||||
fp16
|
||||
eval(const fp16 x)
|
||||
{
|
||||
return std::arg(x);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//! @}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -65,6 +65,13 @@ struct arma_config
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(ARMA_OPTIMISE_POWEXPR)
|
||||
static constexpr bool optimise_powexpr = true;
|
||||
#else
|
||||
static constexpr bool optimise_powexpr = false;
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(ARMA_CHECK_CONFORMANCE)
|
||||
static constexpr bool check_conform = true;
|
||||
#else
|
||||
@@ -153,13 +160,6 @@ struct arma_config
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(ARMA_HAVE_CXX14)
|
||||
static constexpr bool cxx14 = true;
|
||||
#else
|
||||
static constexpr bool cxx14 = false;
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(ARMA_HAVE_CXX17)
|
||||
static constexpr bool cxx17 = true;
|
||||
#else
|
||||
@@ -237,6 +237,20 @@ struct arma_config
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(ARMA_HAVE_FP16)
|
||||
static constexpr bool have_fp16 = true;
|
||||
#else
|
||||
static constexpr bool have_fp16 = false;
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(ARMA_GOOD_FP16)
|
||||
static constexpr bool good_fp16 = true;
|
||||
#else
|
||||
static constexpr bool good_fp16 = false;
|
||||
#endif
|
||||
|
||||
|
||||
static constexpr uword warn_level = (sword(ARMA_WARN_LEVEL) > 0) ? uword(ARMA_WARN_LEVEL) : 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -29,11 +29,10 @@ template<typename eT> class Mat;
|
||||
template<typename eT> class Col;
|
||||
template<typename eT> class Row;
|
||||
template<typename eT> class Cube;
|
||||
template<typename eT> class xvec_htrans;
|
||||
template<typename oT> class field;
|
||||
|
||||
template<typename eT, bool do_conj> class xtrans_mat;
|
||||
|
||||
template<typename eT> struct xvec_htrans;
|
||||
template<typename eT, bool do_conj> struct xtrans_mat;
|
||||
|
||||
template<typename eT> class subview;
|
||||
template<typename eT> class subview_col;
|
||||
@@ -73,93 +72,97 @@ template<typename eT, typename T1> class subview_cube_slices;
|
||||
template<typename eT, typename T1> class SpSubview_col_list;
|
||||
|
||||
|
||||
class SizeMat;
|
||||
class SizeCube;
|
||||
template<typename eT> class Mat_noalias;
|
||||
template<typename eT> class SpMat_noalias;
|
||||
|
||||
class arma_empty_class {};
|
||||
|
||||
class diskio;
|
||||
struct SizeMat;
|
||||
struct SizeCube;
|
||||
|
||||
class op_strans;
|
||||
class op_htrans;
|
||||
class op_htrans2;
|
||||
class op_inv_gen_default;
|
||||
class op_inv_spd_default;
|
||||
class op_inv_gen_full;
|
||||
class op_inv_spd_full;
|
||||
class op_diagmat;
|
||||
class op_trimat;
|
||||
class op_vectorise_row;
|
||||
class op_vectorise_col;
|
||||
class op_symmatu;
|
||||
class op_symmatl;
|
||||
class op_omit;
|
||||
struct arma_empty_class {};
|
||||
|
||||
class op_row_as_mat;
|
||||
class op_col_as_mat;
|
||||
struct diskio;
|
||||
|
||||
class glue_times;
|
||||
class glue_times_diag;
|
||||
struct op_strans;
|
||||
struct op_htrans;
|
||||
struct op_htrans2;
|
||||
struct op_inv_gen_default;
|
||||
struct op_inv_spd_default;
|
||||
struct op_inv_gen_full;
|
||||
struct op_inv_spd_full;
|
||||
struct op_diagmat;
|
||||
struct op_trimat;
|
||||
struct op_vectorise_row;
|
||||
struct op_vectorise_col;
|
||||
struct op_symmatu;
|
||||
struct op_symmatl;
|
||||
struct op_omit;
|
||||
|
||||
class glue_rel_lt;
|
||||
class glue_rel_gt;
|
||||
class glue_rel_lteq;
|
||||
class glue_rel_gteq;
|
||||
class glue_rel_eq;
|
||||
class glue_rel_noteq;
|
||||
class glue_rel_and;
|
||||
class glue_rel_or;
|
||||
struct op_row_as_mat;
|
||||
struct op_col_as_mat;
|
||||
|
||||
class op_rel_lt_pre;
|
||||
class op_rel_lt_post;
|
||||
class op_rel_gt_pre;
|
||||
class op_rel_gt_post;
|
||||
class op_rel_lteq_pre;
|
||||
class op_rel_lteq_post;
|
||||
class op_rel_gteq_pre;
|
||||
class op_rel_gteq_post;
|
||||
class op_rel_eq;
|
||||
class op_rel_noteq;
|
||||
struct glue_times;
|
||||
struct glue_times_diag;
|
||||
|
||||
class gen_eye;
|
||||
class gen_ones;
|
||||
class gen_zeros;
|
||||
struct glue_rel_lt;
|
||||
struct glue_rel_gt;
|
||||
struct glue_rel_lteq;
|
||||
struct glue_rel_gteq;
|
||||
struct glue_rel_eq;
|
||||
struct glue_rel_noteq;
|
||||
struct glue_rel_and;
|
||||
struct glue_rel_or;
|
||||
|
||||
struct op_rel_lt_pre;
|
||||
struct op_rel_lt_post;
|
||||
struct op_rel_gt_pre;
|
||||
struct op_rel_gt_post;
|
||||
struct op_rel_lteq_pre;
|
||||
struct op_rel_lteq_post;
|
||||
struct op_rel_gteq_pre;
|
||||
struct op_rel_gteq_post;
|
||||
struct op_rel_eq;
|
||||
struct op_rel_noteq;
|
||||
|
||||
struct gen_eye;
|
||||
struct gen_ones;
|
||||
struct gen_zeros;
|
||||
|
||||
|
||||
|
||||
class spop_strans;
|
||||
class spop_htrans;
|
||||
class spop_vectorise_row;
|
||||
class spop_vectorise_col;
|
||||
class spop_square;
|
||||
struct spop_strans;
|
||||
struct spop_htrans;
|
||||
struct spop_vectorise_row;
|
||||
struct spop_vectorise_col;
|
||||
struct spop_square;
|
||||
|
||||
class spop_rel_lt_pre;
|
||||
class spop_rel_lt_post;
|
||||
class spop_rel_gt_pre;
|
||||
class spop_rel_gt_post;
|
||||
class spop_rel_lteq_pre;
|
||||
class spop_rel_lteq_post;
|
||||
class spop_rel_gteq_pre;
|
||||
class spop_rel_gteq_post;
|
||||
class spop_rel_eq;
|
||||
class spop_rel_noteq;
|
||||
struct spop_rel_lt_pre;
|
||||
struct spop_rel_lt_post;
|
||||
struct spop_rel_gt_pre;
|
||||
struct spop_rel_gt_post;
|
||||
struct spop_rel_lteq_pre;
|
||||
struct spop_rel_lteq_post;
|
||||
struct spop_rel_gteq_pre;
|
||||
struct spop_rel_gteq_post;
|
||||
struct spop_rel_eq;
|
||||
struct spop_rel_noteq;
|
||||
|
||||
class spglue_plus;
|
||||
class spglue_minus;
|
||||
class spglue_schur;
|
||||
class spglue_times;
|
||||
class spglue_max;
|
||||
class spglue_min;
|
||||
class spglue_rel_lt;
|
||||
class spglue_rel_gt;
|
||||
struct spglue_plus;
|
||||
struct spglue_minus;
|
||||
struct spglue_schur;
|
||||
struct spglue_times;
|
||||
struct spglue_max;
|
||||
struct spglue_min;
|
||||
struct spglue_rel_lt;
|
||||
struct spglue_rel_gt;
|
||||
|
||||
class op_sp_as_dense;
|
||||
struct op_sp_as_dense;
|
||||
|
||||
class op_internal_equ;
|
||||
class op_internal_plus;
|
||||
class op_internal_minus;
|
||||
class op_internal_schur;
|
||||
class op_internal_div;
|
||||
struct op_internal_equ;
|
||||
struct op_internal_plus;
|
||||
struct op_internal_minus;
|
||||
struct op_internal_schur;
|
||||
struct op_internal_div;
|
||||
|
||||
|
||||
|
||||
@@ -248,40 +251,40 @@ struct traits_glue_or
|
||||
|
||||
|
||||
|
||||
template<const bool, const bool, const bool, const bool> class gemm;
|
||||
template<const bool, const bool, const bool> class gemv;
|
||||
template<const bool, const bool, const bool, const bool> struct gemm;
|
||||
template<const bool, const bool, const bool> struct gemv;
|
||||
|
||||
|
||||
template< typename eT, typename gen_type> class Gen;
|
||||
template< typename eT, typename gen_type> struct Gen;
|
||||
|
||||
template< typename T1, typename op_type> class Op;
|
||||
template< typename T1, typename eop_type> class eOp;
|
||||
template< typename T1, typename op_type> class SpToDOp;
|
||||
template< typename T1, typename op_type> class CubeToMatOp;
|
||||
template<typename out_eT, typename T1, typename op_type> class mtOp;
|
||||
template< typename T1, typename op_type> struct Op;
|
||||
template< typename T1, typename eop_type> struct eOp;
|
||||
template< typename T1, typename op_type> struct SpToDOp;
|
||||
template< typename T1, typename op_type> struct CubeToMatOp;
|
||||
template<typename out_eT, typename T1, typename op_type> struct mtOp;
|
||||
|
||||
template< typename T1, typename T2, typename glue_type> class Glue;
|
||||
template< typename T1, typename T2, typename eglue_type> class eGlue;
|
||||
template< typename T1, typename T2, typename glue_type> class SpToDGlue;
|
||||
template<typename out_eT, typename T1, typename T2, typename glue_type> class mtGlue;
|
||||
template< typename T1, typename T2, typename glue_type> struct Glue;
|
||||
template< typename T1, typename T2, typename eglue_type> struct eGlue;
|
||||
template< typename T1, typename T2, typename glue_type> struct SpToDGlue;
|
||||
template<typename out_eT, typename T1, typename T2, typename glue_type> struct mtGlue;
|
||||
|
||||
|
||||
|
||||
template< typename eT, typename gen_type> class GenCube;
|
||||
template< typename eT, typename gen_type> struct GenCube;
|
||||
|
||||
template< typename T1, typename op_type> class OpCube;
|
||||
template< typename T1, typename eop_type> class eOpCube;
|
||||
template<typename out_eT, typename T1, typename op_type> class mtOpCube;
|
||||
template< typename T1, typename op_type> struct OpCube;
|
||||
template< typename T1, typename eop_type> struct eOpCube;
|
||||
template<typename out_eT, typename T1, typename op_type> struct mtOpCube;
|
||||
|
||||
template< typename T1, typename T2, typename glue_type> class GlueCube;
|
||||
template< typename T1, typename T2, typename eglue_type> class eGlueCube;
|
||||
template<typename out_eT, typename T1, typename T2, typename glue_type> class mtGlueCube;
|
||||
template< typename T1, typename T2, typename glue_type> struct GlueCube;
|
||||
template< typename T1, typename T2, typename eglue_type> struct eGlueCube;
|
||||
template<typename out_eT, typename T1, typename T2, typename glue_type> struct mtGlueCube;
|
||||
|
||||
|
||||
template<typename T1> struct Proxy;
|
||||
template<typename T1> struct ProxyCube;
|
||||
|
||||
template<typename T1> class diagmat_proxy;
|
||||
template<typename T1> struct diagmat_proxy;
|
||||
|
||||
template<typename T1> struct unwrap;
|
||||
template<typename T1> struct quasi_unwrap;
|
||||
@@ -312,7 +315,7 @@ struct state_type
|
||||
int out;
|
||||
|
||||
#if defined(ARMA_USE_OPENMP)
|
||||
#pragma omp atomic read
|
||||
#pragma omp atomic read seq_cst
|
||||
out = state;
|
||||
#elif defined(ARMA_USE_STD_MUTEX)
|
||||
out = state.load();
|
||||
@@ -328,7 +331,7 @@ struct state_type
|
||||
operator= (const int in_state)
|
||||
{
|
||||
#if defined(ARMA_USE_OPENMP)
|
||||
#pragma omp atomic write
|
||||
#pragma omp atomic write seq_cst
|
||||
state = in_state;
|
||||
#elif defined(ARMA_USE_STD_MUTEX)
|
||||
state.store(in_state);
|
||||
@@ -339,12 +342,12 @@ struct state_type
|
||||
};
|
||||
|
||||
|
||||
template< typename T1, typename spop_type> class SpOp;
|
||||
template<typename out_eT, typename T1, typename spop_type> class mtSpOp;
|
||||
template<typename out_eT, typename T1, typename op_type> class mtSpReduceOp;
|
||||
template< typename T1, typename spop_type> struct SpOp;
|
||||
template<typename out_eT, typename T1, typename spop_type> struct mtSpOp;
|
||||
template<typename out_eT, typename T1, typename op_type> struct mtSpReduceOp;
|
||||
|
||||
template< typename T1, typename T2, typename spglue_type> class SpGlue;
|
||||
template<typename out_eT, typename T1, typename T2, typename spglue_type> class mtSpGlue;
|
||||
template< typename T1, typename T2, typename spglue_type> struct SpGlue;
|
||||
template<typename out_eT, typename T1, typename T2, typename spglue_type> struct mtSpGlue;
|
||||
|
||||
|
||||
template<typename T1> struct SpProxy;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -21,18 +21,13 @@
|
||||
|
||||
|
||||
|
||||
class arma_ostream_state
|
||||
struct arma_ostream_state
|
||||
{
|
||||
private:
|
||||
|
||||
const ios::fmtflags orig_flags;
|
||||
const std::streamsize orig_precision;
|
||||
const std::streamsize orig_width;
|
||||
const char orig_fill;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
inline arma_ostream_state(const std::ostream& o);
|
||||
|
||||
inline void restore(std::ostream& o) const;
|
||||
@@ -40,10 +35,8 @@ class arma_ostream_state
|
||||
|
||||
|
||||
|
||||
class arma_ostream
|
||||
struct arma_ostream
|
||||
{
|
||||
public:
|
||||
|
||||
template<typename eT> inline static std::streamsize modify_stream(std::ostream& o, const eT* data, const uword n_elem);
|
||||
template<typename T> inline static std::streamsize modify_stream(std::ostream& o, const std::complex<T>* data, const uword n_elem);
|
||||
template<typename eT> inline static std::streamsize modify_stream(std::ostream& o, typename SpMat<eT>::const_iterator begin, const uword n_elem, const typename arma_not_cx<eT>::result* junk = nullptr);
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -86,22 +86,22 @@ arma_ostream::modify_stream(std::ostream& o, const eT* data, const uword n_elem)
|
||||
( val >= eT(+100) )
|
||||
||
|
||||
//( (is_signed<eT>::value) && (val <= eT(-100)) ) ||
|
||||
//( (is_non_integral<eT>::value) && (val > eT(0)) && (val <= eT(+1e-4)) ) ||
|
||||
//( (is_non_integral<eT>::value) && (is_signed<eT>::value) && (val < eT(0)) && (val >= eT(-1e-4)) )
|
||||
//( (is_real<eT>::value) && (val > eT(0)) && (val <= eT(+1e-4)) ) ||
|
||||
//( (is_real<eT>::value) && (is_signed<eT>::value) && (val < eT(0)) && (val >= eT(-1e-4)) )
|
||||
(
|
||||
cond_rel< is_signed<eT>::value >::leq(val, eT(-100))
|
||||
)
|
||||
||
|
||||
(
|
||||
cond_rel< is_non_integral<eT>::value >::gt(val, eT(0))
|
||||
cond_rel< is_real<eT>::value >::gt(val, eT(0))
|
||||
&&
|
||||
cond_rel< is_non_integral<eT>::value >::leq(val, eT(+1e-4))
|
||||
cond_rel< is_real<eT>::value >::leq(val, eT(+1e-4))
|
||||
)
|
||||
||
|
||||
(
|
||||
cond_rel< is_non_integral<eT>::value && is_signed<eT>::value >::lt(val, eT(0))
|
||||
cond_rel< is_real<eT>::value && is_signed<eT>::value >::lt(val, eT(0))
|
||||
&&
|
||||
cond_rel< is_non_integral<eT>::value && is_signed<eT>::value >::geq(val, eT(-1e-4))
|
||||
cond_rel< is_real<eT>::value && is_signed<eT>::value >::geq(val, eT(-1e-4))
|
||||
)
|
||||
)
|
||||
{
|
||||
@@ -213,8 +213,8 @@ arma_ostream::modify_stream(std::ostream& o, typename SpMat<eT>::const_iterator
|
||||
if(
|
||||
val >= eT(+100) ||
|
||||
( (is_signed<eT>::value) && (val <= eT(-100)) ) ||
|
||||
( (is_non_integral<eT>::value) && (val > eT(0)) && (val <= eT(+1e-4)) ) ||
|
||||
( (is_non_integral<eT>::value) && (is_signed<eT>::value) && (val < eT(0)) && (val >= eT(-1e-4)) )
|
||||
( ( is_real<eT>::value) && (val > eT(0)) && (val <= eT(+1e-4)) ) ||
|
||||
( ( is_real<eT>::value) && (is_signed<eT>::value) && (val < eT(0)) && (val >= eT(-1e-4)) )
|
||||
)
|
||||
{
|
||||
use_layout_C = true;
|
||||
@@ -368,7 +368,9 @@ inline
|
||||
void
|
||||
arma_ostream::print_elem(std::ostream& o, const std::complex<T>& x, const bool modify)
|
||||
{
|
||||
if( (x.real() == T(0)) && (x.imag() == T(0)) && (modify) )
|
||||
constexpr T T_zero = T(0);
|
||||
|
||||
if( (x.real() == T_zero) && (x.imag() == T_zero) && (modify) )
|
||||
{
|
||||
o << "(0,0)";
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -24,7 +24,7 @@
|
||||
template<typename eT>
|
||||
struct arma_lt_comparator
|
||||
{
|
||||
arma_inline bool operator() (const eT a, const eT b) const { return (a < b); }
|
||||
constexpr bool operator() (const eT a, const eT b) const { return (a < b); }
|
||||
};
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ struct arma_lt_comparator
|
||||
template<typename eT>
|
||||
struct arma_gt_comparator
|
||||
{
|
||||
arma_inline bool operator() (const eT a, const eT b) const { return (a > b); }
|
||||
constexpr bool operator() (const eT a, const eT b) const { return (a > b); }
|
||||
};
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ struct arma_gt_comparator
|
||||
template<typename eT>
|
||||
struct arma_leq_comparator
|
||||
{
|
||||
arma_inline bool operator() (const eT a, const eT b) const { return (a <= b); }
|
||||
constexpr bool operator() (const eT a, const eT b) const { return (a <= b); }
|
||||
};
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ struct arma_leq_comparator
|
||||
template<typename eT>
|
||||
struct arma_geq_comparator
|
||||
{
|
||||
arma_inline bool operator() (const eT a, const eT b) const { return (a >= b); }
|
||||
constexpr bool operator() (const eT a, const eT b) const { return (a >= b); }
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -26,6 +26,9 @@
|
||||
#undef ARMA_USE_THREAD_LOCAL
|
||||
#define ARMA_USE_THREAD_LOCAL
|
||||
|
||||
#undef ARMA_USE_THREAD_UNIQUE_RNG_SEED
|
||||
#define ARMA_USE_THREAD_UNIQUE_RNG_SEED
|
||||
|
||||
#if (defined(ARMA_RNG_ALT) || defined(ARMA_DONT_USE_CXX11_RNG))
|
||||
#undef ARMA_USE_CXX11_RNG
|
||||
#endif
|
||||
@@ -34,6 +37,10 @@
|
||||
#undef ARMA_USE_THREAD_LOCAL
|
||||
#endif
|
||||
|
||||
#if defined(ARMA_DONT_USE_THREAD_UNIQUE_RNG_SEED)
|
||||
#undef ARMA_USE_THREAD_UNIQUE_RNG_SEED
|
||||
#endif
|
||||
|
||||
|
||||
// NOTE: ARMA_WARMUP_PRODUCER enables a workaround
|
||||
// NOTE: for thread_local issue on macOS 11 and/or AppleClang 12.0
|
||||
@@ -79,10 +86,8 @@
|
||||
#endif
|
||||
|
||||
|
||||
class arma_rng
|
||||
struct arma_rng
|
||||
{
|
||||
public:
|
||||
|
||||
#if defined(ARMA_RNG_ALT)
|
||||
typedef arma_rng_alt::seed_type seed_type;
|
||||
#elif defined(ARMA_USE_CXX11_RNG)
|
||||
@@ -118,6 +123,7 @@ class arma_rng
|
||||
template<typename eT> struct randu;
|
||||
template<typename eT> struct randn;
|
||||
template<typename eT> struct randg;
|
||||
template<typename eT> struct rande;
|
||||
};
|
||||
|
||||
|
||||
@@ -130,24 +136,42 @@ arma_rng::get_producer()
|
||||
{
|
||||
#if defined(ARMA_USE_THREAD_LOCAL)
|
||||
|
||||
// use a thread-safe RNG, with each thread having its own unique starting seed
|
||||
// thread-safe RNG
|
||||
|
||||
static std::atomic<std::size_t> mt19937_64_producer_counter(0);
|
||||
|
||||
static thread_local std::mt19937_64 mt19937_64_producer( std::mt19937_64::default_seed + mt19937_64_producer_counter++ );
|
||||
|
||||
arma_rng::warmup_producer(mt19937_64_producer);
|
||||
#if defined(ARMA_USE_THREAD_UNIQUE_RNG_SEED)
|
||||
|
||||
// each thread has unique starting seed
|
||||
|
||||
#if defined(ARMA_USE_OPENMP)
|
||||
|
||||
static thread_local std::mt19937_64 mt19937_64_producer( std::mt19937_64::default_seed + arma_rng::seed_type(omp_get_thread_num()) );
|
||||
|
||||
#else
|
||||
|
||||
static std::atomic<std::size_t> mt19937_64_producer_counter(0);
|
||||
|
||||
static thread_local std::mt19937_64 mt19937_64_producer( std::mt19937_64::default_seed + mt19937_64_producer_counter++ );
|
||||
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
// each thread has the same starting seed
|
||||
|
||||
static thread_local std::mt19937_64 mt19937_64_producer( std::mt19937_64::default_seed );
|
||||
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
// use a plain RNG in case we don't have thread_local
|
||||
// plain RNG in case we don't have thread_local
|
||||
|
||||
static std::mt19937_64 mt19937_64_producer( std::mt19937_64::default_seed );
|
||||
|
||||
arma_rng::warmup_producer(mt19937_64_producer);
|
||||
|
||||
#endif
|
||||
|
||||
arma_rng::warmup_producer(mt19937_64_producer);
|
||||
|
||||
return mt19937_64_producer;
|
||||
}
|
||||
|
||||
@@ -227,9 +251,45 @@ arma_rng::set_seed(const arma_rng::seed_type val)
|
||||
}
|
||||
#elif defined(ARMA_USE_CXX11_RNG)
|
||||
{
|
||||
arma_rng::lock_producer();
|
||||
arma_rng::get_producer().seed(val);
|
||||
arma_rng::unlock_producer();
|
||||
#if defined(ARMA_USE_OPENMP) && defined(ARMA_USE_THREAD_LOCAL)
|
||||
{
|
||||
arma_rng::lock_producer();
|
||||
|
||||
#if defined(ARMA_USE_THREAD_UNIQUE_RNG_SEED)
|
||||
constexpr bool thread_unique_rng_seed = true;
|
||||
#else
|
||||
constexpr bool thread_unique_rng_seed = false;
|
||||
#endif
|
||||
|
||||
// if we're already in a parallel region, assume the user is setting the seed for each thread
|
||||
|
||||
if( (thread_unique_rng_seed == false) || bool(omp_in_parallel()) )
|
||||
{
|
||||
arma_rng::get_producer().seed(val);
|
||||
}
|
||||
else
|
||||
{
|
||||
const int n_threads = int( (std::max)( int(1), int(omp_get_max_threads()) ) );
|
||||
|
||||
#pragma omp parallel for ordered schedule(static) num_threads(n_threads)
|
||||
for(int t=0; t < n_threads; ++t)
|
||||
{
|
||||
#pragma omp ordered
|
||||
{
|
||||
arma_rng::get_producer().seed(val + arma_rng::seed_type(omp_get_thread_num()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
arma_rng::unlock_producer();
|
||||
}
|
||||
#else
|
||||
{
|
||||
arma_rng::lock_producer();
|
||||
arma_rng::get_producer().seed(val);
|
||||
arma_rng::unlock_producer();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
{
|
||||
@@ -1031,4 +1091,45 @@ struct arma_rng::randg
|
||||
|
||||
|
||||
|
||||
//
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
struct arma_rng::rande
|
||||
{
|
||||
inline
|
||||
static
|
||||
void
|
||||
fill(eT* mem, const uword N, const double lambda)
|
||||
{
|
||||
#if defined(ARMA_USE_CXX11_RNG)
|
||||
{
|
||||
std::exponential_distribution<double> local_e_distr(lambda);
|
||||
|
||||
std::mt19937_64& producer = arma_rng::get_producer();
|
||||
|
||||
arma_rng::lock_producer();
|
||||
|
||||
for(uword i=0; i<N; ++i) { mem[i] = eT(local_e_distr(producer)); }
|
||||
|
||||
arma_rng::unlock_producer();
|
||||
}
|
||||
#else
|
||||
{
|
||||
typedef typename std::mt19937_64::result_type local_seed_type;
|
||||
|
||||
std::mt19937_64 local_engine;
|
||||
std::exponential_distribution<double> local_e_distr(lambda);
|
||||
|
||||
local_engine.seed( local_seed_type(arma_rng::randi<local_seed_type>()) );
|
||||
|
||||
for(uword i=0; i<N; ++i) { mem[i] = eT(local_e_distr(local_engine)); }
|
||||
}
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
//! @}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -21,10 +21,8 @@
|
||||
|
||||
|
||||
|
||||
class arma_rng_cxx03
|
||||
struct arma_rng_cxx03
|
||||
{
|
||||
public:
|
||||
|
||||
typedef unsigned int seed_type;
|
||||
|
||||
inline static void set_seed(const seed_type val);
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -21,10 +21,10 @@
|
||||
|
||||
|
||||
|
||||
#define ARMA_VERSION_MAJOR 14
|
||||
#define ARMA_VERSION_MINOR 5
|
||||
#define ARMA_VERSION_PATCH 0
|
||||
#define ARMA_VERSION_NAME "experimental"
|
||||
#define ARMA_VERSION_MAJOR 15
|
||||
#define ARMA_VERSION_MINOR 2
|
||||
#define ARMA_VERSION_PATCH 2
|
||||
#define ARMA_VERSION_NAME "Medium Roast Deluxe"
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -20,10 +20,8 @@
|
||||
//! @{
|
||||
|
||||
|
||||
class arrayops
|
||||
struct arrayops
|
||||
{
|
||||
public:
|
||||
|
||||
template<typename eT>
|
||||
arma_inline static void
|
||||
copy(eT* dest, const eT* src, const uword n_elem);
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -21,10 +21,8 @@
|
||||
|
||||
|
||||
//! low-level interface functions for accessing LAPACK
|
||||
class auxlib
|
||||
struct auxlib
|
||||
{
|
||||
public:
|
||||
|
||||
//
|
||||
// inv
|
||||
|
||||
@@ -188,12 +186,6 @@ class auxlib
|
||||
template<typename eT>
|
||||
inline static bool chol_band(Mat<eT>& X, const uword KD, const uword layout);
|
||||
|
||||
template<typename T>
|
||||
inline static bool chol_band(Mat< std::complex<T> >& X, const uword KD, const uword layout);
|
||||
|
||||
template<typename eT>
|
||||
inline static bool chol_band_common(Mat<eT>& X, const uword KD, const uword layout);
|
||||
|
||||
template<typename eT>
|
||||
inline static bool chol_pivot(Mat<eT>& X, Mat<uword>& P, const uword layout);
|
||||
|
||||
@@ -298,9 +290,6 @@ class auxlib
|
||||
template<typename T1>
|
||||
inline static bool solve_sympd_fast(Mat<typename T1::elem_type>& out, Mat<typename T1::elem_type>& A, const Base<typename T1::elem_type,T1>& B_expr);
|
||||
|
||||
template<typename T1>
|
||||
inline static bool solve_sympd_fast_common(Mat<typename T1::elem_type>& out, Mat<typename T1::elem_type>& A, const Base<typename T1::elem_type,T1>& B_expr);
|
||||
|
||||
template<typename T1>
|
||||
inline static bool solve_sympd_rcond(Mat<typename T1::pod_type>& out, bool& out_sympd_state, typename T1::pod_type& out_rcond, Mat<typename T1::pod_type>& A, const Base<typename T1::pod_type,T1>& B_expr);
|
||||
|
||||
@@ -340,22 +329,10 @@ class auxlib
|
||||
//
|
||||
|
||||
template<typename T1>
|
||||
inline static bool solve_band_fast(Mat<typename T1::pod_type>& out, Mat<typename T1::pod_type>& A, const uword KL, const uword KU, const Base<typename T1::pod_type,T1>& B_expr);
|
||||
inline static bool solve_band_fast(Mat<typename T1::elem_type>& out, const Mat<typename T1::elem_type>& A, const uword KL, const uword KU, const Base<typename T1::elem_type,T1>& B_expr);
|
||||
|
||||
template<typename T1>
|
||||
inline static bool solve_band_fast(Mat< std::complex<typename T1::pod_type> >& out, Mat< std::complex<typename T1::pod_type> >& A, const uword KL, const uword KU, const Base< std::complex<typename T1::pod_type>,T1>& B_expr);
|
||||
|
||||
template<typename T1>
|
||||
inline static bool solve_band_fast_common(Mat<typename T1::elem_type>& out, const Mat<typename T1::elem_type>& A, const uword KL, const uword KU, const Base<typename T1::elem_type,T1>& B_expr);
|
||||
|
||||
template<typename T1>
|
||||
inline static bool solve_band_rcond(Mat<typename T1::pod_type>& out, typename T1::pod_type& out_rcond, Mat<typename T1::pod_type>& A, const uword KL, const uword KU, const Base<typename T1::pod_type,T1>& B_expr);
|
||||
|
||||
template<typename T1>
|
||||
inline static bool solve_band_rcond(Mat< std::complex<typename T1::pod_type> >& out, typename T1::pod_type& out_rcond, Mat< std::complex<typename T1::pod_type> >& A, const uword KL, const uword KU, const Base< std::complex<typename T1::pod_type>,T1>& B_expr);
|
||||
|
||||
template<typename T1>
|
||||
inline static bool solve_band_rcond_common(Mat<typename T1::elem_type>& out, typename T1::pod_type& out_rcond, const Mat<typename T1::elem_type>& A, const uword KL, const uword KU, const Base<typename T1::elem_type,T1>& B_expr);
|
||||
inline static bool solve_band_rcond(Mat<typename T1::elem_type>& out, typename T1::pod_type& out_rcond, const Mat<typename T1::elem_type>& A, const uword KL, const uword KU, const Base<typename T1::elem_type,T1>& B_expr);
|
||||
|
||||
template<typename T1>
|
||||
inline static bool solve_band_refine(Mat<typename T1::pod_type>& out, typename T1::pod_type& out_rcond, Mat<typename T1::pod_type>& A, const uword KL, const uword KU, const Base<typename T1::pod_type,T1>& B_expr, const bool equilibrate);
|
||||
@@ -366,13 +343,7 @@ class auxlib
|
||||
//
|
||||
|
||||
template<typename T1>
|
||||
inline static bool solve_tridiag_fast(Mat<typename T1::pod_type>& out, Mat<typename T1::pod_type>& A, const Base<typename T1::pod_type,T1>& B_expr);
|
||||
|
||||
template<typename T1>
|
||||
inline static bool solve_tridiag_fast(Mat< std::complex<typename T1::pod_type> >& out, Mat< std::complex<typename T1::pod_type> >& A, const Base< std::complex<typename T1::pod_type>,T1>& B_expr);
|
||||
|
||||
template<typename T1>
|
||||
inline static bool solve_tridiag_fast_common(Mat<typename T1::elem_type>& out, const Mat<typename T1::elem_type>& A, const Base<typename T1::elem_type,T1>& B_expr);
|
||||
inline static bool solve_tridiag_fast(Mat<typename T1::elem_type>& out, const Mat<typename T1::elem_type>& A, const Base<typename T1::elem_type,T1>& B_expr);
|
||||
|
||||
|
||||
//
|
||||
@@ -458,9 +429,6 @@ class auxlib
|
||||
//
|
||||
// misc
|
||||
|
||||
template<typename T1>
|
||||
inline static bool crippled_lapack(const Base<typename T1::elem_type, T1>&);
|
||||
|
||||
template<typename eT>
|
||||
inline static bool rudimentary_sym_check(const Mat<eT>& X);
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -320,13 +320,7 @@ auxlib::inv_sym(Mat< std::complex<T> >& A)
|
||||
|
||||
if(A.is_empty()) { return true; }
|
||||
|
||||
#if defined(ARMA_CRIPPLED_LAPACK)
|
||||
{
|
||||
arma_debug_print("auxlib::inv_sym(): redirecting to auxlib::inv() due to crippled LAPACK");
|
||||
|
||||
return auxlib::inv(A);
|
||||
}
|
||||
#elif defined(ARMA_USE_LAPACK)
|
||||
#if defined(ARMA_USE_LAPACK)
|
||||
{
|
||||
typedef typename std::complex<T> eT;
|
||||
|
||||
@@ -477,13 +471,7 @@ auxlib::inv_sym_rcond(Mat< std::complex<T> >& A, T& out_rcond)
|
||||
|
||||
if(A.is_empty()) { return true; }
|
||||
|
||||
#if defined(ARMA_CRIPPLED_LAPACK)
|
||||
{
|
||||
arma_debug_print("auxlib::inv_sym_rcond(): redirecting to auxlib::inv_rcond() due to crippled LAPACK");
|
||||
|
||||
return auxlib::inv_rcond(A, out_rcond);
|
||||
}
|
||||
#elif defined(ARMA_USE_LAPACK)
|
||||
#if defined(ARMA_USE_LAPACK)
|
||||
{
|
||||
typedef typename std::complex<T> eT;
|
||||
|
||||
@@ -686,13 +674,7 @@ auxlib::inv_sympd_rcond(Mat< std::complex<T> >& A, T& out_rcond)
|
||||
|
||||
if(A.is_empty()) { return true; }
|
||||
|
||||
#if defined(ARMA_CRIPPLED_LAPACK)
|
||||
{
|
||||
arma_ignore(A);
|
||||
arma_ignore(out_rcond);
|
||||
return false;
|
||||
}
|
||||
#elif defined(ARMA_USE_LAPACK)
|
||||
#if defined(ARMA_USE_LAPACK)
|
||||
{
|
||||
arma_conform_assert_blas_size(A);
|
||||
|
||||
@@ -1393,13 +1375,7 @@ auxlib::eig_gen_balance
|
||||
{
|
||||
arma_debug_sigprint();
|
||||
|
||||
#if defined(ARMA_CRIPPLED_LAPACK)
|
||||
{
|
||||
arma_debug_print("auxlib::eig_gen_balance(): redirecting to auxlib::eig_gen() due to crippled LAPACK");
|
||||
|
||||
return auxlib::eig_gen(vals, vecs, vecs_on, expr);
|
||||
}
|
||||
#elif defined(ARMA_USE_LAPACK)
|
||||
#if defined(ARMA_USE_LAPACK)
|
||||
{
|
||||
typedef typename T1::pod_type T;
|
||||
typedef typename std::complex<T> eT;
|
||||
@@ -1751,13 +1727,7 @@ auxlib::eig_gen_twosided_balance
|
||||
{
|
||||
arma_debug_sigprint();
|
||||
|
||||
#if defined(ARMA_CRIPPLED_LAPACK)
|
||||
{
|
||||
arma_debug_print("auxlib::eig_gen_twosided_balance(): redirecting to auxlib::eig_gen() due to crippled LAPACK");
|
||||
|
||||
return auxlib::eig_gen(vals, lvecs, rvecs, expr);
|
||||
}
|
||||
#elif defined(ARMA_USE_LAPACK)
|
||||
#if defined(ARMA_USE_LAPACK)
|
||||
{
|
||||
typedef typename T1::pod_type T;
|
||||
typedef typename std::complex<T> eT;
|
||||
@@ -2716,42 +2686,6 @@ auxlib::chol_band(Mat<eT>& X, const uword KD, const uword layout)
|
||||
{
|
||||
arma_debug_sigprint();
|
||||
|
||||
return auxlib::chol_band_common(X, KD, layout);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<typename T>
|
||||
inline
|
||||
bool
|
||||
auxlib::chol_band(Mat< std::complex<T> >& X, const uword KD, const uword layout)
|
||||
{
|
||||
arma_debug_sigprint();
|
||||
|
||||
#if defined(ARMA_CRIPPLED_LAPACK)
|
||||
{
|
||||
arma_debug_print("auxlib::chol_band(): redirecting to auxlib::chol() due to crippled LAPACK");
|
||||
|
||||
arma_ignore(KD);
|
||||
|
||||
return auxlib::chol(X, layout);
|
||||
}
|
||||
#else
|
||||
{
|
||||
return auxlib::chol_band_common(X, KD, layout);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
inline
|
||||
bool
|
||||
auxlib::chol_band_common(Mat<eT>& X, const uword KD, const uword layout)
|
||||
{
|
||||
arma_debug_sigprint();
|
||||
|
||||
#if defined(ARMA_USE_LAPACK)
|
||||
{
|
||||
const uword N = X.n_rows;
|
||||
@@ -3954,9 +3888,7 @@ auxlib::svd_dc(Mat<eT>& U, Col<eT>& S, Mat<eT>& V, Mat<eT>& A)
|
||||
blas_int lda = blas_int(A.n_rows);
|
||||
blas_int ldu = blas_int(U.n_rows);
|
||||
blas_int ldvt = blas_int(V.n_rows);
|
||||
blas_int lwork1 = 3*min_mn*min_mn + (std::max)(max_mn, 4*min_mn*min_mn + 4*min_mn); // as per LAPACK 3.2 docs
|
||||
blas_int lwork2 = 4*min_mn*min_mn + 6*min_mn + max_mn; // as per LAPACK 3.8 docs; consistent with LAPACK 3.4 docs
|
||||
blas_int lwork_min = (std::max)(lwork1, lwork2); // due to differences between LAPACK 3.2 and 3.8
|
||||
blas_int lwork_min = 4*min_mn*min_mn + 6*min_mn + max_mn; // as per LAPACK 3.8 and 3.12 docs; consistent with LAPACK 3.4 docs
|
||||
blas_int info = 0;
|
||||
|
||||
S.set_size( static_cast<uword>(min_mn) );
|
||||
@@ -4034,8 +3966,8 @@ auxlib::svd_dc(Mat< std::complex<T> >& U, Col<T>& S, Mat< std::complex<T> >& V,
|
||||
blas_int lda = blas_int(A.n_rows);
|
||||
blas_int ldu = blas_int(U.n_rows);
|
||||
blas_int ldvt = blas_int(V.n_rows);
|
||||
blas_int lwork_min = min_mn*min_mn + 2*min_mn + max_mn; // as per LAPACK 3.2, 3.4, 3.8 docs
|
||||
blas_int lrwork = min_mn * ((std::max)(5*min_mn+7, 2*max_mn + 2*min_mn+1)); // as per LAPACK 3.4 docs; LAPACK 3.8 uses 5*min_mn+5 instead of 5*min_mn+7
|
||||
blas_int lwork_min = min_mn*min_mn + 2*min_mn + max_mn; // as per LAPACK 3.2, 3.4, 3.8, 3.12 docs
|
||||
blas_int lrwork = min_mn * ((std::max)(5*min_mn+5, 2*max_mn + 2*min_mn+1)); // as per LAPACK 3.8 and 3.12 docs
|
||||
blas_int info = 0;
|
||||
|
||||
S.set_size( static_cast<uword>(min_mn) );
|
||||
@@ -4103,13 +4035,10 @@ auxlib::svd_dc_econ(Mat<eT>& U, Col<eT>& S, Mat<eT>& V, Mat<eT>& A)
|
||||
blas_int m = blas_int(A.n_rows);
|
||||
blas_int n = blas_int(A.n_cols);
|
||||
blas_int min_mn = (std::min)(m,n);
|
||||
blas_int max_mn = (std::max)(m,n);
|
||||
blas_int lda = blas_int(A.n_rows);
|
||||
blas_int ldu = m;
|
||||
blas_int ldvt = min_mn;
|
||||
blas_int lwork1 = 3*min_mn*min_mn + (std::max)( max_mn, 4*min_mn*min_mn + 4*min_mn ); // as per LAPACK 3.2 docs
|
||||
blas_int lwork2 = 4*min_mn*min_mn + 6*min_mn + max_mn; // as per LAPACK 3.4 docs; LAPACK 3.8 requires 4*min_mn*min_mn + 7*min_mn
|
||||
blas_int lwork_min = (std::max)(lwork1, lwork2); // due to differences between LAPACK 3.2 and 3.4
|
||||
blas_int lwork_min = 4*min_mn*min_mn + 7*min_mn; // as per LAPACK 3.8 and 3.12 docs
|
||||
blas_int info = 0;
|
||||
|
||||
if(A.is_empty())
|
||||
@@ -4194,8 +4123,8 @@ auxlib::svd_dc_econ(Mat< std::complex<T> >& U, Col<T>& S, Mat< std::complex<T> >
|
||||
blas_int lda = blas_int(A.n_rows);
|
||||
blas_int ldu = m;
|
||||
blas_int ldvt = min_mn;
|
||||
blas_int lwork_min = min_mn*min_mn + 2*min_mn + max_mn; // as per LAPACK 3.2 docs
|
||||
blas_int lrwork = min_mn * ((std::max)(5*min_mn+7, 2*max_mn + 2*min_mn+1)); // LAPACK 3.8 uses 5*min_mn+5 instead of 5*min_mn+7
|
||||
blas_int lwork_min = min_mn*min_mn + 3*min_mn; // as per LAPACK 3.12 docs
|
||||
blas_int lrwork = min_mn * ((std::max)(5*min_mn+5, 2*max_mn + 2*min_mn+1)); // as per LAPACK 3.8 and 3.12 docs
|
||||
blas_int info = 0;
|
||||
|
||||
if(A.is_empty())
|
||||
@@ -4650,13 +4579,7 @@ auxlib::solve_sym_fast(Mat< std::complex<typename T1::pod_type> >& out, Mat< std
|
||||
|
||||
if(A.is_empty() || out.is_empty()) { out.zeros(A.n_cols, B_n_cols); return true; }
|
||||
|
||||
#if defined(ARMA_CRIPPLED_LAPACK)
|
||||
{
|
||||
arma_debug_print("auxlib::solve_sym_fast(): redirecting to auxlib::solve_square_fast() due to crippled LAPACK");
|
||||
|
||||
return auxlib::solve_square_fast(out, A, B_expr);
|
||||
}
|
||||
#elif defined(ARMA_USE_LAPACK)
|
||||
#if defined(ARMA_USE_LAPACK)
|
||||
{
|
||||
typedef typename T1::pod_type T;
|
||||
typedef std::complex<T> eT;
|
||||
@@ -4726,13 +4649,7 @@ auxlib::solve_sym_rcond(Mat<typename T1::pod_type>& out, typename T1::pod_type&
|
||||
|
||||
if(A.is_empty() || out.is_empty()) { out.zeros(A.n_cols, B_n_cols); return true; }
|
||||
|
||||
#if defined(ARMA_CRIPPLED_LAPACK)
|
||||
{
|
||||
arma_debug_print("auxlib::solve_sym_rcond(): redirecting to auxlib::solve_square_rcond() due to crippled LAPACK");
|
||||
|
||||
return auxlib::solve_square_rcond(out, out_rcond, A, B_expr);
|
||||
}
|
||||
#elif defined(ARMA_USE_LAPACK)
|
||||
#if defined(ARMA_USE_LAPACK)
|
||||
{
|
||||
typedef typename T1::pod_type eT;
|
||||
|
||||
@@ -4894,28 +4811,6 @@ auxlib::solve_sympd_fast(Mat<typename T1::elem_type>& out, Mat<typename T1::elem
|
||||
{
|
||||
arma_debug_sigprint();
|
||||
|
||||
#if defined(ARMA_CRIPPLED_LAPACK)
|
||||
{
|
||||
arma_debug_print("auxlib::solve_sympd_fast(): redirecting to auxlib::solve_square_fast() due to crippled LAPACK");
|
||||
|
||||
return auxlib::solve_square_fast(out, A, B_expr);
|
||||
}
|
||||
#else
|
||||
{
|
||||
return auxlib::solve_sympd_fast_common(out, A, B_expr);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<typename T1>
|
||||
inline
|
||||
bool
|
||||
auxlib::solve_sympd_fast_common(Mat<typename T1::elem_type>& out, Mat<typename T1::elem_type>& A, const Base<typename T1::elem_type,T1>& B_expr)
|
||||
{
|
||||
arma_debug_sigprint();
|
||||
|
||||
out = B_expr.get_ref();
|
||||
|
||||
const uword B_n_rows = out.n_rows;
|
||||
@@ -5034,15 +4929,7 @@ auxlib::solve_sympd_rcond(Mat< std::complex<typename T1::pod_type> >& out, bool&
|
||||
{
|
||||
arma_debug_sigprint();
|
||||
|
||||
#if defined(ARMA_CRIPPLED_LAPACK)
|
||||
{
|
||||
arma_debug_print("auxlib::solve_sympd_rcond(): redirecting to auxlib::solve_square_rcond() due to crippled LAPACK");
|
||||
|
||||
out_sympd_state = false;
|
||||
|
||||
return auxlib::solve_square_rcond(out, out_rcond, A, B_expr);
|
||||
}
|
||||
#elif defined(ARMA_USE_LAPACK)
|
||||
#if defined(ARMA_USE_LAPACK)
|
||||
{
|
||||
typedef typename T1::pod_type T;
|
||||
typedef typename std::complex<T> eT;
|
||||
@@ -5190,13 +5077,7 @@ auxlib::solve_sympd_refine(Mat< std::complex<typename T1::pod_type> >& out, type
|
||||
{
|
||||
arma_debug_sigprint();
|
||||
|
||||
#if defined(ARMA_CRIPPLED_LAPACK)
|
||||
{
|
||||
arma_debug_print("auxlib::solve_sympd_refine(): redirecting to auxlib::solve_square_refine() due to crippled LAPACK");
|
||||
|
||||
return auxlib::solve_square_refine(out, out_rcond, A, B_expr, equilibrate);
|
||||
}
|
||||
#elif defined(ARMA_USE_LAPACK)
|
||||
#if defined(ARMA_USE_LAPACK)
|
||||
{
|
||||
typedef typename T1::pod_type T;
|
||||
typedef typename std::complex<T> eT;
|
||||
@@ -5849,50 +5730,11 @@ auxlib::solve_trimat_rcond(Mat<typename T1::elem_type>& out, typename T1::pod_ty
|
||||
|
||||
|
||||
|
||||
//! solve a system of linear equations via LU decomposition (real band matrix)
|
||||
template<typename T1>
|
||||
inline
|
||||
bool
|
||||
auxlib::solve_band_fast(Mat<typename T1::pod_type>& out, Mat<typename T1::pod_type>& A, const uword KL, const uword KU, const Base<typename T1::pod_type,T1>& B_expr)
|
||||
{
|
||||
arma_debug_sigprint();
|
||||
|
||||
return auxlib::solve_band_fast_common(out, A, KL, KU, B_expr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! solve a system of linear equations via LU decomposition (complex band matrix)
|
||||
template<typename T1>
|
||||
inline
|
||||
bool
|
||||
auxlib::solve_band_fast(Mat< std::complex<typename T1::pod_type> >& out, Mat< std::complex<typename T1::pod_type> >& A, const uword KL, const uword KU, const Base< std::complex<typename T1::pod_type>,T1>& B_expr)
|
||||
{
|
||||
arma_debug_sigprint();
|
||||
|
||||
#if defined(ARMA_CRIPPLED_LAPACK)
|
||||
{
|
||||
arma_debug_print("auxlib::solve_band_fast(): redirecting to auxlib::solve_square_fast() due to crippled LAPACK");
|
||||
|
||||
arma_ignore(KL);
|
||||
arma_ignore(KU);
|
||||
|
||||
return auxlib::solve_square_fast(out, A, B_expr);
|
||||
}
|
||||
#else
|
||||
{
|
||||
return auxlib::solve_band_fast_common(out, A, KL, KU, B_expr);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! solve a system of linear equations via LU decomposition (band matrix)
|
||||
template<typename T1>
|
||||
inline
|
||||
bool
|
||||
auxlib::solve_band_fast_common(Mat<typename T1::elem_type>& out, const Mat<typename T1::elem_type>& A, const uword KL, const uword KU, const Base<typename T1::elem_type,T1>& B_expr)
|
||||
auxlib::solve_band_fast(Mat<typename T1::elem_type>& out, const Mat<typename T1::elem_type>& A, const uword KL, const uword KU, const Base<typename T1::elem_type,T1>& B_expr)
|
||||
{
|
||||
arma_debug_sigprint();
|
||||
|
||||
@@ -5950,50 +5792,11 @@ auxlib::solve_band_fast_common(Mat<typename T1::elem_type>& out, const Mat<typen
|
||||
|
||||
|
||||
|
||||
//! solve a system of linear equations via LU decomposition (real band matrix)
|
||||
template<typename T1>
|
||||
inline
|
||||
bool
|
||||
auxlib::solve_band_rcond(Mat<typename T1::pod_type>& out, typename T1::pod_type& out_rcond, Mat<typename T1::pod_type>& A, const uword KL, const uword KU, const Base<typename T1::pod_type,T1>& B_expr)
|
||||
{
|
||||
arma_debug_sigprint();
|
||||
|
||||
return auxlib::solve_band_rcond_common(out, out_rcond, A, KL, KU, B_expr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! solve a system of linear equations via LU decomposition (complex band matrix)
|
||||
template<typename T1>
|
||||
inline
|
||||
bool
|
||||
auxlib::solve_band_rcond(Mat< std::complex<typename T1::pod_type> >& out, typename T1::pod_type& out_rcond, Mat< std::complex<typename T1::pod_type> >& A, const uword KL, const uword KU, const Base< std::complex<typename T1::pod_type>,T1>& B_expr)
|
||||
{
|
||||
arma_debug_sigprint();
|
||||
|
||||
#if defined(ARMA_CRIPPLED_LAPACK)
|
||||
{
|
||||
arma_debug_print("auxlib::solve_band_rcond(): redirecting to auxlib::solve_square_rcond() due to crippled LAPACK");
|
||||
|
||||
arma_ignore(KL);
|
||||
arma_ignore(KU);
|
||||
|
||||
return auxlib::solve_square_rcond(out, out_rcond, A, B_expr);
|
||||
}
|
||||
#else
|
||||
{
|
||||
return auxlib::solve_band_rcond_common(out, out_rcond, A, KL, KU, B_expr);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! solve a system of linear equations via LU decomposition (band matrix)
|
||||
template<typename T1>
|
||||
inline
|
||||
bool
|
||||
auxlib::solve_band_rcond_common(Mat<typename T1::elem_type>& out, typename T1::pod_type& out_rcond, const Mat<typename T1::elem_type>& A, const uword KL, const uword KU, const Base<typename T1::elem_type,T1>& B_expr)
|
||||
auxlib::solve_band_rcond(Mat<typename T1::elem_type>& out, typename T1::pod_type& out_rcond, const Mat<typename T1::elem_type>& A, const uword KL, const uword KU, const Base<typename T1::elem_type,T1>& B_expr)
|
||||
{
|
||||
arma_debug_sigprint();
|
||||
|
||||
@@ -6174,16 +5977,7 @@ auxlib::solve_band_refine(Mat< std::complex<typename T1::pod_type> >& out, typen
|
||||
{
|
||||
arma_debug_sigprint();
|
||||
|
||||
#if defined(ARMA_CRIPPLED_LAPACK)
|
||||
{
|
||||
arma_debug_print("auxlib::solve_band_refine(): redirecting to auxlib::solve_square_refine() due to crippled LAPACK");
|
||||
|
||||
arma_ignore(KL);
|
||||
arma_ignore(KU);
|
||||
|
||||
return auxlib::solve_square_refine(out, out_rcond, A, B_expr, equilibrate);
|
||||
}
|
||||
#elif defined(ARMA_USE_LAPACK)
|
||||
#if defined(ARMA_USE_LAPACK)
|
||||
{
|
||||
typedef typename T1::pod_type T;
|
||||
typedef typename std::complex<T> eT;
|
||||
@@ -6270,47 +6064,11 @@ auxlib::solve_band_refine(Mat< std::complex<typename T1::pod_type> >& out, typen
|
||||
|
||||
|
||||
|
||||
//! solve a system of linear equations via Gaussian elimination with partial pivoting (real tridiagonal band matrix)
|
||||
template<typename T1>
|
||||
inline
|
||||
bool
|
||||
auxlib::solve_tridiag_fast(Mat<typename T1::pod_type>& out, Mat<typename T1::pod_type>& A, const Base<typename T1::pod_type,T1>& B_expr)
|
||||
{
|
||||
arma_debug_sigprint();
|
||||
|
||||
return auxlib::solve_tridiag_fast_common(out, A, B_expr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! solve a system of linear equations via Gaussian elimination with partial pivoting (complex tridiagonal band matrix)
|
||||
template<typename T1>
|
||||
inline
|
||||
bool
|
||||
auxlib::solve_tridiag_fast(Mat< std::complex<typename T1::pod_type> >& out, Mat< std::complex<typename T1::pod_type> >& A, const Base< std::complex<typename T1::pod_type>,T1>& B_expr)
|
||||
{
|
||||
arma_debug_sigprint();
|
||||
|
||||
#if defined(ARMA_CRIPPLED_LAPACK)
|
||||
{
|
||||
arma_debug_print("auxlib::solve_tridiag_fast(): redirecting to auxlib::solve_square_fast() due to crippled LAPACK");
|
||||
|
||||
return auxlib::solve_square_fast(out, A, B_expr);
|
||||
}
|
||||
#else
|
||||
{
|
||||
return auxlib::solve_tridiag_fast_common(out, A, B_expr);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! solve a system of linear equations via Gaussian elimination with partial pivoting (tridiagonal band matrix)
|
||||
template<typename T1>
|
||||
inline
|
||||
bool
|
||||
auxlib::solve_tridiag_fast_common(Mat<typename T1::elem_type>& out, const Mat<typename T1::elem_type>& A, const Base<typename T1::elem_type,T1>& B_expr)
|
||||
auxlib::solve_tridiag_fast(Mat<typename T1::elem_type>& out, const Mat<typename T1::elem_type>& A, const Base<typename T1::elem_type,T1>& B_expr)
|
||||
{
|
||||
arma_debug_sigprint();
|
||||
|
||||
@@ -6952,13 +6710,7 @@ auxlib::rcond_sym(Mat< std::complex<T> >& A)
|
||||
{
|
||||
// NOTE: the function name is required for overloading, but is a misnomer: it processes complex hermitian matrices
|
||||
|
||||
#if defined(ARMA_CRIPPLED_LAPACK)
|
||||
{
|
||||
arma_debug_print("auxlib::rcond_sym(): redirecting to auxlib::rcond() due to crippled LAPACK");
|
||||
|
||||
return auxlib::rcond(A);
|
||||
}
|
||||
#elif defined(ARMA_USE_LAPACK)
|
||||
#if defined(ARMA_USE_LAPACK)
|
||||
{
|
||||
typedef typename std::complex<T> eT;
|
||||
|
||||
@@ -7205,13 +6957,7 @@ inline
|
||||
T
|
||||
auxlib::lu_rcond_sympd(const Mat< std::complex<T> >& A, const T norm_val)
|
||||
{
|
||||
#if defined(ARMA_CRIPPLED_LAPACK)
|
||||
{
|
||||
arma_ignore(A);
|
||||
arma_ignore(norm_val);
|
||||
return T(0);
|
||||
}
|
||||
#elif defined(ARMA_USE_LAPACK)
|
||||
#if defined(ARMA_USE_LAPACK)
|
||||
{
|
||||
typedef typename std::complex<T> eT;
|
||||
|
||||
@@ -7287,16 +7033,7 @@ inline
|
||||
T
|
||||
auxlib::lu_rcond_band(const Mat< std::complex<T> >& AB, const uword KL, const uword KU, const podarray<blas_int>& ipiv, const T norm_val)
|
||||
{
|
||||
#if defined(ARMA_CRIPPLED_LAPACK)
|
||||
{
|
||||
arma_ignore(AB);
|
||||
arma_ignore(KL);
|
||||
arma_ignore(KU);
|
||||
arma_ignore(ipiv);
|
||||
arma_ignore(norm_val);
|
||||
return T(0);
|
||||
}
|
||||
#elif defined(ARMA_USE_LAPACK)
|
||||
#if defined(ARMA_USE_LAPACK)
|
||||
{
|
||||
typedef typename std::complex<T> eT;
|
||||
|
||||
@@ -7334,26 +7071,6 @@ auxlib::lu_rcond_band(const Mat< std::complex<T> >& AB, const uword KL, const uw
|
||||
|
||||
|
||||
|
||||
template<typename T1>
|
||||
inline
|
||||
bool
|
||||
auxlib::crippled_lapack(const Base<typename T1::elem_type, T1>&)
|
||||
{
|
||||
#if defined(ARMA_CRIPPLED_LAPACK)
|
||||
{
|
||||
arma_debug_print("auxlib::crippled_lapack(): true");
|
||||
|
||||
return (is_cx<typename T1::elem_type>::yes);
|
||||
}
|
||||
#else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
inline
|
||||
bool
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -78,13 +78,8 @@
|
||||
#endif
|
||||
|
||||
|
||||
#if !defined(ARMA_HAVE_CXX11)
|
||||
#error "*** C++11 compiler required; enable C++11 mode in your compiler, or use an earlier version of Armadillo"
|
||||
#endif
|
||||
|
||||
|
||||
#if (!defined(ARMA_HAVE_CXX14)) && (!defined(ARMA_IGNORE_DEPRECATED_MARKER))
|
||||
#pragma message ("INFO: support for C++11 is deprecated; minimum recommended standard is C++14")
|
||||
#if !defined(ARMA_HAVE_CXX14)
|
||||
#error "*** C++14 compiler required; enable C++14 mode in your compiler, or use an earlier version of Armadillo"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -22,8 +22,6 @@
|
||||
#undef arma_aligned
|
||||
#undef arma_align_mem
|
||||
#undef arma_warn_unused
|
||||
#undef arma_deprecated
|
||||
#undef arma_frown
|
||||
#undef arma_malloc
|
||||
#undef arma_inline
|
||||
#undef arma_noinline
|
||||
@@ -34,8 +32,6 @@
|
||||
#define arma_aligned
|
||||
#define arma_align_mem
|
||||
#define arma_warn_unused
|
||||
#define arma_deprecated
|
||||
#define arma_frown(msg)
|
||||
#define arma_malloc
|
||||
#define arma_inline inline
|
||||
#define arma_noinline
|
||||
@@ -102,6 +98,7 @@
|
||||
#define ARMA_SIMPLE_LOOPS
|
||||
|
||||
#undef ARMA_GOOD_COMPILER
|
||||
#undef ARMA_REAL_GCC
|
||||
|
||||
// posix_memalign() is part of IEEE standard 1003.1
|
||||
// http://pubs.opengroup.org/onlinepubs/009696899/functions/posix_memalign.html
|
||||
@@ -162,19 +159,14 @@
|
||||
#error "*** newer compiler required; need at least gcc 8.1 ***"
|
||||
#endif
|
||||
|
||||
#if (__GNUC__ >= 17)
|
||||
#undef ARMA_IGNORE_DEPRECATED_MARKER
|
||||
#endif
|
||||
|
||||
#define ARMA_GOOD_COMPILER
|
||||
#define ARMA_REAL_GCC
|
||||
|
||||
#undef arma_hot
|
||||
#undef arma_cold
|
||||
#undef arma_aligned
|
||||
#undef arma_align_mem
|
||||
#undef arma_warn_unused
|
||||
#undef arma_deprecated
|
||||
#undef arma_frown
|
||||
#undef arma_malloc
|
||||
#undef arma_inline
|
||||
#undef arma_noinline
|
||||
@@ -184,8 +176,6 @@
|
||||
#define arma_aligned __attribute__((__aligned__))
|
||||
#define arma_align_mem __attribute__((__aligned__(16)))
|
||||
#define arma_warn_unused __attribute__((__warn_unused_result__))
|
||||
#define arma_deprecated __attribute__((__deprecated__))
|
||||
#define arma_frown(msg) __attribute__((__deprecated__(msg)))
|
||||
#define arma_malloc __attribute__((__malloc__))
|
||||
#define arma_inline __attribute__((__always_inline__)) inline
|
||||
#define arma_noinline __attribute__((__noinline__))
|
||||
@@ -223,12 +213,6 @@
|
||||
|
||||
// #pragma message ("using Clang extensions")
|
||||
|
||||
#if defined(__clang_major__) && !defined(__apple_build_version__)
|
||||
#if (__clang_major__ >= 24)
|
||||
#undef ARMA_IGNORE_DEPRECATED_MARKER
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define ARMA_GOOD_COMPILER
|
||||
|
||||
#if !defined(__has_attribute)
|
||||
@@ -251,16 +235,6 @@
|
||||
#define arma_warn_unused __attribute__((__warn_unused_result__))
|
||||
#endif
|
||||
|
||||
#if __has_attribute(__deprecated__)
|
||||
#undef arma_deprecated
|
||||
#define arma_deprecated __attribute__((__deprecated__))
|
||||
#endif
|
||||
|
||||
#if __has_attribute(__deprecated__)
|
||||
#undef arma_frown
|
||||
#define arma_frown(msg) __attribute__((__deprecated__(msg)))
|
||||
#endif
|
||||
|
||||
#if __has_attribute(__malloc__)
|
||||
#undef arma_malloc
|
||||
#define arma_malloc __attribute__((__malloc__))
|
||||
@@ -318,9 +292,6 @@
|
||||
#error "*** newer compiler required ***"
|
||||
#endif
|
||||
|
||||
#undef arma_deprecated
|
||||
#define arma_deprecated __declspec(deprecated)
|
||||
|
||||
#undef arma_noinline
|
||||
#define arma_noinline __declspec(noinline)
|
||||
|
||||
@@ -378,15 +349,6 @@
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(ARMA_HAVE_CXX14)
|
||||
#undef arma_deprecated
|
||||
#define arma_deprecated [[deprecated]]
|
||||
|
||||
#undef arma_frown
|
||||
#define arma_frown(msg) [[deprecated(msg)]]
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(ARMA_HAVE_CXX17)
|
||||
#undef arma_warn_unused
|
||||
#define arma_warn_unused [[nodiscard]]
|
||||
@@ -394,16 +356,17 @@
|
||||
|
||||
|
||||
#if !defined(ARMA_DONT_USE_OPENMP)
|
||||
#if (defined(_OPENMP) && (_OPENMP >= 201107))
|
||||
#if (defined(_OPENMP) && (_OPENMP >= 201307))
|
||||
#undef ARMA_USE_OPENMP
|
||||
#define ARMA_USE_OPENMP
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#if ( defined(ARMA_USE_OPENMP) && (!defined(_OPENMP) || (defined(_OPENMP) && (_OPENMP < 201107))) )
|
||||
#if ( defined(ARMA_USE_OPENMP) && (!defined(_OPENMP) || (defined(_OPENMP) && (_OPENMP < 201307))) )
|
||||
// OpenMP 3.0 required for parallelisation of loops with unsigned integers
|
||||
// OpenMP 3.1 required for atomic read and atomic write
|
||||
// OpenMP 3.1 required for atomic read/write
|
||||
// OpenMP 4.0 required for seq_cst memory order clause in atomic read/write
|
||||
#undef ARMA_USE_OPENMP
|
||||
#undef ARMA_PRINT_OPENMP_WARNING
|
||||
#define ARMA_PRINT_OPENMP_WARNING
|
||||
@@ -411,11 +374,10 @@
|
||||
|
||||
|
||||
#if defined(ARMA_PRINT_OPENMP_WARNING) && !defined(ARMA_DONT_PRINT_OPENMP_WARNING)
|
||||
#pragma message ("WARNING: use of OpenMP disabled; compiler support for OpenMP 3.1+ not detected")
|
||||
#pragma message ("WARNING: use of OpenMP disabled; compiler support for OpenMP 4.0+ not detected")
|
||||
|
||||
#if (defined(_OPENMP) && (_OPENMP < 201107))
|
||||
#if (defined(_OPENMP) && (_OPENMP < 201307))
|
||||
#pragma message ("NOTE: your compiler has an outdated version of OpenMP")
|
||||
#pragma message ("NOTE: consider upgrading to a better compiler")
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -474,15 +436,3 @@
|
||||
// https://sourceware.org/bugzilla/show_bug.cgi?id=19239
|
||||
#undef minor
|
||||
#undef major
|
||||
|
||||
|
||||
// WARNING: option 'ARMA_IGNORE_DEPRECATED_MARKER' is not supported when compiling with gcc 17+ or clang 24+
|
||||
// WARNING: disabling deprecation messages is counter-productive
|
||||
|
||||
#if defined(ARMA_IGNORE_DEPRECATED_MARKER)
|
||||
#undef arma_deprecated
|
||||
#define arma_deprecated
|
||||
|
||||
#undef arma_frown
|
||||
#define arma_frown(msg)
|
||||
#endif
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -20,10 +20,26 @@
|
||||
//! @{
|
||||
|
||||
|
||||
//
|
||||
// for preventing pedantic compiler warnings
|
||||
|
||||
template<bool do_eval>
|
||||
struct cond_rel
|
||||
{
|
||||
template<typename eT> static constexpr bool lt(const eT A, const eT B);
|
||||
template<typename eT> static constexpr bool gt(const eT A, const eT B);
|
||||
|
||||
template<typename eT> static constexpr bool leq(const eT A, const eT B);
|
||||
template<typename eT> static constexpr bool geq(const eT A, const eT B);
|
||||
|
||||
template<typename eT> static constexpr eT make_neg(const eT val);
|
||||
};
|
||||
|
||||
|
||||
|
||||
template<>
|
||||
template<typename eT>
|
||||
arma_inline
|
||||
constexpr
|
||||
bool
|
||||
cond_rel<true>::lt(const eT A, const eT B)
|
||||
{
|
||||
@@ -34,7 +50,7 @@ cond_rel<true>::lt(const eT A, const eT B)
|
||||
|
||||
template<>
|
||||
template<typename eT>
|
||||
arma_inline
|
||||
constexpr
|
||||
bool
|
||||
cond_rel<false>::lt(const eT, const eT)
|
||||
{
|
||||
@@ -45,7 +61,7 @@ cond_rel<false>::lt(const eT, const eT)
|
||||
|
||||
template<>
|
||||
template<typename eT>
|
||||
arma_inline
|
||||
constexpr
|
||||
bool
|
||||
cond_rel<true>::gt(const eT A, const eT B)
|
||||
{
|
||||
@@ -56,7 +72,7 @@ cond_rel<true>::gt(const eT A, const eT B)
|
||||
|
||||
template<>
|
||||
template<typename eT>
|
||||
arma_inline
|
||||
constexpr
|
||||
bool
|
||||
cond_rel<false>::gt(const eT, const eT)
|
||||
{
|
||||
@@ -67,7 +83,7 @@ cond_rel<false>::gt(const eT, const eT)
|
||||
|
||||
template<>
|
||||
template<typename eT>
|
||||
arma_inline
|
||||
constexpr
|
||||
bool
|
||||
cond_rel<true>::leq(const eT A, const eT B)
|
||||
{
|
||||
@@ -78,7 +94,7 @@ cond_rel<true>::leq(const eT A, const eT B)
|
||||
|
||||
template<>
|
||||
template<typename eT>
|
||||
arma_inline
|
||||
constexpr
|
||||
bool
|
||||
cond_rel<false>::leq(const eT, const eT)
|
||||
{
|
||||
@@ -89,7 +105,7 @@ cond_rel<false>::leq(const eT, const eT)
|
||||
|
||||
template<>
|
||||
template<typename eT>
|
||||
arma_inline
|
||||
constexpr
|
||||
bool
|
||||
cond_rel<true>::geq(const eT A, const eT B)
|
||||
{
|
||||
@@ -100,7 +116,7 @@ cond_rel<true>::geq(const eT A, const eT B)
|
||||
|
||||
template<>
|
||||
template<typename eT>
|
||||
arma_inline
|
||||
constexpr
|
||||
bool
|
||||
cond_rel<false>::geq(const eT, const eT)
|
||||
{
|
||||
@@ -111,7 +127,7 @@ cond_rel<false>::geq(const eT, const eT)
|
||||
|
||||
template<>
|
||||
template<typename eT>
|
||||
arma_inline
|
||||
constexpr
|
||||
eT
|
||||
cond_rel<true>::make_neg(const eT val)
|
||||
{
|
||||
@@ -122,7 +138,7 @@ cond_rel<true>::make_neg(const eT val)
|
||||
|
||||
template<>
|
||||
template<typename eT>
|
||||
arma_inline
|
||||
constexpr
|
||||
eT
|
||||
cond_rel<false>::make_neg(const eT)
|
||||
{
|
||||
@@ -1,42 +0,0 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// 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 cond_rel
|
||||
//! @{
|
||||
|
||||
|
||||
//
|
||||
// for preventing pedantic compiler warnings
|
||||
|
||||
template<const bool do_eval>
|
||||
class cond_rel
|
||||
{
|
||||
public:
|
||||
|
||||
template<typename eT> arma_inline static bool lt(const eT A, const eT B);
|
||||
template<typename eT> arma_inline static bool gt(const eT A, const eT B);
|
||||
|
||||
template<typename eT> arma_inline static bool leq(const eT A, const eT B);
|
||||
template<typename eT> arma_inline static bool geq(const eT A, const eT B);
|
||||
|
||||
template<typename eT> arma_inline static eT make_neg(const eT val);
|
||||
};
|
||||
|
||||
|
||||
|
||||
//! @}
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -147,6 +147,12 @@
|
||||
//// Note that ARMA_64BIT_WORD is automatically enabled when std::size_t has 64 bits and ARMA_32BIT_WORD is not defined.
|
||||
#endif
|
||||
|
||||
#if !defined(ARMA_FORCE_USE_FP16)
|
||||
// #define ARMA_FORCE_USE_FP16
|
||||
//// Uncomment the above line to force the use of fp16 and cx_fp16 element types even if hardware support is not detected.
|
||||
//// NOTE: C++23 is also required for fp16 and cx_fp16.
|
||||
#endif
|
||||
|
||||
#if !defined(ARMA_OPTIMISE_BAND)
|
||||
#define ARMA_OPTIMISE_BAND
|
||||
//// Comment out the above line to disable optimised handling
|
||||
@@ -157,7 +163,7 @@
|
||||
#define ARMA_OPTIMISE_SYM
|
||||
//// Comment out the above line to disable optimised handling
|
||||
//// of symmetric/hermitian matrices by various functions:
|
||||
//// solve(), inv(), pinv(), expmat(), logmat(), sqrtmat(), rcond(), rank()
|
||||
//// solve(), inv(), pinv(), expmat(), logmat(), sqrtmat(), powmat(), rank(), cond(), rcond()
|
||||
#endif
|
||||
|
||||
#if !defined(ARMA_OPTIMISE_INVEXPR)
|
||||
@@ -166,6 +172,11 @@
|
||||
//// of inv() and inv_sympd() within compound expressions
|
||||
#endif
|
||||
|
||||
#if !defined(ARMA_OPTIMISE_POWEXPR)
|
||||
#define ARMA_OPTIMISE_POWEXPR
|
||||
//// Comment out the above line to disable optimised handling of pow()
|
||||
#endif
|
||||
|
||||
#if !defined(ARMA_CHECK_CONFORMANCE)
|
||||
#define ARMA_CHECK_CONFORMANCE
|
||||
//// Comment out the above line to disable conformance checks for bounds and size.
|
||||
@@ -209,32 +220,14 @@
|
||||
#define ARMA_DEBUG
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(ARMA_DEFAULT_OSTREAM)
|
||||
#pragma message ("WARNING: support for ARMA_DEFAULT_OSTREAM is deprecated and will be removed;")
|
||||
#pragma message ("WARNING: use ARMA_COUT_STREAM and ARMA_CERR_STREAM instead")
|
||||
#endif
|
||||
|
||||
|
||||
#if !defined(ARMA_COUT_STREAM)
|
||||
#if defined(ARMA_DEFAULT_OSTREAM)
|
||||
// for compatibility with earlier versions of Armadillo
|
||||
#define ARMA_COUT_STREAM ARMA_DEFAULT_OSTREAM
|
||||
#else
|
||||
#define ARMA_COUT_STREAM std::cout
|
||||
#endif
|
||||
#define ARMA_COUT_STREAM std::cout
|
||||
#endif
|
||||
|
||||
#if !defined(ARMA_CERR_STREAM)
|
||||
#if defined(ARMA_DEFAULT_OSTREAM)
|
||||
// for compatibility with earlier versions of Armadillo
|
||||
#define ARMA_CERR_STREAM ARMA_DEFAULT_OSTREAM
|
||||
#else
|
||||
#define ARMA_CERR_STREAM std::cerr
|
||||
#endif
|
||||
#define ARMA_CERR_STREAM std::cerr
|
||||
#endif
|
||||
|
||||
|
||||
#if !defined(ARMA_PRINT_EXCEPTIONS)
|
||||
// #define ARMA_PRINT_EXCEPTIONS
|
||||
#if defined(ARMA_PRINT_EXCEPTIONS_INTERNAL)
|
||||
@@ -288,13 +281,6 @@
|
||||
#undef ARMA_USE_STD_MUTEX
|
||||
#endif
|
||||
|
||||
// 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: use ARMA_DONT_USE_STD_MUTEX instead")
|
||||
#undef ARMA_USE_STD_MUTEX
|
||||
#endif
|
||||
|
||||
#if defined(ARMA_DONT_USE_OPENMP)
|
||||
#undef ARMA_USE_OPENMP
|
||||
#endif
|
||||
@@ -303,6 +289,10 @@
|
||||
#undef ARMA_64BIT_WORD
|
||||
#endif
|
||||
|
||||
#if defined(ARMA_DONT_USE_FP16)
|
||||
#undef ARMA_FORCE_USE_FP16
|
||||
#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
|
||||
@@ -336,6 +326,10 @@
|
||||
#undef ARMA_OPTIMISE_INVEXPR
|
||||
#endif
|
||||
|
||||
#if defined(ARMA_DONT_OPTIMISE_POWEXPR)
|
||||
#undef ARMA_OPTIMISE_POWEXPR
|
||||
#endif
|
||||
|
||||
#if defined(ARMA_DONT_CHECK_CONFORMANCE)
|
||||
#if defined(ARMA_CHECK_CONFORMANCE) && (ARMA_WARN_LEVEL >= 2)
|
||||
#pragma message ("WARNING: conformance checks disabled")
|
||||
@@ -348,10 +342,6 @@
|
||||
#undef ARMA_CHECK_NONFINITE
|
||||
#endif
|
||||
|
||||
#if defined(ARMA_DONT_IGNORE_DEPRECATED_MARKER)
|
||||
#undef ARMA_IGNORE_DEPRECATED_MARKER
|
||||
#endif
|
||||
|
||||
#if defined(ARMA_NO_DEBUG)
|
||||
#undef ARMA_DEBUG
|
||||
#undef ARMA_EXTRA_DEBUG
|
||||
@@ -369,25 +359,18 @@
|
||||
|
||||
#undef ARMA_WARN_LEVEL
|
||||
#define ARMA_WARN_LEVEL 3
|
||||
|
||||
#undef ARMA_IGNORE_DEPRECATED_MARKER
|
||||
#endif
|
||||
|
||||
#if defined(ARMA_DONT_PRINT_EXCEPTIONS)
|
||||
#undef ARMA_PRINT_EXCEPTIONS
|
||||
#endif
|
||||
|
||||
#if defined(ARMA_NO_CRIPPLED_LAPACK)
|
||||
#undef ARMA_CRIPPLED_LAPACK
|
||||
#if defined(ARMA_IGNORE_DEPRECATED_MARKER)
|
||||
#pragma message ("NOTE: option ARMA_IGNORE_DEPRECATED_MARKER is not supported")
|
||||
#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
|
||||
#pragma message ("NOTE: option ARMA_CRIPPLED_LAPACK is not supported")
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -147,6 +147,12 @@
|
||||
//// Note that ARMA_64BIT_WORD is automatically enabled when std::size_t has 64 bits and ARMA_32BIT_WORD is not defined.
|
||||
#endif
|
||||
|
||||
#if !defined(ARMA_FORCE_USE_FP16)
|
||||
// #define ARMA_FORCE_USE_FP16
|
||||
//// Uncomment the above line to force the use of fp16 and cx_fp16 element types even if hardware support is not detected.
|
||||
//// NOTE: C++23 is also required for fp16 and cx_fp16.
|
||||
#endif
|
||||
|
||||
#if !defined(ARMA_OPTIMISE_BAND)
|
||||
#define ARMA_OPTIMISE_BAND
|
||||
//// Comment out the above line to disable optimised handling
|
||||
@@ -157,7 +163,7 @@
|
||||
#define ARMA_OPTIMISE_SYM
|
||||
//// Comment out the above line to disable optimised handling
|
||||
//// of symmetric/hermitian matrices by various functions:
|
||||
//// solve(), inv(), pinv(), expmat(), logmat(), sqrtmat(), rcond(), rank()
|
||||
//// solve(), inv(), pinv(), expmat(), logmat(), sqrtmat(), powmat(), rank(), cond(), rcond()
|
||||
#endif
|
||||
|
||||
#if !defined(ARMA_OPTIMISE_INVEXPR)
|
||||
@@ -166,6 +172,11 @@
|
||||
//// of inv() and inv_sympd() within compound expressions
|
||||
#endif
|
||||
|
||||
#if !defined(ARMA_OPTIMISE_POWEXPR)
|
||||
#define ARMA_OPTIMISE_POWEXPR
|
||||
//// Comment out the above line to disable optimised handling of pow()
|
||||
#endif
|
||||
|
||||
#if !defined(ARMA_CHECK_CONFORMANCE)
|
||||
#define ARMA_CHECK_CONFORMANCE
|
||||
//// Comment out the above line to disable conformance checks for bounds and size.
|
||||
@@ -209,32 +220,14 @@
|
||||
#define ARMA_DEBUG
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(ARMA_DEFAULT_OSTREAM)
|
||||
#pragma message ("WARNING: support for ARMA_DEFAULT_OSTREAM is deprecated and will be removed;")
|
||||
#pragma message ("WARNING: use ARMA_COUT_STREAM and ARMA_CERR_STREAM instead")
|
||||
#endif
|
||||
|
||||
|
||||
#if !defined(ARMA_COUT_STREAM)
|
||||
#if defined(ARMA_DEFAULT_OSTREAM)
|
||||
// for compatibility with earlier versions of Armadillo
|
||||
#define ARMA_COUT_STREAM ARMA_DEFAULT_OSTREAM
|
||||
#else
|
||||
#define ARMA_COUT_STREAM std::cout
|
||||
#endif
|
||||
#define ARMA_COUT_STREAM std::cout
|
||||
#endif
|
||||
|
||||
#if !defined(ARMA_CERR_STREAM)
|
||||
#if defined(ARMA_DEFAULT_OSTREAM)
|
||||
// for compatibility with earlier versions of Armadillo
|
||||
#define ARMA_CERR_STREAM ARMA_DEFAULT_OSTREAM
|
||||
#else
|
||||
#define ARMA_CERR_STREAM std::cerr
|
||||
#endif
|
||||
#define ARMA_CERR_STREAM std::cerr
|
||||
#endif
|
||||
|
||||
|
||||
#if !defined(ARMA_PRINT_EXCEPTIONS)
|
||||
// #define ARMA_PRINT_EXCEPTIONS
|
||||
#if defined(ARMA_PRINT_EXCEPTIONS_INTERNAL)
|
||||
@@ -288,13 +281,6 @@
|
||||
#undef ARMA_USE_STD_MUTEX
|
||||
#endif
|
||||
|
||||
// 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: use ARMA_DONT_USE_STD_MUTEX instead")
|
||||
#undef ARMA_USE_STD_MUTEX
|
||||
#endif
|
||||
|
||||
#if defined(ARMA_DONT_USE_OPENMP)
|
||||
#undef ARMA_USE_OPENMP
|
||||
#endif
|
||||
@@ -303,6 +289,10 @@
|
||||
#undef ARMA_64BIT_WORD
|
||||
#endif
|
||||
|
||||
#if defined(ARMA_DONT_USE_FP16)
|
||||
#undef ARMA_FORCE_USE_FP16
|
||||
#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
|
||||
@@ -336,6 +326,10 @@
|
||||
#undef ARMA_OPTIMISE_INVEXPR
|
||||
#endif
|
||||
|
||||
#if defined(ARMA_DONT_OPTIMISE_POWEXPR)
|
||||
#undef ARMA_OPTIMISE_POWEXPR
|
||||
#endif
|
||||
|
||||
#if defined(ARMA_DONT_CHECK_CONFORMANCE)
|
||||
#if defined(ARMA_CHECK_CONFORMANCE) && (ARMA_WARN_LEVEL >= 2)
|
||||
#pragma message ("WARNING: conformance checks disabled")
|
||||
@@ -348,10 +342,6 @@
|
||||
#undef ARMA_CHECK_NONFINITE
|
||||
#endif
|
||||
|
||||
#if defined(ARMA_DONT_IGNORE_DEPRECATED_MARKER)
|
||||
#undef ARMA_IGNORE_DEPRECATED_MARKER
|
||||
#endif
|
||||
|
||||
#if defined(ARMA_NO_DEBUG)
|
||||
#undef ARMA_DEBUG
|
||||
#undef ARMA_EXTRA_DEBUG
|
||||
@@ -369,25 +359,18 @@
|
||||
|
||||
#undef ARMA_WARN_LEVEL
|
||||
#define ARMA_WARN_LEVEL 3
|
||||
|
||||
#undef ARMA_IGNORE_DEPRECATED_MARKER
|
||||
#endif
|
||||
|
||||
#if defined(ARMA_DONT_PRINT_EXCEPTIONS)
|
||||
#undef ARMA_PRINT_EXCEPTIONS
|
||||
#endif
|
||||
|
||||
#if defined(ARMA_NO_CRIPPLED_LAPACK)
|
||||
#undef ARMA_CRIPPLED_LAPACK
|
||||
#if defined(ARMA_IGNORE_DEPRECATED_MARKER)
|
||||
#pragma message ("NOTE: option ARMA_IGNORE_DEPRECATED_MARKER is not supported")
|
||||
#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
|
||||
#pragma message ("NOTE: option ARMA_CRIPPLED_LAPACK is not supported")
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -22,12 +22,11 @@
|
||||
|
||||
namespace priv
|
||||
{
|
||||
class Datum_helper
|
||||
struct Datum_helper
|
||||
{
|
||||
public:
|
||||
|
||||
template<typename eT>
|
||||
static
|
||||
constexpr
|
||||
typename arma_real_only<eT>::result
|
||||
nan(typename arma_real_only<eT>::result* junk = nullptr)
|
||||
{
|
||||
@@ -39,6 +38,7 @@ namespace priv
|
||||
|
||||
template<typename eT>
|
||||
static
|
||||
constexpr
|
||||
typename arma_cx_only<eT>::result
|
||||
nan(typename arma_cx_only<eT>::result* junk = nullptr)
|
||||
{
|
||||
@@ -52,6 +52,7 @@ namespace priv
|
||||
|
||||
template<typename eT>
|
||||
static
|
||||
constexpr
|
||||
typename arma_integral_only<eT>::result
|
||||
nan(typename arma_integral_only<eT>::result* junk = nullptr)
|
||||
{
|
||||
@@ -63,6 +64,7 @@ namespace priv
|
||||
|
||||
template<typename eT>
|
||||
static
|
||||
constexpr
|
||||
typename arma_real_only<eT>::result
|
||||
inf(typename arma_real_only<eT>::result* junk = nullptr)
|
||||
{
|
||||
@@ -74,6 +76,7 @@ namespace priv
|
||||
|
||||
template<typename eT>
|
||||
static
|
||||
constexpr
|
||||
typename arma_cx_only<eT>::result
|
||||
inf(typename arma_cx_only<eT>::result* junk = nullptr)
|
||||
{
|
||||
@@ -87,6 +90,7 @@ namespace priv
|
||||
|
||||
template<typename eT>
|
||||
static
|
||||
constexpr
|
||||
typename arma_integral_only<eT>::result
|
||||
inf(typename arma_integral_only<eT>::result* junk = nullptr)
|
||||
{
|
||||
@@ -107,10 +111,8 @@ namespace priv
|
||||
|
||||
|
||||
template<typename eT>
|
||||
class Datum
|
||||
struct Datum
|
||||
{
|
||||
public:
|
||||
|
||||
static const eT pi; //!< ratio of any circle's circumference to its diameter
|
||||
static const eT tau; //!< ratio of any circle's circumference to its radius (replacement of 2*pi)
|
||||
static const eT e; //!< base of the natural logarithm
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -26,58 +26,54 @@
|
||||
// eg. instead of math::pi(), use datum::pi
|
||||
|
||||
template<typename eT>
|
||||
class Math
|
||||
struct Math
|
||||
{
|
||||
public:
|
||||
|
||||
arma_frown("use datum::pi instead") static eT pi() { return eT(Datum<eT>::pi); }
|
||||
arma_frown("use datum::e instead") static eT e() { return eT(Datum<eT>::e); }
|
||||
arma_frown("use datum::euler instead") static eT euler() { return eT(Datum<eT>::euler); }
|
||||
arma_frown("use datum::gratio instead") static eT gratio() { return eT(Datum<eT>::gratio); }
|
||||
arma_frown("use datum::sqrt2 instead") static eT sqrt2() { return eT(Datum<eT>::sqrt2); }
|
||||
arma_frown("use datum::eps instead") static eT eps() { return eT(Datum<eT>::eps); }
|
||||
arma_frown("use datum::log_min instead") static eT log_min() { return eT(Datum<eT>::log_min); }
|
||||
arma_frown("use datum::log_max instead") static eT log_max() { return eT(Datum<eT>::log_max); }
|
||||
arma_frown("use datum::nan instead") static eT nan() { return eT(Datum<eT>::nan); }
|
||||
arma_frown("use datum::inf instead") static eT inf() { return eT(Datum<eT>::inf); }
|
||||
[[deprecated("use datum::pi instead")]] static eT pi() { return eT(Datum<eT>::pi); }
|
||||
[[deprecated("use datum::e instead")]] static eT e() { return eT(Datum<eT>::e); }
|
||||
[[deprecated("use datum::euler instead")]] static eT euler() { return eT(Datum<eT>::euler); }
|
||||
[[deprecated("use datum::gratio instead")]] static eT gratio() { return eT(Datum<eT>::gratio); }
|
||||
[[deprecated("use datum::sqrt2 instead")]] static eT sqrt2() { return eT(Datum<eT>::sqrt2); }
|
||||
[[deprecated("use datum::eps instead")]] static eT eps() { return eT(Datum<eT>::eps); }
|
||||
[[deprecated("use datum::log_min instead")]] static eT log_min() { return eT(Datum<eT>::log_min); }
|
||||
[[deprecated("use datum::log_max instead")]] static eT log_max() { return eT(Datum<eT>::log_max); }
|
||||
[[deprecated("use datum::nan instead")]] static eT nan() { return eT(Datum<eT>::nan); }
|
||||
[[deprecated("use datum::inf instead")]] static eT inf() { return eT(Datum<eT>::inf); }
|
||||
};
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
class Phy
|
||||
struct Phy
|
||||
{
|
||||
public:
|
||||
|
||||
arma_deprecated static eT m_u() { return eT(Datum<eT>::m_u); }
|
||||
arma_deprecated static eT N_A() { return eT(Datum<eT>::N_A); }
|
||||
arma_deprecated static eT k() { return eT(Datum<eT>::k); }
|
||||
arma_deprecated static eT k_evk() { return eT(Datum<eT>::k_evk); }
|
||||
arma_deprecated static eT a_0() { return eT(Datum<eT>::a_0); }
|
||||
arma_deprecated static eT mu_B() { return eT(Datum<eT>::mu_B); }
|
||||
arma_deprecated static eT Z_0() { return eT(Datum<eT>::Z_0); }
|
||||
arma_deprecated static eT G_0() { return eT(Datum<eT>::G_0); }
|
||||
arma_deprecated static eT k_e() { return eT(Datum<eT>::k_e); }
|
||||
arma_deprecated static eT eps_0() { return eT(Datum<eT>::eps_0); }
|
||||
arma_deprecated static eT m_e() { return eT(Datum<eT>::m_e); }
|
||||
arma_deprecated static eT eV() { return eT(Datum<eT>::eV); }
|
||||
arma_deprecated static eT e() { return eT(Datum<eT>::ec); }
|
||||
arma_deprecated static eT F() { return eT(Datum<eT>::F); }
|
||||
arma_deprecated static eT alpha() { return eT(Datum<eT>::alpha); }
|
||||
arma_deprecated static eT alpha_inv() { return eT(Datum<eT>::alpha_inv); }
|
||||
arma_deprecated static eT K_J() { return eT(Datum<eT>::K_J); }
|
||||
arma_deprecated static eT mu_0() { return eT(Datum<eT>::mu_0); }
|
||||
arma_deprecated static eT phi_0() { return eT(Datum<eT>::phi_0); }
|
||||
arma_deprecated static eT R() { return eT(Datum<eT>::R); }
|
||||
arma_deprecated static eT G() { return eT(Datum<eT>::G); }
|
||||
arma_deprecated static eT h() { return eT(Datum<eT>::h); }
|
||||
arma_deprecated static eT h_bar() { return eT(Datum<eT>::h_bar); }
|
||||
arma_deprecated static eT m_p() { return eT(Datum<eT>::m_p); }
|
||||
arma_deprecated static eT R_inf() { return eT(Datum<eT>::R_inf); }
|
||||
arma_deprecated static eT c_0() { return eT(Datum<eT>::c_0); }
|
||||
arma_deprecated static eT sigma() { return eT(Datum<eT>::sigma); }
|
||||
arma_deprecated static eT R_k() { return eT(Datum<eT>::R_k); }
|
||||
arma_deprecated static eT b() { return eT(Datum<eT>::b); }
|
||||
[[deprecated]] static eT m_u() { return eT(Datum<eT>::m_u); }
|
||||
[[deprecated]] static eT N_A() { return eT(Datum<eT>::N_A); }
|
||||
[[deprecated]] static eT k() { return eT(Datum<eT>::k); }
|
||||
[[deprecated]] static eT k_evk() { return eT(Datum<eT>::k_evk); }
|
||||
[[deprecated]] static eT a_0() { return eT(Datum<eT>::a_0); }
|
||||
[[deprecated]] static eT mu_B() { return eT(Datum<eT>::mu_B); }
|
||||
[[deprecated]] static eT Z_0() { return eT(Datum<eT>::Z_0); }
|
||||
[[deprecated]] static eT G_0() { return eT(Datum<eT>::G_0); }
|
||||
[[deprecated]] static eT k_e() { return eT(Datum<eT>::k_e); }
|
||||
[[deprecated]] static eT eps_0() { return eT(Datum<eT>::eps_0); }
|
||||
[[deprecated]] static eT m_e() { return eT(Datum<eT>::m_e); }
|
||||
[[deprecated]] static eT eV() { return eT(Datum<eT>::eV); }
|
||||
[[deprecated]] static eT e() { return eT(Datum<eT>::ec); }
|
||||
[[deprecated]] static eT F() { return eT(Datum<eT>::F); }
|
||||
[[deprecated]] static eT alpha() { return eT(Datum<eT>::alpha); }
|
||||
[[deprecated]] static eT alpha_inv() { return eT(Datum<eT>::alpha_inv); }
|
||||
[[deprecated]] static eT K_J() { return eT(Datum<eT>::K_J); }
|
||||
[[deprecated]] static eT mu_0() { return eT(Datum<eT>::mu_0); }
|
||||
[[deprecated]] static eT phi_0() { return eT(Datum<eT>::phi_0); }
|
||||
[[deprecated]] static eT R() { return eT(Datum<eT>::R); }
|
||||
[[deprecated]] static eT G() { return eT(Datum<eT>::G); }
|
||||
[[deprecated]] static eT h() { return eT(Datum<eT>::h); }
|
||||
[[deprecated]] static eT h_bar() { return eT(Datum<eT>::h_bar); }
|
||||
[[deprecated]] static eT m_p() { return eT(Datum<eT>::m_p); }
|
||||
[[deprecated]] static eT R_inf() { return eT(Datum<eT>::R_inf); }
|
||||
[[deprecated]] static eT c_0() { return eT(Datum<eT>::c_0); }
|
||||
[[deprecated]] static eT sigma() { return eT(Datum<eT>::sigma); }
|
||||
[[deprecated]] static eT R_k() { return eT(Datum<eT>::R_k); }
|
||||
[[deprecated]] static eT b() { return eT(Datum<eT>::b); }
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
@@ -39,7 +39,7 @@ get_cerr_stream()
|
||||
|
||||
|
||||
|
||||
arma_deprecated
|
||||
[[deprecated]]
|
||||
inline
|
||||
std::ostream&
|
||||
get_stream_err1()
|
||||
@@ -49,7 +49,7 @@ get_stream_err1()
|
||||
|
||||
|
||||
|
||||
arma_deprecated
|
||||
[[deprecated]]
|
||||
inline
|
||||
std::ostream&
|
||||
get_stream_err2()
|
||||
@@ -59,7 +59,7 @@ get_stream_err2()
|
||||
|
||||
|
||||
|
||||
arma_frown("this function does nothing; instead use ARMA_COUT_STREAM or ARMA_WARN_LEVEL; see documentation")
|
||||
[[deprecated("this function does nothing; instead use ARMA_COUT_STREAM or ARMA_WARN_LEVEL; see documentation")]]
|
||||
inline
|
||||
void
|
||||
set_cout_stream(const std::ostream&)
|
||||
@@ -68,7 +68,7 @@ set_cout_stream(const std::ostream&)
|
||||
|
||||
|
||||
|
||||
arma_frown("this function does nothing; instead use ARMA_CERR_STREAM or ARMA_WARN_LEVEL; see documentation")
|
||||
[[deprecated("this function does nothing; instead use ARMA_CERR_STREAM or ARMA_WARN_LEVEL; see documentation")]]
|
||||
inline
|
||||
void
|
||||
set_cerr_stream(const std::ostream&)
|
||||
@@ -77,7 +77,7 @@ set_cerr_stream(const std::ostream&)
|
||||
|
||||
|
||||
|
||||
arma_frown("this function does nothing; instead use ARMA_CERR_STREAM or ARMA_WARN_LEVEL; see documentation")
|
||||
[[deprecated("this function does nothing; instead use ARMA_CERR_STREAM or ARMA_WARN_LEVEL; see documentation")]]
|
||||
inline
|
||||
void
|
||||
set_stream_err1(const std::ostream&)
|
||||
@@ -86,7 +86,7 @@ set_stream_err1(const std::ostream&)
|
||||
|
||||
|
||||
|
||||
arma_frown("this function does nothing; instead use ARMA_CERR_STREAM or ARMA_WARN_LEVEL; see documentation")
|
||||
[[deprecated("this function does nothing; instead use ARMA_CERR_STREAM or ARMA_WARN_LEVEL; see documentation")]]
|
||||
inline
|
||||
void
|
||||
set_stream_err2(const std::ostream&)
|
||||
@@ -96,7 +96,7 @@ set_stream_err2(const std::ostream&)
|
||||
|
||||
|
||||
template<typename T>
|
||||
arma_frown("this function does nothing; instead use ARMA_COUT_STREAM or ARMA_WARN_LEVEL; see documentation")
|
||||
[[deprecated("this function does nothing; instead use ARMA_COUT_STREAM or ARMA_WARN_LEVEL; see documentation")]]
|
||||
inline
|
||||
std::ostream&
|
||||
arma_cout_stream(std::ostream*)
|
||||
@@ -107,7 +107,7 @@ arma_cout_stream(std::ostream*)
|
||||
|
||||
|
||||
template<typename T>
|
||||
arma_frown("this function does nothing; instead use ARMA_CERR_STREAM or ARMA_WARN_LEVEL; see documentation")
|
||||
[[deprecated("this function does nothing; instead use ARMA_CERR_STREAM or ARMA_WARN_LEVEL; see documentation")]]
|
||||
inline
|
||||
std::ostream&
|
||||
arma_cerr_stream(std::ostream*)
|
||||
@@ -1330,6 +1330,47 @@ arma_assert_atlas_size(const T1& A, const T2& B)
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
inline
|
||||
void
|
||||
arma_elem_type_string(std::string& out)
|
||||
{
|
||||
if( is_u8<eT>::value) { out = "u8"; }
|
||||
else if( is_s8<eT>::value) { out = "s8"; }
|
||||
else if( is_u16<eT>::value) { out = "u16"; }
|
||||
else if( is_s16<eT>::value) { out = "s16"; }
|
||||
else if( is_u32<eT>::value) { out = "u32"; }
|
||||
else if( is_s32<eT>::value) { out = "s32"; }
|
||||
else if( is_u64<eT>::value) { out = "u64"; }
|
||||
else if( is_s64<eT>::value) { out = "s64"; }
|
||||
else if( is_ulng_t<eT>::value) { out = "ulng_t"; }
|
||||
else if( is_slng_t<eT>::value) { out = "slng_t"; }
|
||||
else if( is_float<eT>::value) { out = "float"; }
|
||||
else if( is_double<eT>::value) { out = "double"; }
|
||||
else if( is_cx_float<eT>::value) { out = "cx_float"; }
|
||||
else if(is_cx_double<eT>::value) { out = "cx_double"; }
|
||||
else if( is_fp16<eT>::value) { out = "fp16"; }
|
||||
else if( is_cx_fp16<eT>::value) { out = "cx_fp16"; }
|
||||
else { out = "unknown"; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<typename eT>
|
||||
arma_cold
|
||||
inline
|
||||
void
|
||||
arma_type_print(const char* header)
|
||||
{
|
||||
std::string elem_type_str;
|
||||
|
||||
arma_elem_type_string<eT>(elem_type_str);
|
||||
|
||||
get_cerr_stream() << header << ": " << elem_type_str << std::endl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// macros
|
||||
|
||||
@@ -1372,6 +1413,7 @@ arma_assert_atlas_size(const T1& A, const T2& B)
|
||||
#define arma_debug_sigprint arma_sigprint(ARMA_FNSIG); arma_bktprint
|
||||
#define arma_debug_sigprint_this arma_sigprint(ARMA_FNSIG); arma_thisprint
|
||||
#define arma_debug_print arma_print
|
||||
#define arma_debug_type_print arma_type_print
|
||||
|
||||
// for compatibility with earlier versions of Armadillo
|
||||
#define arma_extra_debug_sigprint arma_sigprint(ARMA_FNSIG); arma_bktprint
|
||||
@@ -1383,6 +1425,7 @@ arma_assert_atlas_size(const T1& A, const T2& B)
|
||||
#define arma_debug_sigprint true ? (void)0 : arma_bktprint
|
||||
#define arma_debug_sigprint_this true ? (void)0 : arma_thisprint
|
||||
#define arma_debug_print true ? (void)0 : arma_print
|
||||
#define arma_debug_type_print true ? (void)0 : arma_type_print
|
||||
|
||||
// for compatibility with earlier versions of Armadillo
|
||||
#define arma_extra_debug_sigprint true ? (void)0 : arma_bktprint
|
||||
@@ -1393,7 +1436,7 @@ arma_assert_atlas_size(const T1& A, const T2& B)
|
||||
|
||||
|
||||
// for compatibility with earlier versions of Armadillo
|
||||
arma_frown("use arma_conform_check() instead")
|
||||
[[deprecated("use arma_conform_check() instead")]]
|
||||
inline void arma_debug_check(bool state, const char* msg) { arma_conform_check(state, msg); }
|
||||
|
||||
|
||||
@@ -1401,10 +1444,8 @@ inline void arma_debug_check(bool state, const char* msg) { arma_conform_check(
|
||||
|
||||
namespace junk
|
||||
{
|
||||
class arma_first_debug_message
|
||||
struct arma_first_debug_message
|
||||
{
|
||||
public:
|
||||
|
||||
inline
|
||||
arma_first_debug_message()
|
||||
{
|
||||
@@ -1418,7 +1459,6 @@ inline void arma_debug_check(bool state, const char* msg) { arma_conform_check(
|
||||
<< " (" << nickname << ')';
|
||||
|
||||
out << "\n@ arma_config::wrapper = " << arma_config::wrapper;
|
||||
out << "\n@ arma_config::cxx14 = " << arma_config::cxx14;
|
||||
out << "\n@ arma_config::cxx17 = " << arma_config::cxx17;
|
||||
out << "\n@ arma_config::cxx20 = " << arma_config::cxx20;
|
||||
out << "\n@ arma_config::cxx23 = " << arma_config::cxx23;
|
||||
@@ -1441,9 +1481,12 @@ inline void arma_debug_check(bool state, const char* msg) { arma_conform_check(
|
||||
out << "\n@ arma_config::optimise_band = " << arma_config::optimise_band;
|
||||
out << "\n@ arma_config::optimise_sym = " << arma_config::optimise_sym;
|
||||
out << "\n@ arma_config::optimise_invexpr = " << arma_config::optimise_invexpr;
|
||||
out << "\n@ arma_config::optimise_powexpr = " << arma_config::optimise_powexpr;
|
||||
out << "\n@ arma_config::check_conform = " << arma_config::check_conform;
|
||||
out << "\n@ arma_config::check_nonfinite = " << arma_config::check_nonfinite;
|
||||
out << "\n@ arma_config::fast_math = " << arma_config::fast_math;
|
||||
out << "\n@ arma_config::have_fp16 = " << arma_config::have_fp16;
|
||||
out << "\n@ arma_config::good_fp16 = " << arma_config::good_fp16;
|
||||
out << "\n@ sizeof(void*) = " << sizeof(void*);
|
||||
out << "\n@ sizeof(int) = " << sizeof(int);
|
||||
out << "\n@ sizeof(long) = " << sizeof(long);
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
// Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
|
||||
// Copyright 2008-2016 Conrad Sanderson (https://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
|
||||
// https://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,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user