TraceMaker
C++ API of the engine
Loading...
Searching...
No Matches
legalize.hpp File Reference

(D) Legalisation (design doc 04 §3 D): Tetris-style greedy, largest parts first, each part moved to the nearest legal position (minimum Euclidean displacement over a lattice searched in rings) from its target. More...

#include <string>
#include "place/legality.hpp"

Go to the source code of this file.

Classes

struct  tmk::place::LegaliseStats

Namespaces

namespace  tmk
namespace  tmk::place

Functions

LegaliseStats tmk::place::legalise (const Problem &p, Placement &pl, bool only_illegal, Coord cell=0, const std::vector< int > *first=nullptr)
 only_illegal: parts that are already legal (inside the board, conflict-free) stay where they are and only the others are re-placed (refine mode).

Detailed Description

(D) Legalisation (design doc 04 §3 D): Tetris-style greedy, largest parts first, each part moved to the nearest legal position (minimum Euclidean displacement over a lattice searched in rings) from its target.

Candidates are screened with the conservative occupancy raster and always confirmed by the exact test.

Definition in file legalize.hpp.