Пример #1
0
        private void graph_creator_aux(IInputFormatInstance gif)
        {
            bool weighted = gif.Weight.Length == gif.Source.Length; float f = 1.0f;

            for (int i = 0; i < gif.ESIZE; i++)
            {
                int s = gif.Source [i];
                int t = gif.Target [i];
                if (weighted)
                {
                    f = gif.Weight [i];
                }
                g.addVertex(s);
                g.addVertex(t);
                g.noSafeAdd(s, t, f);
                if (s == 0 || t == 0)
                {
                    throw new ArgumentNullException("WARNING: Vertex id is 0! ");
                }
            }
            IIteratorInstance <IKVPair <IInteger, IInputFormat> > output_gifs_instance = (IIteratorInstance <IKVPair <IInteger, IInputFormat> >)Output_gif.Instance;
            IKVPairInstance <IInteger, IInputFormat> item = (IKVPairInstance <IInteger, IInputFormat>)Output_gif.createItem();

            ((IIntegerInstance)item.Key).Value = gif.PARTID;
            item.Value = gif;
            output_gifs_instance.put(item);
        }
Пример #2
0
        private void graph_creator_aux(IInputFormatInstance gif)
        {
            for (int i = 0; i < gif.ESIZE; i++)
            {
                int s = gif.Source [i];
                int t = gif.Target [i];
                g.addVertex(s);
                g.addVertex(t);
                g.addEdge(s, t);
                if (s == 0 || t == 0)
                {
                    throw new ArgumentNullException("WARNING: Vertex id is 0! ");
                }
            }
            IIteratorInstance <IKVPair <IInteger, IInputFormat> > output_gifs_instance = (IIteratorInstance <IKVPair <IInteger, IInputFormat> >)Output_gif.Instance;
            IKVPairInstance <IInteger, IInputFormat> item = (IKVPairInstance <IInteger, IInputFormat>)Output_gif.createItem();

            ((IIntegerInstance)item.Key).Value = gif.PARTID;
            item.Value = gif;
            output_gifs_instance.put(item);
        }