baobab.bio.permutation
Class ComplexSignedPermutation

java.lang.Object
  extended by baobab.bio.permutation.SignedPermutation
      extended by baobab.bio.permutation.ComplexSignedPermutation
All Implemented Interfaces:
Permutation, java.lang.Comparable

public class ComplexSignedPermutation
extends SignedPermutation

The ComplexSignedPermutation class represents a signed permutation (the ComplexSignedPermutation class deals with hurdles)

Version:
1.0, May 2006
Author:
Marilia D. V. Braga

Constructor Summary
ComplexSignedPermutation(int[] permutationList)
          Creates a new linear permutation (assumes the identity permutation as target)
ComplexSignedPermutation(int[] permutationList, boolean isLinear)
          Creates a new permutation (assumes the identity permutation as target)
ComplexSignedPermutation(int[] originList, int[] targetList)
          Creates a new linear permutation
ComplexSignedPermutation(int[] originList, int[] targetList, boolean isLinear)
          Creates a new permutation
 
Method Summary
static java.util.Vector<int[]> blocksToIntArrays(java.util.Collection blocks)
          Transforms the collection of blocks to a collection of arrays of int (with length = 2)
 java.lang.Object clone()
           
 int compareTo(java.lang.Object object)
          Compares this block to another block
 boolean equals(ComplexSignedPermutation perm)
           
 java.util.SortedSet<Point> getBreakpoints()
          Gets the breakpoint list of this block
 java.util.SortedSet<Cycle> getCycles()
          Gets the list of cycles of this group of cycles
 java.lang.String getData()
           
 int getNumberOfCycles()
          Gets the number of cycles of this group of cycles
 int getNumberOfHurdles()
          Gets the number of hurdles of the permutation
 int getNumberOfSuperHurdles()
          Gets the number of super hurdles of the permutation
 java.util.SortedSet getOrientedCycles()
          Gets the list of oriented cycles of this group of cycles
 java.util.SortedSet<Point> getPoints()
          Gets all points which belong to this group of cycles
 int getReversalDistance()
          Gets the reversal distance of this permutation
 SignedPermutationReversalFilter getReversalFilter()
           
 java.util.SortedSet<Cycle> getUnorientedCycles()
          Gets the list of non-oriented cycles of this group of cycles
 boolean isFortress()
          Tests whether this permutation is a fortress
 boolean isOriented()
          Tests whether this cycle group is oriented
 int length()
          Gets the length of the block (the number of values of the permutation between its start and end points)
 SignedPermutation revert(int start, int end)
          Reverts the permutation between the specified positions
 SignedPermutation revert(Point start, Point end)
          Reverts the permutation between the specified points
 SignedPermutation revertToNewPermutation(Point start, Point end)
          Make a new permutation, by reverting the permutation between the specified positions
 int[] toIntArray()
          Gets a representation of the block as an array of int, with size 2, representing its start and end positions
 java.lang.String toString()
           
 
Methods inherited from class baobab.bio.permutation.SignedPermutation
equals, getEndPoint, getEndPointIndex, getFormatter, getMappedPositions, getMappedValueOf, getMappedValues, getMinimalReversalDistance, getPermutation, getPointAt, getPositionOf, getPositionOfMapped, getStartPoint, getValueOf, isAdjacency, isLinear, isSorted, revertToNewPermutation, size
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface baobab.bio.permutation.Permutation
getNumberOfCycles
 

Constructor Detail

ComplexSignedPermutation

public ComplexSignedPermutation(int[] permutationList)
Creates a new linear permutation (assumes the identity permutation as target)

Parameters:
permutationList - the list of signed integers (from +/-1 to +/-n), as an array of int

ComplexSignedPermutation

public ComplexSignedPermutation(int[] permutationList,
                                boolean isLinear)
Creates a new permutation (assumes the identity permutation as target)

Parameters:
permutationList - the list of signed integers (from +/-1 to +/-n), as an array of int
isLinear - indicates whether the permutation is linear or circular

ComplexSignedPermutation

public ComplexSignedPermutation(int[] originList,
                                int[] targetList)
Creates a new linear permutation

Parameters:
originList - the origin list of signed integers (from +/-1 to +/-n), as an array of int
targetList - the target list of signed integers (from +/-1 to +/-n), as an array of int

ComplexSignedPermutation

public ComplexSignedPermutation(int[] originList,
                                int[] targetList,
                                boolean isLinear)
Creates a new permutation

Parameters:
originList - the origin list of signed integers (from +/-1 to +/-n), as an array of int
targetList - the target list of signed integers (from +/-1 to +/-n), as an array of int
isLinear - indicates whether the permutation is linear or circular
Method Detail

getReversalDistance

public int getReversalDistance()
Description copied from class: SignedPermutation
Gets the reversal distance of this permutation

Overrides:
getReversalDistance in class SignedPermutation
Returns:
the reversal distance

getNumberOfHurdles

public int getNumberOfHurdles()
Gets the number of hurdles of the permutation

Returns:
the number of hurdles of the permutation

getNumberOfSuperHurdles

public int getNumberOfSuperHurdles()
Gets the number of super hurdles of the permutation

Returns:
the number of super hurdles of the permutation

revert

public SignedPermutation revert(Point start,
                                Point end)
                         throws PermutationException
Reverts the permutation between the specified points

Overrides:
revert in class SignedPermutation
Parameters:
start - the beginning of the reversion block
end - the end of the reversion block
Returns:
the resulting Permutation, after performing the reversion
Throws:
PermutationException

revert

public SignedPermutation revert(int start,
                                int end)
Reverts the permutation between the specified positions

Overrides:
revert in class SignedPermutation
Parameters:
start - the beginning of the reversion block
end - the end of the reversion block
Returns:
the resulting Permutation, after performing the reversion

revertToNewPermutation

public SignedPermutation revertToNewPermutation(Point start,
                                                Point end)
                                         throws PermutationException
Make a new permutation, by reverting the permutation between the specified positions

Overrides:
revertToNewPermutation in class SignedPermutation
Parameters:
start - the beginning of the reversion block
end - the end of the reversion block
Returns:
the resulting permutation, after performing the reversion
Throws:
PermutationException

isFortress

public boolean isFortress()
Tests whether this permutation is a fortress

Returns:
true / false

getReversalFilter

public SignedPermutationReversalFilter getReversalFilter()
Overrides:
getReversalFilter in class SignedPermutation

clone

public java.lang.Object clone()
Overrides:
clone in class SignedPermutation

equals

public boolean equals(ComplexSignedPermutation perm)

toString

public java.lang.String toString()
Overrides:
toString in class SignedPermutation

getData

public java.lang.String getData()
Overrides:
getData in class SignedPermutation

getBreakpoints

public java.util.SortedSet<Point> getBreakpoints()
Gets the breakpoint list of this block

Returns:
a Collection with the list of breakpoints (each breakpoint is represented by a Point)

getNumberOfCycles

public int getNumberOfCycles()
Gets the number of cycles of this group of cycles

Returns:
the number of cycles

getCycles

public java.util.SortedSet<Cycle> getCycles()
Gets the list of cycles of this group of cycles

Returns:
a Vector with the list of cycles

getOrientedCycles

public java.util.SortedSet getOrientedCycles()
Gets the list of oriented cycles of this group of cycles

Returns:
a Vector with the list of cycles

isOriented

public boolean isOriented()
Tests whether this cycle group is oriented


getPoints

public java.util.SortedSet<Point> getPoints()
Gets all points which belong to this group of cycles

Returns:
a Collection with the list of points

getUnorientedCycles

public java.util.SortedSet<Cycle> getUnorientedCycles()
Gets the list of non-oriented cycles of this group of cycles

Returns:
a Vector with the list of cycles

length

public int length()
Gets the length of the block (the number of values of the permutation between its start and end points)

Returns:
the length

toIntArray

public int[] toIntArray()
Gets a representation of the block as an array of int, with size 2, representing its start and end positions

Returns:
representation of the block as an array of int

compareTo

public int compareTo(java.lang.Object object)
Compares this block to another block

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
object - the other block
Returns:
the result of the comparison, as an int

blocksToIntArrays

public static java.util.Vector<int[]> blocksToIntArrays(java.util.Collection blocks)
Transforms the collection of blocks to a collection of arrays of int (with length = 2)

Parameters:
blocks - a collection of blocks
Returns:
a collection containing the blocks as arrays of int