OKlibrary  0.2.1.6
Gasarch.mac
Go to the documentation of this file.
00001 /* Oliver Kullmann, 11.2.2012 (Swansea) */
00002 /* Copyright 2012 Oliver Kullmann
00003 This file is part of the OKlibrary. OKlibrary is free software; you can redistribute
00004 it and/or modify it under the terms of the GNU General Public License as published by
00005 the Free Software Foundation and included in this library; either version 3 of the
00006 License, or any later version. */
00007 
00022 oklib_include("OKlib/ComputerAlgebra/TestSystem/Lisp/Asserts.mac")$
00023 oklib_include("OKlib/ComputerAlgebra/Hypergraphs/Lisp/Generators/Gasarch.mac")$
00024 oklib_include("OKlib/ComputerAlgebra/Hypergraphs/Lisp/Statistics.mac")$
00025 
00026 
00027 /* *****************************************************
00028    * Hypergraphs of sub-square-vertices in a rectangle *
00029    *****************************************************
00030 */
00031 
00032 okltest_gasarch_hg(f) := (
00033   for p : 0 thru 4 do
00034     assert(f(p,0) = [{},{}]),
00035   for q : 0 thru 4 do
00036     assert(f(0,q) = [{},{}]),
00037   for p : 1 thru 4 do
00038     assert(f(p,1) = [setify(create_list(sqv(i,1),i,1,p)), {}]),
00039   for q : 1 thru 4 do
00040     assert(f(1,q) = [setify(create_list(sqv(1,j),j,1,q)), {}]),
00041   assert(f(2,2) = [map(sqv_pair,cartesian_product({1,2},{1,2})), {map(sqv_pair,cartesian_product({1,2},{1,2}))}]),
00042   /* XXX */
00043   true)$
00044 
00045 okltest_standardise_gasarch(f) := block([s,b],
00046   s : f(1,1),
00047   assert(s(sqv(1,1)) = 1),
00048   b : if oklib_test_level=0 then 4 else 8,
00049   for p : 0 thru b do
00050     for q : 0 thru b do (
00051       s : f(p,q),
00052       assert(s(gasarch_ohg(p,q)[1]) = create_list(i,i,1,p*q))
00053   ),
00054   true)$
00055 
00056 
00057 /* **************
00058    * Statistics *
00059    **************
00060 */
00061 
00062 okltest_nver_gasarch_ohg(f) := (
00063   for p : 0 thru 5 do
00064     for q : 0 thru 5 do
00065       assert(f(p,q) = nver_hg(gasarch_hg(p,q))),
00066   true)$
00067 
00068 okltest_nver_gasarch_hg(f) := (
00069   for p : 0 thru 5 do
00070     for q : 0 thru 5 do
00071       assert(f(p,q) = nver_ohg(gasarch_ohg(p,q))),
00072   true)$
00073 
00074 okltest_nhyp_gasarch_ohg(f) := (
00075   for p : 0 thru 5 do
00076     for q : 0 thru 5 do
00077       assert(f(p,q) = nhyp_ohg(gasarch_ohg(p,q))),
00078   true)$
00079 
00080 okltest_nhyp_gasarch_hg(f) := (
00081   for p : 0 thru 5 do
00082     for q : 0 thru 5 do
00083       assert(f(p,q) = nhyp_hg(gasarch_hg(p,q))),
00084   true)$
00085 
00086