natix.SimilaritySearch.NANNI.Build C# (CSharp) Method

Build() public method

public Build ( ANNI ilc ) : void
ilc ANNI
return void
        public void Build(ANNI ilc)
        {
            this.DB = ilc.DB;
            int n = this.DB.Count;
            this.clusters.Clear();

            foreach (var objID in ilc.ACT) {
                var node = new Node();
                node.objID = objID;
                this.clusters.Add (node);
            }

            for (int objID = 0; objID < n; ++objID) {
                var c = ilc.CT [objID];
                if (c == -1) continue;
                this.clusters[c].Add (objID, ilc.DT [objID]);
            }
        }

Usage Example

コード例 #1
0
ファイル: Indexes.cs プロジェクト: sadit/natix
        public static List<string> ExecuteNANNI(IndexArgumentSetup setup, string nick)
        {
            var idxname = String.Format ("{0}/Index.NANNI", nick);
            var reslist = new List<string> ();
            var resname = Execute (setup, nick, idxname, (db) => {
                var nilc = new NANNI ();
                nilc.Build (CreateANNI (setup.BINARY_DATABASE, (int)Math.Abs (setup.QARG)));
                return nilc;
            });

            reslist.Add (resname);
            //			resname = Execute (setup, nick, idxname + "S", (db) => {
            //				var nilc = IndexGenericIO.Load(idxname);
            //				return nilc;
            //			});
            //			reslist.Add (resname);
            return reslist;
        }