rendered paste body#include <iostream>#include <vector>using std::cout;inline bool validnet(const int &activators, const int &repressors){ return (activators & repressors) == 0;}inline bool isfp(int activators, int repressors, int state){ int ns = 0; for(int b = 0; b < 4; ++b) { int a = activators & 0xf; int r = repressors & 0xf; // Require that all regulated bits = 1 // It matters not whether the unregulated genes are all 0 or all 1. if((state & a) == a && (~state & r) == r) ns |= 1 << b; activators >>= 4; repressors >>= 4; } return ns == state;}inline int fixedpoints(int activators, int repressors){ int fps = 0; for(int state = 0; state < 16; ++state) if(isfp(activators, repressors, state)) ++fps; return fps;}void printfphistogram(){ std::vector<int> fphistogram(17, 0); for(int act = 0; act < 0x10000; ++act) for(int rep = 0; rep < 0x10000; ++rep) if(validnet(act, rep)) ++fphistogram[fixedpoints(act, rep)]; cout << "#FPs\tcount\n"; for(int i = 0; i < 17; ++i) cout << i << "\t" << fphistogram[i] << "\n";}int main(){ printfphistogram();}