matrix 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/matrix.rb +1 -1
- data/lib/matrix/version.rb +1 -1
- data/matrix.gemspec +2 -5
- metadata +4 -38
- data/.gitignore +0 -9
- data/Gemfile +0 -6
- data/README.md +0 -45
- data/Rakefile +0 -10
- data/bin/console +0 -14
- data/bin/setup +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb141efd74292651e0289eb99780e5fdc476e5bf124a1038f6240939c629a2bf
|
4
|
+
data.tar.gz: 0e2f47d4f48c2986e4a4cc71973040b9b4a44f1e4c17a0f2319d46316ec742c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86c8960e1d3878711dc34b4af96ae95a4e0a2c765ab3fd1b63cf1e868ccd6b89cbdbbf4821744202c8ad834f7b65bd7b15642383156cac78d767351085ea4997
|
7
|
+
data.tar.gz: e1f5cf5fbdfb027d80afb774c3c89ef8ea837f2c1711ee91ac4689154a24588bfa21f74f2e47a71e5be698512c0023e4649ff1dc64d9feb0fbfcefe250874694
|
data/lib/matrix.rb
CHANGED
@@ -379,7 +379,7 @@ class Matrix
|
|
379
379
|
end
|
380
380
|
|
381
381
|
private def set_value(row, col, value)
|
382
|
-
raise ErrDimensionMismatch, "Expected a
|
382
|
+
raise ErrDimensionMismatch, "Expected a value, got a #{value.class}" if value.respond_to?(:to_matrix)
|
383
383
|
|
384
384
|
@rows[row][col] = value
|
385
385
|
end
|
data/lib/matrix/version.rb
CHANGED
data/matrix.gemspec
CHANGED
@@ -19,11 +19,8 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.licenses = ["Ruby", "BSD-2-Clause"]
|
20
20
|
spec.required_ruby_version = ">= 2.5.0"
|
21
21
|
|
22
|
-
spec.files = ["
|
22
|
+
spec.files = ["LICENSE.txt", "lib/matrix.rb", "lib/matrix/eigenvalue_decomposition.rb", "lib/matrix/lup_decomposition.rb", "lib/matrix/version.rb", "matrix.gemspec"]
|
23
23
|
spec.bindir = "exe"
|
24
|
-
spec.executables =
|
24
|
+
spec.executables = []
|
25
25
|
spec.require_paths = ["lib"]
|
26
|
-
|
27
|
-
spec.add_development_dependency "bundler"
|
28
|
-
spec.add_development_dependency "rake"
|
29
26
|
end
|
metadata
CHANGED
@@ -1,43 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: matrix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marc-Andre Lafortune
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
12
|
-
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
11
|
+
date: 2021-06-18 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
41
13
|
description: An implementation of Matrix and Vector classes.
|
42
14
|
email:
|
43
15
|
- ruby-core@marc-andre.ca
|
@@ -45,13 +17,7 @@ executables: []
|
|
45
17
|
extensions: []
|
46
18
|
extra_rdoc_files: []
|
47
19
|
files:
|
48
|
-
- ".gitignore"
|
49
|
-
- Gemfile
|
50
20
|
- LICENSE.txt
|
51
|
-
- README.md
|
52
|
-
- Rakefile
|
53
|
-
- bin/console
|
54
|
-
- bin/setup
|
55
21
|
- lib/matrix.rb
|
56
22
|
- lib/matrix/eigenvalue_decomposition.rb
|
57
23
|
- lib/matrix/lup_decomposition.rb
|
@@ -77,7 +43,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
77
43
|
- !ruby/object:Gem::Version
|
78
44
|
version: '0'
|
79
45
|
requirements: []
|
80
|
-
rubygems_version: 3.
|
46
|
+
rubygems_version: 3.3.0.dev
|
81
47
|
signing_key:
|
82
48
|
specification_version: 4
|
83
49
|
summary: An implementation of Matrix and Vector classes.
|
data/.gitignore
DELETED
data/Gemfile
DELETED
data/README.md
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
# Matrix [![Version](https://badge.fury.io/rb/matrix.svg)](https://badge.fury.io/rb/matrix) [![Default Gem](https://img.shields.io/badge/stdgem-default-9c1260.svg)](https://stdgems.org/matrix/) [![Test](https://github.com/ruby/matrix/workflows/test/badge.svg)](https://github.com/ruby/matrix/actions?query=workflow%3Atest)
|
2
|
-
|
3
|
-
An implementation of `Matrix` and `Vector` classes.
|
4
|
-
|
5
|
-
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.).
|
6
|
-
|
7
|
-
The `Vector` class represents a mathematical vector, which is useful in its own right, and also constitutes a row or column of a `Matrix`.
|
8
|
-
|
9
|
-
## Installation
|
10
|
-
|
11
|
-
The `matrix` library comes pre-installed with Ruby. Unless you need recent features, you can simply `require 'matrix'` directly, no need to install it.
|
12
|
-
|
13
|
-
If you need features that are more recent than the version of Ruby you want to support (check the [CHANGELOG](CHANGELOG.md)), you must use the gem. To do this, add this line to your application's Gemfile or gem's gemspec:
|
14
|
-
|
15
|
-
```ruby
|
16
|
-
gem 'matrix'
|
17
|
-
```
|
18
|
-
|
19
|
-
And then execute:
|
20
|
-
|
21
|
-
$ bundle
|
22
|
-
|
23
|
-
To make sure that the gem takes precedence over the builtin library, call `bundle exec ...` (or call `gem 'matrix'` explicitly).
|
24
|
-
|
25
|
-
## Usage
|
26
|
-
|
27
|
-
```ruby
|
28
|
-
require 'matrix'
|
29
|
-
m = Matrix[[1, 2], [3, 4]]
|
30
|
-
m.determinant # => -2
|
31
|
-
```
|
32
|
-
|
33
|
-
## Development
|
34
|
-
|
35
|
-
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.
|
36
|
-
|
37
|
-
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](https://rubygems.org).
|
38
|
-
|
39
|
-
## Contributing
|
40
|
-
|
41
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/ruby/matrix.
|
42
|
-
|
43
|
-
## License
|
44
|
-
|
45
|
-
The gem is available as open source under the terms of the [2-Clause BSD License](https://opensource.org/licenses/BSD-2-Clause).
|
data/Rakefile
DELETED
data/bin/console
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "bundler/setup"
|
4
|
-
require "matrix"
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require "irb"
|
14
|
-
IRB.start(__FILE__)
|