/**********************************************************

This software is part of J.-S. Caux's ABACUS++ library.

Copyright (c) 2006-9.

-----------------------------------------------------------

File:  JSC_Combi.h

Purpose:  Declares combinatorics-related classes and functions.

Last modified:  08/10/2009

***********************************************************/

#ifndef _COMBI_
#define _COMBI_

#include "JSC.h"

namespace JSC {

  //***********************************************************************

  class Choose_Table {

  private:
    int Npower;
    int Npowerp1;
    int dim;
    unsigned long long int* table;
    void Fill_table ();

  public:
    Choose_Table ();
    Choose_Table (int Npower_ref);
    Choose_Table (const Choose_Table& Ref_Choose_Table); // constructs a new object from an existing one
    int power();  // returns Npower
    unsigned long long int choose (int N, int M);
    ~Choose_Table ();

  };


  std::ostream& operator<< (std::ostream& s, Choose_Table& Ref_table);


} // namespace JSC

#endif