13.2.11. Macro “dataserverNormaliseVector.C”
13.2.11.1. Objective
This part shows the complete code used to produce the console display in Normalising the variable.
13.2.11.2. Macro Uranie
TDataServer *tdsop =new TDataServer("foo","pouet");
tdsop->fileDataRead("tdstest.dat");
//Compute a global normalisation of v, CenterReduced
tdsop->normalize("v","GCR",TDataServer::kCR,true);
//Compute a normalisation of v, CenterReduced (not global but entry by entry)
tdsop->normalize("v","CR",TDataServer::kCR,false);
//Compute a global normalisation of v, Centered
tdsop->normalize("v","GCent",TDataServer::kCentered);
//Compute a normalisation of v, Centered (not global but entry by entry)
tdsop->normalize("v","Cent",TDataServer::kCentered,false);
//Compute a global normalisation of v, ZeroOne
tdsop->normalize("v","GZO",TDataServer::kZeroOne);
//Compute a normalisation of v, ZeroOne (not global but entry by entry)
tdsop->normalize("v","ZO",TDataServer::kZeroOne,false);
//Compute a global normalisation of v, MinusOneOne
tdsop->normalize("v","GMOO",TDataServer::kMinusOneOne,true);
//Compute a normalisation of v, MinusOneOne (not global but entry by entry)
tdsop->normalize("v","MOO",TDataServer::kMinusOneOne,false);
tdsop->scan("v:vGCR:vCR:vGCent:vCent:vGZO:vZO:vGMOO:vMOO","","colsize=4 col=2:5::::::::");
13.2.11.3. Console
This macro should result in this output in console:
*************************************************************************************
* Row * Instance * v * vGCR * vCR * vGCe * vCen * vGZO * vZO * vGMO * vMOO *
*************************************************************************************
* 0 * 0 * 1 * -1.46 * -1 * -4 * -3 * 0 * 0 * -1 * -1 *
* 0 * 1 * 2 * -1.09 * -1 * -3 * -3 * 0.12 * 0 * -0.7 * -1 *
* 0 * 2 * 3 * -0.73 * -1 * -2 * -3 * 0.25 * 0 * -0.5 * -1 *
* 1 * 0 * 4 * -0.36 * 0 * -1 * 0 * 0.37 * 0.5 * -0.2 * 0 *
* 1 * 1 * 5 * 0 * 0 * 0 * 0 * 0.5 * 0.5 * 0 * 0 *
* 1 * 2 * 6 * 0.365 * 0 * 1 * 0 * 0.62 * 0.5 * 0.25 * 0 *
* 2 * 0 * 7 * 0.730 * 1 * 2 * 3 * 0.75 * 1 * 0.5 * 1 *
* 2 * 1 * 8 * 1.095 * 1 * 3 * 3 * 0.87 * 1 * 0.75 * 1 *
* 2 * 2 * 9 * 1.460 * 1 * 4 * 3 * 1 * 1 * 1 * 1 *
*************************************************************************************