示例#1
0
        protected Feature(byte[] buffer, ref int position)
        {
            Bins = IntArray.New(buffer, ref position);
#if !NO_STORE
            BinsCache = FileObjectStore <IntArrayFormatter> .GetDefaultInstance();
#endif
        }
示例#2
0
        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;
        }
示例#3
0
        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!");
                }
            }
        }