int main(int argc, char* argv[])
{
    std::cout << "Pentomino solver\n";

    colorizePieces();

    std::time_t time1;
    std::time(&time1);

#if 1
    // Solve square in 1/8.
    for (int row = 0; row <= 3; ++row)
    {
        for (int col = 0; col <= row; ++col)
        {
            solveSquare(row, col);
        }
    }
#else
    // Solve square in centre only.
    solveSquare(3, 3);
#endif

    std::time_t time2;
    std::time(&time2);
    double seconds = std::difftime(time2, time1);

    std::cout << solutionCount << " solutions found in " << seconds << " seconds." << std::endl;

    return 0;
}
Exemplo n.º 2
0
bool Intersect::intersect_VE(const Vec3f& a0, const Vec3f& b0, const Vec3f& p0,
                             const Vec3f& a1, const Vec3f& b1, const Vec3f& p1,
                             const Vec3f& L)
{
  Vec3f va, vb, vp;
  va = a1 - a0;
  vb = b1 - b0;
  vp = p1 - p0;

  FCL_REAL a, b, c;
  computeCubicCoeff_VE(a0, b0, p0, va, vb, vp, L, &a, &b, &c);

  if(isZero(a) && isZero(b) && isZero(c))
    return true;

  return solveSquare(a, b, c, a0, b0, p0, va, vb, vp);

}