Check-in [115fecab42]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Removed unnessecary files from standard library extension
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:115fecab4278e271f5d9253f1c0eb4d9391570d8
User & Date: maxi 2018-11-11 12:03:04
Context
2018-11-11
20:31
changed typecasts in acpi_utils.hpp to c++style casts check-in: b14aea8e31 user: maxi tags: trunk
12:03
Removed unnessecary files from standard library extension check-in: 115fecab42 user: maxi tags: trunk
2018-11-07
19:30
[FIXED] ub due to bad variable names check-in: 42fe01316b user: maxi tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Deleted include/kstd/ext/conscell.hpp.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#pragma once

namespace kstd {
	namespace ext {
		template <class T>
			class conscell {
			public: 
				typedef T member_type;
				typedef T* pointer_type;
				typedef T& reference_type;
				typedef conscell<T> self_type;
				typedef conscell<T>* self_pointer;
				typedef conscell<T>& self_reference;
				conscell () {

				}
				conscell (member_type other) {
					held = other;
				}
				conscell (self_reference other) {
					held = other.held;
					next = new conscell (other.next);
				}
				template <class U>
					conscell (conscell<U>& other) {

					}
				~conscell () {
					delete next;
				}
				void push_back (member_type other) {
					if (held == NULL) [[unlikely]] {
						held = other;
					} else  [[likely]] {
						if (next == nullptr) {
							next = new conscell <T>(other);
		
						} else {
							next->push_back (other);
						}
					}
				}
				reference_type operator[] (int index) {
					if (index == 0) [[unlikely]] {
						return held;
					} else [[likely]] {
						return (*next)[index-1];
					}
				}
				void prepend (reference_type other, size_t index) {
					if (index == 1) [[unlikely]] {
						conscell<T> *a = new conscell<T>(next);
						a.held = next;
						next = *a;
					} else [[likely]] {
						next->prepend (other, index-1);
					}
				}
			private:
				member_type held = NULL;
				self_pointer next = nullptr;
			};
	}
}
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






























































































































Deleted include/kstd/ext/numbers.hpp.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#pragma once

namespace kstd {
	namespace ext {
		const float NUMBER_PI = 3.1415926535; //source : https://www.angio.net/pi/digits/pi1000000.txt
		const float NUMBER_E  = 2.7182818284; //source : http://www-history.mcs.st-and.ac.uk/HistTopics/e_10000.html

		template<class Func>
			float integrate (float start, float end, float presicion, Func fx) {
				double value;
				for (; start <= end; start++)
					value += fx (start) * presicion;
				return value; 
			}
		template<class Func>
			float slope (float start, float end, Func fx) {
				return (fx (end) - fx (start));
			}
		template<class Cont>
			typename Cont::reference sum_container (Cont cont) {
				typename Cont::reference ret;
				for (auto i : cont) 
					ret += i;
				return ret;
			}
		template<class Cont>
			typename Cont::reference avg_container (Cont cont) {
				return sum_cont (cont) / cont.size();
			}
		//next tree functions require a sorted container
		template<class Cont>
			typename Cont::reference median_container (Cont cont) {
				return cont [cont.size() / 2];
			}
		template<class Cont>
			typename Cont::reference upper_quartile_container (Cont cont) {
				return cont [cont.size() * 0.75];
			}
		template<class Cont>
			typename Cont::reference lower_quatile_container (Cont cont) {
				return cont [cont.size() * 0.25];
			}
		template<class U, U a, U b>
			constexpr U add () {
				return a + b;
			}
		template<class U, U a, U b>
			constexpr U mult () {
				return a * b;
			}
		template<class U, U a, U b>
			constexpr U div () {
				return a / b;
			}
		template<class U, U a, U b>
			constexpr U sub () {
				return a + b;
			}
	}
}
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<