File : lattice-ops.ads



package Lattice.Ops is

  procedure InitPatch(N1,N2,N3,LP: in Positive);                   -- initialize lattice patch
  procedure FreePatch;
  function BallAt(L: IPoint) return BallPtr;

  procedure AddMovable(L: in IPoint; B: in out Blob; OK: out Boolean);
  procedure SetMovable(B: in PolyPtr; BM: in out Blob; OK: out Boolean);
  procedure ClearMovable(B: in out Blob);
  procedure ClearAllMovable;
  procedure CheckMovable(M: in Positive; B: in PolyPtr);
  procedure CheckMovable(M: in Positive; P: in PolysPtr; PLast: in Natural := 999);
  function Constraints(Mov: Blob) return RMatPtr;                  -- compute halfspace constraints

  function FindConnAll(NM: Positive) return PolysPtr;              -- find polymers
  function FindSubAll(NM: Positive; B: PolyPtr) return PolysPtr;   -- find sub-polymers
  procedure AddNbors(B: in out PolyPtr);
  procedure AddNbors(P: in PolysPtr);
  procedure RemoveNbors(B: in PolyPtr);
  procedure RemoveNbors(P: in PolysPtr);
  procedure Normalize(B: in out PolyPtr);
  procedure Normalize(P: in PolysPtr);

  function Group(Gen: IMapVec) return IMapVecPtr;
  procedure Transform(A: in IMap; B: in Poly; C: out Poly);
  procedure Symmetrize(B: in out PolyPtr);
  procedure Symmetrize(P: in out PolysPtr);
  function FindConnClass(NM: Positive) return PolysPtr;            -- find polymer classes

  function FindSubClass(NM: Positive; B: PolyPtr) return PolysPtr; -- find sub-polymer classes
  procedure AddEntropies(N: in Positive; Pn,P: in PolysPtr);
  function Entropies(NM: in Positive) return PExpPtr;
  procedure EntropySums(NM: in Positive);

private

  type BallPatch is array(Integer range <>,Integer range <>,Integer range <>) of BallPtr;
  type BallPatchPtr is access BallPatch;

  procedure Free is new Ada.Unchecked_Deallocation(BallPatch,BallPatchPtr);

  BPatch: BallPatchPtr;

  procedure GetNbors(Q: in IPoint; N: out Nbors);
  procedure AddConstraint(B0,B1: in BallPtr; I: in Integer; A: in out RMatPtr);

  procedure Cleanup(B: in PolyPtr);
  procedure Cleanup(B: in out PolysPtr; Size: in out Natural; AddUp: Boolean := True);
  function Addable(K: Int; B: PolyPtr) return Boolean;

  procedure ScrewHCP(L: in IPoint; B: in Poly; C: out Poly);
  procedure NormalizeHCP(B: in out PolyPtr);

  Symmetries: IMapVecPtr;

  function SymmHCP return IMapVecPtr;
  function SymmFCC return IMapVecPtr;
  function Symm return IMapVecPtr;

end Lattice.Ops;