public class LatticePointsInEllipsoidIterator extends LatticePointsInEllipsoid implements Serializable, Cloneable
B
, a center vector C
and, a radius r
.
Given this data this class determines all lattice points
N∈Zg
that lay inside the specified ellipsoids,
e.g. the lattice points fulfill:
(N-c)t B (N-c) < r2 with |ci-Ci| < di
,
double radius = 5; RealVector center = new RealVector(2); RealMatrix B = new RealMatrix( new double [][] {{2,1},{1,2}}); LatticePointsInEllipsoidIterator lp = new LatticePointsInEllipsoidIterator( B ); lp.startIteration( radius, center); while(lp.hasNext() ) { System.out.println( new RealVector(lp.n) ); }
Modifier and Type | Field and Description |
---|---|
protected de.jtem.blas.RealVector[] |
abs_t |
protected de.jtem.blas.RealMatrix |
B |
protected de.jtem.blas.RealVector[] |
C |
protected int |
dim |
protected de.jtem.blas.RealMatrix |
latticePoints |
protected de.jtem.blas.RealVector |
N |
protected int |
numOfLatticePoints |
protected double |
r |
protected de.jtem.blas.RealVector[] |
t |
protected de.jtem.blas.RealMatrix[] |
T |
protected boolean |
uptodate |
Constructor and Description |
---|
LatticePointsInEllipsoidIterator(de.jtem.blas.RealMatrix B)
Creates object that delivers the lattice points inside ellipsoid
given by the matrix
B . |
LatticePointsInEllipsoidIterator(de.jtem.blas.RealMatrix B,
double r)
Creates object that delivers the lattice points inside ellipsoid
given by the matrix
B . |
LatticePointsInEllipsoidIterator(de.jtem.blas.RealMatrix B,
de.jtem.blas.RealVector C,
double r)
Creates object that delivers the lattice points inside ellipsoid
given by the matrix
B . |
Modifier and Type | Method and Description |
---|---|
protected void |
addLatticePoint(de.jtem.blas.RealVector y) |
de.jtem.blas.RealMatrix |
getB()
Returns matrix specifying the ellipsoid.
|
de.jtem.blas.RealVector |
getCenter()
Returns center of ellipsoid.
|
de.jtem.blas.RealMatrix |
getLatticePoints()
Returns lattice points in ellipsoid.
|
int |
getNumOfLatticePoints()
Returns number of lattice points in specified ellipsoid.
|
double |
getRadius() |
boolean |
hasNext(de.jtem.blas.RealVector N)
Iterates to next lattice point, which is returned in N.
|
static void |
main(String[] arg) |
void |
setB(de.jtem.blas.RealMatrix B)
Sets matrix specifiying the ellipsoid.
|
void |
setCenter(de.jtem.blas.RealVector c)
Sets center of ellipsoid to
c . |
void |
setRadius(double r)
Sets radius of ellipsoid.
|
protected static double |
sqr(double x) |
void |
startIteration()
Starts iteration thru all lattice points enclosed by the ellipsoid
prescribed by the shape induced by the matrix B, the
radius r, and center C.
|
void |
startIteration(double r,
de.jtem.blas.RealVector C)
Starts iteration thru all lattice points enclosed by the ellipsoid
prescribed by the shape induced by the matrix B and the
radius r, center C.
|
String |
toString()
Returns matrix containing the lattice points as string.
|
update
protected final de.jtem.blas.RealMatrix latticePoints
protected int numOfLatticePoints
protected final de.jtem.blas.RealVector[] abs_t
protected final de.jtem.blas.RealMatrix B
protected final de.jtem.blas.RealVector[] C
protected final int dim
protected final de.jtem.blas.RealVector N
protected double r
protected final de.jtem.blas.RealVector[] t
protected final de.jtem.blas.RealMatrix[] T
protected boolean uptodate
public LatticePointsInEllipsoidIterator(de.jtem.blas.RealMatrix B)
B
.
The ellipsoid is centered in zero and has radius 1.B
- symmetric and positive definite.public LatticePointsInEllipsoidIterator(de.jtem.blas.RealMatrix B, double r)
B
.
The ellipsoid is centered in zero and has radius r
.B
- symmetric and positive definite.r
- radius of ellipsoidpublic LatticePointsInEllipsoidIterator(de.jtem.blas.RealMatrix B, de.jtem.blas.RealVector C, double r)
B
.
The ellipsoid is centered in c
and has radius r
.B
- symmetric and positive definite.C
- center of ellipsoidr
- radius of ellipsoidpublic boolean hasNext(de.jtem.blas.RealVector N)
N
- next lattice point on outputpublic static void main(String[] arg)
public final void setB(de.jtem.blas.RealMatrix B)
B
- symmetric and positive definitepublic void startIteration()
public void startIteration(double r, de.jtem.blas.RealVector C)
r
- radiusC
- centerprotected void addLatticePoint(de.jtem.blas.RealVector y)
public final de.jtem.blas.RealMatrix getLatticePoints()
public final int getNumOfLatticePoints()
public final String toString()
toString
in class Object
getLatticePoints()
public final de.jtem.blas.RealMatrix getB()
public final de.jtem.blas.RealVector getCenter()
public final double getRadius()
public final void setCenter(de.jtem.blas.RealVector c)
c
.c
- vector of length dim
public final void setRadius(double r)
r
- radius of ellipsoidprotected static double sqr(double x)