public static Dictionary<VariableDesc, Dictionary<int, int>> GetIntData(Dictionary<VariableDesc, ValueDescs> oData,
    MatriceComputeMode mode, int nClasses)
 {
     Dictionary<VariableDesc, Dictionary<int, int>> oRet = new Dictionary<VariableDesc, Dictionary<int, int>>();
     var keys = oData.Keys;
     foreach (var key in keys)
     {
         oRet[key] = new Dictionary<int, int>();
         var rdict = oRet[key];
         var vals = (oData[key]).ToArray();
         int n = vals.Length;
         int[] ddata = new int[n];
         if (key.IsNumVar)
         {
             double[] data = new double[n];
             for (int i = 0; i < n; ++i)
             {
                 var v = vals[i];
                 double vv = v.DoubleValue;
                 data[i] = vv;
             }// i
             if (mode == MatriceComputeMode.modeNormalize)
             {
                 DescriptiveStatistics st = new DescriptiveStatistics(data);
                 double ec = st.StandardDeviation;
                 if (ec <= 0.0)
                 {
                     return null;
                 }
                 double mean = st.Mean;
                 for (int i = 0; i < n; ++i)
                 {
                     data[i] = (data[i] - mean) / ec;
                 }// i
             }
             else if (mode == MatriceComputeMode.modeProfil)
             {
                 DescriptiveStatistics st = new DescriptiveStatistics(data);
                 double vmin = st.Minimum;
                 double vmax = st.Maximum;
                 if (vmax <= vmin)
                 {
                     return null;
                 }
                 double rg = vmax - vmin;
                 for (int i = 0; i < n; ++i)
                 {
                     data[i] = (data[i] - vmin) / rg;
                 }
             }
             else if (mode == MatriceComputeMode.modeRank)
             {
                 double[] dz = BertinPartition.GetRanks(data);
                 if (dz == null)
                 {
                     return null;
                 }
                 for (int i = 0; i < n; ++i)
                 {
                     data[i] = dz[i];
                 }
             }
             var pc = BertinPartition.GetPartition(data, nClasses);
             if (pc == null)
             {
                 return null;
             }
             var cc = pc.Classes;
             for (int i = 0; i < n; ++i)
             {
                 var v = vals[i];
                 int ind = v.Index;
                 rdict[ind] = cc[i];
             }// i
         }
         else
         {
             String[] data = new String[n];
             for (int i = 0; i < n; ++i)
             {
                 var v = vals[i];
                 data[i] = v.StringValue;
             }// i
             var p = BertinPartition.GetPartition(data);
             if (p == null)
             {
                 return null;
             }
             var cc = p.Classes;
             for (int i = 0; i < n; ++i)
             {
                 var v = vals[i];
                 int ind = v.Index;
                 rdict[ind] = cc[i];
             }// i
         }
     }// key
     return oRet;
 }
 public IEnumerable<IndivData> GetIndivsData(IEnumerable<IndivDesc> inds, IEnumerable<VariableDesc> oVars, MatriceComputeMode mode,
     int nClasses)
 {
     List<IndivData> oRet = null;
     try
     {
         var vars = oVars.ToArray();
         int nv = vars.Length;
         if (nv < 1)
         {
             return null;
         }
         var vals = GetCommonValues(oVars);
         if (vals == null)
         {
             return null;
         }
         var dictDouble = GetDoubleData(vals, mode);
         var dictInt = GetIntData(vals, mode, nClasses);
         if ((dictDouble == null) || (dictInt == null))
         {
             return null;
         }
         oRet = new List<IndivData>();
         foreach (var ind in inds)
         {
             int index = ind.IndivIndex;
             if (index < 0)
             {
                 continue;
             }
             double[] dd = new double[nv];
             int[] di = new int[nv];
             for (int j = 0; j < nv; ++j)
             {
                 var vv = vars[j];
                 foreach (var x in dictDouble.Keys)
                 {
                     if (x.Id == vv.Id)
                     {
                         var dict = dictDouble[x];
                         if (dict.ContainsKey(index))
                         {
                             dd[j] = dict[index];
                         }
                         break;
                     }//
                 }// double
                 foreach (var x in dictInt.Keys)
                 {
                     if (x.Id == vv.Id)
                     {
                         var dict = dictInt[x];
                         if (dict.ContainsKey(index))
                         {
                             di[j] = dict[index];
                         }
                         break;
                     }//
                 }// double
             }// j
             var vz = new IndivData(ind, dd, di);
             oRet.Add(vz);
         }// inds
     }// try
     catch (Exception /*ex */)
     {
         oRet = null;
     }
     return oRet;
 }