Example #1
0
        protected Feature(byte[] buffer, ref int position)
        {
            Bins = IntArray.New(buffer, ref position);
#if !NO_STORE
            BinsCache = FileObjectStore <IntArrayFormatter> .GetDefaultInstance();
#endif
        }
Example #2
0
        protected Feature(IntArray bins)
        {
            Bins = bins;
#if !NO_STORE
            BinsCache = FileObjectStore <IntArrayFormatter> .GetDefaultInstance();
#endif
            IsTrivialFeature = bins.BitsPerItem == IntArrayBits.Bits0;
            BinsType         = bins.Type;
        }
Example #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!");
                }
            }
        }