• Non-numerical stuff
    • My C macro library:
      • kbtree.h (HTML): efficient B-tree library in C.
      • khash.h (HTML): fast and light-weighted hash table library in C. See also this post and this one.
      • ksort.h (HTML): fast and convenient library for sorting and k-small algorithms in C. See also this post.
      • kvec.h (HTML): simple vector container in C. Benchmark codes: kvec_test.cc. See also this post.
    • Source code for benchmark on unordered dictionary data structures. See this page for the result.
    • My C++ template library. Note that I have shifted my focus on C macro library and the template library is not actively maintained. You can easily find good implementations in SGI STL. However, from the benchmarks you can see that my library still has some advantages. If you like to use the template library and find bugs or require more features, please feel free to contact with me.
      • High-performance hash template library: khash.hh (HTML). Benchmarking programs are also available: hash_test.cc (HTML) and time_hash_map.cc (HTML). See also this post.
      • Sort template library: sort.hh (HTML) and sort_test.cc (HTML). This library includes high-performance iterative introsort (i.e. improved quicksort), iterative bottom-up mergesort and binary heapsort. See also this post.
    • Simple memory management by Kernighan & Ritchie: kalloc.h and kalloc.c (HTML or PDF). See also this post.
    • GNU sort for string-number mixed comparison: sort-1.22a.tar.bz2. This version also includes some performance enhancement. See also this post.
  • Numerical algorithms
    • Normal and Gamma random generator: genran.h and genran.c (HTML). Adapted from GSL.
    • Hooke-Jeeves' method for derivative-free nonlinear programming: min.hh (HTML). This is a C++ template function. See also this post.
    • NEWUOA method for derivative-free nonlinear programming: newuoa.hh (HTML). C++ template function. Adapted from Powell's Fortran program. A benchmark on this method is available here. See also this post.