Adaptively downsampling a curve

It's holiday shopping season and every one is obsessed with getting discounts and points. I, however, am looking for a slightly different discount on a slightly different collection of points. When we simulate a dynamical system (a system that evolves in time), the smaller the time step of a simulation, the more accurate it is. …

Advertisements

Inline virtual final

I was looking into virtual functions (that link is the most succinct exposition I have seen) for some of my code. And I began to think, huh, won't this slow things down? The code first has to go to a virtual table and then look up the correct function - that's a WHOLE extra step. …

C++: how to order class declarations

Of course, this is all a matter of opinion. When I started out writing C++ (back in the days of glBegin() and glEnd() ) I followed the convention (which I found in books and example code) of putting all the member variables first, then all the member functions. There was  much hand-wringing about whether the …

The DNA knows where the DNA comes from

We know that all cells in our bodies carry DNA in their nuclei. To a first order, all the DNA in our bodies is identical (As is normal with biology, there are exceptions, called chimeras which provide much material for the tabloids). However, we know that we are not homogenous blobs of cells of the …

Your microprocessor knows π

When I started out in electrical engineering we were given 8085 kits to play with. It was an 8-bit microprocessor. I used to know the instructions set by heart. I have fond memories of using a ruled college notebook to work out a program to do long division and then keying in the program opcode …

Chebyshev polynomials and Runge’s phenomenon – Computing Orbits (2)

Using polynomial fits to interpolate data can blow up in your face. To avoid this, use the non-uniformly spaced Chebyshev nodes as your fitting control points. For extra bonus bucks, use Chebyshev polynomials.

c++: the named argument tease

I love Python keyword arguments because I forget what the order of the arguments are, because sometimes I want to leave some arguments at default values, because I hate writing boilerplate. That is why I got so excited when I was going through the source code of samtools (If you are not in bioinformatics, for …