Package 'wallis'

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

Help Index


All ordered pairs

Description

All ordered pairs

Usage

all_ordered_pairs(n)

Arguments

n

Size of underlying set

Value

A list of all ordered pairs.


All unordered pairs

Description

All unordered pairs

Usage

all_pairs(n)

Arguments

n

Size of underlying set.

Value

A list of all unordered pairs.


Is pair p available in R at cell e?

Description

Is pair p available in R at cell e?

Usage

avail(R, p, e)

Arguments

R

A partial Room square.

p

A pair.

e

An empty cell of R.

Value

True if and only if the pair p can be placed in cell e in R.


Pairs used in R

Description

Pairs used in R

Usage

distinct_pairs(R)

Arguments

R

A Room square.

Value

A list of the distinct pairs that appear in R.


Empty cells of a partial Room square

Description

Empty cells of a partial Room square

Usage

empty_cells(R)

Arguments

R

A partial Room square.

Value

A list of empty cells of R.


Create a partial Room square with no filled cells

Description

Create a partial Room square with no filled cells

Usage

empty_room(n = 5)

Arguments

n

Size of partial Room square to create.

Value

A partial Room square of size n with no filled cells.


Horizontal and vertical grid lines

Description

Horizontal and vertical grid lines

Usage

grid_lines(n_rows, n_cols)

Arguments

n_rows

Number of rows.

n_cols

Number of columns.

Value

A tibble with columns x, y, xend and yend.


Horizontal grid lines

Description

Horizontal grid lines

Usage

horiz_lines(n_rows, n_cols)

Arguments

n_rows

Number of rows.

n_cols

Number of columns.

Value

A tibble with columns x, y, xend and yend.


Is A Room square column latin?

Description

Is A Room square column latin?

Usage

is_col_latin(R)

Arguments

R

A Room square

Value

True if and only if R is column latin.


Does a column satisfy the latin constraint?

Description

Does a column satisfy the latin constraint?

Usage

is_col_latin_i(R, i)

Arguments

R

A Room square

i

A column index

Value

True if and only if column i of R satisfies the latin constraint.


Is R a maximal partial Room square?

Description

Is R a maximal partial Room square?

Usage

is_maximal_proom(R, n)

Arguments

R

A partial Room square.

n

Order of R.

Value

True if and only if R is a maximal partial Room square, False otherwise.


Is R a partial Room square?

Description

Is R a partial Room square?

Usage

is_partial_room(R)

Arguments

R

A partial Room square.

Value

True if and only if R is a partial Room square, False otherwise.


Is R a Room square?

Description

Is R a Room square?

Usage

is_room(R)

Arguments

R

A Room square.

Value

True if and only if R is a Room square, False otherwise.


Is a Room square row latin?

Description

Is a Room square row latin?

Usage

is_row_latin(R)

Arguments

R

A Room square

Value

True if and only if R is row latin.


Does a row satisfy the latin constraint?

Description

Does a row satisfy the latin constraint?

Usage

is_row_latin_i(R, i)

Arguments

R

A Room square

i

A row index

Value

True if and only if row i of R satisfies the latin constraint.


Number of filled cells in a partial Room square

Description

Number of filled cells in a partial Room square

Usage

n_filled_cells(R)

Arguments

R

A partial Room square

Value

The number of filled cells in R.


Remove both elements of a pair from a list

Description

Remove both elements of a pair from a list

Usage

remove_both(X, p)

Arguments

X

A list

p

A pair

Value

The list X with both elements of p removed (if they exist).


Create a Room square

Description

Create a Room square

Create a Room square

Format

An R6Class generator object

Methods

Public methods


Method new()

Usage
Room$new(size = NA)
Arguments
size

the order of the Room square to be created


Method set()

Usage
Room$set(e, p)

Method is_available()

Usage
Room$is_available(e, p)

Method clone()

The objects of this class are cloneable with this method.

Usage
Room$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


Symbols visible from cell e

Description

Symbols visible from cell e

Usage

see(R, e)

Arguments

R

A Room square.

e

A cell in R.

Value

A list of symbols visible in R from cell e.


Symbols visible from cell (row, col) in R

Description

Symbols visible from cell (row, col) in R

Usage

see2(R, row, col)

Arguments

R

A Room square.

row

A row index.

col

A column index.

Value

A list of symbols visible in R from cell (col, rol).


Pairs not used in a partial Room square

Description

Pairs not used in a partial Room square

Usage

unused_pairs(R, n)

Arguments

R

A partial Room square.

n

Order of R.

Value

A list of pairs not used in R.


Vertical grid lines

Description

Vertical grid lines

Usage

vertical_lines(n_rows, n_cols)

Arguments

n_rows

Number of rows.

n_cols

Number of columns.

Value

A tibble with columns x, y, xend and yend.


Volume of a partial Room square

Description

Volume of a partial Room square

Usage

volume(R)

Arguments

R

A partial Room square.

Value

The volume of R.