| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
matching float type based on size
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
base_math.hpp, cleaning up int_math.hpp and float_math.hpp
float_math.hpp:
- Using std::is_floating_point_v<T> instead of !std::numeric_limits<T>::is_integer
- round_to_int() returns `typename jau::sint_bytes<sizeof(T)>::type`,
i.e. proper integer-sized type
- row_to_string() + mat_to_string() definition in header
and using template floating point type
int_math.hpp:
- Adding equals() w/ integration template type,
complementing the floating point type variant
-
|
|
|
|
| |
used C++ version macro __cplusplus and compiler-id macros
|
|
|
|
| |
operator*(const Vec4f&)
|
|
|
|
| |
toMatrix(Mat4f&)
|
| |
|
|
|
|
| |
Drop passing temporaries as they are very cheap in native land; Add test_math_quaternion (WIP)
|
| |
|
| |
|
|
|
|
| |
via acos(dot(..))
|
|
|
|
| |
[v]format_string(..) for [v]printf(..) formatting a string
|
|
|
|
| |
names
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
gfxbox2 and certain Jogl of mine classes to jau::math::**
Chosen CamelCase (PascalCase) for class types, differing from gfxbox2.
Status:
- Compile clean
- Tests
-- test_math_float.cpp: Covers epsilon/zero/equal/compare/IEC559 of float_math.hpp
-- test_math_vec.cpp: Covers Vec2f + Vec3f (TODO)
-- TODO: Mat4f, Quaternion, Frustum, ...
|
| |
|
|
|
|
| |
warning (=error)
|
| |
|
|
|
|
| |
{machine_->}equal{->s}(), add compare(), is_zero(), round_to_int(), adeg_to_rad(), rad_to_adeg()
|
|
|
|
| |
(Refine API doc, MathError: add ro-access to math_error_t)
|
|
|
|
| |
PRAGMA_DISABLE_WARNING_RESTRICT (gcc)
|
| |
|
|
|
|
|
|
|
| |
and whether native int128_t is available
We allow a compile time override via define JAU_FORCE_MP_WORD_32_BITS
as used by test_big_int01.*
|
|
|
|
| |
dec-string decoding (ctor), ctor via memory region, binary_encode() and general free math func wrapper
|
|
|
|
| |
(no leading '0'), return size_t
|
|
|
|
|
|
|
|
|
| |
potentially reduction in addressable space
big_int_t opearations target vast addressable memory space,
hence don't reduce it artificially.
nsize_t is intended for smaller memory indices only.
|
|
|
|
|
|
|
|
|
|
|
|
| |
'boolean isLittleEndian'; Remove 'nsize_t byte_offset' and rely on given pointer
Using a byte offset of type nsize_t would potentially reduce addressable space on a given platform
and is not required for C++ as the pointer arithmetic can be used by the caller.
Dropping the byte offset exposed the weakness of using a bool type for the little- big-endian switch,
as an integer is automatically converted to bool.
Hence we now use an enum class lb_endian only denoting little-, big-endian
and additional native (the actual platform's encoding).
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(see below)
- ~big_int_t() -> calls clear() to ensure memory is zero'ed out (secure)
- Adjust 'noexcept', i.e. add where safe & drop where exceptions can be thrown
- Throw jau::MathError exceptions: MathDomainError and MathDivByZeroError,
resolving error handling
- Make certain functions private, keep API clean
- Add modulo operator overload and other certain useful ops (incomplete)
-
|
|
|
|
| |
Catch2's `REQUIRE_THROWS_MATCHES`; Let message() and backtrace() return const string& instead of copy
|
|
|
|
| |
specialisations
|
|
|
|
|
|
|
|
|
|
|
|
| |
crypto-properties, also just allowing to utilize big intgral math
Not all operations are supported yet,
however - a quick bringup test for simple arithmetic and to_*_string() works.
Merged with jaulib functionality (condensed)
and dropped assembly ops in big_int_ops (TODO: Add back).
Uses the Constant Time (CT) functionality from ct_utils.hpp and int_math_ct.hpp.
|
|
|
|
|
|
| |
commit)
Botan and jaulib is released under the Simplified BSD License (see license.txt)
|
|
|
|
|
|
|
|
|
| |
'ct_' as desired for cryptographic operations
For more information about constant time programming see
Wagner, Molnar, et al "The Program Counter Security Model"
This use-case has been retrieved from the Botan cryptography library.
|
| |
|
| |
|
|
|
|
| |
and alight_to
|
|
|
|
| |
bit_count(); Split perf-bench of test_int_math01 -> test_int_math_perf01
|
|
|
|
|
|
|
|
|
| |
JAU_INT_MATH_EXPERIMENTAL, ..
tested performance on x86_64 shows that the correct versions with branching abs, min, max and clamp
are of equal speed, if not even slightly faster.
hence it is probably sane and safe to use the correct versions only ;-)
|
|
|
|
| |
uint128_t
|
|
|
|
| |
{add,sub,mul}_overflow(); Add unit tests (test_int_math.cpp)
|
|
|
|
| |
native or full uint128_t etc definitions; 'dp' stands for data-pack
|
| |
|
| |
|
|
|
|
| |
a subset
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
jau::io::ByteInStream_[URL|Feed]'s available() and read() operation.
jau::ringbuffer: Add 'End of Stream' (EOS) concept to unblock all read-operations from this point onwards
and unblocking a potentially currently blocked reader thread.
The EOS concept is required to allow blocking operations from a consumer (reader) w/o knowledge of the content-size,
having the producer (writer) signaling EOS at the end and unblocking all read-operations.
Fuerther, after unblocking a potentially blocker reader-thread,
the failure criteria is now being checked as for the `timeout` case.
This allows a read-thread being unblocked (interrupted) after writing the last chunk
and hence picking up this last written data.
+++
Utilize ringbuffer EOS concept for jau::io::ByteInStream_[URL|Feed]'s available() and read() operation,
i.e. both methods utilize blocking operations.
After the producer (URL: Our Curl consume callback; Feed: Manual set_eof()) marks EOS on the ringbuffer,
all blocking read-operations are permanently unblocked and a current read-thread also interrupted.
+++
Passed test_bytestream01 and test_iostream01
while causing full CPU load via `stress --cpu $(getconf _NPROCESSORS_ONLN)`.
|