eq                   package:magic                   R Documentation

_C_o_m_p_a_r_i_s_o_n _o_f _t_w_o _m_a_g_i_c _s_q_u_a_r_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     Compares two magic squares according to Fr\'{e}nicle'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.

_U_s_a_g_e:

     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

_A_r_g_u_m_e_n_t_s:

      m1: First magic square

      m2: Second magic square

_N_o_t_e:

     Rather clumsy function definition due to the degenerate case of 
     testing two identical matrices ('min(NULL)' is undefined).

     The two arguments are assumed to be matrices of the same size.  If
     not, an error is given.

_A_u_t_h_o_r(_s):

     Robin K. S. Hankin

_S_e_e _A_l_s_o:

     'as.standard'

_E_x_a_m_p_l_e_s:

     magic(4) %eq% magic.4n(1)
     eq(magic(4) , magic.4n(1))

