C Programming Language ====================== Learning C ---------- - **The best way to learn programming is, always, writing your own code!** - `Why Code in C Anymore?….Instead of C++ `__ - C still has a little advantage on the performance and portability. - `CS2022: Introduction to C at Cornell `__ - Lecture slides are available. - `learn-c.org free interactive C tutorial `__ - `30-seconds-of-c `__ - Curated collection of useful C Programming tutorials, snippets, and projects that you can understand in 30 seconds or less Useful Libraries ---------------- Performance ~~~~~~~~~~~ - `Optimization of Computer Programs in C `__ - By Michael Lee. “It focuses on minimizing time spent by the CPU and gives sample source code transformations that often yield improvements. Memory and I/O speed improvements are also discussed.” - `Tips for Optimizing C/C++ Code `__ - Very practical and useful guides for optimizing C/C++. - `mimalloc - mimalloc is a compact general purpose allocator with excellent performance `__ - By Microsoft. mimalloc (pronounced “me-malloc”) is a general purpose allocator with excellent performance characteristics. It is a drop-in replacement for malloc and can be used in other programs without code changes. Numerical ~~~~~~~~~ - `GSL - GNU Scientific Library `__ - The library provides a wide range of mathematical routines such as random number generators, special functions and least-squares fitting. There are over 1000 functions in total with an extensive test suite. - The `online reference manual can be found here `__. - `FFTW `__ - **FFTW** is a C subroutine library for computing the discrete Fourier transform (DFT) in one or more dimensions, of arbitrary input size, and of both real and complex data (as well as of even/odd data, i.e. the discrete cosine/sine transforms or DCT/DST). - The `online manual can be found here `__ Astronomy Related ~~~~~~~~~~~~~~~~~ - `cfitsio - ANSI C routines for reading and writing FITS format data files `__ Specific Topics --------------- Multiprocessing ~~~~~~~~~~~~~~~ GPU Enhancement ~~~~~~~~~~~~~~~ Code to Study ------------- - `sextractor - Extract catalogs of sources from astronomical images `__ - `psfex - Generate PSF super-tabulated models `__ - `CCL - DESC Core Cosmology Library `__ - Also teaches you how to interact with Python. - `Corrfunc - fast correlation functions on the CPU `__ - **utils** are written in C; and wrapped in Python. On Interacting with Python ~~~~~~~~~~~~~~~~~~~~~~~~~~ - `sep - Python and C library for source extraction and photometry `__ - Using **Cython**. - `cosmology - Some code for calculating cosmological distances `__ - By Erin Sheldon. Using **CPython** - `smatch - Code to match points on the sphere using the healpix scheme `__ - By Erin Sheldon. Using **CPython**