  
  [1X22. Cubical Complexes[0X
  
      | [10X ArrayToPureCubicalComplexA,n)[0X Inputs an integer array A of dimension d and an integer n. It returns a d-dimensional pure cubical complex corresponding to the black/white "image" determined by the threshold n and the values of the entries in A. (Integers below the threshold correspond to a black pixel, and higher integers correspond to a white pixel.)                                                      | 
      | [10XPureCubicalComplexA,n)[0X Inputs a binary array A of dimension d. It returns the corresponding d-dimensional pure cubical complex.                                                                                                                                                                                                                                                                                        | 
      | [10XPureCubicalComplexIntersection(S,T)[0X Inputs two pure cubical complexes with common dimension and array size. It returns the intersection of the two complexes. (An entry in the binary array of the intersection has value 1 if and only if the corresponding entries in the binary arrays of S and T both have value 1.)                                                                                               | 
      | [10XPureCubicalComplexUnion(S,T)[0X Inputs two pure cubical complexes with common dimension and array size. It returns the union of the two complexes. (An entry in the binary array of the union has value 1 if and only if at least one of the corresponding entries in the binary arrays of S and T has value 1.)                                                                                                          | 
      | [10XPureCubicalComplexDifference(S,T)[0X Inputs two pure cubical complexes with common dimension and array size. It returns the difference S-T. (An entry in the binary array of the difference has value 1 if and only if the corresponding entry in the binary array of S is 1 and the corresponding entry in the binary array of T is 0.)                                                                                  | 
      | [10X ReadImageAsPureCubicalComplex("file.png",n)[0X Reads an image file ("file.png", "file.eps", "file.bmp" etc) and an integer n between 0 and 765. It returns a 2-dimensional pure cubical complex based on the black/white version of the image determined by the threshold n.                                                                                                                                             | 
      | [10X ReadImageSequenceAsPureCubicalComplex("directory",n)[0X Reads the name of a directory containing a sequence of image files (ordered alphanumerically), and an integer n between 0 and 765. It returns a 3-dimensional pure cubical complex based on the black/white version of the images determined by the threshold n.                                                                                                 | 
      | [10X Size(T)[0X This returns the number of non-zero entries in the binary array of the pure cubical complex T.                                                                                                                                                                                                                                                                                                                | 
      | [10X WritePureCubicalComplexAsImage(T,"filename","ext")[0X Inputs a 2-dimensional pure cubical complex T, and a filename followed by its extension (e.g. "myfile" followed by "png"). A black/white image is saved to the file.                                                                                                                                                                                               | 
      | [10X ViewPureCubicalComplex(T)[0X [10X ViewPureCubicalComplex(T,"mozilla")[0X Inputs a 2-dimensional pure cubical complex T, and optionally a command such as "mozilla" for viewing image files. A black/white image is displayed.                                                                                                                                                                                                   | 
      | [10X Homology(T,n)[0X [10X Homology(T)[0X Inputs a pure cubical complex, or cubical complex, or simplicial complex T and a non-negative integer n. It returns the n-th integral homology of T as a list of torsion integers. If no value of n is input then the list of all homologies of T in dimensions 0 to Dimension(T) is returned .                                                                                            | 
      | [10X Bettinumbers(T,n)[0X [10X Bettinumbers(T)[0X Inputs a pure cubical complex, or cubical complex, or simplicial complex T and a non-negative integer n. The free rank of the n-th integral homology group of T is returned. If no value for n is input then the list of Betti numbers in dimensions 0 to Dimension(T) is returned .                                                                                               | 
      | [10XDirectProductOfPureCubicalComplexes(M,N)[0X Inputs two cubical complexes M,N and returns their direct product D as a cubical complex. The dimension of D is the sum of the dimensions of M and N.                                                                                                                                                                                                                         | 
      | [10XEulerCharacteristic(T)[0X Inputs a pure cubical complex, or cubical complex, or simplicial complex T and returns its Euler characteristic.                                                                                                                                                                                                                                                                                | 
      | [10X PathComponentOfPureCubicalComplex(T,n)[0X Inputs a pure cubical complex T and an integer n in the rane 1, ..., Bettinumbers(T)[1] . It returns the n-th path component of T as a pure cubical complex. The value n=0 is also allowed, in which case the number of path components is returned.                                                                                                                           | 
      | [10XChainComplex(T)[0X Inputs a pure cubical complex, or cubical complex, or simplicial complex T and returns the (often very large) cellular chain complex of T.                                                                                                                                                                                                                                                             | 
      | [10XChainComplexOfPair(T,S)[0X Inputs a pure cubical complex or cubical complex T and contractible subcomplex S. It returns the quotient C(T)/C(S) of cellular chain complexes.                                                                                                                                                                                                                                               | 
      | [10XChainInclusionOfPureCubicalPair(S,T)[0X Inputs a pure cubical complex T and subcomplex S. It returns the chain inclusion C(S) -> C(T) of cellular chain complexes.                                                                                                                                                                                                                                                        | 
      | [10XChainMapOfPureCubicalPairs(M,S,N,T)[0X Inputs a pure cubical complex N and subcomplexes M, T and S in T. It returns the chain map C(M/S) -> C(N/T) of quotient cellular chain complexes.                                                                                                                                                                                                                                  | 
      | [10X ContractPureCubicalComplex(T)[0X Inputs a pure cubical complex T of dimension d and removes d-dimensional cells from T without changing the homotopy type of T. When the function has been applied, no further d-cells can be removed from T without changing its homotopy type. This function modifies T.                                                                                                               | 
      | [10X ContractedComplex(T)[0X Inputs a pure cubical complex T and returns a structural copy of the complex obtained from T by applying the function ContractPureCubicalComplex(T).                                                                                                                                                                                                                                             | 
      | [10X ContractibleSubomplexOfPureCubicalComplex(T)[0X Inputs a pure cubical complex T and returns a maximal contractible subcomplex.                                                                                                                                                                                                                                                                                           | 
      | [10X AlmostContractibleSubomplexOfPureCubicalComplex(T)[0X Inputs a pure cubical complex T and returns a (not necessarily connected) subcomplex having trivial homology in all degrees greater than 0.                                                                                                                                                                                                                        | 
      | [10X HomotopyEquivalentMaximalPureCubicalSubcomplex(T,S)[0X Inputs a pure cubical complex T together with a subcomplex S. It returns a subcomplex H of T which contains S and is maximal with respect to the property that it is homotopy equivalent to S.                                                                                                                                                                    | 
      | [10X HomotopyEquivalentMinimalPureCubicalSubcomplex(T,S)[0X Inputs a pure cubical complex T together with a subcomplex S. It returns a subcomplex H of T which contains S and is minimal with respect to the property that it is homotopy equivalent to T.                                                                                                                                                                    | 
      | [10X BoundaryOfPureCubicalComplex(T)[0X Inputs a pure cubical complex T and returns its boundary as a pure cubical complex. The boundary consists of all cubes which have one or more facets that lie in just the one cube.                                                                                                                                                                                                   | 
      | [10XSingularitiesOfPureCubicalComplex(T,radius,tolerance)[0X Inputs a pure cubical complex T together with a positive integer "radius" and an integer "tolerance" in the range 1..100. It returns the subcomplex of those points in the boundary where the boundary is not differentiable. (The method for deciding differentiability at a point is crude/discrete, prone to errors and depends on the radius and tolerance.) | 
      | [10X ThickenedPureCubicalComplex(T)[0X Inputs a pure cubical complex T and returns a pure cubical complex S. If a euclidean cube is in T then this cube and all its neighbouring cubes are included in S.                                                                                                                                                                                                                     | 
      | [10X ComplementOfPureCubicalComplex(T)[0X Inputs a pure cubical complex T and returns a pure cubical complex S. A euclidean cube is in S precisely when the cube is not in T.                                                                                                                                                                                                                                                 | 
  
