{"id":22886438,"url":"https://github.com/moluopro/matrices","last_synced_at":"2026-05-04T11:31:50.369Z","repository":{"id":65485571,"uuid":"583955333","full_name":"moluopro/matrices","owner":"moluopro","description":"Matrix Computing and Linear Algebra Library for Dart and Flutter","archived":false,"fork":false,"pushed_at":"2023-07-24T02:55:30.000Z","size":1598,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-28T16:13:31.002Z","etag":null,"topics":["dart","flutter","linear-algebra","math","mathematics","matrix"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/matrices","language":"Dart","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/moluopro.png","metadata":{"files":{"readme":"README.ZH.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":["https://paypal.me/abandoft"]}},"created_at":"2022-12-31T16:18:09.000Z","updated_at":"2025-04-11T01:23:21.000Z","dependencies_parsed_at":"2023-07-24T04:03:26.925Z","dependency_job_id":null,"html_url":"https://github.com/moluopro/matrices","commit_stats":null,"previous_names":["moluopro/matrices","abandoft/matrices"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/moluopro/matrices","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moluopro%2Fmatrices","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moluopro%2Fmatrices/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moluopro%2Fmatrices/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moluopro%2Fmatrices/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moluopro","download_url":"https://codeload.github.com/moluopro/matrices/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moluopro%2Fmatrices/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32605752,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"ssl_error","status_checked_at":"2026-05-04T10:08:02.005Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["dart","flutter","linear-algebra","math","mathematics","matrix"],"created_at":"2024-12-13T20:18:46.593Z","updated_at":"2026-05-04T11:31:50.353Z","avatar_url":"https://github.com/moluopro.png","language":"Dart","funding_links":["https://paypal.me/abandoft"],"categories":[],"sub_categories":[],"readme":"## Matrices - Dart矩阵运算和线性代数库  \n\n[English](https://github.com/moluopro/matrices/blob/master/README.md) \u0026nbsp;\u0026nbsp;\u0026nbsp;[中文](https://github.com/moluopro/matrices/blob/master/README.ZH.md)  \n\n****\n\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;Matrices是一个Dart语言的矩阵运算和线性代数库。开发它的目的是为Astable等项目提供矩阵运算支持。目前所有运算均使用Dart语言实现。使用时需要导入matrices.dart文件。另外，在使用Matrices之前，您需要了解线性代数的相关概念。\u003cbr\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;线性代数是数学的一个分支，它的研究对象是向量、线性空间、线性变换和有限维的线性方程组。线性代数主要处理线性关系问题。线性关系意即数学对象之间的关系是以一次形式来表达的。由于科学研究中的非线性模型通常可以被近似为线性模型，因此线性代数被广泛地应用于自然科学和社会科学中。  \n\n****\n\n## 简单使用  \n\n```dart\n  /// Creating a matrix\n\n  var mat = Matrix.fromList([\n    [1, 2, 3],\n    [4, 5, 6]\n  ]);\n  print( mat );\n\n  // Matrix: 2x4\n  // [1.0, 2.0, 3.0]\n  // [4.0, 5.0, 6.0]\n\n  /// Creating a matrix filled with 0’s\n\n  var mat = Matrix.zero(2, 3);\n  print( mat );\n\n  // Matrix: 2x3\n  // [0.0, 0.0, 0.0]\n  // [0.0, 0.0, 0.0]\n\n  /// Creating a matrix filled with 1’s\n\n  var mat = Matrix.one(2, 3);\n  print( mat );\n  \n  // Matrix: 2x3\n  // [1.0, 1.0, 1.0]\n  // [1.0, 1.0, 1.0]\n\n  /// Creating a matrix filled with certain value\n\n  var mat = Matrix.number(9, 2, 3);\n  print( mat );\n  \n  // Matrix: 2x3\n  // [9.0, 9.0, 9.0]\n  // [9.0, 9.0, 9.0]\n\n  /// Creating a matrix from a flattened list\n  \n  // If the length of the flattened list is smaller than the expected matrix size,\n  // zeros will be filled in the vacant position.\n  \n  var mat1 = Matrix.fromFlattenedList([1, 2, 3, 4], 2, 2);\n  var mat2 = Matrix.fromFlattenedList([1, 2, 3, 4], 2, 3);\n  print(mat1);\n  print(mat2);\n\n  // Matrix: 2x2\n  // [1.0, 2.0]\n  // [3.0, 4.0]\n\n  // Matrix: 2x3\n  // [1.0, 2.0, 3.0]\n  // [4.0, 0.0, 0.0]\n\n  /// Creating a matrix filled with random values\n\n  var mat = Matrix.random(2, 3);\n  print( mat );\n  \n  // Matrix: 2x3\n  // [0.38224693703597046, 0.5412146597032305, 0.6424342222644003]\n  // [0.8491145735932242, 0.6236773300386973, 0.25269555696856316]\n\n  /// Addition\n\n  print( mat + 3 );\n  print( mat + mat );\n\n  // Matrix: 2x3\n  // [4.0, 5.0, 6.0]\n  // [7.0, 8.0, 9.0]\n\n  // Matrix: 2x3\n  // [2.0, 4.0, 6.0]\n  // [8.0, 10.0, 12.0]\n\n  /// Take the matrix mat as example\n  Matrix mat 2x4\n      [1, 2, 3, 4]\n      [5, 6, 7, 8]\n\n  /// Indexing a matrix element\n  print( mat[1][2] );\n\n  // 7.0\n\n  /// Number of rows\n  print( mat.rowCount );\n\n  // 2\n\n  /// Number of columns\n  print( mat.columnCount );\n\n  // 4\n\n  /// Total number of elements\n  print( mat.count );\n\n  // 8\n\n\n  /// Slicing a row\n\n  print( mat.row(0) );\n\n  // An easier slicing method\n  print( mat[0] );\n\n  // [1.0, 2.0, 3.0, 4.0]\n  // [1.0, 2.0, 3.0, 4.0]\n\n  /// Slicing a column\n  print( mat.column(0) );\n\n  // Here, we also provide an easier slicing method for columns\n  // Add a minus before real column index to slice column (except the 1st column)\n\n  // Slicing the 1st column\n  print( mat[''] );\n\n  // Slicing the 2nd column\n  print( mat[-1] );\n\n  // [1.0, 5.0]\n  // [1.0, 5.0]\n  // [2.0, 6.0]\n\n  /// Transposing\n  print( mat.transpose );\n\n  // Matrix: 4x2\n  // [1.0, 5.0]\n  // [2.0, 6.0]\n  // [3.0, 7.0]\n  // [4.0, 8.0]\n\n  /// Row Echelon Form\n  print( mat.rowEchelonForm );\n\n  // Matrix: 2x4\n  // [1.0, 0.0, -1.00000, -2.00000]\n  // [0.0, 1.0, 2.00000, 3.00000]\n\n\n  /// Rank\n  print( mat.rank );\n\n  // 2\n\n  /// Take the matrix mat as example, too.\n  Matrix mat 2x4\n      [1, 2, 3, 4]\n      [5, 6, 7, 8]\n\n  /// Modify an element\n  mat[0][0] = 6;\n  print( mat[0] );\n\n  // [6.0, 2.0, 3.0, 4.0]\n\n  /// Modify a row\n  mat.setRow([6, 6, 6, 6], 0);\n  print( mat[0] );\n\n  // [6.0, 6.0, 6.0, 6.0]\n\n  // A eaiser way to modify a row\n  mat[0] = [8, 8, 8, 8];\n  print( mat[0] );\n\n  // [8.0, 8.0, 8.0, 8.0]\n\n  /// Modify a column\n  mat.setColumn([6, 6], 0);\n  print( mat );\n\n  // Matrix: 2x4\n  // [6.0, 2.0, 3.0, 4.0]\n  // [6.0, 6.0, 7.0, 8.0]\n\n  // A eaiser way to modify a column\n  // Add a minus before real column index to modify column (except the 1st column which requires an empty string)\n  mat[''] = [8, 8];\n  mat[-1] = [9, 9];\n  print( mat );\n\n  // Matrix: 2x4\n  // [8.0, 9.0, 3.0, 4.0]\n  // [8.0, 9.0, 7.0, 8.0]\n\n  /// Subtraction\n\n  var mat1 = Matrix.fromList([\n    [1, 2, 1],\n    [1, 2, 1]\n  ]);\n  print( mat - 3 );\n  print( mat - mat1 );\n\n  // Matrix: 2x3\n  // [-2.0, -1.0, 0.0]\n  // [1.0, 2.0, 3.0]\n\n  // Matrix: 2x3\n  // [0.0, 0.0, 2.0]\n  // [3.0, 3.0, 5.0]\n\n\n  /// Scalar Multiplication\n\n  // Note: Scalar should be on the right position of the operator *\n  print( mat * 3 );\n\n  // Matrix: 2x3\n  // [3.0, 6.0, 9.0]\n  // [12.0, 15.0, 18.0]\n\n\n  /// Matrix Product\n\n  var mat2 = Matrix.fromList([\n    [2, 3.5],\n    [1, -2],\n    [-4, 0.5]\n  ]);\n  print( mat * mat2 );\n\n  // Matrix: 2x2\n  // [-8.0, 1.0]\n  // [-11.0, 7.0]\n\n  /// 这只是Matrices的简单入门，进一步使用请翻阅文档\n\n```\n\n## 进阶用法  \n点击 [Matrices文档](https://abandoft.gitee.io/matrices/) 探索精彩的矩阵世界\n\n## 谁在使用\n- [Astable](https://apps.microsoft.com/store/detail/9NQM9B17MGJS) - 优雅而强大的结构力学软件","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoluopro%2Fmatrices","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoluopro%2Fmatrices","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoluopro%2Fmatrices/lists"}