Ejemplo n.º 1
0
 // Helpers	
 public static int Nearest(int[] i, sStkNPS[] a, float v, int l, int h)
 {
     int m = 0;
     while (l < h)
     {
         m = (l + h) >> 1;
         if (a[i[m]].value >= v) l = m + 1; else h = m;
     }
     return (h);
 }
Ejemplo n.º 2
0
 public static int Allocate(ObjectArray <int> ifree,
                            ObjectArray <sStkNPS> stock,
                            sStkNPS value)
 {
     //int	i;
     //if(ifree.Count>0)
     //{
     //    i = ifree[ifree.Count - 1];
     //    ifree.pop_back();
     //    stock[i] = value;
     //}
     //else
     //{
     //    i=stock.Count;
     //    stock.push_back(value);
     //}
     //return(i);
     return(0);
 }
Ejemplo n.º 3
0
 public static int Allocate(ObjectArray<int> ifree,
     ObjectArray<sStkNPS> stock,
     sStkNPS value)
 {
     //int	i;
     //if(ifree.Count>0)
     //{
     //    i = ifree[ifree.Count - 1]; 
     //    ifree.pop_back(); 
     //    stock[i] = value; 
     //}
     //else
     //{ 
     //    i=stock.Count;
     //    stock.push_back(value); 
     //}
     //return(i); 
     return 0;
 }