Title: | Room squares in R |
---|---|
Description: | Room squares in R. |
Authors: | Matthew Henderson [aut, cre] |
Maintainer: | Matthew Henderson <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.0 |
Built: | 2024-11-22 05:07:19 UTC |
Source: | https://github.com/MHenderson/wallis |
All ordered pairs
all_ordered_pairs(n)
all_ordered_pairs(n)
n |
Size of underlying set |
A list of all ordered pairs.
All unordered pairs
all_pairs(n)
all_pairs(n)
n |
Size of underlying set. |
A list of all unordered pairs.
Is pair p available in R at cell e?
avail(R, p, e)
avail(R, p, e)
R |
A partial Room square. |
p |
A pair. |
e |
An empty cell of R. |
True if and only if the pair p can be placed in cell e in R.
Pairs used in R
distinct_pairs(R)
distinct_pairs(R)
R |
A Room square. |
A list of the distinct pairs that appear in R.
Empty cells of a partial Room square
empty_cells(R)
empty_cells(R)
R |
A partial Room square. |
A list of empty cells of R.
Create a partial Room square with no filled cells
empty_room(n = 5)
empty_room(n = 5)
n |
Size of partial Room square to create. |
A partial Room square of size n with no filled cells.
Horizontal and vertical grid lines
grid_lines(n_rows, n_cols)
grid_lines(n_rows, n_cols)
n_rows |
Number of rows. |
n_cols |
Number of columns. |
A tibble with columns x, y, xend and yend.
Horizontal grid lines
horiz_lines(n_rows, n_cols)
horiz_lines(n_rows, n_cols)
n_rows |
Number of rows. |
n_cols |
Number of columns. |
A tibble with columns x, y, xend and yend.
Is A Room square column latin?
is_col_latin(R)
is_col_latin(R)
R |
A Room square |
True if and only if R is column latin.
Does a column satisfy the latin constraint?
is_col_latin_i(R, i)
is_col_latin_i(R, i)
R |
A Room square |
i |
A column index |
True if and only if column i of R satisfies the latin constraint.
Is R a maximal partial Room square?
is_maximal_proom(R, n)
is_maximal_proom(R, n)
R |
A partial Room square. |
n |
Order of R. |
True if and only if R is a maximal partial Room square, False otherwise.
Is R a partial Room square?
is_partial_room(R)
is_partial_room(R)
R |
A partial Room square. |
True if and only if R is a partial Room square, False otherwise.
Is R a Room square?
is_room(R)
is_room(R)
R |
A Room square. |
True if and only if R is a Room square, False otherwise.
Is a Room square row latin?
is_row_latin(R)
is_row_latin(R)
R |
A Room square |
True if and only if R is row latin.
Does a row satisfy the latin constraint?
is_row_latin_i(R, i)
is_row_latin_i(R, i)
R |
A Room square |
i |
A row index |
True if and only if row i of R satisfies the latin constraint.
Number of filled cells in a partial Room square
n_filled_cells(R)
n_filled_cells(R)
R |
A partial Room square |
The number of filled cells in R.
Remove both elements of a pair from a list
remove_both(X, p)
remove_both(X, p)
X |
A list |
p |
A pair |
The list X with both elements of p removed (if they exist).
Create a Room square
Create a Room square
An R6Class
generator object
new()
Room$new(size = NA)
size
the order of the Room square to be created
set()
Room$set(e, p)
is_available()
Room$is_available(e, p)
clone()
The objects of this class are cloneable with this method.
Room$clone(deep = FALSE)
deep
Whether to make a deep clone.
Symbols visible from cell e
see(R, e)
see(R, e)
R |
A Room square. |
e |
A cell in R. |
A list of symbols visible in R from cell e.
Symbols visible from cell (row, col) in R
see2(R, row, col)
see2(R, row, col)
R |
A Room square. |
row |
A row index. |
col |
A column index. |
A list of symbols visible in R from cell (col, rol).
Pairs not used in a partial Room square
unused_pairs(R, n)
unused_pairs(R, n)
R |
A partial Room square. |
n |
Order of R. |
A list of pairs not used in R.
Vertical grid lines
vertical_lines(n_rows, n_cols)
vertical_lines(n_rows, n_cols)
n_rows |
Number of rows. |
n_cols |
Number of columns. |
A tibble with columns x, y, xend and yend.
Volume of a partial Room square
volume(R)
volume(R)
R |
A partial Room square. |
The volume of R.