|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jcae.mesh.amibe.validation.QualityFloat
public class QualityFloat
Manage statistics for quality values. This class allows easy computation of mesh quality. A criterion factor can be selected, then quality is computed and results are printed on screen or in files. Quality values are stored in a list of floats. Example:
QualityFloat data = new QualityFloat(); data.setQualityProcedure(new DihedralAngle()); for (Iterator itf = mesh.getTriangles().iterator(); itf.hasNext(); ) { Triangle f = (Triangle) itf.next(); data.compute(f); } // Print all results in the BB mesh format. data.printMeshBB("foo.bb"); // Gather results into 10 blocks... data.split(10); // ... and display them on screen. data.printLayers();
Constructor Summary | |
---|---|
QualityFloat()
|
|
QualityFloat(int n)
Create a new QualityFloat instance |
Method Summary | |
---|---|
void |
add(float x)
Add a value to the list. |
void |
compute(java.lang.Object x)
Compute the quality of an object and add it to the list. |
void |
finish()
Call the QualityProcedure.finish() procedure. |
float |
getMeanValue()
Return mean value |
float |
getStandardDeviation()
Return standard deviation |
float |
getValueByPercent(double p)
Return value by its distribution index. |
void |
printLayers()
Display histogram about quality values. |
void |
printMeshBB(java.lang.String file)
Write quality values into a file. |
void |
printStatistics()
Display statistics about quality values. |
void |
setQualityProcedure(QualityProcedure q)
Define the procedure which will compute quality values. |
void |
setTarget(float factor)
Normalize quality target. |
int |
size()
Return the number of quality values. |
void |
split(float... v)
|
void |
split(float v1,
float v2,
int nr)
Split quality values into buckets. |
void |
split(int nr)
Split quality values into buckets. |
void |
writeRawData(java.lang.String file)
Write quality values into a raw file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public QualityFloat()
public QualityFloat(int n)
QualityFloat
instance
n
- initial capacity of the list.Method Detail |
---|
public void setQualityProcedure(QualityProcedure q)
q
- the procedure which will compute quality values.public void compute(java.lang.Object x)
x
- the object on which quality is computed.public void add(float x)
x
- the value to add to the list.public void finish()
QualityProcedure.finish()
procedure.
public float getValueByPercent(double p)
p*N
values below it, where
N
is the total number of values. For instance,
getValueByPercent(0.0)
(resp. 1 and 0.5) returns
minimum value (resp. maximum value and median value).
p
- number between 0 and 1
public float getMeanValue()
public float getStandardDeviation()
public int size()
public void setTarget(float factor)
factor
- the scale factor.public void split(int nr)
n
subsegments of equal length, and
the number of quality values for each subsegment is
computed. These numbers can then be displayed by
printLayers()
.
nr
- the desired number of subsegments.public void split(float v1, float v2, int nr)
nr
subsegments of equal length, and the number of quality values
for each subsegment is computed. These numbers can then be
displayed by printLayers()
.
v1
- minimal value to consider.v2
- maximal value to consider.nr
- the desired number of subsegments.public void split(float... v)
public void printLayers()
public void printStatistics()
public void printMeshBB(java.lang.String file)
file
- name of the output filepublic void writeRawData(java.lang.String file)
file
- name of the output file
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |