https://github.com/ruby/matrix
An implementation of Matrix and Vector classes
https://github.com/ruby/matrix
Keywords
hacktoberfest ruby
Keywords from Contributors
repl bigdecimal webrick rubygems debugger debugging-tool documentation-tool strscan lalr-parser-generator parser-generator
Last synced: about 19 hours ago
JSON representation
Repository metadata
An implementation of Matrix and Vector classes
- Host: GitHub
- URL: https://github.com/ruby/matrix
- Owner: ruby
- License: other
- Created: 2017-09-26T09:52:06.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2026-02-10T00:04:04.000Z (22 days ago)
- Last Synced: 2026-02-28T14:35:13.744Z (3 days ago)
- Topics: hacktoberfest, ruby
- Language: Ruby
- Homepage:
- Size: 289 KB
- Stars: 80
- Watchers: 35
- Forks: 26
- Open Issues: 3
- Releases: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: COPYING
README.md
Matrix

An implementation of Matrix and Vector classes.
The Matrix class represents a mathematical matrix. It provides methods for creating matrices, operating on them arithmetically and algebraically, and determining their mathematical properties (trace, rank, inverse, determinant, eigensystem, etc.).
The Vector class represents a mathematical vector, which is useful in its own right, and also constitutes a row or column of a Matrix.
Installation
The matrix library comes pre-installed with Ruby. Unless you need recent features, you can simply require 'matrix' directly, no need to install it.
If you need features that are more recent than the version of Ruby you want to support (check the CHANGELOG), you must use the gem. To do this, add this line to your application's Gemfile or gem's gemspec:
gem 'matrix'
And then execute:
$ bundle
To make sure that the gem takes precedence over the builtin library, call bundle exec ... (or call gem 'matrix' explicitly).
Usage
require 'matrix'
m = Matrix[[1, 2], [3, 4]]
m.determinant # => -2
Development
After checking out the repo, run bin/setup to install dependencies. Then, run rake test to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/ruby/matrix.
License
The gem is available as open source under the terms of the 2-Clause BSD License.
Owner metadata
- Name: The Ruby Programming Language
- Login: ruby
- Email: info@ruby-lang.org
- Kind: organization
- Description: Repositories related to the Ruby Programming language
- Website: https://www.ruby-lang.org/
- Location: Matsue, Japan
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/210414?v=4
- Repositories: 171
- Last ynced at: 2023-04-09T03:40:20.875Z
- Profile URL: https://github.com/ruby
GitHub Events
Total
- Release event: 1
- Delete event: 3
- Member event: 1
- Pull request event: 8
- Fork event: 2
- Issues event: 1
- Watch event: 10
- Push event: 7
- Create event: 4
Last Year
- Release event: 1
- Delete event: 3
- Member event: 1
- Pull request event: 8
- Fork event: 2
- Watch event: 6
- Push event: 7
- Create event: 4
Committers metadata
Last synced: 3 days ago
Total Commits: 253
Total Committers: 34
Avg Commits per committer: 7.441
Development Distribution Score (DDS): 0.573
Commits in past year: 16
Committers in past year: 4
Avg Commits per committer in past year: 4.0
Development Distribution Score (DDS) in past year: 0.375
| Name | Commits | |
|---|---|---|
| marcandre | m****e@b****e | 108 |
| Hiroshi SHIBATA | h****t@r****g | 44 |
| matz | m****z@b****e | 22 |
| nobu | n****u@b****e | 12 |
| dependabot[bot] | 4****] | 11 |
| keiju | k****u@b****e | 9 |
| kazu | k****u@b****e | 4 |
| yugui | y****i@b****e | 4 |
| Akira Matsuda | r****e@d****p | 3 |
| mame | m****e@b****e | 3 |
| naruse | n****e@b****e | 3 |
| Marcus Stollsteimer | s****r@w****e | 3 |
| gsinclair | g****r@b****e | 2 |
| dave | d****e@b****e | 2 |
| Felix Wolfsteller | f****r@g****m | 2 |
| Jan Lelis | m****l@j****e | 2 |
| akr | a****r@b****e | 2 |
| zverok | z****e@g****m | 1 |
| wanabe | w****e@b****e | 1 |
| usa | u****a@b****e | 1 |
| universato | u****o@g****m | 1 |
| zzak | z****k@b****e | 1 |
| svn | s****n@b****e | 1 |
| shyouhei | s****i@b****e | 1 |
| shugo | s****o@b****e | 1 |
| kojix2 | 2****k@g****m | 1 |
| drbrain | d****n@b****e | 1 |
| ayumin | a****n@b****e | 1 |
| Takashi Kokubun | t****n@g****m | 1 |
| Koichi Sasada | k****1@a****t | 1 |
| and 4 more... | ||
Committer domains:
- sixtwothree.org: 1
- atdot.net: 1
- janlelis.de: 1
- dio.jp: 1
- ruby-lang.org: 1
Issue and Pull Request metadata
Last synced: 8 days ago
Total issues: 7
Total pull requests: 42
Average time to close issues: 17 days
Average time to close pull requests: 6 days
Total issue authors: 5
Total pull request authors: 16
Average comments per issue: 3.29
Average comments per pull request: 0.62
Merged pull request: 32
Bot issues: 0
Bot pull requests: 13
Past year issues: 0
Past year pull requests: 14
Past year average time to close issues: N/A
Past year average time to close pull requests: about 5 hours
Past year issue authors: 0
Past year pull request authors: 3
Past year average comments per issue: 0
Past year average comments per pull request: 0.0
Past year merged pull request: 10
Past year bot issues: 0
Past year bot pull requests: 12
Top Issue Authors
- fwolfst (3)
- turonn (1)
- headius (1)
- coffeejunk (1)
- mcartron (1)
Top Pull Request Authors
- dependabot[bot] (13)
- hsbt (6)
- marcandre (4)
- janlelis (3)
- stomar (3)
- fwolfst (2)
- olleolleolle (2)
- AlessandroMinali (1)
- k0kubun (1)
- grzegorz-jakubiak (1)
- der-scheme (1)
- kojix2 (1)
- zverok (1)
- gmcgibbon (1)
- universato (1)
Top Issue Labels
Top Pull Request Labels
- dependencies (13)
- github_actions (12)
Package metadata
- Total packages: 21
-
Total downloads:
- rubygems: 289,077,983 total
- Total docker downloads: 8,212,373,282
- Total dependent packages: 69 (may contain duplicates)
- Total dependent repositories: 43,643 (may contain duplicates)
- Total versions: 47
- Total maintainers: 4
gem.coop: matrix
An implementation of Matrix and Vector classes.
- Homepage: https://github.com/ruby/matrix
- Documentation: http://www.rubydoc.info/gems/matrix/
- Licenses: Ruby,BSD-2-Clause
- Latest release: 0.4.3 (published 9 months ago)
- Last Synced: 2026-03-01T03:05:00.629Z (2 days ago)
- Versions: 8
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 144,701,430 Total
- Docker Downloads: 4,106,186,641
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 0.06%
- Downloads: 0.181%
- Maintainers (3)
rubygems.org: matrix
An implementation of Matrix and Vector classes.
- Homepage: https://github.com/ruby/matrix
- Documentation: http://www.rubydoc.info/gems/matrix/
- Licenses: Ruby,BSD-2-Clause
- Latest release: 0.4.3 (published 9 months ago)
- Last Synced: 2026-02-26T19:00:49.008Z (5 days ago)
- Versions: 8
- Dependent Packages: 69
- Dependent Repositories: 43,643
- Downloads: 144,376,553 Total
- Docker Downloads: 4,106,186,641
-
Rankings:
- Docker downloads count: 0.016%
- Dependent repos count: 0.161%
- Downloads: 0.404%
- Dependent packages count: 0.511%
- Average: 2.193%
- Forks count: 4.882%
- Stargazers count: 7.182%
- Maintainers (3)
proxy.golang.org: github.com/ruby/matrix
- Homepage:
- Documentation: https://pkg.go.dev/github.com/ruby/matrix#section-documentation
- Licenses: other
- Latest release: v0.4.3 (published 9 months ago)
- Last Synced: 2026-02-26T19:01:01.936Z (5 days ago)
- Versions: 7
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Forks count: 4.23%
- Stargazers count: 5.54%
- Average: 7.537%
- Dependent packages count: 9.576%
- Dependent repos count: 10.802%
alpine-v3.18: ruby-matrix
An implementation of Matrix and Vector classes
- Homepage: https://github.com/ruby/matrix
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 0.4.2-r1 (published almost 3 years ago)
- Last Synced: 2026-02-02T08:25:50.509Z (29 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 10.478%
- Forks count: 19.63%
- Stargazers count: 22.283%
- Maintainers (1)
alpine-v3.18: ruby-matrix-doc
An implementation of Matrix and Vector classes (ri docs)
- Homepage: https://github.com/ruby/matrix
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 0.4.2-r1 (published almost 3 years ago)
- Last Synced: 2026-02-06T07:15:53.490Z (25 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 10.478%
- Forks count: 19.63%
- Stargazers count: 22.283%
- Maintainers (1)
alpine-edge: ruby-matrix-doc
An implementation of Matrix and Vector classes (ri docs)
- Homepage: https://github.com/ruby/matrix
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 0.4.2-r3 (published 10 months ago)
- Last Synced: 2026-03-01T13:03:45.826Z (2 days ago)
- Versions: 4
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 14.641%
- Average: 14.88%
- Forks count: 20.515%
- Stargazers count: 24.366%
- Maintainers (1)
alpine-edge: ruby-matrix
An implementation of Matrix and Vector classes
- Homepage: https://github.com/ruby/matrix
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 0.4.2-r3 (published 10 months ago)
- Last Synced: 2026-02-05T05:03:45.633Z (26 days ago)
- Versions: 4
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 14.641%
- Average: 14.88%
- Forks count: 20.515%
- Stargazers count: 24.366%
- Maintainers (1)
alpine-v3.16: ruby-matrix
An implementation of Matrix and Vector classes
- Homepage: https://github.com/ruby/matrix
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 0.4.2-r0 (published almost 4 years ago)
- Last Synced: 2026-02-06T07:04:23.505Z (25 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Average: 14.918%
- Forks count: 15.067%
- Stargazers count: 17.292%
- Dependent packages count: 27.311%
- Maintainers (1)
alpine-v3.16: ruby-matrix-doc
An implementation of Matrix and Vector classes (ri docs)
- Homepage: https://github.com/ruby/matrix
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 0.4.2-r0 (published almost 4 years ago)
- Last Synced: 2026-03-01T14:13:34.114Z (2 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Average: 14.918%
- Forks count: 15.067%
- Stargazers count: 17.292%
- Dependent packages count: 27.311%
- Maintainers (1)
alpine-v3.17: ruby-matrix
An implementation of Matrix and Vector classes
- Homepage: https://github.com/ruby/matrix
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 0.4.2-r0 (published almost 4 years ago)
- Last Synced: 2026-02-02T03:42:43.777Z (29 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Average: 16.466%
- Forks count: 17.896%
- Stargazers count: 20.714%
- Dependent packages count: 27.254%
- Maintainers (1)
alpine-v3.17: ruby-matrix-doc
An implementation of Matrix and Vector classes (ri docs)
- Homepage: https://github.com/ruby/matrix
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 0.4.2-r0 (published almost 4 years ago)
- Last Synced: 2026-02-03T11:12:52.363Z (28 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Average: 16.466%
- Forks count: 17.896%
- Stargazers count: 20.714%
- Dependent packages count: 27.254%
- Maintainers (1)
alpine-v3.21: ruby-matrix
An implementation of Matrix and Vector classes
- Homepage: https://github.com/ruby/matrix
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 0.4.2-r2 (published about 2 years ago)
- Last Synced: 2026-02-02T03:42:40.341Z (29 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
- Maintainers (1)
alpine-v3.19: ruby-matrix-doc
An implementation of Matrix and Vector classes (ri docs)
- Homepage: https://github.com/ruby/matrix
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 0.4.2-r1 (published almost 3 years ago)
- Last Synced: 2026-02-03T13:25:25.682Z (28 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
- Maintainers (1)
alpine-v3.22: ruby-matrix
An implementation of Matrix and Vector classes
- Homepage: https://github.com/ruby/matrix
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 0.4.2-r3 (published 10 months ago)
- Last Synced: 2026-02-06T18:27:59.804Z (25 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
- Maintainers (1)
alpine-v3.23: ruby-matrix-doc
An implementation of Matrix and Vector classes (ri docs)
alpine-v3.23: ruby-matrix
An implementation of Matrix and Vector classes
alpine-v3.22: ruby-matrix-doc
An implementation of Matrix and Vector classes (ri docs)
- Homepage: https://github.com/ruby/matrix
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 0.4.2-r3 (published 10 months ago)
- Last Synced: 2026-02-02T03:43:07.111Z (29 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
- Maintainers (1)
alpine-v3.21: ruby-matrix-doc
An implementation of Matrix and Vector classes (ri docs)
- Homepage: https://github.com/ruby/matrix
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 0.4.2-r2 (published about 2 years ago)
- Last Synced: 2026-02-02T03:43:25.240Z (29 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
- Maintainers (1)
alpine-v3.20: ruby-matrix-doc
An implementation of Matrix and Vector classes (ri docs)
- Homepage: https://github.com/ruby/matrix
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 0.4.2-r2 (published about 2 years ago)
- Last Synced: 2026-02-02T09:11:23.059Z (29 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
- Maintainers (1)
alpine-v3.19: ruby-matrix
An implementation of Matrix and Vector classes
- Homepage: https://github.com/ruby/matrix
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 0.4.2-r1 (published almost 3 years ago)
- Last Synced: 2026-02-02T06:20:00.334Z (29 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
- Maintainers (1)
alpine-v3.20: ruby-matrix
An implementation of Matrix and Vector classes
- Homepage: https://github.com/ruby/matrix
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 0.4.2-r2 (published about 2 years ago)
- Last Synced: 2026-02-02T03:43:21.118Z (29 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
- Maintainers (1)
Dependencies
- rake >= 0
- test-unit >= 0
- actions/checkout v4 composite
- ruby/setup-ruby v1 composite
- actions/checkout 0ad4b8fadaa221de15dcec353f45205ec38ea70b composite
- ruby/setup-ruby a6e6f86333f0a2523ece813039b8b4be04560854 composite
- rubygems/release-gem a25424ba2ba8b387abc8ef40807c2c85b96cbe32 composite
- step-security/harden-runner 6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 composite
Score: 30.80870973478981