2019-01-08 16:09:25 +01:00
|
|
|
// Copyright 2004, Ondra Kamenik
|
|
|
|
|
|
|
|
#include "tl_static.hh"
|
2019-02-21 18:46:53 +01:00
|
|
|
#include "pascal_triangle.hh"
|
2019-01-08 16:09:25 +01:00
|
|
|
|
2019-02-21 18:46:53 +01:00
|
|
|
#include <mutex>
|
2019-01-08 16:09:25 +01:00
|
|
|
|
|
|
|
/* Note that we allow for repeated calls of |init|. This is not normal
|
|
|
|
and the only purpose of allowing this is the test suite. */
|
|
|
|
|
2019-02-21 18:46:53 +01:00
|
|
|
namespace TLStatic
|
2019-01-08 16:09:25 +01:00
|
|
|
{
|
2019-02-21 18:46:53 +01:00
|
|
|
EquivalenceBundle ebundle(1);
|
|
|
|
PermutationBundle pbundle(1);
|
|
|
|
std::mutex mut;
|
2019-01-08 16:09:25 +01:00
|
|
|
|
2019-02-21 18:46:53 +01:00
|
|
|
const EquivalenceSet &
|
|
|
|
getEquiv(int n)
|
|
|
|
{
|
|
|
|
return ebundle.get(n);
|
|
|
|
}
|
2019-01-08 16:09:25 +01:00
|
|
|
|
2019-02-21 18:46:53 +01:00
|
|
|
const PermutationSet &
|
|
|
|
getPerm(int n)
|
|
|
|
{
|
|
|
|
return pbundle.get(n);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
init(int dim, int nvar)
|
|
|
|
{
|
|
|
|
std::lock_guard<std::mutex>{mut};
|
|
|
|
ebundle.generateUpTo(dim);
|
|
|
|
pbundle.generateUpTo(dim);
|
|
|
|
|
|
|
|
PascalTriangle::ensure(nvar, dim);
|
|
|
|
}
|
2019-01-08 16:09:25 +01:00
|
|
|
}
|