shh.gl4
Class PPT

Object
  extended byPPT
All Implemented Interfaces:
Comparable

public class PPT
extends Object
implements Comparable

A point in the projective space Pn-1 over the ring Z/NZ. This is the space of primitive vectors in ZN (vectors whose coordinates together have gcd 1), modulo N and modulo multiplication by the units of Z/NZ. If N is prime, this is the usual projective space over a finite field.

The constructor ensures that the point's coordinates always lie in 0, 1, ..., N-1 and are always lexicographically the least among points in its equivalence class.

Each instance has a reference to a ZModNData object, which stores the level N and helper data. You can reuse the same object for each point in a given projective space.

Author:
Mark McConnell

Constructor Summary
PPT(ZModNData data, int[] coords)
          Constructor.
 
Method Summary
 int compareTo(Object o)
          Compares PPTs lexicographically.
 boolean equals(Object o)
          Tests for equality of the coordinates.
 int hashCode()
          Consistent with equals(java.lang.Object).
static void main(String[] args)
          For testing.
static PPT[] makeP3(ZModNData data, Hashtable h, boolean bPrint)
          Lists the points of P3 in lexicographic order.
 PPT times(MatChar mm)
          Returns a new PPT consisting of this as a row vector times the matrix in mm.
 String toString()
          Returns, e.g., (1 0 1 1).
 String toStringNoParen()
          Returns, e.g., 1 0 1 1.
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PPT

public PPT(ZModNData data,
           int[] coords)
Constructor.

Parameters:
data - Holds the level N and helper data. You can reuse the same object for each point in a given projective space.
coords - Its length is n when we are in Pn-1. The constructor does not alter its contents.
Throws:
IllegalStateException - If the coordinates together don't have gcd 1.
Method Detail

toString

public String toString()
Returns, e.g., (1 0 1 1).


toStringNoParen

public String toStringNoParen()
Returns, e.g., 1 0 1 1.


compareTo

public int compareTo(Object o)
Compares PPTs lexicographically. For the sake of speed, assumes without checking that o is not null and is a PPT with the same N and n as this.

Specified by:
compareTo in interface Comparable

equals

public boolean equals(Object o)
Tests for equality of the coordinates. For the sake of speed, assumes without checking that o is not null and is a PPT with the same N and n as this.


hashCode

public final int hashCode()
Consistent with equals(java.lang.Object).


makeP3

public static PPT[] makeP3(ZModNData data,
                           Hashtable h,
                           boolean bPrint)
Lists the points of P3 in lexicographic order. The CPT ("coded point") corresponding to a given PPT ("projective point") is the PPT's index in this array.

Parameters:
h - If non-null, will be overwritten to hold the reverse mapping from PPT to (Integer)CPT.

times

public PPT times(MatChar mm)
Returns a new PPT consisting of this as a row vector times the matrix in mm. Only works on P3.


main

public static void main(String[] args)
For testing. Input: N v0 v1 v2 .... Output: v projectively-niced mod N. Or if the input is just N, enumerate all N4 points in the affine four-space, projectivize those that can be projectivized, count the resulting points, and see if it equals ZModNData.cardP3.