ADS
Algorithms and Data Structures
Toggle main menu visibility
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
64
namespace
ADS
65
{
66
68
struct
Tile
69
{
70
int
up
,
71
right
,
72
down
,
73
left
;
74
};
75
76
using
Tiling
= std::vector< std::vector< int > >;
77
99
inline
bool
legalTiling
(
const
std::vector< Tile > & D ,
int
n ,
100
const
Tiling
& T );
101
125
inline
std::optional< Tiling >
squareTiling
(
const
std::vector< Tile > & D ,
126
int
n );
127
158
inline
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
/*--------------------------------------------------------------------------*/
Contract.h
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
ADS::squareTiling
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)
ADS::linearTiling
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...
ADS::legalTiling
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...
ADS
Definition
ADT.h:96
ADS::Tiling
std::vector< std::vector< int > > Tiling
the tile of ( i , j )
Definition
Domino.h:76
ADS::Tile
a tile: the colors of its four sides
Definition
Domino.h:69
ADS::Tile::right
int right
the color of the right side
Definition
Domino.h:71
ADS::Tile::up
int up
the color of the upper side
Definition
Domino.h:70
ADS::Tile::left
int left
the color of the left side
Definition
Domino.h:73
ADS::Tile::down
int down
the color of the lower side
Definition
Domino.h:72
ADS
complexity
Domino.h
Generated by
1.17.0