protected Feature(byte[] buffer, ref int position) { Bins = IntArray.New(buffer, ref position); #if !NO_STORE BinsCache = FileObjectStore <IntArrayFormatter> .GetDefaultInstance(); #endif }
protected Feature(IntArray bins) { Bins = bins; #if !NO_STORE BinsCache = FileObjectStore <IntArrayFormatter> .GetDefaultInstance(); #endif IsTrivialFeature = bins.BitsPerItem == IntArrayBits.Bits0; if (!IsTrivialFeature && bins.Length > 0) { MD5Hash = bins.MD5Hash; } BinsType = bins.Type; }
public static Feature New(byte[] buffer, ref int position) { using (Timer.Time(TimerEvent.ConstructFromByteArray)) { FeatureType type = (FeatureType)buffer.ToInt(ref position); switch (type) { case FeatureType.Raw: TsvFeature tf = new TsvFeature(buffer, ref position); #if !NO_STORE tf.BinsCache = FileObjectStore <IntArrayFormatter> .GetDefaultInstance(); #endif return(tf); default: throw Contracts.Except("Impossible!"); } } }