This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| # Public domain power of 10 table generator for the Schubfach algorithm: | |
| # https://drive.google.com/file/d/1IEeATSVnEE6TkrHlCYNY2GjaraBjOT4f. | |
| # Author: Victor Zverovich | |
| import math | |
| # Range of decimal exponents [K_min, K_max] from the paper. | |
| dec_exp_min = -324 | |
| dec_exp_max = 292 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <benchmark/benchmark.h> | |
| #include <fmt/chrono.h> | |
| #include <fmt/compile.h> | |
| #include <ctime> | |
| static void year_month_day_strftime(benchmark::State& state) { | |
| srand(0); | |
| tm t; | |
| t.tm_year = rand() % 10000 - 1900; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <benchmark/benchmark.h> | |
| #include <fmt/compile.h> | |
| #include <fmt/os.h> | |
| #include <cstdio> | |
| #include <fstream> | |
| #if 1 //__cpp_lib_concepts>=201907L | |
| #include "../fast_io/include/fast_io.h" | |
| #include "../fast_io/include/fast_io_device.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Formatting library for C++ | |
| Copyright (c) 2012 - present, Victor Zverovich | |
| All rights reserved. | |
| Redistribution and use in source and binary forms, with or without | |
| modification, are permitted provided that the following conditions are met: | |
| 1. Redistributions of source code must retain the above copyright notice, this |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "asl.h" | |
| int main() { | |
| ASL *asl = ASL_alloc(ASL_read_fg); | |
| FILE *f = jac0dim("test.nl", 0); | |
| fg_read(f, 0); | |
| fint ne = 0; | |
| double x[] = { 0, 0 }; | |
| double objval = asl->p.Objval(asl, 0, x, &ne); | |
| printf("%g %d\n", objval, ne); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define FMT_HEADER_ONLY | |
| #include "format.h" | |
| struct Syschar { | |
| char c; | |
| Syschar(char c = 0) : c(c) {} | |
| operator char() const { return c; } | |
| }; | |
| namespace fmt { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "mp/nl-reader.h" | |
| enum Expr {OTHER, CONST}; | |
| struct ExprCounter : mp::NullNLHandler<Expr> { | |
| int num_divs; | |
| ExprCounter() : num_divs(0) {} | |
| Expr OnBinary(mp::expr::Kind kind, Expr lhs, Expr rhs) { | |
| if (kind == mp::expr::DIV && rhs != CONST) | |
| ++num_divs; |