public static CPointer <TVal> bsearch <TKey, TVal>(TKey key, CPointer <TVal> array, int n, Func <TKey, TVal, int> compare) { var list = new List <TVal>(array.ToArray().Take(n)); var idx = list.BinarySearch(default(TVal), new bcomparer <TKey, TVal>(key, compare)); return(idx >= 0 ? array + idx : new CPointer <TVal>()); }
public static void qsort <T>(CPointer <T> array, int n, Comparison <T> compare) { var list = new List <T>(array.ToArray().Take(n)); list.Sort(compare); for (int i = 0; i < list.Count; i++) { array[i] = list[i]; } }
public void swe_cotrans_sp(CPointer <double> xpo, CPointer <double> xpn, double eps) { SwephLib.swe_cotrans_sp(xpo, xpn, eps); }
public int swe_houses_ex(double tjd_ut, Int32 iflag, double geolat, double geolon, char hsys, CPointer <double> hcusps, CPointer <double> ascmc) { return(SweHouse.swe_houses_ex(tjd_ut, iflag, geolat, geolon, hsys, hcusps, ascmc)); }