Ptp

Renvoie la plage de valeurs d'une matrice/d'un vecteur ou de l'axe de matrice donné, équivalent à Max() - Min(). Ptp - Crête à crête.

double vector::Ptp();
 
double matrix::Ptp();
 
vector matrix::Ptp(
  const int  axis      // axe
   );

Paramètres

axis

[in]  Axe. 0 – axe horizontal, 1 – axe vertical.

Valeur de Retour

Vecteur avec plages de valeurs (maximum - minimum) .

Exemple

   matrix matrix_a={{10,3,2},{1,8,12},{6,5,4},{7,11,9}};
   Print("matrix_a\n",matrix_a);
 
   vector cols_ptp=matrix_a.Ptp(0);
   vector rows_ptp=matrix_a.Ptp(1);
   double matrix_ptp=matrix_a.Ptp();
 
   Print("cols_ptp  ",cols_ptp);
   Print("rows_ptp  ",rows_ptp);
   Print("ptp value  ",matrix_ptp);
 
   /*
   matrix_a
   [[10,3,2]
    [1,8,12]
    [6,5,4]
    [7,11,9]]
   cols_ptp [9,8,10]
   rows_ptp [8,11,2,4]
   ptp value  11.0
   */