// Helpers public static int Nearest( int[] i, sStkNPS[] a, double 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 ); }
public static int Allocate( btList<int> ifree, btList<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; }