baobab.bio.permutation
Class PermutationToTrace

java.lang.Object
  extended by baobab.bio.permutation.PermutationToTrace

public class PermutationToTrace
extends java.lang.Object

The PermutationToTrace class contains utility methods which convert permutation elements to trace elements and vice-versa

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

Constructor Summary
PermutationToTrace()
           
 
Method Summary
static int[] arrayOfBytesToReversal(int[] positions, boolean isLinear, byte[] element)
           
static int[] arrayOfBytesToReversal(Permutation permutation, byte[] element)
           
static int[] bitTraceElementToReversal(Permutation permutation, baobab.util.BitList element)
          Generates a reversal from a trace element
static int[] byteTraceElementToReversal(Permutation permutation, byte[] element)
          Generates a reversal from a trace element
static baobab.util.BitList reversalToBitTraceElement(Permutation permutation, int start, int end)
          Generates a TraceElement from a reversal
static byte[] reversalToByteTraceElement(Permutation permutation, int start, int end)
          Generates a TraceElement from a reversal
static byte[] reversalToUnsignedArrayOfBytes(Permutation permutation, int start, int end)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PermutationToTrace

public PermutationToTrace()
Method Detail

reversalToUnsignedArrayOfBytes

public static byte[] reversalToUnsignedArrayOfBytes(Permutation permutation,
                                                    int start,
                                                    int end)

arrayOfBytesToReversal

public static int[] arrayOfBytesToReversal(int[] positions,
                                           boolean isLinear,
                                           byte[] element)

arrayOfBytesToReversal

public static int[] arrayOfBytesToReversal(Permutation permutation,
                                           byte[] element)

reversalToByteTraceElement

public static byte[] reversalToByteTraceElement(Permutation permutation,
                                                int start,
                                                int end)
Generates a TraceElement from a reversal

Parameters:
permutation - the permutation
start - the start position of a reversal
end - the end position of a reversal
Returns:
the trace element generated

byteTraceElementToReversal

public static int[] byteTraceElementToReversal(Permutation permutation,
                                               byte[] element)
Generates a reversal from a trace element

Parameters:
permutation - the given permutation
Returns:
a reversal as an array of int with length = 2 (position 0 = start, position 1 = end of the reversal)

reversalToBitTraceElement

public static baobab.util.BitList reversalToBitTraceElement(Permutation permutation,
                                                            int start,
                                                            int end)
Generates a TraceElement from a reversal

Parameters:
permutation - the permutation
start - the start position of a reversal
end - the end position of a reversal
Returns:
the trace element generated

bitTraceElementToReversal

public static int[] bitTraceElementToReversal(Permutation permutation,
                                              baobab.util.BitList element)
Generates a reversal from a trace element

Parameters:
permutation - the given permutation
Returns:
a reversal as an array of int with length = 2 (position 0 = start, position 1 = end of the reversal)