|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.unihalle.informatik.Alida.operator.ALDData
de.unihalle.informatik.MiToBo.core.datatypes.MTBVectorField2D
@ALDMetaInfo(export=ALLOWED) @ALDParametrizedClass public class MTBVectorField2D
Class to represent several kinds of vector fields. For example gvf-fields. A vector field has two field vectors, U and V. For the first time a kind of basic methods are implemented and implementation of other methods will be continued.
Constructor Summary | |
---|---|
MTBVectorField2D()
|
|
MTBVectorField2D(double[] u,
double[] v,
int width,
int height)
|
Method Summary | |
---|---|
double[] |
calcPotential_approxLeastSquares(boolean ignoreBorder)
Calculates an approximation of the potential of the field by gradient descent. |
double[] |
calcPotential_exactLeastSquares(boolean ignoreBorder)
Calculates the potential of the field by solving a LSE with least squares. |
double[] |
calcPotential_incrLeastSquares(boolean ignoreBorder)
Calculates a rough approximation of the potential of the field in linear time. |
double |
getDirection(double x,
double y)
Get direction of the vector at position (x,y) in the vector field, relative to the x-axis. |
int |
getFieldSizeX()
|
int |
getFieldSizeY()
|
double |
getMagnitude(double x,
double y)
Get magnitude of the vector at position (x,y) in the vector field. |
double[] |
getPotential()
Returns a copy of the potential field (for faster access!). |
double[] |
getU()
Get vector U of the field. |
double[] |
getV()
Get vector V of the field. |
double |
getValuePotential(double x,
double y)
Returns value of potential at specified position. |
double |
getValueU(double x,
double y)
Get value from vector U at position (x,y). |
double |
getValueV(double x,
double y)
Get value from vector V at position (x,y). |
boolean |
readFromBinFile(String file)
Reads a vector field from a file in binary format. |
void |
resetPotential()
Resets the potential, next access to it will enforce recalculation. |
boolean |
saveToBinFile(String file)
Saves the vector field to a file in binary format. |
void |
setU(double[] u,
int w,
int h)
Set vector U of the field. |
void |
setU(double x,
double y,
double value)
Set value on (x,y) for vector U of the field. |
void |
setV(double[] v,
int w,
int h)
Set value on (x,y) for vector V of the field. |
void |
setV(double x,
double y,
double value)
Set value on (x,y) for vector V of the field. |
Methods inherited from class de.unihalle.informatik.Alida.operator.ALDData |
---|
cloneProperties, getLocation, getProperty, getPropertyKeys, print, setLocation, setProperty |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MTBVectorField2D()
public MTBVectorField2D(double[] u, double[] v, int width, int height)
Method Detail |
---|
public int getFieldSizeX()
public int getFieldSizeY()
public double[] getU()
public double[] getV()
public double getValueU(double x, double y)
x
- x-coordinatey
- y-coordinate
public double getValueV(double x, double y)
x
- x-coordinatey
- y-coordinate
public void setU(double[] u, int w, int h) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
u
- vector to set U
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
public void setU(double x, double y, double value) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Attention! Method assumes that memory for U is s already allocated.
x
- x-coordinatey
- y-coordinatevalue
- value to set on position (x,y)
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
public void setV(double[] v, int w, int h) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
v
- vector to set V
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
public void setV(double x, double y, double value) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Attention! Method assumes that memory for V is s already allocated.
x
- x-coordinatey
- y-coordinatevalue
- value to set on position (x,y)
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
public double getMagnitude(double x, double y)
x
- x-coordinatey
- y-coordinate
public double getDirection(double x, double y)
x
- x-coordinatey
- y-coordinate
public double[] getPotential()
public double getValuePotential(double x, double y)
x
- x coordinate of position.y
- y coordinate of position.
public void resetPotential()
public double[] calcPotential_exactLeastSquares(boolean ignoreBorder)
Attention! This methods takes a lot of resources. If your field is large you better use another routine for potential reconstruction.
ignoreBorder
- If true, outer rows and columns of the field are ignored.
public double[] calcPotential_approxLeastSquares(boolean ignoreBorder)
ignoreBorder
- If true, outer rows and columns of the field are ignored.
public double[] calcPotential_incrLeastSquares(boolean ignoreBorder)
ignoreBorder
- If true, outer rows and columns of the field are ignored.
public boolean saveToBinFile(String file)
file
- Output file.
public boolean readFromBinFile(String file)
file
- Input file.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |