Skip to content
Snippets Groups Projects
Select Git revision
  • Hotfix/64-releaseUDE
  • master default protected
  • gitkeep
  • dev protected
  • Issue/2583-treeBug
  • Hotfix/2504-formGen
  • Issue/2309-docs
  • Issue/2462-removeTraces
  • Hotfix/2459-EncodingPath
  • Hotfix/2452-linkedDeletion
  • Issue/1792-newMetadataStructure
  • Hotfix/2384-guestsAndLinked
  • v2.8.14-Hotfix2365
  • Hotfix/2365-targetClassWorks
  • Hotfix/2371-fixGitLabinRCV
  • Fix/xxxx-activateGitlab
  • Test/xxxx-enablingGitLab
  • Issue/2349-gitlabHttps
  • Issue/2287-guestRole
  • Hotfix/2296-selectedValuesNotReturned
  • Issue/2102-gitLabResTypeRCV
  • v2.11.5
  • v2.11.4
  • v2.11.3
  • v2.11.2
  • v2.11.1
  • v2.11.0
  • v2.10.3
  • v2.10.2
  • v2.10.1
  • v2.10.0
  • v2.9.4
  • v2.9.3
  • v2.9.2
  • v2.9.1
  • v2.9.0
  • v2.8.16
  • v2.8.15
  • v2.8.14
  • v2.8.13
  • v2.8.12
41 results

Tree.sln

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    Program.cs 2.73 KiB
    using CommandLine;
    using SparseTransform;
    using CLIOptions;
    
    public class Program
    
    {
        public static void Main(string[] args)
        {
            Parser.Default.ParseArguments<ConvertOptions, PartitionOptions>(args)
                .WithParsed<ConvertOptions>(o =>
                {
    
                    String MMMatrix = File.ReadAllText(o.Input);
                    String DotString = Convert2Dot(MMMatrix);
                    File.WriteAllText(o.Output, DotString);
    
                })
                .WithParsed<PartitionOptions>(o =>
                {
                    String MMMatrix = File.ReadAllText(o.Input);
                    String Output = "";
    
                    if (o.Format == Formats.ColoredDot)
                    {
                        Output = Partition2ColoredDot(MMMatrix, o.TextColor);
                    }
                    else if (o.Format == Formats.SeedMatrix)
                    {
                        Output = Partition2SeedMatrix(MMMatrix);
                    }
                    else if (o.Format == Formats.CompressedMatrix)
                    {
                        Output = Partition2CompressedMatrix(MMMatrix);
                    }
    
                    File.WriteAllText(o.Output, Output);
                });
        }
    
        /// <summary>
        /// Reference to the Convert2Dot method from ConversionManager
        /// </summary>
        /// <param name="MMMatrix">raw MatrixMarket input String</param>
        /// <returns>Dot String</returns>    
        private static String Convert2Dot(String MMMatrix)
        {
            return ConversionManager.Convert2Dot(MMMatrix);
        }
    
        /// <summary>
        /// Reference to the Partition2ColoredDot method from ConversionManager
        /// </summary>
        /// <param name="MMMatrix">raw MatrixMarket input String</param>
        /// <param name="textColor">true if color should additionally be represented as text</param>
        /// <returns>Dot String with coloring information</returns>
        private static String Partition2ColoredDot(String MMMatrix, bool textColor = false)
        {
            return ConversionManager.Partition2ColoredDot(MMMatrix);
        }
    
        /// <summary>
        /// Reference to the Partition2SeedMatrix method from ConversionManager
        /// </summary>
        /// <param name="MMMatrix">raw MatrixMarket input String</param>
        /// <returns>String of SeedMatrix</returns>
        private static String Partition2SeedMatrix(String MMMatrix)
        {
            return ConversionManager.Partition2SeedMatrix(MMMatrix);
        }
    
        /// <summary>
        /// Reference to the Partition2CompressedMatrix method from ConversionManager
        /// </summary>
        /// <param name="MMMatrix">raw MatrixMarket input String</param>
        /// <returns>String of CompressedMatrix</returns>
        private static String Partition2CompressedMatrix(String MMMatrix)
        {
            return ConversionManager.Partition2CompressedMatrix(MMMatrix);
        }
    }