Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
98c13f4bc7 | ||
|
|
92cd541f57 | ||
|
|
f002bffd96 | ||
|
|
cba9c87169 | ||
|
|
12628de147 | ||
|
|
16d102510f | ||
|
|
87626c836a | ||
|
|
6e7f5c3601 | ||
|
|
7ac92e7999 | ||
|
|
fc11d3683d | ||
|
|
3eb25b1b16 | ||
|
|
a197882af1 | ||
|
|
0dd9ac9a02 | ||
|
|
5d62ce315c | ||
|
|
51d56e7c59 | ||
|
|
17db28c133 | ||
|
|
b801feb467 | ||
|
|
ec95397bc4 | ||
|
|
851828d427 | ||
|
|
1192e1ac19 | ||
|
|
2293bf45cc | ||
|
|
bb7ed84ded | ||
|
|
d1305141d2 | ||
|
|
f3ed7ace06 | ||
|
|
ed8d293f93 | ||
|
|
ce007b7164 | ||
|
|
b2664f138b | ||
|
|
300bd731ca | ||
|
|
9843393a7a | ||
|
|
98a885b9c2 | ||
|
|
0b4542fc88 | ||
|
|
5765ef2909 | ||
|
|
fd2b724040 | ||
|
|
e7bd7e4e18 | ||
|
|
a902935f11 | ||
|
|
1907b8799e | ||
|
|
9782878612 | ||
|
|
b94080a168 | ||
|
|
ada1e18e45 | ||
|
|
bd26d90563 | ||
|
|
447d66758e | ||
|
|
d242d1d3d7 | ||
|
|
e7e189c012 | ||
|
|
256e1d6e88 | ||
|
|
6952ca11d5 | ||
|
|
4ec76d5211 | ||
|
|
05670bfc64 | ||
|
|
29f4f10118 | ||
|
|
e5663df8fa | ||
|
|
cefb070832 | ||
|
|
2f9829c777 | ||
|
|
78dbddf2e9 | ||
|
|
9318a5df61 | ||
|
|
8e65bd7d21 | ||
|
|
42022c75e3 | ||
|
|
869c46e39b | ||
|
|
3199376bbf | ||
|
|
a93c67cc34 | ||
|
|
753e1e23c7 | ||
|
|
021403a5c1 | ||
|
|
402a453065 | ||
|
|
5b05fb843d | ||
|
|
772addf5c1 | ||
|
|
c08e594437 | ||
|
|
9797ad1cad | ||
|
|
b260cdaa58 | ||
|
|
e83cb29013 | ||
|
|
48e19f8e50 | ||
|
|
4e02904b18 | ||
|
|
bd1bd14831 | ||
|
|
74feb70896 | ||
|
|
48a33a1fc3 | ||
|
|
36a5188083 | ||
|
|
0731de2367 | ||
|
|
91b5f68bed | ||
|
|
a290735187 | ||
|
|
4b4ab0ced8 | ||
|
|
7faec6fdce | ||
|
|
696fd719e8 | ||
|
|
aa0c021737 | ||
|
|
682790d0bc | ||
|
|
47a0e466e7 | ||
|
|
8842cdc739 | ||
|
|
870414aa06 | ||
|
|
7b03681ce7 | ||
|
|
a80f63501b | ||
|
|
6556e4ae04 | ||
|
|
648527eb1b | ||
|
|
4a848124fa | ||
|
|
39d01b483e | ||
|
|
03e92c43ba | ||
|
|
bdf448e8f0 | ||
|
|
d0dfac1a32 | ||
|
|
d057c221d8 | ||
|
|
83bb1e7937 | ||
|
|
bdc82c2c76 | ||
|
|
3cfec929f6 | ||
|
|
74720f366d | ||
|
|
65012ac724 | ||
|
|
7b0ce7088e | ||
|
|
d2930a2763 | ||
|
|
9ef5f44c53 | ||
|
|
6b79e17ec3 | ||
|
|
eaf7825044 | ||
|
|
365eca0c16 | ||
|
|
096591bafb | ||
|
|
68e9cf2a01 | ||
|
|
36a2e4eed4 | ||
|
|
7e7fff181b | ||
|
|
91319547c4 | ||
|
|
6288784171 | ||
|
|
74eb504435 | ||
|
|
7e63c9f48c | ||
|
|
5560281526 | ||
|
|
9d04feb8c3 | ||
|
|
47d576fc76 | ||
|
|
c0bf9d5262 | ||
|
|
8f74c350ce | ||
|
|
c9425f3158 | ||
|
|
4e7a567967 | ||
|
|
84ec3ddf9f | ||
|
|
0138a5b699 | ||
|
|
623eb2915d | ||
|
|
f845134e58 | ||
|
|
014e11aa5b | ||
|
|
9f9a93e5e8 | ||
|
|
636b8f8cf0 | ||
|
|
d1f296eaca | ||
|
|
fb5ee6fa0b | ||
|
|
28c3cd7e54 | ||
|
|
69e7c73b34 | ||
|
|
6fd0ff0d0f | ||
|
|
7e88739a41 | ||
|
|
0bc9d1b2d6 | ||
|
|
e8b7efceba | ||
|
|
7fda8d02b0 | ||
|
|
fe3c943543 | ||
|
|
72838eb1df | ||
|
|
2bf91c9159 | ||
|
|
c8c64e614e | ||
|
|
5ff113d8b1 | ||
|
|
bebbf30075 | ||
|
|
5b05448d69 | ||
|
|
c0ef238433 | ||
|
|
e662f86944 | ||
|
|
57da508cf3 | ||
|
|
9ac38a895c | ||
|
|
ed840ebb2d | ||
|
|
1c41747d9c | ||
|
|
dd0aeff3f1 | ||
|
|
2186acc08f | ||
|
|
a2aa0f361a | ||
|
|
756cebff72 | ||
|
|
e767844a07 | ||
|
|
57b7cec007 | ||
|
|
f3bf7bc683 | ||
|
|
a3bd59ddac | ||
|
|
82e715f2cf | ||
|
|
eb8ea83e11 | ||
|
|
bd912040a5 | ||
|
|
f696ac0e4b | ||
|
|
616b01448f | ||
|
|
c71edbf5e5 | ||
|
|
82b3972cae | ||
|
|
982aaf0993 | ||
|
|
25ba9a0ca5 | ||
|
|
740601a431 | ||
|
|
45423128a9 | ||
|
|
acd6552307 | ||
|
|
085731e77c | ||
|
|
f3c1248095 | ||
|
|
996b226da5 | ||
|
|
3c0be74876 | ||
|
|
aec53c9445 | ||
|
|
3105fb0bd2 | ||
|
|
c2852a268d | ||
|
|
b0da624def | ||
|
|
03a3efe988 | ||
|
|
35ba4266cd | ||
|
|
45da4eee4f | ||
|
|
90a67c55f2 | ||
|
|
6346373654 | ||
|
|
7178d9715b | ||
|
|
46fe21ae0d | ||
|
|
fc412ae23d | ||
|
|
bc745128ef | ||
|
|
d2c7718e96 | ||
|
|
3a0293e404 | ||
|
|
66acb38834 | ||
|
|
0ecd5a4c43 | ||
|
|
0265363058 | ||
|
|
0e091bc343 | ||
|
|
2456f676ec | ||
|
|
55560bbdf5 | ||
|
|
6e880d8174 | ||
|
|
0945718ee7 | ||
|
|
cc20c82f81 | ||
|
|
12259d14c4 | ||
|
|
993fe423df | ||
|
|
91970b89ff | ||
|
|
5bcbfc2494 | ||
|
|
64204ba71e | ||
|
|
efbb9ed899 | ||
|
|
79d8be32a4 | ||
|
|
e5e59aad06 | ||
|
|
18836f6f54 | ||
|
|
12134220c6 | ||
|
|
54c8a6bce9 | ||
|
|
597779ad8e | ||
|
|
c7e0735820 | ||
|
|
0a175fb070 | ||
|
|
1ee1a6ea2d | ||
|
|
cb5686067d | ||
|
|
5d92b91916 | ||
|
|
dca21aa5f1 | ||
|
|
fce2e450b8 | ||
|
|
28139a6da3 | ||
|
|
5c45d78bba | ||
|
|
0446d2eed8 | ||
|
|
3f0e62abfa | ||
|
|
da80bc561f | ||
|
|
5a845df84b | ||
|
|
c6219667df | ||
|
|
90b529091f | ||
|
|
dc1ede314e | ||
|
|
fcd466d213 | ||
|
|
8ac6a694f0 | ||
|
|
9e6bda097d | ||
|
|
0bea1b2f4d | ||
|
|
08a15ab6d2 | ||
|
|
8f76c2f5a7 | ||
|
|
eea1835183 | ||
|
|
8e02066f52 | ||
|
|
cc5d113370 | ||
|
|
8903fd84a5 | ||
|
|
08d3312192 | ||
|
|
9944415e12 | ||
|
|
beb4ee0e39 | ||
|
|
4ab6a53ab5 | ||
|
|
99b11428df | ||
|
|
955abfeeab | ||
|
|
e5b1d0bd70 | ||
|
|
b70e88d8ad | ||
|
|
e7ecee425f | ||
|
|
7004caa4b4 | ||
|
|
22bbf2ad79 | ||
|
|
73294812c3 | ||
|
|
52b372f7f0 | ||
|
|
1f61355864 | ||
|
|
95ac9ebde7 | ||
|
|
b244199997 | ||
|
|
c689776db2 | ||
|
|
37ca4fe05c | ||
|
|
4a299aa8ec | ||
|
|
e0162f0a84 | ||
|
|
cb9c78a9e3 | ||
|
|
de479975af | ||
|
|
d57ad2a29a | ||
|
|
42a35f8cc3 | ||
|
|
a75737fef7 | ||
|
|
426ce1372a | ||
|
|
bce19ebcbd | ||
|
|
59477c0dbc | ||
|
|
bec851861b | ||
|
|
4e2f157604 | ||
|
|
2b513d3136 | ||
|
|
efac5b3148 | ||
|
|
daa5deedf3 | ||
|
|
e658f0db17 | ||
|
|
bcee6924b7 | ||
|
|
089d2b965d | ||
|
|
ee9f42faff | ||
|
|
92f4bd5a24 | ||
|
|
25383133c8 | ||
|
|
bde6942425 | ||
|
|
b9461be144 | ||
|
|
c83caaa0da | ||
|
|
0ec6b425e6 | ||
|
|
785bfcb086 | ||
|
|
bb515b8a1f | ||
|
|
cb57dc3815 | ||
|
|
f474274d92 | ||
|
|
1629b41828 | ||
|
|
20afeff672 | ||
|
|
78694113e3 | ||
|
|
acd2a5fcad | ||
|
|
32fd3716fe | ||
|
|
64de62450d | ||
|
|
81e7d78488 | ||
|
|
b8c402b663 | ||
|
|
328f0fe573 | ||
|
|
27db1972be | ||
|
|
b0fe0d3cff | ||
|
|
522cfdce58 | ||
|
|
dbf64f011c | ||
|
|
f90249082c | ||
|
|
3b5fb76081 | ||
|
|
af912a6177 | ||
|
|
803c589b17 | ||
|
|
5eb6b5b5fc | ||
|
|
db71a4affb | ||
|
|
0936110fbc | ||
|
|
f905ee4b4a | ||
|
|
7ff62d22b0 | ||
|
|
c004318b0f | ||
|
|
3632831126 | ||
|
|
ebc6f94fcb | ||
|
|
b4ede23c5c | ||
|
|
feca3eae7f | ||
|
|
0a76ab431b | ||
|
|
24b059344e | ||
|
|
ceaa020a33 | ||
|
|
f9e308b2fd | ||
|
|
153c1363ea | ||
|
|
316c7e4abf | ||
|
|
469cb91a74 | ||
|
|
77cc3e9287 | ||
|
|
e037bd9a5e | ||
|
|
7138865c14 | ||
|
|
8f94af0afb | ||
|
|
dfdbae2570 | ||
|
|
11e69548f2 | ||
|
|
6f6cc83862 | ||
|
|
0d2c5de574 | ||
|
|
07e5b6d1d6 | ||
|
|
df8741c86b | ||
|
|
ffb9ef3c52 | ||
|
|
b87cc838a3 | ||
|
|
9273614f58 | ||
|
|
cdedada64a | ||
|
|
b7cf2fd503 | ||
|
|
b3329329a7 | ||
|
|
20bb9d8bcb | ||
|
|
6ecbed3813 | ||
|
|
123dd0108d | ||
|
|
79793a7a97 | ||
|
|
a2c8b74a35 | ||
|
|
a313b4fd0c | ||
|
|
85233ddbe7 | ||
|
|
b6e9484b31 | ||
|
|
a18a68289b | ||
|
|
b3f4e55604 | ||
|
|
702eb6c68b | ||
|
|
0bdd169d38 | ||
|
|
79f57ff784 | ||
|
|
a3bc2bc599 | ||
|
|
2cdd3feebb | ||
|
|
ca70fdfba3 | ||
|
|
9608d14058 | ||
|
|
112861df8b | ||
|
|
15232980d3 | ||
|
|
6058b46519 | ||
|
|
0b07572a24 | ||
|
|
bb819ee649 | ||
|
|
ee965fc4b7 | ||
|
|
a7c16f40df | ||
|
|
e83cea1b48 | ||
|
|
dbca4d6631 | ||
|
|
8cdca5cbe9 | ||
|
|
121b0a744a | ||
|
|
4ec712dcc6 | ||
|
|
e6bfb6941d | ||
|
|
d2bdd90982 | ||
|
|
59a24f45f2 | ||
|
|
ef011e704b | ||
|
|
943fe56b61 | ||
|
|
670ca673f8 | ||
|
|
265e66f43e | ||
|
|
baf9ab7970 | ||
|
|
dd5e73ae20 | ||
|
|
5d1ceb6aa9 | ||
|
|
acc8680aa8 | ||
|
|
8cb75d0ac5 | ||
|
|
77fccf7db1 | ||
|
|
18a2a42061 | ||
|
|
b2f8023392 | ||
|
|
bcc950cb9e | ||
|
|
5c313e8a6d | ||
|
|
d13194f8e8 | ||
|
|
437c7299b9 | ||
|
|
b744b74533 | ||
|
|
f22d60c74f | ||
|
|
44e1beabce | ||
|
|
f003381651 | ||
|
|
538ae305bf | ||
|
|
d00fc06c06 | ||
|
|
8650784ac7 | ||
|
|
f0acfbbf63 | ||
|
|
da8ea7ea20 | ||
|
|
d484a3d7ad | ||
|
|
978d7d6e76 | ||
|
|
65eefbfce6 | ||
|
|
6e469f1d38 | ||
|
|
3280fd41ae | ||
|
|
97f85611c1 | ||
|
|
7b38cfca6e | ||
|
|
30122e7adf | ||
|
|
0481314430 | ||
|
|
ef7fec1385 | ||
|
|
42623aff06 | ||
|
|
3165f618ed | ||
|
|
93a652c50c | ||
|
|
f506e86466 | ||
|
|
c7053e8c23 | ||
|
|
95a8229587 | ||
|
|
4b3fdadd7f | ||
|
|
7ce8e17e99 | ||
|
|
25d5285cbd | ||
|
|
53806daa3f | ||
|
|
bcca9da94d | ||
|
|
6da76d1019 | ||
|
|
cb73277ec7 | ||
|
|
6d15ecca58 | ||
|
|
e701de5738 | ||
|
|
b4e2b8de7c | ||
|
|
b0ff7506b0 | ||
|
|
1bf38c114d | ||
|
|
96e98edec9 | ||
|
|
6e838ef11c | ||
|
|
55059a4e30 | ||
|
|
98c7800566 | ||
|
|
0e5978f981 | ||
|
|
b52dae4657 | ||
|
|
1b037556da | ||
|
|
6a1c5d7ff3 | ||
|
|
ce4d54c82b | ||
|
|
bca1545ae3 | ||
|
|
b908470f3b | ||
|
|
7c75e9e594 | ||
|
|
55c30cbc73 | ||
|
|
d56115ef45 | ||
|
|
c7f1711d6c | ||
|
|
e280d25c9a | ||
|
|
27f4297396 | ||
|
|
5eabafe2b3 | ||
|
|
ed1ec45817 | ||
|
|
901c5c3d0c | ||
|
|
19292dff3a | ||
|
|
53f8e0664f | ||
|
|
d66e799b5c | ||
|
|
053d5a5787 | ||
|
|
cb3203f130 | ||
|
|
44411aadee | ||
|
|
c953e836e7 | ||
|
|
40d2d9fb9c | ||
|
|
e529e8fadb | ||
|
|
cdf9a0519d | ||
|
|
acdc6b8670 | ||
|
|
251f964c1b | ||
|
|
9937cdafd5 | ||
|
|
e31354d8da | ||
|
|
6279cb3774 | ||
|
|
fa72e7e3e0 | ||
|
|
f72efd7c61 | ||
|
|
3d4daafeb8 | ||
|
|
a99ef05d41 | ||
|
|
a7d906019a | ||
|
|
f3fe8d04c7 | ||
|
|
508ebe3deb | ||
|
|
6e6657e2f0 | ||
|
|
935a500e75 | ||
|
|
64a125b35b | ||
|
|
6754eadb00 | ||
|
|
4a93a1a5d2 | ||
|
|
cc2a33560f | ||
|
|
708897f906 | ||
|
|
5dfa91793f | ||
|
|
f20d1bf7fe | ||
|
|
e0a6e50981 | ||
|
|
11b009ccdc | ||
|
|
d4ac8e535e | ||
|
|
982e8b12ae | ||
|
|
558c04cfd6 | ||
|
|
c693c5f020 | ||
|
|
a7ae8eed4a | ||
|
|
5f74ef8e5d | ||
|
|
7c732dc236 | ||
|
|
b84b7aa997 | ||
|
|
1780c70a98 | ||
|
|
02aab8d3c3 | ||
|
|
744f33aab2 | ||
|
|
c51b6ce8ba | ||
|
|
e0bf67a29f | ||
|
|
b176edcc1b | ||
|
|
09b350febc | ||
|
|
4541b44fab | ||
|
|
17132590fc | ||
|
|
11740aead0 | ||
|
|
f2a82196d4 | ||
|
|
2854685624 | ||
|
|
401c06184e | ||
|
|
d7064ebacf | ||
|
|
580758af9d | ||
|
|
441d0e503b | ||
|
|
5015fb007b | ||
|
|
81b339e987 | ||
|
|
6b6a820a49 | ||
|
|
a865abfe6a | ||
|
|
80797be245 | ||
|
|
3259865a42 | ||
|
|
5edd9e07ec | ||
|
|
d37c42e046 | ||
|
|
d8dceed843 | ||
|
|
0606be415c | ||
|
|
f5b004028a | ||
|
|
76d9aaea28 | ||
|
|
4257990df9 | ||
|
|
a48c256233 | ||
|
|
044977f0a1 | ||
|
|
c32a3b915e | ||
|
|
419cc25c17 | ||
|
|
118ae2140f | ||
|
|
4b72ceda11 | ||
|
|
caa5012e25 | ||
|
|
f37a509c14 | ||
|
|
8dafcf8d30 | ||
|
|
d4e25ce9cf | ||
|
|
9ee144d98d | ||
|
|
e6b9babc12 | ||
|
|
2ddbf3653c | ||
|
|
fb9994ce6f | ||
|
|
840795fc47 | ||
|
|
b5824c72e3 | ||
|
|
39a8ff7c31 | ||
|
|
031e790ec3 | ||
|
|
054506ac91 | ||
|
|
50c8b16a6c | ||
|
|
554c499ce0 | ||
|
|
9aa59809f0 | ||
|
|
f66226695b | ||
|
|
c9cc6e5554 | ||
|
|
181a6af544 | ||
|
|
de118814c3 | ||
|
|
1aa720e759 | ||
|
|
f0eaff90e9 | ||
|
|
21b905e643 | ||
|
|
791fe513c9 | ||
|
|
3d82983dba | ||
|
|
6ee89edb8c | ||
|
|
a7823175a2 | ||
|
|
5caefce03d | ||
|
|
a99f363d69 | ||
|
|
627794a311 | ||
|
|
66135eef6b | ||
|
|
03d351a858 | ||
|
|
607a68a0b4 | ||
|
|
36ab0da6b1 | ||
|
|
cf880d4fff | ||
|
|
057039611e | ||
|
|
530542b112 | ||
|
|
4643ddfff8 | ||
|
|
f54cc6d0bb | ||
|
|
414793c796 | ||
|
|
f0c1211b68 | ||
|
|
fa0c5a5ce2 | ||
|
|
8f5e35d9e4 | ||
|
|
4a4807e4ee | ||
|
|
03eb6e6ece | ||
|
|
f66d795010 | ||
|
|
f01dae8534 | ||
|
|
0cc9f762d3 | ||
|
|
52ccb38b6c | ||
|
|
23c49e6008 | ||
|
|
f4f8f0c28f | ||
|
|
54314571c4 | ||
|
|
b416244930 | ||
|
|
3928bee750 | ||
|
|
17d96107e3 | ||
|
|
e014995291 | ||
|
|
e03265b706 | ||
|
|
940594bfe7 | ||
|
|
bcf4400e27 | ||
|
|
4f62a5ddf8 | ||
|
|
66515d3ec9 | ||
|
|
365c332120 | ||
|
|
facf580a9c | ||
|
|
b0ca8599f8 | ||
|
|
f7e522a83b | ||
|
|
8d6818e40a | ||
|
|
19b7ff026f | ||
|
|
bd56f524b2 | ||
|
|
5cbd10b9e3 | ||
|
|
19f8a401e8 | ||
|
|
478809ca0d | ||
|
|
0a671235ed | ||
|
|
1393134914 | ||
|
|
7c8c10ea20 | ||
|
|
aa28f54c0b | ||
|
|
762e98c2cc | ||
|
|
98bfa65de7 | ||
|
|
81e760e0eb | ||
|
|
140e07bd77 | ||
|
|
bc57da6679 | ||
|
|
0138c02fb7 | ||
|
|
5ca8f67990 | ||
|
|
72d7892432 | ||
|
|
8b8a56104d | ||
|
|
30b45e8c2e | ||
|
|
5260835556 | ||
|
|
cc61283eb6 | ||
|
|
35d70bd7c9 | ||
|
|
8b3f33287a | ||
|
|
4d26e7f4dd | ||
|
|
909a3a3ac1 | ||
|
|
bca546a381 | ||
|
|
7a078fcf8c | ||
|
|
da52eb154b | ||
|
|
03fd9d04c3 | ||
|
|
8ad6cc595d | ||
|
|
a454237c13 | ||
|
|
89277f2deb | ||
|
|
880267f348 | ||
|
|
0e7f1c5089 | ||
|
|
fd780c7a82 | ||
|
|
5f12dfb83d | ||
|
|
e9a14aea9a | ||
|
|
6b47d564d1 | ||
|
|
2d60476b55 | ||
|
|
ad6ce0e46f | ||
|
|
499cf72d6a | ||
|
|
b12eefdae8 | ||
|
|
b955116e1f | ||
|
|
67ea132b50 | ||
|
|
f97f3edcb3 | ||
|
|
a91f7a77fe | ||
|
|
f88801c619 | ||
|
|
afa23649f8 | ||
|
|
2e1a9d70da | ||
|
|
20a9302ff3 | ||
|
|
dbcbc65a00 | ||
|
|
2ee2b572ba | ||
|
|
653996b1c2 | ||
|
|
176da337a0 | ||
|
|
485d16e9a3 | ||
|
|
5c63044568 | ||
|
|
60c63be02a | ||
|
|
e8b08f83e8 | ||
|
|
a4bdfd034b | ||
|
|
95adb74219 | ||
|
|
60915d66dc | ||
|
|
8675f3868a | ||
|
|
14650daa03 | ||
|
|
b57929cefb | ||
|
|
51a8ba3e09 | ||
|
|
44e1a04bab | ||
|
|
87c2b2d870 | ||
|
|
ba443e4bdc | ||
|
|
78836248b4 |
+2
-2
@@ -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> (online copy)</li>
|
||||
<li><a href="docs.html#changelog">docs.html#changelog</a> (local copy)</li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+131
-78
@@ -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
@@ -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)
|
||||
|
||||
@@ -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.
@@ -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})
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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 $@ .
|
||||
|
||||
|
||||
+3
-3
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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.
+39
-20
@@ -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"
|
||||
@@ -302,6 +304,7 @@ namespace arma
|
||||
#include "armadillo_bits/op_clamp_bones.hpp"
|
||||
#include "armadillo_bits/op_expmat_bones.hpp"
|
||||
#include "armadillo_bits/op_nonzeros_bones.hpp"
|
||||
#include "armadillo_bits/op_omit_bones.hpp"
|
||||
#include "armadillo_bits/op_diff_bones.hpp"
|
||||
#include "armadillo_bits/op_norm_bones.hpp"
|
||||
#include "armadillo_bits/op_vecnorm_bones.hpp"
|
||||
@@ -314,12 +317,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 +365,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 +376,9 @@ 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/spop_omit_bones.hpp"
|
||||
|
||||
#include "armadillo_bits/spglue_plus_bones.hpp"
|
||||
#include "armadillo_bits/spglue_minus_bones.hpp"
|
||||
@@ -557,6 +566,7 @@ namespace arma
|
||||
#include "armadillo_bits/fn_clamp.hpp"
|
||||
#include "armadillo_bits/fn_expmat.hpp"
|
||||
#include "armadillo_bits/fn_nonzeros.hpp"
|
||||
#include "armadillo_bits/fn_omit.hpp"
|
||||
#include "armadillo_bits/fn_interp1.hpp"
|
||||
#include "armadillo_bits/fn_interp2.hpp"
|
||||
#include "armadillo_bits/fn_qz.hpp"
|
||||
@@ -583,6 +593,7 @@ namespace arma
|
||||
#include "armadillo_bits/fn_powmat.hpp"
|
||||
#include "armadillo_bits/fn_powext.hpp"
|
||||
#include "armadillo_bits/fn_diags_spdiags.hpp"
|
||||
#include "armadillo_bits/fn_balance.hpp"
|
||||
|
||||
#include "armadillo_bits/fn_speye.hpp"
|
||||
#include "armadillo_bits/fn_spones.hpp"
|
||||
@@ -624,6 +635,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"
|
||||
@@ -750,6 +762,7 @@ namespace arma
|
||||
#include "armadillo_bits/op_clamp_meat.hpp"
|
||||
#include "armadillo_bits/op_expmat_meat.hpp"
|
||||
#include "armadillo_bits/op_nonzeros_meat.hpp"
|
||||
#include "armadillo_bits/op_omit_meat.hpp"
|
||||
#include "armadillo_bits/op_diff_meat.hpp"
|
||||
#include "armadillo_bits/op_norm_meat.hpp"
|
||||
#include "armadillo_bits/op_vecnorm_meat.hpp"
|
||||
@@ -762,12 +775,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 +823,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 +834,9 @@ 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/spop_omit_meat.hpp"
|
||||
|
||||
#include "armadillo_bits/spglue_plus_meat.hpp"
|
||||
#include "armadillo_bits/spglue_minus_meat.hpp"
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
@@ -328,7 +328,7 @@ BaseCube<elem_type,derived>::is_finite() const
|
||||
for(uword c=0; c<n_c; ++c)
|
||||
for(uword r=0; r<n_r; ++r)
|
||||
{
|
||||
if( arma_isfinite(P.at(r,c,s)) == false ) { return false; }
|
||||
if( arma_isnonfinite(P.at(r,c,s)) ) { return false; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
@@ -436,7 +436,7 @@ BaseCube<elem_type,derived>::has_nonfinite() const
|
||||
for(uword c=0; c<n_c; ++c)
|
||||
for(uword r=0; r<n_r; ++r)
|
||||
{
|
||||
if(arma_isfinite(P.at(r,c,s)) == false) { return true; }
|
||||
if(arma_isnonfinite(P.at(r,c,s))) { return true; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) );
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
@@ -685,7 +685,7 @@ Base<elem_type,derived>::is_finite() const
|
||||
|
||||
for(uword i=0; i<n_elem; ++i)
|
||||
{
|
||||
if(arma_isfinite(Pea[i]) == false) { return false; }
|
||||
if(arma_isnonfinite(Pea[i])) { return false; }
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -696,7 +696,7 @@ Base<elem_type,derived>::is_finite() const
|
||||
for(uword col=0; col<n_cols; ++col)
|
||||
for(uword row=0; row<n_rows; ++row)
|
||||
{
|
||||
if(arma_isfinite(P.at(row,col)) == false) { return false; }
|
||||
if(arma_isnonfinite(P.at(row,col))) { return false; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
{
|
||||
@@ -829,7 +829,7 @@ Base<elem_type,derived>::has_nonfinite() const
|
||||
|
||||
for(uword i=0; i<n_elem; ++i)
|
||||
{
|
||||
if(arma_isfinite(Pea[i]) == false) { return true; }
|
||||
if(arma_isnonfinite(Pea[i])) { return true; }
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -840,7 +840,7 @@ Base<elem_type,derived>::has_nonfinite() const
|
||||
for(uword col=0; col<n_cols; ++col)
|
||||
for(uword row=0; row<n_rows; ++row)
|
||||
{
|
||||
if(arma_isfinite(P.at(row,col)) == false) { return true; }
|
||||
if(arma_isnonfinite(P.at(row,col))) { return true; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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) );
|
||||
}
|
||||
|
||||
@@ -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 ];
|
||||
|
||||
+163
-160
File diff suppressed because it is too large
Load Diff
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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
@@ -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();
|
||||
|
||||
@@ -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=()
|
||||
|
||||
@@ -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; }
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -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=()
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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,9 +104,14 @@ inline
|
||||
void
|
||||
MapMat<eT>::operator=(const MapMat<eT>& x)
|
||||
{
|
||||
arma_extra_debug_sigprint();
|
||||
arma_debug_sigprint();
|
||||
|
||||
if(this == &x) { return; }
|
||||
if(this == &x)
|
||||
{
|
||||
arma_debug_print("MapMat::operator=(): copy omitted");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
access::rw(n_rows) = x.n_rows;
|
||||
access::rw(n_cols) = x.n_cols;
|
||||
@@ -125,7 +130,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 +144,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 +186,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 +201,7 @@ inline
|
||||
void
|
||||
MapMat<eT>::operator=(MapMat<eT>&& x)
|
||||
{
|
||||
arma_extra_debug_sigprint();
|
||||
arma_debug_sigprint();
|
||||
|
||||
if(this == &x) { return; }
|
||||
|
||||
@@ -222,7 +227,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 +243,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 +255,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 +267,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 +279,7 @@ inline
|
||||
void
|
||||
MapMat<eT>::zeros()
|
||||
{
|
||||
arma_extra_debug_sigprint();
|
||||
arma_debug_sigprint();
|
||||
|
||||
(*map_ptr).clear();
|
||||
}
|
||||
@@ -286,7 +291,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 +305,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 +319,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 +333,7 @@ inline
|
||||
void
|
||||
MapMat<eT>::eye()
|
||||
{
|
||||
arma_extra_debug_sigprint();
|
||||
arma_debug_sigprint();
|
||||
|
||||
(*this).eye(n_rows, n_cols);
|
||||
}
|
||||
@@ -340,7 +345,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 +368,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 +380,7 @@ inline
|
||||
void
|
||||
MapMat<eT>::speye()
|
||||
{
|
||||
arma_extra_debug_sigprint();
|
||||
arma_debug_sigprint();
|
||||
|
||||
(*this).eye();
|
||||
}
|
||||
@@ -387,7 +392,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 +404,7 @@ inline
|
||||
void
|
||||
MapMat<eT>::speye(const SizeMat& s)
|
||||
{
|
||||
arma_extra_debug_sigprint();
|
||||
arma_debug_sigprint();
|
||||
|
||||
(*this).eye(s);
|
||||
}
|
||||
@@ -436,7 +441,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 +453,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 +499,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 +513,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 +584,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 +615,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 +667,7 @@ inline
|
||||
uword
|
||||
MapMat<eT>::get_n_nonzero() const
|
||||
{
|
||||
arma_extra_debug_sigprint();
|
||||
arma_debug_sigprint();
|
||||
|
||||
return uword((*map_ptr).size());
|
||||
}
|
||||
@@ -674,7 +679,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 +720,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 +730,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 +752,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 +764,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 +790,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 +818,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 +843,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 +852,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 +866,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 +882,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 +898,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 +912,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 +924,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 +945,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 +966,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 +975,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 +996,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 +1013,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 +1026,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 +1044,7 @@ arma_inline
|
||||
void
|
||||
MapMat_val<eT>::operator++(int)
|
||||
{
|
||||
arma_extra_debug_sigprint();
|
||||
arma_debug_sigprint();
|
||||
|
||||
(*this).operator++();
|
||||
}
|
||||
@@ -1054,7 +1056,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 +1074,7 @@ arma_inline
|
||||
void
|
||||
MapMat_val<eT>::operator--(int)
|
||||
{
|
||||
arma_extra_debug_sigprint();
|
||||
arma_debug_sigprint();
|
||||
|
||||
(*this).operator--();
|
||||
}
|
||||
@@ -1093,7 +1095,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 +1104,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 +1118,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 +1134,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 +1150,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 +1164,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 +1173,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 +1195,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 +1206,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 +1228,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 +1239,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 +1261,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 +1270,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 +1292,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 +1301,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 +1323,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 +1335,7 @@ inline
|
||||
eT
|
||||
SpMat_MapMat_val<eT>::operator++(int)
|
||||
{
|
||||
arma_extra_debug_sigprint();
|
||||
arma_debug_sigprint();
|
||||
|
||||
const eT old_val = eT(*this);
|
||||
|
||||
@@ -1349,7 +1351,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 +1363,7 @@ inline
|
||||
eT
|
||||
SpMat_MapMat_val<eT>::operator--(int)
|
||||
{
|
||||
arma_extra_debug_sigprint();
|
||||
arma_debug_sigprint();
|
||||
|
||||
const eT old_val = eT(*this);
|
||||
|
||||
@@ -1377,7 +1379,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 +1404,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 +1435,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 +1466,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 +1483,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 +1495,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 +1516,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 +1545,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 +1572,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 +1582,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 +1596,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 +1615,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 +1634,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 +1653,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 +1672,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 +1691,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 +1710,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 +1729,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 +1748,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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
+893
-612
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -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
@@ -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();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -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 ];
|
||||
|
||||
+163
-160
File diff suppressed because it is too large
Load Diff
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
@@ -748,7 +748,7 @@ SpBase<elem_type,derived>::is_finite() const
|
||||
|
||||
while(it != it_end)
|
||||
{
|
||||
if(arma_isfinite(*it) == false) { return false; }
|
||||
if(arma_isnonfinite(*it)) { return false; }
|
||||
++it;
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
{
|
||||
@@ -850,7 +850,7 @@ SpBase<elem_type,derived>::has_nonfinite() const
|
||||
|
||||
while(it != it_end)
|
||||
{
|
||||
if(arma_isfinite(*it) == false) { return true; }
|
||||
if(arma_isnonfinite(*it)) { return true; }
|
||||
++it;
|
||||
}
|
||||
}
|
||||
@@ -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() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! @}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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
@@ -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
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! @}
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -65,6 +65,48 @@ arma_isfinite(const std::complex<T>& x)
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
|
||||
|
||||
template<typename eT>
|
||||
inline
|
||||
bool
|
||||
arma_isnonfinite(eT)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<>
|
||||
inline
|
||||
bool
|
||||
arma_isnonfinite(float x)
|
||||
{
|
||||
return (std::isfinite(x) == false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<>
|
||||
inline
|
||||
bool
|
||||
arma_isnonfinite(double x)
|
||||
{
|
||||
return (std::isfinite(x) == false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<typename T>
|
||||
inline
|
||||
bool
|
||||
arma_isnonfinite(const std::complex<T>& x)
|
||||
{
|
||||
return ( (std::isfinite(x.real()) == false) || (std::isfinite(x.imag()) == false) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// wrappers for isinf
|
||||
|
||||
@@ -65,6 +65,20 @@ struct arma_config
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(ARMA_OPTIMISE_POWEXPR)
|
||||
static constexpr bool optimise_powexpr = true;
|
||||
#else
|
||||
static constexpr bool optimise_powexpr = false;
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(ARMA_CHECK_CONFORMANCE)
|
||||
static constexpr bool check_conform = true;
|
||||
#else
|
||||
static constexpr bool check_conform = false;
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(ARMA_CHECK_NONFINITE)
|
||||
static constexpr bool check_nonfinite = true;
|
||||
#else
|
||||
@@ -121,20 +135,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 +188,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 +223,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
|
||||
|
||||
@@ -91,6 +91,9 @@ class op_diagmat;
|
||||
class op_trimat;
|
||||
class op_vectorise_row;
|
||||
class op_vectorise_col;
|
||||
class op_symmatu;
|
||||
class op_symmatl;
|
||||
class op_omit;
|
||||
|
||||
class op_row_as_mat;
|
||||
class op_col_as_mat;
|
||||
@@ -128,6 +131,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 +153,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 +295,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 +314,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 +330,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 +341,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;
|
||||
@@ -346,6 +362,7 @@ struct arma_zeros_indicator : public arma_initmode_indicator<true > {};
|
||||
struct arma_nozeros_indicator : public arma_initmode_indicator<false> {};
|
||||
|
||||
|
||||
|
||||
//! \addtogroup injector
|
||||
//! @{
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ arma_ostream::modify_stream(std::ostream& o, const eT* data, const uword n_elem)
|
||||
{
|
||||
const eT val = data[i];
|
||||
|
||||
if(arma_isfinite(val) == false) { continue; }
|
||||
if(arma_isnonfinite(val)) { continue; }
|
||||
|
||||
if(
|
||||
( cond_rel< (sizeof(eT) > 4) && (is_same_type<uword,eT>::yes || is_same_type<sword,eT>::yes) >::geq(val, eT(+10000000000)) )
|
||||
@@ -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);
|
||||
@@ -208,7 +208,7 @@ arma_ostream::modify_stream(std::ostream& o, typename SpMat<eT>::const_iterator
|
||||
{
|
||||
const eT val = (*it);
|
||||
|
||||
if(arma_isfinite(val) == false) { continue; }
|
||||
if(arma_isnonfinite(val)) { continue; }
|
||||
|
||||
if(
|
||||
val >= eT(+100) ||
|
||||
@@ -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; }
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,10 +21,10 @@
|
||||
|
||||
|
||||
|
||||
#define ARMA_VERSION_MAJOR 12
|
||||
#define ARMA_VERSION_MINOR 8
|
||||
#define ARMA_VERSION_MAJOR 14
|
||||
#define ARMA_VERSION_MINOR 6
|
||||
#define ARMA_VERSION_PATCH 2
|
||||
#define ARMA_VERSION_NAME "Cortisol Injector"
|
||||
#define ARMA_VERSION_NAME "Caffe Mocha"
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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)
|
||||
@@ -1041,13 +1050,13 @@ arrayops::is_finite(const eT* src, const uword n_elem)
|
||||
const eT val_i = (*src); src++;
|
||||
const eT val_j = (*src); src++;
|
||||
|
||||
if(arma_isfinite(val_i) == false) { return false; }
|
||||
if(arma_isfinite(val_j) == false) { return false; }
|
||||
if(arma_isnonfinite(val_i)) { return false; }
|
||||
if(arma_isnonfinite(val_j)) { return false; }
|
||||
}
|
||||
|
||||
if((j-1) < n_elem)
|
||||
{
|
||||
if(arma_isfinite(*src) == false) { return false; }
|
||||
if(arma_isnonfinite(*src)) { return false; }
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -365,7 +391,7 @@ class auxlib
|
||||
// solve the Sylvester equation AX + XB = C
|
||||
|
||||
template<typename eT>
|
||||
inline static bool syl(Mat<eT>& X, const Mat<eT>& A, const Mat<eT>& B, const Mat<eT>& C);
|
||||
inline static bool sylvester(Mat<eT>& X, const Mat<eT>& A, const Mat<eT>& B, const Mat<eT>& C);
|
||||
|
||||
|
||||
//
|
||||
@@ -378,6 +404,13 @@ class auxlib
|
||||
inline static bool qz(Mat< std::complex<T> >& A, Mat< std::complex<T> >& B, Mat< std::complex<T> >& vsl, Mat< std::complex<T> >& vsr, const Base< std::complex<T>, T1 >& X_expr, const Base< std::complex<T>, T2 >& Y_expr, const char mode);
|
||||
|
||||
|
||||
//
|
||||
// matrix balance
|
||||
|
||||
template<typename eT>
|
||||
inline static bool balance(Col<typename get_pod_type<eT>::result>& S, Col<uword>& P, Mat<eT>& A, const bool calc_SP, const bool do_scal, const bool do_perm);
|
||||
|
||||
|
||||
//
|
||||
// rcond
|
||||
|
||||
@@ -388,10 +421,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);
|
||||
|
||||
+1230
-495
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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,19 @@
|
||||
//// of inv() and inv_sympd() within compound expressions
|
||||
#endif
|
||||
|
||||
#if !defined(ARMA_OPTIMISE_POWEXPR)
|
||||
#define ARMA_OPTIMISE_POWEXPR
|
||||
//// Comment out the above line to disable optimised handling of pow()
|
||||
#endif
|
||||
|
||||
#if !defined(ARMA_CHECK_CONFORMANCE)
|
||||
#define ARMA_CHECK_CONFORMANCE
|
||||
//// Comment out the above line to disable conformance checks for bounds and size.
|
||||
//// 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 +204,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 +289,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 +308,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,35 +338,64 @@
|
||||
#undef ARMA_OPTIMISE_INVEXPR
|
||||
#endif
|
||||
|
||||
#if defined(ARMA_DONT_OPTIMISE_POWEXPR)
|
||||
#undef ARMA_OPTIMISE_POWEXPR
|
||||
#endif
|
||||
|
||||
#if defined(ARMA_DONT_CHECK_CONFORMANCE)
|
||||
#if defined(ARMA_CHECK_CONFORMANCE) && (ARMA_WARN_LEVEL >= 2)
|
||||
#pragma message ("WARNING: conformance checks disabled")
|
||||
#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_IGNORE_DEPRECATED_MARKER is deprecated and will be removed
|
||||
// WARNING: option ARMA_CRIPPLED_LAPACK is deprecated and will be removed
|
||||
|
||||
#if defined(ARMA_CRIPPLED_LAPACK)
|
||||
#if (!defined(ARMA_IGNORE_DEPRECATED_MARKER))
|
||||
#pragma message ("WARNING: option ARMA_CRIPPLED_LAPACK is deprecated and will be removed")
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
// 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
|
||||
|
||||
@@ -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,19 @@
|
||||
//// of inv() and inv_sympd() within compound expressions
|
||||
#endif
|
||||
|
||||
#if !defined(ARMA_OPTIMISE_POWEXPR)
|
||||
#define ARMA_OPTIMISE_POWEXPR
|
||||
//// Comment out the above line to disable optimised handling of pow()
|
||||
#endif
|
||||
|
||||
#if !defined(ARMA_CHECK_CONFORMANCE)
|
||||
#define ARMA_CHECK_CONFORMANCE
|
||||
//// Comment out the above line to disable conformance checks for bounds and size.
|
||||
//// 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 +204,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 +289,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 +308,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,35 +338,64 @@
|
||||
#undef ARMA_OPTIMISE_INVEXPR
|
||||
#endif
|
||||
|
||||
#if defined(ARMA_DONT_OPTIMISE_POWEXPR)
|
||||
#undef ARMA_OPTIMISE_POWEXPR
|
||||
#endif
|
||||
|
||||
#if defined(ARMA_DONT_CHECK_CONFORMANCE)
|
||||
#if defined(ARMA_CHECK_CONFORMANCE) && (ARMA_WARN_LEVEL >= 2)
|
||||
#pragma message ("WARNING: conformance checks disabled")
|
||||
#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_IGNORE_DEPRECATED_MARKER is deprecated and will be removed
|
||||
// WARNING: option ARMA_CRIPPLED_LAPACK is deprecated and will be removed
|
||||
|
||||
#if defined(ARMA_CRIPPLED_LAPACK)
|
||||
#if (!defined(ARMA_IGNORE_DEPRECATED_MARKER))
|
||||
#pragma message ("WARNING: option ARMA_CRIPPLED_LAPACK is deprecated and will be removed")
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
// 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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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,69 @@ 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::optimise_powexpr = " << arma_config::optimise_powexpr;
|
||||
out << "\n@ arma_config::check_conform = " << arma_config::check_conform;
|
||||
out << "\n@ arma_config::check_nonfinite = " << arma_config::check_nonfinite;
|
||||
out << "\n@ arma_config::fast_math = " << arma_config::fast_math;
|
||||
out << "\n@ 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
|
||||
|
||||
@@ -269,6 +269,35 @@
|
||||
#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
|
||||
|
||||
#define arma_sgebal sgebal
|
||||
#define arma_dgebal dgebal
|
||||
#define arma_cgebal cgebal
|
||||
#define arma_zgebal zgebal
|
||||
|
||||
#else
|
||||
|
||||
#define arma_sgetrf SGETRF
|
||||
@@ -505,6 +534,35 @@
|
||||
#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
|
||||
|
||||
#define arma_sgebal SGEBAL
|
||||
#define arma_dgebal DGEBAL
|
||||
#define arma_cgebal CGEBAL
|
||||
#define arma_zgebal ZGEBAL
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -846,6 +904,44 @@ 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;
|
||||
|
||||
// matrix balance
|
||||
void arma_fortran(arma_sgebal)(const char* job, const blas_int* n, float* a, const blas_int* lda, blas_int* ilo, blas_int* ihi, float* scale, blas_int* info, blas_len job_len) ARMA_NOEXCEPT;
|
||||
void arma_fortran(arma_dgebal)(const char* job, const blas_int* n, double* a, const blas_int* lda, blas_int* ilo, blas_int* ihi, double* scale, blas_int* info, blas_len job_len) ARMA_NOEXCEPT;
|
||||
void arma_fortran(arma_cgebal)(const char* job, const blas_int* n, blas_cxf* a, const blas_int* lda, blas_int* ilo, blas_int* ihi, float* scale, blas_int* info, blas_len job_len) ARMA_NOEXCEPT;
|
||||
void arma_fortran(arma_zgebal)(const char* job, const blas_int* n, blas_cxd* a, const blas_int* lda, blas_int* ilo, blas_int* ihi, double* scale, blas_int* info, blas_len job_len) ARMA_NOEXCEPT;
|
||||
|
||||
#else
|
||||
|
||||
// prototypes without hidden arguments
|
||||
@@ -1170,6 +1266,44 @@ 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;
|
||||
|
||||
// matrix balance
|
||||
void arma_fortran(arma_sgebal)(const char* job, const blas_int* n, float* a, const blas_int* lda, blas_int* ilo, blas_int* ihi, float* scale, blas_int* info) ARMA_NOEXCEPT;
|
||||
void arma_fortran(arma_dgebal)(const char* job, const blas_int* n, double* a, const blas_int* lda, blas_int* ilo, blas_int* ihi, double* scale, blas_int* info) ARMA_NOEXCEPT;
|
||||
void arma_fortran(arma_cgebal)(const char* job, const blas_int* n, blas_cxf* a, const blas_int* lda, blas_int* ilo, blas_int* ihi, float* scale, blas_int* info) ARMA_NOEXCEPT;
|
||||
void arma_fortran(arma_zgebal)(const char* job, const blas_int* n, blas_cxd* a, const blas_int* lda, blas_int* ilo, blas_int* ihi, double* scale, blas_int* info) ARMA_NOEXCEPT;
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -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*);
|
||||
|
||||
@@ -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); }
|
||||
|
||||
@@ -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>;
|
||||
|
||||
@@ -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,15 +989,19 @@ inline
|
||||
void
|
||||
diagview<eT>::randu()
|
||||
{
|
||||
arma_extra_debug_sigprint();
|
||||
arma_debug_sigprint();
|
||||
|
||||
Mat<eT>& x = const_cast< Mat<eT>& >(m);
|
||||
|
||||
const uword local_n_elem = n_elem;
|
||||
|
||||
Col<eT> tmp(local_n_elem, arma_nozeros_indicator());
|
||||
|
||||
tmp.randu();
|
||||
|
||||
for(uword ii=0; ii < local_n_elem; ++ii)
|
||||
{
|
||||
x.at(ii+row_offset, ii+col_offset) = eT(arma_rng::randu<eT>());
|
||||
x.at(ii+row_offset, ii+col_offset) = tmp[ii];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1008,18 +1012,35 @@ inline
|
||||
void
|
||||
diagview<eT>::randn()
|
||||
{
|
||||
arma_extra_debug_sigprint();
|
||||
arma_debug_sigprint();
|
||||
|
||||
Mat<eT>& x = const_cast< Mat<eT>& >(m);
|
||||
|
||||
const uword local_n_elem = n_elem;
|
||||
|
||||
Col<eT> tmp(local_n_elem, arma_nozeros_indicator());
|
||||
|
||||
tmp.randn();
|
||||
|
||||
for(uword ii=0; ii < local_n_elem; ++ii)
|
||||
{
|
||||
x.at(ii+row_offset, ii+col_offset) = eT(arma_rng::randn<eT>());
|
||||
x.at(ii+row_offset, ii+col_offset) = tmp[ii];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! @}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user