#include "permutation.h"




void Permute::printP() 
{
	int i;
	perms[count].resize(N);
	for (i=N-1; i>=0; i--)
		perms[count][i]=aa[P[i]];

	count++;

}
int Permute::factorial(int n)
{
	if (n<10)
		return factr[n];
	else
	  return factorial(n - 1) * n;
}
void Permute::GenMult(int n) {

	int j;

	if (ma[0] == n) printP();
	else {
		for (j=0; j<=t; j++)  {
			if (ma[j] > 0) {
				P[n-1] = j;
				ma[j]--;
				GenMult(n-1);
				ma[j]++;
				P[n-1] = 0;
			}
		}
	}
}

