#include <VectorHelper.hpp>
Static Public Member Functions | |
| static | initVInt (Id nval, Id value=0.) |
| static | initVDouble (Id nval, double value=0.) |
| static | initVVDouble (Id nval1, Id nval2, double value=0.) |
| static | initVVInt (Id nval1, Id nval2, Id value=0) |
| static | initVInt (const Id *values, Id number) |
| static | initVInt (const I32 *values, Id number) |
| static | initVDouble (const double *values, Id number) |
| static | initVVDouble (const double *value, Id n1, Id n2) |
| static VectorString | initVString (Id ntab, char **names) |
| static void | dumpStats (const String &title, constvect vect, Id nmax=-1) |
| static void | dumpRange (const String &title, constvect vect, Id nmax=-1) |
| static void | dumpStats (const String &title, const 1 &vectin, Id nmax=-1) |
| static void | dumpRange (const String &title, const 1 &vectin, Id nmax=-1) |
| static void | dumpRange (const String &title, const 1 &vect) |
| static void | dumpNNZ (const String &title, const 1 &vect, Id nclass=10) |
| static void | capInPlace (1 &vec, double vmin=TEST, double vmax=TEST) |
| static void | capInPlaceVVD (1 &vec, double vmin=TEST, double vmax=TEST) |
| static double | extensionDiagonal (const 1 &mini, const 1 &maxi) |
| static Id | count (const 1 &vec) |
| static double | cumulLog (const 1 &vec) |
| static | cumulIncrement (const 1 &vec) |
| static | quantiles (const 1 &vec, const 1 &probas) |
| static bool | isEqual (const 1 &v1, const 1 &v2, double eps=EPSILON10) |
| static bool | isEqualExtended (const 1 &v1, const 1 &v2, double eps=EPSILON10, bool flagRelative=true, bool flagAbsolute=false, const String &string="") |
| Function checking that two values are equal This verbose option is essentially used in tests. | |
| static void | sequenceInPlace (Id n, 1 &vec) |
| static | sequence (Id number, Id ideb=0, Id step=1) |
| static | sequenceVD (double valFrom, double valTo, double valStep=1., double ratio=1.) |
| static void | fillUndef (1 &vec, double repl) |
| static void | addMultiplyConstantInPlace (double val1, const constvect in, vect out, Id iad) |
| static double | innerProductCV (const constvect veca, const constvect vecb) |
| static void | addMultiplyVectVectInPlace (const constvect in1, const constvect in2, vect out, Id iad) |
| static void | addInPlace (constvect in, vect dest) |
| static void | addInPlace (const double *veca, const double *vecb, double *res, Id size) |
| static void | addSquareInPlace (1 &dest, const 1 &src) |
| static | subtract (constvect veca, constvect vecb) |
| static void | subtractInPlace (const constvect in1, const constvect in2, vect outv) |
| static void | multiplyComplexInPlace (const 1 &vecaRe, const 1 &vecaIm, const 1 &vecbRe, const 1 &vecbIm, 1 &resRe, 1 &resIm) |
| static void | addMultiplyConstantInPlace (double val1, const 1 &in1, 1 &outv, Id iad) |
| static void | addMultiplyConstantInPlace (double val1, const 1 &in1, 1 &outv) |
| static void | copy (const 1 &vecin, 1 &vecout, Id size=-1) |
| static void | copy (const 1 &vecin, 1 &vecout, Id size=-1) |
| static void | copy (const 1 &inv, 1 &outv) |
| static void | mean1AndMean2ToStdev (const 1 &mean1, const 1 &mean2, 1 &std, Id number) |
| static void | normalize (double *tab, Id ntab) |
| static void | normalizeFromGaussianDistribution (1 &vec, double mini=0., double maxi=1.) |
| static | normalScore (const 1 &data, const 1 &wt=1()) |
| static | qnormVec (const 1 &vec) |
| static | pnormVec (const 1 &vec) |
| static | concatenate (const 1 &veca, const 1 &vecb) |
| static void | concatenateInPlace (1 &veca, const 1 &vecb) |
| static | power (const 1 &vec, double power) |
| static | inverse (const 1 &vec) |
| static void | power (1 &res, const constvect vec, double power) |
| static void | inverse (1 &res, const constvect vec) |
| static double | innerProduct (const double *veca, const double *vecb, Id size=-1) |
| static | crossProduct3D (const 1 &veca, const 1 &vecb) |
| static void | crossProduct3DInPlace (const double *a, const double *b, double *v) |
| static | cumsum (const 1 &vecin, bool flagAddZero, bool revert=false) |
| static void | cumulateInPlace (1 &vec) |
| static void | cumulate (1 &veca, const 1 &vecb, double coeff=1., double addval=0.) |
| static void | getMostSignificant (const 1 &vec, double tol=EPSILON6, Id nmax=-1) |
| static | simulateUniform (Id n=1, double mini=0., double maxi=1.) |
| static | simulateBernoulli (Id n=1, double proba=0.5, double vone=1., double velse=0.) |
| static | simulateGaussian (Id n=1, double mean=0., double sigma=1.) |
| static void | simulateGaussianInPlace (1 &vec, double mean=0., double sigma=1.) |
| static | sampleRanks (Id ntotal, double proportion=0., Id number=0, Id seed=242141, Id optSort=0) |
| static void | normalizeCodir (Id ndim, 1 &codir) |
| static bool | isInList (const 1 &vec, Id item) |
| static | sort (const 1 &vecin, bool ascending=true, Id size=-1) |
| static | sort (const 1 &vecin, bool ascending=true, Id size=-1) |
| static void | sortInPlace (1 &vecin, bool ascending=true, Id size=-1) |
| static void | sortInPlace (1 &vecin, bool ascending=true, Id size=-1) |
| static bool | isSorted (const 1 &vec, bool ascending=true) |
| static | unique (const 1 &vecin, Id size=-1) |
| static | unique (const 1 &vecin, Id size=-1) |
| static | orderRanks (const 1 &vecin, bool ascending=true, Id size=-1) |
| static | orderRanks (const 1 &vecin, bool ascending=true, Id size=-1) |
| static | sortRanks (const 1 &vecin, bool ascending=true, Id size=-1) |
| static | reorder (const 1 &vecin, const 1 &order, Id size=-1) |
| static | reorder (const 1 &vecin, const 1 &order, Id size=-1) |
| static | revert (const 1 &vecin) |
| static | revert (const 1 &vecin) |
| static | sample (const 1 &vecin, const 1 &indKeep) |
| Create an output VectorDouble by selecting some indices of the Input VectorDouble 'vecin'. | |
| static void | arrangeInPlace (Id safe, 1 &ranks, 1 &values, bool ascending=true, Id size=-1) |
| Arrange values in place (VectorDouble version) | |
| static void | arrangeInPlace (Id safe, 1 &ranks, 1 &values, bool ascending=true, Id size=-1) |
| static | filter (const 1 &vecin, Id vmin=ITEST, Id vmax=ITEST, bool ascending=true) |
| static | complement (const 1 &vec, const 1 &sel) |
| static std::pair< double, double > | rangeVals (const 1 &vec) |
| static void | unflattenInPlace (const 1 &vd, 1 &vvd) |
| static void | flattenInPlace (const 1 &vvd, 1 &vd) |
| static | flatten (const 1 &vvd) |
| static | unflatten (const 1 &vd, const 1 &sizes) |
| static void | linearCombinationInPlace (double val1, const 1 &vd1, double val2, const 1 &vd2, 1 &outv) |
| static void | linearCombinationVVDInPlace (double val1, const 1 &vvd1, double val2, const 1 &vvd2, 1 &outv) |
| static | suppressTest (const 1 &vecin) |
| static void | extractInPlace (const 1 &vecin, 1 &vecout, Id start) |
| static void | mergeInPlace (const 1 &vecin, 1 &vecout, Id start) |
| static void | transformVD (1 &tab, Id oper_choice=1) |
| static void | squeezeAndStretchInPlaceForward (const 1 &vecin, 1 &vecout, double origin, double mesh, double top, double bot) |
| static void | squeezeAndStretchInPlaceBackward (const 1 &vecin, 1 &vecout, double origin, double mesh, double top, double bot) |
| static Id | whereMinimum (const 1 &tab) |
| static Id | whereMaximum (const 1 &tab) |
| static Id | whereElement (const 1 &tab, Id target) |
| static Id | whereElement (const 1 &tab, Id target, Id start) |
| static bool | isIsotropic (const 1 &sampleRanks) |
| static | reduceOne (const 1 &vecin, Id index) |
| static | reduce (const 1 &vecin, const 1 &vindex) |
| static | compress (const 1 &vecin, const 1 &vindex) |
| static void | truncateDecimalsInPlace (1 &vec, Id ndec) |
| static void | truncateDigitsInPlace (1 &vec, Id ndec) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Performs: veca += vecb**2
| dest | Input/Output vector |
| src | Auxiliary vector |
|
static |
Arrange values in place (VectorDouble version)
Sorts the (double) array value() and the array ranks() if provided
| [in] | safe | 1 if the value array if preserved 0 if the value array is also sorted |
| [in] | ascending | Sorting order |
| [in] | size | Optional vector dimension |
| [out] | ranks | input and output Id array |
| [out] | values | input and output double array |
Sorts the static_cast<Id>(array) value() and the array ranks() if provided This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
static |
|
static |
|
static |
|
static |
Returns the list complementary to 'sel' within 'vecin'
| vec | Initial list |
| sel | Vector of forbidden elements |
|
static |
Reduce the input vector 'vecin' by returning the only elements referred by 'index'
| vecin | Input vector (double) |
| vindex | Vector of indices to be kept |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Cross product (limited to 3D)
| veca | First vector |
| vecb | Second Vector |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Extract the part of a vector 'vecin' (dimensioned to dimension of 'vecout') starting at address 'istart' and copy it into 'vecout'
| vecin | Initial vector |
| vecout | Resulting vector (already allocated) |
| start | Starting address (within 'vecin') |
|
static |
|
static |
From an input list, filter out all the elements which do no lie within [vmin, vmax[, suppress double occurrences and sort them out (ascending or descending)
| vecin | Input array (integer) |
| vmin | lower bound included (or ITEST) |
| vmax | upper bound excluded (or ITEST) |
| ascending | True for ascending order; False for descending order |
|
static |
Method which flattens a VectorVectorDouble into a VectorDouble
| vvd | Input VectorVectorDouble |
|
static |
|
static |
Display the first significant values of the input vector. A "significant" value is a value larger than 'tol' in absolute value Values are listed by decreasing importance.
| vec | Input Vector |
| tol | Tolerance above which a value is significant (in absolute value) |
| nmax | Limit on the number of values printed (-1: no limit) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Function checking that two values are equal This verbose option is essentially used in tests.
| v1 | First value to be compared |
| v2 | Second value to be compared |
| eps | Tolerance used for comparison |
| flagRelative | when True, the values are compared without paying attention to their sign |
| flagAbsolute | when True, test is run on absolute difference |
| string | Message to be displayed when the vectors are not similar |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Merge 'vecin' into 'vecout' starting at address 'istart'
| vecin | Initial vector |
| vecout | Vector where 'vecin' should be copied |
| start | Starting address (in 'vecout') |
|
static |
|
static |
|
static |
Fix plausible values for the Direction coefficients. They must be defined and with norm equal to 1
| [in] | ndim | Space dimension |
| [in,out] | codir | Input/Output Direction coefficients |
|
static |
|
static |
|
static |
Returns the permutation which rearranges the input vector into any order
| vecin | Input vector |
| ascending | True for ascending order; False otherwise |
| size | Optional dimension of the input vector |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Reduce the input vector 'vecin' by suppressing the elements referred by 'index'
| vecin | Input vector (double) |
| vindex | Vector of indices to be suppressed |
|
static |
Reduce the input vector 'vecin' by suppressing the element referred by 'index'
| vecin | Input vector (double) |
| index | Index to be suppressed |
|
static |
|
static |
|
static |
|
static |
|
static |
Create an output VectorDouble by selecting some indices of the Input VectorDouble 'vecin'.
| vecin | Input Rectangular Matrix |
| indKeep | Set of Indices to be kept (all if not defined) |
|
static |
Sample a set of 'ntotal' ranks (unique occurrence)
| ntotal | Dimension to be sampled |
| proportion | Proportion of elected samples (in [0,1]) |
| number | Number of elected samples |
| seed | Seed used for the random number generator |
| optSort | Sorting: 0 for None; 1 for Ascending; -1 for Descending |
Create an output vector containing the 'number' consecutive numbers starting from 'ideb'
| number | Length of the output vector |
| ideb | Index of the first element of the output vector |
| step | Step between two consecutive values |
|
static |
|
static |
Create an output vector going from 'valFrom' to 'ValTo' by step of 'valStep' Create a vector containing the a sequence of numbers
| valFrom | Starting value |
| valTo | Ending value |
| valStep | Step |
| ratio | The whole sequence can be ultimately scaled by 'ratio' |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Operate the squeeze-and-stretch algorithm backward (see remarks)
| vecin | Input vector (in sugar box system) |
| vecout | Output vector (in structural system) |
| origin | Origin of the vertical axis (structural system) |
| mesh | Mesh of the vertical axis (structural system) |
| top | Elevation of the Top surface |
| bot | Elevation of the Bottom surface |
|
static |
Operate the squeeze-and-stretch algorithm forward (see remarks)
| vecin | Input vector (in structural system) |
| vecout | Output vector (in sugar box system) |
| origin | Origin of the vertical axis (structural system) |
| mesh | Mesh of the vertical axis (structural system) |
| top | Elevation of the Top surface |
| bot | Elevation of the Bottom surface |
Return a vector containing vecb - veca
| veca | Input Vector |
| vecb | Input Vector |
|
static |
Performs: outv = in2 - in1
| in1 | Input vector |
| in2 | Input vector |
| outv | Output vector |
|
static |
|
static |
Transform a vector of double values as follows
| tab | Vector of double values |
| oper_choice | Operation on the diagonal term (see Utilities::operate_XXX) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Find the location of the maximum value within a vector
| [in] | tab | Vector of values |
|
static |
Find the location of the minimum value within a vector
| [in] | tab | Vector of values |