This file contains 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; |
This file contains 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 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 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 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 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; |