Computes the 2D projection of the multidimensional CrystalFp object. More...
#include <CrystalFpScatterplot.h>
Public Types | |
| enum | ValueType { VAL_TOTAL_ENERGY, VAL_PER_ATOM_ENERGY, VAL_STRESS, VAL_GROUP, VAL_STEP } |
| Type of value associated to the points. More... | |
| enum | DiagnosticType { DIAG_DISTANCES, DIAG_BINNED_DISTANCES, DIAG_DO_NOTHING } |
| Type of diagnostic requested. More... | |
Public Member Functions | |
| CrystalFpScatterplot () | |
| Constructor. | |
| ~CrystalFpScatterplot () | |
| Destructor. | |
| void | setNamedParam (const std::string &aName, const std::string &aValue) |
| Set the parameter identified by the name. | |
| size_t | initScatterplot (const CrystalFp *aCfp) |
| Initialize the scatterplot computation for the given CrystalFp object. | |
| void | getPoints (float *aCoords) const |
| Get the points coordinates. | |
| void | getValues (float *aValues, ValueType aValueType) const |
| Return the values associated to the points. | |
| float | stepScatterplot (float aTimestep) |
| Move the points one step ahead. | |
| void | perturbPositions (void) |
| Check if the current solution is the best. | |
| size_t | initDiagnostic (DiagnosticType aDiagnostic) |
| Compute scatterplot diagnostic chart. | |
| void | getDiagnosticValues (float *aCoords, float *aValues) const |
| Return the diagnostic chart points. | |
| void | dumpParams (void) const |
| Prints the params values (the one set with setNamedParam()). | |
Computes the 2D projection of the multidimensional CrystalFp object.
The points are projected in 2D trying to preserve the original distances. Normal usage is:
Definition at line 42 of file CrystalFpScatterplot.h.
Type of diagnostic requested.
| DIAG_DISTANCES |
Return all inter-point distances. |
| DIAG_BINNED_DISTANCES |
Bin the interpoint distances. |
| DIAG_DO_NOTHING |
To simplify visualization of the scatterplot only. |
Definition at line 126 of file CrystalFpScatterplot.h.
Type of value associated to the points.
Definition at line 83 of file CrystalFpScatterplot.h.
| cfp::CrystalFpScatterplot::CrystalFpScatterplot | ( | ) |
Constructor.
| cfp::CrystalFpScatterplot::~CrystalFpScatterplot | ( | ) |
Destructor.
| void cfp::CrystalFpScatterplot::dumpParams | ( | void | ) | const |
Prints the params values (the one set with setNamedParam()).
The print is on cerr
| void cfp::CrystalFpScatterplot::getDiagnosticValues | ( | float * | aCoords, |
| float * | aValues | ||
| ) | const |
Return the diagnostic chart points.
| [out] | aCoords | A preallocated array that will be filled by the point coordinates (x, y) |
| [out] | aValues | A preallocated array that will be filled with the point's values |
| void cfp::CrystalFpScatterplot::getPoints | ( | float * | aCoords | ) | const |
Get the points coordinates.
If no points, then do nothing.
| [out] | aCoords | Array of x,y coordinates filled on output. |
| void cfp::CrystalFpScatterplot::getValues | ( | float * | aValues, |
| ValueType | aValueType | ||
| ) | const |
Return the values associated to the points.
It is an independent routine so you can change the visualized value without redisplaying the points.
| [out] | aValues | An array where the values will be stored. |
| [in] | aValueType | The value to be returned. |
| CrystalFpFatal | If aValueType is invalid. |
| size_t cfp::CrystalFpScatterplot::initDiagnostic | ( | DiagnosticType | aDiagnostic | ) |
Compute scatterplot diagnostic chart.
The chart shows distances on the scatterplot vs. distances in real space (both distances are normalized between 0 and 1).
| [in] | aDiagnostic | The diagnostic to be computed |
| CrystalFpFatal | If aDiagnostic is invalid. |
| size_t cfp::CrystalFpScatterplot::initScatterplot | ( | const CrystalFp * | aCfp | ) |
Initialize the scatterplot computation for the given CrystalFp object.
The method used is the ball and spring simple method.
| [in] | aCfp | Pointer to the already computed CrystalFp structure. |
| CrystalFpFatal | If CrystalFp has no distances available. |
| void cfp::CrystalFpScatterplot::perturbPositions | ( | void | ) |
Check if the current solution is the best.
If the current solution is not an improvement, then reload the previous optimum solution. Perturb the point positions to escape a local minima. The perturbation is proportional to the point stress and is slowly reduced every restart.
| void cfp::CrystalFpScatterplot::setNamedParam | ( | const std::string & | aName, |
| const std::string & | aValue | ||
| ) |
Set the parameter identified by the name.
Mainly used to set parameters from the command line. The accepted codes are:
retry Number of retries (used only here to compute the decay coefficient) mass Ball mass stiffness Of the spring damping Damping factor for the movement perturb Perturb scale for the retries (it perturb the initial position of the masses) bins Number of bins for the binned distances diagnostics wobble Wobble scale for the position of the binned points| aName | Name of the parameter to be set (see above) |
| aValue | String representation of the value to be set (internally it is converted to the needed data type) |
| CrystalFpFatal | If the param name is invalid |
| float cfp::CrystalFpScatterplot::stepScatterplot | ( | float | aTimestep | ) |
Move the points one step ahead.
| [in] | aTimestep | The time from the previous step. |
1.8.2