コード例 #1
0
        // *** IDeeplyCloneable<Network<VtxT, EdgeT>> interface adaptation ***

        new public WeightedNetwork <VtxT> DeepClone()
        {
            WeightedNetwork <VtxT> clone = new WeightedNetwork <VtxT>();

            clone.m_vtx = m_vtx.DeepClone();
            clone.m_mtx = m_mtx.DeepClone();
            int i = 0;

            foreach (VtxT vtx in clone.m_vtx)
            {
                if (vtx != null)
                {
                    clone.m_vtx_to_idx.Add(vtx, i++);
                }
            }
            return(clone);
        }
コード例 #2
0
        // *** ICloneable<Network<VtxT, EdgeT>> interface adaptation ***

        new public WeightedNetwork <VtxT> Clone()
        {
            WeightedNetwork <VtxT> clone = new WeightedNetwork <VtxT>();

            clone.mVtx = mVtx.Clone();
            clone.mMtx = mMtx.Clone();
            int i = 0;

            foreach (VtxT vtx in clone.mVtx)
            {
                if (vtx != null)
                {
                    clone.mVtxToIdx.Add(vtx, i++);
                }
            }
            return(clone);
        }