/// <summary> /// Creates an instance of ICopyNetwork appropriate to the underlying /// Type of <paramref name="network"/>. /// The returned object can be used to create a copy of the input network. /// </summary> /// <param name="network">The network to be copied.</param> /// <returns>An ICopyNetwork instance</returns> public ICopyNetwork CreateCopier(INetwork network) { ICopyNetwork tool = null; if (network != null) { if (network is BlueSpider.Blob.Regular.Network.AdjList.SimpleAdjList) { tool = new BlueSpider.Blob.Regular.Network.AdjList.SimpleAdjListCopier(); } else if (network is AdjList) { tool = new AdjacentList.Y.AdjListCopier(); } else if (network is Matrix.CSpace.DirectedNetworkMatrix) { tool = new Matrix.CSpace.MatrixCopier(); } else if (network is Matrix.CSpace.UnDirectedNetworkMatrix) { tool = new Matrix.CSpace.MatrixCopier(); } else if (network is BlueSpider.Blob.Regular.Network.Matrix.SimpleFullMatrix) { throw new NotImplementedException(); } else if (network is BlueSpider.Blob.Regular.Network.Matrix.SimpleSymmetricMatrix) { throw new NotImplementedException(); } } return tool; }
internal static INetworkCopier CreateCopier(INetwork network) { INetworkCopier tool = null; if (network != null) { if (network is AdjList) { tool = new AdjacentList.Y.AdjListCopier(); } else if (network is Matrix.CSpace.DirectedNetworkMatrix) { tool = new BlueSpider.Blob.Network.Matrix.CSpace.MatrixCopier(); } else if (network is Matrix.CSpace.UnDirectedNetworkMatrix) { tool = new BlueSpider.Blob.Network.Matrix.CSpace.MatrixCopier(); } } return tool; }