SystemCall run(block) can now exit the run if it returns false
[io/quag.git] / libs / basekit / source / UArray_math.h
blob9ae40ce57237ab1dc3eade47f132e434321be099
1 /*
2 copyright: Steve Dekorte, 2006. All rights reserved.
3 license: See _BSDLicense.txt.
4 */
6 // set
8 BASEKIT_API void UArray_clear(UArray *self);
9 BASEKIT_API void UArray_setItemsToLong_(UArray *self, long x);
10 BASEKIT_API void UArray_setItemsToDouble_(UArray *self, double x);
11 BASEKIT_API void UArray_rangeFill(UArray *self);
12 BASEKIT_API void UArray_negate(const UArray *self);
14 // basic vector math
16 BASEKIT_API void UArray_add_(UArray *self, const UArray *other);
17 BASEKIT_API void UArray_subtract_(UArray *self, const UArray *other);
18 BASEKIT_API void UArray_multiply_(UArray *self, const UArray *other);
19 BASEKIT_API void UArray_divide_(UArray *self, const UArray *other);
20 BASEKIT_API double UArray_dotProduct_(const UArray *self, const UArray *other);
22 // basic scalar math
24 BASEKIT_API void UArray_addScalarDouble_(UArray *self, double v);
25 BASEKIT_API void UArray_subtractScalarDouble_(UArray *self, double v);
26 BASEKIT_API void UArray_multiplyScalarDouble_(UArray *self, double v);
27 BASEKIT_API void UArray_divideScalarDouble_(UArray *self, double v);
29 // bitwise logic
31 BASEKIT_API void UArray_bitwiseOr_(UArray *self, const UArray *other);
32 BASEKIT_API void UArray_bitwiseAnd_(UArray *self, const UArray *other);
33 BASEKIT_API void UArray_bitwiseXor_(UArray *self, const UArray *other);
34 BASEKIT_API void UArray_bitwiseNot(UArray *self);
36 // bitwise ops
38 BASEKIT_API void UArray_setAllBitsTo_(UArray *self, uint8_t aBool);
39 BASEKIT_API uint8_t UArray_byteAt_(UArray *self, size_t i);
40 BASEKIT_API int UArray_bitAt_(UArray *self, size_t i);
41 BASEKIT_API void UArray_setBit_at_(UArray *self, int b, size_t i);
42 BASEKIT_API UArray * UArray_asBits(const UArray *self);
43 BASEKIT_API size_t UArray_bitCount(UArray *self);
45 // boolean logic
47 BASEKIT_API void UArray_logicalOr_(UArray *self, const UArray *other);
48 BASEKIT_API void UArray_logicalAnd_(UArray *self, const UArray *other);
50 // trigonometry
52 BASEKIT_API void UArray_sin(UArray *self);
53 BASEKIT_API void UArray_cos(UArray *self);
54 BASEKIT_API void UArray_tan(UArray *self);
56 BASEKIT_API void UArray_asin(UArray *self);
57 BASEKIT_API void UArray_acos(UArray *self);
58 BASEKIT_API void UArray_atan(UArray *self);
60 //void UArray_atan2(UArray *self, const UArray *other);
62 BASEKIT_API void UArray_sinh(UArray *self);
63 BASEKIT_API void UArray_cosh(UArray *self);
64 BASEKIT_API void UArray_tanh(UArray *self);
66 BASEKIT_API void UArray_exp(UArray *self);
67 BASEKIT_API void UArray_log(UArray *self);
68 BASEKIT_API void UArray_log10(UArray *self);
70 //void UArray_pow(UArray *self, const UArray *other);
72 BASEKIT_API void UArray_sqrt(UArray *self);
73 BASEKIT_API void UArray_ceil(UArray *self);
74 BASEKIT_API void UArray_floor(UArray *self);
75 BASEKIT_API void UArray_abs(UArray *self);
76 BASEKIT_API void UArray_round(UArray *self);
78 //void UArray_ldexp(UArray *self, const UArray *other);
79 //void UArray_fmod(UArray *self, const UArray *other);
81 BASEKIT_API void UArray_square(UArray *self);
82 BASEKIT_API void UArray_normalize(UArray *self);
84 BASEKIT_API void UArray_crossProduct_(UArray *self, const UArray *other);
85 BASEKIT_API double UArray_distanceTo_(const UArray *self, const UArray *other);
87 // extras
89 BASEKIT_API double UArray_sumAsDouble(const UArray *self);
90 BASEKIT_API double UArray_productAsDouble(const UArray *self);
91 BASEKIT_API double UArray_arithmeticMeanAsDouble(const UArray *self);
92 BASEKIT_API double UArray_arithmeticMeanSquareAsDouble(const UArray *self);
93 BASEKIT_API double UArray_maxAsDouble(const UArray *self);
94 BASEKIT_API double UArray_minAsDouble(const UArray *self);
95 BASEKIT_API void UArray_Max(UArray *self, const UArray *other);
96 BASEKIT_API void UArray_Min(UArray *self, const UArray *other);
98 // hash
100 BASEKIT_API void UArray_changed(UArray *self);
101 BASEKIT_API uintptr_t UArray_calcHash(UArray *self);
102 BASEKIT_API uintptr_t UArray_hash(UArray *self);
103 BASEKIT_API int UArray_equalsWithHashCheck_(UArray *self, UArray *other);
105 // indexes
107 BASEKIT_API void UArray_duplicateIndexes(UArray *self);
108 BASEKIT_API void UArray_removeOddIndexes(UArray *self);
109 BASEKIT_API void UArray_removeEvenIndexes(UArray *self);
111 BASEKIT_API void UArray_reverseItemByteOrders(UArray *self);