|
package jcliffford | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjclifford.Clifford
public class Clifford
This class represents a Clifford element and all the operation in a signed space.
Use this class for p + q <= 8. For p + q > 8 use CliffordBitSet or CliffordTreeSet instead.
0.9
Realized by Giorgio Vassallo, Pietro Brignola, November 2002.
CliffordBitSet,
CliffordTreeSet| Field Summary | |
|---|---|
protected static int |
dim
Algebra's dimension. |
protected static double |
eps
Algebra's Precision. |
protected static int[] |
gradeTable
Stores the grade (number of bits 1 in the binary rappresentation) of a blade. |
protected static int |
hdim
Algebra's possible blades (2 ^ dim). |
protected java.util.TreeMap |
map
Element's blade-value mappings. |
protected static int |
p
Number of dimensions with positive square versors. |
protected static Clifford |
pseudoScalar
Algebra's pseudoscalar. |
protected static int |
q
Number of dimensions with negative square versors. |
protected static int |
signMask
Mask with p bits 0 and q bits 1 corresponding to negative square versors (starting from l.s.b.). |
protected static boolean[][] |
signTable
Stores the grade (number of bits 1 in the binary rappresentation) of a blade. |
protected static int |
spaceMask
Mask with bits 1 corresponding to the presence of dimensions (starting from l.s.b.). |
| Constructor Summary | |
|---|---|
Clifford()
Creates and returns an element with no blade-value mappings. |
|
Clifford(int[] blades,
double[] values)
Creates and returns an element with specified blade-value mappings. |
|
| Method Summary | |
|---|---|
Clifford |
add(Clifford cl)
Adds two elements. |
private static int |
bCoefficent(int n,
int k)
Computes binomial coefficents. |
private static int |
bitCount(int bld)
Counts the number of bits 1 in the binary rappresentation of a blade. |
java.lang.Object |
clone()
Creates and returns an element deeply cloning this element. |
Clifford |
comm(Clifford cl)
Computes the commutation with the specified element. |
Clifford |
conj()
Computes the conjugation of this element. |
double |
dot(Clifford cl)
Computes the fast dot product of two vector. |
Clifford |
dual()
Computes the dual of this element. |
boolean |
equals(java.lang.Object obj)
Compares two elements for equality. |
double |
get(int blade)
Gets the value of a blade. |
double |
get(java.lang.String blademask)
Gets the value of a blade. |
static int |
getDim()
Gets algebra's dimension. |
static double |
getEps()
Gets algebra's precision. |
int |
getMaxGrade()
Gets highest grade of this element. |
static int |
getPossibleBlades()
Gets algebra's possible blades. |
private static boolean |
getSign(int bld1,
int bld2)
Computes the sign of the product of two blades. |
Clifford |
gP(Clifford cl)
Computes the geometric product of two elements. |
Clifford |
gP(double scalar)
Computes the geometric product of an element and a scalar. |
Clifford |
grade(int grade)
Grades an element. |
Clifford |
gradeInv()
Computes the grade involution of this element. |
static void |
init(int pdim,
int ndim)
Initializes algebra's signature. |
Clifford |
inv()
Computes the inverse of this element. |
boolean |
isScalar()
Verifies if this element is a scalar. |
boolean |
isVector()
Verifies if this element is a vector. |
Clifford |
lC(Clifford cl)
Computes the left contraction with the specified element. |
Clifford |
meet(Clifford cl)
Computes the meet with the specified element. |
Clifford |
meet(Clifford cl,
Clifford is)
Computes the meet with the specified element in a common subspace. |
void |
normalize()
Normalizes this element respect the unsigned module. |
void |
noZero()
Removes blades with values lower than eps. |
void |
put(int blade,
double value)
Puts a new blade-value mapping or updates existing. |
void |
put(java.lang.String blademask,
double value)
Puts a new blade-value mapping or updates existing. |
Clifford |
rC(Clifford cl)
Computes the right contraction with the specified element. |
Clifford |
reflect(Clifford n)
Computes the reflection against the specified vector. |
void |
remove(int blade)
Removes blade-value mapping if existing. |
Clifford |
rev()
Computes the reverse of this element. |
static void |
setEps(double e)
Sets algebra's precision. |
static void |
setMeetSubSpace(int subspace)
Sets meet operation subspace. |
double |
sQuadMod()
Computes the quad module of an element regarding signature. |
Clifford |
sub(Clifford cl)
Subtracts two elements. |
java.lang.String |
toString()
Returns a string representation of the element. |
double |
uQuadMod()
Computes the quad module of an element discarding signature. |
Clifford |
wP(Clifford cl)
Computes the wedge product of two elements. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.util.TreeMap map
protected static double eps
protected static int p
protected static int q
protected static int dim
protected static int hdim
protected static int spaceMask
protected static int signMask
protected static int[] gradeTable
protected static boolean[][] signTable
protected static Clifford pseudoScalar
| Constructor Detail |
|---|
public Clifford()
throws java.lang.RuntimeException
java.lang.RuntimeException - if algebra's signature is not initialized.
public Clifford(int[] blades,
double[] values)
throws java.lang.RuntimeException,
java.lang.IllegalArgumentException
blades - the int array representing the specified blades.values - the double array representing the corresponding values.
java.lang.RuntimeException - if algebra's signature is not initialized.
java.lang.IllegalArgumentException - if the arrays have different lenght.| Method Detail |
|---|
public static double getEps()
public static void setEps(double e)
throws java.lang.IllegalArgumentException
e - positive precision.
java.lang.IllegalArgumentException - if the precision is negative.public static int getDim()
public static int getPossibleBlades()
private static int bitCount(int bld)
bld - the blade whose number of bits 1 in its binary rappresentation are to be counted.
private static boolean getSign(int bld1,
int bld2)
bld1 - the first blade of the product.bld2 - the second blade of the product.
private static int bCoefficent(int n,
int k)
n - the dimension.k - the grade.
public static void init(int pdim,
int ndim)
throws java.lang.IllegalArgumentException
pdim - the number of dimensions with versors that square in 1.ndim - the number of dimensions with versors that square in -1.
java.lang.IllegalArgumentException - if p or q are negative or their sum is greater than 8.
public static void setMeetSubSpace(int subspace)
throws java.lang.IllegalArgumentException
subspace - the meet operation subspace.
java.lang.IllegalArgumentException - if subspace is negative or outside algebra's space mask.
public double get(int blade)
throws java.lang.IllegalArgumentException
blade - the int representing the specified blade whose value is to be retrieved.
java.lang.IllegalArgumentException - if blade is negative or outside algebra's space mask.
public double get(java.lang.String blademask)
throws java.lang.IllegalArgumentException
blademask - the binary mask representing the specified blade whose value is to be retrieved.
java.lang.IllegalArgumentException - if blademask is invalid, blade is negative or outside algebra's space mask.
public void put(int blade,
double value)
throws java.lang.IllegalArgumentException
blade - the int representing the specified blade that is to be put.value - the double representing the corresponding value of the specified blade.
java.lang.IllegalArgumentException - if blade is negative or outside algebra's space mask.
public void put(java.lang.String blademask,
double value)
throws java.lang.IllegalArgumentException
blademask - the binary mask representing the specified blade that is to be put.value - the double representing the corresponding value of the specified blade.
java.lang.IllegalArgumentException - if blademask is invalid, blade is negative or outside algebra's space mask.
public void remove(int blade)
throws java.lang.IllegalArgumentException
blade - the int representing the specified blade that is to be removed.
java.lang.IllegalArgumentException - if blade is negative or outside algebra's space mask.public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.Object clone()
clone in class java.lang.Objectpublic final void noZero()
public final double uQuadMod()
public final double sQuadMod()
public final void normalize()
public final int getMaxGrade()
public final boolean isScalar()
public final boolean isVector()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - the second element that is to be compared.
public final Clifford add(Clifford cl)
cl - the second element of the sum.
public final Clifford sub(Clifford cl)
cl - the second element of the difference.
public final Clifford gradeInv()
public final Clifford rev()
public final Clifford inv()
public final Clifford conj()
public final Clifford grade(int grade)
grade - the specified grade of the grading operation.
public final Clifford gP(double scalar)
scalar - the scalar of the geometric product.
public final Clifford gP(Clifford cl)
cl - the second element of the geometric product.
public final Clifford wP(Clifford cl)
cl - the second element of the wedge product.
public final Clifford lC(Clifford cl)
cl - the second element of the left contraction.
public final Clifford rC(Clifford cl)
cl - the second element of the right contraction.
public final double dot(Clifford cl)
throws java.lang.IllegalArgumentException
cl - the second vector of the fast dot product.
java.lang.IllegalArgumentException - if elements are not vectors.public final Clifford comm(Clifford cl)
cl - the second element of the commutation.
public final Clifford dual()
public final Clifford meet(Clifford cl)
cl - the second element of the meet.
public final Clifford meet(Clifford cl,
Clifford is)
cl - the second element of the meet.is - the element representing a common subspace.
public final Clifford reflect(Clifford n)
n - the vector against wich reflect.
|
package jclifford | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||