implemented flat spatial pooler in cpp