예제 #1
0
        /// <summary>
        /// Adds new FeatureVector definition.
        /// </summary>
        /// <param name="_name">The name.</param>
        /// <param name="_desc">The desc.</param>
        /// <param name="_factor">The factor.</param>
        /// <param name="_doNormalizeVector">if set to <c>true</c> [do normalize vector].</param>
        /// <returns></returns>
        public FeatureVectorDefinition Add(String _name, String _desc, Double _factor = 1, Boolean _doNormalizeVector = false)
        {
            FeatureVectorDefinition output = new FeatureVectorDefinition();

            output.name              = _name;
            output.description       = _desc;
            output.Factor            = _factor;
            output.doNormalizeVector = _doNormalizeVector;
            return(Add(output));
        }
예제 #2
0
        /// <summary>
        /// Adds new FeatureVector definition.
        /// </summary>
        /// <param name="item">The FeatureVector to add into definition set</param>
        /// <returns></returns>
        public FeatureVectorDefinition Add(FeatureVectorDefinition item)
        {
            Int32 key = serialization.Count;

            item.id = key;
            if (!serialization.Any(x => x.id == key))
            {
                serialization.Add(item);
                return(item);
            }
            else
            {
                return(this[key]);
            }
        }