OKlibrary  0.2.1.6
Statistics.mac
Go to the documentation of this file.
00001 /* Oliver Kullmann, 5.7.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/DataStructures/Lisp/HashMaps.mac")$
00024 
00025 
00026 kill(f)$
00027 
00028 /* ******************
00029    * Basic measures *
00030    ******************
00031 */
00032 
00033 okltest_nhyp_list_ohg(f) := (
00034   assert(f([[],[]]) = []),
00035   assert(f([[],[{}]]) = [[0,1]]),
00036   assert(f([[1,2,3],[{1},{},{1,2},{},{1,2,3},{2,3},{2}]]) = [[0,2],[1,2],[2,2],[3,1]]),
00037   true)$
00038 
00039 
00040 /* ******************
00041    * Vertex degrees *
00042    ******************
00043 */
00044 
00045 okltest_vertex_degrees_nhyplist_hg(f) := (
00046   assert(hm2sm(f([{},{}])) = {}),
00047   assert(hm2sm(f([{},{{}}])) = {}),
00048   assert(hm2sm(f([{1},{}])) = {[1,[]]}),
00049   assert(hm2sm(f([{1},{{}}])) = {[1,[]]}),
00050   assert(hm2sm(f([{1},{{1}}])) = {[1,[[1,1]]]}),
00051   assert(hm2sm(f([{1,2},{{1},{1,2}}])) = {[1,[[1,1],[2,1]]],[2,[[2,1]]]}),
00052   true)$
00053