Compare commits

...
501 Commits
Author SHA1 Message Date
conrad 5fe5a0303a patch bump 2025-08-25 20:21:06 +10:00
conrad 58d012deaf better wording 2025-07-12 18:46:57 +10:00
conrad f459f8c05b fix 2025-07-12 11:19:26 +10:00
conrad f1e256cdc2 cleanup 2025-07-07 15:43:29 +10:00
conrad 9f9bc041a0 cleanup wordiing 2025-07-04 19:37:49 +10:00
conrad 5ab05fc6a1 fix 2025-06-30 12:42:43 +10:00
conrad 2c15e54506 fix 2025-06-12 12:07:00 +10:00
conrad 8ab2cf9589 patch bump 2025-05-21 15:14:53 +10:00
conrad 90f305d153 take into account possible inf and nan 2025-05-21 10:20:08 +10:00
conrad 4ddb01bfd7 restore previous attributes due to false positives in gcc 14.2 2025-05-20 13:46:33 +10:00
conrad c4ffcac263 remove no longer needed typedef 2025-05-20 13:40:59 +10:00
conrad 83a38cc999 fix comment 2025-05-20 13:02:35 +10:00
conrad 5a80708b4a optimisation for empty matrices 2025-05-20 12:46:37 +10:00
conrad 365af48910 take into account possible inf and nan 2025-05-20 12:33:58 +10:00
conrad 4a2cdf78e0 take into account possible inf and nan 2025-05-20 01:15:25 +10:00
conrad e3f0ff95b9 minor layout fix 2025-05-19 12:49:25 +10:00
conrad 8cb64ddc3d fix handling of corner-cases with nan and inf 2025-05-19 12:40:55 +10:00
conrad fa1cc1925e improve short summary for shift() 2025-05-18 16:24:52 +10:00
conrad 25f6093cef conditionally undefine ARMA_IGNORE_DEPRECATED_MARKER 2025-05-15 13:33:25 +10:00
conrad 5d93b06328 better wording 2025-05-14 13:18:02 +10:00
conrad 210936459e use .is_finite() 2025-05-13 16:20:20 +10:00
conrad c36c50476a add DOI 2025-05-12 23:31:03 +10:00
conrad ef46b50c0c deprecate stand-alone is_finite() 2025-05-07 12:56:51 +10:00
conrad 4d9a82294a issue compile time warning for unused outputs 2025-05-02 14:14:07 +10:00
conrad 0ccf188ecd use std:: prefix 2025-04-26 00:29:02 +10:00
conrad caf55b8129 patch bump 2025-04-25 23:59:11 +10:00
conrad 70ad84b6fc update pdf 2025-04-25 23:57:15 +10:00
conrad 413197f906 remove old papers 2025-04-25 23:55:18 +10:00
conrad 75a08f29d9 workaround for bugs in clang 20.1 2025-04-24 15:18:05 +10:00
conrad 10b1286069 refactor to use superlu::int_t 2025-04-23 16:27:05 +10:00
conrad ff07666ca1 fix layout 2025-04-23 14:48:20 +10:00
conrad f745a4fd64 embed icon image into html 2025-04-23 14:45:53 +10:00
conrad e4dbea66f2 update paper links 2025-04-23 14:30:42 +10:00
conrad c51a929a95 better wording 2025-04-23 14:28:26 +10:00
conrad 9384470685 better wording 2025-04-23 14:27:27 +10:00
conrad df8c66b33d bump min version of CMake 2025-04-23 14:26:51 +10:00
conrad 38db8d899e add compile time warning 2025-04-23 14:08:11 +10:00
conrad 08bcbadd40 add compile time warning 2025-04-23 14:05:24 +10:00
conrad f7d5691c0c add support for superlu 7.0 2025-04-23 13:38:59 +10:00
conrad c22443e423 rename 2025-04-23 13:33:39 +10:00
conrad 92a91a20d7 fix speed regression for inv of tiny matrices 2025-04-23 13:31:13 +10:00
conrad c4a99aae01 add trace reduction 2025-04-23 13:25:35 +10:00
conrad b613bdb306 fix calculation of s 2025-04-23 13:24:40 +10:00
conrad f77f5c3d0f simplifications 2025-04-11 11:50:11 +10:00
conrad 4e64c2e1b4 improve docs for element access via better ordering 2025-04-07 14:42:42 +10:00
conrad 2456f676ec various spelling fixes 2025-03-25 23:17:48 +10:00
conrad 55560bbdf5 spelling fixes 2025-03-25 21:02:03 +10:00
conrad 6e880d8174 patch bump 2025-03-25 16:31:24 +10:00
conrad 0945718ee7 update pdf 2025-03-25 16:27:19 +10:00
conrad cc20c82f81 rename pdf 2025-03-25 16:26:39 +10:00
conrad 12259d14c4 add mutex around fftw plan teardown 2025-03-20 22:54:43 +08:00
conrad 993fe423df better wording 2025-03-19 23:52:25 +10:00
conrad 91970b89ff better wording 2025-03-19 14:14:06 +10:00
conrad 5bcbfc2494 improve docs for vecnorm() 2025-03-19 14:03:51 +10:00
conrad 64204ba71e minor simplifications 2025-03-18 19:58:20 +10:00
conrad efbb9ed899 update citation details 2025-03-17 15:31:46 +10:00
conrad 79d8be32a4 update citation details 2025-03-10 15:31:46 +10:00
conrad e5e59aad06 better wording 2025-03-10 12:49:05 +10:00
conrad 18836f6f54 minor fixes 2025-02-26 17:16:27 +10:00
conrad 12134220c6 add debug statements 2025-02-20 11:38:58 +10:00
conrad 54c8a6bce9 minor version bump 2025-02-17 14:23:00 +10:00
conrad 597779ad8e remove commented out code 2025-02-17 14:03:24 +10:00
conrad c7e0735820 mark as RC2 2025-02-15 15:20:49 +10:00
conrad 0a175fb070 comment out problematic workarounds 2025-02-15 11:56:07 +10:00
conrad 1ee1a6ea2d remove problematic workaround 2025-02-15 11:49:54 +10:00
conrad cb5686067d minor speedup 2025-02-14 14:47:06 +10:00
conrad 5d92b91916 faster handling of sum(square(X)) 2025-02-14 14:40:31 +10:00
conrad dca21aa5f1 optimisation for spglue_schur 2025-02-14 14:32:11 +10:00
conrad fce2e450b8 allow use of blas::dot() 2025-02-14 14:12:24 +10:00
conrad 28139a6da3 mark as RC1 2025-02-13 23:29:27 +10:00
conrad 5c45d78bba workaroudns for old user code 2025-02-13 22:45:47 +10:00
conrad 0446d2eed8 minor layout fix 2025-02-13 22:45:12 +10:00
conrad 3f0e62abfa workaround for old user code 2025-02-12 11:14:43 +10:00
conrad da80bc561f fix types 2025-02-12 10:04:02 +10:00
conrad 5a845df84b fix type 2025-02-12 09:46:43 +10:00
conrad c6219667df link to local PDF 2025-02-12 09:46:18 +10:00
conrad 90b529091f add arxiv pre-print 2025-02-11 13:08:36 +10:00
conrad dc1ede314e update citation 2025-02-10 15:34:37 +10:00
conrad fcd466d213 update copyright year 2025-02-10 15:29:46 +10:00
conrad 8ac6a694f0 update list of changes 2025-02-10 15:00:36 +10:00
conrad 9e6bda097d pre-calculate abs(cx) for faster sorting of complex matrices 2025-02-10 14:44:19 +10:00
conrad 0bea1b2f4d simplify comment 2025-02-10 12:03:26 +10:00
conrad 08a15ab6d2 simplifications 2025-02-07 15:44:24 +10:00
conrad 8f76c2f5a7 use temporary matrix to explicitly avoid aliasing 2025-02-07 15:32:51 +10:00
conrad eea1835183 specialised handling for pow(x,0.5) 2025-02-07 12:07:38 +10:00
conrad 8e02066f52 better wording 2025-02-07 11:51:28 +10:00
conrad cc5d113370 reinterpret pow(x,0.5) as sqrt(x) 2025-02-07 11:32:05 +10:00
conrad 8903fd84a5 restore selective use_mp for pow() 2025-02-07 11:15:52 +10:00
conrad 08d3312192 reinterpret pow(x,0.5) as sqrt(x) 2025-02-07 11:06:51 +10:00
conrad 9944415e12 minor fix 2025-02-06 14:44:15 +10:00
conrad beb4ee0e39 remove unused variable 2025-02-06 14:44:00 +10:00
conrad 4ab6a53ab5 minor layout fix 2025-02-06 14:40:31 +10:00
conrad 99b11428df use std:: prefix 2025-02-05 16:34:40 +10:00
conrad 955abfeeab refactor to avoid using union 2025-02-05 16:24:14 +10:00
conrad e5b1d0bd70 replace weird typedefs with C++11 type aliases 2025-02-05 13:01:33 +10:00
conrad b70e88d8ad minor fix 2025-02-04 13:40:24 +10:00
conrad e7ecee425f remove checking for matrix mul chains 2025-02-03 14:55:59 +10:00
conrad 7004caa4b4 handle more corner cases 2025-02-03 14:41:16 +10:00
conrad 22bbf2ad79 better debug message 2025-02-03 14:10:20 +10:00
conrad 73294812c3 rename unwrap variables 2025-02-03 13:22:42 +10:00
conrad 52b372f7f0 remove partial_unwrap_check 2025-02-03 13:15:07 +10:00
conrad 1f61355864 refactor to use partial_unwrap 2025-02-03 13:11:24 +10:00
conrad 95ac9ebde7 refactor to use partial_unwrap 2025-02-03 12:56:34 +10:00
conrad b244199997 print internal flags 2025-02-03 11:23:40 +10:00
conrad c689776db2 preserve more type information 2025-02-02 23:52:17 +10:00
conrad 37ca4fe05c update list of changes 2025-02-02 11:22:44 +10:00
conrad 4a299aa8ec update list of changes 2025-01-28 14:28:05 +10:00
conrad e0162f0a84 take into account use_mp flag 2025-01-28 14:24:53 +10:00
conrad cb9c78a9e3 faster handling of square() and pow(x,2) 2025-01-28 12:25:17 +10:00
conrad de479975af simplifications 2025-01-28 11:05:11 +10:00
conrad d57ad2a29a optimisation for spop_square 2025-01-27 22:47:34 +10:00
conrad 42a35f8cc3 optimisation for eop_square 2025-01-27 20:36:51 +10:00
conrad a75737fef7 use quasi_unwrap earlier 2025-01-27 00:10:13 +10:00
conrad 426ce1372a directly avoid Proxy if possible 2025-01-25 22:29:44 +10:00
conrad bce19ebcbd directly avoid Proxy if possible 2025-01-25 22:00:08 +10:00
conrad 59477c0dbc restore previous version 2025-01-24 13:08:05 +10:00
conrad bec851861b harmonise to use proxy_type 2025-01-24 11:43:39 +10:00
conrad 4e2f157604 reinterpret pow(x,2) as square(x) 2025-01-24 10:56:07 +10:00
conrad 2b513d3136 add TODO 2025-01-23 18:09:05 +10:00
conrad efac5b3148 reinterpret pow(x,2) as square(x) 2025-01-23 17:11:42 +10:00
conrad daa5deedf3 explicitly handle another corner case 2025-01-22 23:50:27 +10:00
conrad e658f0db17 restore old option for now 2025-01-22 23:23:02 +10:00
conrad bcee6924b7 update list of changes 2025-01-20 14:14:37 +10:00
conrad 089d2b965d unwrap if openmp can be used 2025-01-20 00:15:23 +10:00
conrad ee9f42faff simplifications 2025-01-19 23:41:41 +10:00
conrad 92f4bd5a24 simplifications 2025-01-19 23:01:35 +10:00
conrad 25383133c8 avoid using the proxy if we have direct memory access 2025-01-19 22:47:16 +10:00
conrad bde6942425 update list of changes 2025-01-19 00:17:26 +10:00
conrad b9461be144 faster handling of single submatirx columns 2025-01-18 23:58:31 +10:00
conrad c83caaa0da more efficient handling of expressions 2025-01-18 23:56:57 +10:00
conrad 0ec6b425e6 avoid using the proxy if we have direct memory access 2025-01-18 23:16:11 +10:00
conrad 785bfcb086 avoid using the proxy if we have direct memory access 2025-01-18 23:03:49 +10:00
conrad bb515b8a1f simplifications 2025-01-17 21:33:16 +10:00
conrad cb57dc3815 generate zeros quickly for non-complex inputs 2025-01-17 21:24:45 +10:00
conrad f474274d92 preserve type information 2025-01-17 21:19:04 +10:00
conrad 1629b41828 add warning 2025-01-17 14:08:13 +10:00
conrad 20afeff672 fix 2025-01-17 14:07:55 +10:00
conrad 78694113e3 cleanup 2025-01-17 13:41:00 +10:00
conrad acd2a5fcad optimisations for common cases 2025-01-17 13:37:58 +10:00
conrad 32fd3716fe optimisations for common cases 2025-01-17 13:33:13 +10:00
conrad 64de62450d exploit known dimensions 2025-01-17 13:13:12 +10:00
conrad 81e7d78488 don't fill with zeros as the memory will be immediately overwritten 2025-01-17 13:05:54 +10:00
conrad b8c402b663 avoid copying memory if possible 2025-01-17 13:01:07 +10:00
conrad 328f0fe573 exploit known dimensions 2025-01-17 12:51:38 +10:00
conrad 27db1972be fix for cornercase interaction with .slice() 2025-01-17 12:32:21 +10:00
conrad b0fe0d3cff simplifications 2025-01-17 12:23:08 +10:00
conrad 522cfdce58 fix 2025-01-16 16:34:06 +10:00
conrad dbf64f011c explicitly check for allowed transformations instead of implicit via n_elem 2025-01-16 16:29:13 +10:00
conrad f90249082c simplification 2025-01-16 16:14:14 +10:00
conrad 3b5fb76081 update list of changes 2025-01-16 16:04:47 +10:00
conrad af912a6177 fix 2025-01-16 15:59:42 +10:00
conrad 803c589b17 expand field class with initial implementations of .reshape() and .resize() 2025-01-16 15:50:59 +10:00
conrad 5eb6b5b5fc fix comments 2025-01-12 23:13:12 +10:00
conrad db71a4affb simplifications 2025-01-12 22:57:53 +10:00
conrad 0936110fbc update list of changes 2025-01-09 14:54:02 +10:00
conrad f905ee4b4a reinterpret pow(x,2) as square(x) 2025-01-09 14:39:11 +10:00
conrad 7ff62d22b0 simplifications 2025-01-09 14:30:55 +10:00
conrad c004318b0f fix 2025-01-09 14:25:20 +10:00
conrad 3632831126 reinterpret pow(x,2) as square(x) 2025-01-09 14:24:14 +10:00
conrad ebc6f94fcb simplification 2025-01-09 14:18:42 +10:00
conrad b4ede23c5c reinterpret pow(x,2) as square(x) 2025-01-09 14:17:15 +10:00
conrad feca3eae7f fix 2025-01-09 12:50:41 +10:00
conrad 0a76ab431b remove support for ARMA_IGNORE_DEPRECATED_MARKER 2025-01-02 15:09:00 +10:00
conrad 24b059344e new section for list of changes 2025-01-02 13:11:14 +10:00
conrad ceaa020a33 better layout for sinc() 2025-01-02 13:07:25 +10:00
conrad f9e308b2fd improve docs for toeplitz() 2025-01-02 00:02:21 +10:00
conrad 153c1363ea simplify docs for toeplitz() 2025-01-01 23:28:01 +10:00
conrad 316c7e4abf simplification; alias checks not required 2024-12-25 00:22:08 +10:00
conrad 469cb91a74 reduce stack usage by reducing unnecessary alignment markers 2024-12-18 14:08:42 +10:00
conrad 77cc3e9287 fix prototypes for xSYCON and xHECON 2024-12-17 12:17:02 +10:00
conrad e037bd9a5e reduce bloat 2024-12-16 13:58:00 +10:00
conrad 7138865c14 add note 2024-12-10 12:05:52 +10:00
conrad 8f94af0afb explicitly qualify inherited variables and functions 2024-12-04 12:24:44 +10:00
conrad dfdbae2570 explicitly qualify inherited variables and functions 2024-12-04 12:16:50 +10:00
conrad 11e69548f2 preserve vector type information 2024-12-03 16:25:38 +10:00
conrad 6f6cc83862 fix 2024-12-03 16:19:52 +10:00
conrad 0d2c5de574 preserve vector type information 2024-12-02 22:44:30 +10:00
conrad 07e5b6d1d6 avoid clashes with C++20 std::span 2024-12-02 16:23:54 +10:00
conrad df8741c86b explicitly qualify inherited variables and functions 2024-12-02 16:13:48 +10:00
conrad ffb9ef3c52 more selective detection of symmetric/hermitian matrices 2024-11-28 16:15:56 +11:00
conrad b87cc838a3 more selective detection of symmetric/hermitian matrices 2024-11-27 11:56:43 +11:00
conrad 9273614f58 fix 2024-11-24 17:12:41 +10:00
conrad cdedada64a revert 2024-11-23 16:40:29 +10:00
conrad b7cf2fd503 remove functions from Mat that are present in Base 2024-11-23 13:49:04 +10:00
conrad b3329329a7 expand deprecation warnings with messages 2024-11-23 00:42:36 +10:00
conrad 20bb9d8bcb ensure the first index of extremum value is found 2024-11-22 12:17:20 +10:00
conrad 6ecbed3813 remove unused code 2024-11-20 17:41:01 +10:00
conrad 123dd0108d use partial_unwrap instead of partial_unwrap_check 2024-11-20 17:26:49 +10:00
conrad 79793a7a97 mark as unstable 2024-11-20 12:27:28 +10:00
conrad a2c8b74a35 add TODOs 2024-11-20 11:45:56 +10:00
conrad a313b4fd0c version bump 2024-11-16 15:22:53 +10:00
conrad 85233ddbe7 better wording 2024-11-16 12:46:05 +10:00
conrad b6e9484b31 skip conformance check if given expression resolves to a vector 2024-11-15 11:46:29 +10:00
conrad a18a68289b better wording 2024-11-15 00:44:06 +10:00
conrad b3f4e55604 check for aliasing only when the element types match 2024-11-14 19:25:01 +10:00
conrad 702eb6c68b mark as RC1 2024-11-14 12:30:46 +10:00
conrad 0bdd169d38 simplifications 2024-11-14 12:06:57 +10:00
conrad 79f57ff784 update list of changes 2024-11-13 16:57:26 +10:00
conrad a3bc2bc599 ensure consisten handling of symmetric expressions by various forms of inv() 2024-11-13 16:48:20 +10:00
conrad 2cdd3feebb ensure all matrices are checked 2024-11-13 16:14:42 +10:00
conrad ca70fdfba3 more debug statements 2024-11-13 15:08:32 +10:00
conrad 9608d14058 avoid shadowing 2024-11-13 15:02:52 +10:00
conrad 112861df8b add dedicated function for alias detection 2024-11-13 14:55:09 +10:00
conrad 15232980d3 better wording 2024-11-13 14:08:13 +10:00
conrad 6058b46519 adapt to use .index_min() and .index_max() 2024-11-13 12:10:53 +10:00
conrad 0b07572a24 more tests 2024-11-13 12:04:39 +10:00
conrad bb819ee649 update to .index_max() 2024-11-13 12:01:56 +10:00
conrad ee965fc4b7 fix 2024-11-13 11:43:12 +10:00
conrad a7c16f40df update to .index_min() [continued] 2024-11-13 11:40:32 +10:00
conrad e83cea1b48 update to .index_min() 2024-11-12 17:07:20 +10:00
conrad dbca4d6631 wrappers for sytrs and hetrs 2024-11-11 20:05:17 +10:00
conrad 8cdca5cbe9 add redirects for crippled lapack 2024-11-11 19:11:09 +10:00
conrad 121b0a744a extend solve() to detect symmetric expressions 2024-11-11 19:01:04 +10:00
conrad 4ec712dcc6 expand detection of symmetric expressions 2024-11-11 16:21:51 +10:00
conrad e6bfb6941d for unimplemented options, change errors to warnings 2024-11-11 15:39:24 +10:00
conrad d2bdd90982 prevent compiler warnings 2024-11-11 15:29:28 +10:00
conrad 59a24f45f2 use threshold to avoid speed regressions under openblas 2024-11-11 15:21:18 +10:00
conrad ef011e704b minor layout fix 2024-11-11 14:51:32 +10:00
conrad 943fe56b61 fix 2024-11-11 14:48:44 +10:00
conrad 670ca673f8 check for conflicting options 2024-11-11 14:44:22 +10:00
conrad 265e66f43e document solve_opts::force_sym 2024-11-11 14:36:27 +10:00
conrad baf9ab7970 add solve_opts::force_sym option 2024-11-11 14:14:41 +10:00
conrad dd5e73ae20 add solve_sym_rcond 2024-11-11 14:14:20 +10:00
conrad 5d1ceb6aa9 revert 2024-11-11 11:22:16 +10:00
conrad acc8680aa8 restore previous wording 2024-11-11 11:08:27 +10:00
conrad 8cb75d0ac5 ensure consistent handling of symmetric matrices by expressions with inv() 2024-11-09 17:19:01 +10:00
conrad 77fccf7db1 use threshold 2024-11-09 16:21:43 +10:00
conrad 18a2a42061 add fast mode symmetric solver 2024-11-09 14:50:52 +10:00
conrad b2f8023392 simplify docs for solve() 2024-11-08 15:39:41 +10:00
conrad bcc950cb9e minor corrections 2024-11-08 15:21:00 +10:00
conrad 5c313e8a6d definitions for sytrs and hetrs 2024-11-08 15:15:25 +10:00
conrad d13194f8e8 expand MKL search paths 2024-11-07 13:10:31 +10:00
conrad 437c7299b9 remove mentions of ARMA_BLAS_LONG 2024-11-07 12:22:41 +10:00
conrad b744b74533 ensure consistency with documentation 2024-11-07 12:17:54 +10:00
conrad f22d60c74f qualify lapack function names in comment 2024-11-07 12:14:32 +10:00
conrad 44e1beabce update list of changes 2024-11-06 17:24:52 +10:00
conrad f003381651 minor cleanup 2024-11-06 17:24:29 +10:00
conrad 538ae305bf optimisation when all eigenvalues are positive 2024-11-06 17:15:41 +10:00
conrad d00fc06c06 fix 2024-11-06 13:23:30 +10:00
conrad 8650784ac7 detect sym matrices instead of sympd 2024-11-06 12:34:03 +10:00
conrad f0acfbbf63 update debug messages 2024-11-06 12:20:18 +10:00
conrad da8ea7ea20 add note 2024-11-05 18:53:25 +10:00
conrad d484a3d7ad check diagonal for nonfinite values 2024-11-05 16:39:45 +10:00
conrad 978d7d6e76 rearrange 2024-11-04 12:51:43 +10:00
conrad 65eefbfce6 formally deprecate undocumented forms of .min() and .max() 2024-11-03 15:33:19 +10:00
conrad 6e469f1d38 cleanup 2024-11-01 11:46:04 +10:00
conrad 3280fd41ae ensure rcond results are consistent with rcond version of inv() 2024-11-01 11:43:50 +10:00
conrad 97f85611c1 stronger checks for diagonal elements of hermitian matrices 2024-11-01 11:11:19 +10:00
conrad 7b38cfca6e add sanity checks 2024-10-31 16:09:34 +10:00
conrad 30122e7adf simplification 2024-10-31 16:00:43 +10:00
conrad 0481314430 update docs 2024-10-31 13:44:00 +10:00
conrad ef7fec1385 deprecate ARMA_CRIPPLED_LAPACK option 2024-10-31 13:34:51 +10:00
conrad 42623aff06 minor cleanups 2024-10-31 13:21:39 +10:00
conrad 3165f618ed remove unused code 2024-10-31 13:13:34 +10:00
conrad 93a652c50c simplifications 2024-10-31 13:06:52 +10:00
conrad f506e86466 detect hermitian matrices 2024-10-31 11:02:51 +10:00
conrad c7053e8c23 redirect in case of crippled lapack 2024-10-31 10:27:37 +10:00
conrad 95a8229587 more workarounds 2024-10-31 10:14:48 +10:00
conrad 4b3fdadd7f workarounds for crippled implementations of lapack 2024-10-31 10:06:24 +10:00
conrad 7ce8e17e99 simplifications 2024-10-30 16:15:51 +10:00
conrad 25d5285cbd prevent compiler warnings 2024-10-30 15:59:49 +10:00
conrad 53806daa3f replace hard coded constant 2024-10-30 15:58:59 +10:00
conrad bcca9da94d add wrappers 2024-10-30 15:39:21 +10:00
conrad 6da76d1019 update docs 2024-10-30 13:36:36 +10:00
conrad cb73277ec7 add threshold due to inconsistent speedups on OpenBLAS 0.3.26 2024-10-30 13:23:26 +10:00
conrad 6d15ecca58 fix layout 2024-10-30 12:51:47 +10:00
conrad e701de5738 replace rcond_sympd with rcond_sym 2024-10-29 15:49:18 +10:00
conrad b4e2b8de7c more debug statements 2024-10-29 15:30:28 +10:00
conrad b0ff7506b0 update docs 2024-10-29 15:10:16 +10:00
conrad 1bf38c114d fix 2024-10-29 10:34:44 +10:00
conrad 96e98edec9 inv rcond optimisation for sym matrices 2024-10-29 00:10:14 +10:00
conrad 6e838ef11c defintions for sycon and hecon 2024-10-28 16:00:02 +10:00
conrad 55059a4e30 refactor inv_sym() to handle complex hermitian matrices 2024-10-28 15:44:25 +10:00
conrad 98c7800566 add TODOs 2024-10-28 15:12:48 +10:00
conrad 0e5978f981 partial rework of inv() to optimise for symmetric matrices 2024-10-28 14:23:24 +10:00
conrad b52dae4657 mark as unstable 2024-10-14 14:07:18 +10:00
conrad 1b037556da simpler wording 2024-10-05 19:08:45 +10:00
conrad 6a1c5d7ff3 remove handling of rare expressions 2024-10-05 18:59:22 +10:00
conrad ce4d54c82b bump min compiler version 2024-10-05 16:54:40 +10:00
conrad bca1545ae3 deprecate support for gcc < 8.1 2024-10-05 16:48:37 +10:00
conrad b908470f3b change http to https 2024-10-04 11:44:27 +10:00
conrad 7c75e9e594 deprecate ill-designed forms of pow() 2024-10-03 13:57:48 +10:00
conrad 55c30cbc73 restore doc for previous option 2024-10-03 13:15:41 +10:00
conrad d56115ef45 simplifications 2024-10-03 11:35:02 +10:00
conrad c7f1711d6c restore original implementation; subview_each et al are not derived from Base 2024-10-03 11:12:17 +10:00
conrad e280d25c9a add explanatory notes 2024-10-03 11:03:52 +10:00
conrad 27f4297396 more refactoring 2024-10-03 10:56:14 +10:00
conrad 5eabafe2b3 partial rewrite of powext 2024-10-02 14:46:00 +10:00
conrad ed1ec45817 remove deprecated forms 2024-10-02 13:14:41 +10:00
conrad 901c5c3d0c add notes 2024-10-02 13:10:02 +10:00
conrad 19292dff3a rearrange deprecated forms 2024-10-02 12:59:34 +10:00
conrad 53f8e0664f deprecate seldom used forms of pow() 2024-10-02 12:47:46 +10:00
conrad d66e799b5c simplification: remove docs for seldom used forms of pow() 2024-10-02 12:43:12 +10:00
conrad 053d5a5787 stats_fns: clarify caveat and add example for integer vector 2024-09-25 11:07:26 +10:00
conrad cb3203f130 add ARMA_BLAS_64BIT_INT config option 2024-09-04 15:12:07 +10:00
conrad 44411aadee explicitly deprecate old log_add_exp() 2024-09-04 12:36:46 +10:00
conrad c953e836e7 clarify that 'long long' is 64 bit integer 2024-08-21 20:31:10 +10:00
conrad 40d2d9fb9c patch bump 2024-08-06 13:06:20 +10:00
conrad e529e8fadb ensure format is consistent 2024-08-02 13:04:55 +10:00
conrad cdf9a0519d fix links 2024-08-01 13:20:38 +10:00
conrad acdc6b8670 fix layout 2024-08-01 12:32:32 +10:00
conrad 251f964c1b check for presence of ARMA_USE_STD_MUTEX instead of absence of ARMA_DONT_USE_STD_MUTEX 2024-07-31 11:52:50 +10:00
conrad 9937cdafd5 prefer __builtin_assume_aligned() over std::assume_aligned() to reduce risk 2024-07-31 11:44:49 +10:00
conrad e31354d8da use std::assume_aligned() if available 2024-07-31 11:39:51 +10:00
conrad 6279cb3774 more details for TODO 2024-07-31 11:28:14 +10:00
conrad fa72e7e3e0 remove seldom used optimisation to increase maintainability 2024-07-24 12:26:56 +10:00
conrad f72efd7c61 more graceful handling of unsupported data types 2024-07-20 17:16:45 +10:00
conrad 3d4daafeb8 better wording 2024-07-20 16:53:09 +10:00
conrad a99ef05d41 patch bump 2024-07-07 23:01:27 +10:00
conrad a7d906019a comment out docs for disabling run-time checks 2024-07-01 11:16:35 +10:00
conrad f3fe8d04c7 ensure consistent markers in quasi_unwrap and Proxy 2024-06-30 14:29:21 +10:00
conrad 508ebe3deb avoid unwrapping delayed expressions potentially captured by the Proxy 2024-06-30 14:26:40 +10:00
conrad 6e6657e2f0 skip aliasing checks where not necessary 2024-06-30 13:05:02 +10:00
conrad 935a500e75 simplify debug messages 2024-06-27 13:20:51 +10:00
conrad 64a125b35b remove warning about long-removed option 2024-06-27 11:52:28 +10:00
conrad 6754eadb00 minor comment fix 2024-06-26 14:14:29 +10:00
conrad 4a93a1a5d2 version bump 2024-06-25 14:24:38 +10:00
conrad cc2a33560f simpler wording 2024-06-25 13:26:55 +10:00
conrad 708897f906 better wording 2024-06-25 13:16:21 +10:00
conrad 5dfa91793f simplify wording 2024-06-25 13:08:03 +10:00
conrad f20d1bf7fe fix 2024-06-24 23:10:25 +10:00
conrad e0a6e50981 fix 2024-06-24 23:09:12 +10:00
conrad 11b009ccdc emit warning if conformance checks are disabled 2024-06-24 12:11:27 +10:00
conrad d4ac8e535e catch size errors early 2024-06-24 00:18:10 +10:00
conrad 982e8b12ae more debug statements 2024-06-23 13:23:47 +10:00
conradsnicta 558c04cfd6 Merge branch 'more_spop_rel_tests' into '14.0.x'
Add some tests for accu() optimisation for sparse relational operations

See merge request conradsnicta/armadillo-code!138
2024-06-22 03:30:32 +00:00
Ryan Curtin c693c5f020 Add some tests for accu() optimisation for sparse relational operations 2024-06-22 03:30:32 +00:00
conrad a7ae8eed4a minor wording fix 2024-06-22 13:16:51 +10:00
conrad 5f74ef8e5d mark as RC1 2024-06-22 12:47:35 +10:00
conrad 7c732dc236 remove dev markers 2024-06-22 12:45:29 +10:00
conrad b84b7aa997 add caveat 2024-06-21 20:34:17 +10:00
conrad 1780c70a98 add internal link 2024-06-21 20:29:18 +10:00
conrad 02aab8d3c3 fix 2024-06-21 20:29:03 +10:00
conrad 744f33aab2 update list of changes 2024-06-21 15:04:43 +10:00
conrad c51b6ce8ba remove setting warning level 2024-06-21 14:40:05 +10:00
conrad e0bf67a29f clarifications 2024-06-21 14:39:22 +10:00
conrad b176edcc1b adapt Ryan's approach 2024-06-21 14:31:45 +10:00
conrad 09b350febc simplifications 2024-06-21 11:58:18 +10:00
conrad 4541b44fab another workaround for negative unsigned integers 2024-06-21 11:41:49 +10:00
conrad 17132590fc disable more warnings 2024-06-21 11:34:17 +10:00
conrad 11740aead0 prevent zeros 2024-06-21 01:44:45 +10:00
conrad f2a82196d4 fix 2024-06-20 23:20:15 +10:00
conrad 2854685624 workarounds for handling negatives of unsigned integers 2024-06-20 23:18:32 +10:00
conrad 401c06184e fix 2024-06-20 20:07:19 +10:00
conrad d7064ebacf optimisations 2024-06-20 19:44:08 +10:00
conrad 580758af9d add TODOs 2024-06-20 17:05:43 +10:00
conrad 441d0e503b rename variables for consistency across functions 2024-06-20 16:54:12 +10:00
conrad 5015fb007b handle all conditions in one function 2024-06-20 16:40:00 +10:00
conrad 81b339e987 specialisations for relational comparisons 2024-06-20 15:01:16 +10:00
conrad 6b6a820a49 set warning level to 1 2024-06-20 12:09:20 +10:00
conrad a865abfe6a disentangle direct link between conformance checks and emission of warnings 2024-06-20 12:01:51 +10:00
conrad 80797be245 tests for direct sparse relational operations 2024-06-20 10:51:56 +10:00
conrad 3259865a42 expand accu() to handle sparse relational operations 2024-06-20 10:19:44 +10:00
conrad 5edd9e07ec skip alias checks if element types differ 2024-06-19 12:44:03 +10:00
conrad d37c42e046 skip alias checks if element types differ 2024-06-19 12:21:34 +10:00
conrad d8dceed843 simplify list 2024-06-19 01:14:38 +10:00
conrad 0606be415c update precompiled OpenBLAS 2024-06-18 14:35:21 +10:00
conrad f5b004028a increase accuracy 2024-06-17 20:18:04 +10:00
conrad 76d9aaea28 simplify language 2024-06-17 20:11:38 +10:00
conrad 4257990df9 faster sprandu() and sprandn() 2024-06-17 11:10:03 +10:00
conrad a48c256233 add .as_dense() 2024-06-16 19:45:56 +10:00
conrad 044977f0a1 add internal link 2024-06-16 19:41:20 +10:00
conrad c32a3b915e cleanup 2024-06-16 19:07:00 +10:00
conrad 419cc25c17 update list of changes 2024-06-16 19:03:15 +10:00
conrad 118ae2140f add docs for .as_dense() 2024-06-16 18:54:19 +10:00
conrad 4b72ceda11 add .as_dense() 2024-06-16 18:20:21 +10:00
conrad caa5012e25 expand compiler flags 2024-06-15 19:24:44 +10:00
conrad f37a509c14 update list of changes 2024-06-15 19:16:05 +10:00
conrad 8dafcf8d30 faster handling of sparse submatrix views 2024-06-15 19:05:39 +10:00
conrad d4e25ce9cf simplify handling to SpToDOp and mtSpReduceOp 2024-06-15 18:46:05 +10:00
conrad 9ee144d98d add explanatory notes 2024-06-15 17:26:44 +10:00
conrad e6b9babc12 mark sparse conversion constructor as explicit 2024-06-15 00:44:58 +10:00
conrad 2ddbf3653c mark dense to sparse conversion as explicit 2024-06-15 00:17:19 +10:00
conrad fb9994ce6f rename mtSpReductionOp to mtSpReduceOp 2024-06-15 00:14:48 +10:00
conrad 840795fc47 rework sparse reduction operations 2024-06-14 23:58:39 +10:00
conrad b5824c72e3 add SpReductionOp and mtSpReductionOp frameworks 2024-06-14 14:37:00 +10:00
conrad 39a8ff7c31 cleanup 2024-06-14 11:21:54 +10:00
conrad 031e790ec3 restore previous pre-alloc size 2024-06-14 10:05:49 +10:00
conrad 054506ac91 simplifications 2024-06-14 01:51:51 +10:00
conrad 50c8b16a6c restore explicit marker 2024-06-13 22:39:39 +10:00
conrad 554c499ce0 minor cleanup 2024-06-13 22:39:19 +10:00
conrad 9aa59809f0 use error message functions 2024-06-13 22:28:01 +10:00
conrad f66226695b further support for arma_noinline 2024-06-13 22:01:47 +10:00
conrad c9cc6e5554 rework op_nonzeros_spmat into op_sp_nonzeros 2024-06-13 18:46:38 +10:00
conrad 181a6af544 more details in deprecation messages 2024-06-13 16:23:05 +10:00
conrad de118814c3 rework detection of expressions that can implicitly converted from dense to sparse 2024-06-13 15:46:42 +10:00
conrad 1aa720e759 detect transpose operations of originally sparse expressions 2024-06-13 14:20:14 +10:00
conrad f0eaff90e9 more workarounds 2024-06-13 13:56:53 +10:00
conrad 21b905e643 add explanatory note 2024-06-13 13:41:07 +10:00
conrad 791fe513c9 restrict automatic conversions from dense to sparse 2024-06-13 12:45:54 +10:00
conrad 3d82983dba restrict automatic conversions from dense to sparse 2024-06-13 12:21:10 +10:00
conrad 6ee89edb8c more informative error messages 2024-06-12 20:21:34 +10:00
conrad a7823175a2 fix 2024-06-12 20:18:04 +10:00
conrad 5caefce03d more informative error messages 2024-06-12 19:16:41 +10:00
conrad a99f363d69 decrease default size of buffer 2024-06-12 18:04:07 +10:00
conrad 627794a311 use shorter form 2024-06-12 15:45:04 +10:00
conrad 66135eef6b fix 2024-06-12 13:42:14 +10:00
conrad 03d351a858 simplifications 2024-06-12 13:37:45 +10:00
conrad 607a68a0b4 clarifications 2024-06-12 13:32:41 +10:00
conrad 36ab0da6b1 various fixes 2024-06-12 12:58:42 +10:00
conrad cf880d4fff add HEADER_ONLY option 2024-06-12 12:54:03 +10:00
conrad 057039611e move C+11 deprecation warning 2024-06-12 00:51:18 +10:00
conrad 530542b112 restore support for C++11 in deprecated form 2024-06-12 00:38:22 +10:00
conrad 4643ddfff8 rename op_dot::apply_proxy() to op_dot::apply_proxy_linear() 2024-06-11 12:26:10 +10:00
conrad f54cc6d0bb clarifications 2024-06-11 12:17:11 +10:00
conrad 414793c796 subview optimisations for dot products 2024-06-11 12:13:32 +10:00
conrad f0c1211b68 add debug messages 2024-06-10 23:54:00 +10:00
conrad fa0c5a5ce2 add notes 2024-06-10 20:03:51 +10:00
conrad 8f5e35d9e4 add note 2024-06-10 19:51:41 +10:00
conrad 4a4807e4ee fix 2024-06-10 19:48:55 +10:00
conrad 03eb6e6ece fix 2024-06-10 19:47:56 +10:00
conrad f66d795010 update version 2024-06-10 17:08:40 +10:00
conrad f01dae8534 include Alma and Rocky 2024-06-10 17:06:31 +10:00
conrad 0cc9f762d3 allow implicit conversion of dense expressions to avoid breaking user code 2024-06-10 14:39:58 +10:00
conrad 52ccb38b6c simplifications 2024-06-10 14:35:46 +10:00
conrad 23c49e6008 make sure element types match 2024-06-10 14:33:37 +10:00
conrad f4f8f0c28f allow implicit conversion of spdiagview for consistency with sparse version of diagvec() 2024-06-10 14:25:38 +10:00
conrad 54314571c4 update list of changes 2024-06-10 01:03:37 +10:00
conrad b416244930 2022 CODATA adjustment for physical constants 2024-06-10 00:59:02 +10:00
conrad 3928bee750 use 'constexpr bool' where possible 2024-06-10 00:27:15 +10:00
conrad 17d96107e3 fix layout 2024-06-09 23:39:11 +10:00
conrad e014995291 bump min version for intel compiler 2024-06-09 18:06:31 +10:00
conrad e03265b706 remove superfluous redefinitions 2024-06-09 17:50:07 +10:00
conrad 940594bfe7 verify liwork and lrwork via query 2024-06-09 01:58:43 +10:00
conrad bcf4400e27 re-allow ignoring deprecation messages 2024-06-08 23:34:28 +10:00
conrad 4f62a5ddf8 minor cleanup 2024-06-08 18:53:25 +10:00
conrad 66515d3ec9 fix 2024-06-08 18:24:59 +10:00
conrad 365c332120 remove shadow typedef 2024-06-08 17:48:46 +10:00
conrad facf580a9c add tests for sparse stddev() 2024-06-08 17:43:34 +10:00
conrad b0ca8599f8 update list of changes 2024-06-08 17:38:25 +10:00
conrad f7e522a83b speedup 2024-06-08 17:30:11 +10:00
conrad 8d6818e40a faster handling of sparse submatrix views 2024-06-08 17:26:34 +10:00
conrad 19b7ff026f allow op_diagmat to have implicit conversion 2024-06-08 17:15:50 +10:00
conrad bd56f524b2 convert sparse diagvec to use SpToDOp framework 2024-06-08 16:57:40 +10:00
conrad 5cbd10b9e3 register mtSpToDOp as dense arma type 2024-06-08 16:55:56 +10:00
conrad 19f8a401e8 generate set of random numbers in one hit 2024-06-08 16:46:06 +10:00
conrad 478809ca0d simplifications 2024-06-08 16:26:55 +10:00
conrad 0a671235ed simplifications 2024-06-07 23:18:12 +10:00
conrad 1393134914 specialisation for inplace transpose of vectors 2024-06-07 23:11:19 +10:00
conrad 7c8c10ea20 rework sparse vecnorm() to use mtSpToDOp 2024-06-07 23:02:38 +10:00
conrad aa28f54c0b fix 2024-06-07 15:46:33 +10:00
conrad 762e98c2cc check for zero length vectors 2024-06-07 15:44:56 +10:00
conrad 98bfa65de7 fix layout 2024-06-07 15:30:37 +10:00
conrad 81e760e0eb check for zero length vectors 2024-06-07 15:29:01 +10:00
conrad 140e07bd77 add TODOs 2024-06-07 14:53:08 +10:00
conrad bc57da6679 simplifications 2024-06-07 14:13:15 +10:00
conrad 0138c02fb7 simplifications 2024-06-07 14:05:45 +10:00
conrad 5ca8f67990 rework sparse mean() to use SpToDOp 2024-06-07 13:40:33 +10:00
conrad 72d7892432 update list of changes 2024-06-07 01:23:57 +10:00
conrad 8b8a56104d add sparse stddev() 2024-06-07 01:18:37 +10:00
conrad 30b45e8c2e refactor sparse var() to use mtSpToDOp framework 2024-06-07 00:43:24 +10:00
conrad 5260835556 cleanup 2024-06-06 23:23:27 +10:00
conrad cc61283eb6 rearrange 2024-06-06 23:11:16 +10:00
conrad 35d70bd7c9 cleanup 2024-06-06 22:50:21 +10:00
conrad 8b3f33287a update docs for config options 2024-06-05 12:22:31 +10:00
conrad 4d26e7f4dd update list of changes 2024-06-05 12:15:37 +10:00
conrad 909a3a3ac1 move targeted optimisations to front 2024-06-05 12:01:44 +10:00
conrad bca546a381 simplification 2024-06-05 01:18:35 +10:00
conrad 7a078fcf8c dot product optimisation 2024-06-05 00:47:16 +10:00
conrad da52eb154b further speedups 2024-06-05 00:26:54 +10:00
conrad 03fd9d04c3 simplifications 2024-06-05 00:25:20 +10:00
conrad 8ad6cc595d handle more expressions 2024-06-04 18:37:37 +10:00
conrad a454237c13 remove no longer needed trait 2024-06-04 16:29:06 +10:00
conrad 89277f2deb better handling of compound expressions 2024-06-04 16:28:32 +10:00
conrad 880267f348 handle expressions with scalar mul 2024-06-04 15:00:36 +10:00
conrad 0e7f1c5089 explicit handling of dot product expressed as matrix multiplication 2024-06-04 13:14:11 +10:00
conrad fd780c7a82 add tests for SpSubview n_nonzero 2024-05-30 12:02:03 +10:00
conrad 5f12dfb83d sync to handle corner cases 2024-05-29 13:09:12 +10:00
conrad e9a14aea9a fix 2024-05-29 13:01:37 +10:00
conrad 6b47d564d1 speedup via specialisation 2024-05-29 12:59:17 +10:00
conrad 2d60476b55 start new block for list of changes 2024-05-28 14:21:17 +10:00
conrad ad6ce0e46f extend speedup to general submatrices that span all rows 2024-05-27 11:25:42 +10:00
conrad 499cf72d6a cleanup 2024-05-23 19:23:29 +10:00
conrad b12eefdae8 faster handling of sparse matrix views with one column 2024-05-22 14:49:53 +10:00
conrad b955116e1f simplify warning 2024-05-21 14:40:45 +10:00
conrad 67ea132b50 use 'constexpr bool' where possible 2024-05-21 14:37:31 +10:00
conrad f97f3edcb3 fix 2024-05-13 12:11:22 +10:00
conrad a91f7a77fe beef up warning 2024-05-08 13:45:28 +10:00
conradsnicta f88801c619 Merge branch 'test-resiliency' into '14.0.x'
Allow specifying random seed for tests, and fix often-failing tests

See merge request conradsnicta/armadillo-code!134
2024-05-06 23:56:01 +00:00
Ryan Curtin afa23649f8 Allow specifying random seed for tests, and fix often-failing tests 2024-05-06 23:56:01 +00:00
conrad 2e1a9d70da simplification 2024-05-06 22:23:49 +10:00
conrad 20a9302ff3 add explanatory note 2024-05-05 15:28:37 +10:00
conrad dbcbc65a00 change !ARMA_DONT_USE_STD_MUTEX to ARMA_USE_STD_MUTEX 2024-05-03 14:42:42 +10:00
conrad 2ee2b572ba fix 2024-05-03 14:21:25 +10:00
conrad 653996b1c2 add mutex around generating FFTW3 plans 2024-05-03 13:57:21 +10:00
conrad 176da337a0 extend debug monitor with state of check_conformance 2024-04-28 15:57:24 +10:00
conrad 485d16e9a3 forward superseded function to new function 2024-04-28 15:47:20 +10:00
conrad 5c63044568 rework declaration of superseded function 2024-04-28 15:17:54 +10:00
conrad 60c63be02a add old macros for compatibility with earlier versions of armadillo 2024-04-26 23:31:31 +10:00
conrad e8b08f83e8 reorder processing to ensure consistency 2024-04-26 13:01:34 +10:00
conrad a4bdfd034b more compact debug messages 2024-04-26 12:57:33 +10:00
conrad 95adb74219 rename debugging macros and functions 2024-04-26 12:28:42 +10:00
conrad 60915d66dc rework ARMA_NO_DEBUG to ARMA_DONT_CHECK_CONFORMANCE 2024-04-26 12:03:05 +10:00
conrad 8675f3868a remove ARMA_DONT_ZERO_INIT option 2024-04-25 12:39:11 +10:00
conrad 14650daa03 better layout of debug messages 2024-04-25 11:56:42 +10:00
conrad b57929cefb emit warning to use as_scalar() for conversion to scalars 2024-04-13 12:36:50 +10:00
conrad 51a8ba3e09 rework min(sp_mat) and max(sp_mat) to produce dense vectors by default 2024-04-09 13:53:38 +10:00
conrad 44e1a04bab restore doc markers 2024-04-09 13:42:11 +10:00
conrad 87c2b2d870 rework sum(sp_mat) to produce dense vectors by default 2024-04-09 13:37:13 +10:00
conrad ba443e4bdc bump to C++14 standard 2024-04-09 11:56:04 +10:00
conrad 78836248b4 mark as unstable 2024-04-09 11:39:00 +10:00
496 changed files with 18186 additions and 12984 deletions
+2 -2
View File
@@ -3,8 +3,8 @@
<br>
The list of changes is part of the documentation:
<ul>
<li><a href="http://arma.sourceforge.net/docs.html#changelog">docs.html#changelog</a> (online copy)</li>
<li><a href="docs.html#changelog">docs.html#changelog</a> (local copy)</li>
<li><a href="https://arma.sourceforge.net/docs.html#changelog">docs.html#changelog</a> &nbsp; (online copy)</li>
<li><a href="docs.html#changelog">docs.html#changelog</a> &nbsp; (local copy)</li>
</ul>
</body>
</html>
+131 -78
View File
@@ -16,35 +16,43 @@
# ------------------------------------------------------------------------
## NOTE: If you prefer to link your programs _directly_ with OpenBLAS, BLAS or LAPACK,
## NOTE: do not use this installer.
##
## NOTE: To use Armadillo without installation, compile your programs along these lines:
## NOTE: g++ prog.cpp -o prog -O2 -I /home/user/armadillo-12.2.0/include -DARMA_DONT_USE_WRAPPER -lopenblas -llapack
## NOTE: The above command line assumes that you have unpacked the armadillo archive into /home/user/
## NOTE: You will need to adjust this for newer versions of Armadillo (ie. "12.2.0" needs to be changed),
## NOTE: and/or if you have unpacked the armadillo archive into a different directory.
## NOTE: This installation script generates a runtime wrapper library by default,
## NOTE: which links with OpenBLAS, LAPACK, etc.
## NOTE:
## NOTE: If you prefer to link your programs directly with OpenBLAS, LAPACK, etc
## NOTE: there are two options:
## NOTE:
## NOTE: (1) use the HEADER_ONLY option when running this installation script,
## NOTE: or
## NOTE: (2) do not use this installation script; instead compile your programs
## NOTE: using the include folder directly obtained from the armadillo archive.
## NOTE:
## NOTE: To forcefully disable use of the runtime wrapper library,
## NOTE: compile your programs with ARMA_DONT_USE_WRAPPER enabled.
## NOTE: Example:
## NOTE: g++ prog.cpp -o prog -O2 -I /home/user/armadillo-14.0.0/include -DARMA_DONT_USE_WRAPPER -lopenblas -llapack
## NOTE:
## NOTE: The above assumes that the armadillo archive is unpacked into /home/user/
## NOTE: Adjust for newer versions of Armadillo (change "14.0.0"),
## NOTE: and/or if the armadillo archive has been unpacked into a different folder.
## NOTE:
## NOTE: Replace -lopenblas with -lblas if you don't have OpenBLAS.
## NOTE: On macOS, replace -lblas -llapack with -framework Accelerate
## NOTE: More details: https://arma.sourceforge.net/faq.html
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
cmake_minimum_required(VERSION 3.5...3.10 FATAL_ERROR)
if(NOT (${CMAKE_MAJOR_VERSION} LESS 3))
if(POLICY CMP0025)
# enable differentiation between vanilla Clang and AppleClang
cmake_policy(SET CMP0025 NEW)
message(STATUS "*** set cmake policy CMP0025 to NEW")
endif()
if(POLICY CMP0025)
# enable differentiation between vanilla Clang and AppleClang
cmake_policy(SET CMP0025 NEW)
message(STATUS "*** set cmake policy CMP0025 to NEW")
endif()
if(NOT (CMAKE_VERSION VERSION_LESS "3.1"))
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
message(STATUS "CMAKE_CXX_STANDARD = ${CMAKE_CXX_STANDARD}")
endif()
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
message(STATUS "CMAKE_CXX_STANDARD = ${CMAKE_CXX_STANDARD}")
if(WIN32)
message(STATUS "")
@@ -61,12 +69,12 @@ include(CheckLibraryExists)
# the settings below will be automatically configured by the rest of this script
set(ARMA_USE_WRAPPER true)
set(ARMA_USE_WRAPPER false)
set(ARMA_USE_LAPACK false)
set(ARMA_USE_BLAS false)
set(ARMA_USE_ATLAS false)
set(ARMA_USE_ARPACK false)
set(ARMA_USE_SUPERLU false) # Caveat: only SuperLU version 5.x can be used!
set(ARMA_USE_SUPERLU false)
# extract version from sources
@@ -92,26 +100,15 @@ if(NOT CXX_FLAGS_EMPTY)
endif()
# NOTE: Armadillo requires compiler support for thread_local and C++11
# NOTE: for Linux, this is available with gcc 4.8.3 onwards
# NOTE: for macOS, thread_local is supoported in Xcode 8 (mid 2016 onwards) in C++11 mode
# NOTE: thread_local appears broken again on macOS 11 (Big Sur) and/or AppleClang 12.0
# NOTE: see comments in include/armadillo_bits/arma_rng.hpp
if(DEFINED CMAKE_CXX_COMPILER_ID AND DEFINED CMAKE_CXX_COMPILER_VERSION)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if(NOT (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 4.8.3))
message(STATUS "Detected gcc 4.8.3 or newer")
if(${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 6.1.0)
message(STATUS "*** WARNING: support for gcc versions older than 6.1 is deprecated")
endif()
if(NOT (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 6.1.0))
if(NOT DEFINED CMAKE_CXX_STANDARD)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
message(STATUS "Added '-std=c++11' to compiler flags")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
message(STATUS "Added '-std=c++14' to compiler flags")
endif()
else()
message(FATAL_ERROR "Compiler too old")
message(FATAL_ERROR "Compiler too old; need at least gcc 6.1")
endif()
else()
if(NOT (${CMAKE_MAJOR_VERSION} LESS 3))
@@ -147,7 +144,8 @@ endif()
if(NOT APPLE)
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
message(STATUS "*** CMAKE_INSTALL_PREFIX was initalised by cmake to the default value of ${CMAKE_INSTALL_PREFIX}")
message(STATUS "")
message(STATUS "*** CMAKE_INSTALL_PREFIX was initialised by cmake to the default value of ${CMAKE_INSTALL_PREFIX}")
message(STATUS "*** CMAKE_INSTALL_PREFIX changed to /usr")
set(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "Standard install prefix" FORCE)
endif()
@@ -186,11 +184,18 @@ if(INSTALL_BIN_DIR)
endif()
option(HEADER_ONLY "Do not generate the wrapper library" OFF)
## Example use on the command line:
## cmake -D HEADER_ONLY=true .
if(MSVC)
option(BUILD_SHARED_LIBS "build shared library" OFF)
option(STATIC_LIB "Generate static library instead of shared library" ON)
else()
option(BUILD_SHARED_LIBS "build shared library" ON)
option(STATIC_LIB "Generate static library instead of shared library" OFF)
endif()
## Example use on the command line:
## cmake -D STATIC_LIB=true .
option(OPENBLAS_PROVIDES_LAPACK "Assume that OpenBLAS provides LAPACK functions" OFF)
## Example use on the command line:
@@ -222,26 +227,39 @@ option(BUILD_SMOKE_TEST "Build the smoke test" ON)
if(MSVC)
if(BUILD_SHARED_LIBS)
if(NOT STATIC_LIB)
message(STATUS "")
message(STATUS "*** WARNING: building shared library with MSVC is not supported." )
message(STATUS "*** WARNING: suggest to use manual installation instead;")
message(STATUS "*** WARNING: see README for details")
message(STATUS "*** WARNING: use manual installation instead; see README for details")
message(STATUS "")
else()
set(ARMA_USE_WRAPPER false)
set(STATIC_LIB ON)
endif()
endif()
if(HEADER_ONLY)
set(BUILD_WRAPPER false)
else()
set(BUILD_WRAPPER true)
endif()
if(BUILD_WRAPPER)
set(ARMA_USE_WRAPPER true)
else()
set(ARMA_USE_WRAPPER false)
endif()
message(STATUS "")
message(STATUS "CMAKE_SYSTEM_NAME = ${CMAKE_SYSTEM_NAME}" )
message(STATUS "CMAKE_CXX_COMPILER_ID = ${CMAKE_CXX_COMPILER_ID}" )
message(STATUS "CMAKE_CXX_COMPILER_VERSION = ${CMAKE_CXX_COMPILER_VERSION}")
message(STATUS "CMAKE_COMPILER_IS_GNUCXX = ${CMAKE_COMPILER_IS_GNUCXX}" )
message(STATUS "")
message(STATUS "*** Options:" )
message(STATUS "BUILD_SHARED_LIBS = ${BUILD_SHARED_LIBS}" )
message(STATUS "*** options:" )
message(STATUS "HEADER_ONLY = ${HEADER_ONLY}" )
message(STATUS "STATIC_LIB = ${STATIC_LIB}" )
message(STATUS "OPENBLAS_PROVIDES_LAPACK = ${OPENBLAS_PROVIDES_LAPACK}")
message(STATUS "ALLOW_FLEXIBLAS_LINUX = ${ALLOW_FLEXIBLAS_LINUX}" )
message(STATUS "ALLOW_OPENBLAS_MACOS = ${ALLOW_OPENBLAS_MACOS}" )
@@ -452,7 +470,7 @@ if(ARPACK_FOUND)
set(ARMA_LIBS ${ARMA_LIBS} ${ARPACK_LIBRARY})
endif()
include(ARMA_FindSuperLU5)
include(ARMA_FindSuperLU)
message(STATUS "SuperLU_FOUND = ${SuperLU_FOUND}")
if(SuperLU_FOUND)
@@ -489,16 +507,24 @@ message(STATUS "*** ARMA_USE_BLAS = ${ARMA_USE_BLAS}")
message(STATUS "*** ARMA_USE_ATLAS = ${ARMA_USE_ATLAS}")
message(STATUS "*** ARMA_USE_ARPACK = ${ARMA_USE_ARPACK}")
message(STATUS "*** ARMA_USE_SUPERLU = ${ARMA_USE_SUPERLU}")
message(STATUS "")
message(STATUS "*** Armadillo wrapper library will use the following libraries:")
message(STATUS "*** ARMA_LIBS = ${ARMA_LIBS}")
message(STATUS "")
if(BUILD_WRAPPER)
message(STATUS "")
message(STATUS "*** Armadillo wrapper library links with these libraries:")
message(STATUS "*** ARMA_LIBS = ${ARMA_LIBS}")
else()
message(STATUS "")
message(STATUS "*** Armadillo programs must be manually linked with:")
message(STATUS "*** ARMA_LIBS = ${ARMA_LIBS}")
endif()
message(STATUS "")
message(STATUS "Copying ${PROJECT_SOURCE_DIR}/include/ to ${PROJECT_BINARY_DIR}/tmp/include/")
file(COPY ${PROJECT_SOURCE_DIR}/include/ DESTINATION ${PROJECT_BINARY_DIR}/tmp/include/)
message(STATUS "Generating ${PROJECT_BINARY_DIR}/tmp/include/config.hpp")
message(STATUS "Generating ${PROJECT_BINARY_DIR}/tmp/include/armadillo_bits/config.hpp")
configure_file(${PROJECT_BINARY_DIR}/tmp/include/armadillo_bits/config.hpp.cmake ${PROJECT_BINARY_DIR}/tmp/include/armadillo_bits/config.hpp)
@@ -538,13 +564,25 @@ else()
endif()
message(STATUS "")
message(STATUS "CMAKE_CXX_FLAGS = ${CMAKE_CXX_FLAGS}" )
message(STATUS "CMAKE_SHARED_LINKER_FLAGS = ${CMAKE_SHARED_LINKER_FLAGS}")
message(STATUS "CMAKE_REQUIRED_INCLUDES = ${CMAKE_REQUIRED_INCLUDES}" )
add_library( armadillo ${PROJECT_SOURCE_DIR}/src/wrapper1.cpp ${PROJECT_SOURCE_DIR}/src/wrapper2.cpp )
target_link_libraries( armadillo ${ARMA_LIBS} )
if(BUILD_WRAPPER)
if(STATIC_LIB)
set(BUILD_SHARED_LIBS OFF)
else()
set(BUILD_SHARED_LIBS ON)
endif()
add_library( armadillo ${PROJECT_SOURCE_DIR}/src/wrapper1.cpp ${PROJECT_SOURCE_DIR}/src/wrapper2.cpp )
target_link_libraries( armadillo ${ARMA_LIBS} )
else()
add_library( armadillo INTERFACE )
endif()
# target_include_directories(armadillo INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>)
target_include_directories(armadillo INTERFACE $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/tmp/include> $<INSTALL_INTERFACE:include>)
set_target_properties(armadillo PROPERTIES VERSION ${ARMA_VERSION_MAJOR}.${ARMA_VERSION_MINOR_ALT}.${ARMA_VERSION_PATCH} SOVERSION ${ARMA_VERSION_MAJOR})
@@ -565,7 +603,7 @@ message(STATUS "CMAKE_INSTALL_BINDIR = ${CMAKE_INSTALL_BINDIR}" )
# Note that the trailing / character in "include/" is critical
install(DIRECTORY ${PROJECT_BINARY_DIR}/tmp/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
PATTERN ".svn" EXCLUDE
PATTERN ".git" EXCLUDE
PATTERN "*.cmake" EXCLUDE
PATTERN "*~" EXCLUDE
PATTERN "*orig" EXCLUDE
@@ -576,6 +614,42 @@ install(TARGETS armadillo EXPORT ArmadilloLibraryDepends
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
## smoke test
if(BUILD_SMOKE_TEST)
if(HEADER_ONLY)
## TODO: update to link smoke_test with ARMA_LIBS when HEADER_ONLY option is enabled
message(STATUS "*** building smoke_test not supported when HEADER_ONLY enabled")
else()
message(STATUS "*** configuring smoke_test")
enable_testing()
add_subdirectory(tests1)
endif()
endif()
## pkgconfig related
## TODO: this currently doesn't handle the required SuperLU include dir
## TODO: update armadillo.pc.in to link with ARMA_LIBS when HEADER_ONLY option is enabled
if(HEADER_ONLY)
message(STATUS "*** generating pkgconfig files not supported when HEADER_ONLY enabled")
else()
message(STATUS "*** copying ${PROJECT_SOURCE_DIR}/misc/ to ${PROJECT_BINARY_DIR}/tmp/misc/")
file(COPY ${PROJECT_SOURCE_DIR}/misc/ DESTINATION ${PROJECT_BINARY_DIR}/tmp/misc/)
message(STATUS "*** generating '${PROJECT_BINARY_DIR}/tmp/misc/armadillo.pc'")
configure_file(${PROJECT_BINARY_DIR}/tmp/misc/armadillo.pc.in "${PROJECT_BINARY_DIR}/tmp/misc/armadillo.pc" @ONLY)
install(FILES "${PROJECT_BINARY_DIR}/tmp/misc/armadillo.pc" DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
endif()
if(HEADER_ONLY)
message(STATUS "")
message(STATUS "*** HEADER_ONLY mode is enabled; skipping rest of configuration script")
return()
endif()
# Export the package for use from the build-tree
# (this registers the build-tree with a global CMake-registry)
export(PACKAGE armadillo)
@@ -586,7 +660,6 @@ set(ARMADILLO_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/tmp/include")
set(ARMADILLO_LIB_DIR "${PROJECT_BINARY_DIR}")
set(ARMADILLO_CMAKE_DIR "${PROJECT_BINARY_DIR}")
message(STATUS "Generating '${PROJECT_BINARY_DIR}/ArmadilloConfig.cmake'")
# copy/change config and configVersion file (modify only the @xyz@ variables)
configure_file(${PROJECT_SOURCE_DIR}/cmake_aux/InstallFiles/ArmadilloConfig.cmake.in
@@ -624,23 +697,3 @@ install(FILES
"${PROJECT_BINARY_DIR}/InstallFiles/ArmadilloConfig.cmake"
"${PROJECT_BINARY_DIR}/InstallFiles/ArmadilloConfigVersion.cmake"
DESTINATION "${ARMADILLO_CMAKE_DIR}" COMPONENT dev)
# pkgconfig related
message(STATUS "Copying ${PROJECT_SOURCE_DIR}/misc/ to ${PROJECT_BINARY_DIR}/tmp/misc/")
file(COPY ${PROJECT_SOURCE_DIR}/misc/ DESTINATION ${PROJECT_BINARY_DIR}/tmp/misc/)
message(STATUS "Generating '${PROJECT_BINARY_DIR}/tmp/misc/armadillo.pc'")
configure_file(${PROJECT_BINARY_DIR}/tmp/misc/armadillo.pc.in "${PROJECT_BINARY_DIR}/tmp/misc/armadillo.pc" @ONLY)
install(FILES "${PROJECT_BINARY_DIR}/tmp/misc/armadillo.pc" DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
# smoke test
if(BUILD_SMOKE_TEST)
message(STATUS "*** configuring smoke_test")
enable_testing()
add_subdirectory(tests1)
endif()
+2 -2
View File
@@ -1,7 +1,7 @@
Armadillo C++ Linear Algebra Library
Copyright 2008-2024 Conrad Sanderson (https://conradsanderson.id.au)
Copyright 2008-2025 Conrad Sanderson (https://conradsanderson.id.au)
Copyright 2008-2016 National ICT Australia (NICTA)
Copyright 2017-2024 Data61 / CSIRO
Copyright 2017-2025 Data61 / CSIRO
This product includes software developed by Conrad Sanderson (https://conradsanderson.id.au)
This product includes software developed at National ICT Australia (NICTA)
+35 -38
View File
@@ -1,9 +1,9 @@
### Armadillo: C++ Library for Linear Algebra & Scientific Computing
https://arma.sourceforge.net
Copyright 2008-2024 Conrad Sanderson (https://conradsanderson.id.au)
Copyright 2008-2025 Conrad Sanderson (https://conradsanderson.id.au)
Copyright 2008-2016 National ICT Australia (NICTA)
Copyright 2017-2024 Data61 / CSIRO
Copyright 2017-2025 Data61 / CSIRO
---
@@ -78,8 +78,8 @@ Please cite the following papers if you use Armadillo in your research and/or so
Citations are useful for the continued development and maintenance of the library.
* Conrad Sanderson and Ryan Curtin.
Armadillo: a template-based C++ library for linear algebra.
Journal of Open Source Software, Vol. 1, No. 2, pp. 26, 2016.
Armadillo: An Efficient Framework for Numerical Linear Algebra.
International Conference on Computer and Automation Engineering, 2025.
* Conrad Sanderson and Ryan Curtin.
Practical Sparse Matrices in C++ with Hybrid Storage and Template-Based Expression Optimisation.
@@ -115,7 +115,7 @@ On macOS, the Accelerate framework can be used for BLAS and LAPACK functions.
If sparse matrices are not needed, ARPACK and SuperLU are not required.
Armadillo requires a C++ compiler that supports at least the C++11 standard.
Armadillo requires a C++ compiler that supports at least the C++14 standard.
On Linux-based systems, install the GCC C++ compiler, which is available as a pre-built package.
The package name might be `g++` or `gcc-c++` depending on your system.
@@ -129,8 +129,8 @@ On Windows systems, the MinGW toolset or Visual Studio C++ 2019 (MSVC) can be us
Caveats on the use of SuperLU:
- SuperLU must be available as a shared library
- Only the following SuperLU versions are supported: 5.2.x, 5.3.x, 6.0.x
- SuperLU 6.0.x must be compiled with default integer size (32 bits)
- Only the following SuperLU versions are supported: 5.2.x, 5.3.x, 6.0.x, 7.0.x
- SuperLU 6.0.x and 7.0.x must be compiled with default integer size (32 bits)
---
@@ -230,12 +230,12 @@ and hence you will need to link your programs directly with OpenBLAS, LAPACK, et
If you have installed Armadillo via the cmake installer,
use the following command to compile your programs:
g++ prog.cpp -o prog -O2 -std=c++11 -larmadillo
g++ prog.cpp -o prog -O2 -std=c++14 -larmadillo
If you have installed Armadillo manually, link with OpenBLAS and LAPACK
instead of the Armadillo runtime library:
g++ prog.cpp -o prog -O2 -std=c++11 -lopenblas -llapack
g++ prog.cpp -o prog -O2 -std=c++14 -lopenblas -llapack
If you have manually installed Armadillo in a non-standard location,
such as `/home/user/include/`, you will need to make sure
@@ -243,12 +243,12 @@ that your C++ compiler searches `/home/user/include/`
by explicitly specifying the directory as an argument/option.
For example, using the `-I` switch in GCC and Clang:
g++ prog.cpp -o prog -O2 -std=c++11 -I /home/user/include/ -lopenblas -llapack
g++ prog.cpp -o prog -O2 -std=c++14 -I /home/user/include/ -lopenblas -llapack
If you're getting linking issues (unresolved symbols),
enable the `ARMA_DONT_USE_WRAPPER` option:
g++ prog.cpp -o prog -O2 -std=c++11 -I /home/user/include/ -DARMA_DONT_USE_WRAPPER -lopenblas -llapack
g++ prog.cpp -o prog -O2 -std=c++14 -I /home/user/include/ -DARMA_DONT_USE_WRAPPER -lopenblas -llapack
If you don't have OpenBLAS, on Linux change `-lopenblas` to `-lblas`;
on macOS change `-lopenblas -llapack` to `-framework Accelerate`
@@ -303,20 +303,21 @@ the active solution platform must be set to x64, instead of win32.
The MSVC project was tested on Windows 10 (64 bit) with Visual Studio C++ 2019.
Adaptations may be required for 32 bit systems, later versions of Windows and/or the compiler.
For example, options such as `ARMA_BLAS_LONG` and `ARMA_BLAS_UNDERSCORE`,
For example, options such as `ARMA_BLAS_LONG_LONG` and `ARMA_BLAS_UNDERSCORE`,
defined in `include/armadillo_bits/config.hpp`, may need to be either enabled or disabled.
The folder `examples/lib_win64` contains a copy of lib and dll files
obtained from a pre-compiled release of OpenBLAS:
https://github.com/xianyi/OpenBLAS/releases/
https://github.com/OpenMathLib/OpenBLAS/releases
The compilation was done by a third party. USE AT YOUR OWN RISK.
**Caveat:**
for any high performance scientific/engineering workloads,
we strongly recommend using a Linux-based operating system, such as:
* Fedora https://fedoraproject.org/
* Ubuntu https://www.ubuntu.com/
* CentOS https://centos.org/
* Fedora https://fedoraproject.org/
* Ubuntu https://www.ubuntu.com/
* Alma Linux https://almalinux.org/
* Rocky Linux https://rockylinux.org/
---
@@ -332,29 +333,28 @@ as used by the replacement libraries. Specifically, the following defines
may need to be enabled or disabled:
ARMA_USE_WRAPPER
ARMA_BLAS_CAPITALS
ARMA_BLAS_UNDERSCORE
ARMA_BLAS_LONG
ARMA_BLAS_LONG_LONG
ARMA_DONT_USE_FORTRAN_HIDDEN_ARGS
ARMA_BLAS_UNDERSCORE
ARMA_BLAS_CAPITALS
See the documentation for more information on the above defines.
On Linux-based systems, MKL might be installed in a non-standard location such as `/opt`
which can cause problems during linking.
Before installing Armadillo, the system should know where the MKL libraries are located.
For example, `/opt/intel/mkl/lib/intel64/`.
This can be achieved by setting the `LD_LIBRARY_PATH` environment variable,
or for a more permanent solution, adding the directory locations to `/etc/ld.so.conf`.
It may also be possible to store a text file with the locations
in the `/etc/ld.so.conf.d` directory. For example, `/etc/ld.so.conf.d/mkl.conf`.
If `/etc/ld.so.conf` is modified or `/etc/ld.so.conf.d/mkl.conf` is created,
`/sbin/ldconfig` must be run afterwards.
Examples: `/opt/intel/oneapi/mkl/latest/lib`, `/opt/intel/mkl/lib/intel64/`.
Below is an example of `/etc/ld.so.conf.d/mkl.conf`
where Intel MKL is installed in `/opt/intel`
Before installing Armadillo, the system must know where the MKL libraries are located.
This can be achieved via several ways:
/opt/intel/lib/intel64
/opt/intel/mkl/lib/intel64
1. By setting the `LD_LIBRARY_PATH` environment variable.
2. By adding the MKL library directory locations to the `/etc/ld.so.conf` text file,
followed by running `/sbin/ldconfig`.
3. By creating a text file named `/etc/ld.so.conf.d/mkl.conf`
which contains the MKL library directory locations,
followed by running `/sbin/ldconfig`.
If MKL is installed and it is persistently giving problems during linking,
Support for MKL can be disabled by editing the CMakeLists.txt file,
@@ -369,7 +369,7 @@ Comment out the line containing:
Use of the C++11 `auto` keyword is not recommended with Armadillo objects and expressions.
Armadillo has a template meta-programming framework which creates lots of short lived temporaries
Armadillo has a template meta-programming framework which creates short-lived temporaries
that are not properly handled by `auto`.
---
@@ -460,15 +460,12 @@ Octave/Matlab with C++ code that uses Armadillo matrices.
### 16: Related Software Using Armadillo
* ensmallen: C++ library for non-linear numerical optimisation (L-BFGS, SGD, CMA-ES, etc)
https://ensmallen.org/
* Bandicoot: C++ library for accelerated linear algebra on GPUs
https://coot.sourceforge.io
* MLPACK: extensive library of machine learning algorithms
https://mlpack.org
* ensmallen: C++ library for numerical optimisation (L-BFGS, SGD, CMA-ES, etc)
https://ensmallen.org/
* RcppArmadillo: integration of Armadillo with R
https://dirk.eddelbuettel.com/code/rcpp.armadillo.html
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 432 B

Binary file not shown.
Binary file not shown.
Binary file not shown.
+3
View File
@@ -115,6 +115,9 @@ foreach (MKL_NAME ${MKL_NAMES})
/usr/local/mkl/*/lib/em64t
/usr/local/mkl/*/lib/lib64
/usr/local/mkl/*/lib/32
/usr/local/intel/oneapi/mkl/latest/lib
/opt/intel/oneapi/mkl/latest/lib
/opt/intel/oneapi/mkl/*/lib
)
set(TMP_LIBRARY ${${MKL_NAME}_LIBRARY})
+97
View File
@@ -0,0 +1,97 @@
# Try to find suitable version of SuperLU
# Once done, this will define
#
# SuperLU_FOUND - system has SuperLU
# SuperLU_LIBRARY - Link this to use SuperLU
# SuperLU_INCLUDE_DIR - directory of SuperLU headers
find_path(SuperLU_INCLUDE_DIR slu_ddefs.h
PATHS ${CMAKE_SYSTEM_INCLUDE_PATH} /usr/include /usr/local/include /opt/local/include
PATH_SUFFIXES superlu SuperLU ""
)
find_library(SuperLU_LIBRARY
NAMES superlu
PATHS ${CMAKE_SYSTEM_LIBRARY_PATH} /usr/lib64 /usr/lib /usr/local/lib64 /usr/local/lib /opt/local/lib64 /opt/local/lib
)
set(SuperLU_FOUND NO)
if(NOT SuperLU_FIND_QUIETLY)
message(STATUS "Looking for suitable version of SuperLU")
endif()
if(SuperLU_LIBRARY AND SuperLU_INCLUDE_DIR)
# determine if this is a suitable version of SuperLU
if(EXISTS "${SuperLU_INCLUDE_DIR}/slu_ddefs.h")
file(READ "${SuperLU_INCLUDE_DIR}/slu_ddefs.h" _slu_HEADER_CONTENTS)
string(REGEX REPLACE ".*version ([0-9]).*" "\\1" SLU_VERSION_MAJOR "${_slu_HEADER_CONTENTS}")
if("${SLU_VERSION_MAJOR}" EQUAL "7")
set(SuperLU_FOUND YES)
endif()
if("${SLU_VERSION_MAJOR}" EQUAL "6")
set(SuperLU_FOUND YES)
endif()
if("${SLU_VERSION_MAJOR}" EQUAL "5")
set(SuperLU_FOUND YES)
endif()
if("${SLU_VERSION_MAJOR}" EQUAL "4")
# NOTE: SLU_VERSION_MAJOR = 4 is not 100% reliable, as the version string in slu_ddefs.h wasn't updated in SuperLU 5.0, 5.1, 5.2
# NOTE: We need to explicitly check the prototype of dgssvx() to determine whether this is version 4 or 5.
string(FIND "${_slu_HEADER_CONTENTS}" "dgssvx" _slu_dgssvx_start)
if("${_slu_dgssvx_start}" GREATER 0)
string(SUBSTRING "${_slu_HEADER_CONTENTS}" ${_slu_dgssvx_start} -1 _slu_dgssvx_tmp)
string(FIND "${_slu_dgssvx_tmp}" ";" _slu_dgssvx_len)
string(SUBSTRING "${_slu_HEADER_CONTENTS}" ${_slu_dgssvx_start} ${_slu_dgssvx_len} _slu_dgssvx_proto)
string(FIND "${_slu_dgssvx_proto}" "GlobalLU_t" _slu_dgssvx_check)
if("${_slu_dgssvx_check}" EQUAL -1)
# in version 4, dgssvx() doesn't have a GlobalLU_t argument
if(NOT SuperLU_FIND_QUIETLY)
message(STATUS "Found SuperLU 4, which is insufficient")
endif()
else()
set(SuperLU_FOUND YES)
endif()
endif()
endif()
else()
message(STATUS "Could not read ${SuperLU_INCLUDE_DIR}/slu_ddefs.h to verify suitable version")
endif()
endif()
if(SuperLU_LIBRARY AND NOT SuperLU_INCLUDE_DIR)
if(NOT SuperLU_FIND_QUIETLY)
message(STATUS "Incomplete installation of SuperLU: no SuperLU headers found")
endif()
endif()
if(NOT SuperLU_FOUND)
if(NOT SuperLU_FIND_QUIETLY)
message(STATUS "Could not find suitable version of SuperLU")
endif()
else()
message(STATUS "Found SuperLU library: ${SuperLU_LIBRARY}")
endif()
-90
View File
@@ -1,90 +0,0 @@
# Try to find SuperLU 5.x
# Once done, this will define
#
# SuperLU_FOUND - system has SuperLU
# SuperLU_LIBRARY - Link this to use SuperLU
# SuperLU_INCLUDE_DIR - directory of SuperLU headers
find_path(SuperLU_INCLUDE_DIR slu_ddefs.h
PATHS ${CMAKE_SYSTEM_INCLUDE_PATH} /usr/include /usr/local/include /opt/local/include
PATH_SUFFIXES superlu SuperLU ""
)
find_library(SuperLU_LIBRARY
NAMES superlu
PATHS ${CMAKE_SYSTEM_LIBRARY_PATH} /usr/lib64 /usr/lib /usr/local/lib64 /usr/local/lib /opt/local/lib64 /opt/local/lib
)
set(SuperLU_FOUND NO)
if(NOT SuperLU_FIND_QUIETLY)
message(STATUS "Looking for SuperLU version 5")
endif()
if(SuperLU_LIBRARY AND SuperLU_INCLUDE_DIR)
# Now determine if the version is version 5.
# This voodoo is required as SuperLU developers like to keep things messy.
if(EXISTS "${SuperLU_INCLUDE_DIR}/slu_ddefs.h")
file(READ "${SuperLU_INCLUDE_DIR}/slu_ddefs.h" _slu_HEADER_CONTENTS)
string(REGEX REPLACE ".*version ([0-9]).*" "\\1" SLU_VERSION_MAJOR "${_slu_HEADER_CONTENTS}")
if("${SLU_VERSION_MAJOR}" EQUAL "5")
set(SuperLU_FOUND YES)
else()
if("${SLU_VERSION_MAJOR}" EQUAL "4")
# NOTE: SLU_VERSION_MAJOR = 4 is not 100% reliable, as the version string in slu_ddefs.h wasn't updated in SuperLU 5.0, 5.1, 5.2
# NOTE: We need to explicitly check the prototype of dgssvx() to determine whether this is version 4 or 5.
string(FIND "${_slu_HEADER_CONTENTS}" "dgssvx" _slu_dgssvx_start)
if("${_slu_dgssvx_start}" GREATER 0)
string(SUBSTRING "${_slu_HEADER_CONTENTS}" ${_slu_dgssvx_start} -1 _slu_dgssvx_tmp)
string(FIND "${_slu_dgssvx_tmp}" ";" _slu_dgssvx_len)
string(SUBSTRING "${_slu_HEADER_CONTENTS}" ${_slu_dgssvx_start} ${_slu_dgssvx_len} _slu_dgssvx_proto)
string(FIND "${_slu_dgssvx_proto}" "GlobalLU_t" _slu_dgssvx_check)
if("${_slu_dgssvx_check}" EQUAL -1)
# in version 4, dgssvx() doesn't have a GlobalLU_t argument
if(NOT SuperLU_FIND_QUIETLY)
message(STATUS "Found SuperLU, but it doesn't appear to be version 5")
endif()
else()
set(SuperLU_FOUND YES)
endif()
endif()
else()
if(NOT SuperLU_FIND_QUIETLY)
message(STATUS "Found SuperLU version ${SLU_VERSION_MAJOR}, but version 5 is required")
endif()
endif()
endif()
else()
if(NOT SuperLU_FIND_QUIETLY)
message(STATUS "Found SuperLU and headers, but could not verify version 5")
endif()
endif()
endif()
if(SuperLU_LIBRARY AND NOT SuperLU_INCLUDE_DIR)
if(NOT SuperLU_FIND_QUIETLY)
message(STATUS "Incomplete installation of SuperLU: no SuperLU headers found")
endif()
endif()
if(NOT SuperLU_FOUND)
if(NOT SuperLU_FIND_QUIETLY)
message(STATUS "Could not find SuperLU")
endif()
else()
message(STATUS "Found SuperLU: ${SuperLU_LIBRARY}")
endif()
Vendored
+3 -4
View File
@@ -6,10 +6,10 @@ check_cmake()
{
(cmake --version) </dev/null >/dev/null 2>&1 ||
{
echo "error: cmake (version 2.8 or newer) must be present to configure and install Armadillo"
echo "error: cmake 3.5+ is required to configure and install Armadillo"
echo ""
echo "cmake might be available as a package for your system,"
echo "or can be downloaded from http://cmake.org"
echo "cmake can be installed via your system's package manager,"
echo "or downloaded from https://cmake.org"
ABORT=yes
}
}
@@ -20,4 +20,3 @@ test "$ABORT" = yes && exit -1
rm -f CMakeCache.txt
cmake $@ .
+233 -272
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -4,14 +4,14 @@ How to compile example1.cpp
** Linux and macOS **
If you have installed Armadillo via the CMake installer:
g++ example1.cpp -o example1 -std=c++11 -O2 -larmadillo
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++11 -O2 -I /home/user/armadillo-12.2.0/include -DARMA_DONT_USE_WRAPPER -lopenblas
g++ example1.cpp -o example1 -std=c++14 -O2 -I /home/user/armadillo-14.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. "12.2.0" needs to be changed).
and/or for each specific version of Armadillo (ie. "14.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
+3 -1
View File
@@ -1,7 +1,9 @@
#include <iostream>
#include <armadillo>
using namespace std;
using std::cout;
using std::endl;
using namespace arma;
// Armadillo documentation is available at:
+9 -8
View File
@@ -1,18 +1,19 @@
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.20:
https://github.com/xianyi/OpenBLAS/releases/download/v0.3.20/OpenBLAS-0.3.20-x64.zip
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 compilation was done by a third party. USE AT YOUR OWN RISK.
libopenblas.dll is a copy of OpenBLAS-0.3.20-x64/bin/libopenblas.dll
libopenblas.lib is a copy of OpenBLAS-0.3.20-x64/lib/libopenblas.dll.a
The original sources for OpenBLAS are at:
https://github.com/xianyi/OpenBLAS/
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
OpenBLAS is a high-performance implementation of BLAS and LAPACK.
The original sources for standard BLAS and LAPACK are at:
The source code for OpenBLAS is available at:
https://github.com/OpenMathLib/OpenBLAS
The sources for standard BLAS and LAPACK are at:
http://www.netlib.org/blas/
http://www.netlib.org/lapack/
Binary file not shown.
Binary file not shown.
+33 -20
View File
@@ -19,9 +19,9 @@
#ifndef ARMA_INCLUDES
#define ARMA_INCLUDES
// NOTE: functions that are designed to be user accessible are described in the documentation (docs.html).
// NOTE: all other functions and classes (ie. not explicitly described in the documentation)
// NOTE: are considered as internal implementation details, and may be changed or removed without notice.
// WARNING: the documentation (docs.html) describes the public API (functions, classes, constants);
// WARNING: any functionality which is _not explicitly_ described in the documentation
// WARNING: is considered as internal implementation detail, and may be changed or removed without notice.
#include "armadillo_bits/config.hpp"
#include "armadillo_bits/compiler_check.hpp"
@@ -35,6 +35,7 @@
#include <cmath>
#include <ctime>
#include <memory>
#include <iostream>
#include <fstream>
#include <sstream>
@@ -52,7 +53,7 @@
#include <chrono>
#include <atomic>
#if !defined(ARMA_DONT_USE_STD_MUTEX)
#if defined(ARMA_USE_STD_MUTEX)
#include <mutex>
#endif
@@ -221,6 +222,7 @@ namespace arma
#include "armadillo_bits/OpCube_bones.hpp"
#include "armadillo_bits/SpOp_bones.hpp"
#include "armadillo_bits/SpToDOp_bones.hpp"
#include "armadillo_bits/mtSpReduceOp_bones.hpp"
#include "armadillo_bits/eOp_bones.hpp"
#include "armadillo_bits/eOpCube_bones.hpp"
@@ -314,12 +316,22 @@ namespace arma
#include "armadillo_bits/op_roots_bones.hpp"
#include "armadillo_bits/op_cond_bones.hpp"
#include "armadillo_bits/op_rcond_bones.hpp"
#include "armadillo_bits/op_sp_plus_bones.hpp"
#include "armadillo_bits/op_sp_minus_bones.hpp"
#include "armadillo_bits/op_powmat_bones.hpp"
#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_sp_plus_bones.hpp"
#include "armadillo_bits/op_sp_minus_bones.hpp"
#include "armadillo_bits/op_sp_sum_bones.hpp"
#include "armadillo_bits/op_sp_max_bones.hpp"
#include "armadillo_bits/op_sp_min_bones.hpp"
#include "armadillo_bits/op_sp_mean_bones.hpp"
#include "armadillo_bits/op_sp_var_bones.hpp"
#include "armadillo_bits/op_sp_stddev_bones.hpp"
#include "armadillo_bits/op_sp_vecnorm_bones.hpp"
#include "armadillo_bits/op_sp_diagvec_bones.hpp"
#include "armadillo_bits/op_sp_nonzeros_bones.hpp"
#include "armadillo_bits/op_sp_as_dense_bones.hpp"
#include "armadillo_bits/glue_times_bones.hpp"
#include "armadillo_bits/glue_times_misc_bones.hpp"
@@ -352,15 +364,10 @@ namespace arma
#include "armadillo_bits/gmm_diag_bones.hpp"
#include "armadillo_bits/gmm_full_bones.hpp"
#include "armadillo_bits/spop_max_bones.hpp"
#include "armadillo_bits/spop_min_bones.hpp"
#include "armadillo_bits/spop_sum_bones.hpp"
#include "armadillo_bits/spop_strans_bones.hpp"
#include "armadillo_bits/spop_htrans_bones.hpp"
#include "armadillo_bits/spop_misc_bones.hpp"
#include "armadillo_bits/spop_diagmat_bones.hpp"
#include "armadillo_bits/spop_mean_bones.hpp"
#include "armadillo_bits/spop_var_bones.hpp"
#include "armadillo_bits/spop_trimat_bones.hpp"
#include "armadillo_bits/spop_symmat_bones.hpp"
#include "armadillo_bits/spop_normalise_bones.hpp"
@@ -368,8 +375,8 @@ 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_vecnorm_bones.hpp"
#include "armadillo_bits/spop_shift_bones.hpp"
#include "armadillo_bits/spop_relational_bones.hpp"
#include "armadillo_bits/spglue_plus_bones.hpp"
#include "armadillo_bits/spglue_minus_bones.hpp"
@@ -624,6 +631,7 @@ namespace arma
#include "armadillo_bits/mtOp_meat.hpp"
#include "armadillo_bits/mtOpCube_meat.hpp"
#include "armadillo_bits/mtSpOp_meat.hpp"
#include "armadillo_bits/mtSpReduceOp_meat.hpp"
#include "armadillo_bits/Glue_meat.hpp"
#include "armadillo_bits/GlueCube_meat.hpp"
@@ -762,12 +770,22 @@ namespace arma
#include "armadillo_bits/op_roots_meat.hpp"
#include "armadillo_bits/op_cond_meat.hpp"
#include "armadillo_bits/op_rcond_meat.hpp"
#include "armadillo_bits/op_sp_plus_meat.hpp"
#include "armadillo_bits/op_sp_minus_meat.hpp"
#include "armadillo_bits/op_powmat_meat.hpp"
#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_sp_plus_meat.hpp"
#include "armadillo_bits/op_sp_minus_meat.hpp"
#include "armadillo_bits/op_sp_sum_meat.hpp"
#include "armadillo_bits/op_sp_max_meat.hpp"
#include "armadillo_bits/op_sp_min_meat.hpp"
#include "armadillo_bits/op_sp_mean_meat.hpp"
#include "armadillo_bits/op_sp_var_meat.hpp"
#include "armadillo_bits/op_sp_stddev_meat.hpp"
#include "armadillo_bits/op_sp_vecnorm_meat.hpp"
#include "armadillo_bits/op_sp_diagvec_meat.hpp"
#include "armadillo_bits/op_sp_nonzeros_meat.hpp"
#include "armadillo_bits/op_sp_as_dense_meat.hpp"
#include "armadillo_bits/glue_times_meat.hpp"
#include "armadillo_bits/glue_times_misc_meat.hpp"
@@ -800,15 +818,10 @@ namespace arma
#include "armadillo_bits/gmm_diag_meat.hpp"
#include "armadillo_bits/gmm_full_meat.hpp"
#include "armadillo_bits/spop_max_meat.hpp"
#include "armadillo_bits/spop_min_meat.hpp"
#include "armadillo_bits/spop_sum_meat.hpp"
#include "armadillo_bits/spop_strans_meat.hpp"
#include "armadillo_bits/spop_htrans_meat.hpp"
#include "armadillo_bits/spop_misc_meat.hpp"
#include "armadillo_bits/spop_diagmat_meat.hpp"
#include "armadillo_bits/spop_mean_meat.hpp"
#include "armadillo_bits/spop_var_meat.hpp"
#include "armadillo_bits/spop_trimat_meat.hpp"
#include "armadillo_bits/spop_symmat_meat.hpp"
#include "armadillo_bits/spop_normalise_meat.hpp"
@@ -816,8 +829,8 @@ 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_vecnorm_meat.hpp"
#include "armadillo_bits/spop_shift_meat.hpp"
#include "armadillo_bits/spop_relational_meat.hpp"
#include "armadillo_bits/spglue_plus_meat.hpp"
#include "armadillo_bits/spglue_minus_meat.hpp"
+21 -21
View File
@@ -36,7 +36,7 @@ inline
void
BaseCube<elem_type,derived>::print(const std::string extra_text) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const unwrap_cube<derived> tmp( (*this).get_ref() );
@@ -59,7 +59,7 @@ inline
void
BaseCube<elem_type,derived>::print(std::ostream& user_stream, const std::string extra_text) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const unwrap_cube<derived> tmp( (*this).get_ref() );
@@ -82,7 +82,7 @@ inline
void
BaseCube<elem_type,derived>::raw_print(const std::string extra_text) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const unwrap_cube<derived> tmp( (*this).get_ref() );
@@ -105,7 +105,7 @@ inline
void
BaseCube<elem_type,derived>::raw_print(std::ostream& user_stream, const std::string extra_text) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const unwrap_cube<derived> tmp( (*this).get_ref() );
@@ -128,7 +128,7 @@ inline
void
BaseCube<elem_type,derived>::brief_print(const std::string extra_text) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const unwrap_cube<derived> tmp( (*this).get_ref() );
@@ -151,7 +151,7 @@ inline
void
BaseCube<elem_type,derived>::brief_print(std::ostream& user_stream, const std::string extra_text) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const unwrap_cube<derived> tmp( (*this).get_ref() );
@@ -200,7 +200,7 @@ BaseCube<elem_type,derived>::index_min() const
if(P.get_n_elem() == 0)
{
arma_debug_check(true, "index_min(): object has no elements");
arma_conform_check(true, "index_min(): object has no elements");
}
else
{
@@ -223,7 +223,7 @@ BaseCube<elem_type,derived>::index_max() const
if(P.get_n_elem() == 0)
{
arma_debug_check(true, "index_max(): object has no elements");
arma_conform_check(true, "index_max(): object has no elements");
}
else
{
@@ -240,11 +240,11 @@ inline
bool
BaseCube<elem_type,derived>::is_zero(const typename get_pod_type<elem_type>::result tol) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
typedef typename get_pod_type<elem_type>::result T;
arma_debug_check( (tol < T(0)), "is_zero(): parameter 'tol' must be >= 0" );
arma_conform_check( (tol < T(0)), "is_zero(): parameter 'tol' must be >= 0" );
if(ProxyCube<derived>::use_at || is_Cube<typename ProxyCube<derived>::stored_type>::value)
{
@@ -292,7 +292,7 @@ inline
bool
BaseCube<elem_type,derived>::is_empty() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const ProxyCube<derived> P( (*this).get_ref() );
@@ -306,9 +306,9 @@ inline
bool
BaseCube<elem_type,derived>::is_finite() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "is_finite(): detection of non-finite values is not reliable in fast math mode"); }
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_Cube<typename ProxyCube<derived>::stored_type>::value)
{
@@ -342,9 +342,9 @@ inline
bool
BaseCube<elem_type,derived>::has_inf() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "has_inf(): detection of non-finite values is not reliable in fast math mode"); }
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_Cube<typename ProxyCube<derived>::stored_type>::value)
{
@@ -378,9 +378,9 @@ inline
bool
BaseCube<elem_type,derived>::has_nan() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "has_nan(): detection of non-finite values is not reliable in fast math mode"); }
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_Cube<typename ProxyCube<derived>::stored_type>::value)
{
@@ -414,9 +414,9 @@ inline
bool
BaseCube<elem_type,derived>::has_nonfinite() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "has_nonfinite(): detection of non-finite values is not reliable in fast math mode"); }
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_Cube<typename ProxyCube<derived>::stored_type>::value)
{
@@ -473,7 +473,7 @@ arma_inline
const derived&
BaseCube_eval_Cube<elem_type, derived>::eval() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
return static_cast<const derived&>(*this);
}
@@ -488,7 +488,7 @@ inline
Cube<elem_type>
BaseCube_eval_expr<elem_type, derived>::eval() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
return Cube<elem_type>( static_cast<const derived&>(*this) );
}
+4 -4
View File
@@ -127,11 +127,11 @@ struct Base
arma_warn_unused inline elem_type min() const;
arma_warn_unused inline elem_type max() const;
inline elem_type min(uword& index_of_min_val) const;
inline elem_type max(uword& index_of_max_val) 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;
inline elem_type min(uword& row_of_min_val, uword& col_of_min_val) const;
inline elem_type max(uword& row_of_max_val, uword& col_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;
arma_warn_unused inline uword index_min() const;
arma_warn_unused inline uword index_max() const;
+37 -37
View File
@@ -36,7 +36,7 @@ inline
void
Base<elem_type,derived>::print(const std::string extra_text) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const quasi_unwrap<derived> tmp( (*this).get_ref() );
@@ -59,7 +59,7 @@ inline
void
Base<elem_type,derived>::print(std::ostream& user_stream, const std::string extra_text) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const quasi_unwrap<derived> tmp( (*this).get_ref() );
@@ -82,7 +82,7 @@ inline
void
Base<elem_type,derived>::raw_print(const std::string extra_text) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const quasi_unwrap<derived> tmp( (*this).get_ref() );
@@ -105,7 +105,7 @@ inline
void
Base<elem_type,derived>::raw_print(std::ostream& user_stream, const std::string extra_text) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const quasi_unwrap<derived> tmp( (*this).get_ref() );
@@ -128,7 +128,7 @@ inline
void
Base<elem_type,derived>::brief_print(const std::string extra_text) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const quasi_unwrap<derived> tmp( (*this).get_ref() );
@@ -151,7 +151,7 @@ inline
void
Base<elem_type,derived>::brief_print(std::ostream& user_stream, const std::string extra_text) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const quasi_unwrap<derived> tmp( (*this).get_ref() );
@@ -266,7 +266,7 @@ Base<elem_type,derived>::index_min() const
if(P.get_n_elem() == 0)
{
arma_debug_check(true, "index_min(): object has no elements");
arma_conform_check(true, "index_min(): object has no elements");
}
else
{
@@ -289,7 +289,7 @@ Base<elem_type,derived>::index_max() const
if(P.get_n_elem() == 0)
{
arma_debug_check(true, "index_max(): object has no elements");
arma_conform_check(true, "index_max(): object has no elements");
}
else
{
@@ -306,7 +306,7 @@ inline
bool
Base<elem_type,derived>::is_symmetric() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const quasi_unwrap<derived> U( (*this).get_ref() );
@@ -346,13 +346,13 @@ inline
bool
Base<elem_type,derived>::is_symmetric(const typename get_pod_type<elem_type>::result tol) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
typedef typename get_pod_type<elem_type>::result T;
if(tol == T(0)) { return (*this).is_symmetric(); }
arma_debug_check( (tol < T(0)), "is_symmetric(): parameter 'tol' must be >= 0" );
arma_conform_check( (tol < T(0)), "is_symmetric(): parameter 'tol' must be >= 0" );
const quasi_unwrap<derived> U( (*this).get_ref() );
@@ -377,7 +377,7 @@ inline
bool
Base<elem_type,derived>::is_hermitian() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
typedef typename get_pod_type<elem_type>::result T;
@@ -429,13 +429,13 @@ inline
bool
Base<elem_type,derived>::is_hermitian(const typename get_pod_type<elem_type>::result tol) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
typedef typename get_pod_type<elem_type>::result T;
if(tol == T(0)) { return (*this).is_hermitian(); }
arma_debug_check( (tol < T(0)), "is_hermitian(): parameter 'tol' must be >= 0" );
arma_conform_check( (tol < T(0)), "is_hermitian(): parameter 'tol' must be >= 0" );
const quasi_unwrap<derived> U( (*this).get_ref() );
@@ -460,11 +460,11 @@ inline
bool
Base<elem_type,derived>::is_zero(const typename get_pod_type<elem_type>::result tol) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
typedef typename get_pod_type<elem_type>::result T;
arma_debug_check( (tol < T(0)), "is_zero(): parameter 'tol' must be >= 0" );
arma_conform_check( (tol < T(0)), "is_zero(): parameter 'tol' must be >= 0" );
if(Proxy<derived>::use_at || is_Mat<typename Proxy<derived>::stored_type>::value)
{
@@ -512,7 +512,7 @@ inline
bool
Base<elem_type,derived>::is_trimatu() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const quasi_unwrap<derived> U( (*this).get_ref() );
@@ -530,7 +530,7 @@ inline
bool
Base<elem_type,derived>::is_trimatl() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const quasi_unwrap<derived> U( (*this).get_ref() );
@@ -548,7 +548,7 @@ inline
bool
Base<elem_type,derived>::is_diagmat() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const quasi_unwrap<derived> U( (*this).get_ref() );
@@ -587,7 +587,7 @@ inline
bool
Base<elem_type,derived>::is_empty() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const Proxy<derived> P( (*this).get_ref() );
@@ -601,7 +601,7 @@ inline
bool
Base<elem_type,derived>::is_square() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const Proxy<derived> P( (*this).get_ref() );
@@ -615,7 +615,7 @@ inline
bool
Base<elem_type,derived>::is_vec() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if( (Proxy<derived>::is_row) || (Proxy<derived>::is_col) || (Proxy<derived>::is_xvec) ) { return true; }
@@ -631,7 +631,7 @@ inline
bool
Base<elem_type,derived>::is_colvec() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if(Proxy<derived>::is_col) { return true; }
@@ -647,7 +647,7 @@ inline
bool
Base<elem_type,derived>::is_rowvec() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if(Proxy<derived>::is_row) { return true; }
@@ -663,9 +663,9 @@ inline
bool
Base<elem_type,derived>::is_finite() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "is_finite(): detection of non-finite values is not reliable in fast math mode"); }
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)
{
@@ -711,9 +711,9 @@ inline
bool
Base<elem_type,derived>::has_inf() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "has_inf(): detection of non-finite values is not reliable in fast math mode"); }
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)
{
@@ -759,9 +759,9 @@ inline
bool
Base<elem_type,derived>::has_nan() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "has_nan(): detection of non-finite values is not reliable in fast math mode"); }
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)
{
@@ -807,9 +807,9 @@ inline
bool
Base<elem_type,derived>::has_nonfinite() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "has_nonfinite(): detection of non-finite values is not reliable in fast math mode"); }
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)
{
@@ -888,7 +888,7 @@ inline
bool
Base_extra_yes<elem_type,derived>::is_sympd() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
typedef typename get_pod_type<elem_type>::result T;
@@ -913,11 +913,11 @@ inline
bool
Base_extra_yes<elem_type,derived>::is_sympd(typename get_pod_type<elem_type>::result tol) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
typedef typename get_pod_type<elem_type>::result T;
arma_debug_check( (tol < T(0)), "is_sympd(): parameter 'tol' must be >= 0" );
arma_conform_check( (tol < T(0)), "is_sympd(): parameter 'tol' must be >= 0" );
Mat<elem_type> X = static_cast<const derived&>(*this);
@@ -940,7 +940,7 @@ arma_inline
const derived&
Base_eval_Mat<elem_type, derived>::eval() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
return static_cast<const derived&>(*this);
}
@@ -955,7 +955,7 @@ inline
Mat<elem_type>
Base_eval_expr<elem_type, derived>::eval() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
return Mat<elem_type>( static_cast<const derived&>(*this) );
}
+2
View File
@@ -187,6 +187,8 @@ class Col<eT>::fixed : public Col<eT>
{
private:
using Mat<eT>::mem_local;
static constexpr bool use_extra = (fixed_n_elem > arma_config::mat_prealloc);
arma_align_mem eT mem_local_extra[ (use_extra) ? fixed_n_elem : 1 ];
File diff suppressed because it is too large Load Diff
+5 -2
View File
@@ -33,8 +33,11 @@ class CubeToMatOp : public Base< typename T1::elem_type, CubeToMatOp<T1, op_type
inline CubeToMatOp(const T1& in_m, const uword in_aux_uword);
inline ~CubeToMatOp();
arma_aligned const T1& m; //!< the operand; must be derived from BaseCube
arma_aligned uword aux_uword; //!< auxiliary data, uword format
const T1& m; //!< the operand; must be derived from BaseCube
uword aux_uword; //!< auxiliary data, uword format
template<typename eT2>
constexpr bool is_alias(const Mat<eT2>&) const { return false; }
static constexpr bool is_row = op_type::template traits<T1>::is_row;
static constexpr bool is_col = op_type::template traits<T1>::is_col;
+3 -3
View File
@@ -26,7 +26,7 @@ inline
CubeToMatOp<T1, op_type>::CubeToMatOp(const T1& in_m)
: m(in_m)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -37,7 +37,7 @@ CubeToMatOp<T1, op_type>::CubeToMatOp(const T1& in_m, const uword in_aux_uword)
: m(in_m)
, aux_uword(in_aux_uword)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -46,7 +46,7 @@ template<typename T1, typename op_type>
inline
CubeToMatOp<T1, op_type>::~CubeToMatOp()
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
+9 -7
View File
@@ -62,7 +62,7 @@ class Cube : public BaseCube< eT, Cube<eT> >
#if defined(ARMA_USE_OPENMP)
using raw_mat_ptr_type = mat_type*;
using atomic_mat_ptr_type = mat_type*;
#elif (!defined(ARMA_DONT_USE_STD_MUTEX))
#elif defined(ARMA_USE_STD_MUTEX)
using raw_mat_ptr_type = mat_type*;
using atomic_mat_ptr_type = std::atomic<mat_type*>;
#else
@@ -72,7 +72,7 @@ class Cube : public BaseCube< eT, Cube<eT> >
atomic_mat_ptr_type* mat_ptrs = nullptr;
#if (!defined(ARMA_DONT_USE_STD_MUTEX))
#if defined(ARMA_USE_STD_MUTEX)
mutable std::mutex mat_mutex; // required for slice()
#endif
@@ -387,12 +387,11 @@ class Cube : public BaseCube< eT, Cube<eT> >
arma_warn_unused inline eT min() const;
arma_warn_unused inline eT max() const;
inline eT min(uword& index_of_min_val) const;
inline eT max(uword& index_of_max_val) const;
inline eT min(uword& row_of_min_val, uword& col_of_min_val, uword& slice_of_min_val) const;
inline eT max(uword& row_of_max_val, uword& col_of_max_val, uword& slice_of_max_val) 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;
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;
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;
@@ -486,6 +485,9 @@ class Cube<eT>::fixed : public Cube<eT>
{
private:
using Cube<eT>::mat_ptrs_local;
using Cube<eT>::mem_local;
static constexpr uword fixed_n_elem = fixed_n_rows * fixed_n_cols * fixed_n_slices;
static constexpr uword fixed_n_elem_slice = fixed_n_rows * fixed_n_cols;
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -33,9 +33,9 @@ class GenCube
static constexpr bool use_at = false;
static constexpr bool is_simple = (is_same_type<gen_type, gen_ones>::value) || (is_same_type<gen_type, gen_zeros>::value);
arma_aligned const uword n_rows;
arma_aligned const uword n_cols;
arma_aligned const uword n_slices;
const uword n_rows;
const uword n_cols;
const uword n_slices;
arma_inline GenCube(const uword in_n_rows, const uword in_n_cols, const uword in_n_slices);
arma_inline ~GenCube();
+13 -13
View File
@@ -28,7 +28,7 @@ GenCube<eT, gen_type>::GenCube(const uword in_n_rows, const uword in_n_cols, con
, n_cols (in_n_cols )
, n_slices(in_n_slices)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -37,7 +37,7 @@ template<typename eT, typename gen_type>
arma_inline
GenCube<eT, gen_type>::~GenCube()
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -86,10 +86,10 @@ inline
void
GenCube<eT, gen_type>::apply(Cube<eT>& out) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
// NOTE: we're assuming that the cube has already been set to the correct size;
// this is done by either the Cube contructor or operator=()
// this is done by either the Cube constructor or operator=()
if(is_same_type<gen_type, gen_zeros>::yes) { out.zeros(); }
else if(is_same_type<gen_type, gen_ones >::yes) { out.ones(); }
@@ -102,9 +102,9 @@ inline
void
GenCube<eT, gen_type>::apply_inplace_plus(Cube<eT>& out) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_debug_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "addition");
arma_conform_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "addition");
if(is_same_type<gen_type, gen_ones>::yes)
{
@@ -120,9 +120,9 @@ inline
void
GenCube<eT, gen_type>::apply_inplace_minus(Cube<eT>& out) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_debug_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "subtraction");
arma_conform_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "subtraction");
if(is_same_type<gen_type, gen_ones>::yes)
{
@@ -138,9 +138,9 @@ inline
void
GenCube<eT, gen_type>::apply_inplace_schur(Cube<eT>& out) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_debug_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "element-wise multiplication");
arma_conform_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "element-wise multiplication");
if(is_same_type<gen_type, gen_zeros>::yes)
{
@@ -157,9 +157,9 @@ inline
void
GenCube<eT, gen_type>::apply_inplace_div(Cube<eT>& out) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_debug_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "element-wise division");
arma_conform_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "element-wise division");
if(is_same_type<gen_type, gen_zeros>::yes)
{
@@ -174,7 +174,7 @@ inline
void
GenCube<eT, gen_type>::apply(subview_cube<eT>& out) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
// NOTE: we're assuming that the subcube has the same dimensions as the GenCube object
// this is checked by subview_cube::operator=()
+5 -2
View File
@@ -37,8 +37,8 @@ class Gen
static constexpr bool is_col = T1::is_col;
static constexpr bool is_xvec = T1::is_xvec;
arma_aligned const uword n_rows;
arma_aligned const uword n_cols;
const uword n_rows;
const uword n_cols;
arma_inline Gen(const uword in_n_rows, const uword in_n_cols);
arma_inline ~Gen();
@@ -54,6 +54,9 @@ class Gen
inline void apply_inplace_div (Mat<elem_type>& out) const;
inline void apply(subview<elem_type>& out) const;
template<typename eT2>
constexpr bool is_alias(const Mat<eT2>&) const { return false; }
};
+13 -13
View File
@@ -27,7 +27,7 @@ Gen<T1, gen_type>::Gen(const uword in_n_rows, const uword in_n_cols)
: n_rows(in_n_rows)
, n_cols(in_n_cols)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -36,7 +36,7 @@ template<typename T1, typename gen_type>
arma_inline
Gen<T1, gen_type>::~Gen()
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -88,10 +88,10 @@ inline
void
Gen<T1, gen_type>::apply(Mat<typename T1::elem_type>& out) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
// NOTE: we're assuming that the matrix has already been set to the correct size;
// this is done by either the Mat contructor or operator=()
// this is done by either the Mat constructor or operator=()
if(is_same_type<gen_type, gen_zeros>::yes) { out.zeros(); }
else if(is_same_type<gen_type, gen_ones >::yes) { out.ones(); }
@@ -105,9 +105,9 @@ inline
void
Gen<T1, gen_type>::apply_inplace_plus(Mat<typename T1::elem_type>& out) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_debug_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "addition");
arma_conform_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "addition");
typedef typename T1::elem_type eT;
@@ -132,9 +132,9 @@ inline
void
Gen<T1, gen_type>::apply_inplace_minus(Mat<typename T1::elem_type>& out) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_debug_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "subtraction");
arma_conform_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "subtraction");
typedef typename T1::elem_type eT;
@@ -159,9 +159,9 @@ inline
void
Gen<T1, gen_type>::apply_inplace_schur(Mat<typename T1::elem_type>& out) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_debug_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "element-wise multiplication");
arma_conform_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "element-wise multiplication");
typedef typename T1::elem_type eT;
@@ -189,9 +189,9 @@ inline
void
Gen<T1, gen_type>::apply_inplace_div(Mat<typename T1::elem_type>& out) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_debug_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "element-wise division");
arma_conform_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "element-wise division");
typedef typename T1::elem_type eT;
@@ -217,7 +217,7 @@ inline
void
Gen<T1, gen_type>::apply(subview<typename T1::elem_type>& out) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
// NOTE: we're assuming that the submatrix has the same dimensions as the Gen object
// this is checked by subview::operator=()
+2 -2
View File
@@ -27,7 +27,7 @@ GlueCube<T1,T2,glue_type>::GlueCube(const BaseCube<typename T1::elem_type, T1>&
: A(in_A.get_ref())
, B(in_B.get_ref())
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -36,7 +36,7 @@ template<typename T1, typename T2, typename glue_type>
inline
GlueCube<T1,T2,glue_type>::~GlueCube()
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
+3
View File
@@ -56,6 +56,9 @@ class Glue
inline Glue(const T1& in_A, const T2& in_B, const uword in_aux_uword);
inline ~Glue();
template<typename eT2>
inline bool is_alias(const Mat<eT2>& X) const;
const T1& A; //!< first operand; must be derived from Base
const T2& B; //!< second operand; must be derived from Base
uword aux_uword; //!< storage of auxiliary data, uword format
+16 -3
View File
@@ -27,7 +27,7 @@ Glue<T1,T2,glue_type>::Glue(const T1& in_A, const T2& in_B)
: A(in_A)
, B(in_B)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -39,7 +39,7 @@ Glue<T1,T2,glue_type>::Glue(const T1& in_A, const T2& in_B, const uword in_aux_u
, B(in_B)
, aux_uword(in_aux_uword)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -48,7 +48,20 @@ template<typename T1, typename T2, typename glue_type>
inline
Glue<T1,T2,glue_type>::~Glue()
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
template<typename T1, typename T2, typename glue_type>
template<typename eT2>
inline
bool
Glue<T1,T2,glue_type>::is_alias(const Mat<eT2>& X) const
{
arma_debug_sigprint();
return (A.is_alias(X) || B.is_alias(X));
}
+119 -137
View File
@@ -25,12 +25,12 @@ template<typename eT>
inline
MapMat<eT>::~MapMat()
{
arma_extra_debug_sigprint_this(this);
arma_debug_sigprint_this(this);
if(map_ptr) { (*map_ptr).clear(); delete map_ptr; }
// try to expose buggy user code that accesses deleted objects
if(arma_config::debug) { map_ptr = nullptr; }
map_ptr = nullptr;
arma_type_check(( is_supported_elem_type<eT>::value == false ));
}
@@ -45,7 +45,7 @@ MapMat<eT>::MapMat()
, n_elem (0)
, map_ptr(nullptr)
{
arma_extra_debug_sigprint_this(this);
arma_debug_sigprint_this(this);
init_cold();
}
@@ -60,7 +60,7 @@ MapMat<eT>::MapMat(const uword in_n_rows, const uword in_n_cols)
, n_elem (in_n_rows * in_n_cols)
, map_ptr(nullptr)
{
arma_extra_debug_sigprint_this(this);
arma_debug_sigprint_this(this);
init_cold();
}
@@ -75,7 +75,7 @@ MapMat<eT>::MapMat(const SizeMat& s)
, n_elem (s.n_rows * s.n_cols)
, map_ptr(nullptr)
{
arma_extra_debug_sigprint_this(this);
arma_debug_sigprint_this(this);
init_cold();
}
@@ -90,7 +90,7 @@ MapMat<eT>::MapMat(const MapMat<eT>& x)
, n_elem (0)
, map_ptr(nullptr)
{
arma_extra_debug_sigprint_this(this);
arma_debug_sigprint_this(this);
init_cold();
@@ -104,7 +104,7 @@ inline
void
MapMat<eT>::operator=(const MapMat<eT>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if(this == &x) { return; }
@@ -125,7 +125,7 @@ MapMat<eT>::MapMat(const SpMat<eT>& x)
, n_elem (0)
, map_ptr(nullptr)
{
arma_extra_debug_sigprint_this(this);
arma_debug_sigprint_this(this);
init_cold();
@@ -139,7 +139,7 @@ inline
void
MapMat<eT>::operator=(const SpMat<eT>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const uword x_n_rows = x.n_rows;
const uword x_n_cols = x.n_cols;
@@ -181,7 +181,7 @@ MapMat<eT>::MapMat(MapMat<eT>&& x)
, n_elem (x.n_elem )
, map_ptr(x.map_ptr)
{
arma_extra_debug_sigprint_this(this);
arma_debug_sigprint_this(this);
access::rw(x.n_rows) = 0;
access::rw(x.n_cols) = 0;
@@ -196,7 +196,7 @@ inline
void
MapMat<eT>::operator=(MapMat<eT>&& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if(this == &x) { return; }
@@ -222,7 +222,7 @@ inline
void
MapMat<eT>::reset()
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
access::rw(n_rows) = 0;
access::rw(n_cols) = 0;
@@ -238,7 +238,7 @@ inline
void
MapMat<eT>::set_size(const uword in_n_rows)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
init_warm(in_n_rows, 1);
}
@@ -250,7 +250,7 @@ inline
void
MapMat<eT>::set_size(const uword in_n_rows, const uword in_n_cols)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
init_warm(in_n_rows, in_n_cols);
}
@@ -262,7 +262,7 @@ inline
void
MapMat<eT>::set_size(const SizeMat& s)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
init_warm(s.n_rows, s.n_cols);
}
@@ -274,7 +274,7 @@ inline
void
MapMat<eT>::zeros()
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
(*map_ptr).clear();
}
@@ -286,7 +286,7 @@ inline
void
MapMat<eT>::zeros(const uword in_n_rows)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
init_warm(in_n_rows, 1);
@@ -300,7 +300,7 @@ inline
void
MapMat<eT>::zeros(const uword in_n_rows, const uword in_n_cols)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
init_warm(in_n_rows, in_n_cols);
@@ -314,7 +314,7 @@ inline
void
MapMat<eT>::zeros(const SizeMat& s)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
init_warm(s.n_rows, s.n_cols);
@@ -328,7 +328,7 @@ inline
void
MapMat<eT>::eye()
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
(*this).eye(n_rows, n_cols);
}
@@ -340,7 +340,7 @@ inline
void
MapMat<eT>::eye(const uword in_n_rows, const uword in_n_cols)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
zeros(in_n_rows, in_n_cols);
@@ -363,7 +363,7 @@ inline
void
MapMat<eT>::eye(const SizeMat& s)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
(*this).eye(s.n_rows, s.n_cols);
}
@@ -375,7 +375,7 @@ inline
void
MapMat<eT>::speye()
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
(*this).eye();
}
@@ -387,7 +387,7 @@ inline
void
MapMat<eT>::speye(const uword in_n_rows, const uword in_n_cols)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
(*this).eye(in_n_rows, in_n_cols);
}
@@ -399,7 +399,7 @@ inline
void
MapMat<eT>::speye(const SizeMat& s)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
(*this).eye(s);
}
@@ -436,7 +436,7 @@ arma_inline
MapMat_val<eT>
MapMat<eT>::operator()(const uword index)
{
arma_debug_check_bounds( (index >= n_elem), "MapMat::operator(): index out of bounds" );
arma_conform_check_bounds( (index >= n_elem), "MapMat::operator(): index out of bounds" );
return MapMat_val<eT>(*this, index);
}
@@ -448,7 +448,7 @@ inline
eT
MapMat<eT>::operator()(const uword index) const
{
arma_debug_check_bounds( (index >= n_elem), "MapMat::operator(): index out of bounds" );
arma_conform_check_bounds( (index >= n_elem), "MapMat::operator(): index out of bounds" );
map_type& map_ref = (*map_ptr);
@@ -494,7 +494,7 @@ arma_inline
MapMat_val<eT>
MapMat<eT>::operator()(const uword in_row, const uword in_col)
{
arma_debug_check_bounds( ((in_row >= n_rows) || (in_col >= n_cols)), "MapMat::operator(): index out of bounds" );
arma_conform_check_bounds( ((in_row >= n_rows) || (in_col >= n_cols)), "MapMat::operator(): index out of bounds" );
const uword index = (n_rows * in_col) + in_row;
@@ -508,7 +508,7 @@ inline
eT
MapMat<eT>::operator()(const uword in_row, const uword in_col) const
{
arma_debug_check_bounds( ((in_row >= n_rows) || (in_col >= n_cols)), "MapMat::operator(): index out of bounds" );
arma_conform_check_bounds( ((in_row >= n_rows) || (in_col >= n_cols)), "MapMat::operator(): index out of bounds" );
const uword index = (n_rows * in_col) + in_row;
@@ -579,7 +579,7 @@ inline
void
MapMat<eT>::sprandu(const uword in_n_rows, const uword in_n_cols, const double density)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
zeros(in_n_rows, in_n_cols);
@@ -610,7 +610,7 @@ inline
void
MapMat<eT>::print(const std::string& extra_text) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if(extra_text.length() != 0)
{
@@ -662,7 +662,7 @@ inline
uword
MapMat<eT>::get_n_nonzero() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
return uword((*map_ptr).size());
}
@@ -674,7 +674,7 @@ inline
void
MapMat<eT>::get_locval_format(umat& locs, Col<eT>& vals) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
map_type& map_ref = (*map_ptr);
@@ -715,7 +715,7 @@ inline
void
MapMat<eT>::init_cold()
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
// ensure that n_elem can hold the result of (n_rows * n_cols)
@@ -725,7 +725,7 @@ MapMat<eT>::init_cold()
const char* error_message = "MapMat(): requested size is too large; suggest to enable ARMA_64BIT_WORD";
#endif
arma_debug_check
arma_conform_check
(
(
( (n_rows > ARMA_MAX_UHWORD) || (n_cols > ARMA_MAX_UHWORD) )
@@ -747,7 +747,7 @@ inline
void
MapMat<eT>::init_warm(const uword in_n_rows, const uword in_n_cols)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if( (n_rows == in_n_rows) && (n_cols == in_n_cols)) { return; }
@@ -759,7 +759,7 @@ MapMat<eT>::init_warm(const uword in_n_rows, const uword in_n_cols)
const char* error_message = "MapMat(): requested size is too large; suggest to enable ARMA_64BIT_WORD";
#endif
arma_debug_check
arma_conform_check
(
(
( (in_n_rows > ARMA_MAX_UHWORD) || (in_n_cols > ARMA_MAX_UHWORD) )
@@ -785,7 +785,7 @@ arma_inline
void
MapMat<eT>::set_val(const uword index, const eT& in_val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if(in_val != eT(0))
{
@@ -813,7 +813,7 @@ inline
void
MapMat<eT>::erase_val(const uword index)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
map_type& map_ref = (*map_ptr);
@@ -838,7 +838,7 @@ MapMat_val<eT>::MapMat_val(MapMat<eT>& in_parent, const uword in_index)
: parent(in_parent)
, index (in_index )
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -847,7 +847,7 @@ template<typename eT>
arma_inline
MapMat_val<eT>::operator eT() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const MapMat<eT>& const_parent = parent;
@@ -861,7 +861,7 @@ arma_inline
typename get_pod_type<eT>::result
MapMat_val<eT>::real() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
typedef typename get_pod_type<eT>::result T;
@@ -877,7 +877,7 @@ arma_inline
typename get_pod_type<eT>::result
MapMat_val<eT>::imag() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
typedef typename get_pod_type<eT>::result T;
@@ -893,7 +893,7 @@ arma_inline
void
MapMat_val<eT>::operator=(const MapMat_val<eT>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const eT in_val = eT(x);
@@ -907,7 +907,7 @@ arma_inline
void
MapMat_val<eT>::operator=(const eT in_val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
parent.set_val(index, in_val);
}
@@ -919,7 +919,7 @@ arma_inline
void
MapMat_val<eT>::operator+=(const eT in_val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
typename MapMat<eT>::map_type& map_ref = *(parent.map_ptr);
@@ -940,7 +940,7 @@ arma_inline
void
MapMat_val<eT>::operator-=(const eT in_val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
typename MapMat<eT>::map_type& map_ref = *(parent.map_ptr);
@@ -961,7 +961,7 @@ arma_inline
void
MapMat_val<eT>::operator*=(const eT in_val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
typename MapMat<eT>::map_type& map_ref = *(parent.map_ptr);
@@ -970,18 +970,17 @@ MapMat_val<eT>::operator*=(const eT in_val)
if(it != it_end)
{
if(in_val != eT(0))
{
eT& val = (*it).second;
val *= in_val;
if(val == eT(0)) { map_ref.erase(it); }
}
else
{
map_ref.erase(it);
}
eT& val = (*it).second;
val *= in_val;
if(val == eT(0)) { map_ref.erase(it); }
}
else
{
const eT val = eT(0) * in_val; // in case in_val is inf or nan
if(val != eT(0)) { parent.set_val(index, val); }
}
}
@@ -992,7 +991,7 @@ arma_inline
void
MapMat_val<eT>::operator/=(const eT in_val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
typename MapMat<eT>::map_type& map_ref = *(parent.map_ptr);
@@ -1009,9 +1008,7 @@ MapMat_val<eT>::operator/=(const eT in_val)
}
else
{
// silly operation, but included for completness
const eT val = eT(0) / in_val;
const eT val = eT(0) / in_val; // in case in_val is zero or nan
if(val != eT(0)) { parent.set_val(index, val); }
}
@@ -1024,7 +1021,7 @@ arma_inline
void
MapMat_val<eT>::operator++()
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
typename MapMat<eT>::map_type& map_ref = *(parent.map_ptr);
@@ -1042,7 +1039,7 @@ arma_inline
void
MapMat_val<eT>::operator++(int)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
(*this).operator++();
}
@@ -1054,7 +1051,7 @@ arma_inline
void
MapMat_val<eT>::operator--()
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
typename MapMat<eT>::map_type& map_ref = *(parent.map_ptr);
@@ -1072,7 +1069,7 @@ arma_inline
void
MapMat_val<eT>::operator--(int)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
(*this).operator--();
}
@@ -1093,7 +1090,7 @@ SpMat_MapMat_val<eT>::SpMat_MapMat_val(SpMat<eT>& in_s_parent, MapMat<eT>& in_m_
, row (in_row )
, col (in_col )
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -1102,7 +1099,7 @@ template<typename eT>
inline
SpMat_MapMat_val<eT>::operator eT() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const SpMat<eT>& const_s_parent = s_parent; // declare as const for clarity of intent
@@ -1116,7 +1113,7 @@ inline
typename get_pod_type<eT>::result
SpMat_MapMat_val<eT>::real() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
typedef typename get_pod_type<eT>::result T;
@@ -1132,7 +1129,7 @@ inline
typename get_pod_type<eT>::result
SpMat_MapMat_val<eT>::imag() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
typedef typename get_pod_type<eT>::result T;
@@ -1148,7 +1145,7 @@ inline
SpMat_MapMat_val<eT>&
SpMat_MapMat_val<eT>::operator=(const SpMat_MapMat_val<eT>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const eT in_val = eT(x);
@@ -1162,7 +1159,7 @@ inline
SpMat_MapMat_val<eT>&
SpMat_MapMat_val<eT>::operator=(const eT in_val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
#if defined(ARMA_USE_OPENMP)
{
@@ -1171,7 +1168,7 @@ SpMat_MapMat_val<eT>::operator=(const eT in_val)
(*this).set(in_val);
}
}
#elif (!defined(ARMA_DONT_USE_STD_MUTEX))
#elif defined(ARMA_USE_STD_MUTEX)
{
const std::lock_guard<std::mutex> lock(s_parent.cache_mutex);
@@ -1193,7 +1190,7 @@ inline
SpMat_MapMat_val<eT>&
SpMat_MapMat_val<eT>::operator+=(const eT in_val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if(in_val == eT(0)) { return *this; }
@@ -1204,7 +1201,7 @@ SpMat_MapMat_val<eT>::operator+=(const eT in_val)
(*this).add(in_val);
}
}
#elif (!defined(ARMA_DONT_USE_STD_MUTEX))
#elif defined(ARMA_USE_STD_MUTEX)
{
const std::lock_guard<std::mutex> lock(s_parent.cache_mutex);
@@ -1226,7 +1223,7 @@ inline
SpMat_MapMat_val<eT>&
SpMat_MapMat_val<eT>::operator-=(const eT in_val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if(in_val == eT(0)) { return *this; }
@@ -1237,7 +1234,7 @@ SpMat_MapMat_val<eT>::operator-=(const eT in_val)
(*this).sub(in_val);
}
}
#elif (!defined(ARMA_DONT_USE_STD_MUTEX))
#elif defined(ARMA_USE_STD_MUTEX)
{
const std::lock_guard<std::mutex> lock(s_parent.cache_mutex);
@@ -1259,7 +1256,7 @@ inline
SpMat_MapMat_val<eT>&
SpMat_MapMat_val<eT>::operator*=(const eT in_val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
#if defined(ARMA_USE_OPENMP)
{
@@ -1268,7 +1265,7 @@ SpMat_MapMat_val<eT>::operator*=(const eT in_val)
(*this).mul(in_val);
}
}
#elif (!defined(ARMA_DONT_USE_STD_MUTEX))
#elif defined(ARMA_USE_STD_MUTEX)
{
const std::lock_guard<std::mutex> lock(s_parent.cache_mutex);
@@ -1290,7 +1287,7 @@ inline
SpMat_MapMat_val<eT>&
SpMat_MapMat_val<eT>::operator/=(const eT in_val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
#if defined(ARMA_USE_OPENMP)
{
@@ -1299,7 +1296,7 @@ SpMat_MapMat_val<eT>::operator/=(const eT in_val)
(*this).div(in_val);
}
}
#elif (!defined(ARMA_DONT_USE_STD_MUTEX))
#elif defined(ARMA_USE_STD_MUTEX)
{
const std::lock_guard<std::mutex> lock(s_parent.cache_mutex);
@@ -1321,7 +1318,7 @@ inline
SpMat_MapMat_val<eT>&
SpMat_MapMat_val<eT>::operator++()
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
return (*this).operator+=( eT(1) );
}
@@ -1333,7 +1330,7 @@ inline
eT
SpMat_MapMat_val<eT>::operator++(int)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const eT old_val = eT(*this);
@@ -1349,7 +1346,7 @@ inline
SpMat_MapMat_val<eT>&
SpMat_MapMat_val<eT>::operator--()
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
return (*this).operator-=( eT(1) );
}
@@ -1361,7 +1358,7 @@ inline
eT
SpMat_MapMat_val<eT>::operator--(int)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const eT old_val = eT(*this);
@@ -1377,7 +1374,7 @@ inline
void
SpMat_MapMat_val<eT>::set(const eT in_val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const bool done = (s_parent.sync_state == 0) ? s_parent.try_set_value_csc(row, col, in_val) : false;
@@ -1402,7 +1399,7 @@ inline
void
SpMat_MapMat_val<eT>::add(const eT in_val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const bool done = (s_parent.sync_state == 0) ? s_parent.try_add_value_csc(row, col, in_val) : false;
@@ -1433,7 +1430,7 @@ inline
void
SpMat_MapMat_val<eT>::sub(const eT in_val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const bool done = (s_parent.sync_state == 0) ? s_parent.try_sub_value_csc(row, col, in_val) : false;
@@ -1464,7 +1461,7 @@ inline
void
SpMat_MapMat_val<eT>::mul(const eT in_val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const bool done = (s_parent.sync_state == 0) ? s_parent.try_mul_value_csc(row, col, in_val) : false;
@@ -1481,18 +1478,11 @@ SpMat_MapMat_val<eT>::mul(const eT in_val)
if(it != it_end)
{
if(in_val != eT(0))
{
eT& val = (*it).second;
val *= in_val;
if(val == eT(0)) { map_ref.erase(it); }
}
else
{
map_ref.erase(it);
}
eT& val = (*it).second;
val *= in_val;
if(val == eT(0)) { map_ref.erase(it); }
s_parent.sync_state = 1;
@@ -1500,19 +1490,15 @@ SpMat_MapMat_val<eT>::mul(const eT in_val)
}
else
{
// element not found, ie. it's zero; zero multiplied by anything is zero, except for nan and inf
if(arma_isfinite(in_val) == false)
const eT result = eT(0) * in_val; // in case in_val is inf or nan
if(result != eT(0))
{
const eT result = eT(0) * in_val;
m_parent.set_val(index, result);
if(result != eT(0)) // paranoia, in case compiling with -ffast-math
{
m_parent.set_val(index, result);
s_parent.sync_state = 1;
access::rw(s_parent.n_nonzero) = m_parent.get_n_nonzero();
}
s_parent.sync_state = 1;
access::rw(s_parent.n_nonzero) = m_parent.get_n_nonzero();
}
}
}
@@ -1525,7 +1511,7 @@ inline
void
SpMat_MapMat_val<eT>::div(const eT in_val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const bool done = (s_parent.sync_state == 0) ? s_parent.try_div_value_csc(row, col, in_val) : false;
@@ -1554,19 +1540,15 @@ SpMat_MapMat_val<eT>::div(const eT in_val)
}
else
{
// element not found, ie. it's zero; zero divided by anything is zero, except for zero and nan
if( (in_val == eT(0)) || (arma_isnan(in_val)) )
const eT result = eT(0) / in_val; // in case in_val is zero or nan
if(result != eT(0))
{
const eT result = eT(0) / in_val;
m_parent.set_val(index, result);
if(result != eT(0)) // paranoia, in case compiling with -ffast-math
{
m_parent.set_val(index, result);
s_parent.sync_state = 1;
access::rw(s_parent.n_nonzero) = m_parent.get_n_nonzero();
}
s_parent.sync_state = 1;
access::rw(s_parent.n_nonzero) = m_parent.get_n_nonzero();
}
}
}
@@ -1585,7 +1567,7 @@ SpSubview_MapMat_val<eT>::SpSubview_MapMat_val(SpSubview<eT>& in_sv_parent, MapM
: SpMat_MapMat_val<eT>(access::rw(in_sv_parent.m), in_m_parent, in_row, in_col)
, sv_parent(in_sv_parent)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -1595,7 +1577,7 @@ inline
SpSubview_MapMat_val<eT>&
SpSubview_MapMat_val<eT>::operator=(const SpSubview_MapMat_val<eT>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const eT in_val = eT(x);
@@ -1609,7 +1591,7 @@ inline
SpSubview_MapMat_val<eT>&
SpSubview_MapMat_val<eT>::operator=(const eT in_val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const uword old_n_nonzero = sv_parent.m.n_nonzero;
@@ -1628,7 +1610,7 @@ inline
SpSubview_MapMat_val<eT>&
SpSubview_MapMat_val<eT>::operator+=(const eT in_val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const uword old_n_nonzero = sv_parent.m.n_nonzero;
@@ -1647,7 +1629,7 @@ inline
SpSubview_MapMat_val<eT>&
SpSubview_MapMat_val<eT>::operator-=(const eT in_val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const uword old_n_nonzero = sv_parent.m.n_nonzero;
@@ -1666,7 +1648,7 @@ inline
SpSubview_MapMat_val<eT>&
SpSubview_MapMat_val<eT>::operator*=(const eT in_val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const uword old_n_nonzero = sv_parent.m.n_nonzero;
@@ -1685,7 +1667,7 @@ inline
SpSubview_MapMat_val<eT>&
SpSubview_MapMat_val<eT>::operator/=(const eT in_val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const uword old_n_nonzero = sv_parent.m.n_nonzero;
@@ -1704,7 +1686,7 @@ inline
SpSubview_MapMat_val<eT>&
SpSubview_MapMat_val<eT>::operator++()
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const uword old_n_nonzero = sv_parent.m.n_nonzero;
@@ -1723,7 +1705,7 @@ inline
eT
SpSubview_MapMat_val<eT>::operator++(int)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const uword old_n_nonzero = sv_parent.m.n_nonzero;
@@ -1742,7 +1724,7 @@ inline
SpSubview_MapMat_val<eT>&
SpSubview_MapMat_val<eT>::operator--()
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const uword old_n_nonzero = sv_parent.m.n_nonzero;
@@ -1761,7 +1743,7 @@ inline
eT
SpSubview_MapMat_val<eT>::operator--(int)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const uword old_n_nonzero = sv_parent.m.n_nonzero;
+30 -15
View File
@@ -178,6 +178,8 @@ class Mat : public Base< eT, Mat<eT> >
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);
inline Mat& operator= (const spdiagview<eT>& X);
@@ -308,8 +310,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_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 col_num, const uword N, const bool set_to_zero);
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);
inline void insert_rows(const uword row_num, const uword N);
inline void insert_cols(const uword col_num, const uword N);
@@ -366,6 +368,14 @@ 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);
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 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 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);
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);
@@ -475,7 +485,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_deprecated 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
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
template<typename functor> inline Mat& for_each(functor F);
@@ -531,11 +541,11 @@ class Mat : public Base< eT, Mat<eT> >
arma_warn_unused inline eT min() const;
arma_warn_unused inline eT max() const;
inline eT min(uword& index_of_min_val) const;
inline eT max(uword& index_of_max_val) 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;
inline eT min(uword& row_of_min_val, uword& col_of_min_val) const;
inline eT max(uword& row_of_max_val, uword& col_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;
arma_cold inline bool save(const std::string name, const file_type type = arma_binary) const;
@@ -548,15 +558,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_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(const csv_name& spec, const file_type type = csv_ascii) const;
arma_deprecated inline bool quiet_save( std::ostream& os, const file_type type = arma_binary) const;
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;
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(const csv_name& spec, const file_type type = csv_ascii);
arma_deprecated inline bool quiet_load( std::istream& is, const file_type type = auto_detect);
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);
// for container-like functionality
@@ -761,6 +771,9 @@ class Mat : public Base< eT, Mat<eT> >
inline void steal_mem_col(Mat& X, const uword max_n_rows);
template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& X) const; //!< don't use this unless you're writing code internal to Armadillo
template<uword fixed_n_rows, uword fixed_n_cols> class fixed;
@@ -812,6 +825,8 @@ class Mat<eT>::fixed : public Mat<eT>
{
private:
using Mat<eT>::mem_local;
static constexpr uword fixed_n_elem = fixed_n_rows * fixed_n_cols;
static constexpr bool use_extra = (fixed_n_elem > arma_config::mat_prealloc);
File diff suppressed because it is too large Load Diff
+5 -5
View File
@@ -35,11 +35,11 @@ class OpCube : public BaseCube< typename T1::elem_type, OpCube<T1, op_type> >
inline OpCube(const BaseCube<typename T1::elem_type, T1>& in_m, const uword in_aux_uword_a, const uword in_aux_uword_b, const uword in_aux_uword_c);
inline ~OpCube();
arma_aligned const T1& m; //!< the operand; must be derived from BaseCube
arma_aligned elem_type aux; //!< auxiliary data, using the element type as used by T1
arma_aligned uword aux_uword_a; //!< auxiliary data, uword format
arma_aligned uword aux_uword_b; //!< auxiliary data, uword format
arma_aligned uword aux_uword_c; //!< auxiliary data, uword format
const T1& m; //!< the operand; must be derived from BaseCube
elem_type aux; //!< auxiliary data, using the element type as used by T1
uword aux_uword_a; //!< auxiliary data, uword format
uword aux_uword_b; //!< auxiliary data, uword format
uword aux_uword_c; //!< auxiliary data, uword format
};
+6 -6
View File
@@ -25,7 +25,7 @@ template<typename T1, typename op_type>
OpCube<T1, op_type>::OpCube(const BaseCube<typename T1::elem_type, T1>& in_m)
: m(in_m.get_ref())
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -35,7 +35,7 @@ OpCube<T1, op_type>::OpCube(const BaseCube<typename T1::elem_type, T1>& in_m, co
: m(in_m.get_ref())
, aux(in_aux)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -47,7 +47,7 @@ OpCube<T1, op_type>::OpCube(const BaseCube<typename T1::elem_type, T1>& in_m, co
, aux_uword_b(in_aux_uword_b)
, aux_uword_c(in_aux_uword_c)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -59,7 +59,7 @@ OpCube<T1, op_type>::OpCube(const BaseCube<typename T1::elem_type, T1>& in_m, co
, aux_uword_a(in_aux_uword_a)
, aux_uword_b(in_aux_uword_b)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -71,7 +71,7 @@ OpCube<T1, op_type>::OpCube(const BaseCube<typename T1::elem_type, T1>& in_m, co
, aux_uword_b(in_aux_uword_b)
, aux_uword_c(in_aux_uword_c)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -79,7 +79,7 @@ OpCube<T1, op_type>::OpCube(const BaseCube<typename T1::elem_type, T1>& in_m, co
template<typename T1, typename op_type>
OpCube<T1, op_type>::~OpCube()
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
+7 -4
View File
@@ -58,10 +58,13 @@ class Op
inline Op(const T1& in_m, const uword in_aux_uword_a, const uword in_aux_uword_b);
inline ~Op();
arma_aligned const T1& m; //!< the operand; must be derived from Base
arma_aligned elem_type aux; //!< auxiliary data, using the element type as used by T1
arma_aligned uword aux_uword_a; //!< auxiliary data, uword format
arma_aligned uword aux_uword_b; //!< auxiliary data, uword format
template<typename eT2>
inline bool is_alias(const Mat<eT2>& X) const;
const T1& m; //!< the operand; must be derived from Base
elem_type aux; //!< auxiliary data, using the element type as used by T1
uword aux_uword_a; //!< auxiliary data, uword format
uword aux_uword_b; //!< auxiliary data, uword format
};
+18 -5
View File
@@ -26,7 +26,7 @@ inline
Op<T1, op_type>::Op(const T1& in_m)
: m(in_m)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -37,7 +37,7 @@ Op<T1, op_type>::Op(const T1& in_m, const typename T1::elem_type in_aux)
: m(in_m)
, aux(in_aux)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -50,7 +50,7 @@ Op<T1, op_type>::Op(const T1& in_m, const typename T1::elem_type in_aux, const u
, aux_uword_a(in_aux_uword_a)
, aux_uword_b(in_aux_uword_b)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -62,7 +62,7 @@ Op<T1, op_type>::Op(const T1& in_m, const uword in_aux_uword_a, const uword in_a
, aux_uword_a(in_aux_uword_a)
, aux_uword_b(in_aux_uword_b)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -71,7 +71,20 @@ template<typename T1, typename op_type>
inline
Op<T1, op_type>::~Op()
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
template<typename T1, typename op_type>
template<typename eT2>
inline
bool
Op<T1, op_type>::is_alias(const Mat<eT2>& X) const
{
arma_debug_sigprint();
return m.is_alias(X);
}
+148 -148
View File
@@ -22,36 +22,36 @@
// within each specialisation of the Proxy class:
//
// elem_type = the type of the elements obtained from object Q
// pod_type = the underlying type of elements if elem_type is std::complex
// stored_type = the type of the Q object
// ea_type = the type of the object that provides access to elements via operator[i]
// aligned_ea_type = the type of the object that provides access to elements via at_alt(i)
// elem_type = type of the elements obtained from object Q
// pod_type = underlying type of elements if elem_type is std::complex
// stored_type = type of Q object
// ea_type = type of object that provides access to elements via operator[i]
// aligned_ea_type = type of object that provides access to elements via at_alt(i)
//
// use_at = boolean indicating whether at(row,col) must be used to get elements
// use_mp = boolean indicating whether OpenMP can be used while processing elements
// has_subview = boolean indicating whether the Q object has a subview
// use_at = boolean to indicate at(row,col) must be used to get elements
// use_mp = boolean to indicate OpenMP can be used while processing elements
// has_subview = boolean to indicate Q object has a subview
//
// is_row = boolean indicating whether the Q object can be treated a row vector
// is_col = boolean indicating whether the Q object can be treated a column vector
// is_xvec = boolean indicating whether the Q object is a vector with unknown orientation
// is_row = boolean to indicate Q object can be treated a row vector
// is_col = boolean to indicate Q object can be treated a column vector
// is_xvec = boolean to indicate Q object is a vector with unknown orientation
//
// Q = object that can be unwrapped via the unwrap family of classes (ie. Q must be convertible to Mat)
// Q = object that can be unwrapped via unwrap family of classes (ie. Q must be convertible to Mat)
//
// get_n_rows() = return the number of rows in Q
// get_n_cols() = return the number of columns in Q
// get_n_elem() = return the number of elements in Q
// get_n_rows() = return number of rows in Q
// get_n_cols() = return number of columns in Q
// get_n_elem() = return number of elements in Q
//
// operator[i] = linear element accessor; valid only if the 'use_at' boolean is false
// at(row,col) = access elements via (row,col); valid only if the 'use_at' boolean is true
// at_alt(i) = aligned linear element accessor; valid only if the 'use_at' boolean is false and is_aligned() returns true
// operator[i] = linear element accessor; valid only if 'use_at' boolean is false
// at(row,col) = access elements via (row,col); valid only if 'use_at' boolean is true
// at_alt(i) = aligned linear element accessor; valid only if 'use_at' boolean is false and is_aligned() returns true
//
// get_ea() = return the object that provides linear access to elements via operator[i]
// get_aligned_ea() = return the object that provides linear access to elements via at_alt(i); valid only if is_aligned() returns true
// get_ea() = return object that provides linear access to elements via operator[i]
// get_aligned_ea() = return object that provides linear access to elements via at_alt(i); valid only if is_aligned() returns true
//
// is_alias(X) = return true/false indicating whether the Q object aliases matrix X
// has_overlap(X) = return true/false indicating whether the Q object has overlap with subview X
// is_aligned() = return true/false indicating whether the Q object has aligned memory
// is_alias(X) = return true/false to indicate Q object aliases matrix X
// has_overlap(X) = return true/false to indicate Q object has overlap with subview X
// is_aligned() = return true/false to indicate Q object has aligned memory
@@ -88,7 +88,7 @@ struct Proxy_fixed
inline explicit Proxy_fixed(const T1& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
//// this may require T1::n_elem etc to be declared as static constexpr inline variables (C++17)
@@ -168,12 +168,12 @@ struct Proxy< Mat<eT> >
static constexpr bool is_col = false;
static constexpr bool is_xvec = false;
arma_aligned const Mat<eT>& Q;
const Mat<eT>& Q;
inline explicit Proxy(const Mat<eT>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return Q.n_rows; }
@@ -188,7 +188,7 @@ struct Proxy< Mat<eT> >
arma_inline aligned_ea_type get_aligned_ea() const { return Q; }
template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& X) const { return (is_same_type<eT,eT2>::value) ? (void_ptr(&Q) == void_ptr(&X)) : false; }
arma_inline bool is_alias(const Mat<eT2>& X) const { return (is_same_type<eT,eT2>::yes) && (void_ptr(&Q) == void_ptr(&X)); }
template<typename eT2>
arma_inline bool has_overlap(const subview<eT2>& X) const { return is_alias(X.m); }
@@ -215,12 +215,12 @@ struct Proxy< Col<eT> >
static constexpr bool is_col = true;
static constexpr bool is_xvec = false;
arma_aligned const Col<eT>& Q;
const Col<eT>& Q;
inline explicit Proxy(const Col<eT>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return Q.n_rows; }
@@ -235,7 +235,7 @@ struct Proxy< Col<eT> >
arma_inline aligned_ea_type get_aligned_ea() const { return Q; }
template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& X) const { return (is_same_type<eT,eT2>::value) ? (void_ptr(&Q) == void_ptr(&X)) : false; }
arma_inline bool is_alias(const Mat<eT2>& X) const { return (is_same_type<eT,eT2>::yes) && (void_ptr(&Q) == void_ptr(&X)); }
template<typename eT2>
arma_inline bool has_overlap(const subview<eT2>& X) const { return is_alias(X.m); }
@@ -262,12 +262,12 @@ struct Proxy< Row<eT> >
static constexpr bool is_col = false;
static constexpr bool is_xvec = false;
arma_aligned const Row<eT>& Q;
const Row<eT>& Q;
inline explicit Proxy(const Row<eT>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
constexpr uword get_n_rows() const { return 1; }
@@ -282,7 +282,7 @@ struct Proxy< Row<eT> >
arma_inline aligned_ea_type get_aligned_ea() const { return Q; }
template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& X) const { return (is_same_type<eT,eT2>::value) ? (void_ptr(&Q) == void_ptr(&X)) : false; }
arma_inline bool is_alias(const Mat<eT2>& X) const { return (is_same_type<eT,eT2>::yes) && (void_ptr(&Q) == void_ptr(&X)); }
template<typename eT2>
arma_inline bool has_overlap(const subview<eT2>& X) const { return is_alias(X.m); }
@@ -309,12 +309,12 @@ struct Proxy< Gen<T1, gen_type> >
static constexpr bool is_col = Gen<T1, gen_type>::is_col;
static constexpr bool is_xvec = Gen<T1, gen_type>::is_xvec;
arma_aligned const Gen<T1, gen_type>& Q;
const Gen<T1, gen_type>& Q;
inline explicit Proxy(const Gen<T1, gen_type>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return (is_row ? 1 : Q.n_rows); }
@@ -356,12 +356,12 @@ struct Proxy< eOp<T1, eop_type> >
static constexpr bool is_col = eOp<T1, eop_type>::is_col;
static constexpr bool is_xvec = eOp<T1, eop_type>::is_xvec;
arma_aligned const eOp<T1, eop_type>& Q;
const eOp<T1, eop_type>& Q;
inline explicit Proxy(const eOp<T1, eop_type>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return is_row ? 1 : Q.get_n_rows(); }
@@ -403,12 +403,12 @@ struct Proxy< eGlue<T1, T2, eglue_type> >
static constexpr bool is_col = eGlue<T1, T2, eglue_type>::is_col;
static constexpr bool is_xvec = eGlue<T1, T2, eglue_type>::is_xvec;
arma_aligned const eGlue<T1, T2, eglue_type>& Q;
const eGlue<T1, T2, eglue_type>& Q;
inline explicit Proxy(const eGlue<T1, T2, eglue_type>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return is_row ? 1 : Q.get_n_rows(); }
@@ -450,12 +450,12 @@ struct Proxy< Op<T1, op_type> >
static constexpr bool is_col = Op<T1, op_type>::is_col;
static constexpr bool is_xvec = Op<T1, op_type>::is_xvec;
arma_aligned const Mat<elem_type> Q;
const Mat<elem_type> Q;
inline explicit Proxy(const Op<T1, op_type>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return is_row ? 1 : Q.n_rows; }
@@ -497,12 +497,12 @@ struct Proxy< Glue<T1, T2, glue_type> >
static constexpr bool is_col = Glue<T1, T2, glue_type>::is_col;
static constexpr bool is_xvec = Glue<T1, T2, glue_type>::is_xvec;
arma_aligned const Mat<elem_type> Q;
const Mat<elem_type> Q;
inline explicit Proxy(const Glue<T1, T2, glue_type>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return is_row ? 1 : Q.n_rows; }
@@ -547,9 +547,9 @@ struct Proxy< Glue<T1, T2, glue_min> >
static constexpr bool is_col = this_Glue_type::is_col;
static constexpr bool is_xvec = this_Glue_type::is_xvec;
arma_aligned const this_Glue_type& Q;
arma_aligned const Proxy<T1> P1;
arma_aligned const Proxy<T2> P2;
const this_Glue_type& Q;
const Proxy<T1> P1;
const Proxy<T2> P2;
arma_lt_comparator<elem_type> comparator;
@@ -558,9 +558,9 @@ struct Proxy< Glue<T1, T2, glue_min> >
, P1(X.A)
, P2(X.B)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_debug_assert_same_size(P1, P2, "element-wise min()");
arma_conform_assert_same_size(P1, P2, "element-wise min()");
}
arma_inline uword get_n_rows() const { return is_row ? 1 : P1.get_n_rows(); }
@@ -605,9 +605,9 @@ struct Proxy< Glue<T1, T2, glue_max> >
static constexpr bool is_col = this_Glue_type::is_col;
static constexpr bool is_xvec = this_Glue_type::is_xvec;
arma_aligned const this_Glue_type& Q;
arma_aligned const Proxy<T1> P1;
arma_aligned const Proxy<T2> P2;
const this_Glue_type& Q;
const Proxy<T1> P1;
const Proxy<T2> P2;
arma_gt_comparator<elem_type> comparator;
@@ -616,9 +616,9 @@ struct Proxy< Glue<T1, T2, glue_max> >
, P1(X.A)
, P2(X.B)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_debug_assert_same_size(P1, P2, "element-wise max()");
arma_conform_assert_same_size(P1, P2, "element-wise max()");
}
arma_inline uword get_n_rows() const { return is_row ? 1 : P1.get_n_rows(); }
@@ -660,12 +660,12 @@ struct Proxy< mtOp<out_eT, T1, op_type> >
static constexpr bool is_col = mtOp<out_eT, T1, op_type>::is_col;
static constexpr bool is_xvec = mtOp<out_eT, T1, op_type>::is_xvec;
arma_aligned const Mat<out_eT> Q;
const Mat<out_eT> Q;
inline explicit Proxy(const mtOp<out_eT, T1, op_type>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return is_row ? 1 : Q.n_rows; }
@@ -707,12 +707,12 @@ struct Proxy< mtGlue<out_eT, T1, T2, glue_type> >
static constexpr bool is_col = mtGlue<out_eT, T1, T2, glue_type>::is_col;
static constexpr bool is_xvec = mtGlue<out_eT, T1, T2, glue_type>::is_xvec;
arma_aligned const Mat<out_eT> Q;
const Mat<out_eT> Q;
inline explicit Proxy(const mtGlue<out_eT, T1, T2, glue_type>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return is_row ? 1 : Q.n_rows; }
@@ -754,12 +754,12 @@ struct Proxy< CubeToMatOp<T1, op_type> >
static constexpr bool is_col = CubeToMatOp<T1, op_type>::is_col;
static constexpr bool is_xvec = CubeToMatOp<T1, op_type>::is_xvec;
arma_aligned const Mat<elem_type> Q;
const Mat<elem_type> Q;
inline explicit Proxy(const CubeToMatOp<T1, op_type>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return is_row ? 1 : Q.n_rows; }
@@ -795,20 +795,20 @@ struct Proxy< CubeToMatOp<T1, op_vectorise_cube_col> >
static constexpr bool use_at = false;
static constexpr bool use_mp = false;
static constexpr bool has_subview = false;
static constexpr bool has_subview = true;
static constexpr bool is_row = false;
static constexpr bool is_col = true;
static constexpr bool is_xvec = false;
arma_aligned const unwrap_cube<T1> U;
arma_aligned const Mat<elem_type> Q;
const unwrap_cube<T1> U;
const Mat<elem_type> Q;
inline explicit Proxy(const CubeToMatOp<T1, op_vectorise_cube_col>& A)
: U(A.m)
, Q(const_cast<elem_type*>(U.M.memptr()), U.M.n_elem, 1, false, true)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return Q.n_rows; }
@@ -850,12 +850,12 @@ struct Proxy< SpToDOp<T1, op_type> >
static constexpr bool is_col = SpToDOp<T1, op_type>::is_col;
static constexpr bool is_xvec = SpToDOp<T1, op_type>::is_xvec;
arma_aligned const Mat<elem_type> Q;
const Mat<elem_type> Q;
inline explicit Proxy(const SpToDOp<T1, op_type>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return is_row ? 1 : Q.n_rows; }
@@ -880,10 +880,10 @@ struct Proxy< SpToDOp<T1, op_type> >
template<typename T1>
struct Proxy< SpToDOp<T1, op_nonzeros_spmat> >
template<typename eT>
struct Proxy< SpToDOp<SpMat<eT>, op_sp_nonzeros> >
{
typedef typename T1::elem_type elem_type;
typedef eT elem_type;
typedef typename get_pod_type<elem_type>::result pod_type;
typedef Mat<elem_type> stored_type;
typedef const elem_type* ea_type;
@@ -891,20 +891,20 @@ struct Proxy< SpToDOp<T1, op_nonzeros_spmat> >
static constexpr bool use_at = false;
static constexpr bool use_mp = false;
static constexpr bool has_subview = false;
static constexpr bool has_subview = true;
static constexpr bool is_row = false;
static constexpr bool is_col = true;
static constexpr bool is_xvec = false;
arma_aligned const unwrap_spmat<T1> U;
arma_aligned const Mat<elem_type> Q;
const SpMat<elem_type>& R;
const Mat<elem_type> Q;
inline explicit Proxy(const SpToDOp<T1, op_nonzeros_spmat>& A)
: U(A.m)
, Q(const_cast<elem_type*>(U.M.values), U.M.n_nonzero, 1, false, true)
inline explicit Proxy(const SpToDOp<SpMat<eT>, op_sp_nonzeros>& A)
: R(A.m)
, Q(const_cast<elem_type*>(R.values), R.n_nonzero, 1, false, true)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return Q.n_rows; }
@@ -946,12 +946,12 @@ struct Proxy< SpToDGlue<T1, T2, glue_type> >
static constexpr bool is_col = SpToDGlue<T1, T2, glue_type>::is_col;
static constexpr bool is_xvec = SpToDGlue<T1, T2, glue_type>::is_xvec;
arma_aligned const Mat<elem_type> Q;
const Mat<elem_type> Q;
inline explicit Proxy(const SpToDGlue<T1, T2, glue_type>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return is_row ? 1 : Q.n_rows; }
@@ -993,12 +993,12 @@ struct Proxy< subview<eT> >
static constexpr bool is_col = false;
static constexpr bool is_xvec = false;
arma_aligned const subview<eT>& Q;
const subview<eT>& Q;
inline explicit Proxy(const subview<eT>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return Q.n_rows; }
@@ -1013,7 +1013,7 @@ struct Proxy< subview<eT> >
arma_inline aligned_ea_type get_aligned_ea() const { return Q; }
template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& X) const { return (is_same_type<eT,eT2>::value) ? (void_ptr(&(Q.m)) == void_ptr(&X)) : false; }
arma_inline bool is_alias(const Mat<eT2>& X) const { return (is_same_type<eT,eT2>::yes) && (void_ptr(&(Q.m)) == void_ptr(&X)); }
template<typename eT2>
arma_inline bool has_overlap(const subview<eT2>& X) const { return Q.check_overlap(X); }
@@ -1040,12 +1040,12 @@ struct Proxy< subview_col<eT> >
static constexpr bool is_col = true;
static constexpr bool is_xvec = false;
arma_aligned const subview_col<eT>& Q;
const subview_col<eT>& Q;
inline explicit Proxy(const subview_col<eT>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return Q.n_rows; }
@@ -1060,7 +1060,7 @@ struct Proxy< subview_col<eT> >
arma_inline aligned_ea_type get_aligned_ea() const { return Q; }
template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& X) const { return (is_same_type<eT,eT2>::value) ? (void_ptr(&(Q.m)) == void_ptr(&X)) : false; }
arma_inline bool is_alias(const Mat<eT2>& X) const { return (is_same_type<eT,eT2>::yes) && (void_ptr(&(Q.m)) == void_ptr(&X)); }
template<typename eT2>
arma_inline bool has_overlap(const subview<eT2>& X) const { return Q.check_overlap(X); }
@@ -1087,14 +1087,14 @@ struct Proxy< subview_cols<eT> >
static constexpr bool is_col = false;
static constexpr bool is_xvec = false;
arma_aligned const subview_cols<eT>& sv;
arma_aligned const Mat<eT> Q;
const subview_cols<eT>& sv;
const Mat<eT> Q;
inline explicit Proxy(const subview_cols<eT>& A)
: sv(A)
, Q ( const_cast<eT*>( A.colptr(0) ), A.n_rows, A.n_cols, false, false )
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return Q.n_rows; }
@@ -1109,7 +1109,7 @@ struct Proxy< subview_cols<eT> >
arma_inline aligned_ea_type get_aligned_ea() const { return Q; }
template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& X) const { return (is_same_type<eT,eT2>::value) ? (void_ptr(&(sv.m)) == void_ptr(&X)) : false; }
arma_inline bool is_alias(const Mat<eT2>& X) const { return (is_same_type<eT,eT2>::yes) && (void_ptr(&(sv.m)) == void_ptr(&X)); }
template<typename eT2>
arma_inline bool has_overlap(const subview<eT2>& X) const { return sv.check_overlap(X); }
@@ -1136,12 +1136,12 @@ struct Proxy< subview_row<eT> >
static constexpr bool is_col = false;
static constexpr bool is_xvec = false;
arma_aligned const subview_row<eT>& Q;
const subview_row<eT>& Q;
inline explicit Proxy(const subview_row<eT>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
constexpr uword get_n_rows() const { return 1; }
@@ -1156,7 +1156,7 @@ struct Proxy< subview_row<eT> >
arma_inline aligned_ea_type get_aligned_ea() const { return Q; }
template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& X) const { return (is_same_type<eT,eT2>::value) ? (void_ptr(&(Q.m)) == void_ptr(&X)) : false; }
arma_inline bool is_alias(const Mat<eT2>& X) const { return (is_same_type<eT,eT2>::yes) && (void_ptr(&(Q.m)) == void_ptr(&X)); }
template<typename eT2>
arma_inline bool has_overlap(const subview<eT2>& X) const { return Q.check_overlap(X); }
@@ -1183,28 +1183,28 @@ struct Proxy< subview_elem1<eT,T1> >
static constexpr bool is_col = true;
static constexpr bool is_xvec = false;
arma_aligned const subview_elem1<eT,T1>& Q;
arma_aligned const Proxy<T1> R;
const subview_elem1<eT,T1>& Q;
const Proxy<T1> R;
inline explicit Proxy(const subview_elem1<eT,T1>& A)
: Q(A)
, R(A.a.get_ref())
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const bool R_is_vec = ((R.get_n_rows() == 1) || (R.get_n_cols() == 1));
const bool R_is_empty = (R.get_n_elem() == 0);
arma_debug_check( ((R_is_vec == false) && (R_is_empty == false)), "Mat::elem(): given object must be a vector" );
arma_conform_check( ((R_is_vec == false) && (R_is_empty == false)), "Mat::elem(): given object must be a vector" );
}
arma_inline uword get_n_rows() const { return R.get_n_elem(); }
constexpr uword get_n_cols() const { return 1; }
arma_inline uword get_n_elem() const { return R.get_n_elem(); }
arma_inline elem_type operator[] (const uword i) const { const uword ii = (Proxy<T1>::use_at) ? R.at(i,0) : R[i]; arma_debug_check_bounds( (ii >= Q.m.n_elem), "Mat::elem(): index out of bounds" ); return Q.m[ii]; }
arma_inline elem_type at (const uword r, const uword) const { const uword ii = (Proxy<T1>::use_at) ? R.at(r,0) : R[r]; arma_debug_check_bounds( (ii >= Q.m.n_elem), "Mat::elem(): index out of bounds" ); return Q.m[ii]; }
arma_inline elem_type at_alt (const uword i) const { const uword ii = (Proxy<T1>::use_at) ? R.at(i,0) : R[i]; arma_debug_check_bounds( (ii >= Q.m.n_elem), "Mat::elem(): index out of bounds" ); return Q.m[ii]; }
arma_inline elem_type operator[] (const uword i) const { const uword ii = (Proxy<T1>::use_at) ? R.at(i,0) : R[i]; arma_conform_check_bounds( (ii >= Q.m.n_elem), "Mat::elem(): index out of bounds" ); return Q.m[ii]; }
arma_inline elem_type at (const uword r, const uword) const { const uword ii = (Proxy<T1>::use_at) ? R.at(r,0) : R[r]; arma_conform_check_bounds( (ii >= Q.m.n_elem), "Mat::elem(): index out of bounds" ); return Q.m[ii]; }
arma_inline elem_type at_alt (const uword i) const { const uword ii = (Proxy<T1>::use_at) ? R.at(i,0) : R[i]; arma_conform_check_bounds( (ii >= Q.m.n_elem), "Mat::elem(): index out of bounds" ); return Q.m[ii]; }
arma_inline ea_type get_ea() const { return (*this); }
arma_inline aligned_ea_type get_aligned_ea() const { return (*this); }
@@ -1237,12 +1237,12 @@ struct Proxy< subview_elem2<eT,T1,T2> >
static constexpr bool is_col = false;
static constexpr bool is_xvec = false;
arma_aligned const Mat<eT> Q;
const Mat<eT> Q;
inline explicit Proxy(const subview_elem2<eT,T1,T2>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return Q.n_rows; }
@@ -1284,12 +1284,12 @@ struct Proxy< diagview<eT> >
static constexpr bool is_col = true;
static constexpr bool is_xvec = false;
arma_aligned const diagview<eT>& Q;
const diagview<eT>& Q;
inline explicit Proxy(const diagview<eT>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return Q.n_rows; }
@@ -1304,7 +1304,7 @@ struct Proxy< diagview<eT> >
arma_inline aligned_ea_type get_aligned_ea() const { return Q; }
template<typename eT2>
arma_inline bool is_alias(const Mat<eT2>& X) const { return (is_same_type<eT,eT2>::value) ? (void_ptr(&(Q.m)) == void_ptr(&X)) : false; }
arma_inline bool is_alias(const Mat<eT2>& X) const { return (is_same_type<eT,eT2>::yes) && (void_ptr(&(Q.m)) == void_ptr(&X)); }
template<typename eT2>
arma_inline bool has_overlap(const subview<eT2>& X) const { return is_alias(X.m); }
@@ -1339,13 +1339,13 @@ struct Proxy_diagvec_mat< Op<T1, op_diagvec> >
static constexpr bool is_col = true;
static constexpr bool is_xvec = false;
arma_aligned const Mat<elem_type>& R;
arma_aligned const diagview<elem_type> Q;
const Mat<elem_type>& R;
const diagview<elem_type> Q;
inline explicit Proxy_diagvec_mat(const Op<T1, op_diagvec>& A)
: R(A.m), Q( R.diag() )
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return Q.n_rows; }
@@ -1395,12 +1395,12 @@ struct Proxy_diagvec_expr< Op<T1, op_diagvec> >
static constexpr bool is_col = true;
static constexpr bool is_xvec = false;
arma_aligned const Mat<elem_type> Q;
const Mat<elem_type> Q;
inline explicit Proxy_diagvec_expr(const Op<T1, op_diagvec>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return Q.n_rows; }
@@ -1445,7 +1445,7 @@ struct Proxy< Op<T1, op_diagvec> >
inline explicit Proxy(const Op<T1, op_diagvec>& A)
: Proxy_diagvec(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
};
@@ -1468,12 +1468,12 @@ struct Proxy< Op<T1, op_diagvec2> >
static constexpr bool is_col = true;
static constexpr bool is_xvec = false;
arma_aligned const Mat<elem_type> Q;
const Mat<elem_type> Q;
inline explicit Proxy(const Op<T1, op_diagvec2>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return Q.n_rows; }
@@ -1530,7 +1530,7 @@ struct Proxy_xtrans_default< Op<T1, op_htrans> >
: U(A.m)
, Q(U.M)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline ea_type get_ea() const { return Q; }
@@ -1571,7 +1571,7 @@ struct Proxy_xtrans_default< Op<T1, op_strans> >
: U(A.m)
, Q(U.M)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline ea_type get_ea() const { return Q; }
@@ -1614,14 +1614,14 @@ struct Proxy_xtrans_vector< Op<T1, op_htrans> >
static constexpr bool is_col = Op<T1, op_htrans>::is_col;
static constexpr bool is_xvec = Op<T1, op_htrans>::is_xvec;
arma_aligned const quasi_unwrap<T1> U; // avoid copy if T1 is a Row, Col or subview_col
arma_aligned const Mat<elem_type> Q;
const quasi_unwrap<T1> U; // avoid copy if T1 is a Row, Col or subview_col
const Mat<elem_type> Q;
inline Proxy_xtrans_vector(const Op<T1, op_htrans>& A)
: U(A.m)
, Q(const_cast<elem_type*>(U.M.memptr()), U.M.n_cols, U.M.n_rows, false, false)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline ea_type get_ea() const { return Q.memptr(); }
@@ -1656,14 +1656,14 @@ struct Proxy_xtrans_vector< Op<T1, op_strans> >
static constexpr bool is_col = Op<T1, op_strans>::is_col;
static constexpr bool is_xvec = Op<T1, op_strans>::is_xvec;
arma_aligned const quasi_unwrap<T1> U; // avoid copy if T1 is a Row, Col or subview_col
arma_aligned const Mat<elem_type> Q;
const quasi_unwrap<T1> U; // avoid copy if T1 is a Row, Col or subview_col
const Mat<elem_type> Q;
inline Proxy_xtrans_vector(const Op<T1, op_strans>& A)
: U(A.m)
, Q(const_cast<elem_type*>(U.M.memptr()), U.M.n_cols, U.M.n_rows, false, false)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline ea_type get_ea() const { return Q.memptr(); }
@@ -1728,7 +1728,7 @@ struct Proxy< Op<T1, op_htrans> >
inline explicit Proxy(const Op<T1, op_htrans>& A)
: Proxy_xtrans(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return is_row ? 1 : Q.n_rows; }
@@ -1790,7 +1790,7 @@ struct Proxy< Op<T1, op_strans> >
inline explicit Proxy(const Op<T1, op_strans>& A)
: Proxy_xtrans(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return is_row ? 1 : Q.n_rows; }
@@ -1832,12 +1832,12 @@ struct Proxy_subview_row_htrans_cx
static constexpr bool is_col = true;
static constexpr bool is_xvec = false;
arma_aligned const subview_row_htrans<eT> Q;
const subview_row_htrans<eT> Q;
inline explicit Proxy_subview_row_htrans_cx(const Op<subview_row<eT>, op_htrans>& A)
: Q(A.m)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
template<typename eT2>
@@ -1866,12 +1866,12 @@ struct Proxy_subview_row_htrans_non_cx
static constexpr bool is_col = true;
static constexpr bool is_xvec = false;
arma_aligned const subview_row_strans<eT> Q;
const subview_row_strans<eT> Q;
inline explicit Proxy_subview_row_htrans_non_cx(const Op<subview_row<eT>, op_htrans>& A)
: Q(A.m)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
template<typename eT2>
@@ -1931,7 +1931,7 @@ struct Proxy< Op<subview_row<eT>, op_htrans> >
inline explicit Proxy(const Op<subview_row<eT>, op_htrans>& A)
: Proxy_sv_row_ht(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return Q.n_rows; }
@@ -1973,12 +1973,12 @@ struct Proxy< Op<subview_row<eT>, op_strans> >
static constexpr bool is_col = true;
static constexpr bool is_xvec = false;
arma_aligned const subview_row_strans<eT> Q;
const subview_row_strans<eT> Q;
inline explicit Proxy(const Op<subview_row<eT>, op_strans>& A)
: Q(A.m)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return Q.n_rows; }
@@ -2029,7 +2029,7 @@ struct Proxy< Op< Row< std::complex<T> >, op_htrans> >
: Q (A.m.memptr(), A.m.n_rows, A.m.n_cols)
, src(A.m)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return Q.n_rows; }
@@ -2080,7 +2080,7 @@ struct Proxy< Op< Col< std::complex<T> >, op_htrans> >
: Q (A.m.memptr(), A.m.n_rows, A.m.n_cols)
, src(A.m)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
constexpr uword get_n_rows() const { return 1; }
@@ -2131,7 +2131,7 @@ struct Proxy< Op< subview_col< std::complex<T> >, op_htrans> >
: Q (A.m.colptr(0), A.m.n_rows, A.m.n_cols)
, src(A.m)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
constexpr uword get_n_rows() const { return 1; }
@@ -2174,14 +2174,14 @@ struct Proxy< Op<T1, op_htrans2> >
static constexpr bool is_col = eOp< Op<T1, op_htrans>, eop_scalar_times>::is_col;
static constexpr bool is_xvec = eOp< Op<T1, op_htrans>, eop_scalar_times>::is_xvec;
arma_aligned const Op<T1, op_htrans> R;
arma_aligned const eOp< Op<T1, op_htrans>, eop_scalar_times > Q;
const Op<T1, op_htrans> R;
const eOp< Op<T1, op_htrans>, eop_scalar_times > Q;
inline explicit Proxy(const Op<T1, op_htrans2>& A)
: R(A.m)
, Q(R, A.aux)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return is_row ? 1 : Q.get_n_rows(); }
@@ -2223,12 +2223,12 @@ struct Proxy< subview_row_strans<eT> >
static constexpr bool is_col = true;
static constexpr bool is_xvec = false;
arma_aligned const subview_row_strans<eT>& Q;
const subview_row_strans<eT>& Q;
inline explicit Proxy(const subview_row_strans<eT>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return Q.n_rows; }
@@ -2270,12 +2270,12 @@ struct Proxy< subview_row_htrans<eT> >
static constexpr bool is_col = true;
static constexpr bool is_xvec = false;
arma_aligned const subview_row_htrans<eT>& Q;
const subview_row_htrans<eT>& Q;
inline explicit Proxy(const subview_row_htrans<eT>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return Q.n_rows; }
@@ -2317,12 +2317,12 @@ struct Proxy< xtrans_mat<eT, do_conj> >
static constexpr bool is_col = false;
static constexpr bool is_xvec = false;
arma_aligned const Mat<eT> Q;
const Mat<eT> Q;
inline explicit Proxy(const xtrans_mat<eT, do_conj>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return Q.n_rows; }
@@ -2364,12 +2364,12 @@ struct Proxy< xvec_htrans<eT> >
static constexpr bool is_col = false;
static constexpr bool is_xvec = true;
arma_aligned const Mat<eT> Q;
const Mat<eT> Q;
inline explicit Proxy(const xvec_htrans<eT>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return Q.n_rows; }
@@ -2419,14 +2419,14 @@ struct Proxy_vectorise_col_mat< Op<T1, op_vectorise_col> >
static constexpr bool is_col = true;
static constexpr bool is_xvec = false;
arma_aligned const unwrap<T1> U;
arma_aligned const Mat<elem_type> Q;
const unwrap<T1> U;
const Mat<elem_type> Q;
inline explicit Proxy_vectorise_col_mat(const Op<T1, op_vectorise_col>& A)
: U(A.m)
, Q(const_cast<elem_type*>(U.M.memptr()), U.M.n_elem, 1, false, false)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return Q.n_rows; }
@@ -2476,14 +2476,14 @@ struct Proxy_vectorise_col_expr< Op<T1, op_vectorise_col> >
static constexpr bool is_col = true;
static constexpr bool is_xvec = false;
arma_aligned const Op<T1, op_vectorise_col>& Q;
arma_aligned const Proxy<T1> R;
const Op<T1, op_vectorise_col>& Q;
const Proxy<T1> R;
inline explicit Proxy_vectorise_col_expr(const Op<T1, op_vectorise_col>& A)
: Q(A)
, R(A.m)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return R.get_n_elem(); }
@@ -2528,7 +2528,7 @@ struct Proxy< Op<T1, op_vectorise_col> >
inline explicit Proxy(const Op<T1, op_vectorise_col>& A)
: Proxy_vectorise_col(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
};
+20 -20
View File
@@ -48,12 +48,12 @@ struct ProxyCube< Cube<eT> >
static constexpr bool use_mp = false;
static constexpr bool has_subview = false;
arma_aligned const Cube<eT>& Q;
const Cube<eT>& Q;
inline explicit ProxyCube(const Cube<eT>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return Q.n_rows; }
@@ -93,12 +93,12 @@ struct ProxyCube< GenCube<eT, gen_type> >
static constexpr bool use_mp = false;
static constexpr bool has_subview = false;
arma_aligned const GenCube<eT, gen_type>& Q;
const GenCube<eT, gen_type>& Q;
inline explicit ProxyCube(const GenCube<eT, gen_type>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return Q.n_rows; }
@@ -138,12 +138,12 @@ struct ProxyCube< OpCube<T1, op_type> >
static constexpr bool use_mp = false;
static constexpr bool has_subview = false;
arma_aligned const Cube<elem_type> Q;
const Cube<elem_type> Q;
inline explicit ProxyCube(const OpCube<T1, op_type>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return Q.n_rows; }
@@ -183,12 +183,12 @@ struct ProxyCube< GlueCube<T1, T2, glue_type> >
static constexpr bool use_mp = false;
static constexpr bool has_subview = false;
arma_aligned const Cube<elem_type> Q;
const Cube<elem_type> Q;
inline explicit ProxyCube(const GlueCube<T1, T2, glue_type>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return Q.n_rows; }
@@ -228,12 +228,12 @@ struct ProxyCube< subview_cube<eT> >
static constexpr bool use_mp = false;
static constexpr bool has_subview = true;
arma_aligned const subview_cube<eT>& Q;
const subview_cube<eT>& Q;
inline explicit ProxyCube(const subview_cube<eT>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return Q.n_rows; }
@@ -273,12 +273,12 @@ struct ProxyCube< subview_cube_slices<eT,T1> >
static constexpr bool use_mp = false;
static constexpr bool has_subview = false;
arma_aligned const Cube<eT> Q;
const Cube<eT> Q;
inline explicit ProxyCube(const subview_cube_slices<eT,T1>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return Q.n_rows; }
@@ -318,12 +318,12 @@ struct ProxyCube< eOpCube<T1, eop_type > >
static constexpr bool use_mp = eOpCube<T1, eop_type>::use_mp;
static constexpr bool has_subview = eOpCube<T1, eop_type>::has_subview;
arma_aligned const eOpCube<T1, eop_type>& Q;
const eOpCube<T1, eop_type>& Q;
inline explicit ProxyCube(const eOpCube<T1, eop_type>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return Q.get_n_rows(); }
@@ -363,12 +363,12 @@ struct ProxyCube< eGlueCube<T1, T2, eglue_type > >
static constexpr bool use_mp = eGlueCube<T1, T2, eglue_type>::use_mp;
static constexpr bool has_subview = eGlueCube<T1, T2, eglue_type>::has_subview;
arma_aligned const eGlueCube<T1, T2, eglue_type>& Q;
const eGlueCube<T1, T2, eglue_type>& Q;
inline explicit ProxyCube(const eGlueCube<T1, T2, eglue_type>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return Q.get_n_rows(); }
@@ -408,12 +408,12 @@ struct ProxyCube< mtOpCube<out_eT, T1, op_type> >
static constexpr bool use_mp = false;
static constexpr bool has_subview = false;
arma_aligned const Cube<out_eT> Q;
const Cube<out_eT> Q;
inline explicit ProxyCube(const mtOpCube<out_eT, T1, op_type>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return Q.n_rows; }
@@ -453,12 +453,12 @@ struct ProxyCube< mtGlueCube<out_eT, T1, T2, glue_type > >
static constexpr bool use_mp = false;
static constexpr bool has_subview = false;
arma_aligned const Cube<out_eT> Q;
const Cube<out_eT> Q;
inline explicit ProxyCube(const mtGlueCube<out_eT, T1, T2, glue_type>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return Q.n_rows; }
+2
View File
@@ -187,6 +187,8 @@ class Row<eT>::fixed : public Row<eT>
{
private:
using Mat<eT>::mem_local;
static constexpr bool use_extra = (fixed_n_elem > arma_config::mat_prealloc);
arma_align_mem eT mem_local_extra[ (use_extra) ? fixed_n_elem : 1 ];
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -27,7 +27,7 @@ SizeCube::SizeCube(const uword in_n_rows, const uword in_n_cols, const uword in_
, n_cols (in_n_cols )
, n_slices(in_n_slices)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -53,7 +53,7 @@ SizeCube::operator()(const uword dim) const
if(dim == 1) { return n_cols; }
if(dim == 2) { return n_slices; }
arma_debug_check_bounds(true, "size(): index out of bounds");
arma_conform_check_bounds(true, "size(): index out of bounds");
return uword(1);
}
+2 -2
View File
@@ -26,7 +26,7 @@ SizeMat::SizeMat(const uword in_n_rows, const uword in_n_cols)
: n_rows(in_n_rows)
, n_cols(in_n_cols)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -50,7 +50,7 @@ SizeMat::operator()(const uword dim) const
if(dim == 0) { return n_rows; }
if(dim == 1) { return n_cols; }
arma_debug_check_bounds(true, "size(): index out of bounds");
arma_conform_check_bounds(true, "size(): index out of bounds");
return uword(1);
}
+6 -4
View File
@@ -76,11 +76,11 @@ struct SpBase
arma_warn_unused inline elem_type min() const;
arma_warn_unused inline elem_type max() const;
inline elem_type min(uword& index_of_min_val) const;
inline elem_type max(uword& index_of_max_val) 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;
inline elem_type min(uword& row_of_min_val, uword& col_of_min_val) const;
inline elem_type max(uword& row_of_max_val, uword& col_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;
arma_warn_unused inline uword index_min() const;
arma_warn_unused inline uword index_max() const;
@@ -109,6 +109,8 @@ struct SpBase
arma_warn_unused inline const SpOp<derived,spop_vectorise_col> as_col() const;
arma_warn_unused inline const SpOp<derived,spop_vectorise_row> as_row() const;
arma_warn_unused inline const SpToDOp<derived,op_sp_as_dense> as_dense() const;
};
+54 -44
View File
@@ -75,7 +75,7 @@ inline
void
SpBase<elem_type,derived>::print(const std::string extra_text) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const unwrap_spmat<derived> tmp( (*this).get_ref() );
@@ -98,7 +98,7 @@ inline
void
SpBase<elem_type,derived>::print(std::ostream& user_stream, const std::string extra_text) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const unwrap_spmat<derived> tmp( (*this).get_ref() );
@@ -121,7 +121,7 @@ inline
void
SpBase<elem_type,derived>::raw_print(const std::string extra_text) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const unwrap_spmat<derived> tmp( (*this).get_ref() );
@@ -144,7 +144,7 @@ inline
void
SpBase<elem_type,derived>::raw_print(std::ostream& user_stream, const std::string extra_text) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const unwrap_spmat<derived> tmp( (*this).get_ref() );
@@ -167,7 +167,7 @@ inline
void
SpBase<elem_type, derived>::print_dense(const std::string extra_text) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const unwrap_spmat<derived> tmp( (*this).get_ref() );
@@ -190,7 +190,7 @@ inline
void
SpBase<elem_type, derived>::print_dense(std::ostream& user_stream, const std::string extra_text) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const unwrap_spmat<derived> tmp( (*this).get_ref() );
@@ -213,7 +213,7 @@ inline
void
SpBase<elem_type, derived>::raw_print_dense(const std::string extra_text) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const unwrap_spmat<derived> tmp( (*this).get_ref() );
@@ -236,7 +236,7 @@ inline
void
SpBase<elem_type, derived>::raw_print_dense(std::ostream& user_stream, const std::string extra_text) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const unwrap_spmat<derived> tmp( (*this).get_ref() );
@@ -259,7 +259,7 @@ inline
void
SpBase<elem_type,derived>::brief_print(const std::string extra_text) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const unwrap_spmat<derived> tmp( (*this).get_ref() );
@@ -282,7 +282,7 @@ inline
void
SpBase<elem_type,derived>::brief_print(std::ostream& user_stream, const std::string extra_text) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const unwrap_spmat<derived> tmp( (*this).get_ref() );
@@ -308,7 +308,7 @@ inline
const derived&
SpBase_eval_SpMat<elem_type, derived>::eval() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
return static_cast<const derived&>(*this);
}
@@ -323,7 +323,7 @@ inline
SpMat<elem_type>
SpBase_eval_expr<elem_type, derived>::eval() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
return SpMat<elem_type>( static_cast<const derived&>(*this) );
}
@@ -335,7 +335,7 @@ inline
elem_type
SpBase<elem_type, derived>::min() const
{
return spop_min::min( (*this).get_ref() );
return op_sp_min::min( (*this).get_ref() );
}
@@ -345,7 +345,7 @@ inline
elem_type
SpBase<elem_type, derived>::max() const
{
return spop_max::max( (*this).get_ref() );
return op_sp_max::max( (*this).get_ref() );
}
@@ -357,7 +357,7 @@ SpBase<elem_type, derived>::min(uword& index_of_min_val) const
{
const SpProxy<derived> P( (*this).get_ref() );
return spop_min::min_with_index(P, index_of_min_val);
return op_sp_min::min_with_index(P, index_of_min_val);
}
@@ -369,7 +369,7 @@ SpBase<elem_type, derived>::max(uword& index_of_max_val) const
{
const SpProxy<derived> P( (*this).get_ref() );
return spop_max::max_with_index(P, index_of_max_val);
return op_sp_max::max_with_index(P, index_of_max_val);
}
@@ -383,7 +383,7 @@ SpBase<elem_type, derived>::min(uword& row_of_min_val, uword& col_of_min_val) co
uword index = 0;
const elem_type val = spop_min::min_with_index(P, index);
const elem_type val = op_sp_min::min_with_index(P, index);
const uword local_n_rows = P.get_n_rows();
@@ -404,7 +404,7 @@ SpBase<elem_type, derived>::max(uword& row_of_max_val, uword& col_of_max_val) co
uword index = 0;
const elem_type val = spop_max::max_with_index(P, index);
const elem_type val = op_sp_max::max_with_index(P, index);
const uword local_n_rows = P.get_n_rows();
@@ -427,11 +427,11 @@ SpBase<elem_type,derived>::index_min() const
if(P.get_n_elem() == 0)
{
arma_debug_check(true, "index_min(): object has no elements");
arma_conform_check(true, "index_min(): object has no elements");
}
else
{
spop_min::min_with_index(P, index);
op_sp_min::min_with_index(P, index);
}
return index;
@@ -450,11 +450,11 @@ SpBase<elem_type,derived>::index_max() const
if(P.get_n_elem() == 0)
{
arma_debug_check(true, "index_max(): object has no elements");
arma_conform_check(true, "index_max(): object has no elements");
}
else
{
spop_max::max_with_index(P, index);
op_sp_max::max_with_index(P, index);
}
return index;
@@ -467,7 +467,7 @@ inline
bool
SpBase<elem_type,derived>::is_symmetric() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const unwrap_spmat<derived> tmp( (*this).get_ref() );
@@ -481,7 +481,7 @@ inline
bool
SpBase<elem_type,derived>::is_symmetric(const typename get_pod_type<elem_type>::result tol) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const unwrap_spmat<derived> tmp( (*this).get_ref() );
@@ -495,7 +495,7 @@ inline
bool
SpBase<elem_type,derived>::is_hermitian() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const unwrap_spmat<derived> tmp( (*this).get_ref() );
@@ -509,7 +509,7 @@ inline
bool
SpBase<elem_type,derived>::is_hermitian(const typename get_pod_type<elem_type>::result tol) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const unwrap_spmat<derived> tmp( (*this).get_ref() );
@@ -523,11 +523,11 @@ inline
bool
SpBase<elem_type,derived>::is_zero(const typename get_pod_type<elem_type>::result tol) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
typedef typename get_pod_type<elem_type>::result T;
arma_debug_check( (tol < T(0)), "is_zero(): parameter 'tol' must be >= 0" );
arma_conform_check( (tol < T(0)), "is_zero(): parameter 'tol' must be >= 0" );
const SpProxy<derived> P( (*this).get_ref() );
@@ -580,7 +580,7 @@ inline
bool
SpBase<elem_type,derived>::is_trimatu() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const SpProxy<derived> P( (*this).get_ref() );
@@ -605,7 +605,7 @@ inline
bool
SpBase<elem_type,derived>::is_trimatl() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const SpProxy<derived> P( (*this).get_ref() );
@@ -630,7 +630,7 @@ inline
bool
SpBase<elem_type,derived>::is_diagmat() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const SpProxy<derived> P( (*this).get_ref() );
@@ -653,7 +653,7 @@ inline
bool
SpBase<elem_type,derived>::is_empty() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const SpProxy<derived> P( (*this).get_ref() );
@@ -667,7 +667,7 @@ inline
bool
SpBase<elem_type,derived>::is_square() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const SpProxy<derived> P( (*this).get_ref() );
@@ -681,7 +681,7 @@ inline
bool
SpBase<elem_type,derived>::is_vec() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if( (SpProxy<derived>::is_row) || (SpProxy<derived>::is_col) || (SpProxy<derived>::is_xvec) ) { return true; }
@@ -697,7 +697,7 @@ inline
bool
SpBase<elem_type,derived>::is_colvec() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if(SpProxy<derived>::is_col) { return true; }
@@ -713,7 +713,7 @@ inline
bool
SpBase<elem_type,derived>::is_rowvec() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if(SpProxy<derived>::is_row) { return true; }
@@ -729,9 +729,9 @@ inline
bool
SpBase<elem_type,derived>::is_finite() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "is_finite(): detection of non-finite values is not reliable in fast math mode"); }
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_SpMat<typename SpProxy<derived>::stored_type>::value)
{
@@ -763,9 +763,9 @@ inline
bool
SpBase<elem_type,derived>::has_inf() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "has_inf(): detection of non-finite values is not reliable in fast math mode"); }
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_SpMat<typename SpProxy<derived>::stored_type>::value)
{
@@ -797,9 +797,9 @@ inline
bool
SpBase<elem_type,derived>::has_nan() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "has_nan(): detection of non-finite values is not reliable in fast math mode"); }
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_SpMat<typename SpProxy<derived>::stored_type>::value)
{
@@ -831,9 +831,9 @@ inline
bool
SpBase<elem_type,derived>::has_nonfinite() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if(arma_config::fast_math_warn) { arma_debug_warn_level(1, "has_nonfinite(): detection of non-finite values is not reliable in fast math mode"); }
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_SpMat<typename SpProxy<derived>::stored_type>::value)
{
@@ -880,4 +880,14 @@ SpBase<elem_type, derived>::as_row() const
template<typename elem_type, typename derived>
inline
const SpToDOp<derived,op_sp_as_dense>
SpBase<elem_type, derived>::as_dense() const
{
return SpToDOp<derived,op_sp_as_dense>( (*this).get_ref() );
}
//! @}
+5 -1
View File
@@ -47,7 +47,9 @@ class SpCol : public SpMat<eT>
inline SpCol& operator=(const eT val);
template<typename T1> inline SpCol(const Base<eT,T1>& X);
inline SpCol(const Col<eT>& X); // for backwards compatibility
template<typename T1> inline explicit SpCol(const Base<eT,T1>& X);
template<typename T1> inline SpCol& operator=(const Base<eT,T1>& X);
template<typename T1> inline SpCol(const SpBase<eT,T1>& X);
@@ -60,6 +62,8 @@ class SpCol : public SpMat<eT>
arma_warn_unused inline const SpOp<SpCol<eT>,spop_htrans> ht() const;
arma_warn_unused inline const SpOp<SpCol<eT>,spop_strans> st() const;
arma_warn_unused inline const SpToDOp<SpCol<eT>,op_sp_as_dense> as_dense() const;
inline void shed_row (const uword row_num);
inline void shed_rows(const uword in_row1, const uword in_row2);
+51 -29
View File
@@ -26,7 +26,7 @@ inline
SpCol<eT>::SpCol()
: SpMat<eT>(arma_vec_indicator(), 1)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -36,7 +36,7 @@ inline
SpCol<eT>::SpCol(const uword in_n_elem)
: SpMat<eT>(arma_vec_indicator(), in_n_elem, 1, 1)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -46,7 +46,7 @@ inline
SpCol<eT>::SpCol(const uword in_n_rows, const uword in_n_cols)
: SpMat<eT>(arma_vec_indicator(), in_n_rows, in_n_cols, 1)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -56,7 +56,7 @@ inline
SpCol<eT>::SpCol(const SizeMat& s)
: SpMat<eT>(arma_vec_indicator(), 0, 0, 1)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpMat<eT>::init(s.n_rows, s.n_cols);
}
@@ -68,7 +68,7 @@ inline
SpCol<eT>::SpCol(const char* text)
: SpMat<eT>(arma_vec_indicator(), 1)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpMat<eT>::init(std::string(text));
}
@@ -80,7 +80,7 @@ inline
SpCol<eT>&
SpCol<eT>::operator=(const char* text)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpMat<eT>::init(std::string(text));
@@ -94,7 +94,7 @@ inline
SpCol<eT>::SpCol(const std::string& text)
: SpMat<eT>(arma_vec_indicator(), 1)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpMat<eT>::init(text);
}
@@ -106,7 +106,7 @@ inline
SpCol<eT>&
SpCol<eT>::operator=(const std::string& text)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpMat<eT>::init(text);
@@ -120,7 +120,7 @@ inline
SpCol<eT>&
SpCol<eT>::operator=(const eT val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpMat<eT>::operator=(val);
@@ -135,20 +135,32 @@ inline
SpCol<eT>::SpCol(const Base<eT,T1>& X)
: SpMat<eT>(arma_vec_indicator(), 1)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpMat<eT>::operator=(X.get_ref());
}
template<typename eT>
inline
SpCol<eT>::SpCol(const Col<eT>& X)
: SpMat<eT>(arma_vec_indicator(), 1)
{
arma_debug_sigprint();
SpMat<eT>::operator=(X);
}
template<typename eT>
template<typename T1>
inline
SpCol<eT>&
SpCol<eT>::operator=(const Base<eT,T1>& X)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpMat<eT>::operator=(X.get_ref());
@@ -163,7 +175,7 @@ inline
SpCol<eT>::SpCol(const SpBase<eT,T1>& X)
: SpMat<eT>(arma_vec_indicator(), 1)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpMat<eT>::operator=(X.get_ref());
}
@@ -176,7 +188,7 @@ inline
SpCol<eT>&
SpCol<eT>::operator=(const SpBase<eT,T1>& X)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpMat<eT>::operator=(X.get_ref());
@@ -195,7 +207,7 @@ SpCol<eT>::SpCol
)
: SpMat<eT>(arma_vec_indicator(), 1)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpMat<eT>::init(A,B);
}
@@ -232,15 +244,25 @@ SpCol<eT>::st() const
template<typename eT>
inline
const SpToDOp<SpCol<eT>,op_sp_as_dense>
SpCol<eT>::as_dense() const
{
return SpToDOp<SpCol<eT>,op_sp_as_dense>(*this);
}
//! remove specified row
template<typename eT>
inline
void
SpCol<eT>::shed_row(const uword row_num)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_debug_check_bounds( row_num >= SpMat<eT>::n_rows, "SpCol::shed_row(): out of bounds" );
arma_conform_check_bounds( row_num >= SpMat<eT>::n_rows, "SpCol::shed_row(): out of bounds" );
shed_rows(row_num, row_num);
}
@@ -253,9 +275,9 @@ inline
void
SpCol<eT>::shed_rows(const uword in_row1, const uword in_row2)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_debug_check_bounds
arma_conform_check_bounds
(
(in_row1 > in_row2) || (in_row2 >= SpMat<eT>::n_rows),
"SpCol::shed_rows(): indices out of bounds or incorrectly used"
@@ -339,11 +361,11 @@ SpCol<eT>::shed_rows(const uword in_row1, const uword in_row2)
// void
// SpCol<eT>::insert_rows(const uword row_num, const uword N, const bool set_to_zero)
// {
// arma_extra_debug_sigprint();
// arma_debug_sigprint();
//
// arma_debug_check(set_to_zero == false, "SpCol::insert_rows(): cannot set nonzero values");
// arma_conform_check(set_to_zero == false, "SpCol::insert_rows(): cannot set nonzero values");
//
// arma_debug_check_bounds((row_num > SpMat<eT>::n_rows), "SpCol::insert_rows(): out of bounds");
// arma_conform_check_bounds((row_num > SpMat<eT>::n_rows), "SpCol::insert_rows(): out of bounds");
//
// for(uword row = 0; row < SpMat<eT>::n_rows; ++row)
// {
@@ -364,9 +386,9 @@ inline
typename SpCol<eT>::row_iterator
SpCol<eT>::begin_row(const uword row_num)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_debug_check_bounds( (row_num >= SpMat<eT>::n_rows), "SpCol::begin_row(): index out of bounds" );
arma_conform_check_bounds( (row_num >= SpMat<eT>::n_rows), "SpCol::begin_row(): index out of bounds" );
SpMat<eT>::sync_csc();
@@ -380,9 +402,9 @@ inline
typename SpCol<eT>::const_row_iterator
SpCol<eT>::begin_row(const uword row_num) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_debug_check_bounds( (row_num >= SpMat<eT>::n_rows), "SpCol::begin_row(): index out of bounds" );
arma_conform_check_bounds( (row_num >= SpMat<eT>::n_rows), "SpCol::begin_row(): index out of bounds" );
SpMat<eT>::sync_csc();
@@ -396,9 +418,9 @@ inline
typename SpCol<eT>::row_iterator
SpCol<eT>::end_row(const uword row_num)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_debug_check_bounds( (row_num >= SpMat<eT>::n_rows), "SpCol::end_row(): index out of bounds" );
arma_conform_check_bounds( (row_num >= SpMat<eT>::n_rows), "SpCol::end_row(): index out of bounds" );
SpMat<eT>::sync_csc();
@@ -412,9 +434,9 @@ inline
typename SpCol<eT>::const_row_iterator
SpCol<eT>::end_row(const uword row_num) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_debug_check_bounds( (row_num >= SpMat<eT>::n_rows), "SpCol::end_row(): index out of bounds" );
arma_conform_check_bounds( (row_num >= SpMat<eT>::n_rows), "SpCol::end_row(): index out of bounds" );
SpMat<eT>::sync_csc();
+3 -3
View File
@@ -27,7 +27,7 @@ SpGlue<T1,T2,spglue_type>::SpGlue(const T1& in_A, const T2& in_B)
: A(in_A)
, B(in_B)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -39,7 +39,7 @@ SpGlue<T1,T2,spglue_type>::SpGlue(const T1& in_A, const T2& in_B, const typename
, B(in_B)
, aux(in_aux)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -48,7 +48,7 @@ template<typename T1, typename T2, typename spglue_type>
inline
SpGlue<T1,T2,spglue_type>::~SpGlue()
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
+13 -12
View File
@@ -140,9 +140,6 @@ class SpMat : public SpBase< eT, SpMat<eT> >
template<typename T1> inline SpMat& operator/=(const Op<T1, op_diagmat>& expr);
template<typename T1> inline SpMat& operator%=(const Op<T1, op_diagmat>& expr);
//! explicit specification of sparse +/- scalar
template<typename T1, typename op_type> inline explicit SpMat(const SpToDOp<T1, op_type>& expr);
//! construction of complex matrix out of two non-complex matrices
template<typename T1, typename T2>
inline explicit SpMat(const SpBase<pod_type, T1>& A, const SpBase<pod_type, T2>& B);
@@ -171,7 +168,6 @@ class SpMat : public SpBase< eT, SpMat<eT> >
inline SpMat& operator%=(const spdiagview<eT>& X);
inline SpMat& operator/=(const spdiagview<eT>& X);
// delayed unary ops
template<typename T1, typename spop_type> inline SpMat(const SpOp<T1, spop_type>& X);
template<typename T1, typename spop_type> inline SpMat& operator= (const SpOp<T1, spop_type>& X);
template<typename T1, typename spop_type> inline SpMat& operator+=(const SpOp<T1, spop_type>& X);
@@ -180,7 +176,6 @@ class SpMat : public SpBase< eT, SpMat<eT> >
template<typename T1, typename spop_type> inline SpMat& operator%=(const SpOp<T1, spop_type>& X);
template<typename T1, typename spop_type> inline SpMat& operator/=(const SpOp<T1, spop_type>& X);
// delayed binary ops
template<typename T1, typename T2, typename spglue_type> inline SpMat(const SpGlue<T1, T2, spglue_type>& X);
template<typename T1, typename T2, typename spglue_type> inline SpMat& operator= (const SpGlue<T1, T2, spglue_type>& X);
template<typename T1, typename T2, typename spglue_type> inline SpMat& operator+=(const SpGlue<T1, T2, spglue_type>& X);
@@ -189,7 +184,6 @@ class SpMat : public SpBase< eT, SpMat<eT> >
template<typename T1, typename T2, typename spglue_type> inline SpMat& operator%=(const SpGlue<T1, T2, spglue_type>& X);
template<typename T1, typename T2, typename spglue_type> inline SpMat& operator/=(const SpGlue<T1, T2, spglue_type>& X);
// delayed mixed-type unary ops
template<typename T1, typename spop_type> inline SpMat(const mtSpOp<eT, T1, spop_type>& X);
template<typename T1, typename spop_type> inline SpMat& operator= (const mtSpOp<eT, T1, spop_type>& X);
template<typename T1, typename spop_type> inline SpMat& operator+=(const mtSpOp<eT, T1, spop_type>& X);
@@ -198,7 +192,6 @@ class SpMat : public SpBase< eT, SpMat<eT> >
template<typename T1, typename spop_type> inline SpMat& operator%=(const mtSpOp<eT, T1, spop_type>& X);
template<typename T1, typename spop_type> inline SpMat& operator/=(const mtSpOp<eT, T1, spop_type>& X);
// delayed mixed-type binary ops
template<typename T1, typename T2, typename spglue_type> inline SpMat(const mtSpGlue<eT, T1, T2, spglue_type>& X);
template<typename T1, typename T2, typename spglue_type> inline SpMat& operator= (const mtSpGlue<eT, T1, T2, spglue_type>& X);
template<typename T1, typename T2, typename spglue_type> inline SpMat& operator+=(const mtSpGlue<eT, T1, T2, spglue_type>& X);
@@ -207,6 +200,14 @@ class SpMat : public SpBase< eT, SpMat<eT> >
template<typename T1, typename T2, typename spglue_type> inline SpMat& operator%=(const mtSpGlue<eT, T1, T2, spglue_type>& X);
template<typename T1, typename T2, typename spglue_type> inline SpMat& operator/=(const mtSpGlue<eT, T1, T2, spglue_type>& X);
template<typename T1, typename op_type> inline SpMat(const mtSpReduceOp<eT, T1, op_type>& X);
template<typename T1, typename op_type> inline SpMat& operator= (const mtSpReduceOp<eT, T1, op_type>& X);
template<typename T1, typename op_type> inline SpMat& operator+=(const mtSpReduceOp<eT, T1, op_type>& X);
template<typename T1, typename op_type> inline SpMat& operator-=(const mtSpReduceOp<eT, T1, op_type>& X);
template<typename T1, typename op_type> inline SpMat& operator*=(const mtSpReduceOp<eT, T1, op_type>& X);
template<typename T1, typename op_type> inline SpMat& operator%=(const mtSpReduceOp<eT, T1, op_type>& X);
template<typename T1, typename op_type> inline SpMat& operator/=(const mtSpReduceOp<eT, T1, op_type>& X);
arma_inline SpSubview_row<eT> row(const uword row_num);
arma_inline const SpSubview_row<eT> row(const uword row_num) const;
@@ -398,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_deprecated inline bool quiet_save(const std::string name, const file_type type = arma_binary) const;
arma_deprecated inline bool quiet_save( std::ostream& os, const file_type type = arma_binary) const;
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;
arma_deprecated inline bool quiet_load(const std::string name, const file_type type = arma_binary);
arma_deprecated inline bool quiet_load( std::istream& is, const file_type type = arma_binary);
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);
@@ -695,7 +696,7 @@ class SpMat : public SpBase< eT, SpMat<eT> >
// 1: CSC needs to be updated from cache (ie. cache has more recent data)
// 2: no update required (ie. CSC and cache contain the same data)
#if (!defined(ARMA_DONT_USE_STD_MUTEX))
#if defined(ARMA_USE_STD_MUTEX)
arma_aligned mutable std::mutex cache_mutex;
#endif
File diff suppressed because it is too large Load Diff
+4 -4
View File
@@ -40,10 +40,10 @@ class SpOp : public SpBase< typename T1::elem_type, SpOp<T1, op_type> >
arma_inline bool is_alias(const SpMat<elem_type>& X) const;
arma_aligned const T1& m; //!< the operand; must be derived from SpBase
arma_aligned elem_type aux; //!< auxiliary data, using the element type as used by T1
arma_aligned uword aux_uword_a; //!< auxiliary data, uword format
arma_aligned uword aux_uword_b; //!< auxiliary data, uword format
const T1& m; //!< the operand; must be derived from SpBase
elem_type aux; //!< auxiliary data, using the element type as used by T1
uword aux_uword_a; //!< auxiliary data, uword format
uword aux_uword_b; //!< auxiliary data, uword format
};
+4 -4
View File
@@ -26,7 +26,7 @@ inline
SpOp<T1, op_type>::SpOp(const T1& in_m)
: m(in_m)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -37,7 +37,7 @@ SpOp<T1, op_type>::SpOp(const T1& in_m, const typename T1::elem_type in_aux)
: m(in_m)
, aux(in_aux)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -49,7 +49,7 @@ SpOp<T1, op_type>::SpOp(const T1& in_m, const uword in_aux_uword_a, const uword
, aux_uword_a(in_aux_uword_a)
, aux_uword_b(in_aux_uword_b)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -58,7 +58,7 @@ template<typename T1, typename op_type>
inline
SpOp<T1, op_type>::~SpOp()
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
+127 -76
View File
@@ -25,43 +25,43 @@
// within each specialisation of the Proxy class:
//
// elem_type = the type of the elements obtained from object Q
// pod_type = the underlying type of elements if elem_type is std::complex
// stored_type = the type of the Q object
// elem_type = type of the elements obtained from object Q
// pod_type = underlying type of elements if elem_type is std::complex
// stored_type = type of Q object
//
// const_iterator_type = the type of iterator provided by begin() and begin_col()
// const_row_iterator_type = the type of iterator provided by begin_row()
// const_iterator_type = type of iterator provided by begin() and begin_col()
// const_row_iterator_type = type of iterator provided by begin_row()
//
// use_iterator = boolean indicating that the provided iterators must be used for accessing elements
// Q_is_generated = boolean indicating that the Q object was generated by SpProxy
// use_iterator = boolean to indicate that provided iterators must be used for accessing elements
// Q_is_generated = boolean to indicate Q object was generated by SpProxy
//
// is_row = boolean indicating whether the Q object can be treated a row vector
// is_col = boolean indicating whether the Q object can be treated a column vector
// is_xvec = boolean indicating whether the Q object is a vector with unknown orientation
// is_row = boolean to indicate Q object can be treated a row vector
// is_col = boolean to indicate Q object can be treated a column vector
// is_xvec = boolean to indicate Q object is a vector with unknown orientation
//
// Q = object that can be unwrapped via the unwrap_spmat family of classes (ie. Q must be convertible to SpMat)
// Q = object that can be unwrapped via unwrap_spmat family of classes (ie. Q must be convertible to SpMat)
//
// get_n_rows() = return the number of rows in Q
// get_n_cols() = return the number of columns in Q
// get_n_elem() = return the number of elements in Q
// get_n_nonzero() = return the number of non-zero elements in Q
// get_n_rows() = return number of rows in Q
// get_n_cols() = return number of columns in Q
// get_n_elem() = return number of elements in Q
// get_n_nonzero() = return number of non-zero elements in Q
//
// operator[i] = linear element accessor; valid only if the 'use_iterator' boolean is false
// at(row,col) = access elements via (row,col); valid only if the 'use_iterator' boolean is false
//
// get_values() = return pointer to the CSC values array in Q; valid only if the 'use_iterator' boolean is false
// get_row_indices() = return pointer to the CSC row indices array in Q; valid only if the 'use_iterator' boolean is false
// get_col_ptrs() = return pointer to the CSC column pointers array in Q; valid only if the 'use_iterator' boolean is false
// get_values() = return pointer to CSC values array in Q; valid only if the 'use_iterator' boolean is false
// get_row_indices() = return pointer to CSC row indices array in Q; valid only if the 'use_iterator' boolean is false
// get_col_ptrs() = return pointer to CSC column pointers array in Q; valid only if the 'use_iterator' boolean is false
//
// begin() = column-wise iterator indicating the first element in Q
// begin_col(col_num) = column-wise iterator indicating the first element in column 'col_num' in Q
// begin_row(row_num = 0) = row-wise iterator indicating the first element in row 'row_num' in Q
// begin() = column-wise iterator indicating first element in Q
// begin_col(col_num) = column-wise iterator indicating first element in column 'col_num' in Q
// begin_row(row_num = 0) = row-wise iterator indicating first element in row 'row_num' in Q
//
// end() = column-wise iterator indicating the "one-past-end" element in Q
// end_row() = row-wise iterator indicating the "one-past-end" element in Q
// end_row(row_num) = row-wise iterator indicating the "one-past-end" element in row 'row_num' in Q
// end() = column-wise iterator indicating "one-past-end" element in Q
// end_row() = row-wise iterator indicating "one-past-end" element in Q
// end_row(row_num) = row-wise iterator indicating "one-past-end" element in row 'row_num' in Q
//
// is_alias(X) = return true/false indicating whether the Q object aliases matrix X
// is_alias(X) = return true/false to indicate Q object aliases matrix X
@@ -71,48 +71,48 @@ struct SpProxy< SpMat<eT> >
typedef eT elem_type;
typedef typename get_pod_type<elem_type>::result pod_type;
typedef SpMat<eT> stored_type;
typedef typename SpMat<eT>::const_iterator const_iterator_type;
typedef typename SpMat<eT>::const_row_iterator const_row_iterator_type;
static constexpr bool use_iterator = false;
static constexpr bool Q_is_generated = false;
static constexpr bool is_row = false;
static constexpr bool is_col = false;
static constexpr bool is_xvec = false;
arma_aligned const SpMat<eT>& Q;
const SpMat<eT>& Q;
inline explicit SpProxy(const SpMat<eT>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
Q.sync();
}
arma_inline uword get_n_rows() const { return Q.n_rows; }
arma_inline uword get_n_cols() const { return Q.n_cols; }
arma_inline uword get_n_elem() const { return Q.n_elem; }
arma_inline uword get_n_nonzero() const { return Q.n_nonzero; }
arma_inline elem_type operator[](const uword i) const { return Q[i]; }
arma_inline elem_type at (const uword row, const uword col) const { return Q.at(row, col); }
arma_inline const eT* get_values() const { return Q.values; }
arma_inline const uword* get_row_indices() const { return Q.row_indices; }
arma_inline const uword* get_col_ptrs() const { return Q.col_ptrs; }
arma_inline const_iterator_type begin() const { return Q.begin(); }
arma_inline const_iterator_type begin_col(const uword col_num) const { return Q.begin_col(col_num); }
arma_inline const_row_iterator_type begin_row(const uword row_num = 0) const { return Q.begin_row(row_num); }
arma_inline const_iterator_type end() const { return Q.end(); }
arma_inline const_row_iterator_type end_row() const { return Q.end_row(); }
arma_inline const_row_iterator_type end_row(const uword row_num) const { return Q.end_row(row_num); }
template<typename eT2>
arma_inline bool is_alias(const SpMat<eT2>& X) const { return (void_ptr(&Q) == void_ptr(&X)); }
arma_inline bool is_alias(const SpMat<eT2>& X) const { return (is_same_type<eT,eT2>::yes) && (void_ptr(&Q) == void_ptr(&X)); }
};
@@ -134,12 +134,12 @@ struct SpProxy< SpCol<eT> >
static constexpr bool is_col = true;
static constexpr bool is_xvec = false;
arma_aligned const SpCol<eT>& Q;
const SpCol<eT>& Q;
inline explicit SpProxy(const SpCol<eT>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
Q.sync();
}
@@ -164,7 +164,7 @@ struct SpProxy< SpCol<eT> >
arma_inline const_row_iterator_type end_row(const uword row_num) const { return Q.end_row(row_num); }
template<typename eT2>
arma_inline bool is_alias(const SpMat<eT2>& X) const { return (void_ptr(&Q) == void_ptr(&X)); }
arma_inline bool is_alias(const SpMat<eT2>& X) const { return (is_same_type<eT,eT2>::yes) && (void_ptr(&Q) == void_ptr(&X)); }
};
@@ -186,12 +186,12 @@ struct SpProxy< SpRow<eT> >
static constexpr bool is_col = false;
static constexpr bool is_xvec = false;
arma_aligned const SpRow<eT>& Q;
const SpRow<eT>& Q;
inline explicit SpProxy(const SpRow<eT>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
Q.sync();
}
@@ -216,7 +216,7 @@ struct SpProxy< SpRow<eT> >
arma_inline const_row_iterator_type end_row(const uword row_num) const { return Q.end_row(row_num); }
template<typename eT2>
arma_inline bool is_alias(const SpMat<eT2>& X) const { return (void_ptr(&Q) == void_ptr(&X)); }
arma_inline bool is_alias(const SpMat<eT2>& X) const { return (is_same_type<eT,eT2>::yes) && (void_ptr(&Q) == void_ptr(&X)); }
};
@@ -227,48 +227,48 @@ struct SpProxy< SpSubview<eT> >
typedef eT elem_type;
typedef typename get_pod_type<elem_type>::result pod_type;
typedef SpSubview<eT> stored_type;
typedef typename SpSubview<eT>::const_iterator const_iterator_type;
typedef typename SpSubview<eT>::const_row_iterator const_row_iterator_type;
static constexpr bool use_iterator = true;
static constexpr bool Q_is_generated = false;
static constexpr bool is_row = false;
static constexpr bool is_col = false;
static constexpr bool is_xvec = false;
arma_aligned const SpSubview<eT>& Q;
const SpSubview<eT>& Q;
inline explicit SpProxy(const SpSubview<eT>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
Q.m.sync();
}
arma_inline uword get_n_rows() const { return Q.n_rows; }
arma_inline uword get_n_cols() const { return Q.n_cols; }
arma_inline uword get_n_elem() const { return Q.n_elem; }
arma_inline uword get_n_nonzero() const { return Q.n_nonzero; }
arma_inline elem_type operator[](const uword i) const { return Q[i]; }
arma_inline elem_type at (const uword row, const uword col) const { return Q.at(row, col); }
arma_inline const eT* get_values() const { return Q.m.values; }
arma_inline const uword* get_row_indices() const { return Q.m.row_indices; }
arma_inline const uword* get_col_ptrs() const { return Q.m.col_ptrs; }
arma_inline const_iterator_type begin() const { return Q.begin(); }
arma_inline const_iterator_type begin_col(const uword col_num) const { return Q.begin_col(col_num); }
arma_inline const_row_iterator_type begin_row(const uword row_num = 0) const { return Q.begin_row(row_num); }
arma_inline const_iterator_type end() const { return Q.end(); }
arma_inline const_row_iterator_type end_row() const { return Q.end_row(); }
arma_inline const_row_iterator_type end_row(const uword row_num) const { return Q.end_row(row_num); }
template<typename eT2>
arma_inline bool is_alias(const SpMat<eT2>& X) const { return (void_ptr(&Q.m) == void_ptr(&X)); }
arma_inline bool is_alias(const SpMat<eT2>& X) const { return (is_same_type<eT,eT2>::yes) && (void_ptr(&Q.m) == void_ptr(&X)); }
};
@@ -290,12 +290,12 @@ struct SpProxy< SpSubview_col<eT> >
static constexpr bool is_col = true;
static constexpr bool is_xvec = false;
arma_aligned const SpSubview_col<eT>& Q;
const SpSubview_col<eT>& Q;
inline explicit SpProxy(const SpSubview_col<eT>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
Q.m.sync();
}
@@ -320,7 +320,7 @@ struct SpProxy< SpSubview_col<eT> >
arma_inline const_row_iterator_type end_row(const uword row_num) const { return Q.end_row(row_num); }
template<typename eT2>
arma_inline bool is_alias(const SpMat<eT2>& X) const { return (void_ptr(&Q.m) == void_ptr(&X)); }
arma_inline bool is_alias(const SpMat<eT2>& X) const { return (is_same_type<eT,eT2>::yes) && (void_ptr(&Q.m) == void_ptr(&X)); }
};
@@ -342,12 +342,12 @@ struct SpProxy< SpSubview_col_list<eT,T1> >
static constexpr bool is_col = false;
static constexpr bool is_xvec = false;
arma_aligned const SpMat<eT> Q;
const SpMat<eT> Q;
inline explicit SpProxy(const SpSubview_col_list<eT,T1>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return Q.n_rows; }
@@ -385,7 +385,7 @@ struct SpProxy< SpSubview_row<eT> >
typedef typename SpSubview<eT>::const_iterator const_iterator_type;
typedef typename SpSubview<eT>::const_row_iterator const_row_iterator_type;
static constexpr bool use_iterator = true;
static constexpr bool Q_is_generated = false;
@@ -393,12 +393,12 @@ struct SpProxy< SpSubview_row<eT> >
static constexpr bool is_col = false;
static constexpr bool is_xvec = false;
arma_aligned const SpSubview_row<eT>& Q;
const SpSubview_row<eT>& Q;
inline explicit SpProxy(const SpSubview_row<eT>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
Q.m.sync();
}
@@ -423,7 +423,7 @@ struct SpProxy< SpSubview_row<eT> >
arma_inline const_row_iterator_type end_row(const uword row_num) const { return Q.end_row(row_num); }
template<typename eT2>
arma_inline bool is_alias(const SpMat<eT2>& X) const { return (void_ptr(&Q.m) == void_ptr(&X)); }
arma_inline bool is_alias(const SpMat<eT2>& X) const { return (is_same_type<eT,eT2>::yes) && (void_ptr(&Q.m) == void_ptr(&X)); }
};
@@ -445,12 +445,12 @@ struct SpProxy< spdiagview<eT> >
static constexpr bool is_col = true;
static constexpr bool is_xvec = false;
arma_aligned const SpMat<eT> Q;
const SpMat<eT> Q;
inline explicit SpProxy(const spdiagview<eT>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return Q.n_rows; }
@@ -497,12 +497,12 @@ struct SpProxy< SpOp<T1, spop_type> >
static constexpr bool is_col = SpOp<T1, spop_type>::is_col;
static constexpr bool is_xvec = SpOp<T1, spop_type>::is_xvec;
arma_aligned const SpMat<eT> Q;
const SpMat<eT> Q;
inline explicit SpProxy(const SpOp<T1, spop_type>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return is_row ? 1 : Q.n_rows; }
@@ -549,12 +549,12 @@ struct SpProxy< SpGlue<T1, T2, spglue_type> >
static constexpr bool is_col = SpGlue<T1, T2, spglue_type>::is_col;
static constexpr bool is_xvec = SpGlue<T1, T2, spglue_type>::is_xvec;
arma_aligned const SpMat<eT> Q;
const SpMat<eT> Q;
inline explicit SpProxy(const SpGlue<T1, T2, spglue_type>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return is_row ? 1 : Q.n_rows; }
@@ -600,12 +600,12 @@ struct SpProxy< mtSpOp<out_eT, T1, spop_type> >
static constexpr bool is_col = mtSpOp<out_eT, T1, spop_type>::is_col;
static constexpr bool is_xvec = mtSpOp<out_eT, T1, spop_type>::is_xvec;
arma_aligned const SpMat<out_eT> Q;
const SpMat<out_eT> Q;
inline explicit SpProxy(const mtSpOp<out_eT, T1, spop_type>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return is_row ? 1 : Q.n_rows; }
@@ -651,12 +651,63 @@ struct SpProxy< mtSpGlue<out_eT, T1, T2, spglue_type> >
static constexpr bool is_col = mtSpGlue<out_eT, T1, T2, spglue_type>::is_col;
static constexpr bool is_xvec = mtSpGlue<out_eT, T1, T2, spglue_type>::is_xvec;
arma_aligned const SpMat<out_eT> Q;
const SpMat<out_eT> Q;
inline explicit SpProxy(const mtSpGlue<out_eT, T1, T2, spglue_type>& A)
: Q(A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return is_row ? 1 : Q.n_rows; }
arma_inline uword get_n_cols() const { return is_col ? 1 : Q.n_cols; }
arma_inline uword get_n_elem() const { return Q.n_elem; }
arma_inline uword get_n_nonzero() const { return Q.n_nonzero; }
arma_inline elem_type operator[](const uword i) const { return Q[i]; }
arma_inline elem_type at (const uword row, const uword col) const { return Q.at(row, col); }
arma_inline const out_eT* get_values() const { return Q.values; }
arma_inline const uword* get_row_indices() const { return Q.row_indices; }
arma_inline const uword* get_col_ptrs() const { return Q.col_ptrs; }
arma_inline const_iterator_type begin() const { return Q.begin(); }
arma_inline const_iterator_type begin_col(const uword col_num) const { return Q.begin_col(col_num); }
arma_inline const_row_iterator_type begin_row(const uword row_num = 0) const { return Q.begin_row(row_num); }
arma_inline const_iterator_type end() const { return Q.end(); }
arma_inline const_row_iterator_type end_row() const { return Q.end_row(); }
arma_inline const_row_iterator_type end_row(const uword row_num) const { return Q.end_row(row_num); }
template<typename eT2>
constexpr bool is_alias(const SpMat<eT2>&) const { return false; }
};
template<typename out_eT, typename T1, typename op_type>
struct SpProxy< mtSpReduceOp<out_eT, T1, op_type> >
{
typedef out_eT elem_type;
typedef typename get_pod_type<elem_type>::result pod_type;
typedef SpMat<out_eT> stored_type;
typedef typename SpMat<out_eT>::const_iterator const_iterator_type;
typedef typename SpMat<out_eT>::const_row_iterator const_row_iterator_type;
static constexpr bool use_iterator = false;
static constexpr bool Q_is_generated = true;
static constexpr bool is_row = mtSpReduceOp<out_eT, T1, op_type>::is_row;
static constexpr bool is_col = mtSpReduceOp<out_eT, T1, op_type>::is_col;
static constexpr bool is_xvec = mtSpReduceOp<out_eT, T1, op_type>::is_xvec;
const SpMat<out_eT> Q;
inline explicit SpProxy(const mtSpReduceOp<out_eT, T1, op_type>& A)
: Q(A)
{
arma_debug_sigprint();
}
arma_inline uword get_n_rows() const { return is_row ? 1 : Q.n_rows; }
+6 -2
View File
@@ -25,7 +25,7 @@ template<typename eT>
class SpRow : public SpMat<eT>
{
public:
typedef eT elem_type;
typedef typename get_pod_type<eT>::result pod_type;
@@ -47,7 +47,9 @@ class SpRow : public SpMat<eT>
inline SpRow& operator=(const eT val);
template<typename T1> inline SpRow(const Base<eT,T1>& X);
inline SpRow(const Row<eT>& X); // for backwards compatibility
template<typename T1> inline explicit SpRow(const Base<eT,T1>& X);
template<typename T1> inline SpRow& operator=(const Base<eT,T1>& X);
template<typename T1> inline SpRow(const SpBase<eT,T1>& X);
@@ -60,6 +62,8 @@ class SpRow : public SpMat<eT>
arma_warn_unused inline const SpOp<SpRow<eT>,spop_htrans> ht() const;
arma_warn_unused inline const SpOp<SpRow<eT>,spop_strans> st() const;
arma_warn_unused inline const SpToDOp<SpRow<eT>,op_sp_as_dense> as_dense() const;
inline void shed_col (const uword col_num);
inline void shed_cols(const uword in_col1, const uword in_col2);
+53 -29
View File
@@ -26,7 +26,7 @@ inline
SpRow<eT>::SpRow()
: SpMat<eT>(arma_vec_indicator(), 2)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -36,7 +36,7 @@ inline
SpRow<eT>::SpRow(const uword in_n_elem)
: SpMat<eT>(arma_vec_indicator(), 1, in_n_elem, 2)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -46,7 +46,7 @@ inline
SpRow<eT>::SpRow(const uword in_n_rows, const uword in_n_cols)
: SpMat<eT>(arma_vec_indicator(), in_n_rows, in_n_cols, 2)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -56,7 +56,7 @@ inline
SpRow<eT>::SpRow(const SizeMat& s)
: SpMat<eT>(arma_vec_indicator(), 0, 0, 2)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpMat<eT>::init(s.n_rows, s.n_cols);
}
@@ -68,7 +68,7 @@ inline
SpRow<eT>::SpRow(const char* text)
: SpMat<eT>(arma_vec_indicator(), 2)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpMat<eT>::init(std::string(text));
}
@@ -80,7 +80,7 @@ inline
SpRow<eT>&
SpRow<eT>::operator=(const char* text)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpMat<eT>::init(std::string(text));
@@ -94,7 +94,7 @@ inline
SpRow<eT>::SpRow(const std::string& text)
: SpMat<eT>(arma_vec_indicator(), 2)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpMat<eT>::init(text);
}
@@ -106,7 +106,7 @@ inline
SpRow<eT>&
SpRow<eT>::operator=(const std::string& text)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpMat<eT>::init(text);
@@ -120,7 +120,7 @@ inline
SpRow<eT>&
SpRow<eT>::operator=(const eT val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpMat<eT>::operator=(val);
@@ -135,20 +135,34 @@ inline
SpRow<eT>::SpRow(const Base<eT,T1>& X)
: SpMat<eT>(arma_vec_indicator(), 2)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpMat<eT>::operator=(X.get_ref());
}
template<typename eT>
inline
SpRow<eT>::SpRow(const Row<eT>& X)
: SpMat<eT>(arma_vec_indicator(), 2)
{
arma_debug_sigprint();
SpMat<eT>::operator=(X);
}
template<typename eT>
template<typename T1>
inline
SpRow<eT>&
SpRow<eT>::operator=(const Base<eT,T1>& X)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpMat<eT>::operator=(X.get_ref());
@@ -163,7 +177,7 @@ inline
SpRow<eT>::SpRow(const SpBase<eT,T1>& X)
: SpMat<eT>(arma_vec_indicator(), 2)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpMat<eT>::operator=(X.get_ref());
}
@@ -176,7 +190,7 @@ inline
SpRow<eT>&
SpRow<eT>::operator=(const SpBase<eT,T1>& X)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpMat<eT>::operator=(X.get_ref());
@@ -195,7 +209,7 @@ SpRow<eT>::SpRow
)
: SpMat<eT>(arma_vec_indicator(), 2)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpMat<eT>::init(A,B);
}
@@ -232,15 +246,25 @@ SpRow<eT>::st() const
template<typename eT>
inline
const SpToDOp<SpRow<eT>,op_sp_as_dense>
SpRow<eT>::as_dense() const
{
return SpToDOp<SpRow<eT>,op_sp_as_dense>(*this);
}
//! remove specified columns
template<typename eT>
inline
void
SpRow<eT>::shed_col(const uword col_num)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_debug_check_bounds( col_num >= SpMat<eT>::n_cols, "SpRow::shed_col(): out of bounds" );
arma_conform_check_bounds( col_num >= SpMat<eT>::n_cols, "SpRow::shed_col(): out of bounds" );
shed_cols(col_num, col_num);
}
@@ -253,9 +277,9 @@ inline
void
SpRow<eT>::shed_cols(const uword in_col1, const uword in_col2)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_debug_check_bounds
arma_conform_check_bounds
(
(in_col1 > in_col2) || (in_col2 >= SpMat<eT>::n_cols),
"SpRow::shed_cols(): indices out of bounds or incorrectly used"
@@ -335,12 +359,12 @@ SpRow<eT>::shed_cols(const uword in_col1, const uword in_col2)
// void
// SpRow<eT>::insert_cols(const uword col_num, const uword N, const bool set_to_zero)
// {
// arma_extra_debug_sigprint();
// arma_debug_sigprint();
//
// // insertion at col_num == n_cols is in effect an append operation
// arma_debug_check_bounds( (col_num > SpMat<eT>::n_cols), "SpRow::insert_cols(): out of bounds" );
// arma_conform_check_bounds( (col_num > SpMat<eT>::n_cols), "SpRow::insert_cols(): out of bounds" );
//
// arma_debug_check( (set_to_zero == false), "SpRow::insert_cols(): cannot set elements to nonzero values" );
// arma_conform_check( (set_to_zero == false), "SpRow::insert_cols(): cannot set elements to nonzero values" );
//
// uword newVal = (col_num == 0) ? 0 : SpMat<eT>::col_ptrs[col_num];
// SpMat<eT>::col_ptrs.insert(col_num, N, newVal);
@@ -364,11 +388,11 @@ inline
typename SpRow<eT>::row_iterator
SpRow<eT>::begin_row(const uword row_num)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
// Since this is a row, row_num can only be 0. But the option is provided for
// compatibility.
arma_debug_check_bounds((row_num >= 1), "SpRow::begin_row(): index out of bounds");
arma_conform_check_bounds((row_num >= 1), "SpRow::begin_row(): index out of bounds");
return SpMat<eT>::begin();
}
@@ -380,11 +404,11 @@ inline
typename SpRow<eT>::const_row_iterator
SpRow<eT>::begin_row(const uword row_num) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
// Since this is a row, row_num can only be 0. But the option is provided for
// compatibility.
arma_debug_check_bounds((row_num >= 1), "SpRow::begin_row(): index out of bounds");
arma_conform_check_bounds((row_num >= 1), "SpRow::begin_row(): index out of bounds");
return SpMat<eT>::begin();
}
@@ -396,11 +420,11 @@ inline
typename SpRow<eT>::row_iterator
SpRow<eT>::end_row(const uword row_num)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
// Since this is a row, row_num can only be 0. But the option is provided for
// compatibility.
arma_debug_check_bounds((row_num >= 1), "SpRow::end_row(): index out of bounds");
arma_conform_check_bounds((row_num >= 1), "SpRow::end_row(): index out of bounds");
return SpMat<eT>::end();
}
@@ -412,11 +436,11 @@ inline
typename SpRow<eT>::const_row_iterator
SpRow<eT>::end_row(const uword row_num) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
// Since this is a row, row_num can only be 0. But the option is provided for
// compatibility.
arma_debug_check_bounds((row_num >= 1), "SpRow::end_row(): index out of bounds");
arma_conform_check_bounds((row_num >= 1), "SpRow::end_row(): index out of bounds");
return SpMat<eT>::end();
}
@@ -361,6 +361,8 @@ class SpSubview_col : public SpSubview<eT>
arma_warn_unused inline const SpOp<SpSubview_col<eT>,spop_htrans> ht() const;
arma_warn_unused inline const SpOp<SpSubview_col<eT>,spop_strans> st() const;
arma_warn_unused inline const SpToDOp<SpSubview_col<eT>,op_sp_as_dense> as_dense() const;
protected:
@@ -399,6 +401,8 @@ class SpSubview_row : public SpSubview<eT>
arma_warn_unused inline const SpOp<SpSubview_row<eT>,spop_htrans> ht() const;
arma_warn_unused inline const SpOp<SpSubview_row<eT>,spop_strans> st() const;
arma_warn_unused inline const SpToDOp<SpSubview_row<eT>,op_sp_as_dense> as_dense() const;
protected:
@@ -25,7 +25,7 @@ template<typename eT, typename T1>
inline
SpSubview_col_list<eT,T1>::~SpSubview_col_list()
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -40,13 +40,13 @@ SpSubview_col_list<eT,T1>::SpSubview_col_list
: m (in_m )
, U_ci(in_ci.get_ref())
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const umat& ci = U_ci.M;
const uword* ci_mem = ci.memptr();
const uword ci_n_elem = ci.n_elem;
arma_debug_check
arma_conform_check
(
( (ci.is_vec() == false) && (ci.is_empty() == false) ),
"SpMat::cols(): given object must be a vector"
@@ -56,7 +56,7 @@ SpSubview_col_list<eT,T1>::SpSubview_col_list
{
const uword i = ci_mem[ci_count];
arma_debug_check_bounds( (i >= in_m.n_cols), "SpMat::cols(): index out of bounds" );
arma_conform_check_bounds( (i >= in_m.n_cols), "SpMat::cols(): index out of bounds" );
}
}
@@ -69,7 +69,7 @@ inline
void
SpSubview_col_list<eT,T1>::for_each(functor F)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpMat<eT> tmp(*this);
@@ -86,7 +86,7 @@ inline
void
SpSubview_col_list<eT,T1>::for_each(functor F) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const SpMat<eT> tmp(*this);
@@ -102,7 +102,7 @@ inline
void
SpSubview_col_list<eT,T1>::transform(functor F)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpMat<eT> tmp(*this);
@@ -118,7 +118,7 @@ inline
void
SpSubview_col_list<eT,T1>::replace(const eT old_val, const eT new_val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpMat<eT> tmp(*this);
@@ -134,7 +134,7 @@ inline
void
SpSubview_col_list<eT,T1>::clean(const typename get_pod_type<eT>::result threshold)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpMat<eT> tmp(*this);
@@ -150,7 +150,7 @@ inline
void
SpSubview_col_list<eT,T1>::fill(const eT val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
Mat<eT> tmp(m.n_rows, U_ci.M.n_elem, arma_nozeros_indicator()); tmp.fill(val);
@@ -164,7 +164,7 @@ inline
void
SpSubview_col_list<eT,T1>::zeros()
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpMat<eT>& m_local = const_cast< SpMat<eT>& >(m);
@@ -201,7 +201,7 @@ inline
void
SpSubview_col_list<eT,T1>::ones()
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const Mat<eT> tmp(m.n_rows, U_ci.M.n_elem, fill::ones);
@@ -215,7 +215,7 @@ inline
void
SpSubview_col_list<eT,T1>::operator+= (const eT val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const SpMat<eT> tmp1(*this);
@@ -233,7 +233,7 @@ inline
void
SpSubview_col_list<eT,T1>::operator-= (const eT val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const SpMat<eT> tmp1(*this);
@@ -251,9 +251,7 @@ inline
void
SpSubview_col_list<eT,T1>::operator*= (const eT val)
{
arma_extra_debug_sigprint();
if(val == eT(0)) { (*this).zeros(); return; }
arma_debug_sigprint();
SpMat<eT>& m_local = const_cast< SpMat<eT>& >(m);
@@ -296,7 +294,7 @@ inline
void
SpSubview_col_list<eT,T1>::operator/= (const eT val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const SpMat<eT> tmp1(*this);
@@ -315,7 +313,7 @@ inline
void
SpSubview_col_list<eT,T1>::operator= (const Base<eT,expr>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const quasi_unwrap<expr> U(x.get_ref());
const Mat<eT>& X = U.M;
@@ -326,7 +324,7 @@ SpSubview_col_list<eT,T1>::operator= (const Base<eT,expr>& x)
const uword* ci_mem = ci.memptr();
const uword ci_n_elem = ci.n_elem;
arma_debug_assert_same_size( m_local.n_rows, ci_n_elem, X.n_rows, X.n_cols, "SpMat::cols()" );
arma_conform_assert_same_size( m_local.n_rows, ci_n_elem, X.n_rows, X.n_cols, "SpMat::cols()" );
const uword X_n_elem = X.n_elem;
const eT* X_mem = X.memptr();
@@ -378,7 +376,7 @@ inline
void
SpSubview_col_list<eT,T1>::operator+= (const Base<eT,expr>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const Mat<eT> tmp = SpMat<eT>(*this) + x.get_ref();
@@ -393,7 +391,7 @@ inline
void
SpSubview_col_list<eT,T1>::operator-= (const Base<eT,expr>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const Mat<eT> tmp = SpMat<eT>(*this) - x.get_ref();
@@ -408,7 +406,7 @@ inline
void
SpSubview_col_list<eT,T1>::operator%= (const Base<eT,expr>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const SpMat<eT> tmp = SpMat<eT>(*this) % x.get_ref();
@@ -423,7 +421,7 @@ inline
void
SpSubview_col_list<eT,T1>::operator/= (const Base<eT,expr>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const SpMat<eT> tmp = SpMat<eT>(*this) / x.get_ref();
@@ -437,7 +435,7 @@ inline
void
SpSubview_col_list<eT,T1>::operator= (const SpSubview_col_list<eT,T1>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const SpMat<eT> tmp(x);
@@ -452,7 +450,7 @@ inline
void
SpSubview_col_list<eT,T1>::operator= (const SpSubview_col_list<eT,T2>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const SpMat<eT> tmp(x);
@@ -467,7 +465,7 @@ inline
void
SpSubview_col_list<eT,T1>::operator= (const SpBase<eT,expr>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const unwrap_spmat<expr> U(x.get_ref());
const SpMat<eT>& X = U.M;
@@ -487,7 +485,7 @@ SpSubview_col_list<eT,T1>::operator= (const SpBase<eT,expr>& x)
const uword* ci_mem = ci.memptr();
const uword ci_n_elem = ci.n_elem;
arma_debug_assert_same_size( m_local.n_rows, ci_n_elem, X.n_rows, X.n_cols, "SpMat::cols()" );
arma_conform_assert_same_size( m_local.n_rows, ci_n_elem, X.n_rows, X.n_cols, "SpMat::cols()" );
SpMat<eT> Y(arma_reserve_indicator(), X.n_rows, m_local.n_cols, X.n_nonzero);
@@ -531,7 +529,7 @@ inline
void
SpSubview_col_list<eT,T1>::operator+= (const SpBase<eT,expr>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const SpMat<eT> tmp = SpMat<eT>(*this) + x.get_ref();
@@ -546,7 +544,7 @@ inline
void
SpSubview_col_list<eT,T1>::operator-= (const SpBase<eT,expr>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const SpMat<eT> tmp = SpMat<eT>(*this) - x.get_ref();
@@ -561,7 +559,7 @@ inline
void
SpSubview_col_list<eT,T1>::operator%= (const SpBase<eT,expr>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const SpMat<eT> tmp = SpMat<eT>(*this) % x.get_ref();
@@ -576,7 +574,7 @@ inline
void
SpSubview_col_list<eT,T1>::operator/= (const SpBase<eT,expr>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpMat<eT> tmp(*this);
@@ -597,7 +595,7 @@ inline
void
SpSubview_col_list<eT,T1>::extract(SpMat<eT>& out, const SpSubview_col_list<eT,T1>& in)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
// NOTE: aliasing is handled by SpMat<eT>::operator=(const SpSubview_col_list<eT,T1>& in)
@@ -665,7 +663,7 @@ inline
void
SpSubview_col_list<eT,T1>::plus_inplace(SpMat<eT>& out, const SpSubview_col_list& in)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const SpMat<eT> tmp(in);
@@ -679,7 +677,7 @@ inline
void
SpSubview_col_list<eT,T1>::minus_inplace(SpMat<eT>& out, const SpSubview_col_list& in)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const SpMat<eT> tmp(in);
@@ -693,7 +691,7 @@ inline
void
SpSubview_col_list<eT,T1>::schur_inplace(SpMat<eT>& out, const SpSubview_col_list& in)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const SpMat<eT> tmp(in);
@@ -707,7 +705,7 @@ inline
void
SpSubview_col_list<eT,T1>::div_inplace(SpMat<eT>& out, const SpSubview_col_list& in)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const SpMat<eT> tmp(in);
@@ -816,7 +816,7 @@ SpSubview<eT>::const_row_iterator::operator++()
else if((*pos_ptr) == next_min_row + aux_row && col < next_min_col && (*pos_ptr) < aux_row + iterator_base::M->n_rows)
{
// The first element in this column is in a subsequent row that we
// already have another elemnt for, but the column index is less so
// already have another element for, but the column index is less so
// this element will come first.
next_min_col = col;
next_actual_pos = col_offset + (pos_ptr - start_ptr);
+136 -108
View File
@@ -24,7 +24,7 @@ template<typename eT>
inline
SpSubview<eT>::~SpSubview()
{
arma_extra_debug_sigprint_this(this);
arma_debug_sigprint_this(this);
}
@@ -40,22 +40,32 @@ SpSubview<eT>::SpSubview(const SpMat<eT>& in_m, const uword in_row1, const uword
, n_elem(in_n_rows * in_n_cols)
, n_nonzero(0)
{
arma_extra_debug_sigprint_this(this);
arma_debug_sigprint_this(this);
m.sync_csc();
// There must be a O(1) way to do this
uword lend = m.col_ptrs[in_col1 + in_n_cols];
uword lend_row = in_row1 + in_n_rows;
uword count = 0;
// count the number of non-zeros in the subview
uword count = 0;
for(uword i = m.col_ptrs[in_col1]; i < lend; ++i)
if(n_rows == m.n_rows)
{
const uword m_row_indices_i = m.row_indices[i];
count = m.col_ptrs[aux_col1 + n_cols] - m.col_ptrs[aux_col1];
}
else
{
arma_debug_print("counting non-zeros in sparse subview");
const bool condition = (m_row_indices_i >= in_row1) && (m_row_indices_i < lend_row);
uword lend = m.col_ptrs[in_col1 + in_n_cols];
uword lend_row = in_row1 + in_n_rows;
count += condition ? uword(1) : uword(0);
for(uword i = m.col_ptrs[in_col1]; i < lend; ++i)
{
const uword m_row_indices_i = m.row_indices[i];
const bool condition = (m_row_indices_i >= in_row1) && (m_row_indices_i < lend_row);
count += condition ? uword(1) : uword(0);
}
}
access::rw(n_nonzero) = count;
@@ -74,7 +84,7 @@ SpSubview<eT>::SpSubview(const SpSubview<eT>& in)
, n_elem (in.n_elem )
, n_nonzero(in.n_nonzero)
{
arma_extra_debug_sigprint(arma_str::format("this = %x in = %x") % this % &in);
arma_debug_sigprint(arma_str::format("this: %x; in: %x") % this % &in);
}
@@ -90,7 +100,7 @@ SpSubview<eT>::SpSubview(SpSubview<eT>&& in)
, n_elem (in.n_elem )
, n_nonzero(in.n_nonzero)
{
arma_extra_debug_sigprint(arma_str::format("this = %x in = %x") % this % &in);
arma_debug_sigprint(arma_str::format("this: %x; in: %x") % this % &in);
// for paranoia
@@ -109,7 +119,7 @@ inline
const SpSubview<eT>&
SpSubview<eT>::operator+=(const eT val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if(val == eT(0)) { return *this; }
@@ -127,7 +137,7 @@ inline
const SpSubview<eT>&
SpSubview<eT>::operator-=(const eT val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if(val == eT(0)) { return *this; }
@@ -145,9 +155,7 @@ inline
const SpSubview<eT>&
SpSubview<eT>::operator*=(const eT val)
{
arma_extra_debug_sigprint();
if(val == eT(0)) { (*this).zeros(); return *this; }
arma_debug_sigprint();
if((n_elem == 0) || (n_nonzero == 0)) { return *this; }
@@ -207,9 +215,9 @@ inline
const SpSubview<eT>&
SpSubview<eT>::operator/=(const eT val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_debug_check( (val == eT(0)), "element-wise division: division by zero" );
arma_conform_check( (val == eT(0)), "element-wise division: division by zero" );
m.sync_csc();
m.invalidate_cache();
@@ -268,13 +276,13 @@ inline
const SpSubview<eT>&
SpSubview<eT>::operator=(const Base<eT, T1>& in)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if(is_same_type< T1, Gen<Mat<eT>, gen_zeros> >::yes)
{
const Proxy<T1> P(in.get_ref());
arma_debug_assert_same_size(n_rows, n_cols, P.get_n_rows(), P.get_n_cols(), "insertion into sparse submatrix");
arma_conform_assert_same_size(n_rows, n_cols, P.get_n_rows(), P.get_n_cols(), "insertion into sparse submatrix");
(*this).zeros();
@@ -285,7 +293,7 @@ SpSubview<eT>::operator=(const Base<eT, T1>& in)
{
const Proxy<T1> P(in.get_ref());
arma_debug_assert_same_size(n_rows, n_cols, P.get_n_rows(), P.get_n_cols(), "insertion into sparse submatrix");
arma_conform_assert_same_size(n_rows, n_cols, P.get_n_rows(), P.get_n_cols(), "insertion into sparse submatrix");
(*this).eye();
@@ -294,7 +302,7 @@ SpSubview<eT>::operator=(const Base<eT, T1>& in)
const quasi_unwrap<T1> U(in.get_ref());
arma_debug_assert_same_size(n_rows, n_cols, U.M.n_rows, U.M.n_cols, "insertion into sparse submatrix");
arma_conform_assert_same_size(n_rows, n_cols, U.M.n_rows, U.M.n_cols, "insertion into sparse submatrix");
spglue_merge::subview_merge(*this, U.M);
@@ -309,7 +317,7 @@ inline
const SpSubview<eT>&
SpSubview<eT>::operator+=(const Base<eT, T1>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
return (*this).operator=( (*this) + x.get_ref() );
}
@@ -322,7 +330,7 @@ inline
const SpSubview<eT>&
SpSubview<eT>::operator-=(const Base<eT, T1>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
return (*this).operator=( (*this) - x.get_ref() );
}
@@ -335,7 +343,7 @@ inline
const SpSubview<eT>&
SpSubview<eT>::operator*=(const Base<eT, T1>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpMat<eT> tmp(*this);
@@ -352,14 +360,14 @@ inline
const SpSubview<eT>&
SpSubview<eT>::operator%=(const Base<eT, T1>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpSubview<eT>& sv = (*this);
const quasi_unwrap<T1> U(x.get_ref());
const Mat<eT>& B = U.M;
arma_debug_assert_same_size(sv.n_rows, sv.n_cols, B.n_rows, B.n_cols, "element-wise multiplication");
arma_conform_assert_same_size(sv.n_rows, sv.n_cols, B.n_rows, B.n_cols, "element-wise multiplication");
SpMat<eT>& sv_m = access::rw(sv.m);
@@ -418,14 +426,14 @@ inline
const SpSubview<eT>&
SpSubview<eT>::operator/=(const Base<eT, T1>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const SpSubview<eT>& A = (*this);
const quasi_unwrap<T1> U(x.get_ref());
const Mat<eT>& B = U.M;
arma_debug_assert_same_size(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "element-wise division");
arma_conform_assert_same_size(A.n_rows, A.n_cols, B.n_rows, B.n_cols, "element-wise division");
bool result_ok = true;
@@ -491,7 +499,7 @@ inline
const SpSubview<eT>&
SpSubview<eT>::operator=(const SpSubview<eT>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
return (*this).operator_equ_common(x);
}
@@ -504,7 +512,7 @@ inline
const SpSubview<eT>&
SpSubview<eT>::operator=(const SpBase<eT, T1>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
return (*this).operator_equ_common( x.get_ref() );
}
@@ -517,11 +525,11 @@ inline
const SpSubview<eT>&
SpSubview<eT>::operator_equ_common(const SpBase<eT, T1>& in)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const unwrap_spmat<T1> U(in.get_ref());
arma_debug_assert_same_size(n_rows, n_cols, U.M.n_rows, U.M.n_cols, "insertion into sparse submatrix");
arma_conform_assert_same_size(n_rows, n_cols, U.M.n_rows, U.M.n_cols, "insertion into sparse submatrix");
if(U.is_alias(m))
{
@@ -545,7 +553,7 @@ inline
const SpSubview<eT>&
SpSubview<eT>::operator+=(const SpBase<eT, T1>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
// TODO: implement dedicated machinery
return (*this).operator=( (*this) + x.get_ref() );
@@ -559,7 +567,7 @@ inline
const SpSubview<eT>&
SpSubview<eT>::operator-=(const SpBase<eT, T1>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
// TODO: implement dedicated machinery
return (*this).operator=( (*this) - x.get_ref() );
@@ -573,7 +581,7 @@ inline
const SpSubview<eT>&
SpSubview<eT>::operator*=(const SpBase<eT, T1>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
return (*this).operator=( (*this) * x.get_ref() );
}
@@ -586,7 +594,7 @@ inline
const SpSubview<eT>&
SpSubview<eT>::operator%=(const SpBase<eT, T1>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
// TODO: implement dedicated machinery
return (*this).operator=( (*this) % x.get_ref() );
@@ -600,13 +608,13 @@ inline
const SpSubview<eT>&
SpSubview<eT>::operator/=(const SpBase<eT, T1>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
// NOTE: use of this function is not advised; it is implemented only for completeness
SpProxy<T1> p(x.get_ref());
arma_debug_assert_same_size(n_rows, n_cols, p.get_n_rows(), p.get_n_cols(), "element-wise division");
arma_conform_assert_same_size(n_rows, n_cols, p.get_n_rows(), p.get_n_cols(), "element-wise division");
if(p.is_alias(m) == false)
{
@@ -635,7 +643,7 @@ inline
void
SpSubview<eT>::for_each(functor F)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
m.sync_csc();
m.invalidate_cache();
@@ -692,7 +700,7 @@ inline
void
SpSubview<eT>::for_each(functor F) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
m.sync_csc();
@@ -730,7 +738,7 @@ inline
void
SpSubview<eT>::transform(functor F)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
m.sync_csc();
m.invalidate_cache();
@@ -786,7 +794,7 @@ inline
void
SpSubview<eT>::replace(const eT old_val, const eT new_val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if(old_val == eT(0))
{
@@ -865,7 +873,7 @@ inline
void
SpSubview<eT>::clean(const typename get_pod_type<eT>::result threshold)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if((n_elem == 0) || (n_nonzero == 0)) { return; }
@@ -893,16 +901,16 @@ inline
void
SpSubview<eT>::clamp(const eT min_val, const eT max_val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if(is_cx<eT>::no)
{
arma_debug_check( (access::tmp_real(min_val) > access::tmp_real(max_val)), "SpSubview::clamp(): min_val must be less than max_val" );
arma_conform_check( (access::tmp_real(min_val) > access::tmp_real(max_val)), "SpSubview::clamp(): min_val must be less than max_val" );
}
else
{
arma_debug_check( (access::tmp_real(min_val) > access::tmp_real(max_val)), "SpSubview::clamp(): real(min_val) must be less than real(max_val)" );
arma_debug_check( (access::tmp_imag(min_val) > access::tmp_imag(max_val)), "SpSubview::clamp(): imag(min_val) must be less than imag(max_val)" );
arma_conform_check( (access::tmp_real(min_val) > access::tmp_real(max_val)), "SpSubview::clamp(): real(min_val) must be less than real(max_val)" );
arma_conform_check( (access::tmp_imag(min_val) > access::tmp_imag(max_val)), "SpSubview::clamp(): imag(min_val) must be less than imag(max_val)" );
}
if((n_elem == 0) || (n_nonzero == 0)) { return; }
@@ -923,7 +931,7 @@ inline
void
SpSubview<eT>::fill(const eT val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if(val != eT(0))
{
@@ -946,7 +954,7 @@ inline
void
SpSubview<eT>::zeros()
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if((n_elem == 0) || (n_nonzero == 0)) { return; }
@@ -1003,7 +1011,7 @@ inline
void
SpSubview<eT>::ones()
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
(*this).fill(eT(1));
}
@@ -1015,7 +1023,7 @@ inline
void
SpSubview<eT>::eye()
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpMat<eT> tmp;
@@ -1031,7 +1039,7 @@ inline
void
SpSubview<eT>::randu()
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
Mat<eT> tmp( (*this).n_rows, (*this).n_cols, fill::randu );
@@ -1045,7 +1053,7 @@ inline
void
SpSubview<eT>::randn()
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
Mat<eT> tmp( (*this).n_rows, (*this).n_cols, fill::randn );
@@ -1085,7 +1093,7 @@ inline
SpSubview_MapMat_val<eT>
SpSubview<eT>::operator()(const uword i)
{
arma_debug_check_bounds( (i >= n_elem), "SpSubview::operator(): index out of bounds" );
arma_conform_check_bounds( (i >= n_elem), "SpSubview::operator(): index out of bounds" );
const uword lrow = i % n_rows;
const uword lcol = i / n_rows;
@@ -1100,7 +1108,7 @@ inline
eT
SpSubview<eT>::operator()(const uword i) const
{
arma_debug_check_bounds( (i >= n_elem), "SpSubview::operator(): index out of bounds" );
arma_conform_check_bounds( (i >= n_elem), "SpSubview::operator(): index out of bounds" );
const uword lrow = i % n_rows;
const uword lcol = i / n_rows;
@@ -1115,7 +1123,7 @@ inline
SpSubview_MapMat_val<eT>
SpSubview<eT>::operator()(const uword in_row, const uword in_col)
{
arma_debug_check_bounds( (in_row >= n_rows) || (in_col >= n_cols), "SpSubview::operator(): index out of bounds" );
arma_conform_check_bounds( (in_row >= n_rows) || (in_col >= n_cols), "SpSubview::operator(): index out of bounds" );
return (*this).at(in_row, in_col);
}
@@ -1127,7 +1135,7 @@ inline
eT
SpSubview<eT>::operator()(const uword in_row, const uword in_col) const
{
arma_debug_check_bounds( (in_row >= n_rows) || (in_col >= n_cols), "SpSubview::operator(): index out of bounds" );
arma_conform_check_bounds( (in_row >= n_rows) || (in_col >= n_cols), "SpSubview::operator(): index out of bounds" );
return (*this).at(in_row, in_col);
}
@@ -1236,9 +1244,9 @@ inline
SpSubview_row<eT>
SpSubview<eT>::row(const uword row_num)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_debug_check_bounds(row_num >= n_rows, "SpSubview::row(): out of bounds");
arma_conform_check_bounds(row_num >= n_rows, "SpSubview::row(): out of bounds");
return SpSubview_row<eT>(const_cast< SpMat<eT>& >(m), row_num + aux_row1, aux_col1, n_cols);
}
@@ -1250,9 +1258,9 @@ inline
const SpSubview_row<eT>
SpSubview<eT>::row(const uword row_num) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_debug_check_bounds(row_num >= n_rows, "SpSubview::row(): out of bounds");
arma_conform_check_bounds(row_num >= n_rows, "SpSubview::row(): out of bounds");
return SpSubview_row<eT>(m, row_num + aux_row1, aux_col1, n_cols);
}
@@ -1264,9 +1272,9 @@ inline
SpSubview_col<eT>
SpSubview<eT>::col(const uword col_num)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_debug_check_bounds(col_num >= n_cols, "SpSubview::col(): out of bounds");
arma_conform_check_bounds(col_num >= n_cols, "SpSubview::col(): out of bounds");
return SpSubview_col<eT>(const_cast< SpMat<eT>& >(m), col_num + aux_col1, aux_row1, n_rows);
}
@@ -1278,9 +1286,9 @@ inline
const SpSubview_col<eT>
SpSubview<eT>::col(const uword col_num) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_debug_check_bounds(col_num >= n_cols, "SpSubview::col(): out of bounds");
arma_conform_check_bounds(col_num >= n_cols, "SpSubview::col(): out of bounds");
return SpSubview_col<eT>(m, col_num + aux_col1, aux_row1, n_rows);
}
@@ -1292,9 +1300,9 @@ inline
SpSubview<eT>
SpSubview<eT>::rows(const uword in_row1, const uword in_row2)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_debug_check_bounds
arma_conform_check_bounds
(
(in_row1 > in_row2) || (in_row2 >= n_rows),
"SpSubview::rows(): indices out of bounds or incorrectly used"
@@ -1310,9 +1318,9 @@ inline
const SpSubview<eT>
SpSubview<eT>::rows(const uword in_row1, const uword in_row2) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_debug_check_bounds
arma_conform_check_bounds
(
(in_row1 > in_row2) || (in_row2 >= n_rows),
"SpSubview::rows(): indices out of bounds or incorrectly used"
@@ -1328,9 +1336,9 @@ inline
SpSubview<eT>
SpSubview<eT>::cols(const uword in_col1, const uword in_col2)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_debug_check_bounds
arma_conform_check_bounds
(
(in_col1 > in_col2) || (in_col2 >= n_cols),
"SpSubview::cols(): indices out of bounds or incorrectly used"
@@ -1346,9 +1354,9 @@ inline
const SpSubview<eT>
SpSubview<eT>::cols(const uword in_col1, const uword in_col2) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_debug_check_bounds
arma_conform_check_bounds
(
(in_col1 > in_col2) || (in_col2 >= n_cols),
"SpSubview::cols(): indices out of bounds or incorrectly used"
@@ -1364,9 +1372,9 @@ inline
SpSubview<eT>
SpSubview<eT>::submat(const uword in_row1, const uword in_col1, const uword in_row2, const uword in_col2)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_debug_check_bounds
arma_conform_check_bounds
(
(in_row1 > in_row2) || (in_col1 > in_col2) || (in_row2 >= n_rows) || (in_col2 >= n_cols),
"SpSubview::submat(): indices out of bounds or incorrectly used"
@@ -1382,9 +1390,9 @@ inline
const SpSubview<eT>
SpSubview<eT>::submat(const uword in_row1, const uword in_col1, const uword in_row2, const uword in_col2) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_debug_check_bounds
arma_conform_check_bounds
(
(in_row1 > in_row2) || (in_col1 > in_col2) || (in_row2 >= n_rows) || (in_col2 >= n_cols),
"SpSubview::submat(): indices out of bounds or incorrectly used"
@@ -1400,7 +1408,7 @@ inline
SpSubview<eT>
SpSubview<eT>::submat(const span& row_span, const span& col_span)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const bool row_all = row_span.whole;
const bool col_all = row_span.whole;
@@ -1411,7 +1419,7 @@ SpSubview<eT>::submat(const span& row_span, const span& col_span)
const uword in_col1 = col_all ? 0 : col_span.a;
const uword in_col2 = col_all ? n_cols : col_span.b;
arma_debug_check_bounds
arma_conform_check_bounds
(
( row_all ? false : ((in_row1 > in_row2) || (in_row2 >= n_rows)))
||
@@ -1429,7 +1437,7 @@ inline
const SpSubview<eT>
SpSubview<eT>::submat(const span& row_span, const span& col_span) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const bool row_all = row_span.whole;
const bool col_all = row_span.whole;
@@ -1440,7 +1448,7 @@ SpSubview<eT>::submat(const span& row_span, const span& col_span) const
const uword in_col1 = col_all ? 0 : col_span.a;
const uword in_col2 = col_all ? n_cols - 1 : col_span.b;
arma_debug_check_bounds
arma_conform_check_bounds
(
( row_all ? false : ((in_row1 > in_row2) || (in_row2 >= n_rows)))
||
@@ -1458,7 +1466,7 @@ inline
SpSubview<eT>
SpSubview<eT>::operator()(const uword row_num, const span& col_span)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
return submat(span(row_num, row_num), col_span);
}
@@ -1470,7 +1478,7 @@ inline
const SpSubview<eT>
SpSubview<eT>::operator()(const uword row_num, const span& col_span) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
return submat(span(row_num, row_num), col_span);
}
@@ -1482,7 +1490,7 @@ inline
SpSubview<eT>
SpSubview<eT>::operator()(const span& row_span, const uword col_num)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
return submat(row_span, span(col_num, col_num));
}
@@ -1494,7 +1502,7 @@ inline
const SpSubview<eT>
SpSubview<eT>::operator()(const span& row_span, const uword col_num) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
return submat(row_span, span(col_num, col_num));
}
@@ -1506,7 +1514,7 @@ inline
SpSubview<eT>
SpSubview<eT>::operator()(const span& row_span, const span& col_span)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
return submat(row_span, col_span);
}
@@ -1518,7 +1526,7 @@ inline
const SpSubview<eT>
SpSubview<eT>::operator()(const span& row_span, const span& col_span) const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
return submat(row_span, col_span);
}
@@ -1530,9 +1538,9 @@ inline
void
SpSubview<eT>::swap_rows(const uword in_row1, const uword in_row2)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_debug_check((in_row1 >= n_rows) || (in_row2 >= n_rows), "SpSubview::swap_rows(): invalid row index");
arma_conform_check((in_row1 >= n_rows) || (in_row2 >= n_rows), "SpSubview::swap_rows(): invalid row index");
const uword lstart_col = aux_col1;
const uword lend_col = aux_col1 + n_cols;
@@ -1552,9 +1560,9 @@ inline
void
SpSubview<eT>::swap_cols(const uword in_col1, const uword in_col2)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_debug_check((in_col1 >= n_cols) || (in_col2 >= n_cols), "SpSubview::swap_cols(): invalid column index");
arma_conform_check((in_col1 >= n_cols) || (in_col2 >= n_cols), "SpSubview::swap_cols(): invalid column index");
const uword lstart_row = aux_row1;
const uword lend_row = aux_row1 + n_rows;
@@ -1751,7 +1759,7 @@ inline
eT&
SpSubview<eT>::insert_element(const uword in_row, const uword in_col, const eT in_val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
// This may not actually insert an element.
const uword old_n_nonzero = m.n_nonzero;
@@ -1769,7 +1777,7 @@ inline
void
SpSubview<eT>::delete_element(const uword in_row, const uword in_col)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
// This may not actually delete an element.
const uword old_n_nonzero = m.n_nonzero;
@@ -1784,7 +1792,7 @@ inline
void
SpSubview<eT>::invalidate_cache() const
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
m.invalidate_cache();
}
@@ -1802,7 +1810,7 @@ inline
SpSubview_col<eT>::SpSubview_col(const SpMat<eT>& in_m, const uword in_col)
: SpSubview<eT>(in_m, 0, in_col, in_m.n_rows, 1)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -1812,7 +1820,7 @@ inline
SpSubview_col<eT>::SpSubview_col(const SpMat<eT>& in_m, const uword in_col, const uword in_row1, const uword in_n_rows)
: SpSubview<eT>(in_m, in_row1, in_col, in_n_rows, 1)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -1822,7 +1830,7 @@ inline
void
SpSubview_col<eT>::operator=(const SpSubview<eT>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpSubview<eT>::operator=(x);
}
@@ -1834,7 +1842,7 @@ inline
void
SpSubview_col<eT>::operator=(const SpSubview_col<eT>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpSubview<eT>::operator=(x); // interprets 'SpSubview_col' as 'SpSubview'
}
@@ -1847,7 +1855,7 @@ inline
void
SpSubview_col<eT>::operator=(const SpBase<eT,T1>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpSubview<eT>::operator=(x);
}
@@ -1860,7 +1868,7 @@ inline
void
SpSubview_col<eT>::operator=(const Base<eT,T1>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpSubview<eT>::operator=(x);
}
@@ -1897,6 +1905,16 @@ SpSubview_col<eT>::st() const
template<typename eT>
inline
const SpToDOp<SpSubview_col<eT>,op_sp_as_dense>
SpSubview_col<eT>::as_dense() const
{
return SpToDOp<SpSubview_col<eT>,op_sp_as_dense>(*this);
}
//
//
//
@@ -1908,7 +1926,7 @@ inline
SpSubview_row<eT>::SpSubview_row(const SpMat<eT>& in_m, const uword in_row)
: SpSubview<eT>(in_m, in_row, 0, 1, in_m.n_cols)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -1918,7 +1936,7 @@ inline
SpSubview_row<eT>::SpSubview_row(const SpMat<eT>& in_m, const uword in_row, const uword in_col1, const uword in_n_cols)
: SpSubview<eT>(in_m, in_row, in_col1, 1, in_n_cols)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -1928,7 +1946,7 @@ inline
void
SpSubview_row<eT>::operator=(const SpSubview<eT>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpSubview<eT>::operator=(x);
}
@@ -1940,7 +1958,7 @@ inline
void
SpSubview_row<eT>::operator=(const SpSubview_row<eT>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpSubview<eT>::operator=(x); // interprets 'SpSubview_row' as 'SpSubview'
}
@@ -1953,7 +1971,7 @@ inline
void
SpSubview_row<eT>::operator=(const SpBase<eT,T1>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpSubview<eT>::operator=(x);
}
@@ -1966,7 +1984,7 @@ inline
void
SpSubview_row<eT>::operator=(const Base<eT,T1>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
SpSubview<eT>::operator=(x);
}
@@ -2003,4 +2021,14 @@ SpSubview_row<eT>::st() const
template<typename eT>
inline
const SpToDOp<SpSubview_row<eT>,op_sp_as_dense>
SpSubview_row<eT>::as_dense() const
{
return SpToDOp<SpSubview_row<eT>,op_sp_as_dense>(*this);
}
//! @}
+9 -6
View File
@@ -29,15 +29,18 @@ class SpToDGlue : public Base< typename T1::elem_type, SpToDGlue<T1, T2, glue_ty
typedef typename T1::elem_type elem_type;
typedef typename get_pod_type<elem_type>::result pod_type;
inline explicit SpToDGlue(const T1& in_A, const T2& in_B);
inline ~SpToDGlue();
const T1& A; //!< first operand; must be derived from Base or SpBase
const T2& B; //!< second operand; must be derived from Base or SpBase
static constexpr bool is_row = glue_type::template traits<T1,T2>::is_row;
static constexpr bool is_col = glue_type::template traits<T1,T2>::is_col;
static constexpr bool is_xvec = glue_type::template traits<T1,T2>::is_xvec;
inline explicit SpToDGlue(const T1& in_A, const T2& in_B);
inline ~SpToDGlue();
template<typename eT2>
constexpr bool is_alias(const Mat<eT2>&) const { return false; }
const T1& A; //!< first operand; must be derived from Base or SpBase
const T2& B; //!< second operand; must be derived from Base or SpBase
};
+2 -2
View File
@@ -27,7 +27,7 @@ SpToDGlue<T1,T2,glue_type>::SpToDGlue(const T1& in_A, const T2& in_B)
: A(in_A)
, B(in_B)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -36,7 +36,7 @@ template<typename T1, typename T2, typename glue_type>
inline
SpToDGlue<T1,T2,glue_type>::~SpToDGlue()
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
+14 -18
View File
@@ -20,17 +20,7 @@
//! @{
//! Class for storing data required for delayed unary operations on a sparse
//! matrix that produce a dense matrix; the data for storage may include
//! the operand (eg. the matrix to which the operation is to be applied) and the unary operator (eg. inverse).
//! The operand is stored as a reference (which can be optimised away),
//! while the operator is "stored" through the template definition (op_type).
//! The operands can be 'SpMat', 'SpRow', 'SpCol', 'SpOp', and 'SpGlue'.
//! Note that as 'SpGlue' can be one of the operands, more than one matrix can be stored.
//!
//! For example, we could have:
//! SpToDOp< SpGlue< SpMat, SpMat, sp_glue_times >, op_sp_plus >
// 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> >
@@ -40,16 +30,22 @@ class SpToDOp : public Base< typename T1::elem_type, SpToDOp<T1, op_type> >
typedef typename T1::elem_type elem_type;
typedef typename get_pod_type<elem_type>::result pod_type;
inline explicit SpToDOp(const T1& in_m);
inline SpToDOp(const T1& in_m, const elem_type in_aux);
inline ~SpToDOp();
arma_aligned const T1& m; //!< the operand; must be derived from SpBase
arma_aligned elem_type aux; //!< auxiliary data, using the element type as used by T1
static constexpr bool is_row = op_type::template traits<T1>::is_row;
static constexpr bool is_col = op_type::template traits<T1>::is_col;
static constexpr bool is_xvec = op_type::template traits<T1>::is_xvec;
inline explicit SpToDOp(const T1& in_m);
inline SpToDOp(const T1& in_m, const elem_type in_aux);
inline SpToDOp(const T1& in_m, const uword in_aux_uword_a, const uword in_aux_uword_b);
inline ~SpToDOp();
template<typename eT2>
constexpr bool is_alias(const Mat<eT2>&) const { return false; }
const T1& m; //!< the operand; must be derived from SpBase
elem_type aux; //!< auxiliary data, using the element type as used by T1
uword aux_uword_a; //!< auxiliary data, uword format
uword aux_uword_b; //!< auxiliary data, uword format
};
+15 -3
View File
@@ -26,7 +26,7 @@ inline
SpToDOp<T1, op_type>::SpToDOp(const T1& in_m)
: m(in_m)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -37,7 +37,19 @@ SpToDOp<T1, op_type>::SpToDOp(const T1& in_m, const typename T1::elem_type in_au
: m(in_m)
, aux(in_aux)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
template<typename T1, typename op_type>
inline
SpToDOp<T1, op_type>::SpToDOp(const T1& in_m, const uword in_aux_uword_a, const uword in_aux_uword_b)
: m(in_m)
, aux_uword_a(in_aux_uword_a)
, aux_uword_b(in_aux_uword_b)
{
arma_debug_sigprint();
}
@@ -46,7 +58,7 @@ template<typename T1, typename op_type>
inline
SpToDOp<T1, op_type>::~SpToDOp()
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
+14 -41
View File
@@ -148,24 +148,17 @@ inline
SpValProxy<T1>&
SpValProxy<T1>::operator*=(const eT rhs)
{
if(rhs != eT(0))
if(val_ptr)
{
if(val_ptr)
{
// The value already exists and merely needs to be updated.
*val_ptr *= rhs;
parent.invalidate_cache();
check_zero();
}
*val_ptr *= rhs;
parent.invalidate_cache();
check_zero();
}
else
{
if(val_ptr)
{
// Since we are multiplying by zero, the value can be deleted.
parent.delete_element(row, col);
val_ptr = nullptr;
}
const eT val = eT(0) * rhs; // in case rhs is inf or nan
if(val != eT(0)) { val_ptr = &parent.insert_element(row, col, val); }
}
return *this;
@@ -178,37 +171,17 @@ inline
SpValProxy<T1>&
SpValProxy<T1>::operator/=(const eT rhs)
{
if(rhs != eT(0)) // I hope this is true!
if(val_ptr)
{
if(val_ptr)
{
*val_ptr /= rhs;
parent.invalidate_cache();
check_zero();
}
*val_ptr /= rhs;
parent.invalidate_cache();
check_zero();
}
else
{
if(val_ptr)
{
*val_ptr /= rhs; // That is where it gets ugly.
// Now check if it's 0.
if(*val_ptr == eT(0))
{
parent.delete_element(row, col);
val_ptr = nullptr;
}
}
else
{
eT val = eT(0) / rhs; // This may vary depending on type and implementation.
if(val != eT(0))
{
// Ok, now we have to insert it.
val_ptr = &parent.insert_element(row, col, val);
}
}
const eT val = eT(0) / rhs; // in case rhs is zero or nan
if(val != eT(0)) { val_ptr = &parent.insert_element(row, col, val); }
}
return *this;
+8 -22
View File
@@ -65,6 +65,13 @@ struct arma_config
#endif
#if defined(ARMA_CHECK_CONFORMANCE)
static constexpr bool check_conform = true;
#else
static constexpr bool check_conform = false;
#endif
#if defined(ARMA_CHECK_NONFINITE)
static constexpr bool check_nonfinite = true;
#else
@@ -121,20 +128,6 @@ struct arma_config
#endif
#if defined(ARMA_NO_DEBUG)
static constexpr bool debug = false;
#else
static constexpr bool debug = true;
#endif
#if defined(ARMA_EXTRA_DEBUG)
static constexpr bool extra_debug = true;
#else
static constexpr bool extra_debug = false;
#endif
#if defined(ARMA_GOOD_COMPILER)
static constexpr bool good_comp = true;
#else
@@ -188,7 +181,7 @@ struct arma_config
#endif
#if (!defined(ARMA_DONT_USE_STD_MUTEX))
#if defined(ARMA_USE_STD_MUTEX)
static constexpr bool std_mutex = true;
#else
static constexpr bool std_mutex = false;
@@ -223,13 +216,6 @@ struct arma_config
#endif
#if defined(ARMA_DONT_ZERO_INIT)
static constexpr bool zero_init = false;
#else
static constexpr bool zero_init = true;
#endif
#if defined(ARMA_FAST_MATH)
static constexpr bool fast_math = true;
#else
+19 -4
View File
@@ -91,6 +91,8 @@ class op_diagmat;
class op_trimat;
class op_vectorise_row;
class op_vectorise_col;
class op_symmatu;
class op_symmatl;
class op_row_as_mat;
class op_col_as_mat;
@@ -128,6 +130,18 @@ class spop_strans;
class spop_htrans;
class spop_vectorise_row;
class spop_vectorise_col;
class 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;
class spglue_plus;
class spglue_minus;
@@ -138,7 +152,7 @@ class spglue_min;
class spglue_rel_lt;
class spglue_rel_gt;
class op_sp_as_dense;
class op_internal_equ;
class op_internal_plus;
@@ -280,7 +294,7 @@ struct state_type
{
#if defined(ARMA_USE_OPENMP)
int state;
#elif (!defined(ARMA_DONT_USE_STD_MUTEX))
#elif defined(ARMA_USE_STD_MUTEX)
std::atomic<int> state;
#else
int state;
@@ -299,7 +313,7 @@ struct state_type
#if defined(ARMA_USE_OPENMP)
#pragma omp atomic read
out = state;
#elif (!defined(ARMA_DONT_USE_STD_MUTEX))
#elif defined(ARMA_USE_STD_MUTEX)
out = state.load();
#else
out = state;
@@ -315,7 +329,7 @@ struct state_type
#if defined(ARMA_USE_OPENMP)
#pragma omp atomic write
state = in_state;
#elif (!defined(ARMA_DONT_USE_STD_MUTEX))
#elif defined(ARMA_USE_STD_MUTEX)
state.store(in_state);
#else
state = in_state;
@@ -326,6 +340,7 @@ 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 T2, typename spglue_type> class SpGlue;
template<typename out_eT, typename T1, typename T2, typename spglue_type> class mtSpGlue;
+12 -12
View File
@@ -190,7 +190,7 @@ inline
std::streamsize
arma_ostream::modify_stream(std::ostream& o, typename SpMat<eT>::const_iterator begin, const uword n_elem, const typename arma_not_cx<eT>::result* junk)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_ignore(junk);
o.unsetf(ios::showbase);
@@ -429,7 +429,7 @@ inline
void
arma_ostream::print(std::ostream& o, const Mat<eT>& m, const bool modify)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const arma_ostream_state stream_state(o);
@@ -498,7 +498,7 @@ inline
void
arma_ostream::print(std::ostream& o, const Cube<eT>& x, const bool modify)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const arma_ostream_state stream_state(o);
@@ -540,7 +540,7 @@ inline
void
arma_ostream::print(std::ostream& o, const field<oT>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const arma_ostream_state stream_state(o);
@@ -613,7 +613,7 @@ inline
void
arma_ostream::print(std::ostream& o, const subview_field<oT>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const arma_ostream_state stream_state(o);
@@ -683,7 +683,7 @@ inline
void
arma_ostream::print_dense(std::ostream& o, const SpMat<eT>& m, const bool modify)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const arma_ostream_state stream_state(o);
@@ -765,7 +765,7 @@ inline
void
arma_ostream::print(std::ostream& o, const SpMat<eT>& m, const bool modify)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const arma_ostream_state stream_state(o);
@@ -867,7 +867,7 @@ inline
void
arma_ostream::print(std::ostream& o, const SizeMat& S)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const arma_ostream_state stream_state(o);
@@ -888,7 +888,7 @@ inline
void
arma_ostream::print(std::ostream& o, const SizeCube& S)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const arma_ostream_state stream_state(o);
@@ -910,7 +910,7 @@ inline
void
arma_ostream::brief_print(std::ostream& o, const Mat<eT>& m, const bool print_size)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const arma_ostream_state stream_state(o);
@@ -1068,7 +1068,7 @@ inline
void
arma_ostream::brief_print(std::ostream& o, const Cube<eT>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const arma_ostream_state stream_state(o);
@@ -1125,7 +1125,7 @@ inline
void
arma_ostream::brief_print(std::ostream& o, const SpMat<eT>& m)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if(m.n_nonzero <= 10) { arma_ostream::print(o, m, true); return; }
+12 -20
View File
@@ -74,7 +74,7 @@
#define ARMA_GUARD_PRODUCER
#endif
#if (defined(ARMA_DONT_GUARD_PRODUCER) || defined(ARMA_DONT_USE_STD_MUTEX))
#if (defined(ARMA_DONT_GUARD_PRODUCER) || (!defined(ARMA_USE_STD_MUTEX)))
#undef ARMA_GUARD_PRODUCER
#endif
@@ -267,20 +267,14 @@ arma_rng::set_seed_random()
{
try
{
union
{
seed_type a;
unsigned char b[sizeof(seed_type)];
} tmp;
tmp.a = seed_type(0);
char tmp[sizeof(seed_type)] = {};
std::ifstream f("/dev/urandom", std::ifstream::binary);
if(f.good()) { f.read((char*)(&(tmp.b[0])), sizeof(seed_type)); }
if(f.good()) { f.read(&(tmp[0]), sizeof(seed_type)); }
if(f.good()) { std::memcpy(&seed2, &(tmp[0]), sizeof(seed_type)); }
if(f.good()) { seed2 = tmp.a; }
have_seed = (seed2 != seed_type(0));
}
catch(...) {}
@@ -297,19 +291,17 @@ arma_rng::set_seed_random()
seed3 = static_cast<seed_type>( since_epoch_usec & 0xFFFF );
union
{
uword* a;
unsigned char b[sizeof(uword*)];
} tmp;
unsigned char* a = (unsigned char*)std::malloc(std::size_t(4096));
tmp.a = (uword*)malloc(sizeof(uword));
unsigned char b[sizeof(unsigned char*)] = {};
if(tmp.a != nullptr)
if(a != nullptr)
{
for(size_t i=0; i<sizeof(uword*); ++i) { seed4 += seed_type(tmp.b[i]); }
std::memcpy(&(b[0]), &a, sizeof(unsigned char*));
free(tmp.a);
for(size_t i=0; i<sizeof(unsigned char*); ++i) { seed4 += seed_type(b[i]); }
std::free(a);
}
}
+4 -4
View File
@@ -21,10 +21,10 @@
#define ARMA_VERSION_MAJOR 12
#define ARMA_VERSION_MINOR 8
#define ARMA_VERSION_PATCH 2
#define ARMA_VERSION_NAME "Cortisol Injector"
#define ARMA_VERSION_MAJOR 14
#define ARMA_VERSION_MINOR 4
#define ARMA_VERSION_PATCH 4
#define ARMA_VERSION_NAME "Filtered Espresso"
+10 -1
View File
@@ -239,7 +239,7 @@ arrayops::convert(out_eT* dest, const in_eT* src, const uword n_elem)
{
const out_eT* src2 = (const out_eT*)src;
if(dest != src2) { arrayops::copy(dest, src2, n_elem); }
arrayops::copy(dest, src2, n_elem);
return;
}
@@ -304,6 +304,15 @@ inline
void
arrayops::convert_cx(out_eT* dest, const in_eT* src, const uword n_elem)
{
if(is_same_type<out_eT,in_eT>::value)
{
const out_eT* src2 = (const out_eT*)src;
arrayops::copy(dest, src2, n_elem);
return;
}
uword j;
for(j=1; j<n_elem; j+=2)
+31 -5
View File
@@ -43,6 +43,18 @@ class auxlib
template<typename eT>
inline static bool inv_tr_rcond(Mat<eT>& A, typename get_pod_type<eT>::result& out_rcond, const uword layout);
template<typename eT>
inline static bool inv_sym(Mat<eT>& A);
template<typename T>
inline static bool inv_sym(Mat< std::complex<T> >& A);
template<typename eT>
inline static bool inv_sym_rcond(Mat<eT>& A, eT& out_rcond);
template<typename T>
inline static bool inv_sym_rcond(Mat< std::complex<T> >& A, T& out_rcond);
template<typename eT>
inline static bool inv_sympd(Mat<eT>& A, bool& out_sympd_state);
@@ -50,10 +62,10 @@ class auxlib
inline static bool inv_sympd(Mat<eT>& out, const Mat<eT>& X);
template<typename eT>
inline static bool inv_sympd_rcond(Mat<eT>& A, bool& out_sympd_state, eT& out_rcond);
inline static bool inv_sympd_rcond(Mat<eT>& A, eT& out_rcond);
template<typename T>
inline static bool inv_sympd_rcond(Mat< std::complex<T> >& A, bool& out_sympd_state, T& out_rcond);
inline static bool inv_sympd_rcond(Mat< std::complex<T> >& A, T& out_rcond);
//
@@ -269,6 +281,20 @@ class auxlib
//
template<typename T1>
inline static bool solve_sym_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_sym_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_sym_rcond(Mat<typename T1::pod_type>& out, typename T1::pod_type& out_rcond, Mat<typename T1::pod_type>& A, const Base<typename T1::pod_type,T1>& B_expr);
template<typename T1>
inline static bool solve_sym_rcond(Mat< std::complex<typename T1::pod_type> >& out, typename T1::pod_type& out_rcond, 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_sympd_fast(Mat<typename T1::elem_type>& out, Mat<typename T1::elem_type>& A, const Base<typename T1::elem_type,T1>& B_expr);
@@ -388,10 +414,10 @@ class auxlib
inline static T rcond(Mat< std::complex<T> >& A);
template<typename eT>
inline static eT rcond_sympd(Mat<eT>& A, bool& calc_ok);
inline static eT rcond_sym(Mat<eT>& A);
template<typename T>
inline static T rcond_sympd(Mat< std::complex<T> >& A, bool& calc_ok);
template<typename T>
inline static T rcond_sym(Mat< std::complex<T> >& A);
template<typename eT>
inline static eT rcond_trimat(const Mat<eT>& A, const uword layout);
File diff suppressed because it is too large Load Diff
+8 -8
View File
@@ -30,7 +30,7 @@ inline
bool
is_band(uword& out_KL, uword& out_KU, const Mat<eT>& A, const uword N_min)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
// NOTE: assuming that A has a square size
// NOTE: assuming that N_min is >= 4
@@ -108,7 +108,7 @@ inline
bool
is_band_lower(uword& out_KD, const Mat<eT>& A, const uword N_min)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
// NOTE: assuming that A has a square size
// NOTE: assuming that N_min is >= 4
@@ -171,7 +171,7 @@ inline
bool
is_band_upper(uword& out_KD, const Mat<eT>& A, const uword N_min)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
// NOTE: assuming that A has a square size
// NOTE: assuming that N_min is >= 4
@@ -234,7 +234,7 @@ inline
void
compress(Mat<eT>& AB, const Mat<eT>& A, const uword KL, const uword KU, const bool use_offset)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
// NOTE: assuming that A has a square size
@@ -242,7 +242,7 @@ compress(Mat<eT>& AB, const Mat<eT>& A, const uword KL, const uword KU, const bo
// http://www.netlib.org/lapack/lug/node124.html
// for ?gbsv, matrix AB size: 2*KL+KU+1 x N; band representation of A stored in rows KL+1 to 2*KL+KU+1 (note: fortran counts from 1)
// for ?gbsvx, matrix AB size: KL+KU+1 x N; band representaiton of A stored in rows 1 to KL+KU+1 (note: fortran counts from 1)
// for ?gbsvx, matrix AB size: KL+KU+1 x N; band representation of A stored in rows 1 to KL+KU+1 (note: fortran counts from 1)
//
// the +1 in the above formulas is to take into account the main diagonal
@@ -287,12 +287,12 @@ inline
void
uncompress(Mat<eT>& A, const Mat<eT>& AB, const uword KL, const uword KU, const bool use_offset)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const uword AB_n_rows = AB.n_rows;
const uword N = AB.n_cols;
arma_debug_check( (AB_n_rows != ((use_offset) ? uword(2*KL + KU + 1) : uword(KL + KU + 1))), "band_helper::uncompress(): detected inconsistency" );
arma_conform_check( (AB_n_rows != ((use_offset) ? uword(2*KL + KU + 1) : uword(KL + KU + 1))), "band_helper::uncompress(): detected inconsistency" );
A.zeros(N,N); // assuming there is no aliasing between A and AB
@@ -328,7 +328,7 @@ inline
void
extract_tridiag(Mat<eT>& out, const Mat<eT>& A)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
// NOTE: assuming that A has a square size and is at least 2x2
@@ -83,6 +83,11 @@
#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")
#endif
// for compatibility with earlier versions of Armadillo
#undef ARMA_USE_CXX11
#define ARMA_USE_CXX11
+16 -41
View File
@@ -161,13 +161,16 @@
#undef ARMA_GCC_VERSION
#define ARMA_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
#if (ARMA_GCC_VERSION < 40803)
#error "*** newer compiler required; need gcc 4.8.3 or newer ***"
#if (ARMA_GCC_VERSION < 60100)
#error "*** newer compiler required; need gcc 6.1 or newer ***"
#endif
// #if (ARMA_GCC_VERSION < 60100)
// #pragma message ("WARNING: support for gcc versions older than 6.1 is deprecated")
// #endif
// gcc 6.1 has proper C++14 support and fixes an OpenMP related bug:
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57580
#if (ARMA_GCC_VERSION < 80100)
#pragma message("INFO: support for GCC versions older than 8.1 is deprecated")
#endif
#define ARMA_GOOD_COMPILER
@@ -300,31 +303,32 @@
#error "*** newer compiler required ***"
#endif
#if (__INTEL_COMPILER < 1500)
#if (__INTEL_COMPILER < 1600)
#error "*** newer compiler required ***"
#endif
#undef ARMA_HAVE_GCC_ASSUME_ALIGNED
#undef ARMA_HAVE_ICC_ASSUME_ALIGNED
#define ARMA_HAVE_ICC_ASSUME_ALIGNED
#endif
#if defined(_MSC_VER)
#if (_MSC_VER < 1900)
#if (_MSC_VER < 1910)
#error "*** newer compiler required ***"
#endif
#undef arma_deprecated
#define arma_deprecated __declspec(deprecated)
// #undef arma_inline
// #define arma_inline __forceinline inline
#undef arma_noinline
#define arma_noinline __declspec(noinline)
#pragma warning(push)
#pragma warning(disable: 4127) // conditional expression is constant
#pragma warning(disable: 4146) // unary minus operator applied to unsigned type, result still unsigned
#pragma warning(disable: 4180) // qualifier has no meaning
#pragma warning(disable: 4244) // possible loss of data when converting types (see also 4305)
#pragma warning(disable: 4510) // default constructor could not be generated
@@ -344,8 +348,6 @@
#pragma warning(disable: 4714) // __forceinline can't be inlined
#pragma warning(disable: 4800) // value forced to bool
// NOTE: also possible to disable 4146 (unary minus operator applied to unsigned type, result still unsigned)
#if defined(ARMA_HAVE_CXX17)
#pragma warning(disable: 26812) // unscoped enum
#pragma warning(disable: 26819) // unannotated fallthrough
@@ -376,18 +378,6 @@
#endif
#if defined(__SUNPRO_CC)
// http://www.oracle.com/technetwork/server-storage/solarisstudio/training/index-jsp-141991.html
// http://www.oracle.com/technetwork/server-storage/solarisstudio/documentation/cplusplus-faq-355066.html
#if (__SUNPRO_CC < 0x5140)
#error "*** newer compiler required ***"
#endif
#endif
#if defined(ARMA_HAVE_CXX14)
#undef arma_deprecated
#define arma_deprecated [[deprecated]]
@@ -430,17 +420,6 @@
#endif
#if defined(ARMA_USE_OPENMP)
#if (defined(ARMA_GCC_VERSION) && (ARMA_GCC_VERSION < 50400))
// due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57580
#undef ARMA_USE_OPENMP
#if !defined(ARMA_DONT_PRINT_OPENMP_WARNING)
#pragma message ("WARNING: use of OpenMP disabled due to compiler bug in gcc <= 5.3")
#endif
#endif
#endif
#if (defined(__FAST_MATH__) || (defined(__FINITE_MATH_ONLY__) && (__FINITE_MATH_ONLY__ > 0)) || defined(_M_FP_FAST))
#undef ARMA_FAST_MATH
#define ARMA_FAST_MATH
@@ -498,11 +477,7 @@
#undef major
// optionally allow disabling of compile-time deprecation messages (not recommended)
// NOTE: option 'ARMA_IGNORE_DEPRECATED_MARKER' will be removed
// NOTE: disabling deprecation messages is counter-productive
#if defined(ARMA_IGNORE_DEPRECATED_MARKER) && (!defined(ARMA_DONT_IGNORE_DEPRECATED_MARKER)) && (!defined(ARMA_EXTRA_DEBUG))
#if defined(ARMA_IGNORE_DEPRECATED_MARKER)
#undef arma_deprecated
#define arma_deprecated
+75 -35
View File
@@ -102,11 +102,8 @@
//// Uncomment the above line if your BLAS and LAPACK libraries have function names with a trailing underscore.
//// Conversely, comment it out if the function names don't have a trailing underscore.
// #define ARMA_BLAS_LONG
//// Uncomment the above line if your BLAS and LAPACK libraries use "long" instead of "int"
// #define ARMA_BLAS_LONG_LONG
//// Uncomment the above line if your BLAS and LAPACK libraries use "long long" instead of "int"
//// Uncomment the above line if your BLAS and LAPACK libraries use 64 bit integers, ie. "long long" instead of "int"
// #define ARMA_BLAS_NOEXCEPT
//// Uncomment the above line if you require BLAS functions to have the 'noexcept' specification
@@ -131,7 +128,7 @@
//// Uncomment the above line to use Intel MKL types for complex numbers.
//// You will need to include appropriate MKL headers before the Armadillo header.
//// You may also need to enable or disable the following options:
//// ARMA_BLAS_LONG, ARMA_BLAS_LONG_LONG, ARMA_USE_FORTRAN_HIDDEN_ARGS
//// ARMA_BLAS_LONG_LONG, ARMA_USE_FORTRAN_HIDDEN_ARGS
#if !defined(ARMA_USE_OPENMP)
// #define ARMA_USE_OPENMP
@@ -139,6 +136,11 @@
//// Note that ARMA_USE_OPENMP is automatically enabled when a compiler supporting OpenMP 3.1 is detected.
#endif
#if !defined(ARMA_USE_STD_MUTEX)
#define ARMA_USE_STD_MUTEX
//// Comment out the above line to disable use of std::mutex
#endif
#if !defined(ARMA_64BIT_WORD)
// #define ARMA_64BIT_WORD
//// Uncomment the above line if you require matrices/vectors capable of holding more than 4 billion elements.
@@ -164,6 +166,14 @@
//// of inv() and inv_sympd() within compound expressions
#endif
#if !defined(ARMA_CHECK_CONFORMANCE)
#define ARMA_CHECK_CONFORMANCE
//// Comment out the above line to disable conformance checks for bounds and size.
//// This is NOT RECOMMENDED.
//// It is strongly recommended that conformance checks are enabled during development,
//// as this greatly aids in finding mistakes in your code.
#endif
#if !defined(ARMA_CHECK_NONFINITE)
#define ARMA_CHECK_NONFINITE
//// Comment out the above line to disable checking for nonfinite matrices
@@ -189,25 +199,19 @@
//// The maximum number of threads to use for OpenMP based parallelisation;
//// it must be an integer that is at least 1.
// #define ARMA_NO_DEBUG
//// Uncomment the above line to disable all run-time checks. NOT RECOMMENDED.
//// It is strongly recommended that run-time checks are enabled during development,
//// as this greatly aids in finding mistakes in your code.
// #define ARMA_EXTRA_DEBUG
// #define ARMA_DEBUG
//// Uncomment the above line to see the function traces of how Armadillo evaluates expressions.
//// This is mainly useful for debugging of the library.
#if defined(ARMA_EXTRA_DEBUG)
#undef ARMA_NO_DEBUG
#undef ARMA_WARN_LEVEL
#define ARMA_WARN_LEVEL 3
// for compatibility with earlier versions of Armadillo
#undef ARMA_DEBUG
#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: option ARMA_DEFAULT_OSTREAM is deprecated and will be removed;")
#pragma message ("WARNING: use ARMA_COUT_STREAM and ARMA_CERR_STREAM instead")
#endif
@@ -280,17 +284,15 @@
#undef ARMA_USE_FORTRAN_HIDDEN_ARGS
#endif
#if !defined(ARMA_DONT_USE_STD_MUTEX)
// #define ARMA_DONT_USE_STD_MUTEX
//// Uncomment the above line to disable use of std::mutex
#if defined(ARMA_DONT_USE_STD_MUTEX)
#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: option ARMA_DONT_USE_CXX11_MUTEX is deprecated and will be removed;")
#pragma message ("WARNING: use ARMA_DONT_USE_STD_MUTEX instead")
#undef ARMA_DONT_USE_STD_MUTEX
#define ARMA_DONT_USE_STD_MUTEX
#undef ARMA_USE_STD_MUTEX
#endif
#if defined(ARMA_DONT_USE_OPENMP)
@@ -301,6 +303,24 @@
#undef ARMA_64BIT_WORD
#endif
#if (defined(ARMA_BLAS_LONG_LONG) && defined(ARMA_USE_WRAPPER))
#pragma message ("WARNING: use of ARMA_BLAS_LONG_LONG in conjunction with ARMA_USE_WRAPPER is not supported")
#endif
#if (defined(ARMA_BLAS_64BIT_INT) && defined(ARMA_USE_WRAPPER))
#pragma message ("WARNING: use of ARMA_BLAS_64BIT_INT in conjunction with ARMA_USE_WRAPPER is not supported")
#endif
#if (defined(ARMA_SUPERLU_64BIT_INT) && defined(ARMA_USE_WRAPPER))
#pragma message ("WARNING: use of ARMA_SUPERLU_64BIT_INT in conjunction with ARMA_USE_WRAPPER is not supported")
#endif
// for compatibility with earlier versions of Armadillo
#if defined(ARMA_BLAS_LONG) || defined(ARMA_BLAS_LONG_LONG)
#undef ARMA_BLAS_64BIT_INT
#define ARMA_BLAS_64BIT_INT
#endif
#if defined(ARMA_DONT_OPTIMISE_BAND) || defined(ARMA_DONT_OPTIMISE_SOLVE_BAND)
#undef ARMA_OPTIMISE_BAND
#endif
@@ -313,36 +333,56 @@
#undef ARMA_OPTIMISE_INVEXPR
#endif
#if defined(ARMA_DONT_CHECK_CONFORMANCE)
#if defined(ARMA_CHECK_CONFORMANCE) && (ARMA_WARN_LEVEL >= 2)
#pragma message ("WARNING: conformance checks disabled")
#endif
#undef ARMA_CHECK_CONFORMANCE
#endif
#if defined(ARMA_DONT_CHECK_NONFINITE)
#undef ARMA_CHECK_NONFINITE
#endif
#if defined(ARMA_DONT_PRINT_ERRORS)
#pragma message ("INFO: support for ARMA_DONT_PRINT_ERRORS option has been removed")
#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
#endif
#if defined(ARMA_DEBUG)
#undef ARMA_DONT_CHECK_CONFORMANCE
#undef ARMA_DONT_CHECK_NONFINITE
#if defined(ARMA_PRINT_EXCEPTIONS)
#pragma message ("INFO: suggest to use ARMA_WARN_LEVEL and ARMA_DONT_PRINT_EXCEPTIONS options instead")
#else
#pragma message ("INFO: suggest to use ARMA_WARN_LEVEL option instead")
#endif
#undef ARMA_CHECK_CONFORMANCE
#define ARMA_CHECK_CONFORMANCE
#pragma message ("INFO: see the documentation for details")
#undef ARMA_CHECK_NONFINITE
#define ARMA_CHECK_NONFINITE
#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_DONT_ZERO_INIT)
// #define ARMA_DONT_ZERO_INIT
//// Uncomment the above line to disable initialising elements to zero during construction of dense matrices and cubes
#endif
#if defined(ARMA_NO_CRIPPLED_LAPACK)
#undef ARMA_CRIPPLED_LAPACK
#endif
// WARNING: option ARMA_CRIPPLED_LAPACK is deprecated and will be removed
// WARNING: option ARMA_IGNORE_DEPRECATED_MARKER is deprecated and will be removed
// if Armadillo was installed on this system via CMake and ARMA_USE_WRAPPER is not defined,
// ARMA_AUX_LIBS lists the libraries required by Armadillo on this system, and
// ARMA_AUX_INCDIRS lists the include directories required by Armadillo on this system.
+75 -35
View File
@@ -102,11 +102,8 @@
//// Uncomment the above line if your BLAS and LAPACK libraries have function names with a trailing underscore.
//// Conversely, comment it out if the function names don't have a trailing underscore.
// #define ARMA_BLAS_LONG
//// Uncomment the above line if your BLAS and LAPACK libraries use "long" instead of "int"
// #define ARMA_BLAS_LONG_LONG
//// Uncomment the above line if your BLAS and LAPACK libraries use "long long" instead of "int"
//// Uncomment the above line if your BLAS and LAPACK libraries use 64 bit integers, ie. "long long" instead of "int"
// #define ARMA_BLAS_NOEXCEPT
//// Uncomment the above line if you require BLAS functions to have the 'noexcept' specification
@@ -131,7 +128,7 @@
//// Uncomment the above line to use Intel MKL types for complex numbers.
//// You will need to include appropriate MKL headers before the Armadillo header.
//// You may also need to enable or disable the following options:
//// ARMA_BLAS_LONG, ARMA_BLAS_LONG_LONG, ARMA_USE_FORTRAN_HIDDEN_ARGS
//// ARMA_BLAS_LONG_LONG, ARMA_USE_FORTRAN_HIDDEN_ARGS
#if !defined(ARMA_USE_OPENMP)
// #define ARMA_USE_OPENMP
@@ -139,6 +136,11 @@
//// Note that ARMA_USE_OPENMP is automatically enabled when a compiler supporting OpenMP 3.1 is detected.
#endif
#if !defined(ARMA_USE_STD_MUTEX)
#define ARMA_USE_STD_MUTEX
//// Comment out the above line to disable use of std::mutex
#endif
#if !defined(ARMA_64BIT_WORD)
// #define ARMA_64BIT_WORD
//// Uncomment the above line if you require matrices/vectors capable of holding more than 4 billion elements.
@@ -164,6 +166,14 @@
//// of inv() and inv_sympd() within compound expressions
#endif
#if !defined(ARMA_CHECK_CONFORMANCE)
#define ARMA_CHECK_CONFORMANCE
//// Comment out the above line to disable conformance checks for bounds and size.
//// This is NOT RECOMMENDED.
//// It is strongly recommended that conformance checks are enabled during development,
//// as this greatly aids in finding mistakes in your code.
#endif
#if !defined(ARMA_CHECK_NONFINITE)
#define ARMA_CHECK_NONFINITE
//// Comment out the above line to disable checking for nonfinite matrices
@@ -189,25 +199,19 @@
//// The maximum number of threads to use for OpenMP based parallelisation;
//// it must be an integer that is at least 1.
// #define ARMA_NO_DEBUG
//// Uncomment the above line to disable all run-time checks. NOT RECOMMENDED.
//// It is strongly recommended that run-time checks are enabled during development,
//// as this greatly aids in finding mistakes in your code.
// #define ARMA_EXTRA_DEBUG
// #define ARMA_DEBUG
//// Uncomment the above line to see the function traces of how Armadillo evaluates expressions.
//// This is mainly useful for debugging of the library.
#if defined(ARMA_EXTRA_DEBUG)
#undef ARMA_NO_DEBUG
#undef ARMA_WARN_LEVEL
#define ARMA_WARN_LEVEL 3
// for compatibility with earlier versions of Armadillo
#undef ARMA_DEBUG
#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: option ARMA_DEFAULT_OSTREAM is deprecated and will be removed;")
#pragma message ("WARNING: use ARMA_COUT_STREAM and ARMA_CERR_STREAM instead")
#endif
@@ -280,17 +284,15 @@
#undef ARMA_USE_FORTRAN_HIDDEN_ARGS
#endif
#if !defined(ARMA_DONT_USE_STD_MUTEX)
// #define ARMA_DONT_USE_STD_MUTEX
//// Uncomment the above line to disable use of std::mutex
#if defined(ARMA_DONT_USE_STD_MUTEX)
#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: option ARMA_DONT_USE_CXX11_MUTEX is deprecated and will be removed;")
#pragma message ("WARNING: use ARMA_DONT_USE_STD_MUTEX instead")
#undef ARMA_DONT_USE_STD_MUTEX
#define ARMA_DONT_USE_STD_MUTEX
#undef ARMA_USE_STD_MUTEX
#endif
#if defined(ARMA_DONT_USE_OPENMP)
@@ -301,6 +303,24 @@
#undef ARMA_64BIT_WORD
#endif
#if (defined(ARMA_BLAS_LONG_LONG) && defined(ARMA_USE_WRAPPER))
#pragma message ("WARNING: use of ARMA_BLAS_LONG_LONG in conjunction with ARMA_USE_WRAPPER is not supported")
#endif
#if (defined(ARMA_BLAS_64BIT_INT) && defined(ARMA_USE_WRAPPER))
#pragma message ("WARNING: use of ARMA_BLAS_64BIT_INT in conjunction with ARMA_USE_WRAPPER is not supported")
#endif
#if (defined(ARMA_SUPERLU_64BIT_INT) && defined(ARMA_USE_WRAPPER))
#pragma message ("WARNING: use of ARMA_SUPERLU_64BIT_INT in conjunction with ARMA_USE_WRAPPER is not supported")
#endif
// for compatibility with earlier versions of Armadillo
#if defined(ARMA_BLAS_LONG) || defined(ARMA_BLAS_LONG_LONG)
#undef ARMA_BLAS_64BIT_INT
#define ARMA_BLAS_64BIT_INT
#endif
#if defined(ARMA_DONT_OPTIMISE_BAND) || defined(ARMA_DONT_OPTIMISE_SOLVE_BAND)
#undef ARMA_OPTIMISE_BAND
#endif
@@ -313,36 +333,56 @@
#undef ARMA_OPTIMISE_INVEXPR
#endif
#if defined(ARMA_DONT_CHECK_CONFORMANCE)
#if defined(ARMA_CHECK_CONFORMANCE) && (ARMA_WARN_LEVEL >= 2)
#pragma message ("WARNING: conformance checks disabled")
#endif
#undef ARMA_CHECK_CONFORMANCE
#endif
#if defined(ARMA_DONT_CHECK_NONFINITE)
#undef ARMA_CHECK_NONFINITE
#endif
#if defined(ARMA_DONT_PRINT_ERRORS)
#pragma message ("INFO: support for ARMA_DONT_PRINT_ERRORS option has been removed")
#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
#endif
#if defined(ARMA_DEBUG)
#undef ARMA_DONT_CHECK_CONFORMANCE
#undef ARMA_DONT_CHECK_NONFINITE
#if defined(ARMA_PRINT_EXCEPTIONS)
#pragma message ("INFO: suggest to use ARMA_WARN_LEVEL and ARMA_DONT_PRINT_EXCEPTIONS options instead")
#else
#pragma message ("INFO: suggest to use ARMA_WARN_LEVEL option instead")
#endif
#undef ARMA_CHECK_CONFORMANCE
#define ARMA_CHECK_CONFORMANCE
#pragma message ("INFO: see the documentation for details")
#undef ARMA_CHECK_NONFINITE
#define ARMA_CHECK_NONFINITE
#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_DONT_ZERO_INIT)
// #define ARMA_DONT_ZERO_INIT
//// Uncomment the above line to disable initialising elements to zero during construction of dense matrices and cubes
#endif
#if defined(ARMA_NO_CRIPPLED_LAPACK)
#undef ARMA_CRIPPLED_LAPACK
#endif
// WARNING: option ARMA_CRIPPLED_LAPACK is deprecated and will be removed
// WARNING: option ARMA_IGNORE_DEPRECATED_MARKER is deprecated and will be removed
// if Armadillo was installed on this system via CMake and ARMA_USE_WRAPPER is not defined,
// ARMA_AUX_LIBS lists the libraries required by Armadillo on this system, and
// ARMA_AUX_INCDIRS lists the include directories required by Armadillo on this system.
+9 -9
View File
@@ -176,22 +176,22 @@ template<typename eT> const eT Datum<eT>::log_max = std::log(std::numeric_li
template<typename eT> const eT Datum<eT>::nan = priv::Datum_helper::nan<eT>();
template<typename eT> const eT Datum<eT>::inf = priv::Datum_helper::inf<eT>();
template<typename eT> const eT Datum<eT>::m_u = eT(1.66053906660e-27);
template<typename eT> const eT Datum<eT>::m_u = eT(1.66053906892e-27);
template<typename eT> const eT Datum<eT>::N_A = eT(6.02214076e23);
template<typename eT> const eT Datum<eT>::k = eT(1.380649e-23);
template<typename eT> const eT Datum<eT>::k_evk = eT(8.617333262e-5);
template<typename eT> const eT Datum<eT>::a_0 = eT(5.29177210903e-11);
template<typename eT> const eT Datum<eT>::mu_B = eT(9.2740100783e-24);
template<typename eT> const eT Datum<eT>::Z_0 = eT(376.730313668);
template<typename eT> const eT Datum<eT>::a_0 = eT(5.29177210544e-11);
template<typename eT> const eT Datum<eT>::mu_B = eT(9.2740100657e-24);
template<typename eT> const eT Datum<eT>::Z_0 = eT(376.730313412);
template<typename eT> const eT Datum<eT>::G_0 = eT(7.748091729e-5);
template<typename eT> const eT Datum<eT>::k_e = eT(8.9875517923e9);
template<typename eT> const eT Datum<eT>::eps_0 = eT(8.8541878128e-12);
template<typename eT> const eT Datum<eT>::m_e = eT(9.1093837015e-31);
template<typename eT> const eT Datum<eT>::m_e = eT(9.1093837139e-31);
template<typename eT> const eT Datum<eT>::eV = eT(1.602176634e-19);
template<typename eT> const eT Datum<eT>::ec = eT(1.602176634e-19);
template<typename eT> const eT Datum<eT>::F = eT(96485.33212);
template<typename eT> const eT Datum<eT>::alpha = eT(7.2973525693e-3);
template<typename eT> const eT Datum<eT>::alpha_inv = eT(137.035999084);
template<typename eT> const eT Datum<eT>::alpha = eT(7.2973525643e-3);
template<typename eT> const eT Datum<eT>::alpha_inv = eT(137.035999177);
template<typename eT> const eT Datum<eT>::K_J = eT(483597.8484e9);
template<typename eT> const eT Datum<eT>::mu_0 = eT(1.25663706212e-6);
template<typename eT> const eT Datum<eT>::phi_0 = eT(2.067833848e-15);
@@ -199,8 +199,8 @@ template<typename eT> const eT Datum<eT>::R = eT(8.314462618);
template<typename eT> const eT Datum<eT>::G = eT(6.67430e-11);
template<typename eT> const eT Datum<eT>::h = eT(6.62607015e-34);
template<typename eT> const eT Datum<eT>::h_bar = eT(1.054571817e-34);
template<typename eT> const eT Datum<eT>::m_p = eT(1.67262192369e-27);
template<typename eT> const eT Datum<eT>::R_inf = eT(10973731.568160);
template<typename eT> const eT Datum<eT>::m_p = eT(1.67262192595e-27);
template<typename eT> const eT Datum<eT>::R_inf = eT(10973731.568157);
template<typename eT> const eT Datum<eT>::c_0 = eT(299792458.0);
template<typename eT> const eT Datum<eT>::sigma = eT(5.670374419e-8);
template<typename eT> const eT Datum<eT>::R_k = eT(25812.80745);
+92 -96
View File
@@ -265,7 +265,7 @@ arma_print(const T1& x, const T2& y, const T3& z)
//! print a message to the cerr stream with a preceding @ character.
//! used for printing the signature of a function
//! (see the arma_extra_debug_sigprint macro)
//! (see the arma_debug_sigprint macro)
inline
void
arma_sigprint(const char* x)
@@ -317,13 +317,13 @@ inline
void
arma_thisprint(const void* this_ptr)
{
get_cerr_stream() << " [this = " << this_ptr << ']' << std::endl;
get_cerr_stream() << " [this: " << this_ptr << ']' << std::endl;
}
//
// arma_warn
// arma_plain_warn
//! print a message to the warn stream
@@ -332,7 +332,7 @@ arma_cold
arma_noinline
static
void
arma_warn(const T1& arg1)
arma_plain_warn(const T1& arg1)
{
get_cerr_stream() << "\nwarning: " << arg1 << std::endl;
}
@@ -343,7 +343,7 @@ arma_cold
arma_noinline
static
void
arma_warn(const T1& arg1, const T2& arg2)
arma_plain_warn(const T1& arg1, const T2& arg2)
{
get_cerr_stream() << "\nwarning: " << arg1 << arg2 << std::endl;
}
@@ -354,7 +354,7 @@ arma_cold
arma_noinline
static
void
arma_warn(const T1& arg1, const T2& arg2, const T3& arg3)
arma_plain_warn(const T1& arg1, const T2& arg2, const T3& arg3)
{
get_cerr_stream() << "\nwarning: " << arg1 << arg2 << arg3 << std::endl;
}
@@ -365,7 +365,7 @@ arma_cold
arma_noinline
static
void
arma_warn(const T1& arg1, const T2& arg2, const T3& arg3, const T4& arg4)
arma_plain_warn(const T1& arg1, const T2& arg2, const T3& arg3, const T4& arg4)
{
get_cerr_stream() << "\nwarning: " << arg1 << arg2 << arg3 << arg4 << std::endl;
}
@@ -373,50 +373,50 @@ arma_warn(const T1& arg1, const T2& arg2, const T3& arg3, const T4& arg4)
//
// arma_warn_level
// arma_warn
template<typename T1>
inline
void
arma_warn_level(const uword level, const T1& arg1)
arma_warn(const uword level, const T1& arg1)
{
constexpr uword config_level = (sword(ARMA_WARN_LEVEL) > 0) ? uword(ARMA_WARN_LEVEL) : uword(0);
if((config_level > 0) && (level <= config_level)) { arma_warn(arg1); }
if((config_level > 0) && (level <= config_level)) { arma_plain_warn(arg1); }
}
template<typename T1, typename T2>
inline
void
arma_warn_level(const uword level, const T1& arg1, const T2& arg2)
arma_warn(const uword level, const T1& arg1, const T2& arg2)
{
constexpr uword config_level = (sword(ARMA_WARN_LEVEL) > 0) ? uword(ARMA_WARN_LEVEL) : uword(0);
if((config_level > 0) && (level <= config_level)) { arma_warn(arg1,arg2); }
if((config_level > 0) && (level <= config_level)) { arma_plain_warn(arg1,arg2); }
}
template<typename T1, typename T2, typename T3>
inline
void
arma_warn_level(const uword level, const T1& arg1, const T2& arg2, const T3& arg3)
arma_warn(const uword level, const T1& arg1, const T2& arg2, const T3& arg3)
{
constexpr uword config_level = (sword(ARMA_WARN_LEVEL) > 0) ? uword(ARMA_WARN_LEVEL) : uword(0);
if((config_level > 0) && (level <= config_level)) { arma_warn(arg1,arg2,arg3); }
if((config_level > 0) && (level <= config_level)) { arma_plain_warn(arg1,arg2,arg3); }
}
template<typename T1, typename T2, typename T3, typename T4>
inline
void
arma_warn_level(const uword level, const T1& arg1, const T2& arg2, const T3& arg3, const T4& arg4)
arma_warn(const uword level, const T1& arg1, const T2& arg2, const T3& arg3, const T4& arg4)
{
constexpr uword config_level = (sword(ARMA_WARN_LEVEL) > 0) ? uword(ARMA_WARN_LEVEL) : uword(0);
if((config_level > 0) && (level <= config_level)) { arma_warn(arg1,arg2,arg3,arg4); }
if((config_level > 0) && (level <= config_level)) { arma_plain_warn(arg1,arg2,arg3,arg4); }
}
@@ -579,7 +579,7 @@ arma_assert_same_size(const uword A_n_rows, const uword A_n_cols, const uword B_
//! stop if given matrices have different sizes
//! stop if given matrices do not have the same size
template<typename eT1, typename eT2>
arma_hot
inline
@@ -600,7 +600,7 @@ arma_assert_same_size(const Mat<eT1>& A, const Mat<eT2>& B, const char* x)
//! stop if given proxies have different sizes
//! stop if given proxies do not have the same size
template<typename eT1, typename eT2>
arma_hot
inline
@@ -804,7 +804,7 @@ arma_assert_same_size(const uword A_n_rows, const uword A_n_cols, const uword A_
//! stop if given cubes have different sizes
//! stop if given cubes do not have the same size
template<typename eT1, typename eT2>
arma_hot
inline
@@ -883,7 +883,7 @@ arma_assert_same_size(const subview_cube<eT>& A, const ProxyCube<T1>& B, const c
//! stop if given cube proxies have different sizes
//! stop if given cube proxies do not have the same size
template<typename eT1, typename eT2>
arma_hot
inline
@@ -1339,48 +1339,52 @@ arma_assert_atlas_size(const T1& A, const T2& B)
// #define ARMA_FILELINE __FILE__ ": " ARMA_STRING2(__LINE__)
#if defined(ARMA_NO_DEBUG)
#if defined(ARMA_CHECK_CONFORMANCE)
#define arma_debug_print true ? (void)0 : arma_print
#define arma_debug_warn true ? (void)0 : arma_warn
#define arma_debug_warn_level true ? (void)0 : arma_warn_level
#define arma_debug_check true ? (void)0 : arma_check
#define arma_debug_check_bounds true ? (void)0 : arma_check_bounds
#define arma_debug_set_error true ? (void)0 : arma_set_error
#define arma_debug_assert_same_size true ? (void)0 : arma_assert_same_size
#define arma_debug_assert_mul_size true ? (void)0 : arma_assert_mul_size
#define arma_debug_assert_trans_mul_size true ? (void)0 : arma_assert_trans_mul_size
#define arma_debug_assert_cube_as_mat true ? (void)0 : arma_assert_cube_as_mat
#define arma_debug_assert_blas_size true ? (void)0 : arma_assert_blas_size
#define arma_debug_assert_atlas_size true ? (void)0 : arma_assert_atlas_size
#define arma_conform_check arma_check
#define arma_conform_check_bounds arma_check_bounds
#define arma_conform_set_error arma_set_error
#define arma_conform_assert_same_size arma_assert_same_size
#define arma_conform_assert_mul_size arma_assert_mul_size
#define arma_conform_assert_trans_mul_size arma_assert_trans_mul_size
#define arma_conform_assert_cube_as_mat arma_assert_cube_as_mat
#define arma_conform_assert_blas_size arma_assert_blas_size
#define arma_conform_assert_atlas_size arma_assert_atlas_size
#else
#define arma_debug_print arma_print
#define arma_debug_warn arma_warn
#define arma_debug_warn_level arma_warn_level
#define arma_debug_check arma_check
#define arma_debug_check_bounds arma_check_bounds
#define arma_debug_set_error arma_set_error
#define arma_debug_assert_same_size arma_assert_same_size
#define arma_debug_assert_mul_size arma_assert_mul_size
#define arma_debug_assert_trans_mul_size arma_assert_trans_mul_size
#define arma_debug_assert_cube_as_mat arma_assert_cube_as_mat
#define arma_debug_assert_blas_size arma_assert_blas_size
#define arma_debug_assert_atlas_size arma_assert_atlas_size
#define arma_conform_check true ? (void)0 : arma_check
#define arma_conform_check_bounds true ? (void)0 : arma_check_bounds
#define arma_conform_set_error true ? (void)0 : arma_set_error
#define arma_conform_assert_same_size true ? (void)0 : arma_assert_same_size
#define arma_conform_assert_mul_size true ? (void)0 : arma_assert_mul_size
#define arma_conform_assert_trans_mul_size true ? (void)0 : arma_assert_trans_mul_size
#define arma_conform_assert_cube_as_mat true ? (void)0 : arma_assert_cube_as_mat
#define arma_conform_assert_blas_size true ? (void)0 : arma_assert_blas_size
#define arma_conform_assert_atlas_size true ? (void)0 : arma_assert_atlas_size
#endif
#if defined(ARMA_EXTRA_DEBUG)
#if defined(ARMA_DEBUG)
#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
// for compatibility with earlier versions of Armadillo
#define arma_extra_debug_sigprint arma_sigprint(ARMA_FNSIG); arma_bktprint
#define arma_extra_debug_sigprint_this arma_sigprint(ARMA_FNSIG); arma_thisprint
#define arma_extra_debug_print arma_print
#else
#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
// for compatibility with earlier versions of Armadillo
#define arma_extra_debug_sigprint true ? (void)0 : arma_bktprint
#define arma_extra_debug_sigprint_this true ? (void)0 : arma_thisprint
#define arma_extra_debug_print true ? (void)0 : arma_print
@@ -1388,76 +1392,68 @@ arma_assert_atlas_size(const T1& A, const T2& B)
#endif
// for compatibility with earlier versions of Armadillo
arma_frown("use arma_conform_check() instead")
inline void arma_debug_check(bool state, const char* msg) { arma_conform_check(state, msg); }
#if defined(ARMA_EXTRA_DEBUG)
#if defined(ARMA_DEBUG)
namespace junk
{
class arma_first_extra_debug_message
class arma_first_debug_message
{
public:
inline
arma_first_extra_debug_message()
arma_first_debug_message()
{
union
{
unsigned short a;
unsigned char b[sizeof(unsigned short)];
} endian_test;
endian_test.a = 1;
const bool little_endian = (endian_test.b[0] == 1);
const char* nickname = ARMA_VERSION_NAME;
const char* nickname = ARMA_VERSION_NAME;
std::ostream& out = get_cerr_stream();
out << "@ ---" << '\n';
out << "@ Armadillo "
<< arma_version::major << '.' << arma_version::minor << '.' << arma_version::patch
<< " (" << nickname << ")\n";
<< " (" << nickname << ')';
out << "@ arma_config::wrapper = " << arma_config::wrapper << '\n';
out << "@ arma_config::cxx14 = " << arma_config::cxx14 << '\n';
out << "@ arma_config::cxx17 = " << arma_config::cxx17 << '\n';
out << "@ arma_config::cxx20 = " << arma_config::cxx20 << '\n';
out << "@ arma_config::cxx23 = " << arma_config::cxx23 << '\n';
out << "@ arma_config::std_mutex = " << arma_config::std_mutex << '\n';
out << "@ arma_config::posix = " << arma_config::posix << '\n';
out << "@ arma_config::openmp = " << arma_config::openmp << '\n';
out << "@ arma_config::lapack = " << arma_config::lapack << '\n';
out << "@ arma_config::blas = " << arma_config::blas << '\n';
out << "@ arma_config::newarp = " << arma_config::newarp << '\n';
out << "@ arma_config::arpack = " << arma_config::arpack << '\n';
out << "@ arma_config::superlu = " << arma_config::superlu << '\n';
out << "@ arma_config::atlas = " << arma_config::atlas << '\n';
out << "@ arma_config::hdf5 = " << arma_config::hdf5 << '\n';
out << "@ arma_config::good_comp = " << arma_config::good_comp << '\n';
out << "@ arma_config::extra_code = " << arma_config::extra_code << '\n';
out << "@ arma_config::hidden_args = " << arma_config::hidden_args << '\n';
out << "@ arma_config::mat_prealloc = " << arma_config::mat_prealloc << '\n';
out << "@ arma_config::mp_threshold = " << arma_config::mp_threshold << '\n';
out << "@ arma_config::mp_threads = " << arma_config::mp_threads << '\n';
out << "@ arma_config::optimise_band = " << arma_config::optimise_band << '\n';
out << "@ arma_config::optimise_sym = " << arma_config::optimise_sym << '\n';
out << "@ arma_config::optimise_invexpr = " << arma_config::optimise_invexpr << '\n';
out << "@ arma_config::check_nonfinite = " << arma_config::check_nonfinite << '\n';
out << "@ arma_config::zero_init = " << arma_config::zero_init << '\n';
out << "@ arma_config::fast_math = " << arma_config::fast_math << '\n';
out << "@ sizeof(void*) = " << sizeof(void*) << '\n';
out << "@ sizeof(int) = " << sizeof(int) << '\n';
out << "@ sizeof(long) = " << sizeof(long) << '\n';
out << "@ sizeof(uword) = " << sizeof(uword) << '\n';
out << "@ sizeof(blas_int) = " << sizeof(blas_int) << '\n';
out << "@ little_endian = " << little_endian << '\n';
out << "@ ---" << std::endl;
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;
out << "\n@ arma_config::std_mutex = " << arma_config::std_mutex;
out << "\n@ arma_config::posix = " << arma_config::posix;
out << "\n@ arma_config::openmp = " << arma_config::openmp;
out << "\n@ arma_config::lapack = " << arma_config::lapack;
out << "\n@ arma_config::blas = " << arma_config::blas;
out << "\n@ arma_config::newarp = " << arma_config::newarp;
out << "\n@ arma_config::arpack = " << arma_config::arpack;
out << "\n@ arma_config::superlu = " << arma_config::superlu;
out << "\n@ arma_config::atlas = " << arma_config::atlas;
out << "\n@ arma_config::hdf5 = " << arma_config::hdf5;
out << "\n@ arma_config::good_comp = " << arma_config::good_comp;
out << "\n@ arma_config::extra_code = " << arma_config::extra_code;
out << "\n@ arma_config::hidden_args = " << arma_config::hidden_args;
out << "\n@ arma_config::mat_prealloc = " << arma_config::mat_prealloc;
out << "\n@ arma_config::mp_threshold = " << arma_config::mp_threshold;
out << "\n@ arma_config::mp_threads = " << arma_config::mp_threads;
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::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@ sizeof(void*) = " << sizeof(void*);
out << "\n@ sizeof(int) = " << sizeof(int);
out << "\n@ sizeof(long) = " << sizeof(long);
out << "\n@ sizeof(uword) = " << sizeof(uword);
out << "\n@ sizeof(blas_int) = " << sizeof(blas_int);
out << "\n@ ---" << std::endl;
}
};
static arma_first_extra_debug_message arma_first_extra_debug_message_run;
static arma_first_debug_message arma_first_debug_message_run;
}
#endif
+112
View File
@@ -269,6 +269,30 @@
#define arma_cpstrf cpstrf
#define arma_zpstrf zpstrf
#define arma_ssytrf ssytrf
#define arma_dsytrf dsytrf
#define arma_chetrf chetrf
#define arma_zhetrf zhetrf
#define arma_ssytrs ssytrs
#define arma_dsytrs dsytrs
#define arma_chetrs chetrs
#define arma_zhetrs zhetrs
#define arma_ssytri ssytri
#define arma_dsytri dsytri
#define arma_chetri chetri
#define arma_zhetri zhetri
#define arma_ssycon ssycon
#define arma_dsycon dsycon
#define arma_checon checon
#define arma_zhecon zhecon
#else
#define arma_sgetrf SGETRF
@@ -505,6 +529,30 @@
#define arma_cpstrf CPSTRF
#define arma_zpstrf ZPSTRF
#define arma_ssytrf SSYTRF
#define arma_dsytrf DSYTRF
#define arma_chetrf CHETRF
#define arma_zhetrf ZHETRF
#define arma_ssytrs SSYTRS
#define arma_dsytrs DSYTRS
#define arma_chetrs CHETRS
#define arma_zhetrs ZHETRS
#define arma_ssytri SSYTRI
#define arma_dsytri DSYTRI
#define arma_chetri CHETRI
#define arma_zhetri ZHETRI
#define arma_ssycon SSYCON
#define arma_dsycon DSYCON
#define arma_checon CHECON
#define arma_zhecon ZHECON
#endif
@@ -846,6 +894,38 @@ extern "C"
void arma_fortran(arma_cpstrf)(const char* uplo, const blas_int* n, blas_cxf* a, const blas_int* lda, blas_int* piv, blas_int* rank, const float* tol, float* work, blas_int* info, blas_len uplo_len) ARMA_NOEXCEPT;
void arma_fortran(arma_zpstrf)(const char* uplo, const blas_int* n, blas_cxd* a, const blas_int* lda, blas_int* piv, blas_int* rank, const double* tol, double* work, blas_int* info, blas_len uplo_len) ARMA_NOEXCEPT;
// factorisation of symmetric matrix (real)
void arma_fortran(arma_ssytrf)(const char* uplo, const blas_int* n, float* a, const blas_int* lda, blas_int* ipiv, float* work, const blas_int* lwork, blas_int* info, blas_len uplo_len) ARMA_NOEXCEPT;
void arma_fortran(arma_dsytrf)(const char* uplo, const blas_int* n, double* a, const blas_int* lda, blas_int* ipiv, double* work, const blas_int* lwork, blas_int* info, blas_len uplo_len) ARMA_NOEXCEPT;
// factorisation of hermitian matrix (complex)
void arma_fortran(arma_chetrf)(const char* uplo, const blas_int* n, blas_cxf* a, const blas_int* lda, blas_int* ipiv, blas_cxf* work, const blas_int* lwork, blas_int* info, blas_len uplo_len) ARMA_NOEXCEPT;
void arma_fortran(arma_zhetrf)(const char* uplo, const blas_int* n, blas_cxd* a, const blas_int* lda, blas_int* ipiv, blas_cxd* work, const blas_int* lwork, blas_int* info, blas_len uplo_len) ARMA_NOEXCEPT;
// solve system using pre-computed factorisation (real)
void arma_fortran(arma_ssytrs)(const char* uplo, const blas_int* n, const blas_int* nrhs, const float* a, const blas_int* lda, const blas_int* ipiv, float* b, const blas_int* ldb, blas_int* info, blas_len uplo_len) ARMA_NOEXCEPT;
void arma_fortran(arma_dsytrs)(const char* uplo, const blas_int* n, const blas_int* nrhs, const double* a, const blas_int* lda, const blas_int* ipiv, double* b, const blas_int* ldb, blas_int* info, blas_len uplo_len) ARMA_NOEXCEPT;
// solve system using pre-computed factorisation (complex)
void arma_fortran(arma_chetrs)(const char* uplo, const blas_int* n, const blas_int* nrhs, const blas_cxf* a, const blas_int* lda, const blas_int* ipiv, blas_cxf* b, const blas_int* ldb, blas_int* info, blas_len uplo_len) ARMA_NOEXCEPT;
void arma_fortran(arma_zhetrs)(const char* uplo, const blas_int* n, const blas_int* nrhs, const blas_cxd* a, const blas_int* lda, const blas_int* ipiv, blas_cxd* b, const blas_int* ldb, blas_int* info, blas_len uplo_len) ARMA_NOEXCEPT;
// inverse of symmetric matrix using pre-computed factorisation (real)
void arma_fortran(arma_ssytri)(const char* uplo, const blas_int* n, float* a, const blas_int* lda, const blas_int* ipiv, float* work, blas_int* info, blas_len uplo_len) ARMA_NOEXCEPT;
void arma_fortran(arma_dsytri)(const char* uplo, const blas_int* n, double* a, const blas_int* lda, const blas_int* ipiv, double* work, blas_int* info, blas_len uplo_len) ARMA_NOEXCEPT;
// inverse of hermitian matrix using pre-computed factorisation (complex)
void arma_fortran(arma_chetri)(const char* uplo, const blas_int* n, blas_cxf* a, const blas_int* lda, const blas_int* ipiv, blas_cxf* work, blas_int* info, blas_len uplo_len) ARMA_NOEXCEPT;
void arma_fortran(arma_zhetri)(const char* uplo, const blas_int* n, blas_cxd* a, const blas_int* lda, const blas_int* ipiv, blas_cxd* work, blas_int* info, blas_len uplo_len) ARMA_NOEXCEPT;
// rcond of symmetric matrix using pre-computed factorisation (real)
void arma_fortran(arma_ssycon)(const char* uplo, const blas_int* n, const float* a, const blas_int* lda, const blas_int* ipiv, const float* anorm, float* rcond, float* work, blas_int* iwork, blas_int* info, blas_len uplo_len) ARMA_NOEXCEPT;
void arma_fortran(arma_dsycon)(const char* uplo, const blas_int* n, const double* a, const blas_int* lda, const blas_int* ipiv, const double* anorm, double* rcond, double* work, blas_int* iwork, blas_int* info, blas_len uplo_len) ARMA_NOEXCEPT;
// rcond of hermitian matrix using pre-computed factorisation (complex)
void arma_fortran(arma_checon)(const char* uplo, const blas_int* n, const blas_cxf* a, const blas_int* lda, const blas_int* ipiv, const float* anorm, float* rcond, blas_cxf* work, blas_int* info, blas_len uplo_len) ARMA_NOEXCEPT;
void arma_fortran(arma_zhecon)(const char* uplo, const blas_int* n, const blas_cxd* a, const blas_int* lda, const blas_int* ipiv, const double* anorm, double* rcond, blas_cxd* work, blas_int* info, blas_len uplo_len) ARMA_NOEXCEPT;
#else
// prototypes without hidden arguments
@@ -1170,6 +1250,38 @@ extern "C"
void arma_fortran(arma_cpstrf)(const char* uplo, const blas_int* n, blas_cxf* a, const blas_int* lda, blas_int* piv, blas_int* rank, const float* tol, float* work, blas_int* info) ARMA_NOEXCEPT;
void arma_fortran(arma_zpstrf)(const char* uplo, const blas_int* n, blas_cxd* a, const blas_int* lda, blas_int* piv, blas_int* rank, const double* tol, double* work, blas_int* info) ARMA_NOEXCEPT;
// factorisation of symmetric matrix (real)
void arma_fortran(arma_ssytrf)(const char* uplo, const blas_int* n, float* a, const blas_int* lda, blas_int* ipiv, float* work, const blas_int* lwork, blas_int* info) ARMA_NOEXCEPT;
void arma_fortran(arma_dsytrf)(const char* uplo, const blas_int* n, double* a, const blas_int* lda, blas_int* ipiv, double* work, const blas_int* lwork, blas_int* info) ARMA_NOEXCEPT;
// factorisation of hermitian matrix (complex)
void arma_fortran(arma_chetrf)(const char* uplo, const blas_int* n, blas_cxf* a, const blas_int* lda, blas_int* ipiv, blas_cxf* work, const blas_int* lwork, blas_int* info) ARMA_NOEXCEPT;
void arma_fortran(arma_zhetrf)(const char* uplo, const blas_int* n, blas_cxd* a, const blas_int* lda, blas_int* ipiv, blas_cxd* work, const blas_int* lwork, blas_int* info) ARMA_NOEXCEPT;
// solve system using pre-computed factorisation (real)
void arma_fortran(arma_ssytrs)(const char* uplo, const blas_int* n, const blas_int* nrhs, const float* a, const blas_int* lda, const blas_int* ipiv, float* b, const blas_int* ldb, blas_int* info) ARMA_NOEXCEPT;
void arma_fortran(arma_dsytrs)(const char* uplo, const blas_int* n, const blas_int* nrhs, const double* a, const blas_int* lda, const blas_int* ipiv, double* b, const blas_int* ldb, blas_int* info) ARMA_NOEXCEPT;
// solve system using pre-computed factorisation (complex)
void arma_fortran(arma_zhetrs)(const char* uplo, const blas_int* n, const blas_int* nrhs, const blas_cxd* a, const blas_int* lda, const blas_int* ipiv, blas_cxd* b, const blas_int* ldb, blas_int* info) ARMA_NOEXCEPT;
void arma_fortran(arma_chetrs)(const char* uplo, const blas_int* n, const blas_int* nrhs, const blas_cxf* a, const blas_int* lda, const blas_int* ipiv, blas_cxf* b, const blas_int* ldb, blas_int* info) ARMA_NOEXCEPT;
// inverse of symmetric matrix using pre-computed factorisation (real)
void arma_fortran(arma_ssytri)(const char* uplo, const blas_int* n, float* a, const blas_int* lda, const blas_int* ipiv, float* work, blas_int* info) ARMA_NOEXCEPT;
void arma_fortran(arma_dsytri)(const char* uplo, const blas_int* n, double* a, const blas_int* lda, const blas_int* ipiv, double* work, blas_int* info) ARMA_NOEXCEPT;
// inverse of hermitian matrix using pre-computed factorisation (complex)
void arma_fortran(arma_chetri)(const char* uplo, const blas_int* n, blas_cxf* a, const blas_int* lda, const blas_int* ipiv, blas_cxf* work, blas_int* info) ARMA_NOEXCEPT;
void arma_fortran(arma_zhetri)(const char* uplo, const blas_int* n, blas_cxd* a, const blas_int* lda, const blas_int* ipiv, blas_cxd* work, blas_int* info) ARMA_NOEXCEPT;
// rcond of symmetric matrix using pre-computed factorisation (real)
void arma_fortran(arma_ssycon)(const char* uplo, const blas_int* n, const float* a, const blas_int* lda, const blas_int* ipiv, const float* anorm, float* rcond, float* work, blas_int* iwork, blas_int* info) ARMA_NOEXCEPT;
void arma_fortran(arma_dsycon)(const char* uplo, const blas_int* n, const double* a, const blas_int* lda, const blas_int* ipiv, const double* anorm, double* rcond, double* work, blas_int* iwork, blas_int* info) ARMA_NOEXCEPT;
// rcond of hermitian matrix using pre-computed factorisation (complex)
void arma_fortran(arma_checon)(const char* uplo, const blas_int* n, const blas_cxf* a, const blas_int* lda, const blas_int* ipiv, const float* anorm, float* rcond, blas_cxf* work, blas_int* info) ARMA_NOEXCEPT;
void arma_fortran(arma_zhecon)(const char* uplo, const blas_int* n, const blas_cxd* a, const blas_int* lda, const blas_int* ipiv, const double* anorm, double* rcond, blas_cxd* work, blas_int* info) ARMA_NOEXCEPT;
#endif
}
+12 -12
View File
@@ -19,20 +19,20 @@
extern "C"
{
extern void arma_wrapper(sgssv)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperLUStat_t*, int*);
extern void arma_wrapper(dgssv)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperLUStat_t*, int*);
extern void arma_wrapper(cgssv)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperLUStat_t*, int*);
extern void arma_wrapper(zgssv)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperLUStat_t*, int*);
extern void arma_wrapper(sgssv)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperLUStat_t*, superlu::int_t*);
extern void arma_wrapper(dgssv)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperLUStat_t*, superlu::int_t*);
extern void arma_wrapper(cgssv)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperLUStat_t*, superlu::int_t*);
extern void arma_wrapper(zgssv)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::SuperLUStat_t*, superlu::int_t*);
extern void arma_wrapper(sgssvx)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, int*, char*, float*, float*, superlu::SuperMatrix*, superlu::SuperMatrix*, void*, int, superlu::SuperMatrix*, superlu::SuperMatrix*, float*, float*, float*, float*, superlu::GlobalLU_t*, superlu::mem_usage_t*, superlu::SuperLUStat_t*, int*);
extern void arma_wrapper(dgssvx)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, int*, char*, double*, double*, superlu::SuperMatrix*, superlu::SuperMatrix*, void*, int, superlu::SuperMatrix*, superlu::SuperMatrix*, double*, double*, double*, double*, superlu::GlobalLU_t*, superlu::mem_usage_t*, superlu::SuperLUStat_t*, int*);
extern void arma_wrapper(cgssvx)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, int*, char*, float*, float*, superlu::SuperMatrix*, superlu::SuperMatrix*, void*, int, superlu::SuperMatrix*, superlu::SuperMatrix*, float*, float*, float*, float*, superlu::GlobalLU_t*, superlu::mem_usage_t*, superlu::SuperLUStat_t*, int*);
extern void arma_wrapper(zgssvx)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, int*, char*, double*, double*, superlu::SuperMatrix*, superlu::SuperMatrix*, void*, int, superlu::SuperMatrix*, superlu::SuperMatrix*, double*, double*, double*, double*, superlu::GlobalLU_t*, superlu::mem_usage_t*, superlu::SuperLUStat_t*, int*);
extern void arma_wrapper(sgssvx)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, int*, char*, float*, float*, superlu::SuperMatrix*, superlu::SuperMatrix*, void*, superlu::int_t, superlu::SuperMatrix*, superlu::SuperMatrix*, float*, float*, float*, float*, superlu::GlobalLU_t*, superlu::mem_usage_t*, superlu::SuperLUStat_t*, superlu::int_t*);
extern void arma_wrapper(dgssvx)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, int*, char*, double*, double*, superlu::SuperMatrix*, superlu::SuperMatrix*, void*, superlu::int_t, superlu::SuperMatrix*, superlu::SuperMatrix*, double*, double*, double*, double*, superlu::GlobalLU_t*, superlu::mem_usage_t*, superlu::SuperLUStat_t*, superlu::int_t*);
extern void arma_wrapper(cgssvx)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, int*, char*, float*, float*, superlu::SuperMatrix*, superlu::SuperMatrix*, void*, superlu::int_t, superlu::SuperMatrix*, superlu::SuperMatrix*, float*, float*, float*, float*, superlu::GlobalLU_t*, superlu::mem_usage_t*, superlu::SuperLUStat_t*, superlu::int_t*);
extern void arma_wrapper(zgssvx)(superlu::superlu_options_t*, superlu::SuperMatrix*, int*, int*, int*, char*, double*, double*, superlu::SuperMatrix*, superlu::SuperMatrix*, void*, superlu::int_t, superlu::SuperMatrix*, superlu::SuperMatrix*, double*, double*, double*, double*, superlu::GlobalLU_t*, superlu::mem_usage_t*, superlu::SuperLUStat_t*, superlu::int_t*);
extern void arma_wrapper(sgstrf)(superlu::superlu_options_t*, superlu::SuperMatrix*, int, int, int*, void*, int, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::GlobalLU_t*, superlu::SuperLUStat_t*, int*);
extern void arma_wrapper(dgstrf)(superlu::superlu_options_t*, superlu::SuperMatrix*, int, int, int*, void*, int, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::GlobalLU_t*, superlu::SuperLUStat_t*, int*);
extern void arma_wrapper(cgstrf)(superlu::superlu_options_t*, superlu::SuperMatrix*, int, int, int*, void*, int, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::GlobalLU_t*, superlu::SuperLUStat_t*, int*);
extern void arma_wrapper(zgstrf)(superlu::superlu_options_t*, superlu::SuperMatrix*, int, int, int*, void*, int, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::GlobalLU_t*, superlu::SuperLUStat_t*, int*);
extern void arma_wrapper(sgstrf)(superlu::superlu_options_t*, superlu::SuperMatrix*, int, int, int*, void*, superlu::int_t, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::GlobalLU_t*, superlu::SuperLUStat_t*, superlu::int_t*);
extern void arma_wrapper(dgstrf)(superlu::superlu_options_t*, superlu::SuperMatrix*, int, int, int*, void*, superlu::int_t, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::GlobalLU_t*, superlu::SuperLUStat_t*, superlu::int_t*);
extern void arma_wrapper(cgstrf)(superlu::superlu_options_t*, superlu::SuperMatrix*, int, int, int*, void*, superlu::int_t, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::GlobalLU_t*, superlu::SuperLUStat_t*, superlu::int_t*);
extern void arma_wrapper(zgstrf)(superlu::superlu_options_t*, superlu::SuperMatrix*, int, int, int*, void*, superlu::int_t, int*, int*, superlu::SuperMatrix*, superlu::SuperMatrix*, superlu::GlobalLU_t*, superlu::SuperLUStat_t*, superlu::int_t*);
extern void arma_wrapper(sgstrs)(superlu::trans_t, superlu::SuperMatrix*, superlu::SuperMatrix*, int*, int*, superlu::SuperMatrix*, superlu::SuperLUStat_t*, int*);
extern void arma_wrapper(dgstrs)(superlu::trans_t, superlu::SuperMatrix*, superlu::SuperMatrix*, int*, int*, superlu::SuperMatrix*, superlu::SuperLUStat_t*, int*);
+8 -8
View File
@@ -37,7 +37,7 @@ class diagmat_proxy_default
, n_rows ( P_is_vec ? P.get_n_elem() : P.get_n_rows() )
, n_cols ( P_is_vec ? P.get_n_elem() : P.get_n_cols() )
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -115,7 +115,7 @@ class diagmat_proxy_fixed
diagmat_proxy_fixed(const T1& X)
: P(X)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -195,7 +195,7 @@ class diagmat_proxy< Mat<eT> >
, n_rows ( P_is_vec ? X.n_elem : X.n_rows )
, n_cols ( P_is_vec ? X.n_elem : X.n_cols )
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline elem_type operator[] (const uword i) const { return P_is_vec ? P[i] : P.at(i,i); }
@@ -226,7 +226,7 @@ class diagmat_proxy< Row<eT> >
, n_rows(X.n_elem)
, n_cols(X.n_elem)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline elem_type operator[] (const uword i) const { return P[i]; }
@@ -258,7 +258,7 @@ class diagmat_proxy< Col<eT> >
, n_rows(X.n_elem)
, n_cols(X.n_elem)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline elem_type operator[] (const uword i) const { return P[i]; }
@@ -290,7 +290,7 @@ class diagmat_proxy< subview_row<eT> >
, n_rows(X.n_elem)
, n_cols(X.n_elem)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline elem_type operator[] (const uword i) const { return P[i]; }
@@ -322,7 +322,7 @@ class diagmat_proxy< subview_col<eT> >
, n_rows(X.n_elem)
, n_cols(X.n_elem)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline elem_type operator[] (const uword i) const { return P[i]; }
@@ -355,7 +355,7 @@ class diagmat_proxy< Glue<T1,T2,glue_times> >
n_rows = P.n_rows;
n_cols = P.n_cols;
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
arma_inline elem_type operator[] (const uword i) const { return P.at(i,i); }
+4 -1
View File
@@ -29,7 +29,7 @@ class diagview : public Base< eT, diagview<eT> >
typedef eT elem_type;
typedef typename get_pod_type<eT>::result pod_type;
arma_aligned const Mat<eT>& m;
const Mat<eT>& m;
static constexpr bool is_row = false;
static constexpr bool is_col = true;
@@ -108,6 +108,9 @@ class diagview : public Base< eT, diagview<eT> >
inline static void schur_inplace(Mat<eT>& out, const diagview& in);
inline static void div_inplace(Mat<eT>& out, const diagview& in);
template<typename eT2>
inline bool is_alias(const Mat<eT2>& X) const;
friend class Mat<eT>;
friend class subview<eT>;
+75 -62
View File
@@ -24,7 +24,7 @@ template<typename eT>
inline
diagview<eT>::~diagview()
{
arma_extra_debug_sigprint_this(this);
arma_debug_sigprint_this(this);
}
@@ -38,7 +38,7 @@ diagview<eT>::diagview(const Mat<eT>& in_m, const uword in_row_offset, const uwo
, n_rows (in_len )
, n_elem (in_len )
{
arma_extra_debug_sigprint_this(this);
arma_debug_sigprint_this(this);
}
@@ -52,7 +52,7 @@ diagview<eT>::diagview(const diagview<eT>& in)
, n_rows (in.n_rows )
, n_elem (in.n_elem )
{
arma_extra_debug_sigprint(arma_str::format("this = %x in = %x") % this % &in);
arma_debug_sigprint(arma_str::format("this: %x; in: %x") % this % &in);
}
@@ -66,7 +66,7 @@ diagview<eT>::diagview(diagview<eT>&& in)
, n_rows (in.n_rows )
, n_elem (in.n_elem )
{
arma_extra_debug_sigprint(arma_str::format("this = %x in = %x") % this % &in);
arma_debug_sigprint(arma_str::format("this: %x; in: %x") % this % &in);
// for paranoia
@@ -84,11 +84,11 @@ inline
void
diagview<eT>::operator= (const diagview<eT>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
diagview<eT>& d = *this;
arma_debug_check( (d.n_elem != x.n_elem), "diagview: diagonals have incompatible lengths" );
arma_conform_check( (d.n_elem != x.n_elem), "diagview: diagonals have incompatible lengths" );
Mat<eT>& d_m = const_cast< Mat<eT>& >(d.m);
const Mat<eT>& x_m = x.m;
@@ -132,7 +132,7 @@ inline
void
diagview<eT>::operator+=(const eT val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
Mat<eT>& t_m = const_cast< Mat<eT>& >(m);
@@ -153,7 +153,7 @@ inline
void
diagview<eT>::operator-=(const eT val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
Mat<eT>& t_m = const_cast< Mat<eT>& >(m);
@@ -174,7 +174,7 @@ inline
void
diagview<eT>::operator*=(const eT val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
Mat<eT>& t_m = const_cast< Mat<eT>& >(m);
@@ -195,7 +195,7 @@ inline
void
diagview<eT>::operator/=(const eT val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
Mat<eT>& t_m = const_cast< Mat<eT>& >(m);
@@ -218,7 +218,7 @@ inline
void
diagview<eT>::operator= (const Base<eT,T1>& o)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
diagview<eT>& d = *this;
@@ -230,19 +230,19 @@ diagview<eT>::operator= (const Base<eT,T1>& o)
const Proxy<T1> P( o.get_ref() );
arma_debug_check
arma_conform_check
(
( (d_n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_cols() != 1)) ),
"diagview: given object has incompatible size"
);
const bool is_alias = P.is_alias(d_m);
const bool have_alias = P.is_alias(d_m);
if(is_alias) { arma_extra_debug_print("aliasing detected"); }
if(have_alias) { arma_debug_print("aliasing detected"); }
if( (is_Mat<typename Proxy<T1>::stored_type>::value) || (Proxy<T1>::use_at) || (is_alias) )
if( (is_Mat<typename Proxy<T1>::stored_type>::value) || (Proxy<T1>::use_at) || (have_alias) )
{
const unwrap_check<typename Proxy<T1>::stored_type> tmp(P.Q, is_alias);
const unwrap_check<typename Proxy<T1>::stored_type> tmp(P.Q, have_alias);
const Mat<eT>& x = tmp.M;
const eT* x_mem = x.memptr();
@@ -291,7 +291,7 @@ inline
void
diagview<eT>::operator+=(const Base<eT,T1>& o)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
diagview<eT>& d = *this;
@@ -303,19 +303,19 @@ diagview<eT>::operator+=(const Base<eT,T1>& o)
const Proxy<T1> P( o.get_ref() );
arma_debug_check
arma_conform_check
(
( (d_n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_cols() != 1)) ),
"diagview: given object has incompatible size"
);
const bool is_alias = P.is_alias(d_m);
const bool have_alias = P.is_alias(d_m);
if(is_alias) { arma_extra_debug_print("aliasing detected"); }
if(have_alias) { arma_debug_print("aliasing detected"); }
if( (is_Mat<typename Proxy<T1>::stored_type>::value) || (Proxy<T1>::use_at) || (is_alias) )
if( (is_Mat<typename Proxy<T1>::stored_type>::value) || (Proxy<T1>::use_at) || (have_alias) )
{
const unwrap_check<typename Proxy<T1>::stored_type> tmp(P.Q, is_alias);
const unwrap_check<typename Proxy<T1>::stored_type> tmp(P.Q, have_alias);
const Mat<eT>& x = tmp.M;
const eT* x_mem = x.memptr();
@@ -364,7 +364,7 @@ inline
void
diagview<eT>::operator-=(const Base<eT,T1>& o)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
diagview<eT>& d = *this;
@@ -376,19 +376,19 @@ diagview<eT>::operator-=(const Base<eT,T1>& o)
const Proxy<T1> P( o.get_ref() );
arma_debug_check
arma_conform_check
(
( (d_n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_cols() != 1)) ),
"diagview: given object has incompatible size"
);
const bool is_alias = P.is_alias(d_m);
const bool have_alias = P.is_alias(d_m);
if(is_alias) { arma_extra_debug_print("aliasing detected"); }
if(have_alias) { arma_debug_print("aliasing detected"); }
if( (is_Mat<typename Proxy<T1>::stored_type>::value) || (Proxy<T1>::use_at) || (is_alias) )
if( (is_Mat<typename Proxy<T1>::stored_type>::value) || (Proxy<T1>::use_at) || (have_alias) )
{
const unwrap_check<typename Proxy<T1>::stored_type> tmp(P.Q, is_alias);
const unwrap_check<typename Proxy<T1>::stored_type> tmp(P.Q, have_alias);
const Mat<eT>& x = tmp.M;
const eT* x_mem = x.memptr();
@@ -437,7 +437,7 @@ inline
void
diagview<eT>::operator%=(const Base<eT,T1>& o)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
diagview<eT>& d = *this;
@@ -449,19 +449,19 @@ diagview<eT>::operator%=(const Base<eT,T1>& o)
const Proxy<T1> P( o.get_ref() );
arma_debug_check
arma_conform_check
(
( (d_n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_cols() != 1)) ),
"diagview: given object has incompatible size"
);
const bool is_alias = P.is_alias(d_m);
const bool have_alias = P.is_alias(d_m);
if(is_alias) { arma_extra_debug_print("aliasing detected"); }
if(have_alias) { arma_debug_print("aliasing detected"); }
if( (is_Mat<typename Proxy<T1>::stored_type>::value) || (Proxy<T1>::use_at) || (is_alias) )
if( (is_Mat<typename Proxy<T1>::stored_type>::value) || (Proxy<T1>::use_at) || (have_alias) )
{
const unwrap_check<typename Proxy<T1>::stored_type> tmp(P.Q, is_alias);
const unwrap_check<typename Proxy<T1>::stored_type> tmp(P.Q, have_alias);
const Mat<eT>& x = tmp.M;
const eT* x_mem = x.memptr();
@@ -510,7 +510,7 @@ inline
void
diagview<eT>::operator/=(const Base<eT,T1>& o)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
diagview<eT>& d = *this;
@@ -522,19 +522,19 @@ diagview<eT>::operator/=(const Base<eT,T1>& o)
const Proxy<T1> P( o.get_ref() );
arma_debug_check
arma_conform_check
(
( (d_n_elem != P.get_n_elem()) || ((P.get_n_rows() != 1) && (P.get_n_cols() != 1)) ),
"diagview: given object has incompatible size"
);
const bool is_alias = P.is_alias(d_m);
const bool have_alias = P.is_alias(d_m);
if(is_alias) { arma_extra_debug_print("aliasing detected"); }
if(have_alias) { arma_debug_print("aliasing detected"); }
if( (is_Mat<typename Proxy<T1>::stored_type>::value) || (Proxy<T1>::use_at) || (is_alias) )
if( (is_Mat<typename Proxy<T1>::stored_type>::value) || (Proxy<T1>::use_at) || (have_alias) )
{
const unwrap_check<typename Proxy<T1>::stored_type> tmp(P.Q, is_alias);
const unwrap_check<typename Proxy<T1>::stored_type> tmp(P.Q, have_alias);
const Mat<eT>& x = tmp.M;
const eT* x_mem = x.memptr();
@@ -583,10 +583,10 @@ inline
void
diagview<eT>::extract(Mat<eT>& out, const diagview<eT>& in)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
// NOTE: we're assuming that the matrix has already been set to the correct size and there is no aliasing;
// size setting and alias checking is done by either the Mat contructor or operator=()
// size setting and alias checking is done by either the Mat constructor or operator=()
const Mat<eT>& in_m = in.m;
@@ -620,9 +620,9 @@ inline
void
diagview<eT>::plus_inplace(Mat<eT>& out, const diagview<eT>& in)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_debug_assert_same_size(out.n_rows, out.n_cols, in.n_rows, in.n_cols, "addition");
arma_conform_assert_same_size(out.n_rows, out.n_cols, in.n_rows, in.n_cols, "addition");
const Mat<eT>& in_m = in.m;
@@ -656,9 +656,9 @@ inline
void
diagview<eT>::minus_inplace(Mat<eT>& out, const diagview<eT>& in)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_debug_assert_same_size(out.n_rows, out.n_cols, in.n_rows, in.n_cols, "subtraction");
arma_conform_assert_same_size(out.n_rows, out.n_cols, in.n_rows, in.n_cols, "subtraction");
const Mat<eT>& in_m = in.m;
@@ -692,9 +692,9 @@ inline
void
diagview<eT>::schur_inplace(Mat<eT>& out, const diagview<eT>& in)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_debug_assert_same_size(out.n_rows, out.n_cols, in.n_rows, in.n_cols, "element-wise multiplication");
arma_conform_assert_same_size(out.n_rows, out.n_cols, in.n_rows, in.n_cols, "element-wise multiplication");
const Mat<eT>& in_m = in.m;
@@ -728,9 +728,9 @@ inline
void
diagview<eT>::div_inplace(Mat<eT>& out, const diagview<eT>& in)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_debug_assert_same_size(out.n_rows, out.n_cols, in.n_rows, in.n_cols, "element-wise division");
arma_conform_assert_same_size(out.n_rows, out.n_cols, in.n_rows, in.n_cols, "element-wise division");
const Mat<eT>& in_m = in.m;
@@ -813,7 +813,7 @@ arma_inline
eT&
diagview<eT>::operator()(const uword ii)
{
arma_debug_check_bounds( (ii >= n_elem), "diagview::operator(): out of bounds" );
arma_conform_check_bounds( (ii >= n_elem), "diagview::operator(): out of bounds" );
return (const_cast< Mat<eT>& >(m)).at(ii+row_offset, ii+col_offset);
}
@@ -825,7 +825,7 @@ arma_inline
eT
diagview<eT>::operator()(const uword ii) const
{
arma_debug_check_bounds( (ii >= n_elem), "diagview::operator(): out of bounds" );
arma_conform_check_bounds( (ii >= n_elem), "diagview::operator(): out of bounds" );
return m.at(ii+row_offset, ii+col_offset);
}
@@ -857,7 +857,7 @@ arma_inline
eT&
diagview<eT>::operator()(const uword row, const uword col)
{
arma_debug_check_bounds( ((row >= n_elem) || (col > 0)), "diagview::operator(): out of bounds" );
arma_conform_check_bounds( ((row >= n_elem) || (col > 0)), "diagview::operator(): out of bounds" );
return (const_cast< Mat<eT>& >(m)).at(row+row_offset, row+col_offset);
}
@@ -869,7 +869,7 @@ arma_inline
eT
diagview<eT>::operator()(const uword row, const uword col) const
{
arma_debug_check_bounds( ((row >= n_elem) || (col > 0)), "diagview::operator(): out of bounds" );
arma_conform_check_bounds( ((row >= n_elem) || (col > 0)), "diagview::operator(): out of bounds" );
return m.at(row+row_offset, row+col_offset);
}
@@ -881,7 +881,7 @@ inline
void
diagview<eT>::replace(const eT old_val, const eT new_val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
Mat<eT>& x = const_cast< Mat<eT>& >(m);
@@ -914,7 +914,7 @@ inline
void
diagview<eT>::clean(const typename get_pod_type<eT>::result threshold)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
Mat<eT> tmp(*this);
@@ -930,7 +930,7 @@ inline
void
diagview<eT>::clamp(const eT min_val, const eT max_val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
Mat<eT> tmp(*this);
@@ -946,7 +946,7 @@ inline
void
diagview<eT>::fill(const eT val)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
Mat<eT>& x = const_cast< Mat<eT>& >(m);
@@ -965,7 +965,7 @@ inline
void
diagview<eT>::zeros()
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
(*this).fill(eT(0));
}
@@ -977,7 +977,7 @@ inline
void
diagview<eT>::ones()
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
(*this).fill(eT(1));
}
@@ -989,7 +989,7 @@ inline
void
diagview<eT>::randu()
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
Mat<eT>& x = const_cast< Mat<eT>& >(m);
@@ -1008,7 +1008,7 @@ inline
void
diagview<eT>::randn()
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
Mat<eT>& x = const_cast< Mat<eT>& >(m);
@@ -1022,4 +1022,17 @@ diagview<eT>::randn()
template<typename eT>
template<typename eT2>
inline
bool
diagview<eT>::is_alias(const Mat<eT2>& X) const
{
arma_debug_sigprint();
return m.is_alias(X);
}
//! @}
+126 -126
View File
@@ -268,7 +268,7 @@ inline
file_type
diskio::guess_file_type(std::istream& f)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
return diskio::guess_file_type_internal(f);
}
@@ -279,7 +279,7 @@ inline
file_type
diskio::guess_file_type_internal(std::istream& f)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
f.clear();
const std::fstream::pos_type pos1 = f.tellg();
@@ -336,7 +336,7 @@ diskio::guess_file_type_internal(std::istream& f)
// ssv_ascii has to be before csv_ascii;
// if the data has semicolons, it suggests a CSV file with semicolon as the separating character;
// the semicolon may be used to allow the comma character to represent the decimal seperator (eg. 1,2345 vs 1.2345)
// the semicolon may be used to allow the comma character to represent the decimal separator (eg. 1,2345 vs 1.2345)
if(has_semicolon && (has_bracket == false)) { return ssv_ascii; }
@@ -479,7 +479,7 @@ diskio::convert_token(eT& val, const std::string& token)
// {
// // std::from_chars() doesn't handle leading whitespace
// // std::from_chars() doesn't handle leading + sign
// // std::from_chars() handles only the decimal point (.) as the decimal seperator
// // std::from_chars() handles only the decimal point (.) as the decimal separator
//
// const char str0 = str[0];
// const bool start_ok = ((str0 != ' ') && (str0 != '\t') && (str0 != '+'));
@@ -679,7 +679,7 @@ inline
bool
diskio::save_raw_ascii(const Mat<eT>& x, const std::string& final_name)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const std::string tmp_name = diskio::gen_tmp_name(final_name);
@@ -711,7 +711,7 @@ inline
bool
diskio::save_raw_ascii(const Mat<eT>& x, std::ostream& f)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const arma_ostream_state stream_state(f);
@@ -746,7 +746,7 @@ inline
bool
diskio::save_raw_binary(const Mat<eT>& x, const std::string& final_name)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const std::string tmp_name = diskio::gen_tmp_name(final_name);
@@ -774,7 +774,7 @@ inline
bool
diskio::save_raw_binary(const Mat<eT>& x, std::ostream& f)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
f.write( reinterpret_cast<const char*>(x.mem), std::streamsize(x.n_elem*sizeof(eT)) );
@@ -790,7 +790,7 @@ inline
bool
diskio::save_arma_ascii(const Mat<eT>& x, const std::string& final_name)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const std::string tmp_name = diskio::gen_tmp_name(final_name);
@@ -822,7 +822,7 @@ inline
bool
diskio::save_arma_ascii(const Mat<eT>& x, std::ostream& f)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const arma_ostream_state stream_state(f);
@@ -860,7 +860,7 @@ inline
bool
diskio::save_csv_ascii(const Mat<eT>& x, const std::string& final_name, const field<std::string>& header, const bool with_header, const char separator)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const std::string tmp_name = diskio::gen_tmp_name(final_name);
@@ -874,7 +874,7 @@ diskio::save_csv_ascii(const Mat<eT>& x, const std::string& final_name, const fi
if(with_header)
{
arma_extra_debug_print("diskio::save_csv_ascii(): writing header");
arma_debug_print("diskio::save_csv_ascii(): writing header");
for(uword i=0; i < header.n_elem; ++i)
{
@@ -906,7 +906,7 @@ inline
bool
diskio::save_csv_ascii(const Mat<eT>& x, std::ostream& f, const char separator)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const arma_ostream_state stream_state(f);
@@ -949,7 +949,7 @@ inline
bool
diskio::save_csv_ascii(const Mat< std::complex<T> >& x, std::ostream& f, const char separator)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
typedef typename std::complex<T> eT;
@@ -1005,7 +1005,7 @@ inline
bool
diskio::save_coord_ascii(const Mat<eT>& x, const std::string& final_name)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const std::string tmp_name = diskio::gen_tmp_name(final_name);
@@ -1035,7 +1035,7 @@ inline
bool
diskio::save_coord_ascii(const Mat<eT>& x, std::ostream& f)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const arma_ostream_state stream_state(f);
@@ -1062,7 +1062,7 @@ diskio::save_coord_ascii(const Mat<eT>& x, std::ostream& f)
f.put('\n');
}
// make sure it's possible to figure out the matrix size later
// make sure it's possible to determine the matrix size
if( (x.n_rows > 0) && (x.n_cols > 0) )
{
const uword max_row = (x.n_rows > 0) ? x.n_rows-1 : 0;
@@ -1088,7 +1088,7 @@ inline
bool
diskio::save_coord_ascii(const Mat< std::complex<T> >& x, std::ostream& f)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
typedef typename std::complex<T> eT;
@@ -1125,7 +1125,7 @@ diskio::save_coord_ascii(const Mat< std::complex<T> >& x, std::ostream& f)
f.put('\n');
}
// make sure it's possible to figure out the matrix size later
// make sure it's possible to determine the matrix size
if( (x.n_rows > 0) && (x.n_cols > 0) )
{
const uword max_row = (x.n_rows > 0) ? x.n_rows-1 : 0;
@@ -1153,7 +1153,7 @@ inline
bool
diskio::save_arma_binary(const Mat<eT>& x, const std::string& final_name)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const std::string tmp_name = diskio::gen_tmp_name(final_name);
@@ -1183,7 +1183,7 @@ inline
bool
diskio::save_arma_binary(const Mat<eT>& x, std::ostream& f)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
f << diskio::gen_bin_header(x) << '\n';
f << x.n_rows << ' ' << x.n_cols << '\n';
@@ -1201,7 +1201,7 @@ inline
bool
diskio::save_pgm_binary(const Mat<eT>& x, const std::string& final_name)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const std::string tmp_name = diskio::gen_tmp_name(final_name);
@@ -1230,7 +1230,7 @@ inline
bool
diskio::save_pgm_binary(const Mat<eT>& x, std::ostream& f)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
f << "P5" << '\n';
f << x.n_cols << ' ' << x.n_rows << '\n';
@@ -1261,7 +1261,7 @@ inline
bool
diskio::save_pgm_binary(const Mat< std::complex<T> >& x, const std::string& final_name)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const uchar_mat tmp = conv_to<uchar_mat>::from(x);
@@ -1276,7 +1276,7 @@ inline
bool
diskio::save_pgm_binary(const Mat< std::complex<T> >& x, std::ostream& f)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const uchar_mat tmp = conv_to<uchar_mat>::from(x);
@@ -1291,7 +1291,7 @@ inline
bool
diskio::save_hdf5_binary(const Mat<eT>& x, const hdf5_name& spec, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
#if defined(ARMA_USE_HDF5)
{
@@ -1319,8 +1319,8 @@ diskio::save_hdf5_binary(const Mat<eT>& x, const hdf5_name& spec, std::string& e
hid_t dataspace = H5Screate_simple(2, dims, NULL); // treat the matrix as a 2d array dataspace
hid_t datatype = hdf5_misc::get_hdf5_type<eT>();
// If this returned something invalid, well, it's time to crash.
arma_check(datatype == -1, "Mat::save(): unknown datatype for HDF5");
// fail if we can't handle the datatype
if(datatype == -1) { err_msg = "unknown datatype for HDF5"; return false; }
// MATLAB forces the users to specify a name at save time for HDF5;
// Octave will use the default of 'dataset' unless otherwise specified.
@@ -1407,7 +1407,7 @@ inline
bool
diskio::load_raw_ascii(Mat<eT>& x, const std::string& name, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
std::ifstream f;
@@ -1434,7 +1434,7 @@ inline
bool
diskio::load_raw_ascii(Mat<eT>& x, std::istream& f, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
bool load_okay = f.good();
@@ -1525,7 +1525,7 @@ inline
bool
diskio::load_raw_binary(Mat<eT>& x, const std::string& name, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
std::ifstream f;
f.open(name, std::fstream::binary);
@@ -1548,7 +1548,7 @@ inline
bool
diskio::load_raw_binary(Mat<eT>& x, std::istream& f, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
f.clear();
const std::streampos pos1 = f.tellg();
@@ -1570,7 +1570,7 @@ diskio::load_raw_binary(Mat<eT>& x, std::istream& f, std::string& err_msg)
try { x.set_size(N / uword(sizeof(eT)), 1); } catch(...) { err_msg = "not enough memory"; return false; }
f.clear();
f.read( reinterpret_cast<char *>(x.memptr()), std::streamsize(x.n_elem * uword(sizeof(eT))) );
f.read( reinterpret_cast<char*>(x.memptr()), std::streamsize(x.n_elem * uword(sizeof(eT))) );
return f.good();
}
@@ -1584,7 +1584,7 @@ inline
bool
diskio::load_arma_ascii(Mat<eT>& x, const std::string& name, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
std::ifstream f;
@@ -1610,7 +1610,7 @@ inline
bool
diskio::load_arma_ascii(Mat<eT>& x, std::istream& f, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
std::streampos pos = f.tellg();
@@ -1689,7 +1689,7 @@ inline
bool
diskio::load_csv_ascii(Mat<eT>& x, const std::string& name, std::string& err_msg, field<std::string>& header, const bool with_header, const char separator, const bool strict)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
std::ifstream f;
@@ -1701,7 +1701,7 @@ diskio::load_csv_ascii(Mat<eT>& x, const std::string& name, std::string& err_msg
if(with_header)
{
arma_extra_debug_print("diskio::load_csv_ascii(): reading header");
arma_debug_print("diskio::load_csv_ascii(): reading header");
std::string header_line;
std::stringstream header_stream;
@@ -1762,7 +1762,7 @@ inline
bool
diskio::load_csv_ascii(Mat<eT>& x, std::istream& f, std::string& err_msg, const char separator, const bool strict)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
// TODO: replace with more efficient implementation
@@ -1917,7 +1917,7 @@ inline
bool
diskio::load_csv_ascii(Mat< std::complex<T> >& x, std::istream& f, std::string& err_msg, const char separator, const bool strict)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
// TODO: replace with more efficient implementation
@@ -2154,7 +2154,7 @@ inline
bool
diskio::load_coord_ascii(Mat<eT>& x, const std::string& name, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
std::ifstream f;
@@ -2182,7 +2182,7 @@ inline
bool
diskio::load_coord_ascii(Mat<eT>& x, std::istream& f, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if(f.good() == false) { return false; }
@@ -2281,7 +2281,7 @@ inline
bool
diskio::load_coord_ascii(Mat< std::complex<T> >& x, std::istream& f, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if(f.good() == false) { return false; }
@@ -2391,7 +2391,7 @@ inline
bool
diskio::load_arma_binary(Mat<eT>& x, const std::string& name, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
std::ifstream f;
f.open(name, std::fstream::binary);
@@ -2414,7 +2414,7 @@ inline
bool
diskio::load_arma_binary(Mat<eT>& x, std::istream& f, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
std::streampos pos = f.tellg();
@@ -2435,7 +2435,7 @@ diskio::load_arma_binary(Mat<eT>& x, std::istream& f, std::string& err_msg)
try { x.set_size(f_n_rows,f_n_cols); } catch(...) { err_msg = "not enough memory"; return false; }
f.read( reinterpret_cast<char *>(x.memptr()), std::streamsize(x.n_elem*sizeof(eT)) );
f.read( reinterpret_cast<char*>(x.memptr()), std::streamsize(x.n_elem*sizeof(eT)) );
load_okay = f.good();
}
@@ -2505,7 +2505,7 @@ inline
bool
diskio::load_pgm_binary(Mat<eT>& x, const std::string& name, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
std::fstream f;
f.open(name, std::fstream::in | std::fstream::binary);
@@ -2580,7 +2580,7 @@ diskio::load_pgm_binary(Mat<eT>& x, std::istream& f, std::string& err_msg)
const uword n_elem = f_n_cols*f_n_rows;
podarray<u16> tmp(n_elem);
f.read( reinterpret_cast<char *>(tmp.memptr()), std::streamsize(n_elem*2) );
f.read( reinterpret_cast<char*>(tmp.memptr()), std::streamsize(n_elem*2) );
uword i = 0;
@@ -2617,7 +2617,7 @@ inline
bool
diskio::load_pgm_binary(Mat< std::complex<T> >& x, const std::string& name, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
uchar_mat tmp;
const bool load_okay = diskio::load_pgm_binary(tmp, name, err_msg);
@@ -2635,7 +2635,7 @@ inline
bool
diskio::load_pgm_binary(Mat< std::complex<T> >& x, std::istream& is, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
uchar_mat tmp;
const bool load_okay = diskio::load_pgm_binary(tmp, is, err_msg);
@@ -2653,7 +2653,7 @@ inline
bool
diskio::load_hdf5_binary(Mat<eT>& x, const hdf5_name& spec, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
#if defined(ARMA_USE_HDF5)
{
@@ -2777,7 +2777,7 @@ inline
bool
diskio::load_auto_detect(Mat<eT>& x, const std::string& name, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if(diskio::is_readable(name) == false) { return false; }
@@ -2808,7 +2808,7 @@ inline
bool
diskio::load_auto_detect(Mat<eT>& x, std::istream& f, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const char* ARMA_MAT_TXT_str = "ARMA_MAT_TXT";
const char* ARMA_MAT_BIN_str = "ARMA_MAT_BIN";
@@ -2889,7 +2889,7 @@ inline
bool
diskio::save_csv_ascii(const SpMat<eT>& x, const std::string& final_name, const field<std::string>& header, const bool with_header, const char separator)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const std::string tmp_name = diskio::gen_tmp_name(final_name);
@@ -2903,7 +2903,7 @@ diskio::save_csv_ascii(const SpMat<eT>& x, const std::string& final_name, const
if(with_header)
{
arma_extra_debug_print("diskio::save_csv_ascii(): writing header");
arma_debug_print("diskio::save_csv_ascii(): writing header");
for(uword i=0; i < header.n_elem; ++i)
{
@@ -2935,7 +2935,7 @@ inline
bool
diskio::save_csv_ascii(const SpMat<eT>& x, std::ostream& f, const char separator)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const arma_ostream_state stream_state(f);
@@ -2988,13 +2988,13 @@ inline
bool
diskio::save_csv_ascii(const SpMat< std::complex<T> >& x, std::ostream& f, const char separator)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_ignore(x);
arma_ignore(f);
arma_ignore(separator);
arma_debug_warn_level(1, "saving complex sparse matrices as csv_ascii not yet implemented");
arma_warn(1, "saving complex sparse matrices as csv_ascii not yet implemented");
return false;
}
@@ -3007,7 +3007,7 @@ inline
bool
diskio::save_coord_ascii(const SpMat<eT>& x, const std::string& final_name)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const std::string tmp_name = diskio::gen_tmp_name(final_name);
@@ -3038,7 +3038,7 @@ inline
bool
diskio::save_coord_ascii(const SpMat<eT>& x, std::ostream& f)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const arma_ostream_state stream_state(f);
@@ -3065,7 +3065,7 @@ diskio::save_coord_ascii(const SpMat<eT>& x, std::ostream& f)
}
// make sure it's possible to figure out the matrix size later
// make sure it's possible to determine the matrix size
if( (x.n_rows > 0) && (x.n_cols > 0) )
{
const uword max_row = (x.n_rows > 0) ? x.n_rows-1 : 0;
@@ -3092,7 +3092,7 @@ inline
bool
diskio::save_coord_ascii(const SpMat< std::complex<T> >& x, std::ostream& f)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
typedef typename std::complex<T> eT;
@@ -3128,7 +3128,7 @@ diskio::save_coord_ascii(const SpMat< std::complex<T> >& x, std::ostream& f)
f.put('\n');
}
// make sure it's possible to figure out the matrix size later
// make sure it's possible to determine the matrix size
if( (x.n_rows > 0) && (x.n_cols > 0) )
{
const uword max_row = (x.n_rows > 0) ? x.n_rows-1 : 0;
@@ -3156,7 +3156,7 @@ inline
bool
diskio::save_arma_binary(const SpMat<eT>& x, const std::string& final_name)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const std::string tmp_name = diskio::gen_tmp_name(final_name);
@@ -3186,7 +3186,7 @@ inline
bool
diskio::save_arma_binary(const SpMat<eT>& x, std::ostream& f)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
f << diskio::gen_bin_header(x) << '\n';
f << x.n_rows << ' ' << x.n_cols << ' ' << x.n_nonzero << '\n';
@@ -3205,7 +3205,7 @@ inline
bool
diskio::load_csv_ascii(SpMat<eT>& x, const std::string& name, std::string& err_msg, field<std::string>& header, const bool with_header, const char separator)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
std::ifstream f;
@@ -3217,7 +3217,7 @@ diskio::load_csv_ascii(SpMat<eT>& x, const std::string& name, std::string& err_m
if(with_header)
{
arma_extra_debug_print("diskio::load_csv_ascii(): reading header");
arma_debug_print("diskio::load_csv_ascii(): reading header");
std::string header_line;
std::stringstream header_stream;
@@ -3277,7 +3277,7 @@ inline
bool
diskio::load_csv_ascii(SpMat<eT>& x, std::istream& f, std::string& err_msg, const char separator)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
// TODO: replace with more efficient implementation
@@ -3375,14 +3375,14 @@ inline
bool
diskio::load_csv_ascii(SpMat< std::complex<T> >& x, std::istream& f, std::string& err_msg, const char separator)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_ignore(x);
arma_ignore(f);
arma_ignore(err_msg);
arma_ignore(separator);
arma_debug_warn_level(1, "loading complex sparse matrices as csv_ascii not yet implemented");
arma_warn(1, "loading complex sparse matrices as csv_ascii not yet implemented");
return false;
}
@@ -3394,7 +3394,7 @@ inline
bool
diskio::load_coord_ascii(SpMat<eT>& x, const std::string& name, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
std::ifstream f;
@@ -3418,7 +3418,7 @@ inline
bool
diskio::load_coord_ascii(SpMat<eT>& x, std::istream& f, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if(f.good() == false) { return false; }
@@ -3517,7 +3517,7 @@ inline
bool
diskio::load_coord_ascii(SpMat< std::complex<T> >& x, std::istream& f, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if(f.good() == false) { return false; }
@@ -3627,7 +3627,7 @@ inline
bool
diskio::load_arma_binary(SpMat<eT>& x, const std::string& name, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
std::ifstream f;
f.open(name, std::fstream::binary);
@@ -3650,7 +3650,7 @@ inline
bool
diskio::load_arma_binary(SpMat<eT>& x, std::istream& f, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
bool load_okay = true;
@@ -3688,9 +3688,9 @@ diskio::load_arma_binary(SpMat<eT>& x, std::istream& f, std::string& err_msg)
{
if(sizeof(uword) == 8)
{
arma_extra_debug_print("detected inconsistent data while loading; re-reading integer parts as u32");
arma_debug_print("detected inconsistent data while loading; re-reading integer parts as u32");
// inconstency could be due to a different uword size used during saving,
// inconsistency could be due to a different uword size used during saving,
// so try loading the row_indices and col_ptrs under the assumption of 32 bit unsigned integers
f.clear();
@@ -3709,14 +3709,14 @@ diskio::load_arma_binary(SpMat<eT>& x, std::istream& f, std::string& err_msg)
if( load_okay && (check2 == true) && (check3 == true) )
{
arma_extra_debug_print("reading integer parts as u32 succeeded");
arma_debug_print("reading integer parts as u32 succeeded");
arrayops::convert(access::rwp(x.row_indices), tmp_a.memptr(), x.n_nonzero );
arrayops::convert(access::rwp(x.col_ptrs), tmp_b.memptr(), x.n_cols + 1);
}
else
{
arma_extra_debug_print("reading integer parts as u32 failed");
arma_debug_print("reading integer parts as u32 failed");
}
}
}
@@ -3752,7 +3752,7 @@ inline
bool
diskio::save_raw_ascii(const Cube<eT>& x, const std::string& final_name)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const std::string tmp_name = diskio::gen_tmp_name(final_name);
@@ -3783,7 +3783,7 @@ inline
bool
diskio::save_raw_ascii(const Cube<eT>& x, std::ostream& f)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const arma_ostream_state stream_state(f);
@@ -3821,7 +3821,7 @@ inline
bool
diskio::save_raw_binary(const Cube<eT>& x, const std::string& final_name)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const std::string tmp_name = diskio::gen_tmp_name(final_name);
@@ -3849,7 +3849,7 @@ inline
bool
diskio::save_raw_binary(const Cube<eT>& x, std::ostream& f)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
f.write( reinterpret_cast<const char*>(x.mem), std::streamsize(x.n_elem*sizeof(eT)) );
@@ -3865,7 +3865,7 @@ inline
bool
diskio::save_arma_ascii(const Cube<eT>& x, const std::string& final_name)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const std::string tmp_name = diskio::gen_tmp_name(final_name);
@@ -3897,7 +3897,7 @@ inline
bool
diskio::save_arma_ascii(const Cube<eT>& x, std::ostream& f)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const arma_ostream_state stream_state(f);
@@ -3939,7 +3939,7 @@ inline
bool
diskio::save_arma_binary(const Cube<eT>& x, const std::string& final_name)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const std::string tmp_name = diskio::gen_tmp_name(final_name);
@@ -3969,7 +3969,7 @@ inline
bool
diskio::save_arma_binary(const Cube<eT>& x, std::ostream& f)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
f << diskio::gen_bin_header(x) << '\n';
f << x.n_rows << ' ' << x.n_cols << ' ' << x.n_slices << '\n';
@@ -3987,7 +3987,7 @@ inline
bool
diskio::save_hdf5_binary(const Cube<eT>& x, const hdf5_name& spec, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
#if defined(ARMA_USE_HDF5)
{
@@ -4016,8 +4016,8 @@ diskio::save_hdf5_binary(const Cube<eT>& x, const hdf5_name& spec, std::string&
hid_t dataspace = H5Screate_simple(3, dims, NULL); // treat the cube as a 3d array dataspace
hid_t datatype = hdf5_misc::get_hdf5_type<eT>();
// If this returned something invalid, well, it's time to crash.
arma_check(datatype == -1, "Cube::save(): unknown datatype for HDF5");
// fail if we can't handle the datatype
if(datatype == -1) { err_msg = "unknown datatype for HDF5"; return false; }
// MATLAB forces the users to specify a name at save time for HDF5;
// Octave will use the default of 'dataset' unless otherwise specified.
@@ -4103,7 +4103,7 @@ inline
bool
diskio::load_raw_ascii(Cube<eT>& x, const std::string& name, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
Mat<eT> tmp;
const bool load_okay = diskio::load_raw_ascii(tmp, name, err_msg);
@@ -4134,7 +4134,7 @@ inline
bool
diskio::load_raw_ascii(Cube<eT>& x, std::istream& f, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
Mat<eT> tmp;
const bool load_okay = diskio::load_raw_ascii(tmp, f, err_msg);
@@ -4165,7 +4165,7 @@ inline
bool
diskio::load_raw_binary(Cube<eT>& x, const std::string& name, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
std::ifstream f;
f.open(name, std::fstream::binary);
@@ -4188,7 +4188,7 @@ inline
bool
diskio::load_raw_binary(Cube<eT>& x, std::istream& f, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
f.clear();
const std::streampos pos1 = f.tellg();
@@ -4208,7 +4208,7 @@ diskio::load_raw_binary(Cube<eT>& x, std::istream& f, std::string& err_msg)
try { x.set_size(N / uword(sizeof(eT)), 1, 1); } catch(...) { err_msg = "not enough memory"; return false; }
f.clear();
f.read( reinterpret_cast<char *>(x.memptr()), std::streamsize(x.n_elem * uword(sizeof(eT))) );
f.read( reinterpret_cast<char*>(x.memptr()), std::streamsize(x.n_elem * uword(sizeof(eT))) );
return f.good();
}
@@ -4222,7 +4222,7 @@ inline
bool
diskio::load_arma_ascii(Cube<eT>& x, const std::string& name, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
std::ifstream f;
@@ -4248,7 +4248,7 @@ inline
bool
diskio::load_arma_ascii(Cube<eT>& x, std::istream& f, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
std::streampos pos = f.tellg();
@@ -4327,7 +4327,7 @@ inline
bool
diskio::load_arma_binary(Cube<eT>& x, const std::string& name, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
std::ifstream f;
f.open(name, std::fstream::binary);
@@ -4350,7 +4350,7 @@ inline
bool
diskio::load_arma_binary(Cube<eT>& x, std::istream& f, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
std::streampos pos = f.tellg();
@@ -4373,7 +4373,7 @@ diskio::load_arma_binary(Cube<eT>& x, std::istream& f, std::string& err_msg)
try { x.set_size(f_n_rows, f_n_cols, f_n_slices); } catch(...) { err_msg = "not enough memory"; return false; }
f.read( reinterpret_cast<char *>(x.memptr()), std::streamsize(x.n_elem*sizeof(eT)) );
f.read( reinterpret_cast<char*>(x.memptr()), std::streamsize(x.n_elem*sizeof(eT)) );
load_okay = f.good();
}
@@ -4426,7 +4426,7 @@ inline
bool
diskio::load_hdf5_binary(Cube<eT>& x, const hdf5_name& spec, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
#if defined(ARMA_USE_HDF5)
{
@@ -4483,7 +4483,7 @@ diskio::load_hdf5_binary(Cube<eT>& x, const hdf5_name& spec, std::string& err_ms
return false;
}
if(ndims == 1) { dims[1] = 1; dims[2] = 1; } // Vector case; one row/colum, several slices
if(ndims == 1) { dims[1] = 1; dims[2] = 1; } // Vector case; one row/column, several slices
if(ndims == 2) { dims[2] = 1; } // Matrix case; one column, several rows/slices
try { x.set_size(dims[2], dims[1], dims[0]); } catch(...) { err_msg = "not enough memory"; return false; }
@@ -4551,7 +4551,7 @@ inline
bool
diskio::load_auto_detect(Cube<eT>& x, const std::string& name, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
if(diskio::is_readable(name) == false) { return false; }
@@ -4582,7 +4582,7 @@ inline
bool
diskio::load_auto_detect(Cube<eT>& x, std::istream& f, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const char* ARMA_CUB_TXT_str = "ARMA_CUB_TXT";
const char* ARMA_CUB_BIN_str = "ARMA_CUB_BIN";
@@ -4658,7 +4658,7 @@ inline
bool
diskio::save_arma_binary(const field<T1>& x, const std::string& final_name)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const std::string tmp_name = diskio::gen_tmp_name(final_name);
@@ -4686,7 +4686,7 @@ inline
bool
diskio::save_arma_binary(const field<T1>& x, std::ostream& f)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_type_check(( (is_Mat<T1>::value == false) && (is_Cube<T1>::value == false) ));
@@ -4723,7 +4723,7 @@ inline
bool
diskio::load_arma_binary(field<T1>& x, const std::string& name, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
std::ifstream f( name, std::fstream::binary );
@@ -4745,7 +4745,7 @@ inline
bool
diskio::load_arma_binary(field<T1>& x, std::istream& f, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_type_check(( (is_Mat<T1>::value == false) && (is_Cube<T1>::value == false) ));
@@ -4810,7 +4810,7 @@ inline
bool
diskio::save_std_string(const field<std::string>& x, const std::string& final_name)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const std::string tmp_name = diskio::gen_tmp_name(final_name);
@@ -4837,7 +4837,7 @@ inline
bool
diskio::save_std_string(const field<std::string>& x, std::ostream& f)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
for(uword row=0; row<x.n_rows; ++row)
for(uword col=0; col<x.n_cols; ++col)
@@ -4863,7 +4863,7 @@ inline
bool
diskio::load_std_string(field<std::string>& x, const std::string& name, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
std::ifstream f(name);
@@ -4884,7 +4884,7 @@ inline
bool
diskio::load_std_string(field<std::string>& x, std::istream& f, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
bool load_okay = true;
@@ -4956,7 +4956,7 @@ inline
bool
diskio::load_auto_detect(field<T1>& x, const std::string& name, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
std::fstream f;
f.open(name, std::fstream::in | std::fstream::binary);
@@ -4980,7 +4980,7 @@ inline
bool
diskio::load_auto_detect(field<T1>& x, std::istream& f, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_type_check(( is_Mat<T1>::value == false ));
@@ -5033,7 +5033,7 @@ inline
bool
diskio::load_ppm_binary(Cube<eT>& x, const std::string& name, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
std::fstream f;
f.open(name, std::fstream::in | std::fstream::binary);
@@ -5056,7 +5056,7 @@ inline
bool
diskio::load_ppm_binary(Cube<eT>& x, std::istream& f, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
bool load_okay = true;
@@ -5111,7 +5111,7 @@ diskio::load_ppm_binary(Cube<eT>& x, std::istream& f, std::string& err_msg)
const uword n_elem = 3*f_n_cols*f_n_rows;
podarray<u16> tmp(n_elem);
f.read( reinterpret_cast<char *>(tmp.memptr()), std::streamsize(2*n_elem) );
f.read( reinterpret_cast<char*>(tmp.memptr()), std::streamsize(2*n_elem) );
uword i = 0;
@@ -5149,7 +5149,7 @@ inline
bool
diskio::save_ppm_binary(const Cube<eT>& x, const std::string& final_name)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const std::string tmp_name = diskio::gen_tmp_name(final_name);
@@ -5177,9 +5177,9 @@ inline
bool
diskio::save_ppm_binary(const Cube<eT>& x, std::ostream& f)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_debug_check( (x.n_slices != 3), "diskio::save_ppm_binary(): given cube must have exactly 3 slices" );
arma_conform_check( (x.n_slices != 3), "diskio::save_ppm_binary(): given cube must have exactly 3 slices" );
const uword n_elem = 3 * x.n_rows * x.n_cols;
podarray<u8> tmp(n_elem);
@@ -5219,7 +5219,7 @@ inline
bool
diskio::load_ppm_binary(field<T1>& x, const std::string& name, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
std::fstream f;
f.open(name, std::fstream::in | std::fstream::binary);
@@ -5242,7 +5242,7 @@ inline
bool
diskio::load_ppm_binary(field<T1>& x, std::istream& f, std::string& err_msg)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_type_check(( is_Mat<T1>::value == false ));
typedef typename T1::elem_type eT;
@@ -5311,7 +5311,7 @@ diskio::load_ppm_binary(field<T1>& x, std::istream& f, std::string& err_msg)
const uword n_elem = 3*f_n_cols*f_n_rows;
podarray<u16> tmp(n_elem);
f.read( reinterpret_cast<char *>(tmp.memptr()), std::streamsize(2*n_elem) );
f.read( reinterpret_cast<char*>(tmp.memptr()), std::streamsize(2*n_elem) );
uword i = 0;
@@ -5349,7 +5349,7 @@ inline
bool
diskio::save_ppm_binary(const field<T1>& x, const std::string& final_name)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const std::string tmp_name = diskio::gen_tmp_name(final_name);
std::ofstream f( tmp_name, std::fstream::binary );
@@ -5376,13 +5376,13 @@ inline
bool
diskio::save_ppm_binary(const field<T1>& x, std::ostream& f)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_type_check(( is_Mat<T1>::value == false ));
typedef typename T1::elem_type eT;
arma_debug_check( (x.n_elem != 3), "diskio::save_ppm_binary(): given field must have exactly 3 matrices of equal size" );
arma_conform_check( (x.n_elem != 3), "diskio::save_ppm_binary(): given field must have exactly 3 matrices of equal size" );
bool same_size = true;
for(uword i=1; i<3; ++i)
@@ -5394,7 +5394,7 @@ diskio::save_ppm_binary(const field<T1>& x, std::ostream& f)
}
}
arma_debug_check( (same_size != true), "diskio::save_ppm_binary(): given field must have exactly 3 matrices of equal size" );
arma_conform_check( (same_size != true), "diskio::save_ppm_binary(): given field must have exactly 3 matrices of equal size" );
const Mat<eT>& R = x(0);
const Mat<eT>& G = x(1);
+4 -2
View File
@@ -27,13 +27,15 @@ class eGlueCube : public BaseCube< typename T1::elem_type, eGlueCube<T1, T2, egl
typedef typename T1::elem_type elem_type;
typedef typename get_pod_type<elem_type>::result pod_type;
typedef ProxyCube<T1> proxy1_type;
typedef ProxyCube<T2> proxy2_type;
static constexpr bool use_at = (ProxyCube<T1>::use_at || ProxyCube<T2>::use_at );
static constexpr bool use_mp = (ProxyCube<T1>::use_mp || ProxyCube<T2>::use_mp );
static constexpr bool has_subview = (ProxyCube<T1>::has_subview || ProxyCube<T2>::has_subview);
arma_aligned const ProxyCube<T1> P1;
arma_aligned const ProxyCube<T2> P2;
const ProxyCube<T1> P1;
const ProxyCube<T2> P2;
arma_inline ~eGlueCube();
arma_inline eGlueCube(const T1& in_A, const T2& in_B);
+3 -3
View File
@@ -25,7 +25,7 @@ template<typename T1, typename T2, typename eglue_type>
arma_inline
eGlueCube<T1,T2,eglue_type>::~eGlueCube()
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -36,9 +36,9 @@ eGlueCube<T1,T2,eglue_type>::eGlueCube(const T1& in_A, const T2& in_B)
: P1(in_A)
, P2(in_B)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
arma_debug_assert_same_size
arma_conform_assert_same_size
(
P1.get_n_rows(), P1.get_n_cols(), P1.get_n_slices(),
P2.get_n_rows(), P2.get_n_cols(), P2.get_n_slices(),
+5 -2
View File
@@ -38,12 +38,15 @@ class eGlue : public Base< typename T1::elem_type, eGlue<T1, T2, eglue_type> >
static constexpr bool is_row = (Proxy<T1>::is_row || Proxy<T2>::is_row );
static constexpr bool is_xvec = (Proxy<T1>::is_xvec || Proxy<T2>::is_xvec);
arma_aligned const Proxy<T1> P1;
arma_aligned const Proxy<T2> P2;
const Proxy<T1> P1;
const Proxy<T2> P2;
arma_inline ~eGlue();
arma_inline eGlue(const T1& in_A, const T2& in_B);
template<typename eT2>
inline bool is_alias(const Mat<eT2>& X) const;
arma_inline uword get_n_rows() const;
arma_inline uword get_n_cols() const;
arma_inline uword get_n_elem() const;
+15 -4
View File
@@ -25,7 +25,7 @@ template<typename T1, typename T2, typename eglue_type>
arma_inline
eGlue<T1,T2,eglue_type>::~eGlue()
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -36,10 +36,10 @@ eGlue<T1,T2,eglue_type>::eGlue(const T1& in_A, const T2& in_B)
: P1(in_A)
, P2(in_B)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
// arma_debug_assert_same_size( P1, P2, eglue_type::text() );
arma_debug_assert_same_size
// arma_conform_assert_same_size( P1, P2, eglue_type::text() );
arma_conform_assert_same_size
(
P1.get_n_rows(), P1.get_n_cols(),
P2.get_n_rows(), P2.get_n_cols(),
@@ -49,6 +49,17 @@ eGlue<T1,T2,eglue_type>::eGlue(const T1& in_A, const T2& in_B)
template<typename T1, typename T2, typename eglue_type>
template<typename eT2>
inline
bool
eGlue<T1,T2,eglue_type>::is_alias(const Mat<eT2>& X) const
{
return (P1.is_alias(X) || P2.is_alias(X));
}
template<typename T1, typename T2, typename eglue_type>
arma_inline
uword
+6 -5
View File
@@ -28,16 +28,17 @@ class eOpCube : public BaseCube< typename T1::elem_type, eOpCube<T1, eop_type> >
typedef typename T1::elem_type elem_type;
typedef typename get_pod_type<elem_type>::result pod_type;
typedef ProxyCube<T1> proxy_type;
static constexpr bool use_at = ProxyCube<T1>::use_at;
static constexpr bool use_mp = ProxyCube<T1>::use_mp || eop_type::use_mp;
static constexpr bool has_subview = ProxyCube<T1>::has_subview;
arma_aligned const ProxyCube<T1> P;
arma_aligned elem_type aux; //!< storage of auxiliary data, user defined format
arma_aligned uword aux_uword_a; //!< storage of auxiliary data, uword format
arma_aligned uword aux_uword_b; //!< storage of auxiliary data, uword format
arma_aligned uword aux_uword_c; //!< storage of auxiliary data, uword format
const ProxyCube<T1> P;
elem_type aux; //!< storage of auxiliary data, user defined format
uword aux_uword_a; //!< storage of auxiliary data, uword format
uword aux_uword_b; //!< storage of auxiliary data, uword format
uword aux_uword_c; //!< storage of auxiliary data, uword format
inline ~eOpCube();
inline explicit eOpCube(const BaseCube<typename T1::elem_type, T1>& in_m);
+6 -6
View File
@@ -26,7 +26,7 @@ inline
eOpCube<T1, eop_type>::eOpCube(const BaseCube<typename T1::elem_type, T1>& in_m)
: P (in_m.get_ref())
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -37,7 +37,7 @@ eOpCube<T1, eop_type>::eOpCube(const BaseCube<typename T1::elem_type, T1>& in_m,
: P (in_m.get_ref())
, aux (in_aux)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -49,7 +49,7 @@ eOpCube<T1, eop_type>::eOpCube(const BaseCube<typename T1::elem_type, T1>& in_m,
, aux_uword_a (in_aux_uword_a)
, aux_uword_b (in_aux_uword_b)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -62,7 +62,7 @@ eOpCube<T1, eop_type>::eOpCube(const BaseCube<typename T1::elem_type, T1>& in_m,
, aux_uword_b (in_aux_uword_b)
, aux_uword_c (in_aux_uword_c)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -76,7 +76,7 @@ eOpCube<T1, eop_type>::eOpCube(const BaseCube<typename T1::elem_type, T1>& in_m,
, aux_uword_b (in_aux_uword_b)
, aux_uword_c (in_aux_uword_c)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -85,7 +85,7 @@ template<typename T1, typename eop_type>
inline
eOpCube<T1, eop_type>::~eOpCube()
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
+7 -5
View File
@@ -38,11 +38,10 @@ class eOp : public Base< typename T1::elem_type, eOp<T1, eop_type> >
static constexpr bool is_col = Proxy<T1>::is_col;
static constexpr bool is_xvec = Proxy<T1>::is_xvec;
arma_aligned const Proxy<T1> P;
arma_aligned elem_type aux; //!< storage of auxiliary data, user defined format
arma_aligned uword aux_uword_a; //!< storage of auxiliary data, uword format
arma_aligned uword aux_uword_b; //!< storage of auxiliary data, uword format
const Proxy<T1> P;
elem_type aux; //!< storage of auxiliary data, user defined format
uword aux_uword_a; //!< storage of auxiliary data, uword format
uword aux_uword_b; //!< storage of auxiliary data, uword format
inline ~eOp();
inline explicit eOp(const T1& in_m);
@@ -50,6 +49,9 @@ class eOp : public Base< typename T1::elem_type, eOp<T1, eop_type> >
inline eOp(const T1& in_m, const uword in_aux_uword_a, const uword in_aux_uword_b);
inline eOp(const T1& in_m, const elem_type in_aux, const uword in_aux_uword_a, const uword in_aux_uword_b);
template<typename eT2>
inline bool is_alias(const Mat<eT2>& X) const;
arma_inline uword get_n_rows() const;
arma_inline uword get_n_cols() const;
arma_inline uword get_n_elem() const;
+18 -5
View File
@@ -26,7 +26,7 @@ inline
eOp<T1, eop_type>::eOp(const T1& in_m)
: P(in_m)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -37,7 +37,7 @@ eOp<T1, eop_type>::eOp(const T1& in_m, const typename T1::elem_type in_aux)
: P(in_m)
, aux(in_aux)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -49,7 +49,7 @@ eOp<T1, eop_type>::eOp(const T1& in_m, const uword in_aux_uword_a, const uword i
, aux_uword_a(in_aux_uword_a)
, aux_uword_b(in_aux_uword_b)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -62,7 +62,7 @@ eOp<T1, eop_type>::eOp(const T1& in_m, const typename T1::elem_type in_aux, cons
, aux_uword_a(in_aux_uword_a)
, aux_uword_b(in_aux_uword_b)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
@@ -71,10 +71,23 @@ template<typename T1, typename eop_type>
inline
eOp<T1, eop_type>::~eOp()
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
}
template<typename T1, typename eop_type>
template<typename eT2>
inline
bool
eOp<T1, eop_type>::is_alias(const Mat<eT2>& X) const
{
arma_debug_sigprint();
return P.is_alias(X);
}
template<typename T1, typename eop_type>
arma_inline
+20 -20
View File
@@ -259,7 +259,7 @@ inline
void
eglue_core<eglue_type>::apply(outT& out, const eGlue<T1, T2, eglue_type>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
typedef typename T1::elem_type eT;
@@ -267,7 +267,7 @@ eglue_core<eglue_type>::apply(outT& out, const eGlue<T1, T2, eglue_type>& x)
constexpr bool use_mp = (Proxy<T1>::use_mp || Proxy<T2>::use_mp) && (arma_config::openmp);
// NOTE: we're assuming that the matrix has already been set to the correct size and there is no aliasing;
// size setting and alias checking is done by either the Mat contructor or operator=()
// size setting and alias checking is done by either the Mat constructor or operator=()
eT* out_mem = out.memptr();
@@ -358,12 +358,12 @@ inline
void
eglue_core<eglue_type>::apply_inplace_plus(Mat<typename T1::elem_type>& out, const eGlue<T1, T2, eglue_type>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const uword n_rows = x.get_n_rows();
const uword n_cols = x.get_n_cols();
arma_debug_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "addition");
arma_conform_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "addition");
typedef typename T1::elem_type eT;
@@ -455,12 +455,12 @@ inline
void
eglue_core<eglue_type>::apply_inplace_minus(Mat<typename T1::elem_type>& out, const eGlue<T1, T2, eglue_type>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const uword n_rows = x.get_n_rows();
const uword n_cols = x.get_n_cols();
arma_debug_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "subtraction");
arma_conform_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "subtraction");
typedef typename T1::elem_type eT;
@@ -552,12 +552,12 @@ inline
void
eglue_core<eglue_type>::apply_inplace_schur(Mat<typename T1::elem_type>& out, const eGlue<T1, T2, eglue_type>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const uword n_rows = x.get_n_rows();
const uword n_cols = x.get_n_cols();
arma_debug_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "element-wise multiplication");
arma_conform_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "element-wise multiplication");
typedef typename T1::elem_type eT;
@@ -649,12 +649,12 @@ inline
void
eglue_core<eglue_type>::apply_inplace_div(Mat<typename T1::elem_type>& out, const eGlue<T1, T2, eglue_type>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const uword n_rows = x.get_n_rows();
const uword n_cols = x.get_n_cols();
arma_debug_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "element-wise division");
arma_conform_assert_same_size(out.n_rows, out.n_cols, n_rows, n_cols, "element-wise division");
typedef typename T1::elem_type eT;
@@ -751,7 +751,7 @@ inline
void
eglue_core<eglue_type>::apply(Cube<typename T1::elem_type>& out, const eGlueCube<T1, T2, eglue_type>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
typedef typename T1::elem_type eT;
@@ -759,7 +759,7 @@ eglue_core<eglue_type>::apply(Cube<typename T1::elem_type>& out, const eGlueCube
constexpr bool use_mp = (ProxyCube<T1>::use_mp || ProxyCube<T2>::use_mp) && (arma_config::openmp);
// NOTE: we're assuming that the cube has already been set to the correct size and there is no aliasing;
// size setting and alias checking is done by either the Cube contructor or operator=()
// size setting and alias checking is done by either the Cube constructor or operator=()
eT* out_mem = out.memptr();
@@ -851,13 +851,13 @@ inline
void
eglue_core<eglue_type>::apply_inplace_plus(Cube<typename T1::elem_type>& out, const eGlueCube<T1, T2, eglue_type>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const uword n_rows = x.get_n_rows();
const uword n_cols = x.get_n_cols();
const uword n_slices = x.get_n_slices();
arma_debug_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "addition");
arma_conform_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "addition");
typedef typename T1::elem_type eT;
@@ -949,13 +949,13 @@ inline
void
eglue_core<eglue_type>::apply_inplace_minus(Cube<typename T1::elem_type>& out, const eGlueCube<T1, T2, eglue_type>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const uword n_rows = x.get_n_rows();
const uword n_cols = x.get_n_cols();
const uword n_slices = x.get_n_slices();
arma_debug_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "subtraction");
arma_conform_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "subtraction");
typedef typename T1::elem_type eT;
@@ -1047,13 +1047,13 @@ inline
void
eglue_core<eglue_type>::apply_inplace_schur(Cube<typename T1::elem_type>& out, const eGlueCube<T1, T2, eglue_type>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const uword n_rows = x.get_n_rows();
const uword n_cols = x.get_n_cols();
const uword n_slices = x.get_n_slices();
arma_debug_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "element-wise multiplication");
arma_conform_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "element-wise multiplication");
typedef typename T1::elem_type eT;
@@ -1145,13 +1145,13 @@ inline
void
eglue_core<eglue_type>::apply_inplace_div(Cube<typename T1::elem_type>& out, const eGlueCube<T1, T2, eglue_type>& x)
{
arma_extra_debug_sigprint();
arma_debug_sigprint();
const uword n_rows = x.get_n_rows();
const uword n_cols = x.get_n_cols();
const uword n_slices = x.get_n_slices();
arma_debug_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "element-wise division");
arma_conform_assert_same_size(out.n_rows, out.n_cols, out.n_slices, n_rows, n_cols, n_slices, "element-wise division");
typedef typename T1::elem_type eT;

Some files were not shown because too many files have changed in this diff Show More