magic (version 1.5-9)

eq: Comparison of two magic squares

Description

Compares two magic squares according to Frenicle's method. Mnemonic is the old Fortran “.GT.” (for “Greater Than”) comparison et seq.

To compare magic square a with magic square b, their elements are compared in rowwise order: a[1,1] is compared with b[1,1], then a[1,2] with b[1,2], up to a[n,n]. Consider the first element that is different, say [i,j]. Then a<b if a[i,j]<b[i,j].

The generalization to hypercubes is straightforward: comparisons are carried out natural order.

Usage

eq(m1, m2)
ne(m1, m2)
gt(m1, m2)
lt(m1, m2)
ge(m1, m2)
le(m1, m2)
m1 %eq% m2
m1 %ne% m2
m1 %gt% m2
m1 %lt% m2
m1 %ge% m2
m1 %le% m2

Arguments

m1

First magic square

m2

Second magic square

See Also

as.standard

Examples

Run this code
# NOT RUN {
magic(4) %eq% magic.4n(1)
eq(magic(4) , magic.4n(1))
# }

Run the code above in your browser using DataLab