ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
Domino.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*/
2/*----------------------------- File Domino.h ------------------------------*/
3/*--------------------------------------------------------------------------*/
41/*--------------------------------------------------------------------------*/
42/*----------------------------- DEFINITIONS --------------------------------*/
43/*--------------------------------------------------------------------------*/
44
45#ifndef __ADS_Domino
46 #define __ADS_Domino
47/* self-identification: #endif constant */
48
49/*--------------------------------------------------------------------------*/
50/*------------------------------ INCLUDES ----------------------------------*/
51/*--------------------------------------------------------------------------*/
52
53#include "ADS/Contract.h"
54
55#include <algorithm>
56#include <cstddef>
57#include <optional>
58#include <vector>
59
60/*--------------------------------------------------------------------------*/
61/*--------------------------- NAMESPACE ------------------------------------*/
62/*--------------------------------------------------------------------------*/
63
64namespace ADS
65{
66
68struct Tile
69{
70 int up ,
74 };
75
76using Tiling = std::vector< std::vector< int > >;
77
99inline bool legalTiling( const std::vector< Tile > & D , int n ,
100 const Tiling & T );
101
125inline std::optional< Tiling > squareTiling( const std::vector< Tile > & D ,
126 int n );
127
158inline bool linearTiling( const std::vector< Tile > & D , long n );
159
160/*--------------------------------------------------------------------------*/
161
162} // end( namespace ADS )
163
164/*--------------------------------------------------------------------------*/
165/*-------------------------- IMPLEMENTATION --------------------------------*/
166/*--------------------------------------------------------------------------*/
167
168#include "ADS/complexity/impl/Domino.tpp"
169
170/*--------------------------------------------------------------------------*/
171
172#endif /* Domino.h included */
173
174/*--------------------------------------------------------------------------*/
175/*--------------------------- End File Domino.h ----------------------------*/
176/*--------------------------------------------------------------------------*/
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
std::optional< Tiling > squareTiling(const std::vector< Tile > &D, int n)
a legal covering of the square, by backtrack, or nothing (also if or is empty)
bool linearTiling(const std::vector< Tile > &D, long n)
whether a strip of tiles from exists, ; false if or is empty, true for any if a cycle of tiles t...
bool legalTiling(const std::vector< Tile > &D, int n, const Tiling &T)
whether is a legal covering of the square by , with in ; false if , if is not or if a tile of i...
Definition ADT.h:96
std::vector< std::vector< int > > Tiling
the tile of ( i , j )
Definition Domino.h:76
a tile: the colors of its four sides
Definition Domino.h:69
int right
the color of the right side
Definition Domino.h:71
int up
the color of the upper side
Definition Domino.h:70
int left
the color of the left side
Definition Domino.h:73
int down
the color of the lower side
Definition Domino.h:72