mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-16 17:39:58 +00:00
Compare commits
1039 Commits
V3.5
...
v3.6-DEV21
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
474edee78f | ||
|
|
ae8a8c0b4b | ||
|
|
6c0c56ab5b | ||
|
|
09e2ac95da | ||
|
|
fab0c1aae4 | ||
|
|
10317e4730 | ||
|
|
8330664467 | ||
|
|
4f30e98e50 | ||
|
|
272963b832 | ||
|
|
ff3d6b4a63 | ||
|
|
734d9c2739 | ||
|
|
d0bb437fc0 | ||
|
|
d7957363ff | ||
|
|
aecc1c970a | ||
|
|
7be34c1dcd | ||
|
|
70ed4e36e0 | ||
|
|
4f005d4491 | ||
|
|
5502d87af7 | ||
|
|
d56d52c01f | ||
|
|
d568dd0e06 | ||
|
|
dfdf0c5898 | ||
|
|
53ee8f358c | ||
|
|
4c720884b6 | ||
|
|
4c6c8e6d71 | ||
|
|
5fb2dfb73e | ||
|
|
1dc1cd678f | ||
|
|
a3c1f6d2fc | ||
|
|
fb76ecc33c | ||
|
|
8580a45c38 | ||
|
|
ca3a48c0bc | ||
|
|
e26ab4f957 | ||
|
|
d97adfe987 | ||
|
|
65853b095d | ||
|
|
c592de6af9 | ||
|
|
e0892371b7 | ||
|
|
6236611aee | ||
|
|
ea26efc44a | ||
|
|
60430fa97b | ||
|
|
437c38f959 | ||
|
|
08876a9065 | ||
|
|
4d9367ed20 | ||
|
|
dab1520e39 | ||
|
|
be5f0b3d22 | ||
|
|
bd64625c05 | ||
|
|
cb874b6793 | ||
|
|
2477096345 | ||
|
|
f6375f18f9 | ||
|
|
a6628eb447 | ||
|
|
e3e826a017 | ||
|
|
578a7fb263 | ||
|
|
41fbd9563a | ||
|
|
d953b44c00 | ||
|
|
32c7b68f43 | ||
|
|
4ddaa041a9 | ||
|
|
b5046f4be1 | ||
|
|
01beed8f46 | ||
|
|
d7c1b66b27 | ||
|
|
9b679a7d79 | ||
|
|
78850dabc3 | ||
|
|
494e01ba7a | ||
|
|
5e516aefca | ||
|
|
e31f05236c | ||
|
|
13dc1059bc | ||
|
|
ec46e545f5 | ||
|
|
1e480b6965 | ||
|
|
5e8e490e51 | ||
|
|
fa296f7c13 | ||
|
|
cc8b6b114d | ||
|
|
73d28661fa | ||
|
|
a4d928e4a0 | ||
|
|
7c944d6100 | ||
|
|
c973bd7d85 | ||
|
|
e02e19a979 | ||
|
|
fecaad5cbf | ||
|
|
1e18321da7 | ||
|
|
524dad3f4d | ||
|
|
2096342fe4 | ||
|
|
15595090e7 | ||
|
|
bf2a1735ed | ||
|
|
78a4532793 | ||
|
|
31f51dbdd5 | ||
|
|
f4a14b6ac9 | ||
|
|
33018aab77 | ||
|
|
81d59d4637 | ||
|
|
6d3ae32e61 | ||
|
|
5f548785ad | ||
|
|
1297d76ee4 | ||
|
|
f86bc6752e | ||
|
|
f8cdbf3e39 | ||
|
|
e1ed960714 | ||
|
|
39c135a29b | ||
|
|
efba58b509 | ||
|
|
ba3c0bf34e | ||
|
|
e10aac4de4 | ||
|
|
7cc2219293 | ||
|
|
29485aa327 | ||
|
|
f9fa6ca401 | ||
|
|
d57c3c9ce5 | ||
|
|
0d2310e76a | ||
|
|
d7ae5610cf | ||
|
|
eaa6120467 | ||
|
|
e464762f7f | ||
|
|
195514c30e | ||
|
|
5fd1a08419 | ||
|
|
2ea3080d24 | ||
|
|
fd546b4da1 | ||
|
|
2b30f9aa50 | ||
|
|
09de27b0d2 | ||
|
|
cc3f291113 | ||
|
|
dcd2a69951 | ||
|
|
c3bbd3a9ee | ||
|
|
d449933ab1 | ||
|
|
7b2bd79448 | ||
|
|
6e88ee4ca6 | ||
|
|
b893e702b3 | ||
|
|
18dbedc586 | ||
|
|
fcad1ed196 | ||
|
|
8375f539db | ||
|
|
cc0bb2e6d6 | ||
|
|
95cd28a279 | ||
|
|
39fc9e4537 | ||
|
|
1f77f08ae0 | ||
|
|
91f2c46c3e | ||
|
|
01e0d14757 | ||
|
|
29a76773a6 | ||
|
|
abdce42223 | ||
|
|
98466cc9cf | ||
|
|
924da10958 | ||
|
|
0f9b92f8cf | ||
|
|
171760097d | ||
|
|
db9623a201 | ||
|
|
62012f1990 | ||
|
|
b36bbdc3c0 | ||
|
|
00b50b47c3 | ||
|
|
1986df1c95 | ||
|
|
15bbe288a0 | ||
|
|
534a6a4ef1 | ||
|
|
d41e7dd1f6 | ||
|
|
a98ac12d0e | ||
|
|
49989f95b6 | ||
|
|
98e49c3228 | ||
|
|
171882dc9f | ||
|
|
bd864344bb | ||
|
|
72f91c31a8 | ||
|
|
155273232f | ||
|
|
a0f77fbf70 | ||
|
|
fd384d69ba | ||
|
|
7e998d965a | ||
|
|
f1045d1aed | ||
|
|
557a0a27ec | ||
|
|
e772e068d5 | ||
|
|
c91f6d89ac | ||
|
|
031b268270 | ||
|
|
b086b779cf | ||
|
|
c60f6f4bb6 | ||
|
|
173b1a754e | ||
|
|
0f432a7824 | ||
|
|
0ffca019ea | ||
|
|
360bc29d52 | ||
|
|
7f005935e5 | ||
|
|
b9fbcce56e | ||
|
|
a918a5c28e | ||
|
|
c89d15e067 | ||
|
|
86e6b4781c | ||
|
|
92e3438ef3 | ||
|
|
59a2f3841f | ||
|
|
a52a07de7a | ||
|
|
806e907584 | ||
|
|
0cc4a338d2 | ||
|
|
b6f1151990 | ||
|
|
85e5353990 | ||
|
|
456b06348f | ||
|
|
c502c9bbc0 | ||
|
|
e34a36f98a | ||
|
|
663b6af8fb | ||
|
|
1b38e556c3 | ||
|
|
3e21d6bd39 | ||
|
|
8e3863218d | ||
|
|
c29a776c21 | ||
|
|
566d562982 | ||
|
|
c78fcda1e3 | ||
|
|
61d00c161f | ||
|
|
bd49279553 | ||
|
|
73a354156d | ||
|
|
cb092b9d73 | ||
|
|
722588f1db | ||
|
|
9d6e08547f | ||
|
|
39a7e67085 | ||
|
|
c4d6ee065e | ||
|
|
b738038907 | ||
|
|
3bc1391cb1 | ||
|
|
73e174a982 | ||
|
|
20d34664e3 | ||
|
|
8c5144657c | ||
|
|
eadc3a78bf | ||
|
|
68e7fcacb4 | ||
|
|
4e570230a7 | ||
|
|
830317ef03 | ||
|
|
1335786957 | ||
|
|
271c0a979a | ||
|
|
1026145f9b | ||
|
|
fe2643eb65 | ||
|
|
6ecff9e2d1 | ||
|
|
9023014833 | ||
|
|
c7599be666 | ||
|
|
0dd9d045cd | ||
|
|
7540b69eea | ||
|
|
de3fadf8e7 | ||
|
|
a70231c4bb | ||
|
|
0262d5f968 | ||
|
|
6919ade54e | ||
|
|
0243aedded | ||
|
|
32a6089f50 | ||
|
|
58c5cc20d2 | ||
|
|
8753032170 | ||
|
|
e448aa1a8d | ||
|
|
58c8b98f47 | ||
|
|
586033c6a5 | ||
|
|
154077793e | ||
|
|
07d835e076 | ||
|
|
3888246b42 | ||
|
|
061cb9328c | ||
|
|
c3a1afa0a0 | ||
|
|
968bdc1d17 | ||
|
|
d17d3c59a3 | ||
|
|
99f73bdba5 | ||
|
|
df08c607d1 | ||
|
|
2b063c91c2 | ||
|
|
6e4dba86f0 | ||
|
|
316e62d27c | ||
|
|
a5043d1b59 | ||
|
|
0ba409a192 | ||
|
|
aed30180f6 | ||
|
|
773e5a21b0 | ||
|
|
0d0cf42918 | ||
|
|
5472b0b50b | ||
|
|
3a07cc52d7 | ||
|
|
380dc47ac7 | ||
|
|
815496a8d1 | ||
|
|
6486e89145 | ||
|
|
d83041282d | ||
|
|
176226545f | ||
|
|
df1d83c357 | ||
|
|
20a7d74c16 | ||
|
|
489c499ba7 | ||
|
|
95e5cb3bc4 | ||
|
|
9a0b6e0bc7 | ||
|
|
44f49c54d6 | ||
|
|
bee7d48ac2 | ||
|
|
d7e1747a2b | ||
|
|
9315b301d7 | ||
|
|
4d5841e4b1 | ||
|
|
e1ac00b860 | ||
|
|
3d07321b2f | ||
|
|
c4204231cc | ||
|
|
f279898bd5 | ||
|
|
6560194db4 | ||
|
|
aaa6bac5ed | ||
|
|
a4e9b52eeb | ||
|
|
ae2df3a271 | ||
|
|
ce920126f5 | ||
|
|
cebf46a99d | ||
|
|
f072a1ad6e | ||
|
|
f77f040ae7 | ||
|
|
07c532a588 | ||
|
|
6572bbb52a | ||
|
|
3e153f03ac | ||
|
|
ac606065aa | ||
|
|
0a03aac7e8 | ||
|
|
79f4bb2815 | ||
|
|
d932811c97 | ||
|
|
1e1ddfaaee | ||
|
|
3e6214624d | ||
|
|
88060faab6 | ||
|
|
6c2a435759 | ||
|
|
c9e01353a0 | ||
|
|
9ff6d6ab97 | ||
|
|
d27327d8c1 | ||
|
|
55e9cdb444 | ||
|
|
46be903027 | ||
|
|
6c960f11c3 | ||
|
|
96c8508da2 | ||
|
|
37c1ec4bd8 | ||
|
|
5540160d3f | ||
|
|
2536bafcb2 | ||
|
|
8de66b8f2b | ||
|
|
2cbf324a26 | ||
|
|
4c7bdc3963 | ||
|
|
133364e597 | ||
|
|
39d19e8c1a | ||
|
|
f0f1b13754 | ||
|
|
de10c10a50 | ||
|
|
5d666c8233 | ||
|
|
696a04e8a0 | ||
|
|
e261794992 | ||
|
|
465ec039a2 | ||
|
|
ea548695b6 | ||
|
|
0b3a883303 | ||
|
|
c474dae4b6 | ||
|
|
cb04baf734 | ||
|
|
e79b474ea8 | ||
|
|
c01b696551 | ||
|
|
5a1bd1a27e | ||
|
|
c15d1bc33b | ||
|
|
a0a9c31641 | ||
|
|
5f78616696 | ||
|
|
4ed2565b2f | ||
|
|
6e77d6bde8 | ||
|
|
df1b5fdcaa | ||
|
|
378cf95784 | ||
|
|
2a8678d416 | ||
|
|
e3fda3cc0d | ||
|
|
a2b95df762 | ||
|
|
3f476a8226 | ||
|
|
92f81ef711 | ||
|
|
e849b4fd81 | ||
|
|
239f66fa6f | ||
|
|
be3cb9d149 | ||
|
|
58617cb165 | ||
|
|
5c33ffb1d4 | ||
|
|
b9b6745da5 | ||
|
|
763235a573 | ||
|
|
e9abe68736 | ||
|
|
cabe078453 | ||
|
|
2be7a2c86e | ||
|
|
0fe28abe5a | ||
|
|
5714a74e88 | ||
|
|
44c6749d14 | ||
|
|
b79166fa59 | ||
|
|
fc9e302aef | ||
|
|
921e81fad8 | ||
|
|
3308372445 | ||
|
|
e6b302dd6c | ||
|
|
e1b8293f01 | ||
|
|
92d1244b68 | ||
|
|
c726325af6 | ||
|
|
209470bf8f | ||
|
|
bc9eaccde2 | ||
|
|
2d6cc255ec | ||
|
|
58f8d9394d | ||
|
|
06914d9446 | ||
|
|
453b05a188 | ||
|
|
ace6760fbb | ||
|
|
da75f0cc38 | ||
|
|
14b287109f | ||
|
|
b44be0897d | ||
|
|
cf31bffed2 | ||
|
|
d84d329a78 | ||
|
|
8d89ba4e67 | ||
|
|
276791edb9 | ||
|
|
2d64166acd | ||
|
|
cbe75fae47 | ||
|
|
537b6677d3 | ||
|
|
980c99cfae | ||
|
|
cdb117486a | ||
|
|
01b0e4767b | ||
|
|
0eb8d63d07 | ||
|
|
d59b7d43f4 | ||
|
|
d392984993 | ||
|
|
c72b81ea84 | ||
|
|
773b076606 | ||
|
|
5dc4ace31d | ||
|
|
0427042709 | ||
|
|
d76701285d | ||
|
|
97ce2989bf | ||
|
|
d8c21e4070 | ||
|
|
0d3a8c911a | ||
|
|
a298715bb5 | ||
|
|
1b18ec7eeb | ||
|
|
33a4cf517d | ||
|
|
105f15e3e0 | ||
|
|
d21a603fa1 | ||
|
|
5d510388cf | ||
|
|
0b7d817c2d | ||
|
|
2b6473da60 | ||
|
|
cefc2cb81c | ||
|
|
b29f72d19c | ||
|
|
75ba4c0e90 | ||
|
|
1d4e93350a | ||
|
|
1120704073 | ||
|
|
41456b5cc1 | ||
|
|
cf745c1200 | ||
|
|
89d99ccecf | ||
|
|
08ff66a7bd | ||
|
|
dfe4da61d8 | ||
|
|
3c5d53a5bb | ||
|
|
9b52cf6a6c | ||
|
|
944f0ba73d | ||
|
|
24203a01ad | ||
|
|
c6c5505610 | ||
|
|
f251e982ae | ||
|
|
d881a2b3be | ||
|
|
4e3a258a1c | ||
|
|
6f79286302 | ||
|
|
ea1aa13a9b | ||
|
|
c25e9f2749 | ||
|
|
5eb519a214 | ||
|
|
61b5fee924 | ||
|
|
ae318a43ba | ||
|
|
759c6593cf | ||
|
|
6f948346a4 | ||
|
|
e098816f2b | ||
|
|
055833eed9 | ||
|
|
f0d839c37b | ||
|
|
c373e65010 | ||
|
|
0d57f88ac2 | ||
|
|
d5b09a4c9c | ||
|
|
afb69d8edb | ||
|
|
603c8cd651 | ||
|
|
983874d599 | ||
|
|
906cffba8e | ||
|
|
af19f31b24 | ||
|
|
47cb560633 | ||
|
|
e24d25ff47 | ||
|
|
373f3b7a35 | ||
|
|
b887f69a1b | ||
|
|
80086ace46 | ||
|
|
53e19a006d | ||
|
|
2d1e36549c | ||
|
|
763458564c | ||
|
|
5f68d2dce0 | ||
|
|
3c639d3377 | ||
|
|
ec11d90160 | ||
|
|
c49fa4f4d5 | ||
|
|
8c01d6291e | ||
|
|
34526f2fe9 | ||
|
|
487ec866f5 | ||
|
|
36df458406 | ||
|
|
1b61f076ca | ||
|
|
cb37db2281 | ||
|
|
1957404d03 | ||
|
|
90acbedabb | ||
|
|
56532be1ea | ||
|
|
bed5f1e820 | ||
|
|
a42ca208b6 | ||
|
|
9ff48f067a | ||
|
|
70fa7c0a45 | ||
|
|
e874714f60 | ||
|
|
71f34634e3 | ||
|
|
afd6552b3b | ||
|
|
8e5a2b42d0 | ||
|
|
bf02c868ea | ||
|
|
25bb4beaa5 | ||
|
|
c187dbe686 | ||
|
|
44fd1885a1 | ||
|
|
197d320bf8 | ||
|
|
d17bba8ce1 | ||
|
|
fe4301a7e2 | ||
|
|
aaf6f282b0 | ||
|
|
f30dd0a9c5 | ||
|
|
d4aebbb441 | ||
|
|
f47c3003a7 | ||
|
|
a7b08c4abf | ||
|
|
a107a0203c | ||
|
|
aaa7889172 | ||
|
|
9e5980f82c | ||
|
|
45345679a6 | ||
|
|
c187d4325b | ||
|
|
7d32bb4446 | ||
|
|
bbc7a03178 | ||
|
|
cec7c4dd52 | ||
|
|
4273480bf4 | ||
|
|
a5252334ef | ||
|
|
e05cf52446 | ||
|
|
1345779cfc | ||
|
|
cfd456c798 | ||
|
|
4af953ee00 | ||
|
|
617ebc3d82 | ||
|
|
3e846a3d20 | ||
|
|
da8341f619 | ||
|
|
d3cafc4aed | ||
|
|
42b37ce017 | ||
|
|
fc9c116fa4 | ||
|
|
a2da081681 | ||
|
|
b6e3ae4c96 | ||
|
|
eb6f111a0d | ||
|
|
f5f38f54e9 | ||
|
|
6ed93a22a1 | ||
|
|
f4dd2f10bd | ||
|
|
2d446cc9c2 | ||
|
|
4c50c1fb53 | ||
|
|
83a50db2cb | ||
|
|
e77096df35 | ||
|
|
f51856a52a | ||
|
|
294bf71f96 | ||
|
|
4ab82e9755 | ||
|
|
b7a56a9dd9 | ||
|
|
cde4ec0194 | ||
|
|
ca191e3163 | ||
|
|
d2a530e19e | ||
|
|
4c62c52fc3 | ||
|
|
b2e90c0af6 | ||
|
|
52c1441e03 | ||
|
|
3d1f8ee5fa | ||
|
|
1023e599a0 | ||
|
|
586ead3638 | ||
|
|
d50e1a8552 | ||
|
|
8c30a6da4a | ||
|
|
a1087c9bb3 | ||
|
|
e363f57a74 | ||
|
|
c61a6d846e | ||
|
|
22ea3399fe | ||
|
|
16dfd234e2 | ||
|
|
4351c68770 | ||
|
|
c10b666b55 | ||
|
|
0dfa8f0e00 | ||
|
|
9264d112ef | ||
|
|
5fdf427f39 | ||
|
|
4c19365e8b | ||
|
|
28cbf3b943 | ||
|
|
410b28f4db | ||
|
|
73e175e0f3 | ||
|
|
8e84ed280d | ||
|
|
0d4c289b9e | ||
|
|
f358f335b0 | ||
|
|
1593576cff | ||
|
|
5066fa990d | ||
|
|
a418b601b1 | ||
|
|
01f1e0e9bd | ||
|
|
aeb0e142cd | ||
|
|
7cacf01e8d | ||
|
|
e95eb7b39d | ||
|
|
fc3de5f84a | ||
|
|
97f58096cb | ||
|
|
2fb044e653 | ||
|
|
de02184079 | ||
|
|
6164dd963f | ||
|
|
8c5b416b56 | ||
|
|
b2da0afb83 | ||
|
|
8b651b50dc | ||
|
|
b69daad663 | ||
|
|
0179c3b3d8 | ||
|
|
894d9e6e23 | ||
|
|
9e4fe431e4 | ||
|
|
c3f7cf1404 | ||
|
|
f1c6394305 | ||
|
|
0f40659052 | ||
|
|
16d5c82f21 | ||
|
|
96b4cacec9 | ||
|
|
1a184f925d | ||
|
|
84f706f370 | ||
|
|
42632c4d8d | ||
|
|
203c505f34 | ||
|
|
5ef8817107 | ||
|
|
46e07a7016 | ||
|
|
35606d321c | ||
|
|
fbd095a2d4 | ||
|
|
79071a2f3b | ||
|
|
80d7eed382 | ||
|
|
a0409e8cea | ||
|
|
6cdd5bbbe7 | ||
|
|
39feb5807c | ||
|
|
99fb4f551e | ||
|
|
6fcabd699a | ||
|
|
bdd6d2c219 | ||
|
|
90e20d79bd | ||
|
|
ebca2b846a | ||
|
|
2a43f11c72 | ||
|
|
6cdb848e9f | ||
|
|
2372b4cdbe | ||
|
|
2eed6f66dc | ||
|
|
3c6bbd5ec6 | ||
|
|
1eae9f4071 | ||
|
|
414cc630fd | ||
|
|
2ada830c5b | ||
|
|
80ba487153 | ||
|
|
9bb1f3434d | ||
|
|
64e83121ca | ||
|
|
97da9f9539 | ||
|
|
c52d260949 | ||
|
|
9a2d71dc5d | ||
|
|
1d9f570ed8 | ||
|
|
6bc48200e7 | ||
|
|
c886158c16 | ||
|
|
c49180460d | ||
|
|
7c90abf675 | ||
|
|
f0fd495a21 | ||
|
|
3f9892d130 | ||
|
|
8150d5b7ce | ||
|
|
edec952b86 | ||
|
|
7d9337fb23 | ||
|
|
7e3f141124 | ||
|
|
750f7fb258 | ||
|
|
08632206c3 | ||
|
|
51eb9e6c96 | ||
|
|
7189c6d759 | ||
|
|
5a27239e01 | ||
|
|
9a62573087 | ||
|
|
e2c6f2ea28 | ||
|
|
7a4be49492 | ||
|
|
11092bf436 | ||
|
|
c52a861a9a | ||
|
|
f01ed7c77c | ||
|
|
fa1e1d00ae | ||
|
|
1dde50f6e5 | ||
|
|
5d18b810a7 | ||
|
|
947393914f | ||
|
|
3bf2f13764 | ||
|
|
1f8bafb334 | ||
|
|
911b9bd966 | ||
|
|
ba5cf3ed1d | ||
|
|
c850a532f6 | ||
|
|
b9039e7767 | ||
|
|
2874bf6bfa | ||
|
|
4b93632b42 | ||
|
|
e885966195 | ||
|
|
1a5b7e1464 | ||
|
|
c98695cd34 | ||
|
|
f767b066df | ||
|
|
169bd9c4e0 | ||
|
|
5bd48dd4f6 | ||
|
|
9b2226d3ba | ||
|
|
b91c8395c0 | ||
|
|
cc27d6be84 | ||
|
|
a1d2fd8f41 | ||
|
|
a33a74923b | ||
|
|
c701c8a510 | ||
|
|
2e4fa9f406 | ||
|
|
9a72ab4269 | ||
|
|
98ff3aaf11 | ||
|
|
83b551deaf | ||
|
|
af94c6f8c5 | ||
|
|
6349e53232 | ||
|
|
eba028475a | ||
|
|
e3d11c27a8 | ||
|
|
0f73c15c0e | ||
|
|
20e0b4aeca | ||
|
|
b313cb4f37 | ||
|
|
64da909243 | ||
|
|
94c723f4a0 | ||
|
|
c16d4c4667 | ||
|
|
3b2aa33c6a | ||
|
|
e6938a38f8 | ||
|
|
5518ac98a8 | ||
|
|
88e6c4cbd2 | ||
|
|
b02a640d6e | ||
|
|
ec195656f7 | ||
|
|
d0dba1d8a1 | ||
|
|
1599546b68 | ||
|
|
709994c3e7 | ||
|
|
c2abdc2a5b | ||
|
|
cd2de5dc3d | ||
|
|
d9df2bb76b | ||
|
|
8ec6d513b8 | ||
|
|
0b5153a6a5 | ||
|
|
93259ce7e0 | ||
|
|
00b498c8b7 | ||
|
|
2162cb1374 | ||
|
|
13c91cf67d | ||
|
|
ac5ae5027b | ||
|
|
e90eaf281f | ||
|
|
5dd950c77b | ||
|
|
9bdbf22f7c | ||
|
|
a27065673c | ||
|
|
028e822aa4 | ||
|
|
fdf6d4e862 | ||
|
|
0e3766a504 | ||
|
|
3bfcfa57aa | ||
|
|
4d205bd742 | ||
|
|
8956f60826 | ||
|
|
0e1bec38aa | ||
|
|
225cf0c9d5 | ||
|
|
ad4d06faa8 | ||
|
|
5eafea682b | ||
|
|
c3145c5f04 | ||
|
|
0dc5fc2f6f | ||
|
|
984d28abf0 | ||
|
|
05e89e5c34 | ||
|
|
32884b1c6a | ||
|
|
e1086afc50 | ||
|
|
21c07be749 | ||
|
|
59f736bb50 | ||
|
|
a81c97c09b | ||
|
|
c72a14a023 | ||
|
|
903861bae9 | ||
|
|
dff682fd88 | ||
|
|
6637a45929 | ||
|
|
837a7c6154 | ||
|
|
e32e233d5f | ||
|
|
b66f65e129 | ||
|
|
9dbfc10e04 | ||
|
|
3be603a9ee | ||
|
|
e4ad4ab1a3 | ||
|
|
bf76bac59d | ||
|
|
c3463860d5 | ||
|
|
2034b8754a | ||
|
|
1c4c83af5e | ||
|
|
5c84f7f789 | ||
|
|
dbecc005b5 | ||
|
|
04b4d945fa | ||
|
|
74f3a213ac | ||
|
|
f3af493aba | ||
|
|
f6bcccb04c | ||
|
|
c1727623a8 | ||
|
|
757a01e876 | ||
|
|
20d8836708 | ||
|
|
775765b853 | ||
|
|
3982267e29 | ||
|
|
fc4b8f7cbc | ||
|
|
7274268f47 | ||
|
|
e1f9005cf5 | ||
|
|
16e00fde90 | ||
|
|
2418d3b95b | ||
|
|
df2d436a02 | ||
|
|
20c975e7df | ||
|
|
7d8c27fd54 | ||
|
|
b0a8c6edfa | ||
|
|
6163ece7d6 | ||
|
|
66fb3b2bde | ||
|
|
14e6fd5393 | ||
|
|
47d79bd872 | ||
|
|
6e8bad3d19 | ||
|
|
1ec634f043 | ||
|
|
2b54f68d50 | ||
|
|
410aaf6a93 | ||
|
|
60600948be | ||
|
|
3450f577d3 | ||
|
|
d55cd20639 | ||
|
|
56ecb3e538 | ||
|
|
365848b79e | ||
|
|
125a92514c | ||
|
|
0881250542 | ||
|
|
0286583d4b | ||
|
|
7cc6733df1 | ||
|
|
4447f8bffd | ||
|
|
ddcd2825a2 | ||
|
|
f24ee9be8a | ||
|
|
5194d09ec3 | ||
|
|
bc13092cd2 | ||
|
|
15b491409a | ||
|
|
92f3a237be | ||
|
|
a6ed25c7e4 | ||
|
|
45a628b4b9 | ||
|
|
b6ee709520 | ||
|
|
77bbca0a16 | ||
|
|
6ca1bd9a9c | ||
|
|
93ff6c36b4 | ||
|
|
6a3734971d | ||
|
|
f8f43eed4c | ||
|
|
8a1842a9ba | ||
|
|
2d3eed0a98 | ||
|
|
df160a10a1 | ||
|
|
a8473441ae | ||
|
|
f18b5470ec | ||
|
|
f51a6a6cb1 | ||
|
|
cc6fa1d02a | ||
|
|
0352e19e34 | ||
|
|
4f64b88f0f | ||
|
|
4348a6279c | ||
|
|
d52fb5a68f | ||
|
|
c179419feb | ||
|
|
b89019264e | ||
|
|
922ebf987b | ||
|
|
ca5504e486 | ||
|
|
369ffd2040 | ||
|
|
f4fcc93693 | ||
|
|
e8b1f69d63 | ||
|
|
6c31805981 | ||
|
|
f2d93cc2dc | ||
|
|
5a0b022188 | ||
|
|
1cb1beb09c | ||
|
|
47e67f4d37 | ||
|
|
5772f6fd2f | ||
|
|
d4a5eaa501 | ||
|
|
881e517b1a | ||
|
|
21415379af | ||
|
|
89b74816f6 | ||
|
|
f3e9ba3573 | ||
|
|
2b68037c72 | ||
|
|
71a81e7f01 | ||
|
|
f261a76b9e | ||
|
|
a94500f1c3 | ||
|
|
2c0ce8f5c5 | ||
|
|
4b4d86f413 | ||
|
|
670698fdef | ||
|
|
73f11db578 | ||
|
|
021ecda647 | ||
|
|
44475a03fb | ||
|
|
7ee6ef43c1 | ||
|
|
caaae923ad | ||
|
|
8627f26b2c | ||
|
|
f415dc38b0 | ||
|
|
3f92810240 | ||
|
|
fc00d28873 | ||
|
|
7daf2fa63e | ||
|
|
eec8d6616c | ||
|
|
9bd6cff3e3 | ||
|
|
d3c04e27fa | ||
|
|
fd0a5955ef | ||
|
|
4029c3a9aa | ||
|
|
c1edbcb00a | ||
|
|
fcc9660b64 | ||
|
|
532b29b9d1 | ||
|
|
c973328779 | ||
|
|
76d459a895 | ||
|
|
b6eabc63d1 | ||
|
|
e7aaebcd00 | ||
|
|
7d06cd5ad1 | ||
|
|
cc11f1fa2d | ||
|
|
4cd24bc09a | ||
|
|
a4dbfa69d3 | ||
|
|
d042ec591e | ||
|
|
211b9b23cd | ||
|
|
d6c16dd9de | ||
|
|
e1db9c832f | ||
|
|
05ee4f40da | ||
|
|
a0add0bdc9 | ||
|
|
a9ddef9667 | ||
|
|
d69fa7986f | ||
|
|
3ff380ce0f | ||
|
|
c0bed13cfa | ||
|
|
794efdaf06 | ||
|
|
5e54c994b7 | ||
|
|
0a1b0846ce | ||
|
|
28645ff7b0 | ||
|
|
ff433dcf76 | ||
|
|
429b5de44c | ||
|
|
0fab9b901a | ||
|
|
2e228ef52b | ||
|
|
13b80dfda6 | ||
|
|
09dea59996 | ||
|
|
4ae3d47d10 | ||
|
|
3aca25c681 | ||
|
|
0caa399e06 | ||
|
|
8fe784c8d2 | ||
|
|
ed33157945 | ||
|
|
75c3039358 | ||
|
|
d5fffcc8fa | ||
|
|
a853ce9e9d | ||
|
|
d399d1ce4c | ||
|
|
a82e1467b5 | ||
|
|
c6dd6a1f64 | ||
|
|
adc9fc84cd | ||
|
|
df268b7e6f | ||
|
|
95d0e330b0 | ||
|
|
0398bcdea3 | ||
|
|
0ed1ad86a7 | ||
|
|
521b507b18 | ||
|
|
ecc8c9b593 | ||
|
|
613ddbda81 | ||
|
|
2735d8969a | ||
|
|
7a0ed0792b | ||
|
|
1167cdd582 | ||
|
|
d8f68a93f0 | ||
|
|
368da6d075 | ||
|
|
0f2dae05bb | ||
|
|
33d5c1fe2b | ||
|
|
b97eca37ff | ||
|
|
29fcc6aafe | ||
|
|
562cde58f4 | ||
|
|
7e77dd552a | ||
|
|
e5b756b060 | ||
|
|
8c4758cc7a | ||
|
|
856de3e1e5 | ||
|
|
c31d5c703f | ||
|
|
4b3c36464e | ||
|
|
7eeb4f9179 | ||
|
|
ccc6345606 | ||
|
|
b051f30a7a | ||
|
|
c7515e040b | ||
|
|
587c631b82 | ||
|
|
28b242815b | ||
|
|
feacfefbf4 | ||
|
|
42fa49c50f | ||
|
|
f0315ccca5 | ||
|
|
c082ec50e9 | ||
|
|
39660ecc37 | ||
|
|
685c176eca | ||
|
|
77cf334f8a | ||
|
|
18922e1316 | ||
|
|
b3f35597d3 | ||
|
|
22c2cdd5d7 | ||
|
|
ecd6b13a26 | ||
|
|
f3e3209f32 | ||
|
|
c9bca752cc | ||
|
|
102b5dff15 | ||
|
|
eaf54b692e | ||
|
|
3c1adf90ef | ||
|
|
43150e7c17 | ||
|
|
4d1ef200bf | ||
|
|
afa5d01a31 | ||
|
|
52dc384447 | ||
|
|
bda728696f | ||
|
|
b24869e1a8 | ||
|
|
d32152f6dc | ||
|
|
8ee52edeee | ||
|
|
74c8fddb1a | ||
|
|
9282bd783e | ||
|
|
ce89389451 | ||
|
|
d36b39d31e | ||
|
|
987e79024f | ||
|
|
63ebd5fc7c | ||
|
|
3fab386fb2 | ||
|
|
fc02b8a38b | ||
|
|
71690f32a7 | ||
|
|
d3ba4b0f1e | ||
|
|
2a08c4c2b2 | ||
|
|
e2e9fe63cf | ||
|
|
917bbab173 | ||
|
|
a4727c8a46 | ||
|
|
323a97fb40 | ||
|
|
d7603b7fa6 | ||
|
|
95eca909c1 | ||
|
|
4912f3731d | ||
|
|
95365b647c | ||
|
|
0f5f44053f | ||
|
|
3f9774b2c2 | ||
|
|
cc462f49a3 | ||
|
|
207e20a369 | ||
|
|
1231f59b1a | ||
|
|
7f81ac76a9 | ||
|
|
48fbdbd542 | ||
|
|
7e0fcf32f9 | ||
|
|
3559395c83 | ||
|
|
0125e2aadf | ||
|
|
cc0108d48f | ||
|
|
2b58c20cc9 | ||
|
|
ef97cc84a0 | ||
|
|
b1c9f7071b | ||
|
|
87d1af5b13 | ||
|
|
694be2d111 | ||
|
|
c0869f5caf | ||
|
|
3461af38d5 | ||
|
|
1e9f8ee174 | ||
|
|
1740fd488b | ||
|
|
5ec95681f2 | ||
|
|
0676ce1d89 | ||
|
|
ab2c1048d1 | ||
|
|
66d1d47b1d | ||
|
|
96285c874c | ||
|
|
85fb985d2f | ||
|
|
44eded59b7 | ||
|
|
4ab6bd9809 | ||
|
|
c0893c052a | ||
|
|
98e224b10b | ||
|
|
70bef43ccd | ||
|
|
495dff77ca | ||
|
|
35a37ff846 | ||
|
|
9e7f843d43 | ||
|
|
b17c337979 | ||
|
|
40983afa7b | ||
|
|
b8a6fd40e3 | ||
|
|
67801f4ce7 | ||
|
|
4fd07e7688 | ||
|
|
20b00ea33b | ||
|
|
a7debe567b | ||
|
|
0f1224bb35 | ||
|
|
d913e75402 | ||
|
|
95c1d822a7 | ||
|
|
10ae17868d | ||
|
|
c0b057a48d | ||
|
|
876ce83c96 | ||
|
|
85cbbc3840 | ||
|
|
ce955e01a5 | ||
|
|
e83c9e8bb3 | ||
|
|
6ce905509f | ||
|
|
ec24536f65 | ||
|
|
c81576e311 | ||
|
|
73be187b15 | ||
|
|
85bdb48ab7 | ||
|
|
40195ab0ce | ||
|
|
0ecfa0e67e | ||
|
|
21d1e071bf | ||
|
|
f4d954c3ee | ||
|
|
426c28b961 | ||
|
|
da3e8212cf | ||
|
|
cee6f0329a | ||
|
|
37ebd06564 | ||
|
|
5ad1f1624d | ||
|
|
bbc0a1f0ea | ||
|
|
0da3142f6b | ||
|
|
16a5cb0c6f | ||
|
|
ad3024ac7f | ||
|
|
0035530f29 | ||
|
|
03acacbd7d | ||
|
|
635eccd001 | ||
|
|
6659262ae2 | ||
|
|
78e74ddaa9 | ||
|
|
78b94c9d8f | ||
|
|
fae2b935e1 | ||
|
|
5ecc2470aa | ||
|
|
0495cb786d | ||
|
|
706b79f8fc | ||
|
|
022d403f97 | ||
|
|
fe05d635e6 | ||
|
|
902c18078e | ||
|
|
6fb3baae95 | ||
|
|
6d3811f981 | ||
|
|
279919a747 | ||
|
|
2efe686c14 | ||
|
|
4c9f237c20 | ||
|
|
d755a3a892 | ||
|
|
226d704f1d | ||
|
|
b60bb0e6db | ||
|
|
0c3d748424 | ||
|
|
ab4601cc33 | ||
|
|
70e31235ed | ||
|
|
127166a0e9 | ||
|
|
48670ff566 | ||
|
|
1b3792d4a8 | ||
|
|
3cae9815c4 | ||
|
|
54dc089705 | ||
|
|
8f33ebdd3d | ||
|
|
125ecbb4bb | ||
|
|
d88a94fa7d | ||
|
|
b4eb1191fd | ||
|
|
d1e2f38e07 | ||
|
|
67384872d0 | ||
|
|
9018ad7a28 | ||
|
|
46514538b5 | ||
|
|
cf5d0d1f29 | ||
|
|
8ea4524630 | ||
|
|
2ef1f407b5 | ||
|
|
a0ed8d020f | ||
|
|
071cb35d15 | ||
|
|
2c0eb835d4 | ||
|
|
6e5fb42171 | ||
|
|
40d03c4402 | ||
|
|
e64b6fb557 | ||
|
|
8a94666e91 | ||
|
|
1bf8f43f0a | ||
|
|
835f7cff92 | ||
|
|
8c775e5d2f | ||
|
|
16fc7a192b | ||
|
|
432926f4b9 | ||
|
|
5c47bdb633 | ||
|
|
e90ba2e567 | ||
|
|
fca5d9eb20 | ||
|
|
2914f16e89 | ||
|
|
878b281ffc | ||
|
|
a92833f919 | ||
|
|
ba2213bb73 | ||
|
|
2c20561caa | ||
|
|
17541b373d | ||
|
|
c6691bf2d7 | ||
|
|
151c98d8cc | ||
|
|
21bf52c786 | ||
|
|
c42f06f727 | ||
|
|
46107635c2 |
5
.gitignore
vendored
5
.gitignore
vendored
@@ -36,6 +36,11 @@ plugins/
|
||||
resources/
|
||||
src/debug/
|
||||
src/release/
|
||||
doc/doxygen/latex
|
||||
doc/doxygen/html
|
||||
|
||||
# qt creator builds
|
||||
build-src*
|
||||
|
||||
qwt/src/debug/
|
||||
qwt/src/release/
|
||||
|
||||
59
.travis.yml
59
.travis.yml
@@ -1,12 +1,20 @@
|
||||
if: commit_message =~ /\[publish binaries\]/
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- /^[vV]\d+\.\d+(\.\d+)?(-\S*)?$/
|
||||
os:
|
||||
- osx
|
||||
- linux
|
||||
dist: xenial
|
||||
language: c++
|
||||
|
||||
language: cpp
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/Library/Caches/Homebrew
|
||||
- qwt
|
||||
- D2XX
|
||||
- site-packages
|
||||
- VLC
|
||||
|
||||
env:
|
||||
global:
|
||||
- BRANCH=master
|
||||
@@ -28,33 +36,28 @@ env:
|
||||
- secure: cc0pAJjkmFNw2bO3zVACmtyHTwINAHALrtUxi+nRD+FhOO9KxuxuuwvcKCZKfp9EUOjz5PrYWKV1ZH/zt/jMix8A4Gyue2mWX8WYih7aTmJBcJWsFNTCybnClreKBCh18kHdWWhkmhk8EMINDvlqxzJZGpcNO04gxhL9wuLLrNQ=
|
||||
- secure: em0xXIm69rMHsHXYQiizeJB7dEFBkX33PsWDHwBNrX6lFBued23eL96KJC4RVbk6A+AHFtXFATrreZ14D5JH/E/37CXhe3X2R93WqiPUSH0s7NI4fFA1BroKUNAlqO4bMqDBidtNmwMPaLTXjaOnOZyvbAG7z+QV3TKC8tOeZDU=
|
||||
- secure: VFaSERlgsjzjiDQhKw8XFvQrjdvFzHHL7V3NQg+RfELHoT6I1pAGFdl/+lRBIVOiVkbQ6XnpBA28nlf0QydPHElRZdqmh0azQV/bkUXD4ffPE8q0iSqeqhAZ+5L05K5K+Gby/y8TZE4FX6e/7trFL7oq+h9x0gq5RQO8rAcTV84=
|
||||
matrix:
|
||||
include:
|
||||
- os: osx
|
||||
osx_image: xcode10.1
|
||||
compiler: clang
|
||||
- os: linux
|
||||
compiler: gcc
|
||||
- secure: eTSJmS38EsTkI22yvDJLUrBxSyLDwd3pDRsyLQfZ3ThN0UJ9cQN2uB7aLy3OzNYadpi+Axlr46MgG0G5qGV1hHXkf+C4orGkURQWxHA7L5R/oE98TuYMO1bisZu9dJEVbmEM4cehCjbB7DExzxK4m6+oTJsWhVbIwlNh5Poq/v4=
|
||||
|
||||
jobs:
|
||||
include:
|
||||
- os: osx
|
||||
osx_image: xcode11.3
|
||||
compiler: clang
|
||||
- os: linux
|
||||
dist: bionic
|
||||
compiler: gcc
|
||||
|
||||
before_install:
|
||||
- travis/$TRAVIS_OS_NAME/before_install.sh
|
||||
|
||||
before_script:
|
||||
- travis/$TRAVIS_OS_NAME/before_script.sh
|
||||
|
||||
script:
|
||||
- travis/$TRAVIS_OS_NAME/script.sh
|
||||
after_success:
|
||||
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then
|
||||
export FINAL_NAME=dev-prerelease-branch-master-build-${TRAVIS_BUILD_NUMBER}.dmg;
|
||||
else
|
||||
export FINAL_NAME=dev-prerelease-branch-master-build-${TRAVIS_BUILD_NUMBER}.AppImage;
|
||||
fi
|
||||
- travis/$TRAVIS_OS_NAME/after_success.sh
|
||||
deploy:
|
||||
provider: releases
|
||||
api_key:
|
||||
secure: KlfkRM8oGP02y5LhbdxetnhqUG3YzVylvyhT8BTYjdoJtkJr7YXYpdhj9byZ9aiy1gSWI/g7A1X6/P8/McqRtgt4dEYr4Zg8QO7Y7QdTpgNQEwu8ZrkyyG/7b/rSkfFHDjrOAHslLVXuBNwWgi8YW1aTn0rY2AqDbOri7u6tt9Q=
|
||||
file: src/$FINAL_NAME
|
||||
skip_cleanup: true
|
||||
on:
|
||||
tags: true
|
||||
repo: GoldenCheetah/GoldenCheetah
|
||||
|
||||
before_cache:
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew cleanup; fi
|
||||
|
||||
after_success:
|
||||
- travis/$TRAVIS_OS_NAME/after_success.sh
|
||||
|
||||
319
INSTALL-LINUX
319
INSTALL-LINUX
@@ -4,112 +4,79 @@
|
||||
|
||||
Mark Liversedge
|
||||
John Ehrlinger
|
||||
Ale Martinez
|
||||
|
||||
Jan 2015
|
||||
Version 1.2
|
||||
Mar 2021
|
||||
Version 3.6
|
||||
|
||||
A walkthrough of building GoldenCheetah from scratch on Ubuntu linux. This walkthrough
|
||||
should be largely the same for any Linux distro.
|
||||
A walkthrough of building GoldenCheetah from scratch on Ubuntu linux 18.04
|
||||
This walkthrough should be largely the same for any Debian derivative Linux
|
||||
distro, and very similar for others using their correspoing package manager.
|
||||
|
||||
CONTENTS
|
||||
|
||||
1. BASIC INSTALLATION WITH MANDATORY DEPENDENCIES
|
||||
- QT
|
||||
- git
|
||||
- flex
|
||||
- bison
|
||||
- QT
|
||||
- OpenGL
|
||||
- gsl
|
||||
|
||||
2. ADDING OPTIONAL DEPENDENCIES WHEN BUILDING VERSION 2
|
||||
2. ADDING OPTIONAL DEPENDENCIES
|
||||
- FTDI D2XX
|
||||
- SRMIO
|
||||
- liboauth
|
||||
- libkml
|
||||
|
||||
3. ADDING OPTIONAL DEPENDENCIES WHEN BUILDING VERSION 3
|
||||
- checking out the release 3 branch & building with MANDATORY dependencies
|
||||
- flex
|
||||
- bison
|
||||
- libical - Diary window and CalDAV support (google/mobileme calendar integration)
|
||||
- libvlc - Video playback in training mode
|
||||
- libical - Diary window and CalDAV support (external calendar integration)
|
||||
- libusb - If you want support for using USB2 sticks in Train View
|
||||
- R - If you want R charts
|
||||
- Python - If you want Python charts, scripts and data processors
|
||||
|
||||
1. BASIC INSTALLATION WITH MANDATORY DEPENDENCIES
|
||||
=================================================
|
||||
|
||||
Installed Linux distribution of choice on platforms i386 or amd-64 (currently Debian-based distributions and Arch-based distributions are covered). You will not need to do this if you
|
||||
already have a Linux distribution installed. Left this step in to highlight the
|
||||
Linux distribution the commands below were executed on.
|
||||
Install the Linux distribution of choice on amd64 platform (Ubuntu 18.04 is used
|
||||
for this document). You will not need to do this if you already have a Linux
|
||||
distribution installed. Left this step in to highlight the Linux distribution
|
||||
the commands below were executed on.
|
||||
|
||||
login and open a terminal to get a shell prompt
|
||||
|
||||
Download MANDATORY DEPENDENCIES (browser)
|
||||
-----------------------------------------
|
||||
Install Qt
|
||||
----------
|
||||
Download and install the Qt SDK from http://qt-project.org/
|
||||
Once that is completed test qmake is ok with: qmake --version (should report 4.9.8 or higher)
|
||||
You can use a browser to download and run the interactive installer, be sure to
|
||||
select version 5.14.2 or higher Qt 5 version, including at least the following modules:
|
||||
- Desktop gcc 64-bit
|
||||
- Qt Charts
|
||||
- Qt WebEngine
|
||||
Once this step is completed add the bin directory to PATH and test qmake is ok:
|
||||
$ qmake --version
|
||||
|
||||
|
||||
DEBIAN-BASED DISTRIBUTION INSTRUCTIONS
|
||||
--------------------------------------
|
||||
|
||||
Install git with:
|
||||
Install git
|
||||
-----------
|
||||
$ sudo apt-get install git
|
||||
Said Y to prompt about all git files installed (git-gui et al)
|
||||
|
||||
Install FLEX and BISON
|
||||
----------------------
|
||||
|
||||
You will need flex v2.5.9 or later
|
||||
$ sudo apt-get install bison
|
||||
$ sudo apt-get install flex
|
||||
|
||||
Install Mesa OpenGL utility library
|
||||
-----------------------------------
|
||||
sudo apt-get install libglu1-mesa-dev
|
||||
|
||||
ARCH-BASED DISTRIBUTION INSTRUCTIONS
|
||||
------------------------------------
|
||||
Install GSL development libraries
|
||||
---------------------------------
|
||||
sudo apt-get -qq install libgsl-dev
|
||||
|
||||
Install git:
|
||||
$ sudo pacman -S git
|
||||
|
||||
INSTALL FLEX and BISON
|
||||
----------------------
|
||||
$ sudo pacman -S flex bison
|
||||
|
||||
NEXT STEPS
|
||||
----------
|
||||
$ vi gcconfig.pri
|
||||
|
||||
Ensure you have the following lines (which are now also in gcconfig.pri.in which has
|
||||
been updated to reflect the new dependencies in version 3)
|
||||
|
||||
QMAKE_LEX = flex
|
||||
QMAKE_YACC = bison
|
||||
win32 {
|
||||
QMAKE_YACC = bison --file-prefix=y -t
|
||||
QMAKE_MOVE = cmd /c move
|
||||
QMAKE_DEL_FILE = rm -f
|
||||
}
|
||||
|
||||
Build!
|
||||
------
|
||||
$ make clean
|
||||
$ qmake
|
||||
$ make
|
||||
|
||||
To compile translation you need QT tool - lrelease
|
||||
If it is not found using he defaults in src/src.pro then set the full path and filename in gcconfig.pri
|
||||
QMAKE_LRELEASE = /usr/bin/lrelease
|
||||
|
||||
When build first time you get number of error messages on .qm files missing:
|
||||
"RCC: Error in 'Resources/application.qrc': Cannot find file 'translations/gc_fr.qm'"
|
||||
You can ignore these messages for your build. The .qm files will be created during the
|
||||
build at a later point in time via the "lrelease" command you configured in gcconfig.pri)
|
||||
|
||||
If your QT build includes its own local compress libs then you should comment the line below in gcconfig.pri,
|
||||
otherwise you will need to have the compress libraries installed separately.
|
||||
#LIBZ_INCLUDE =
|
||||
#LIBZ_LIBS = -lz
|
||||
|
||||
You will now have a release3 binary but with none of the release3 dependencies compiled in.
|
||||
Get latest GOLDEN CHEETAH source files
|
||||
--------------------------------------
|
||||
$ mkdir -p ~/Projects/Live
|
||||
$ cd ~/Projects/Live
|
||||
$ mkdir -p ~/Projects
|
||||
$ cd ~/Projects
|
||||
$ git clone git://github.com/GoldenCheetah/GoldenCheetah.git
|
||||
$ cd GoldenCheetah
|
||||
|
||||
@@ -121,11 +88,34 @@ $ cd ../src
|
||||
$ cp gcconfig.pri.in gcconfig.pri
|
||||
$ vi gcconfig.pri
|
||||
|
||||
Comment out the D2XX_INCLUDE and SRMIO_INSTALL lines for now (put # in first character of the line
|
||||
to comment out), we will install that in a moment, if we need to.
|
||||
Uncomment below and configure the location of the GNU scientific library, this is a mandatory dependency.
|
||||
|
||||
If you are building for your local host you may find that you get better performance if
|
||||
compiling with gcc -O3 (tree vectorization can have a significat impact) [or -Ofast]
|
||||
#GSL_INCLUDES = /usr/include
|
||||
#GSL_LIBS = -lgsl -lgslcblas -lm
|
||||
|
||||
Ensure you have the following lines (which are now also in gcconfig.pri.in which has
|
||||
been updated to reflect the new dependencies in version 3.6)
|
||||
|
||||
QMAKE_LEX = flex
|
||||
QMAKE_YACC = bison
|
||||
win32 {
|
||||
QMAKE_YACC = bison --file-prefix=y -t
|
||||
QMAKE_MOVE = cmd /c move
|
||||
QMAKE_DEL_FILE = rm -f
|
||||
}
|
||||
|
||||
To compile translation you need the QT tool lrelease
|
||||
If it is not found using the defaults in src/src.pro then set the full path and
|
||||
filename in gcconfig.pri, s.t.
|
||||
QMAKE_LRELEASE = /usr/bin/lrelease
|
||||
|
||||
If your QT build doesn't include its own local compress libs then you should uncomment the lines below,
|
||||
and add the library path to LIBZ_INCLUDE =, you will need to have the compress libraries installed separately.
|
||||
#LIBZ_INCLUDE =
|
||||
#LIBZ_LIBS = -lz
|
||||
|
||||
compiling with gcc -O3 (tree vectorization can have a significat impact)
|
||||
[or -Ofast]
|
||||
|
||||
If so you might like to uncomment:
|
||||
|
||||
@@ -136,32 +126,43 @@ Save and exit
|
||||
$ cd ..
|
||||
|
||||
BUILD WITH BASIC CONFIGURATION
|
||||
------------------------------
|
||||
$ qmake -recursive
|
||||
$ make
|
||||
|
||||
Congratulations you have now build a basic GoldenCheetah and can run this safely. See below for
|
||||
optional dependencies you can install to support other features.
|
||||
When build first time you get number of error messages on .qm files missing:
|
||||
"RCC: Error in 'Resources/application.qrc': Cannot find file 'translations/gc_fr.qm'"
|
||||
You can ignore these messages for your build. The .qm files will be created
|
||||
during the build at a later point in time via the "lrelease" command you
|
||||
configured in gcconfig.pri
|
||||
|
||||
ADDING OPTIONAL DEPENDENCIES WHEN BUILDING VERSION 2
|
||||
====================================================
|
||||
Congratulations you have now build a basic GoldenCheetah and can run this
|
||||
safely from src folder.
|
||||
|
||||
See below for optional dependencies you can install to support other features.
|
||||
|
||||
|
||||
2. ADDING OPTIONAL DEPENDENCIES
|
||||
===============================
|
||||
|
||||
D2XX - For Powertap downloads via USB
|
||||
-------------------------------------
|
||||
|
||||
Download the FTDI drivers from http://www.ftdichip.com/Drivers/D2XX.htm (e.g. I used Linux
|
||||
64-bit drivers from http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx1.0.4.tar.gz)
|
||||
Download the FTDI drivers from http://www.ftdichip.com/Drivers/D2XX.htm and
|
||||
extract:
|
||||
|
||||
Extract into your home directory (I put mine into ~/Projects/ with archive manager which
|
||||
created a sub-directory ~/Projects/libftd2xx1.0.4
|
||||
$ cd ~/Projects
|
||||
$ wget http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx-x86_64-1.3.6.tgz
|
||||
$ tar xf libftd2xx-x86_64-1.3.6.tgz
|
||||
|
||||
$ cd src
|
||||
$ cd ~/Projects/GoldenCheetah/src
|
||||
$ vi gcconfig.pri
|
||||
|
||||
Uncomment the D2XX_INCLUDE entry and make it match (my home is /home/markl)
|
||||
D2XX_INCLUDE = /home/markl/libftd2xx1.0.4
|
||||
D2XX_INCLUDE = /home/markl/Projects/libftd2xx-x86_64-1.3.6
|
||||
|
||||
Make clean is needed if you have previouslt built, since source files examine #defines before
|
||||
including this feature. You can skip it if you know why ;)
|
||||
Make clean is needed if you have previouslt built, since source files examine
|
||||
#defines before including this feature. You can skip it if you know why ;)
|
||||
$ make clean
|
||||
$ qmake
|
||||
$ make
|
||||
@@ -186,20 +187,20 @@ $ make
|
||||
$ sudo make install
|
||||
|
||||
Lets go config GC and build with SRMIO
|
||||
$ cd ~/Projects/Live/GoldenCheetah/src
|
||||
$ cd ~/Projects/GoldenCheetah/src
|
||||
$ vi gcconfig.pri
|
||||
|
||||
Uncomment the SRMIO_INSTALL and replace with the target used from srmio install:
|
||||
SRMIO_INSTALL = /usr/local/
|
||||
|
||||
At the bottom of gcconfig.pri you will see the include directory should reference from
|
||||
the base install location (/usr/local) make sure it says:
|
||||
At the bottom of gcconfig.pri you will see the include directory should
|
||||
reference from the base install location (/usr/local) make sure it says:
|
||||
|
||||
SRMIO_INCLUDE = $${SRMIO_INSTALL}/include
|
||||
SRMIO_LIB = $${SRMIO_INSTALL}/lib/libsrmio.a
|
||||
|
||||
Make clean is needed if you have previouslt built, since source files examine #defines before
|
||||
including this feature. You can skip it if you know why ;)
|
||||
Make clean is needed if you have previouslt built, since source files examine
|
||||
#defines before including this feature. You can skip it if you know why ;)
|
||||
$ make clean
|
||||
$ qmake
|
||||
$ make
|
||||
@@ -209,9 +210,7 @@ You now have SRM support built in.
|
||||
LIBKML - For export to Google Earth
|
||||
-----------------------------------
|
||||
|
||||
You will need Google Earth 5.2 or later and therefore libkml that supports this. Unfortunately at the time of writing
|
||||
the officially packaged libkml is too old, so you will need to install from source, which means you will need to have
|
||||
subversion installed and expat. You may be able to use the currently packaged libkml with
|
||||
You will need Google Earth 5.2 or later and therefore libkml that supports this.
|
||||
|
||||
$ sudo apt-get install libkml-dev
|
||||
|
||||
@@ -220,7 +219,8 @@ if this does not work you will need to build from source:
|
||||
$ sudo apt-get install subversion
|
||||
$ sudo apt-get install expat libexpat1 libexpat1-dev
|
||||
|
||||
Once svn is installed you can grab the libkml source and configure build etc:
|
||||
Once svn is installed you can grab the libkml source, configure, build and
|
||||
install:
|
||||
$ cd ~/Projects
|
||||
$ svn checkout http://libkml.googlecode.com/svn/trunk/ libkml
|
||||
$ cd libkml
|
||||
@@ -237,55 +237,32 @@ if this does not work you will need to build from source:
|
||||
- examples/{engine,gpx,gx,hellonet,helloworld,regionator,xsd}/Makefile
|
||||
- and look for the flag -pedantic and remove it. I got this on Linux 64bit builds ymmv.
|
||||
|
||||
Once libkml is installed and built:
|
||||
Once libkml is installed:
|
||||
|
||||
$ cd ~/Projects/Live/GoldenCheetah/src
|
||||
$ cd ~/Projects/GoldenCheetah/src
|
||||
$ vi gcconfig.pri
|
||||
|
||||
Ensure KML_INSTALL=/usr/local
|
||||
|
||||
Make clean is needed if you have previously built, since source files examine #defines before
|
||||
including this feature. You can skip it if you know why ;)
|
||||
Make clean is needed if you have previously built, since source files examine
|
||||
#defines before including this feature. You can skip it if you know why ;)
|
||||
$ make clean
|
||||
$ qmake
|
||||
$ make
|
||||
|
||||
You can now export rides to Google Earth kml format.
|
||||
|
||||
ADDING OPTIONAL DEPENDENCIES WHEN BUILDING VERSION 3
|
||||
====================================================
|
||||
|
||||
|
||||
NOTE: When you run version 3 it will refresh ride metrics and CP files -- this only occurs the
|
||||
first time it runs (and will refresh only rides that change after that). I find it is best
|
||||
to import ride files once your build where you want it. i.e. don't import until you have
|
||||
got all your dependencies sorted.
|
||||
|
||||
NOTE: To reduce the dependencies on 'dormant' code there are a number of new pieces of source
|
||||
that are included in the release3 tree. Notably; qtsoap from qt-solutions, since they
|
||||
work but are likely to be archived and deprecated. If and when that happens we may well
|
||||
adopt whatever classes Trolltech introduce.
|
||||
|
||||
|
||||
LIBICAL - Diary integration with Google or MobileMe calendars
|
||||
-------------------------------------------------------------
|
||||
|
||||
$ cd ~/Projects/Live/GoldenCheetah/src
|
||||
|
||||
$ sudo apt-get install libical-dev
|
||||
|
||||
$ cd ~/Projects/GoldenCheetah/src
|
||||
$ vi gcconfig.pri
|
||||
|
||||
ICAL_INSTALL=/usr/include
|
||||
ICAL_LIBS=-lical
|
||||
|
||||
Since the src.pro wants ICAL installed in a different place we need to hack it, *** this will
|
||||
be fixed shortly ***
|
||||
|
||||
$ vi src.pro
|
||||
|
||||
Comment out the ICAL_LIBS entry:
|
||||
|
||||
#ICAL_LIBS = $${ICAL_INSTALL}/lib/libical.a
|
||||
ICAL_INSTALL = /usr
|
||||
ICAL_INCLUDE = /usr/include
|
||||
ICAL_LIBS = -lical
|
||||
|
||||
$ make clean
|
||||
$ qmake
|
||||
@@ -293,21 +270,89 @@ $ make
|
||||
|
||||
You should now have diary functions.
|
||||
|
||||
NOTE: That upload to MobileMe and Google requires a functioning https lib in QT. Depending
|
||||
upon the version installed this might not be the case and will need to be built and
|
||||
configured -- this is beyond the scope of this walkthough. Sorry.
|
||||
LIBVLC - Video playback in Realtime
|
||||
-----------------------------------
|
||||
|
||||
LIBVLC - Video playback in Realtime (Experimental)
|
||||
--------------------------------------------------
|
||||
You will need libvlc 3.0.8 or higher for better performance:
|
||||
|
||||
You will need libvlc 1.1.9 or higher (1.1.8 is ok but will segv on exit)
|
||||
$ sudo apt-get install libvlc-dev
|
||||
sudo add-apt-repository ppa:jonathonf/vlc-3
|
||||
sudo add-apt-repository ppa:jonathonf/ffmpeg-4
|
||||
sudo apt-get update
|
||||
sudo apt-get install vlc libvlc-dev libvlccore-dev
|
||||
|
||||
$ cd ~/Projects/GoldenCheetah/src
|
||||
$ vi gcconfig.pri
|
||||
|
||||
Comment out VLC_INSTALL and it should read:
|
||||
|
||||
VLC_INSTALL = /usr/include/vlc/
|
||||
VLC_INSTALL = /usr
|
||||
|
||||
$ make clean
|
||||
$ qmake
|
||||
$ make
|
||||
|
||||
LIBUSB - for using USB2 sticks in Train View on Linux or Windows
|
||||
----------------------------------------------------------------
|
||||
$ sudo apt-get install libusb-1.0-0-dev libudev-dev
|
||||
|
||||
$ cd ~/Projects/GoldenCheetah/src
|
||||
$ vi gcconfig.pri
|
||||
|
||||
Uncomment or add the following lines:
|
||||
|
||||
LIBUSB_USE_V_1 = true # don't use on Windows
|
||||
LIBUSB_INSTALL = /usr/local
|
||||
|
||||
$ make clean
|
||||
$ qmake
|
||||
$ make
|
||||
|
||||
R Embedding
|
||||
-----------
|
||||
|
||||
Install R 4.0
|
||||
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
|
||||
sudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/"
|
||||
sudo apt-get update
|
||||
sudo apt-get install r-base-dev
|
||||
R --version
|
||||
|
||||
$ cd ~/Projects/GoldenCheetah/src
|
||||
$ vi gcconfig.pri
|
||||
|
||||
Uncomment or add the following line:
|
||||
DEFINES += GC_WANT_R
|
||||
|
||||
$ make clean
|
||||
$ qmake
|
||||
$ make
|
||||
|
||||
Python Embedding
|
||||
----------------
|
||||
|
||||
Install Python 3.7
|
||||
|
||||
sudo add-apt-repository ppa:deadsnakes/ppa
|
||||
sudo apt-get update
|
||||
sudo apt-get install python3.7-dev
|
||||
python3.7 --version
|
||||
|
||||
Install SIP 4.19.8:
|
||||
cd ~/Projects
|
||||
wget https://sourceforge.net/projects/pyqt/files/sip/sip-4.19.8/sip-4.19.8.tar.gz
|
||||
tar xf sip-4.19.8.tar.gz
|
||||
cd sip-4.19.8
|
||||
python3.7 configure.py
|
||||
make
|
||||
sudo make install
|
||||
|
||||
$ cd ~/Projects/GoldenCheetah/src
|
||||
$ vi gcconfig.pri
|
||||
|
||||
Uncomment or add the following lines:
|
||||
DEFINES += GC_WANT_PYTHON
|
||||
PYTHONINCLUDES = -I/usr/include/python3.7/
|
||||
PYTHONLIBS = -L/usr/lib/python3.7/config-3.7m-x86_64-linux-gnu -lpython3.7m
|
||||
|
||||
$ make clean
|
||||
$ qmake
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
Update Note: to build GoldenCheetah v3.6 we are using the Homebrew Package
|
||||
Manager to install dependencies, including Qt and GSL, on Travis-ci
|
||||
macOS High Sierra build environment.
|
||||
You can check the travis/osx folder for the complete and updated build scripts,
|
||||
the minimum Qt version known to work is 5.13 with Qt WebEngine and Qt Charts.
|
||||
GSL - GNU Scientific Library is a mandatory dependency starting with v3.6
|
||||
|
||||
Ale Martinez - May, 2020
|
||||
|
||||
+++++++++++++++++++++++
|
||||
MAC OSX BUILD WALKTHROUGH
|
||||
+++++++++++++++++++++++
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
Update Note: to build GoldenCheetah v3.6 we are using Microsoft Visual C++ 2017,
|
||||
included in Microsoft Visual Studio 2019, with pre-installed Qt and GSL
|
||||
insalled with vcpkg, on AppVeyor continuous integration platform.
|
||||
You can check the appveyor.yml for the complete and updated build script,
|
||||
the minimum Qt version known to work is 5.13 with Qt WebEngine and Qt Charts.
|
||||
GSL - GNU Scientific Library is a mandatory dependency starting with v3.6
|
||||
|
||||
Ale Martinez - May, 2020
|
||||
+++++++++++++++++++++++
|
||||
WIN32 BUILD WALKTHROUGH
|
||||
+++++++++++++++++++++++
|
||||
@@ -7,6 +14,7 @@
|
||||
|
||||
February 2017
|
||||
|
||||
|
||||
This instruction will guide you through a standard build of GoldenCheetah (without external
|
||||
dependencies or API based services included).
|
||||
|
||||
@@ -199,9 +207,3 @@ to contribute is to provide a pull-request.
|
||||
|
||||
Cheers.
|
||||
Joern
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1 +1,10 @@
|
||||
Issue tracker is **only** for Bugs and Features, before to open a new issue please read the Contributing document (link at the right) and use the forums if you need help.
|
||||
Issue tracker is **only** for Bugs and Features, please don't open issues for questions or technical support. Before to open a new issue please read the contributing guidelines (link below).
|
||||
|
||||
If you have questions, please read the FAQs and User's/Developer's Guide:
|
||||
* FAQs - https://github.com/GoldenCheetah/GoldenCheetah/wiki/FAQ
|
||||
* User's Guide - https://github.com/GoldenCheetah/GoldenCheetah/wiki/UG_Main-Page_Users-Guide
|
||||
* Developer's Guide - https://github.com/GoldenCheetah/GoldenCheetah/wiki/Developers-guide
|
||||
|
||||
If you need help or technical support please use the forums:
|
||||
* Users - https://groups.google.com/forum/#!forum/golden-cheetah-users
|
||||
* Developers - https://groups.google.com/forum/#!forum/golden-cheetah-developers
|
||||
|
||||
19
README.md
19
README.md
@@ -4,18 +4,11 @@
|
||||
|
||||
## About
|
||||
|
||||
GoldenCheetah is an open-source data analysis tool primarily written in C++
|
||||
with Qt for cyclists and triathletes
|
||||
with support for training as well.
|
||||
|
||||
GoldenCheetah can connect with indoor trainers and cycling equipment such
|
||||
as cycling computers and power meters to import data.
|
||||
|
||||
In addition, GoldenCheetah can connect to cloud services.
|
||||
|
||||
It can then manipulate and view the data, as well as analyze it.
|
||||
GoldenCheetah is a desktop application for cyclists and triathletes and coaches, providing a rich set of tools and models to analyse, track and predict performance, optimise aerodynamics and train indoors.
|
||||
|
||||
GoldenCheetah integrates with most popular cloud services like Strava and Todays Plan, imports data from bike computers, imports downloads from any website like TrainingPeaks and Garmin and will also connect to smart trainers using ANT+ and Bluetooth.
|
||||
|
||||
GoldenCheetah is free for everyone to use and modify, released under the GPL v2 open source license with pre-built binaries for Mac, Windows and Linux.
|
||||
|
||||
## Installing
|
||||
|
||||
@@ -29,12 +22,10 @@ INSTALL-LINUX For building on Linux
|
||||
INSTALL-MAC For building on Apple OS X
|
||||
|
||||
|
||||
OSX: [](https://travis-ci.org/GoldenCheetah/GoldenCheetah)
|
||||
macOS and Linux: [](https://app.travis-ci.com/GoldenCheetah/GoldenCheetah)
|
||||
|
||||
Windows: [](https://ci.appveyor.com/project/Joern-R/goldencheetah-knhd8)
|
||||
|
||||
[](https://scan.coverity.com/projects/goldencheetah-goldencheetah)
|
||||
|
||||
Alternatively, official builds are available from http://www.goldencheetah.org
|
||||
|
||||
whilst the latest developer builds are available from https://github.com/GoldenCheetah/GoldenCheetah/releases
|
||||
Official release builds, snapshots and development builds are all available from http://www.goldencheetah.org
|
||||
|
||||
218
appveyor.yml
218
appveyor.yml
@@ -1,32 +1,216 @@
|
||||
version: ci.{build}
|
||||
image: Visual Studio 2015
|
||||
image: Visual Studio 2019
|
||||
clone_depth: 1
|
||||
|
||||
environment:
|
||||
GC_GOOGLE_CALENDAR_CLIENT_SECRET:
|
||||
secure: hwjHTrSAMEbKd9PA+5x/zI4x5Uk4KQm1hdfZzkwiu8k=
|
||||
GC_GOOGLE_DRIVE_CLIENT_ID:
|
||||
secure: mNqG+pqpMl21ZFVvAMKvhm2rfOdv42fFpnLwfrvX5QqpWVcHEeBuUFeJeUAZfTR0GQGfWfPOEmhb9CG0W1ZJ05TIyb+kTLrWF7iijCiVR6s=
|
||||
GC_GOOGLE_DRIVE_CLIENT_SECRET:
|
||||
secure: T+BaB/L7x4dPPf592e0kfw4sTlAslUXl10irJqiUjpY=
|
||||
GC_GOOGLE_DRIVE_API_KEY:
|
||||
secure: oxTAhK/kiLUsXdYvITAgzSqeB5FRcL+XANFuAYpoW5P/xBb7XaLbNnL2gyrmzQeG
|
||||
GC_CLOUD_OPENDATA_SECRET:
|
||||
secure: 6fPhBiHKvJeOMqXdHGqpkPS+NpUDMczEXjedx8GcjbHr82ISX+gwSuXfOUDLq/S9
|
||||
GC_WITHINGS_CONSUMER_SECRET:
|
||||
secure: 86xAkdoQB8mLXq964/lGCp3ElTSF4k3a27R3UUXt3618guWLyBfsEK5Q0+XSOI3Q38w80CTpmNdwejoISv8Ilg==
|
||||
GC_NOKIA_CLIENT_SECRET:
|
||||
secure: pvPWraDplrKeRNamt5MKga8fzDmI2+zgFx+y3lsQE6gmBadZU2xkTIc/xCaP7UPv2erNCmKivfMOh2NIcRmqvIHynDoifNVy2P61KyG5v3E=
|
||||
GC_DROPBOX_CLIENT_SECRET:
|
||||
secure: 7pCVnVEKKmSU4SZN6IFqUw==
|
||||
GC_STRAVA_CLIENT_SECRET:
|
||||
secure: n3cMS1yy709xhSnTeWABMsoAIkJzy5euh3Pw4ehv0BzszJKoWkypF0cyW8RXSm3M
|
||||
GC_TODAYSPLAN_CLIENT_SECRET:
|
||||
secure: 7PnFB8cfahFT6LyP64eB7N1vkbwVaULpB2ORmEkn+J75zNB1xxGClFNXSHZ7kXhB
|
||||
GC_CYCLINGANALYTICS_CLIENT_SECRET:
|
||||
secure: UY+m3YypNNLUzKyGdrLw8xdCvxuQWRZi9EHS3j1ubLC4qyRL7iEVW6ubumfdh6gT
|
||||
GC_CLOUD_DB_BASIC_AUTH:
|
||||
secure: OEBetrOnXjsY7wN8hYqmMj6482oDORmAmCq8PI7mfnfiWE6Z4jB676JvgdNlP98q
|
||||
GC_CLOUD_DB_APP_NAME:
|
||||
secure: bpkyuw/BsJw0OrpuBqQwZ46CHbhkbmcjcMttVtfJoZU=
|
||||
GC_POLARFLOW_CLIENT_SECRET:
|
||||
secure: h2JdlC1i4QOmwpkz+Xxbrw==
|
||||
GC_SPORTTRACKS_CLIENT_SECRET:
|
||||
secure: n6a8nJgqMyg+VsVeoIIR8TFzxyDFVi2w/ggetQk5agY=
|
||||
GC_RWGPS_API_KEY:
|
||||
secure: uUtCyF5ByZ1VYJOztUngIA==
|
||||
|
||||
init:
|
||||
# Setup QT 5.9 - 64Bit
|
||||
|
||||
- set QTDIR=C:\Qt\5.9\msvc2015_64
|
||||
# Setup QT 5.14 - 64Bit
|
||||
- set QTDIR=C:\Qt\5.14\msvc2017_64
|
||||
- set PATH=%QTDIR%\bin;%PATH%
|
||||
- qmake --version
|
||||
|
||||
# Setup MSVC - VS 2015
|
||||
# Setup MSVC - VS 2019
|
||||
- call c:\"Program Files (x86)"\"Microsoft Visual Studio"\2019\Community\VC\Auxiliary\Build\vcvarsall.bat amd64
|
||||
|
||||
- CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
|
||||
# Setup NSIS
|
||||
- set PATH=%PATH%;C:\"Program Files (x86)"\NSIS
|
||||
|
||||
# Get the libraries
|
||||
|
||||
- ps: Start-FileDownload 'https://github.com/Joern-R/gc-ci-libs/releases/download/0.0.2/gc-ci-libs.zip' -Filename 'c:/gc-ci-libs.zip'
|
||||
- 7z x c:/gc-ci-libs.zip -oC:\libs
|
||||
cache:
|
||||
- gc-ci-libs.zip -> appveyor.yml
|
||||
- jom_1_1_3.zip
|
||||
- sip-4.19.8.zip
|
||||
- C:\R
|
||||
- C:\Python -> src\Python\requirements.txt
|
||||
- c:\tools\vcpkg\installed\
|
||||
- qwt
|
||||
|
||||
install:
|
||||
# choco install winflexbison
|
||||
# Get the libraries
|
||||
- if not exist gc-ci-libs.zip appveyor DownloadFile "https://github.com/GoldenCheetah/WindowsSDK/releases/download/v0.1.1/gc-ci-libs.zip"
|
||||
- 7z x -y gc-ci-libs.zip -oC:\libs
|
||||
# GSL
|
||||
- vcpkg install gsl:x64-windows
|
||||
|
||||
# Get config
|
||||
- copy qwt\qwtconfig.pri.in qwt\qwtconfig.pri
|
||||
- copy c:\libs\gcconfig64-Release.appveyor.pri src\gcconfig.pri
|
||||
|
||||
# Get jom
|
||||
- if not exist jom_1_1_3.zip appveyor DownloadFile "https://download.qt.io/official_releases/jom/jom_1_1_3.zip"
|
||||
- 7z x -y jom_1_1_3.zip -oc:\jom\
|
||||
- set PATH=%PATH%;c:\jom\;
|
||||
|
||||
# Get R and add to config
|
||||
- ps: >-
|
||||
if (-not (Test-Path 'C:\R')) {
|
||||
$rurl = $(ConvertFrom-JSON $(Invoke-WebRequest https://rversions.r-pkg.org/r-release-win).Content).URL
|
||||
Start-FileDownload $rurl "R-win.exe"
|
||||
Start-Process -FilePath .\R-win.exe -ArgumentList "/VERYSILENT /DIR=C:\R" -NoNewWindow -Wait
|
||||
}
|
||||
- set PATH=%PATH%;c:\R\bin\;
|
||||
- R --version
|
||||
- echo DEFINES+=GC_WANT_R >> src\gcconfig.pri
|
||||
|
||||
# Get Python embeddable and install packages
|
||||
- ps: >-
|
||||
if (-not (Test-Path 'C:\Python')) {
|
||||
Start-FileDownload "https://www.python.org/ftp/python/3.7.9/python-3.7.9-embed-amd64.zip" Python.zip
|
||||
7z x Python.zip -oC:\Python\
|
||||
echo python37.zip . '' 'import site' | Out-File C:\Python\python37._pth -Encoding ascii
|
||||
mkdir C:\Python\lib\site-packages
|
||||
c:\python37-x64\python -m pip install --upgrade pip
|
||||
c:\python37-x64\python -m pip install -r src\Python\requirements.txt -t C:\Python\lib\site-packages
|
||||
}
|
||||
|
||||
# Get SIP and and install on Python
|
||||
- c:\python37-x64\python --version
|
||||
- if not exist sip-4.19.8.zip appveyor DownloadFile "https://sourceforge.net/projects/pyqt/files/sip/sip-4.19.8/sip-4.19.8.zip"
|
||||
- 7z x sip-4.19.8.zip
|
||||
- cd sip-4.19.8
|
||||
- c:\python37-x64\python configure.py
|
||||
- jom -j4
|
||||
- nmake install
|
||||
- cd ..
|
||||
|
||||
# Add Python (avoiding colision between GC Context.h and Python context.h)
|
||||
- echo DEFINES+=GC_WANT_PYTHON >> src\gcconfig.pri
|
||||
- echo PYTHONINCLUDES=-ICore -I\"c:\python37-x64\include\" >> src\gcconfig.pri
|
||||
- echo PYTHONLIBS=-L\"c:\python37-x64\libs\" -lpython37 >> src\gcconfig.pri
|
||||
|
||||
# GSL
|
||||
- echo GSL_INCLUDES=c:\tools\vcpkg\installed\x64-windows\include >> src\gcconfig.pri
|
||||
- echo GSL_LIBS=-Lc:\tools\vcpkg\installed\x64-windows\lib -lgsl -lgslcblas >> src\gcconfig.pri
|
||||
|
||||
before_build:
|
||||
# Define GC version string, only for tagged builds
|
||||
- if %APPVEYOR_REPO_TAG%==true echo DEFINES+=GC_VERSION=VERSION_STRING >> src\gcconfig.pri
|
||||
|
||||
# Enable CloudDB
|
||||
- echo CloudDB=active >> src\gcconfig.pri
|
||||
|
||||
# Add Train Robot
|
||||
- echo DEFINES+=GC_WANT_ROBOT >> src\gcconfig.pri
|
||||
|
||||
# Add debug console
|
||||
#- echo CONFIG+=console >> src\gcconfig.pri
|
||||
|
||||
# Patch Secrets.h
|
||||
- ps: (Get-Content src\Core\Secrets.h) -replace '__GC_GOOGLE_CALENDAR_CLIENT_SECRET__', $env:GC_GOOGLE_CALENDAR_CLIENT_SECRET | Set-Content src\Core\Secrets.h
|
||||
- ps: (Get-Content src\Core\Secrets.h) -replace '__GC_GOOGLE_DRIVE_CLIENT_ID__', $env:GC_GOOGLE_DRIVE_CLIENT_ID | Set-Content src\Core\Secrets.h
|
||||
- ps: (Get-Content src\Core\Secrets.h) -replace '__GC_GOOGLE_DRIVE_CLIENT_SECRET__', $env:GC_GOOGLE_DRIVE_CLIENT_SECRET | Set-Content src\Core\Secrets.h
|
||||
- ps: (Get-Content src\Core\Secrets.h) -replace '__GC_GOOGLE_DRIVE_API_KEY__', $env:GC_GOOGLE_DRIVE_API_KEY | Set-Content src\Core\Secrets.h
|
||||
- ps: (Get-Content src\Core\Secrets.h) -replace 'OPENDATA_DISABLE', 'OPENDATA_ENABLE' | Set-Content src\Core\Secrets.h
|
||||
- ps: (Get-Content src\Core\Secrets.h) -replace '__GC_CLOUD_OPENDATA_SECRET__', $env:GC_CLOUD_OPENDATA_SECRET | Set-Content src\Core\Secrets.h
|
||||
- ps: (Get-Content src\Core\Secrets.h) -replace '__GC_WITHINGS_CONSUMER_SECRET__', $env:GC_WITHINGS_CONSUMER_SECRET | Set-Content src\Core\Secrets.h
|
||||
- ps: (Get-Content src\Core\Secrets.h) -replace '__GC_NOKIA_CLIENT_SECRET__', $env:GC_NOKIA_CLIENT_SECRET | Set-Content src\Core\Secrets.h
|
||||
- ps: (Get-Content src\Core\Secrets.h) -replace '__GC_DROPBOX_CLIENT_SECRET__', $env:GC_DROPBOX_CLIENT_SECRET | Set-Content src\Core\Secrets.h
|
||||
- ps: (Get-Content src\Core\Secrets.h) -replace '__GC_STRAVA_CLIENT_SECRET__', $env:GC_STRAVA_CLIENT_SECRET | Set-Content src\Core\Secrets.h
|
||||
- ps: (Get-Content src\Core\Secrets.h) -replace '__GC_TODAYSPLAN_CLIENT_SECRET__', $env:GC_TODAYSPLAN_CLIENT_SECRET | Set-Content src\Core\Secrets.h
|
||||
- ps: (Get-Content src\Core\Secrets.h) -replace '__GC_CYCLINGANALYTICS_CLIENT_SECRET__', $env:GC_CYCLINGANALYTICS_CLIENT_SECRET | Set-Content src\Core\Secrets.h
|
||||
- ps: (Get-Content src\Core\Secrets.h) -replace '__GC_CLOUD_DB_BASIC_AUTH__', $env:GC_CLOUD_DB_BASIC_AUTH | Set-Content src\Core\Secrets.h
|
||||
- ps: (Get-Content src\Core\Secrets.h) -replace '__GC_CLOUD_DB_APP_NAME__', $env:GC_CLOUD_DB_APP_NAME | Set-Content src\Core\Secrets.h
|
||||
- ps: (Get-Content src\Core\Secrets.h) -replace '__GC_POLARFLOW_CLIENT_SECRET__', $env:GC_POLARFLOW_CLIENT_SECRET | Set-Content src\Core\Secrets.h
|
||||
- ps: (Get-Content src\Core\Secrets.h) -replace '__GC_SPORTTRACKS_CLIENT_SECRET__', $env:GC_SPORTTRACKS_CLIENT_SECRET | Set-Content src\Core\Secrets.h
|
||||
- ps: (Get-Content src\Core\Secrets.h) -replace '__GC_RWGPS_API_KEY__', $env:GC_RWGPS_API_KEY | Set-Content src\Core\Secrets.h
|
||||
|
||||
build_script:
|
||||
- qmake.exe build.pro -r -spec win32-msvc
|
||||
- nmake
|
||||
- cd qwt\
|
||||
- jom -j1
|
||||
- cd ..
|
||||
- jom -j4
|
||||
|
||||
#notifications:
|
||||
#- provider: GitHubPullRequest
|
||||
# on_build_success: true
|
||||
# on_build_failure: true
|
||||
# on_build_status_changed: true
|
||||
after_build:
|
||||
- cd src\release
|
||||
|
||||
# copy dependencies
|
||||
- windeployqt --release GoldenCheetah.exe
|
||||
- copy c:\libs\10_Precompiled_DLL\usbexpress_3.5.1\USBXpress\USBXpress_API\Host\x64\SiUSBXp.dll
|
||||
- copy c:\libs\10_Precompiled_DLL\libsamplerate64\lib\libsamplerate-0.dll
|
||||
- copy c:\libs\10_Precompiled_DLL\VLC\win64\lib\libvlc*.dll
|
||||
- xcopy /s /i /e /q c:\libs\10_Precompiled_DLL\VLC\win64\plugins plugins
|
||||
- copy c:\OpenSSL-v111-Win64\bin\lib*.dll
|
||||
- copy c:\OpenSSL-v111-Win64\license.txt "OpenSSL License.txt"
|
||||
- xcopy /s /i /e /q C:\Python .
|
||||
- copy C:\Python\LICENSE.txt "PYTHON LICENSE.txt"
|
||||
- copy c:\tools\vcpkg\installed\x64-windows\bin\gsl*.dll
|
||||
|
||||
# ReadMe, license and icon files
|
||||
- copy ..\Resources\win32\ReadMe.txt
|
||||
- echo GoldenCheetah is licensed under the GNU General Public License v2 > license.txt
|
||||
- echo. >> license.txt
|
||||
- type ..\..\COPYING >> license.txt
|
||||
- copy ..\Resources\win32\gc.ico
|
||||
|
||||
# Installer script
|
||||
- copy ..\Resources\win32\GC3.6-Dev-Master-W64-QT5.14.2.nsi
|
||||
|
||||
# Build the installer
|
||||
- makensis GC3.6-Dev-Master-W64-QT5.14.2.nsi
|
||||
- move GoldenCheetah_v3.6-DEV_64bit_Windows.exe ..\..\GoldenCheetah_v3.6-DEV_x64.exe
|
||||
- cd ..\..
|
||||
- ps: Set-AppveyorBuildVariable -Name 'PUBLISH_BINARIES' -Value false
|
||||
- ps: if ($env:APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED -Match "\[publish binaries\]") { Set-AppveyorBuildVariable -Name 'PUBLISH_BINARIES' -Value true }
|
||||
|
||||
test_script:
|
||||
# minimum test
|
||||
- src\release\GoldenCheetah --version 2>GCversionWindows.txt
|
||||
- git log -1 >> GCversionWindows.txt
|
||||
- ps: CertUtil -hashfile GoldenCheetah_v3.6-DEV_x64.exe sha256 | Select-Object -First 2 | Add-Content GCversionWindows.txt
|
||||
- type GCversionWindows.txt
|
||||
|
||||
artifacts:
|
||||
- path: GoldenCheetah_v3.6-DEV_x64.exe
|
||||
name: GCinstaller
|
||||
- path: GCversionWindows.txt
|
||||
name: GCversionWindows
|
||||
|
||||
deploy:
|
||||
# deploy continuous builds to s3
|
||||
- provider: S3
|
||||
access_key_id:
|
||||
secure: RoEkfKfOnF7JHOiLZX5qfZM08X+bu4oaDzzSKgdooNM=
|
||||
secret_access_key:
|
||||
secure: GPAArawatirYwgpHJBthdrbvyFU5bBzPOdK7VYYPiG2YHYi/DNJZ5Q5qGK1A440p
|
||||
bucket: goldencheetah-binaries
|
||||
region: us-east-1
|
||||
remove_files: true
|
||||
set_public: true
|
||||
folder: Windows
|
||||
artifact: GCinstaller, GCversionWindows
|
||||
on:
|
||||
PUBLISH_BINARIES: true
|
||||
APPVEYOR_REPO_NAME: "GoldenCheetah/GoldenCheetah"
|
||||
|
||||
4613
contrib/boost/GeometricTools_BSplineCurve.h
Normal file
4613
contrib/boost/GeometricTools_BSplineCurve.h
Normal file
File diff suppressed because it is too large
Load Diff
19
contrib/kmeans/INFO
Normal file
19
contrib/kmeans/INFO
Normal file
@@ -0,0 +1,19 @@
|
||||
NOTE
|
||||
|
||||
The sources in this sub-directory including the LICENSE and README files
|
||||
are imported with permission granted by the author (Greg Hamerly).
|
||||
|
||||
The original sources are available from Github here:
|
||||
https://github.com/ghamerly/fast-kmeans
|
||||
|
||||
Whilst the original source implements multiple algorithms we only kept
|
||||
the hamerly variant.
|
||||
|
||||
The source files have not been adapted to use Qt containers or to refactor
|
||||
any of the class inheritance. So updating to newer versions should be
|
||||
very straightforward (although the base functionality and performance is
|
||||
good enough).
|
||||
|
||||
Usage in Qt applications will likely use the Kmeans wrapper class
|
||||
|
||||
28/09/2021
|
||||
22
contrib/kmeans/LICENSE
Normal file
22
contrib/kmeans/LICENSE
Normal file
@@ -0,0 +1,22 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Greg Hamerly
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
15
contrib/kmeans/Makefile-testing
Normal file
15
contrib/kmeans/Makefile-testing
Normal file
@@ -0,0 +1,15 @@
|
||||
# doesn't work now since the source has been placed in a subdir
|
||||
# left for info and fairly trivial to fixup if you want to work
|
||||
# directly with the original sources
|
||||
|
||||
OBJECTS=kmeans_dataset.o \
|
||||
general_functions.o \
|
||||
hamerly_kmeans.o \
|
||||
kmeans.o \
|
||||
original_space_kmeans.o \
|
||||
triangle_inequality_base_kmeans.o \
|
||||
driver-standalone.o
|
||||
|
||||
driver-standalone: $(OBJECTS)
|
||||
gcc -o $@ $(OBJECTS) -lstdc++ -lm
|
||||
./driver-standalone hamerly smallDataset.txt 4 centers
|
||||
106
contrib/kmeans/README
Normal file
106
contrib/kmeans/README
Normal file
@@ -0,0 +1,106 @@
|
||||
===============================
|
||||
Fast K-means Clustering Toolkit
|
||||
===============================
|
||||
|
||||
----------------------
|
||||
Version 0.1 (Sat May 17 17:41:11 CDT 2014)
|
||||
- Initial release.
|
||||
|
||||
----------------------
|
||||
WHAT:
|
||||
This software is a testbed for comparing variants of Lloyd's k-means clustering
|
||||
algorithm. It includes implementations of several algorithms that accelerate
|
||||
the algorithm by avoiding unnecessary distance calculations.
|
||||
|
||||
----------------------
|
||||
WHO:
|
||||
Greg Hamerly (hamerly@cs.baylor.edu, primary contact) and Jonathan Drake
|
||||
(drakej@hp.com).
|
||||
|
||||
----------------------
|
||||
HOW TO BUILD THE SOFTWARE:
|
||||
type "make" (and hope for the best)
|
||||
|
||||
----------------------
|
||||
HOW TO RUN THE SOFTWARE:
|
||||
The driver is designed to take commands from standard input, usually a file
|
||||
that's been redirected as input:
|
||||
|
||||
./kmeans < commands.txt
|
||||
|
||||
You can read the source to find all the possible commands, but here is a
|
||||
summary:
|
||||
- threads T -- use T threads for clustering
|
||||
- maxiterations I -- use at most I iterations; default (or negative)
|
||||
indicates an unlimited number
|
||||
- dataset D -- use the given path name to a file as the dataset for
|
||||
clustering. The dataset should have a first line with the number of points
|
||||
n and dimension d. The next (nd) tokens are taken as the n vectors
|
||||
to cluster.
|
||||
- initialize k {kpp|random} -- use the given method (k-means++ or a random
|
||||
sample of the points) to initialize k centers
|
||||
- lloyd, hamerly, annulus, elkan, compare, sort, heap, adaptive -- perform
|
||||
k-means clustering with the given algorithm (requires first having
|
||||
initialized the centers). The adaptive algorithm is Drake's algorithm with
|
||||
a heuristic for choosing an initial B
|
||||
- drake B -- use Drake's algorithm with B lower bounds
|
||||
- kernel [gaussian T | linear | polynomial P] -- use kernelized k-means with
|
||||
the given kernel
|
||||
- elkan_kernel [gaussian T | linear | polynomial P] -- use kernelized
|
||||
k-means with the given kernel, and Elkan's accelerations
|
||||
- center -- give the previously-loaded dataset a mean of 0.
|
||||
- quit -- quit the program
|
||||
|
||||
Note that when a set of centers is initialized, that same set of centers is used
|
||||
from then on (until a new initialization occurs). So running a clustering
|
||||
algorithm multiple times will use the same initialization each time.
|
||||
|
||||
Here is an example of a simple set of commands:
|
||||
|
||||
dataset smallDataset.txt
|
||||
initialize 10 kpp
|
||||
|
||||
annulus
|
||||
hamerly
|
||||
adaptive
|
||||
heap
|
||||
elkan
|
||||
sort
|
||||
compare
|
||||
|
||||
|
||||
----------------------
|
||||
CAVEATS:
|
||||
- This software has been developed and tested on Linux. Other platforms may not
|
||||
work. Please let us know if you have difficulties, and if possible fixes for
|
||||
the code.
|
||||
|
||||
- This software uses a non-standard pthreads function called
|
||||
pthread_barrier_wait(), which is implemented on Linux but not on OSX.
|
||||
Therefore, multithreading doesn't currently work on OSX. To turn it off,
|
||||
comment out the lines in the Makefile that say:
|
||||
|
||||
CPPFLAGS += -DUSE_THREADS
|
||||
LDFLAGS += -lpthread
|
||||
|
||||
|
||||
----------------------
|
||||
REFERENCES:
|
||||
|
||||
Phillips, Steven J. "Acceleration of k-means and related clustering algorithms."
|
||||
In Algorithm Engineering and Experiments, pp. 166-177. Springer Berlin
|
||||
Heidelberg, 2002.
|
||||
|
||||
Elkan, Charles. "Using the triangle inequality to accelerate k-means." In ICML,
|
||||
vol. 3, pp. 147-153. 2003.
|
||||
|
||||
Hamerly, Greg. "Making k-means Even Faster." In SDM, pp. 130-140. 2010.
|
||||
|
||||
Drake, Jonathan, and Greg Hamerly. "Accelerated k-means with adaptive distance
|
||||
bounds." In 5th NIPS Workshop on Optimization for Machine Learning. 2012.
|
||||
|
||||
Drake, Jonathan. "Faster k-means clustering." MS thesis, 2013.
|
||||
|
||||
Hamerly, Greg, and Jonathan Drake. "Accelerating Lloyd's algorithm for k-means
|
||||
clustering." To appear in Partitional Clustering Algorithms, Springer, 2014.
|
||||
|
||||
70
contrib/kmeans/driver-standalone.cpp
Normal file
70
contrib/kmeans/driver-standalone.cpp
Normal file
@@ -0,0 +1,70 @@
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
|
||||
#include "kmeans/general_functions.h"
|
||||
#include "kmeans/kmeans.h"
|
||||
|
||||
|
||||
#include "dataset.h"
|
||||
#include "hamerly_kmeans.h"
|
||||
|
||||
Dataset *load_dataset(std::string const &filename) {
|
||||
std::ifstream input(filename.c_str());
|
||||
|
||||
int n, d;
|
||||
input >> n >> d;
|
||||
Dataset *x = new Dataset(n, d);
|
||||
|
||||
for (int i = 0; i < n * d; ++i) input >> x->data[i];
|
||||
|
||||
return x;
|
||||
}
|
||||
|
||||
Kmeans *get_algorithm(std::string const &name) {
|
||||
if (name == "hamerly") return new HamerlyKmeans();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
if (argc != 5) {
|
||||
std::cout << "usage: " << argv[0] << " algorithm dataset k [centers|assignment]\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
std::string algorithm_name(argv[1]);
|
||||
std::string filename(argv[2]);
|
||||
int k = std::stoi(argv[3]);
|
||||
std::string output(argv[4]);
|
||||
|
||||
Dataset *x = load_dataset(filename);
|
||||
Kmeans *algorithm = get_algorithm(algorithm_name);
|
||||
|
||||
Dataset *initialCenters = init_centers_kmeanspp_v2(*x, k);
|
||||
|
||||
unsigned short *assignment = new unsigned short[x->n];
|
||||
|
||||
assign(*x, *initialCenters, assignment);
|
||||
|
||||
algorithm->initialize(x, k, assignment, 1);
|
||||
|
||||
algorithm->run(10000);
|
||||
|
||||
Dataset const *finalCenters = algorithm->getCenters();
|
||||
if (output == "centers") {
|
||||
finalCenters->print();
|
||||
} else {
|
||||
assign(*x, *finalCenters, assignment);
|
||||
for (int i = 0; i < x->n; ++i) {
|
||||
std::cout << assignment[i] << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
delete x;
|
||||
delete algorithm;
|
||||
delete initialCenters;
|
||||
delete [] assignment;
|
||||
|
||||
return 0;
|
||||
}
|
||||
179
contrib/kmeans/hamerly_kmeans.cpp
Normal file
179
contrib/kmeans/hamerly_kmeans.cpp
Normal file
@@ -0,0 +1,179 @@
|
||||
/* Authors: Greg Hamerly and Jonathan Drake
|
||||
* Feedback: hamerly@cs.baylor.edu
|
||||
* See: http://cs.baylor.edu/~hamerly/software/kmeans.php
|
||||
* Copyright 2014
|
||||
*/
|
||||
|
||||
#include "hamerly_kmeans.h"
|
||||
#include "kmeans_general_functions.h"
|
||||
#include <cmath>
|
||||
#include <algorithm>
|
||||
|
||||
/* Hamerly's algorithm that is a 'simplification' of Elkan's, in that it keeps
|
||||
* the following bounds:
|
||||
* - One upper bound per clustered record on the distance between the record
|
||||
* and its closest center. It is always greater than or equal to the true
|
||||
* distance between the record and its closest center. This is the same as in
|
||||
* Elkan's algorithm.
|
||||
* - *One* lower bound per clustered record on the distance between the record
|
||||
* and its *second*-closest center. It is always less than or equal to the
|
||||
* true distance between the record and its second closest center. This is
|
||||
* different information than Elkan's algorithm -- his algorithm keeps k
|
||||
* lower bounds for each record, for a total of (n*k) lower bounds.
|
||||
*
|
||||
* The basic ideas are:
|
||||
* - when lower(x) <= upper(x), we need to recalculate the closest centers for
|
||||
* the record x, and reset lower(x) and upper(x) to their boundary values
|
||||
* - whenever a center moves
|
||||
* - calculate the distance it moves 'd'
|
||||
* - for each record x assigned to that center, update its upper bound
|
||||
* - upper(x) = upper(x) + d
|
||||
* - after each iteration
|
||||
* - find the center that has moved the most (with distance 'd')
|
||||
* - update the lower bound for all (?) records:
|
||||
* - lower(x) = lower(x) - d
|
||||
*
|
||||
* Parameters:
|
||||
* - threadId: the index of the thread that is running
|
||||
* - maxIterations: a bound on the number of iterations to perform
|
||||
*
|
||||
* Return value: the number of iterations performed (always at least 1)
|
||||
*/
|
||||
// this version only updates center locations when necessary
|
||||
int HamerlyKmeans::runThread(int threadId, int maxIterations) {
|
||||
int iterations = 0;
|
||||
|
||||
int startNdx = start(threadId);
|
||||
int endNdx = end(threadId);
|
||||
|
||||
while ((iterations < maxIterations) && ! converged) {
|
||||
++iterations;
|
||||
|
||||
// compute the inter-center distances, keeping only the closest distances
|
||||
update_s(threadId);
|
||||
synchronizeAllThreads();
|
||||
|
||||
// loop over all records
|
||||
for (int i = startNdx; i < endNdx; ++i) {
|
||||
unsigned short closest = assignment[i];
|
||||
|
||||
// if upper[i] is less than the greater of these two, then we can
|
||||
// ignore record i
|
||||
double upper_comparison_bound = std::max(s[closest], lower[i]);
|
||||
|
||||
// first check: if u(x) <= s(c(x)) or u(x) <= lower(x), then ignore
|
||||
// x, because its closest center must still be closest
|
||||
if (upper[i] <= upper_comparison_bound) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// otherwise, compute the real distance between this record and its
|
||||
// closest center, and update upper
|
||||
double u2 = pointCenterDist2(i, closest);
|
||||
upper[i] = sqrt(u2);
|
||||
|
||||
// if (u(x) <= s(c(x))) or (u(x) <= lower(x)), then ignore x
|
||||
if (upper[i] <= upper_comparison_bound) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// now update the lower bound by looking at all other centers
|
||||
double l2 = std::numeric_limits<double>::max(); // the squared lower bound
|
||||
for (int j = 0; j < k; ++j) {
|
||||
if (j == closest) { continue; }
|
||||
|
||||
double dist2 = pointCenterDist2(i, j);
|
||||
|
||||
if (dist2 < u2) {
|
||||
// another center is closer than the current assignment
|
||||
|
||||
// change the lower bound to be the current upper bound
|
||||
// (since the current upper bound is the distance to the
|
||||
// now-second-closest known center)
|
||||
l2 = u2;
|
||||
|
||||
// adjust the upper bound and the current assignment
|
||||
u2 = dist2;
|
||||
closest = j;
|
||||
} else if (dist2 < l2) {
|
||||
// we must reduce the lower bound on the distance to the
|
||||
// *second* closest center to x[i]
|
||||
l2 = dist2;
|
||||
}
|
||||
}
|
||||
|
||||
// we have been dealing in squared distances; need to convert
|
||||
lower[i] = sqrt(l2);
|
||||
|
||||
// if the assignment for i has changed, then adjust the counts and
|
||||
// locations of each center's accumulated mass
|
||||
if (assignment[i] != closest) {
|
||||
upper[i] = sqrt(u2);
|
||||
changeAssignment(i, closest, threadId);
|
||||
}
|
||||
}
|
||||
|
||||
verifyAssignment(iterations, startNdx, endNdx);
|
||||
|
||||
// ELKAN 4, 5, AND 6
|
||||
// calculate the new center locations
|
||||
synchronizeAllThreads();
|
||||
if (threadId == 0) {
|
||||
int furthestMovingCenter = move_centers();
|
||||
converged = (0.0 == centerMovement[furthestMovingCenter]);
|
||||
}
|
||||
|
||||
synchronizeAllThreads();
|
||||
|
||||
if (! converged) {
|
||||
update_bounds(startNdx, endNdx);
|
||||
}
|
||||
|
||||
synchronizeAllThreads();
|
||||
}
|
||||
|
||||
return iterations;
|
||||
}
|
||||
|
||||
|
||||
/* This method does the following:
|
||||
* - finds the furthest-moving center
|
||||
* - finds the distances moved by the two furthest-moving centers
|
||||
* - updates the upper/lower bounds for each record
|
||||
*
|
||||
* Parameters:
|
||||
* - startNdx: the first index of the dataset this thread is responsible for
|
||||
* - endNdx: one past the last index of the dataset this thread is responsible for
|
||||
*/
|
||||
void HamerlyKmeans::update_bounds(int startNdx, int endNdx) {
|
||||
double longest = centerMovement[0], secondLongest = (1 < k) ? centerMovement[1] : centerMovement[0];
|
||||
int furthestMovingCenter = 0;
|
||||
|
||||
if (longest < secondLongest) {
|
||||
furthestMovingCenter = 1;
|
||||
std::swap(longest, secondLongest);
|
||||
}
|
||||
|
||||
for (int j = 2; j < k; ++j) {
|
||||
if (longest < centerMovement[j]) {
|
||||
secondLongest = longest;
|
||||
longest = centerMovement[j];
|
||||
furthestMovingCenter = j;
|
||||
} else if (secondLongest < centerMovement[j]) {
|
||||
secondLongest = centerMovement[j];
|
||||
}
|
||||
}
|
||||
|
||||
// update upper/lower bounds
|
||||
for (int i = startNdx; i < endNdx; ++i) {
|
||||
// the upper bound increases by the amount that its center moved
|
||||
upper[i] += centerMovement[assignment[i]];
|
||||
|
||||
// The lower bound decreases by the maximum amount that any center
|
||||
// moved, unless the furthest-moving center is the one it's assigned
|
||||
// to. In the latter case, the lower bound decreases by the amount
|
||||
// of the second-furthest-moving center.
|
||||
lower[i] -= (assignment[i] == furthestMovingCenter) ? secondLongest : longest;
|
||||
}
|
||||
}
|
||||
|
||||
29
contrib/kmeans/hamerly_kmeans.h
Normal file
29
contrib/kmeans/hamerly_kmeans.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#ifndef HAMERLY_KMEANS_H
|
||||
#define HAMERLY_KMEANS_H
|
||||
|
||||
/* Authors: Greg Hamerly and Jonathan Drake
|
||||
* Feedback: hamerly@cs.baylor.edu
|
||||
* See: http://cs.baylor.edu/~hamerly/software/kmeans.php
|
||||
* Copyright 2014
|
||||
*
|
||||
* HamerlyKmeans implements Hamerly's k-means algorithm that uses one lower
|
||||
* bound per point.
|
||||
*/
|
||||
|
||||
#include "triangle_inequality_base_kmeans.h"
|
||||
|
||||
class HamerlyKmeans : public TriangleInequalityBaseKmeans {
|
||||
public:
|
||||
HamerlyKmeans() { numLowerBounds = 1; }
|
||||
virtual ~HamerlyKmeans() { free(); }
|
||||
virtual std::string getName() const { return "hamerly"; }
|
||||
|
||||
protected:
|
||||
// Update the upper and lower bounds for the given range of points.
|
||||
void update_bounds(int startNdx, int endNdx);
|
||||
|
||||
virtual int runThread(int threadId, int maxIterations);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
165
contrib/kmeans/kmeans.cpp
Normal file
165
contrib/kmeans/kmeans.cpp
Normal file
@@ -0,0 +1,165 @@
|
||||
/* Authors: Greg Hamerly and Jonathan Drake
|
||||
* Feedback: hamerly@cs.baylor.edu
|
||||
* See: http://cs.baylor.edu/~hamerly/software/kmeans.php
|
||||
* Copyright 2014
|
||||
*/
|
||||
|
||||
#include "kmeans.h"
|
||||
#include "kmeans_general_functions.h"
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
Kmeans::Kmeans() : x(NULL), n(0), k(0), d(0), numThreads(0), converged(false),
|
||||
clusterSize(NULL), centerMovement(NULL), assignment(NULL) {
|
||||
#ifdef COUNT_DISTANCES
|
||||
numDistances = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
void Kmeans::free() {
|
||||
delete [] centerMovement;
|
||||
for (int t = 0; t < numThreads; ++t) {
|
||||
delete [] clusterSize[t];
|
||||
}
|
||||
delete [] clusterSize;
|
||||
centerMovement = NULL;
|
||||
clusterSize = NULL;
|
||||
assignment = NULL;
|
||||
n = k = d = numThreads = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Kmeans::initialize(Dataset const *aX, unsigned short aK, unsigned short *initialAssignment, int aNumThreads) {
|
||||
free();
|
||||
|
||||
converged = false;
|
||||
x = aX;
|
||||
n = x->n;
|
||||
d = x->d;
|
||||
k = aK;
|
||||
|
||||
#ifdef USE_THREADS
|
||||
numThreads = aNumThreads;
|
||||
pthread_barrier_init(&barrier, NULL, numThreads);
|
||||
#else
|
||||
numThreads = 1;
|
||||
#endif
|
||||
|
||||
assignment = initialAssignment;
|
||||
centerMovement = new double[k];
|
||||
clusterSize = new int *[numThreads];
|
||||
for (int t = 0; t < numThreads; ++t) {
|
||||
clusterSize[t] = new int[k];
|
||||
std::fill(clusterSize[t], clusterSize[t] + k, 0);
|
||||
for (int i = start(t); i < end(t); ++i) {
|
||||
assert(assignment[i] < k);
|
||||
++clusterSize[t][assignment[i]];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef COUNT_DISTANCES
|
||||
numDistances = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
void Kmeans::changeAssignment(int xIndex, int closestCluster, int threadId) {
|
||||
--clusterSize[threadId][assignment[xIndex]];
|
||||
++clusterSize[threadId][closestCluster];
|
||||
assignment[xIndex] = closestCluster;
|
||||
}
|
||||
|
||||
#ifdef USE_THREADS
|
||||
struct ThreadInfo {
|
||||
public:
|
||||
ThreadInfo() : km(NULL), threadId(0), pthread_id(0) {}
|
||||
Kmeans *km;
|
||||
int threadId;
|
||||
pthread_t pthread_id;
|
||||
int numIterations;
|
||||
int maxIterations;
|
||||
};
|
||||
#endif
|
||||
|
||||
void *Kmeans::runner(void *args) {
|
||||
#ifdef USE_THREADS
|
||||
ThreadInfo *ti = (ThreadInfo *)args;
|
||||
ti->numIterations = ti->km->runThread(ti->threadId, ti->maxIterations);
|
||||
#endif
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int Kmeans::run(int maxIterations) {
|
||||
int iterations = 0;
|
||||
#ifdef USE_THREADS
|
||||
{
|
||||
ThreadInfo *info = new ThreadInfo[numThreads];
|
||||
for (int t = 0; t < numThreads; ++t) {
|
||||
info[t].km = this;
|
||||
info[t].threadId = t;
|
||||
info[t].maxIterations = maxIterations;
|
||||
pthread_create(&info[t].pthread_id, NULL, Kmeans::runner, &info[t]);
|
||||
}
|
||||
// wait for everything to finish...
|
||||
for (int t = 0; t < numThreads; ++t) {
|
||||
pthread_join(info[t].pthread_id, NULL);
|
||||
}
|
||||
iterations = info[0].numIterations;
|
||||
delete [] info;
|
||||
}
|
||||
#else
|
||||
{
|
||||
iterations = runThread(0, maxIterations);
|
||||
}
|
||||
#endif
|
||||
|
||||
return iterations;
|
||||
}
|
||||
|
||||
double Kmeans::getSSE() const {
|
||||
double sse = 0.0;
|
||||
for (int i = 0; i < n; ++i) {
|
||||
sse += pointCenterDist2(i, assignment[i]);
|
||||
}
|
||||
return sse;
|
||||
}
|
||||
|
||||
void Kmeans::verifyAssignment(int iteration, int startNdx, int endNdx) const {
|
||||
#ifdef VERIFY_ASSIGNMENTS
|
||||
for (int i = startNdx; i < endNdx; ++i) {
|
||||
// keep track of the squared distance and identity of the closest-seen
|
||||
// cluster (so far)
|
||||
int closest = assignment[i];
|
||||
double closest_dist2 = pointCenterDist2(i, closest);
|
||||
double original_closest_dist2 = closest_dist2;
|
||||
// look at all centers
|
||||
for (int j = 0; j < k; ++j) {
|
||||
if (j == closest) {
|
||||
continue;
|
||||
}
|
||||
double d2 = pointCenterDist2(i, j);
|
||||
|
||||
// determine if we found a closer center
|
||||
if (d2 < closest_dist2) {
|
||||
closest = j;
|
||||
closest_dist2 = d2;
|
||||
}
|
||||
}
|
||||
|
||||
// if we have found a discrepancy, then print out information and crash
|
||||
// the program
|
||||
if (closest != assignment[i]) {
|
||||
std::cerr << "assignment error:" << std::endl;
|
||||
std::cerr << "iteration = " << iteration << std::endl;
|
||||
std::cerr << "point index = " << i << std::endl;
|
||||
std::cerr << "closest center = " << closest << std::endl;
|
||||
std::cerr << "closest center dist2 = " << closest_dist2 << std::endl;
|
||||
std::cerr << "assigned center = " << assignment[i] << std::endl;
|
||||
std::cerr << "assigned center dist2 = " << original_closest_dist2 << std::endl;
|
||||
assert(false);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
147
contrib/kmeans/kmeans.h
Normal file
147
contrib/kmeans/kmeans.h
Normal file
@@ -0,0 +1,147 @@
|
||||
#ifndef KMEANS_H
|
||||
#define KMEANS_H
|
||||
|
||||
/* Authors: Greg Hamerly and Jonathan Drake
|
||||
* Feedback: hamerly@cs.baylor.edu
|
||||
* See: http://cs.baylor.edu/~hamerly/software/kmeans.php
|
||||
* Copyright 2014
|
||||
*
|
||||
* Kmeans is an abstract base class for algorithms which implement Lloyd's
|
||||
* k-means algorithm. Subclasses provide functionality in the "runThread()"
|
||||
* method.
|
||||
*/
|
||||
|
||||
#include "kmeans_dataset.h"
|
||||
#include <limits>
|
||||
#include <string>
|
||||
#ifdef USE_THREADS
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
|
||||
class Kmeans {
|
||||
public:
|
||||
// Construct a K-means object to operate on the given dataset
|
||||
Kmeans();
|
||||
virtual ~Kmeans() { free(); }
|
||||
|
||||
// This method kicks off the threads that do the clustering and run
|
||||
// until convergence (or until reaching maxIterations). It returns the
|
||||
// number of iterations performed.
|
||||
int run(int aMaxIterations = std::numeric_limits<int>::max());
|
||||
|
||||
// Get the cluster assignment for the given point index.
|
||||
int getAssignment(int xIndex) const { return assignment[xIndex]; }
|
||||
|
||||
// Initialize the algorithm at the beginning of the run(), with the
|
||||
// given data and initial assignment. The parameter initialAssignment
|
||||
// will be modified by this algorithm and will at the end contain the
|
||||
// final assignment of clusters.
|
||||
virtual void initialize(Dataset const *aX, unsigned short aK, unsigned short *initialAssignment, int aNumThreads);
|
||||
|
||||
// Free all memory being used by the object.
|
||||
virtual void free();
|
||||
|
||||
// This method verifies that the current assignment is correct, by
|
||||
// checking every point-center distance. For debugging.
|
||||
virtual void verifyAssignment(int iteration, int startNdx, int endNdx) const;
|
||||
|
||||
// Compute the sum of squared errors for the data on the centers (not
|
||||
// designed to be fast).
|
||||
virtual double getSSE() const;
|
||||
|
||||
// Get the name of this clustering algorithm (to be overridden by
|
||||
// subclasses).
|
||||
virtual std::string getName() const = 0;
|
||||
|
||||
// Virtual methods for computing inner products (depending on the kernel
|
||||
// being used, e.g.). For vanilla k-means these will be the standard dot
|
||||
// product; for more exotic applications these will be other kernel
|
||||
// functions.
|
||||
virtual double pointPointInnerProduct(int x1, int x2) const = 0;
|
||||
virtual double pointCenterInnerProduct(int xndx, unsigned short cndx) const = 0;
|
||||
virtual double centerCenterInnerProduct(unsigned short c1, unsigned short c2) const = 0;
|
||||
|
||||
// Use the inner products to compute squared distances between a point
|
||||
// and center.
|
||||
virtual double pointCenterDist2(int x1, unsigned short cndx) const {
|
||||
#ifdef COUNT_DISTANCES
|
||||
++numDistances;
|
||||
#endif
|
||||
return pointPointInnerProduct(x1, x1) - 2 * pointCenterInnerProduct(x1, cndx) + centerCenterInnerProduct(cndx, cndx);
|
||||
}
|
||||
|
||||
// Use the inner products to compute squared distances between two
|
||||
// centers.
|
||||
virtual double centerCenterDist2(unsigned short c1, unsigned short c2) const {
|
||||
#ifdef COUNT_DISTANCES
|
||||
++numDistances;
|
||||
#endif
|
||||
return centerCenterInnerProduct(c1, c1) - 2 * centerCenterInnerProduct(c1, c2) + centerCenterInnerProduct(c2, c2);
|
||||
}
|
||||
|
||||
#ifdef COUNT_DISTANCES
|
||||
#ifdef USE_THREADS
|
||||
// Note: numDistances is NOT thread-safe, but it is not meant to be
|
||||
// enabled in performant code.
|
||||
#error Counting distances and using multiple threads is not supported.
|
||||
#endif
|
||||
mutable long long numDistances;
|
||||
#endif
|
||||
|
||||
virtual Dataset const *getCenters() const { return NULL; }
|
||||
|
||||
protected:
|
||||
// The dataset to cluster.
|
||||
const Dataset *x;
|
||||
|
||||
// Local copies for convenience.
|
||||
int n, k, d;
|
||||
|
||||
// Pthread primitives for multithreading.
|
||||
int numThreads;
|
||||
#ifdef USE_THREADS
|
||||
pthread_barrier_t barrier;
|
||||
#endif
|
||||
|
||||
// To communicate (to all threads) that we have converged.
|
||||
bool converged;
|
||||
|
||||
// Keep track of how many points are in each cluster, divided over each
|
||||
// thread.
|
||||
int **clusterSize;
|
||||
|
||||
// centerMovement is computed in move_centers() and used to detect
|
||||
// convergence (if max(centerMovement) == 0.0) and update point-center
|
||||
// distance bounds (in subclasses that use them).
|
||||
double *centerMovement;
|
||||
|
||||
// For each point in x, keep which cluster it is assigned to. By using a
|
||||
// short, we assume a limited number of clusters (fewer than 2^16).
|
||||
unsigned short *assignment;
|
||||
|
||||
|
||||
// This is where each thread does its work.
|
||||
virtual int runThread(int threadId, int maxIterations) = 0;
|
||||
|
||||
// Static entry method for pthread_create().
|
||||
static void *runner(void *args);
|
||||
|
||||
// Assign point at xIndex to cluster newCluster, working within thread threadId.
|
||||
virtual void changeAssignment(int xIndex, int newCluster, int threadId);
|
||||
|
||||
// Over what range in [0, n) does this thread have ownership of the
|
||||
// points? end() returns one past the last owned point.
|
||||
int start(int threadId) const { return n * threadId / numThreads; }
|
||||
int end(int threadId) const { return start(threadId + 1); }
|
||||
int whichThread(int index) const { return index * numThreads / n; }
|
||||
|
||||
// Convenience method for causing all threads to synchronize.
|
||||
void synchronizeAllThreads() {
|
||||
#ifdef USE_THREADS
|
||||
pthread_barrier_wait(&barrier);
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
95
contrib/kmeans/kmeans_dataset.cpp
Normal file
95
contrib/kmeans/kmeans_dataset.cpp
Normal file
@@ -0,0 +1,95 @@
|
||||
/* Authors: Greg Hamerly and Jonathan Drake
|
||||
* Feedback: hamerly@cs.baylor.edu
|
||||
* See: http://cs.baylor.edu/~hamerly/software/kmeans.php
|
||||
* Copyright 2014
|
||||
*/
|
||||
|
||||
#include "kmeans_dataset.h"
|
||||
// #include <iostream>
|
||||
#include <iomanip>
|
||||
#include <cassert>
|
||||
#include <cstring>
|
||||
|
||||
// print the dataset to standard output (cout), using formatting to keep the
|
||||
// data in matrix format
|
||||
void Dataset::print(std::ostream &out) const {
|
||||
//std::ostream &out = std::cout;
|
||||
out.precision(6);
|
||||
int ndx = 0;
|
||||
for (int i = 0; i < n; ++i) {
|
||||
for (int j = 0; j < d; ++j) {
|
||||
out << std::setw(13) << data[ndx++] << " ";
|
||||
}
|
||||
out << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
// returns a (modifiable) reference to the value in dimension "dim" from record
|
||||
// "ndx"
|
||||
double &Dataset::operator()(int ndx, int dim) {
|
||||
# ifdef DEBUG
|
||||
assert(ndx < n);
|
||||
assert(dim < d);
|
||||
# endif
|
||||
return data[ndx * d + dim];
|
||||
}
|
||||
|
||||
// returns a (const) reference to the value in dimension "dim" from record "ndx"
|
||||
const double &Dataset::operator()(int ndx, int dim) const {
|
||||
# ifdef DEBUG
|
||||
assert(ndx < n);
|
||||
assert(dim < d);
|
||||
# endif
|
||||
return data[ndx * d + dim];
|
||||
}
|
||||
|
||||
// fill the entire dataset with value. Does NOT update sumDataSquared.
|
||||
void Dataset::fill(double value) {
|
||||
for (int i = 0; i < nd; ++i) {
|
||||
data[i] = value;
|
||||
}
|
||||
}
|
||||
|
||||
// copy constructor -- makes a deep copy of everything in x
|
||||
Dataset::Dataset(Dataset const &x) {
|
||||
n = d = nd = 0;
|
||||
data = sumDataSquared = NULL;
|
||||
*this = x;
|
||||
}
|
||||
|
||||
// operator= is the standard deep-copy assignment operator, which
|
||||
// returns a const reference to *this.
|
||||
Dataset const &Dataset::operator=(Dataset const &x) {
|
||||
if (this != &x) {
|
||||
|
||||
// reallocate sumDataSquared and data as necessary
|
||||
if (n != x.n) {
|
||||
delete [] sumDataSquared;
|
||||
sumDataSquared = x.sumDataSquared ? new double[x.n] : NULL;
|
||||
}
|
||||
|
||||
if (nd != x.nd) {
|
||||
delete [] data;
|
||||
data = x.data ? new double[x.nd] : NULL;
|
||||
}
|
||||
|
||||
// reflect the new sizes
|
||||
n = x.n;
|
||||
d = x.d;
|
||||
nd = x.nd;
|
||||
|
||||
// copy data as appropriate
|
||||
if (x.sumDataSquared) {
|
||||
memcpy(sumDataSquared, x.sumDataSquared, x.n * sizeof(double));
|
||||
}
|
||||
|
||||
if (x.data) {
|
||||
memcpy(data, x.data, x.nd * sizeof(double));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// return a reference for chaining assignments
|
||||
return *this;
|
||||
}
|
||||
|
||||
85
contrib/kmeans/kmeans_dataset.h
Normal file
85
contrib/kmeans/kmeans_dataset.h
Normal file
@@ -0,0 +1,85 @@
|
||||
#ifndef DATASET_H
|
||||
#define DATASET_H
|
||||
|
||||
/* Authors: Greg Hamerly and Jonathan Drake
|
||||
* Feedback: hamerly@cs.baylor.edu
|
||||
* See: http://cs.baylor.edu/~hamerly/software/kmeans.php
|
||||
* Copyright 2014
|
||||
*
|
||||
* A Dataset class represents a collection of multidimensional records, as is
|
||||
* typical in metric machine learning. Every record has the same number of
|
||||
* dimensions (values), and every value must be numeric. Undefined values are
|
||||
* not allowed.
|
||||
*
|
||||
* This particular implementation keeps all the data in a 1-dimensional array,
|
||||
* and also optionally keeps extra storage for the sum of the squared values of
|
||||
* each record. However, the Dataset class does NOT automatically populate or
|
||||
* update the sumDataSquared values.
|
||||
*/
|
||||
|
||||
#include <cstddef>
|
||||
#include <iostream>
|
||||
|
||||
class Dataset {
|
||||
public:
|
||||
// default constructor -- constructs a completely empty dataset with no
|
||||
// records
|
||||
Dataset() : n(0), d(0), nd(0), data(NULL), sumDataSquared(NULL) {}
|
||||
|
||||
// construct a dataset of a particular size, and determine whether to
|
||||
// keep the sumDataSquared
|
||||
Dataset(int aN, int aD, bool keepSDS = false) : n(aN), d(aD), nd(n * d),
|
||||
data(new double[nd]),
|
||||
sumDataSquared(keepSDS ? new double[n] : NULL) {}
|
||||
|
||||
// copy constructor -- makes a deep copy of everything in x
|
||||
Dataset(Dataset const &x);
|
||||
|
||||
// destroys the dataset safely
|
||||
~Dataset() {
|
||||
n = d = nd = 0;
|
||||
double *dp = data, *sdsp = sumDataSquared;
|
||||
data = sumDataSquared = NULL;
|
||||
delete [] dp;
|
||||
delete [] sdsp;
|
||||
}
|
||||
|
||||
// operator= is the standard deep-copy assignment operator, which
|
||||
// returns a const reference to *this.
|
||||
Dataset const &operator=(Dataset const &x);
|
||||
|
||||
// allows modification of the record ndx and dimension dim
|
||||
double &operator()(int ndx, int dim);
|
||||
|
||||
// allows const access to record ndx and dimension dim
|
||||
const double &operator()(int ndx, int dim) const;
|
||||
|
||||
// fill the entire dataset with value. Does NOT update sumDataSquared.
|
||||
void fill(double value);
|
||||
|
||||
// print the dataset to standard output (cout), using formatting to keep the
|
||||
// data in matrix format
|
||||
void print(std::ostream &out = std::cout) const;
|
||||
|
||||
// n represents the number of records
|
||||
// d represents the dimension
|
||||
// nd is a shortcut for the value n * d
|
||||
int n, d, nd;
|
||||
|
||||
// data is an array of length n*d that stores all of the records in
|
||||
// record-major (row-major) order. Thus data[0]...data[d-1] are the
|
||||
// values associated with the first record.
|
||||
double *data;
|
||||
|
||||
// sumDataSquared is an (optional) sum of squared values for every
|
||||
// record. Thus,
|
||||
// sumDataSquared[0] = data[0]^2 + data[1]^2 + ... + data[d-1]^2
|
||||
// sumDataSquared[1] = data[d]^2 + data[d+1]^2 + ... + data[2*d-1]^2
|
||||
// and so on. Note that this is the *intended* use of the sumDataSquared
|
||||
// field, but that the Dataset class does NOT automatically populate or
|
||||
// update the values in sumDataSquared.
|
||||
double *sumDataSquared;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
256
contrib/kmeans/kmeans_general_functions.cpp
Normal file
256
contrib/kmeans/kmeans_general_functions.cpp
Normal file
@@ -0,0 +1,256 @@
|
||||
/* Authors: Greg Hamerly and Jonathan Drake
|
||||
* Feedback: hamerly@cs.baylor.edu
|
||||
* See: http://cs.baylor.edu/~hamerly/software/kmeans.php
|
||||
* Copyright 2014
|
||||
*/
|
||||
|
||||
#include "kmeans_dataset.h"
|
||||
#include "kmeans.h"
|
||||
#include "kmeans_general_functions.h"
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
#include <algorithm>
|
||||
#include <numeric>
|
||||
#include <cstring>
|
||||
#include <cstdio>
|
||||
|
||||
void addVectors(double *a, double const *b, int d) {
|
||||
double const *end = a + d;
|
||||
while (a < end) {
|
||||
*(a++) += *(b++);
|
||||
}
|
||||
}
|
||||
|
||||
void subVectors(double *a, double const *b, int d) {
|
||||
double const *end = a + d;
|
||||
while (a < end) {
|
||||
*(a++) -= *(b++);
|
||||
}
|
||||
}
|
||||
|
||||
double distance2silent(double const *a, double const *b, int d) {
|
||||
double d2 = 0.0, diff;
|
||||
double const *end = a + d; // one past the last valid entry in a
|
||||
while (a < end) {
|
||||
diff = *(a++) - *(b++);
|
||||
d2 += diff * diff;
|
||||
}
|
||||
return d2;
|
||||
}
|
||||
|
||||
|
||||
void centerDataset(Dataset *x) {
|
||||
double *xCentroid = new double[x->d];
|
||||
|
||||
for (int d = 0; d < x->d; ++d) {
|
||||
xCentroid[d] = 0.0;
|
||||
}
|
||||
|
||||
for (int i = 0; i < x->n; ++i) {
|
||||
addVectors(xCentroid, x->data + i * x->d, x->d);
|
||||
}
|
||||
|
||||
// compute average (divide by n)
|
||||
for (int d = 0; d < x->d; ++d) {
|
||||
xCentroid[d] /= x->n;
|
||||
}
|
||||
|
||||
// re-center the dataset
|
||||
const double *xEnd = x->data + x->n * x->d;
|
||||
for (double *xp = x->data; xp != xEnd; xp += x->d) {
|
||||
subVectors(xp, xCentroid, x->d);
|
||||
}
|
||||
|
||||
delete [] xCentroid;
|
||||
}
|
||||
|
||||
Dataset *init_centers(Dataset const &x, unsigned short k) {
|
||||
int *chosen_pts = new int[k];
|
||||
Dataset *c = new Dataset(k, x.d);
|
||||
for (int i = 0; i < k; ++i) {
|
||||
bool acceptable = true;
|
||||
do {
|
||||
acceptable = true;
|
||||
chosen_pts[i] = rand() % x.n;
|
||||
for (int j = 0; j < i; ++j) {
|
||||
if (chosen_pts[i] == chosen_pts[j]) {
|
||||
acceptable = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} while (! acceptable);
|
||||
double *cdp = c->data + i * x.d;
|
||||
memcpy(cdp, x.data + chosen_pts[i] * x.d, sizeof(double) * x.d);
|
||||
if (c->sumDataSquared) {
|
||||
c->sumDataSquared[i] = std::inner_product(cdp, cdp + x.d, cdp, 0.0);
|
||||
}
|
||||
}
|
||||
|
||||
delete [] chosen_pts;
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
Dataset *init_centers_kmeanspp(Dataset const &x, unsigned short k) {
|
||||
int *chosen_pts = new int[k];
|
||||
std::pair<double, int> *dist2 = new std::pair<double, int>[x.n];
|
||||
double *distribution = new double[x.n];
|
||||
|
||||
// initialize dist2
|
||||
for (int i = 0; i < x.n; ++i) {
|
||||
dist2[i].first = std::numeric_limits<double>::max();
|
||||
dist2[i].second = i;
|
||||
}
|
||||
|
||||
// choose the first point randomly
|
||||
int ndx = 1;
|
||||
chosen_pts[ndx - 1] = rand() % x.n;
|
||||
|
||||
while (ndx < k) {
|
||||
double sum_distribution = 0.0;
|
||||
// look for the point that is furthest from any center
|
||||
for (int i = 0; i < x.n; ++i) {
|
||||
int example = dist2[i].second;
|
||||
double d2 = 0.0, diff;
|
||||
for (int j = 0; j < x.d; ++j) {
|
||||
diff = x(example,j) - x(chosen_pts[ndx - 1],j);
|
||||
d2 += diff * diff;
|
||||
}
|
||||
if (d2 < dist2[i].first) {
|
||||
dist2[i].first = d2;
|
||||
}
|
||||
|
||||
sum_distribution += dist2[i].first;
|
||||
}
|
||||
|
||||
// sort the examples by their distance from centers
|
||||
sort(dist2, dist2 + x.n);
|
||||
|
||||
// turn distribution into a CDF
|
||||
distribution[0] = dist2[0].first / sum_distribution;
|
||||
for (int i = 1; i < x.n; ++i) {
|
||||
distribution[i] = distribution[i - 1] + dist2[i].first / sum_distribution;
|
||||
}
|
||||
|
||||
// choose a random interval according to the new distribution
|
||||
double r = (double)rand() / (double)RAND_MAX;
|
||||
double *new_center_ptr = std::lower_bound(distribution, distribution + x.n, r);
|
||||
int distribution_ndx = (int)(new_center_ptr - distribution);
|
||||
chosen_pts[ndx] = dist2[distribution_ndx].second;
|
||||
/*
|
||||
cout << "chose " << distribution_ndx << " which is actually "
|
||||
<< chosen_pts[ndx] << " with distance "
|
||||
<< dist2[distribution_ndx].first << std::endl;
|
||||
*/
|
||||
|
||||
++ndx;
|
||||
}
|
||||
|
||||
Dataset *c = new Dataset(k, x.d);
|
||||
|
||||
for (int i = 0; i < k; ++i) {
|
||||
double *cdp = c->data + i * x.d;
|
||||
memcpy(cdp, x.data + chosen_pts[i] * x.d, sizeof(double) * x.d);
|
||||
if (c->sumDataSquared) {
|
||||
c->sumDataSquared[i] = std::inner_product(cdp, cdp + x.d, cdp, 0.0);
|
||||
}
|
||||
}
|
||||
|
||||
delete [] chosen_pts;
|
||||
delete [] dist2;
|
||||
delete [] distribution;
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
Dataset *init_centers_kmeanspp_v2(Dataset const &x, unsigned short k) {
|
||||
int *chosen_pts = new int[k];
|
||||
std::pair<double, int> *dist2 = new std::pair<double, int>[x.n];
|
||||
|
||||
// initialize dist2
|
||||
for (int i = 0; i < x.n; ++i) {
|
||||
dist2[i].first = std::numeric_limits<double>::max();
|
||||
dist2[i].second = i;
|
||||
}
|
||||
|
||||
// choose the first point randomly
|
||||
int ndx = 1;
|
||||
chosen_pts[ndx - 1] = rand() % x.n;
|
||||
|
||||
while (ndx < k) {
|
||||
double sum_distribution = 0.0;
|
||||
// look for the point that is furthest from any center
|
||||
double max_dist = 0.0;
|
||||
for (int i = 0; i < x.n; ++i) {
|
||||
int example = dist2[i].second;
|
||||
double d2 = 0.0, diff;
|
||||
for (int j = 0; j < x.d; ++j) {
|
||||
diff = x(example,j) - x(chosen_pts[ndx - 1],j);
|
||||
d2 += diff * diff;
|
||||
}
|
||||
if (d2 < dist2[i].first) {
|
||||
dist2[i].first = d2;
|
||||
}
|
||||
|
||||
if (dist2[i].first > max_dist) {
|
||||
max_dist = dist2[i].first;
|
||||
}
|
||||
|
||||
sum_distribution += dist2[i].first;
|
||||
}
|
||||
|
||||
bool unique = true;
|
||||
|
||||
do {
|
||||
// choose a random interval according to the new distribution
|
||||
double r = sum_distribution * (double)rand() / (double)RAND_MAX;
|
||||
double sum_cdf = dist2[0].first;
|
||||
int cdf_ndx = 0;
|
||||
while (sum_cdf < r) {
|
||||
sum_cdf += dist2[++cdf_ndx].first;
|
||||
}
|
||||
chosen_pts[ndx] = cdf_ndx;
|
||||
|
||||
for (int i = 0; i < ndx; ++i) {
|
||||
unique = unique && (chosen_pts[ndx] != chosen_pts[i]);
|
||||
}
|
||||
} while (! unique);
|
||||
|
||||
++ndx;
|
||||
}
|
||||
|
||||
Dataset *c = new Dataset(k, x.d);
|
||||
for (int i = 0; i < c->n; ++i) {
|
||||
double *cdp = c->data + i * x.d;
|
||||
memcpy(cdp, x.data + chosen_pts[i] * x.d, sizeof(double) * x.d);
|
||||
if (c->sumDataSquared) {
|
||||
c->sumDataSquared[i] = std::inner_product(cdp, cdp + x.d, cdp, 0.0);
|
||||
}
|
||||
}
|
||||
|
||||
delete [] chosen_pts;
|
||||
delete [] dist2;
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
void kmeans_assign(Dataset const &x, Dataset const &c, unsigned short *assignment) {
|
||||
for (int i = 0; i < x.n; ++i) {
|
||||
double shortestDist2 = std::numeric_limits<double>::max();
|
||||
int closest = 0;
|
||||
for (int j = 0; j < c.n; ++j) {
|
||||
double d2 = 0.0, *a = x.data + i * x.d, *b = c.data + j * x.d;
|
||||
for (; a != x.data + (i + 1) * x.d; ++a, ++b) {
|
||||
d2 += (*a - *b) * (*a - *b);
|
||||
}
|
||||
if (d2 < shortestDist2) {
|
||||
shortestDist2 = d2;
|
||||
closest = j;
|
||||
}
|
||||
}
|
||||
assignment[i] = closest;
|
||||
}
|
||||
}
|
||||
83
contrib/kmeans/kmeans_general_functions.h
Normal file
83
contrib/kmeans/kmeans_general_functions.h
Normal file
@@ -0,0 +1,83 @@
|
||||
#ifndef GENERAL_KMEANS_FUNCTIONS_H
|
||||
#define GENERAL_KMEANS_FUNCTIONS_H
|
||||
|
||||
/* Authors: Greg Hamerly and Jonathan Drake
|
||||
* Feedback: hamerly@cs.baylor.edu
|
||||
* See: http://cs.baylor.edu/~hamerly/software/kmeans.php
|
||||
* Copyright 2014
|
||||
*
|
||||
* Generally useful functions.
|
||||
*/
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include "kmeans_dataset.h"
|
||||
|
||||
/* Add together two vectors, and put the result in the first argument.
|
||||
* Calculates a = a + b
|
||||
*
|
||||
* Parameters:
|
||||
* a -- vector to add, and the result of the operation
|
||||
* b -- vector to add to a
|
||||
* d -- the dimension
|
||||
* Return value: none
|
||||
*/
|
||||
void addVectors(double *a, double const *b, int d);
|
||||
|
||||
/* Subtract two vectors, and put the result in the first argument. Calculates
|
||||
* a = a - b
|
||||
*
|
||||
* Parameters:
|
||||
* a -- vector to subtract from, and the result of the operation
|
||||
* b -- vector to subtract
|
||||
* d -- the dimension
|
||||
* Return value: none
|
||||
*/
|
||||
void subVectors(double *a, double const *b, int d);
|
||||
|
||||
/* Initialize the centers randomly. Choose random records from x as the initial
|
||||
* values for the centers. Assumes that c uses the sumDataSquared field.
|
||||
*
|
||||
* Parameters:
|
||||
* x -- records that are being clustered (n * d)
|
||||
* c -- centers to be initialized. Should be pre-allocated with the number of
|
||||
* centers desired, and dimension.
|
||||
* Return value: none
|
||||
*/
|
||||
Dataset *init_centers(Dataset const &x, unsigned short k);
|
||||
|
||||
/* Initialize the centers randomly using K-means++.
|
||||
*
|
||||
* Parameters:
|
||||
* x -- records that are being clustered (n * d)
|
||||
* c -- centers to be initialized. Should be pre-allocated with the number of
|
||||
* centers desired, and dimension.
|
||||
* Return value: none
|
||||
*/
|
||||
Dataset *init_centers_kmeanspp(Dataset const &x, unsigned short k);
|
||||
Dataset *init_centers_kmeanspp_v2(Dataset const &x, unsigned short k);
|
||||
|
||||
/* Print an array (templated). Convenience function.
|
||||
*
|
||||
* Parameters:
|
||||
* arr -- the array to print
|
||||
* length -- the length of the array
|
||||
* separator -- the string to put between each pair of printed elements
|
||||
* Return value: none
|
||||
*/
|
||||
template <class T>
|
||||
void printArray(T const *arr, int length, std::string separator) {
|
||||
for (int i = 0; i < length; ++i) {
|
||||
if (i > 0) {
|
||||
std::cout << separator;
|
||||
}
|
||||
std::cout << arr[i];
|
||||
}
|
||||
}
|
||||
|
||||
void centerDataset(Dataset *x);
|
||||
|
||||
void kmeans_assign(Dataset const &x, Dataset const &c, unsigned short *assignment);
|
||||
|
||||
#endif
|
||||
106
contrib/kmeans/original_space_kmeans.cpp
Normal file
106
contrib/kmeans/original_space_kmeans.cpp
Normal file
@@ -0,0 +1,106 @@
|
||||
/* Authors: Greg Hamerly and Jonathan Drake
|
||||
* Feedback: hamerly@cs.baylor.edu
|
||||
* See: http://cs.baylor.edu/~hamerly/software/kmeans.php
|
||||
* Copyright 2014
|
||||
*/
|
||||
|
||||
#include "original_space_kmeans.h"
|
||||
#include "kmeans_general_functions.h"
|
||||
#include <cmath>
|
||||
#include <cassert>
|
||||
#include <numeric>
|
||||
|
||||
OriginalSpaceKmeans::OriginalSpaceKmeans() : centers(NULL), sumNewCenters(NULL) { }
|
||||
|
||||
void OriginalSpaceKmeans::free() {
|
||||
for (int t = 0; t < numThreads; ++t) {
|
||||
delete sumNewCenters[t];
|
||||
}
|
||||
Kmeans::free();
|
||||
delete centers;
|
||||
delete [] sumNewCenters;
|
||||
centers = NULL;
|
||||
sumNewCenters = NULL;
|
||||
}
|
||||
|
||||
/* This method moves the newCenters to their new locations, based on the
|
||||
* sufficient statistics in sumNewCenters. It also computes the centerMovement
|
||||
* and the center that moved the furthest.
|
||||
*
|
||||
* Parameters: none
|
||||
*
|
||||
* Return value: index of the furthest-moving centers
|
||||
*/
|
||||
int OriginalSpaceKmeans::move_centers() {
|
||||
int furthestMovingCenter = 0;
|
||||
for (int j = 0; j < k; ++j) {
|
||||
centerMovement[j] = 0.0;
|
||||
int totalClusterSize = 0;
|
||||
for (int t = 0; t < numThreads; ++t) {
|
||||
totalClusterSize += clusterSize[t][j];
|
||||
}
|
||||
if (totalClusterSize > 0) {
|
||||
for (int dim = 0; dim < d; ++dim) {
|
||||
double z = 0.0;
|
||||
for (int t = 0; t < numThreads; ++t) {
|
||||
z += (*sumNewCenters[t])(j,dim);
|
||||
}
|
||||
z /= totalClusterSize;
|
||||
centerMovement[j] += (z - (*centers)(j, dim)) * (z - (*centers)(j, dim));
|
||||
(*centers)(j, dim) = z;
|
||||
}
|
||||
}
|
||||
centerMovement[j] = sqrt(centerMovement[j]);
|
||||
|
||||
if (centerMovement[furthestMovingCenter] < centerMovement[j]) {
|
||||
furthestMovingCenter = j;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef COUNT_DISTANCES
|
||||
numDistances += k;
|
||||
#endif
|
||||
|
||||
return furthestMovingCenter;
|
||||
}
|
||||
|
||||
void OriginalSpaceKmeans::initialize(Dataset const *aX, unsigned short aK, unsigned short *initialAssignment, int aNumThreads) {
|
||||
Kmeans::initialize(aX, aK, initialAssignment, aNumThreads);
|
||||
|
||||
centers = new Dataset(k, d);
|
||||
sumNewCenters = new Dataset *[numThreads];
|
||||
centers->fill(0.0);
|
||||
|
||||
for (int t = 0; t < numThreads; ++t) {
|
||||
sumNewCenters[t] = new Dataset(k, d, false);
|
||||
sumNewCenters[t]->fill(0.0);
|
||||
for (int i = start(t); i < end(t); ++i) {
|
||||
addVectors(sumNewCenters[t]->data + assignment[i] * d, x->data + i * d, d);
|
||||
}
|
||||
}
|
||||
|
||||
// put the centers at their initial locations, based on clusterSize and
|
||||
// sumNewCenters
|
||||
move_centers();
|
||||
}
|
||||
|
||||
void OriginalSpaceKmeans::changeAssignment(int xIndex, int closestCluster, int threadId) {
|
||||
unsigned short oldAssignment = assignment[xIndex];
|
||||
Kmeans::changeAssignment(xIndex, closestCluster, threadId);
|
||||
double *xp = x->data + xIndex * d;
|
||||
subVectors(sumNewCenters[threadId]->data + oldAssignment * d, xp, d);
|
||||
addVectors(sumNewCenters[threadId]->data + closestCluster * d, xp, d);
|
||||
}
|
||||
|
||||
double OriginalSpaceKmeans::pointPointInnerProduct(int x1, int x2) const {
|
||||
return std::inner_product(x->data + x1 * d, x->data + (x1 + 1) * d, x->data + x2 * d, 0.0);
|
||||
}
|
||||
|
||||
double OriginalSpaceKmeans::pointCenterInnerProduct(int xndx, unsigned short cndx) const {
|
||||
return std::inner_product(x->data + xndx * d, x->data + (xndx + 1) * d, centers->data + cndx * d, 0.0);
|
||||
}
|
||||
|
||||
double OriginalSpaceKmeans::centerCenterInnerProduct(unsigned short c1, unsigned short c2) const {
|
||||
return std::inner_product(centers->data + c1 * d, centers->data + (c1 + 1) * d, centers->data + c2 * d, 0.0);
|
||||
}
|
||||
|
||||
54
contrib/kmeans/original_space_kmeans.h
Normal file
54
contrib/kmeans/original_space_kmeans.h
Normal file
@@ -0,0 +1,54 @@
|
||||
#ifndef ORIGINAL_SPACE_KMEANS_H
|
||||
#define ORIGINAL_SPACE_KMEANS_H
|
||||
|
||||
/* Authors: Greg Hamerly and Jonathan Drake
|
||||
* Feedback: hamerly@cs.baylor.edu
|
||||
* See: http://cs.baylor.edu/~hamerly/software/kmeans.php
|
||||
* Copyright 2014
|
||||
*
|
||||
* OriginalSpaceKmeans is a base class for other algorithms that operate in the
|
||||
* same space as the data being clustered (as opposed to kernelized k-means
|
||||
* algorithms, which operate in kernel space).
|
||||
*/
|
||||
|
||||
#include "kmeans.h"
|
||||
|
||||
/* Cluster with the cluster centers living in the original space (with the
|
||||
* data). This is as opposed to a kernelized version of k-means, where the
|
||||
* center points might not be explicitly represented. This is also an abstract
|
||||
* class.
|
||||
*/
|
||||
class OriginalSpaceKmeans : public Kmeans {
|
||||
public:
|
||||
OriginalSpaceKmeans();
|
||||
virtual ~OriginalSpaceKmeans() { free(); }
|
||||
virtual void free();
|
||||
virtual void initialize(Dataset const *aX, unsigned short aK, unsigned short *initialAssignment, int aNumThreads);
|
||||
|
||||
virtual double pointPointInnerProduct(int x1ndx, int x2ndx) const;
|
||||
virtual double pointCenterInnerProduct(int xndx, unsigned short cndx) const;
|
||||
virtual double centerCenterInnerProduct(unsigned short c1ndx, unsigned short c2ndx) const;
|
||||
|
||||
virtual Dataset const *getCenters() const { return centers; }
|
||||
|
||||
protected:
|
||||
// Move the centers to the average of their current assigned points,
|
||||
// compute the distance moved by each center, and return the index of
|
||||
// the furthest-moving center.
|
||||
int move_centers();
|
||||
|
||||
virtual void changeAssignment(int xIndex, int closestCluster, int threadId);
|
||||
|
||||
// The set of centers we are operating on.
|
||||
Dataset *centers;
|
||||
|
||||
// sumNewCenters and centerCount provide sufficient statistics to
|
||||
// quickly calculate the changing locations of the centers. Whenever a
|
||||
// point changes cluster membership, we subtract (add) it from (to) the
|
||||
// row in sumNewCenters associated with its old (new) cluster. We also
|
||||
// decrement (increment) centerCount for the old (new) cluster.
|
||||
Dataset **sumNewCenters;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
1001
contrib/kmeans/smallDataset.txt
Normal file
1001
contrib/kmeans/smallDataset.txt
Normal file
File diff suppressed because it is too large
Load Diff
79
contrib/kmeans/triangle_inequality_base_kmeans.cpp
Normal file
79
contrib/kmeans/triangle_inequality_base_kmeans.cpp
Normal file
@@ -0,0 +1,79 @@
|
||||
/* Authors: Greg Hamerly and Jonathan Drake
|
||||
* Feedback: hamerly@cs.baylor.edu
|
||||
* See: http://cs.baylor.edu/~hamerly/software/kmeans.php
|
||||
* Copyright 2014
|
||||
*/
|
||||
|
||||
#include "triangle_inequality_base_kmeans.h"
|
||||
#include "kmeans_general_functions.h"
|
||||
#include <cassert>
|
||||
#include <limits>
|
||||
#include <cmath>
|
||||
|
||||
void TriangleInequalityBaseKmeans::free() {
|
||||
OriginalSpaceKmeans::free();
|
||||
delete [] s;
|
||||
delete [] upper;
|
||||
delete [] lower;
|
||||
s = NULL;
|
||||
upper = NULL;
|
||||
lower = NULL;
|
||||
}
|
||||
|
||||
/* This function computes the inter-center distances, keeping only the closest
|
||||
* distances, and updates "s". After this, s[j] will contain the distance
|
||||
* between center j and its closest other center, divided by two. The division
|
||||
* here saves repeated work later, since we always will need the distance / 2.
|
||||
*
|
||||
* Parameters: none
|
||||
*
|
||||
* Return value: none
|
||||
*/
|
||||
// TODO: parallelize this
|
||||
void TriangleInequalityBaseKmeans::update_s(int threadId) {
|
||||
// initialize
|
||||
for (int c1 = 0; c1 < k; ++c1) {
|
||||
if (c1 % numThreads == threadId) {
|
||||
s[c1] = std::numeric_limits<double>::max();
|
||||
}
|
||||
}
|
||||
// compute inter-center squared distances between all pairs
|
||||
for (int c1 = 0; c1 < k; ++c1) {
|
||||
if (c1 % numThreads == threadId) {
|
||||
for (int c2 = 0; c2 < k; ++c2) {
|
||||
if (c2 == c1) {
|
||||
continue;
|
||||
}
|
||||
double d2 = centerCenterDist2(c1, c2);
|
||||
if (d2 < s[c1]) { s[c1] = d2; }
|
||||
}
|
||||
// take the root and divide by two
|
||||
s[c1] = sqrt(s[c1]) / 2.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* This function initializes the upper/lower bounds, assignment, centerCounts,
|
||||
* and sumNewCenters. It sets the bounds to invalid values which will force the
|
||||
* first iteration of k-means to set them correctly. NB: subclasses should set
|
||||
* numLowerBounds appropriately before entering this function.
|
||||
*
|
||||
* Parameters: none
|
||||
*
|
||||
* Return value: none
|
||||
*/
|
||||
void TriangleInequalityBaseKmeans::initialize(Dataset const *aX, unsigned short aK, unsigned short *initialAssignment, int aNumThreads) {
|
||||
OriginalSpaceKmeans::initialize(aX, aK, initialAssignment, aNumThreads);
|
||||
|
||||
s = new double[k];
|
||||
upper = new double[n];
|
||||
lower = new double[n * numLowerBounds];
|
||||
|
||||
// start with invalid bounds and assignments which will force the first
|
||||
// iteration of k-means to do all its standard work
|
||||
std::fill(s, s + k, 0.0);
|
||||
std::fill(upper, upper + n, std::numeric_limits<double>::max());
|
||||
std::fill(lower, lower + n * numLowerBounds, 0.0);
|
||||
}
|
||||
|
||||
43
contrib/kmeans/triangle_inequality_base_kmeans.h
Normal file
43
contrib/kmeans/triangle_inequality_base_kmeans.h
Normal file
@@ -0,0 +1,43 @@
|
||||
#ifndef TRIANGLE_INEQUALITY_BASE_KMEANS_H
|
||||
#define TRIANGLE_INEQUALITY_BASE_KMEANS_H
|
||||
|
||||
/* Authors: Greg Hamerly and Jonathan Drake
|
||||
* Feedback: hamerly@cs.baylor.edu
|
||||
* See: http://cs.baylor.edu/~hamerly/software/kmeans.php
|
||||
* Copyright 2014
|
||||
*
|
||||
* This class is an abstract base class for several other algorithms that use
|
||||
* upper & lower bounds to avoid distance calculations in k-means.
|
||||
*/
|
||||
|
||||
#include "original_space_kmeans.h"
|
||||
|
||||
class TriangleInequalityBaseKmeans : public OriginalSpaceKmeans {
|
||||
public:
|
||||
TriangleInequalityBaseKmeans() : numLowerBounds(0), s(NULL), upper(NULL), lower(NULL) {}
|
||||
virtual ~TriangleInequalityBaseKmeans() { free(); }
|
||||
|
||||
virtual void initialize(Dataset const *aX, unsigned short aK, unsigned short *initialAssignment, int aNumThreads);
|
||||
virtual void free();
|
||||
|
||||
protected:
|
||||
void update_s(int threadId);
|
||||
|
||||
// The number of lower bounds being used by this algorithm.
|
||||
int numLowerBounds;
|
||||
|
||||
// Half the distance between each center and its closest other center.
|
||||
double *s;
|
||||
|
||||
// One upper bound for each point on the distance between that point and
|
||||
// its assigned (closest) center.
|
||||
double *upper;
|
||||
|
||||
// Lower bound(s) for each point on the distance between that point and
|
||||
// the centers being tracked for lower bounds, which may be 1 to k.
|
||||
// Actual size is n * numLowerBounds.
|
||||
double *lower;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -22,6 +22,9 @@
|
||||
#endif
|
||||
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
|
||||
#pragma GCC diagnostic ignored "-Wcpp"
|
||||
|
||||
/* precision-specific definitions */
|
||||
#define LEVMAR_CHKJAC LM_ADD_PREFIX(levmar_chkjac)
|
||||
#define LEVMAR_FDIF_FORW_JAC_APPROX LM_ADD_PREFIX(levmar_fdif_forw_jac_approx)
|
||||
@@ -426,7 +429,7 @@ int info, rank, worksz, *iwork, iworksz;
|
||||
static int LEVMAR_LUINVERSE(LM_REAL *A, LM_REAL *B, int m)
|
||||
{
|
||||
void *buf=NULL;
|
||||
int buf_sz=0;
|
||||
//int buf_sz=0;
|
||||
|
||||
register int i, j, k, l;
|
||||
int *idx, maxi=-1, idx_sz, a_sz, x_sz, work_sz, tot_sz;
|
||||
@@ -439,7 +442,7 @@ LM_REAL *a, *x, *work, max, sum, tmp;
|
||||
work_sz=m;
|
||||
tot_sz=(a_sz + x_sz + work_sz)*sizeof(LM_REAL) + idx_sz*sizeof(int); /* should be arranged in that order for proper doubles alignment */
|
||||
|
||||
buf_sz=tot_sz;
|
||||
//buf_sz=tot_sz;
|
||||
buf=(void *)malloc(tot_sz);
|
||||
if(!buf){
|
||||
fprintf(stderr, RCAT("memory allocation in ", LEVMAR_LUINVERSE) "() failed!\n");
|
||||
@@ -32,6 +32,7 @@ void lmcurve_evaluate(
|
||||
const double *const par, const int m_dat, const void *const data,
|
||||
double *const fvec, int *const info)
|
||||
{
|
||||
(void)(info);
|
||||
for (int i = 0; i < m_dat; i++ )
|
||||
fvec[i] =
|
||||
((lmcurve_data_struct*)data)->y[i] -
|
||||
@@ -29,7 +29,7 @@ void QwtPlotGappedCurve::drawSeries(QPainter *painter, const QwtScaleMap &xMap,
|
||||
return;
|
||||
|
||||
if (to < 0)
|
||||
to = dataSize() - 1;
|
||||
to = dataSize();
|
||||
|
||||
int i = from;
|
||||
double last = 0;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user