at.dms.kjc.sir.linear.transform
Class LinearTransform

java.lang.Object
  extended by at.dms.kjc.sir.linear.transform.LinearTransform
Direct Known Subclasses:
LinearTransformNull, LinearTransformPipeline, LinearTransformSplitJoin

public abstract class LinearTransform
extends Object

A LinearTransform communicates information about how to transform one or more linear representations into a new linear representation (eg combination rules). For example, for pipeline combinations, the Linear Transform contains information about what expansion factors to use for the filters to be combined.
The interface to a LinearTransform is simple the transform() method, which will return the overall linear representation that the transform calculates. To create a LinearTransform, you use one of the static methods in the subclasses to pre-compute whatever information is necessary, and then you call transform() on the returned LinearTransform object.
$Id: LinearTransform.java,v 1.8 2006/01/25 17:02:01 thies Exp $


Constructor Summary
LinearTransform()
           
 
Method Summary
static int divCeiling(int a, int b)
          Gets the ceiling of the division of two integers.
static int gcd(int[] arr)
          Gets the gcd of an array of numbers.
static int gcd(int a, int b)
          Return the greatest factor that evenly divids both m and n (ie the greatest common denominator).
static int lcm(int[] numbers)
          Calculates the least common multiple of all the integers contained in the array.
static int lcm(int a, int b)
          Calculates the least common multiple of two integers.
abstract  LinearFilterRepresentation transform()
          Actually implements the specific transform.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinearTransform

public LinearTransform()
Method Detail

transform

public abstract LinearFilterRepresentation transform()
                                              throws NoTransformPossibleException
Actually implements the specific transform. Returns a LinearFilterRepresentation that results from applying the appropriate transformation.

Throws:
NoTransformPossibleException

lcm

public static int lcm(int a,
                      int b)
Calculates the least common multiple of two integers.


lcm

public static int lcm(int[] numbers)
Calculates the least common multiple of all the integers contained in the array.


gcd

public static int gcd(int a,
                      int b)
Return the greatest factor that evenly divids both m and n (ie the greatest common denominator). Valid for 0 < n < m. From http://www.brent.worden.org/algorithm/mathematics/greatestCommonDenominator.html.


gcd

public static int gcd(int[] arr)
Gets the gcd of an array of numbers.


divCeiling

public static int divCeiling(int a,
                             int b)
Gets the ceiling of the division of two integers. Eg divCeil(5,3) = ceil(5/3) = 2