private static void ExtractFeatureInformation(object featuredObject, int iiLen, int oiLen, out FeatureDescription[] descriptions, out Strings inIDs, out Strings outIDs)
        {
            var ofo = featuredObject as IFeaturedInputOutput;
            if (ofo != null)
            {
                inIDs = ofo.InputFeatureIDs;
                outIDs = ofo.OutputFeatureIDs;
                descriptions = ofo.FeatureDescriptions.ToArray();
                return;
            }

            var ifo = featuredObject as IFeaturedInput;
            if (ifo != null)
            {
                inIDs = ifo.InputFeatureIDs;
                var set = ifo.FeatureDescriptions; // Mutable.
                outIDs = GenerateFeatureDescriptions(set, oiLen);
                descriptions = set.ToArray();
                return;
            }

            var newSet = new FeatureDescriptionSet();
            inIDs = GenerateFeatureDescriptions(newSet, iiLen);
            outIDs = GenerateFeatureDescriptions(newSet, oiLen);
            descriptions = newSet.ToArray();
        }
Esempio n. 2
0
        protected Feature(FeatureDescription description)
        {
            Contract.Requires(description != null);

            Description = description;
        }