{"id":27483388,"url":"https://github.com/hectorpulido/simple_linear_algebra","last_synced_at":"2025-10-10T23:44:25.480Z","repository":{"id":111766935,"uuid":"116608150","full_name":"HectorPulido/Simple_Linear_Algebra","owner":"HectorPulido","description":"Simple list of functions of matrices","archived":false,"fork":false,"pushed_at":"2018-01-21T22:23:07.000Z","size":151,"stargazers_count":5,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-10T23:44:24.871Z","etag":null,"topics":["linear-algebra","vectors"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HectorPulido.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-01-07T23:46:48.000Z","updated_at":"2024-05-05T14:44:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"a70d69d7-f9ae-4e66-bef3-2075a6aa4d1e","html_url":"https://github.com/HectorPulido/Simple_Linear_Algebra","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/HectorPulido/Simple_Linear_Algebra","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HectorPulido%2FSimple_Linear_Algebra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HectorPulido%2FSimple_Linear_Algebra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HectorPulido%2FSimple_Linear_Algebra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HectorPulido%2FSimple_Linear_Algebra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HectorPulido","download_url":"https://codeload.github.com/HectorPulido/Simple_Linear_Algebra/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HectorPulido%2FSimple_Linear_Algebra/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005584,"owners_count":26083921,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["linear-algebra","vectors"],"created_at":"2025-04-16T15:47:07.033Z","updated_at":"2025-10-10T23:44:25.474Z","avatar_url":"https://github.com/HectorPulido.png","language":"C#","funding_links":["https://www.patreon.com/HectorPulido"],"categories":[],"sub_categories":[],"readme":"# Simple linear algebra for C#\n\nThis is simple linear algebra for C# easy to understand\n\n## Functions\n\nAll usable functions \n\n![alt text](https://github.com/HectorPulido/Simple_Linear_Algebra/blob/master/Img/Functions.png?raw=true \"Functions\")\n\n```csharp\ndouble[,] a1 = { { 10, 20, 30 }, { 1, 3, 4 } };\n\nMatrix a = new Matrix(a1);\nConsole.WriteLine(\"Matrix a\");\nConsole.WriteLine(a.ToString());\n\nMatrix b = Matrix.Identy(2);\nConsole.WriteLine(\"Matrix identy b\");\nConsole.WriteLine(b.ToString());\n\nMatrix c = a.T;\nConsole.WriteLine(\"Matrix a transposed c\");\nConsole.WriteLine(c.ToString());\n\nMatrix d = a + 1;\nConsole.WriteLine(\"Matrix a + 1, d\");\nConsole.WriteLine(d.ToString());\n\nMatrix e = a - 1;\nConsole.WriteLine(\"Matrix a - 1, e\");\nConsole.WriteLine(e.ToString());\n\nMatrix f = a * 10;\nConsole.WriteLine(\"Matrix a * 10, f\");\nConsole.WriteLine(f.ToString());\n\nMatrix g = Matrix.Random(2, 3, new Random(123));\nConsole.WriteLine(\"Matrix g, random matrix\");\nConsole.WriteLine(g.ToString());\n\nMatrix h = a + g;\nConsole.WriteLine(\"Matrix h, a + g\");\nConsole.WriteLine(h.ToString());\n\nMatrix i = a * g.T;\nConsole.WriteLine(\"Matrix h, a * g' \");\nConsole.WriteLine(i.ToString());\n\nMatrix j = a.GetColumn(0);\nConsole.WriteLine(\"Matrix j, first column of a\");\nConsole.WriteLine(j.ToString());\n\nMatrix k = a.GetRow(0);\nConsole.WriteLine(\"Matrix k, first row of a\");\nConsole.WriteLine(k.ToString());\n\nMatrix l = a.AddColumn(Matrix.Ones(2, 1));\nConsole.WriteLine(\"Matrix l, a with a added column of ones\");\nConsole.WriteLine(l.ToString());\n\nMatrix m = a.AddRow(Matrix.Zeros(1, 3));\nConsole.WriteLine(\"Matrix m, a with a added row of zeros\");\nConsole.WriteLine(m.ToString());\n```\n## Helper \nRight now there are some additional useful functions on Helper.cs\n```csharp\nif (Helper.SaveMatrix(a1, \"a1.dat\"))\n\tConsole.WriteLine(\"a1, saved\");\n\nMatrix _a1;\nif(Helper.LoadMatrix(out _a1, \"a1.dat\"))\n\tConsole.WriteLine(\"a1, loaded \\n \" + _a1.ToString());\n\nConsole.WriteLine(\"Images can be loaded, and the size can be changed\");\nMatrix[] img = ImageHelper.LoadImage(\"Image.bmp\", 15, 15);\nConsole.WriteLine(img[0]); //BW\nConsole.WriteLine(img[1]); //R\nConsole.WriteLine(img[2]); //G\nConsole.WriteLine(img[3]); //B\n\nConsole.WriteLine(\"Images can be Saved\");\nImageHelper.SaveImage(img[0], \"BWImg.bmp\"); // Saved on BW\nImageHelper.SaveImage(img[1], img[2], img[3], \"ColorImg.bmp\"); //Saved on Color\n\nif (Helper.SaveCsv(Helper.MatrixToCsv(h), \"a.csv\"))\n\tConsole.WriteLine(\"Matrix saved on csv file\");                         \n\tstring[][] data;\nif (Helper.ReadCsv(out data, \"CsvFile.csv\"))\n{\n\tConsole.WriteLine(\"Data readed from csv file\");\n\tHelper.MapCsv(ref data, new Dictionary\u003cstring, string\u003e { { \"Ford\" , \"0\" },\n                                                                 { \"Chevy\", \"1\" },\n                                                                 { \"Jeep\" , \"2\" }});\n\tConsole.WriteLine(Helper.CsvToMatrix(data));\n}\n```\n## What can I do with this\nYou can use this as you want, as matrix calculator or something more complex, like machine learnign \n1. Multilayer perceptron (Neural network) https://github.com/HectorPulido/Vectorized-multilayer-neural-network\n2. Monolayer perceptron (Neural network) https://github.com/HectorPulido/Simple-vectorized-mono-layer-perceptron\n3. Convolutional neural network https://github.com/HectorPulido/Convolutional-Neural-Network-From-Scratch\n\n## How use it\nJust go to your project (on visual studio) and import the script LinearAlgebra.cs\n![alt text](https://github.com/HectorPulido/Simple_Linear_Algebra/blob/master/Img/HowToUse.png?raw=true \"HowToUseIt\")\nTo use Helper is the same process but, to use the ImageHelper you need to import System.Drawing.Dll from \n- Project -\u003e Framework -\u003e System.Drawing\n\n## Future\nThere are a lot of features I want to add, like a Console, but I want to focus on the Linear Algebra, to make it more complex and deep\n\n## Patreon\nPlease consider Support on Patreon\nhttps://www.patreon.com/HectorPulido\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhectorpulido%2Fsimple_linear_algebra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhectorpulido%2Fsimple_linear_algebra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhectorpulido%2Fsimple_linear_algebra/lists"}