Commit graph

53 commits

Author SHA1 Message Date
Leonardo de Moura
8f2fe273ea refactor(*): isolate std::thread dependency
This commit allows us to build Lean without the pthread dependency.
It is also useful if we want to implement multi-threading on top of Boost.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-09 15:20:26 -08:00
Leonardo de Moura
f7e8545e97 refactor(frontends/lua): rename leanlua_state to script_state, and move it to util
This commit also minimizes the dependencies of script_state.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-27 14:57:36 -08:00
Leonardo de Moura
a6f6f49b5f refactor(frontends/lua): add lua_migrate_fn, and make copy_values modular
copy_values is not a big if-then-else anymore.
Before this change, whenever we added a new kind of userdata, we would have to update copy_values.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-27 10:32:19 -08:00
Leonardo de Moura
956f203a55 refactor(bindings/lua): move Lua bindings to the file associated with them
The directory bindings/lua was getting too big and had too many dependencies.
Moreover, it was getting too painful to edit/maintain two different places.
Now, the bindings for module X are in the directory that defines X.
For example, the bindings for util/name.cpp are located at util/name.cpp.

The only exception is the kernel. We do not want to inflate the kernel
with Lua bindings. The bindings for the kernel classes are located
at bindings/kernel_bindings.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-26 19:15:56 -08:00
Leonardo de Moura
31abc00db8 chore(*): add LCOV_EXCL_LINE to lean_unreachable statements
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-11 09:19:38 -08:00
Leonardo de Moura
1d18f60dd5 fix(numerics): add missing numeric_traits<float>::zero()
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-10-28 07:47:23 -07:00
Leonardo de Moura
e208309abd refactor(numerics): rename power operator to pow, the idea is to follow the C/C++ name convention for the power operator
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-10-21 17:23:56 -07:00
Leonardo de Moura
f1d9312521 feat(numerics/zpz): add numeric_traits for zpz numerals
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-10-18 14:41:18 -07:00
Leonardo de Moura
1429cc9df2 feat(numerics): add finite field Z/pZ
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-10-18 13:27:28 -07:00
Leonardo de Moura
cf2c0f8ebb feat(numerics): add gcd and extended gcd templates (for primitive types)
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-10-16 18:18:20 -07:00
Leonardo de Moura
39f68ed0d6 feat(numerics): add is_prime function
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-10-16 17:25:08 -07:00
Leonardo de Moura
105f55c68b feat(numerics): add zero() method to all numeric_traits
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-10-16 16:55:17 -07:00
Leonardo de Moura
467eff4662 add(numerics): add prime number generator/iterator
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-10-16 16:05:45 -07:00
Soonho Kong
4602dfd209 test(util/numerics): more tests to improve coverage 2013-09-28 23:38:17 -07:00
Leonardo de Moura
6477708d78 refactor(debug): improve lean_unreachable(), now we can avoid 'fake' return statements
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-25 21:27:20 -07:00
Leonardo de Moura
dae654e4c6 Track memory usage. Add new CMake option TRACK_MEMORY_USAGE (It is ON by default).
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-20 12:32:12 -07:00
Soonho Kong
ab6ca82e6f Update to suppress unused-parameter warnings 2013-09-19 22:40:34 -07:00
Leonardo de Moura
df054477eb Remove unnecessary TODOs.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-17 13:33:52 -07:00
Soonho Kong
dcc917a6b4 Use "sprintf" instead of "snprintf" because cygwin doesn't support "snprintf" 2013-09-15 01:38:21 -07:00
Soonho Kong
60903d3cea Fix cygwin build which was failed due to snprintf 2013-09-14 17:11:37 -07:00
Soonho Kong
bc60b47295 Apply coding style 2013-09-13 18:48:09 -07:00
Leonardo de Moura
bcc3827a99 Modify Doxygen file to extract all elements even the undocumented ones. Disable warnings for undocumented entities. Add extra comments.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-13 13:46:22 -07:00
Leonardo de Moura
8c735f1daa Use consistent coding style for spaces after ','
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-13 12:49:03 -07:00
Soonho Kong
5c3866cd71 Use fullpath in #include directives, add missing STL headers 2013-09-13 03:35:29 -07:00
Leonardo de Moura
26097475fd Use fullpath in #include directives.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-09-12 20:04:10 -07:00
Soonho Kong
fae6c29237 Fix memory leaks in mpfp.h 2013-09-10 13:26:14 -07:00
Leonardo de Moura
42a7094ca2 Fix bug in display_decimal. Add more mpq tests
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-23 09:42:49 -07:00
Leonardo de Moura
65b4845fbc Add more tests to improve coverage. Fix bug in mpz.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-18 00:28:50 -07:00
Soonho Kong
a6f3122146 Fix cygwin error caused by the use of thread_local in numerics/float class 2013-08-15 13:49:15 -07:00
Soonho Kong
eb29a67395 Fix mpfp::operator^= to resolve operator overloading problem 2013-08-14 23:49:26 -07:00
Soonho Kong
43b25a0231 Add operator<(mpq, double) to mpq 2013-08-14 13:45:29 -07:00
Soonho Kong
70f383eb82 Add unary minus operator overloadings to mpq & mpfp 2013-08-14 00:01:03 -07:00
Soonho Kong
5f143f164e Fix numeric_traits<mpfp>::pi constants 2013-08-13 20:09:06 -07:00
Soonho Kong
02900e2c83 Add abs/floor/ceil to double/float/mpq/mpfp 2013-08-13 20:09:06 -07:00
Soonho Kong
e123dd8e58 Use numeric_traits<mpfp>::get_mpfp_rnd() as a default rounding mode in mpfp operations 2013-08-13 00:35:14 -07:00
Leonardo de Moura
fb56869aae Fix cygwin problem.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-12 15:22:08 -07:00
Soonho Kong
71e10a0336 Add missing initialization of numeric_traits<mpfp>::rnd 2013-08-12 14:58:17 -07:00
Leonardo de Moura
2ad9c89684 Fix memory leak in mpfp. Add mpfp finalizer to avoid Valgrind warnings.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-12 11:36:15 -07:00
Leonardo de Moura
f79c0d3546 Add support for cygwin
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-10 14:21:13 -07:00
Soonho Kong
375bc817cc Add more to mpfp 2013-08-09 22:41:07 -07:00
Soonho Kong
0f48f73e14 Add constants and transcendental functions to mpfp 2013-08-07 19:32:15 -07:00
Soonho Kong
03dc15868b Add more operator overloadings to mpfp 2013-08-07 19:32:15 -07:00
Soonho Kong
93b99cf1ec Add constants(Pi, 1/2Pi, 2Pi) to double, float, and mpq 2013-08-07 19:32:03 -07:00
Soonho Kong
2a8c9e9c06 Reformat mpfp.h 2013-08-07 19:32:03 -07:00
Soonho Kong
d3dbcadf8b Add placeholders for transcendental functions in mpbq & mpq 2013-08-07 19:32:02 -07:00
Leonardo de Moura
84de625ee4 Rename pp functions (that do not use format lib) to print
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-07 12:10:10 -07:00
Leonardo de Moura
722e2b0ed4 Reformat code (make formating more consistent)
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-08-07 08:17:33 -07:00
Soonho Kong
5efd2fdd6f Update util/numerics/CMakeLists.txt to add mpfp, double, float 2013-08-06 20:01:09 -07:00
Soonho Kong
fb41a4f5a3 Add numeric_traits for double and float 2013-08-06 20:00:37 -07:00
Soonho Kong
d22b4bc9f1 Add mpfp, a wrapper for MPFR 2013-08-06 19:59:58 -07:00