@ai-ecoverse/wasix-ruby 3.4.11-1 → 3.4.11-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PRESTAGE.md +61 -27
- package/README.md +2 -2
- package/bin/bundle +29 -0
- package/bin/bundler +29 -0
- package/bin/erb +29 -0
- package/bin/gem +12 -0
- package/bin/irb +29 -0
- package/bin/rake +29 -0
- package/bin/ruby +1 -0
- package/bin/ruby.wasm +0 -0
- package/lib/ruby/3.4.0/English.rb +164 -0
- package/lib/ruby/3.4.0/benchmark.rb +594 -0
- package/lib/ruby/3.4.0/bundled_gems.rb +248 -0
- package/lib/ruby/3.4.0/bundler/build_metadata.rb +43 -0
- package/lib/ruby/3.4.0/bundler/capistrano.rb +22 -0
- package/lib/ruby/3.4.0/bundler/checksum.rb +264 -0
- package/lib/ruby/3.4.0/bundler/ci_detector.rb +75 -0
- package/lib/ruby/3.4.0/bundler/cli/add.rb +49 -0
- package/lib/ruby/3.4.0/bundler/cli/binstubs.rb +57 -0
- package/lib/ruby/3.4.0/bundler/cli/cache.rb +43 -0
- package/lib/ruby/3.4.0/bundler/cli/check.rb +40 -0
- package/lib/ruby/3.4.0/bundler/cli/clean.rb +25 -0
- package/lib/ruby/3.4.0/bundler/cli/common.rb +138 -0
- package/lib/ruby/3.4.0/bundler/cli/config.rb +204 -0
- package/lib/ruby/3.4.0/bundler/cli/console.rb +42 -0
- package/lib/ruby/3.4.0/bundler/cli/doctor/diagnose.rb +167 -0
- package/lib/ruby/3.4.0/bundler/cli/doctor/ssl.rb +249 -0
- package/lib/ruby/3.4.0/bundler/cli/doctor.rb +33 -0
- package/lib/ruby/3.4.0/bundler/cli/exec.rb +89 -0
- package/lib/ruby/3.4.0/bundler/cli/fund.rb +36 -0
- package/lib/ruby/3.4.0/bundler/cli/gem.rb +467 -0
- package/lib/ruby/3.4.0/bundler/cli/info.rb +83 -0
- package/lib/ruby/3.4.0/bundler/cli/init.rb +51 -0
- package/lib/ruby/3.4.0/bundler/cli/inject.rb +60 -0
- package/lib/ruby/3.4.0/bundler/cli/install.rb +199 -0
- package/lib/ruby/3.4.0/bundler/cli/issue.rb +41 -0
- package/lib/ruby/3.4.0/bundler/cli/list.rb +66 -0
- package/lib/ruby/3.4.0/bundler/cli/lock.rb +94 -0
- package/lib/ruby/3.4.0/bundler/cli/open.rb +29 -0
- package/lib/ruby/3.4.0/bundler/cli/outdated.rb +297 -0
- package/lib/ruby/3.4.0/bundler/cli/platform.rb +48 -0
- package/lib/ruby/3.4.0/bundler/cli/plugin.rb +35 -0
- package/lib/ruby/3.4.0/bundler/cli/pristine.rb +60 -0
- package/lib/ruby/3.4.0/bundler/cli/remove.rb +17 -0
- package/lib/ruby/3.4.0/bundler/cli/show.rb +75 -0
- package/lib/ruby/3.4.0/bundler/cli/update.rb +123 -0
- package/lib/ruby/3.4.0/bundler/cli/viz.rb +31 -0
- package/lib/ruby/3.4.0/bundler/cli.rb +790 -0
- package/lib/ruby/3.4.0/bundler/compact_index_client/cache.rb +96 -0
- package/lib/ruby/3.4.0/bundler/compact_index_client/cache_file.rb +148 -0
- package/lib/ruby/3.4.0/bundler/compact_index_client/parser.rb +84 -0
- package/lib/ruby/3.4.0/bundler/compact_index_client/updater.rb +105 -0
- package/lib/ruby/3.4.0/bundler/compact_index_client.rb +97 -0
- package/lib/ruby/3.4.0/bundler/constants.rb +14 -0
- package/lib/ruby/3.4.0/bundler/current_ruby.rb +82 -0
- package/lib/ruby/3.4.0/bundler/definition.rb +1187 -0
- package/lib/ruby/3.4.0/bundler/dependency.rb +151 -0
- package/lib/ruby/3.4.0/bundler/deployment.rb +69 -0
- package/lib/ruby/3.4.0/bundler/deprecate.rb +44 -0
- package/lib/ruby/3.4.0/bundler/digest.rb +71 -0
- package/lib/ruby/3.4.0/bundler/dsl.rb +638 -0
- package/lib/ruby/3.4.0/bundler/endpoint_specification.rb +174 -0
- package/lib/ruby/3.4.0/bundler/env.rb +148 -0
- package/lib/ruby/3.4.0/bundler/environment_preserver.rb +68 -0
- package/lib/ruby/3.4.0/bundler/errors.rb +281 -0
- package/lib/ruby/3.4.0/bundler/feature_flag.rb +50 -0
- package/lib/ruby/3.4.0/bundler/fetcher/base.rb +52 -0
- package/lib/ruby/3.4.0/bundler/fetcher/compact_index.rb +120 -0
- package/lib/ruby/3.4.0/bundler/fetcher/dependency.rb +78 -0
- package/lib/ruby/3.4.0/bundler/fetcher/downloader.rb +91 -0
- package/lib/ruby/3.4.0/bundler/fetcher/gem_remote_fetcher.rb +16 -0
- package/lib/ruby/3.4.0/bundler/fetcher/index.rb +25 -0
- package/lib/ruby/3.4.0/bundler/fetcher.rb +331 -0
- package/lib/ruby/3.4.0/bundler/force_platform.rb +16 -0
- package/lib/ruby/3.4.0/bundler/friendly_errors.rb +126 -0
- package/lib/ruby/3.4.0/bundler/gem_helper.rb +237 -0
- package/lib/ruby/3.4.0/bundler/gem_helpers.rb +144 -0
- package/lib/ruby/3.4.0/bundler/gem_tasks.rb +7 -0
- package/lib/ruby/3.4.0/bundler/gem_version_promoter.rb +147 -0
- package/lib/ruby/3.4.0/bundler/graph.rb +152 -0
- package/lib/ruby/3.4.0/bundler/index.rb +205 -0
- package/lib/ruby/3.4.0/bundler/injector.rb +285 -0
- package/lib/ruby/3.4.0/bundler/inline.rb +98 -0
- package/lib/ruby/3.4.0/bundler/installer/gem_installer.rb +85 -0
- package/lib/ruby/3.4.0/bundler/installer/parallel_installer.rb +203 -0
- package/lib/ruby/3.4.0/bundler/installer/standalone.rb +113 -0
- package/lib/ruby/3.4.0/bundler/installer.rb +243 -0
- package/lib/ruby/3.4.0/bundler/lazy_specification.rb +243 -0
- package/lib/ruby/3.4.0/bundler/lockfile_generator.rb +104 -0
- package/lib/ruby/3.4.0/bundler/lockfile_parser.rb +300 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-add.1 +76 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-add.1.ronn +87 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-binstubs.1 +33 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-binstubs.1.ronn +44 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-cache.1 +68 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-cache.1.ronn +108 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-check.1 +24 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-check.1.ronn +31 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-clean.1 +17 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-clean.1.ronn +18 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-config.1 +317 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-config.1.ronn +408 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-console.1 +33 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-console.1.ronn +39 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-doctor.1 +30 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-doctor.1.ronn +33 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-env.1 +9 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-env.1.ronn +10 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-exec.1 +107 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-exec.1.ronn +154 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-fund.1 +22 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-fund.1.ronn +25 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-gem.1 +87 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-gem.1.ronn +149 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-help.1 +9 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-help.1.ronn +12 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-info.1 +17 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-info.1.ronn +21 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-init.1 +20 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-init.1.ronn +32 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-inject.1 +31 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-inject.1.ronn +32 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-install.1 +218 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-install.1.ronn +387 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-issue.1 +45 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-issue.1.ronn +37 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-licenses.1 +9 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-licenses.1.ronn +10 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-list.1 +35 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-list.1.ronn +36 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-lock.1 +75 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-lock.1.ronn +115 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-open.1 +32 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-open.1.ronn +28 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-outdated.1 +103 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-outdated.1.ronn +110 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-platform.1 +49 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-platform.1.ronn +49 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-plugin.1 +58 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-plugin.1.ronn +63 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-pristine.1 +23 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-pristine.1.ronn +34 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-remove.1 +21 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-remove.1.ronn +23 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-show.1 +19 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-show.1.ronn +25 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-update.1 +281 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-update.1.ronn +359 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-version.1 +22 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-version.1.ronn +24 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-viz.1 +30 -0
- package/lib/ruby/3.4.0/bundler/man/bundle-viz.1.ronn +36 -0
- package/lib/ruby/3.4.0/bundler/man/bundle.1 +102 -0
- package/lib/ruby/3.4.0/bundler/man/bundle.1.ronn +116 -0
- package/lib/ruby/3.4.0/bundler/man/gemfile.5 +472 -0
- package/lib/ruby/3.4.0/bundler/man/gemfile.5.ronn +558 -0
- package/lib/ruby/3.4.0/bundler/match_metadata.rb +30 -0
- package/lib/ruby/3.4.0/bundler/match_platform.rb +23 -0
- package/lib/ruby/3.4.0/bundler/match_remote_metadata.rb +29 -0
- package/lib/ruby/3.4.0/bundler/materialization.rb +59 -0
- package/lib/ruby/3.4.0/bundler/mirror.rb +221 -0
- package/lib/ruby/3.4.0/bundler/plugin/api/source.rb +322 -0
- package/lib/ruby/3.4.0/bundler/plugin/api.rb +81 -0
- package/lib/ruby/3.4.0/bundler/plugin/dsl.rb +53 -0
- package/lib/ruby/3.4.0/bundler/plugin/events.rb +85 -0
- package/lib/ruby/3.4.0/bundler/plugin/index.rb +197 -0
- package/lib/ruby/3.4.0/bundler/plugin/installer/git.rb +34 -0
- package/lib/ruby/3.4.0/bundler/plugin/installer/path.rb +26 -0
- package/lib/ruby/3.4.0/bundler/plugin/installer/rubygems.rb +19 -0
- package/lib/ruby/3.4.0/bundler/plugin/installer.rb +132 -0
- package/lib/ruby/3.4.0/bundler/plugin/source_list.rb +31 -0
- package/lib/ruby/3.4.0/bundler/plugin.rb +378 -0
- package/lib/ruby/3.4.0/bundler/process_lock.rb +20 -0
- package/lib/ruby/3.4.0/bundler/remote_specification.rb +126 -0
- package/lib/ruby/3.4.0/bundler/resolver/base.rb +118 -0
- package/lib/ruby/3.4.0/bundler/resolver/candidate.rb +85 -0
- package/lib/ruby/3.4.0/bundler/resolver/incompatibility.rb +15 -0
- package/lib/ruby/3.4.0/bundler/resolver/package.rb +94 -0
- package/lib/ruby/3.4.0/bundler/resolver/root.rb +25 -0
- package/lib/ruby/3.4.0/bundler/resolver/spec_group.rb +74 -0
- package/lib/ruby/3.4.0/bundler/resolver/strategy.rb +40 -0
- package/lib/ruby/3.4.0/bundler/resolver.rb +526 -0
- package/lib/ruby/3.4.0/bundler/retry.rb +66 -0
- package/lib/ruby/3.4.0/bundler/ruby_dsl.rb +62 -0
- package/lib/ruby/3.4.0/bundler/ruby_version.rb +137 -0
- package/lib/ruby/3.4.0/bundler/rubygems_ext.rb +485 -0
- package/lib/ruby/3.4.0/bundler/rubygems_gem_installer.rb +172 -0
- package/lib/ruby/3.4.0/bundler/rubygems_integration.rb +455 -0
- package/lib/ruby/3.4.0/bundler/runtime.rb +320 -0
- package/lib/ruby/3.4.0/bundler/safe_marshal.rb +31 -0
- package/lib/ruby/3.4.0/bundler/self_manager.rb +206 -0
- package/lib/ruby/3.4.0/bundler/settings/validator.rb +102 -0
- package/lib/ruby/3.4.0/bundler/settings.rb +599 -0
- package/lib/ruby/3.4.0/bundler/setup.rb +39 -0
- package/lib/ruby/3.4.0/bundler/shared_helpers.rb +398 -0
- package/lib/ruby/3.4.0/bundler/similarity_detector.rb +63 -0
- package/lib/ruby/3.4.0/bundler/source/gemspec.rb +15 -0
- package/lib/ruby/3.4.0/bundler/source/git/git_proxy.rb +472 -0
- package/lib/ruby/3.4.0/bundler/source/git.rb +452 -0
- package/lib/ruby/3.4.0/bundler/source/metadata.rb +63 -0
- package/lib/ruby/3.4.0/bundler/source/path/installer.rb +53 -0
- package/lib/ruby/3.4.0/bundler/source/path.rb +250 -0
- package/lib/ruby/3.4.0/bundler/source/rubygems/remote.rb +76 -0
- package/lib/ruby/3.4.0/bundler/source/rubygems.rb +522 -0
- package/lib/ruby/3.4.0/bundler/source/rubygems_aggregate.rb +68 -0
- package/lib/ruby/3.4.0/bundler/source.rb +118 -0
- package/lib/ruby/3.4.0/bundler/source_list.rb +273 -0
- package/lib/ruby/3.4.0/bundler/source_map.rb +71 -0
- package/lib/ruby/3.4.0/bundler/spec_set.rb +395 -0
- package/lib/ruby/3.4.0/bundler/stub_specification.rb +146 -0
- package/lib/ruby/3.4.0/bundler/templates/Executable +27 -0
- package/lib/ruby/3.4.0/bundler/templates/Executable.bundler +109 -0
- package/lib/ruby/3.4.0/bundler/templates/Executable.standalone +14 -0
- package/lib/ruby/3.4.0/bundler/templates/Gemfile +5 -0
- package/lib/ruby/3.4.0/bundler/templates/newgem/CHANGELOG.md.tt +5 -0
- package/lib/ruby/3.4.0/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +132 -0
- package/lib/ruby/3.4.0/bundler/templates/newgem/Cargo.toml.tt +7 -0
- package/lib/ruby/3.4.0/bundler/templates/newgem/Gemfile.tt +24 -0
- package/lib/ruby/3.4.0/bundler/templates/newgem/LICENSE.txt.tt +21 -0
- package/lib/ruby/3.4.0/bundler/templates/newgem/README.md.tt +49 -0
- package/lib/ruby/3.4.0/bundler/templates/newgem/Rakefile.tt +67 -0
- package/lib/ruby/3.4.0/bundler/templates/newgem/bin/console.tt +11 -0
- package/lib/ruby/3.4.0/bundler/templates/newgem/bin/setup.tt +8 -0
- package/lib/ruby/3.4.0/bundler/templates/newgem/circleci/config.yml.tt +25 -0
- package/lib/ruby/3.4.0/bundler/templates/newgem/exe/newgem.tt +3 -0
- package/lib/ruby/3.4.0/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +15 -0
- package/lib/ruby/3.4.0/bundler/templates/newgem/ext/newgem/extconf-c.rb.tt +10 -0
- package/lib/ruby/3.4.0/bundler/templates/newgem/ext/newgem/extconf-rust.rb.tt +6 -0
- package/lib/ruby/3.4.0/bundler/templates/newgem/ext/newgem/newgem.c.tt +9 -0
- package/lib/ruby/3.4.0/bundler/templates/newgem/ext/newgem/newgem.h.tt +6 -0
- package/lib/ruby/3.4.0/bundler/templates/newgem/ext/newgem/src/lib.rs.tt +12 -0
- package/lib/ruby/3.4.0/bundler/templates/newgem/github/workflows/main.yml.tt +37 -0
- package/lib/ruby/3.4.0/bundler/templates/newgem/gitignore.tt +23 -0
- package/lib/ruby/3.4.0/bundler/templates/newgem/gitlab-ci.yml.tt +18 -0
- package/lib/ruby/3.4.0/bundler/templates/newgem/lib/newgem/version.rb.tt +9 -0
- package/lib/ruby/3.4.0/bundler/templates/newgem/lib/newgem.rb.tt +15 -0
- package/lib/ruby/3.4.0/bundler/templates/newgem/newgem.gemspec.tt +52 -0
- package/lib/ruby/3.4.0/bundler/templates/newgem/rspec.tt +3 -0
- package/lib/ruby/3.4.0/bundler/templates/newgem/rubocop.yml.tt +8 -0
- package/lib/ruby/3.4.0/bundler/templates/newgem/sig/newgem.rbs.tt +8 -0
- package/lib/ruby/3.4.0/bundler/templates/newgem/spec/newgem_spec.rb.tt +11 -0
- package/lib/ruby/3.4.0/bundler/templates/newgem/spec/spec_helper.rb.tt +15 -0
- package/lib/ruby/3.4.0/bundler/templates/newgem/standard.yml.tt +3 -0
- package/lib/ruby/3.4.0/bundler/templates/newgem/test/minitest/test_helper.rb.tt +6 -0
- package/lib/ruby/3.4.0/bundler/templates/newgem/test/minitest/test_newgem.rb.tt +13 -0
- package/lib/ruby/3.4.0/bundler/templates/newgem/test/test-unit/newgem_test.rb.tt +15 -0
- package/lib/ruby/3.4.0/bundler/templates/newgem/test/test-unit/test_helper.rb.tt +6 -0
- package/lib/ruby/3.4.0/bundler/ui/rg_proxy.rb +19 -0
- package/lib/ruby/3.4.0/bundler/ui/shell.rb +187 -0
- package/lib/ruby/3.4.0/bundler/ui/silent.rb +96 -0
- package/lib/ruby/3.4.0/bundler/ui.rb +9 -0
- package/lib/ruby/3.4.0/bundler/uri_credentials_filter.rb +43 -0
- package/lib/ruby/3.4.0/bundler/uri_normalizer.rb +23 -0
- package/lib/ruby/3.4.0/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +224 -0
- package/lib/ruby/3.4.0/bundler/vendor/connection_pool/lib/connection_pool/version.rb +3 -0
- package/lib/ruby/3.4.0/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +56 -0
- package/lib/ruby/3.4.0/bundler/vendor/connection_pool/lib/connection_pool.rb +186 -0
- package/lib/ruby/3.4.0/bundler/vendor/fileutils/lib/fileutils.rb +2696 -0
- package/lib/ruby/3.4.0/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +41 -0
- package/lib/ruby/3.4.0/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +65 -0
- package/lib/ruby/3.4.0/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +79 -0
- package/lib/ruby/3.4.0/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +1111 -0
- package/lib/ruby/3.4.0/bundler/vendor/pub_grub/lib/pub_grub/assignment.rb +20 -0
- package/lib/ruby/3.4.0/bundler/vendor/pub_grub/lib/pub_grub/basic_package_source.rb +169 -0
- package/lib/ruby/3.4.0/bundler/vendor/pub_grub/lib/pub_grub/failure_writer.rb +182 -0
- package/lib/ruby/3.4.0/bundler/vendor/pub_grub/lib/pub_grub/incompatibility.rb +150 -0
- package/lib/ruby/3.4.0/bundler/vendor/pub_grub/lib/pub_grub/package.rb +43 -0
- package/lib/ruby/3.4.0/bundler/vendor/pub_grub/lib/pub_grub/partial_solution.rb +121 -0
- package/lib/ruby/3.4.0/bundler/vendor/pub_grub/lib/pub_grub/rubygems.rb +45 -0
- package/lib/ruby/3.4.0/bundler/vendor/pub_grub/lib/pub_grub/solve_failure.rb +19 -0
- package/lib/ruby/3.4.0/bundler/vendor/pub_grub/lib/pub_grub/static_package_source.rb +61 -0
- package/lib/ruby/3.4.0/bundler/vendor/pub_grub/lib/pub_grub/strategy.rb +42 -0
- package/lib/ruby/3.4.0/bundler/vendor/pub_grub/lib/pub_grub/term.rb +105 -0
- package/lib/ruby/3.4.0/bundler/vendor/pub_grub/lib/pub_grub/version.rb +3 -0
- package/lib/ruby/3.4.0/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb +129 -0
- package/lib/ruby/3.4.0/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb +423 -0
- package/lib/ruby/3.4.0/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb +236 -0
- package/lib/ruby/3.4.0/bundler/vendor/pub_grub/lib/pub_grub/version_union.rb +178 -0
- package/lib/ruby/3.4.0/bundler/vendor/pub_grub/lib/pub_grub.rb +31 -0
- package/lib/ruby/3.4.0/bundler/vendor/securerandom/lib/securerandom.rb +102 -0
- package/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/actions/create_file.rb +105 -0
- package/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/actions/create_link.rb +61 -0
- package/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/actions/directory.rb +108 -0
- package/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +143 -0
- package/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +371 -0
- package/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +130 -0
- package/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/actions.rb +340 -0
- package/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/base.rb +825 -0
- package/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/command.rb +151 -0
- package/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +107 -0
- package/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/error.rb +106 -0
- package/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/group.rb +292 -0
- package/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/invocation.rb +178 -0
- package/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/line_editor/basic.rb +37 -0
- package/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/line_editor/readline.rb +88 -0
- package/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/line_editor.rb +17 -0
- package/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/nested_context.rb +29 -0
- package/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/parser/argument.rb +86 -0
- package/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/parser/arguments.rb +195 -0
- package/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/parser/option.rb +178 -0
- package/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/parser/options.rb +294 -0
- package/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/parser.rb +4 -0
- package/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/rake_compat.rb +72 -0
- package/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/runner.rb +335 -0
- package/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/shell/basic.rb +388 -0
- package/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/shell/color.rb +112 -0
- package/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/shell/column_printer.rb +29 -0
- package/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/shell/html.rb +81 -0
- package/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/shell/table_printer.rb +118 -0
- package/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/shell/terminal.rb +42 -0
- package/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/shell/wrapped_printer.rb +38 -0
- package/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/shell.rb +81 -0
- package/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/util.rb +285 -0
- package/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor/version.rb +3 -0
- package/lib/ruby/3.4.0/bundler/vendor/thor/lib/thor.rb +674 -0
- package/lib/ruby/3.4.0/bundler/vendor/tsort/lib/tsort.rb +455 -0
- package/lib/ruby/3.4.0/bundler/vendor/uri/lib/uri/common.rb +880 -0
- package/lib/ruby/3.4.0/bundler/vendor/uri/lib/uri/file.rb +100 -0
- package/lib/ruby/3.4.0/bundler/vendor/uri/lib/uri/ftp.rb +267 -0
- package/lib/ruby/3.4.0/bundler/vendor/uri/lib/uri/generic.rb +1592 -0
- package/lib/ruby/3.4.0/bundler/vendor/uri/lib/uri/http.rb +125 -0
- package/lib/ruby/3.4.0/bundler/vendor/uri/lib/uri/https.rb +23 -0
- package/lib/ruby/3.4.0/bundler/vendor/uri/lib/uri/ldap.rb +261 -0
- package/lib/ruby/3.4.0/bundler/vendor/uri/lib/uri/ldaps.rb +22 -0
- package/lib/ruby/3.4.0/bundler/vendor/uri/lib/uri/mailto.rb +293 -0
- package/lib/ruby/3.4.0/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +546 -0
- package/lib/ruby/3.4.0/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +206 -0
- package/lib/ruby/3.4.0/bundler/vendor/uri/lib/uri/version.rb +6 -0
- package/lib/ruby/3.4.0/bundler/vendor/uri/lib/uri/ws.rb +83 -0
- package/lib/ruby/3.4.0/bundler/vendor/uri/lib/uri/wss.rb +23 -0
- package/lib/ruby/3.4.0/bundler/vendor/uri/lib/uri.rb +104 -0
- package/lib/ruby/3.4.0/bundler/vendored_fileutils.rb +4 -0
- package/lib/ruby/3.4.0/bundler/vendored_net_http.rb +23 -0
- package/lib/ruby/3.4.0/bundler/vendored_persistent.rb +11 -0
- package/lib/ruby/3.4.0/bundler/vendored_pub_grub.rb +4 -0
- package/lib/ruby/3.4.0/bundler/vendored_securerandom.rb +12 -0
- package/lib/ruby/3.4.0/bundler/vendored_thor.rb +8 -0
- package/lib/ruby/3.4.0/bundler/vendored_timeout.rb +12 -0
- package/lib/ruby/3.4.0/bundler/vendored_tsort.rb +4 -0
- package/lib/ruby/3.4.0/bundler/vendored_uri.rb +21 -0
- package/lib/ruby/3.4.0/bundler/version.rb +13 -0
- package/lib/ruby/3.4.0/bundler/vlad.rb +17 -0
- package/lib/ruby/3.4.0/bundler/worker.rb +117 -0
- package/lib/ruby/3.4.0/bundler/yaml_serializer.rb +98 -0
- package/lib/ruby/3.4.0/bundler.rb +701 -0
- package/lib/ruby/3.4.0/cgi/cookie.rb +210 -0
- package/lib/ruby/3.4.0/cgi/core.rb +900 -0
- package/lib/ruby/3.4.0/cgi/html.rb +1035 -0
- package/lib/ruby/3.4.0/cgi/session/pstore.rb +91 -0
- package/lib/ruby/3.4.0/cgi/session.rb +562 -0
- package/lib/ruby/3.4.0/cgi/util.rb +258 -0
- package/lib/ruby/3.4.0/cgi.rb +297 -0
- package/lib/ruby/3.4.0/coverage.rb +14 -0
- package/lib/ruby/3.4.0/date.rb +70 -0
- package/lib/ruby/3.4.0/delegate.rb +444 -0
- package/lib/ruby/3.4.0/did_you_mean/core_ext/name_error.rb +57 -0
- package/lib/ruby/3.4.0/did_you_mean/experimental.rb +2 -0
- package/lib/ruby/3.4.0/did_you_mean/formatter.rb +44 -0
- package/lib/ruby/3.4.0/did_you_mean/formatters/plain_formatter.rb +4 -0
- package/lib/ruby/3.4.0/did_you_mean/formatters/verbose_formatter.rb +10 -0
- package/lib/ruby/3.4.0/did_you_mean/jaro_winkler.rb +84 -0
- package/lib/ruby/3.4.0/did_you_mean/levenshtein.rb +57 -0
- package/lib/ruby/3.4.0/did_you_mean/spell_checker.rb +46 -0
- package/lib/ruby/3.4.0/did_you_mean/spell_checkers/key_error_checker.rb +28 -0
- package/lib/ruby/3.4.0/did_you_mean/spell_checkers/method_name_checker.rb +79 -0
- package/lib/ruby/3.4.0/did_you_mean/spell_checkers/name_error_checkers/class_name_checker.rb +49 -0
- package/lib/ruby/3.4.0/did_you_mean/spell_checkers/name_error_checkers/variable_name_checker.rb +85 -0
- package/lib/ruby/3.4.0/did_you_mean/spell_checkers/name_error_checkers.rb +20 -0
- package/lib/ruby/3.4.0/did_you_mean/spell_checkers/null_checker.rb +6 -0
- package/lib/ruby/3.4.0/did_you_mean/spell_checkers/pattern_key_name_checker.rb +28 -0
- package/lib/ruby/3.4.0/did_you_mean/spell_checkers/require_path_checker.rb +39 -0
- package/lib/ruby/3.4.0/did_you_mean/tree_spell_checker.rb +109 -0
- package/lib/ruby/3.4.0/did_you_mean/verbose.rb +2 -0
- package/lib/ruby/3.4.0/did_you_mean/version.rb +3 -0
- package/lib/ruby/3.4.0/did_you_mean.rb +131 -0
- package/lib/ruby/3.4.0/digest/loader.rb +3 -0
- package/lib/ruby/3.4.0/digest/sha2/loader.rb +3 -0
- package/lib/ruby/3.4.0/digest/sha2.rb +142 -0
- package/lib/ruby/3.4.0/digest/version.rb +5 -0
- package/lib/ruby/3.4.0/digest.rb +123 -0
- package/lib/ruby/3.4.0/erb/compiler.rb +472 -0
- package/lib/ruby/3.4.0/erb/def_method.rb +47 -0
- package/lib/ruby/3.4.0/erb/util.rb +63 -0
- package/lib/ruby/3.4.0/erb/version.rb +5 -0
- package/lib/ruby/3.4.0/erb.rb +509 -0
- package/lib/ruby/3.4.0/error_highlight/base.rb +830 -0
- package/lib/ruby/3.4.0/error_highlight/core_ext.rb +47 -0
- package/lib/ruby/3.4.0/error_highlight/formatter.rb +74 -0
- package/lib/ruby/3.4.0/error_highlight/version.rb +3 -0
- package/lib/ruby/3.4.0/error_highlight.rb +2 -0
- package/lib/ruby/3.4.0/fileutils.rb +2696 -0
- package/lib/ruby/3.4.0/find.rb +90 -0
- package/lib/ruby/3.4.0/forwardable/impl.rb +16 -0
- package/lib/ruby/3.4.0/forwardable.rb +321 -0
- package/lib/ruby/3.4.0/ipaddr.rb +841 -0
- package/lib/ruby/3.4.0/irb/cmd/nop.rb +4 -0
- package/lib/ruby/3.4.0/irb/color.rb +262 -0
- package/lib/ruby/3.4.0/irb/color_printer.rb +55 -0
- package/lib/ruby/3.4.0/irb/command/backtrace.rb +17 -0
- package/lib/ruby/3.4.0/irb/command/base.rb +60 -0
- package/lib/ruby/3.4.0/irb/command/break.rb +17 -0
- package/lib/ruby/3.4.0/irb/command/catch.rb +17 -0
- package/lib/ruby/3.4.0/irb/command/cd.rb +51 -0
- package/lib/ruby/3.4.0/irb/command/chws.rb +40 -0
- package/lib/ruby/3.4.0/irb/command/context.rb +16 -0
- package/lib/ruby/3.4.0/irb/command/continue.rb +17 -0
- package/lib/ruby/3.4.0/irb/command/debug.rb +73 -0
- package/lib/ruby/3.4.0/irb/command/delete.rb +17 -0
- package/lib/ruby/3.4.0/irb/command/disable_irb.rb +19 -0
- package/lib/ruby/3.4.0/irb/command/edit.rb +63 -0
- package/lib/ruby/3.4.0/irb/command/exit.rb +18 -0
- package/lib/ruby/3.4.0/irb/command/finish.rb +17 -0
- package/lib/ruby/3.4.0/irb/command/force_exit.rb +18 -0
- package/lib/ruby/3.4.0/irb/command/help.rb +83 -0
- package/lib/ruby/3.4.0/irb/command/history.rb +45 -0
- package/lib/ruby/3.4.0/irb/command/info.rb +17 -0
- package/lib/ruby/3.4.0/irb/command/internal_helpers.rb +27 -0
- package/lib/ruby/3.4.0/irb/command/irb_info.rb +33 -0
- package/lib/ruby/3.4.0/irb/command/load.rb +91 -0
- package/lib/ruby/3.4.0/irb/command/ls.rb +167 -0
- package/lib/ruby/3.4.0/irb/command/measure.rb +49 -0
- package/lib/ruby/3.4.0/irb/command/next.rb +17 -0
- package/lib/ruby/3.4.0/irb/command/pushws.rb +65 -0
- package/lib/ruby/3.4.0/irb/command/show_doc.rb +51 -0
- package/lib/ruby/3.4.0/irb/command/show_source.rb +74 -0
- package/lib/ruby/3.4.0/irb/command/step.rb +17 -0
- package/lib/ruby/3.4.0/irb/command/subirb.rb +123 -0
- package/lib/ruby/3.4.0/irb/command/whereami.rb +23 -0
- package/lib/ruby/3.4.0/irb/command.rb +23 -0
- package/lib/ruby/3.4.0/irb/completion.rb +504 -0
- package/lib/ruby/3.4.0/irb/context.rb +716 -0
- package/lib/ruby/3.4.0/irb/debug/ui.rb +101 -0
- package/lib/ruby/3.4.0/irb/debug.rb +127 -0
- package/lib/ruby/3.4.0/irb/default_commands.rb +276 -0
- package/lib/ruby/3.4.0/irb/easter-egg.rb +152 -0
- package/lib/ruby/3.4.0/irb/ext/change-ws.rb +37 -0
- package/lib/ruby/3.4.0/irb/ext/eval_history.rb +149 -0
- package/lib/ruby/3.4.0/irb/ext/loader.rb +127 -0
- package/lib/ruby/3.4.0/irb/ext/multi-irb.rb +258 -0
- package/lib/ruby/3.4.0/irb/ext/tracer.rb +39 -0
- package/lib/ruby/3.4.0/irb/ext/use-loader.rb +67 -0
- package/lib/ruby/3.4.0/irb/ext/workspaces.rb +36 -0
- package/lib/ruby/3.4.0/irb/frame.rb +80 -0
- package/lib/ruby/3.4.0/irb/help.rb +28 -0
- package/lib/ruby/3.4.0/irb/helper_method/base.rb +16 -0
- package/lib/ruby/3.4.0/irb/helper_method/conf.rb +11 -0
- package/lib/ruby/3.4.0/irb/helper_method.rb +29 -0
- package/lib/ruby/3.4.0/irb/history.rb +112 -0
- package/lib/ruby/3.4.0/irb/init.rb +538 -0
- package/lib/ruby/3.4.0/irb/input-method.rb +515 -0
- package/lib/ruby/3.4.0/irb/inspector.rb +131 -0
- package/lib/ruby/3.4.0/irb/lc/error.rb +52 -0
- package/lib/ruby/3.4.0/irb/lc/help-message +55 -0
- package/lib/ruby/3.4.0/irb/lc/ja/error.rb +53 -0
- package/lib/ruby/3.4.0/irb/lc/ja/help-message +58 -0
- package/lib/ruby/3.4.0/irb/locale.rb +153 -0
- package/lib/ruby/3.4.0/irb/nesting_parser.rb +239 -0
- package/lib/ruby/3.4.0/irb/notifier.rb +230 -0
- package/lib/ruby/3.4.0/irb/output-method.rb +80 -0
- package/lib/ruby/3.4.0/irb/pager.rb +100 -0
- package/lib/ruby/3.4.0/irb/ruby-lex.rb +476 -0
- package/lib/ruby/3.4.0/irb/ruby_logo.aa +118 -0
- package/lib/ruby/3.4.0/irb/source_finder.rb +138 -0
- package/lib/ruby/3.4.0/irb/statement.rb +80 -0
- package/lib/ruby/3.4.0/irb/version.rb +11 -0
- package/lib/ruby/3.4.0/irb/workspace.rb +171 -0
- package/lib/ruby/3.4.0/irb/ws-for-case-2.rb +9 -0
- package/lib/ruby/3.4.0/irb/xmp.rb +164 -0
- package/lib/ruby/3.4.0/irb.rb +1593 -0
- package/lib/ruby/3.4.0/json/add/bigdecimal.rb +58 -0
- package/lib/ruby/3.4.0/json/add/complex.rb +51 -0
- package/lib/ruby/3.4.0/json/add/core.rb +12 -0
- package/lib/ruby/3.4.0/json/add/date.rb +54 -0
- package/lib/ruby/3.4.0/json/add/date_time.rb +67 -0
- package/lib/ruby/3.4.0/json/add/exception.rb +49 -0
- package/lib/ruby/3.4.0/json/add/ostruct.rb +54 -0
- package/lib/ruby/3.4.0/json/add/range.rb +54 -0
- package/lib/ruby/3.4.0/json/add/rational.rb +49 -0
- package/lib/ruby/3.4.0/json/add/regexp.rb +48 -0
- package/lib/ruby/3.4.0/json/add/set.rb +48 -0
- package/lib/ruby/3.4.0/json/add/struct.rb +52 -0
- package/lib/ruby/3.4.0/json/add/symbol.rb +47 -0
- package/lib/ruby/3.4.0/json/add/time.rb +52 -0
- package/lib/ruby/3.4.0/json/common.rb +896 -0
- package/lib/ruby/3.4.0/json/ext/generator/state.rb +116 -0
- package/lib/ruby/3.4.0/json/ext.rb +23 -0
- package/lib/ruby/3.4.0/json/generic_object.rb +75 -0
- package/lib/ruby/3.4.0/json/version.rb +5 -0
- package/lib/ruby/3.4.0/json.rb +587 -0
- package/lib/ruby/3.4.0/logger/errors.rb +9 -0
- package/lib/ruby/3.4.0/logger/formatter.rb +36 -0
- package/lib/ruby/3.4.0/logger/log_device.rb +236 -0
- package/lib/ruby/3.4.0/logger/period.rb +47 -0
- package/lib/ruby/3.4.0/logger/severity.rb +38 -0
- package/lib/ruby/3.4.0/logger/version.rb +5 -0
- package/lib/ruby/3.4.0/logger.rb +761 -0
- package/lib/ruby/3.4.0/mkmf.rb +3045 -0
- package/lib/ruby/3.4.0/monitor.rb +289 -0
- package/lib/ruby/3.4.0/net/http/exceptions.rb +34 -0
- package/lib/ruby/3.4.0/net/http/generic_request.rb +414 -0
- package/lib/ruby/3.4.0/net/http/header.rb +981 -0
- package/lib/ruby/3.4.0/net/http/proxy_delta.rb +17 -0
- package/lib/ruby/3.4.0/net/http/request.rb +88 -0
- package/lib/ruby/3.4.0/net/http/requests.rb +430 -0
- package/lib/ruby/3.4.0/net/http/response.rb +738 -0
- package/lib/ruby/3.4.0/net/http/responses.rb +1174 -0
- package/lib/ruby/3.4.0/net/http/status.rb +84 -0
- package/lib/ruby/3.4.0/net/http.rb +2574 -0
- package/lib/ruby/3.4.0/net/https.rb +23 -0
- package/lib/ruby/3.4.0/net/protocol.rb +544 -0
- package/lib/ruby/3.4.0/objspace/trace.rb +45 -0
- package/lib/ruby/3.4.0/objspace.rb +135 -0
- package/lib/ruby/3.4.0/open-uri.rb +895 -0
- package/lib/ruby/3.4.0/open3/version.rb +3 -0
- package/lib/ruby/3.4.0/open3.rb +1410 -0
- package/lib/ruby/3.4.0/openssl/asn1.rb +188 -0
- package/lib/ruby/3.4.0/openssl/bn.rb +40 -0
- package/lib/ruby/3.4.0/openssl/buffering.rb +499 -0
- package/lib/ruby/3.4.0/openssl/cipher.rb +67 -0
- package/lib/ruby/3.4.0/openssl/digest.rb +69 -0
- package/lib/ruby/3.4.0/openssl/hmac.rb +78 -0
- package/lib/ruby/3.4.0/openssl/marshal.rb +30 -0
- package/lib/ruby/3.4.0/openssl/pkcs5.rb +22 -0
- package/lib/ruby/3.4.0/openssl/pkey.rb +471 -0
- package/lib/ruby/3.4.0/openssl/ssl.rb +609 -0
- package/lib/ruby/3.4.0/openssl/version.rb +5 -0
- package/lib/ruby/3.4.0/openssl/x509.rb +391 -0
- package/lib/ruby/3.4.0/openssl.rb +38 -0
- package/lib/ruby/3.4.0/optionparser.rb +2 -0
- package/lib/ruby/3.4.0/optparse/ac.rb +70 -0
- package/lib/ruby/3.4.0/optparse/date.rb +18 -0
- package/lib/ruby/3.4.0/optparse/kwargs.rb +27 -0
- package/lib/ruby/3.4.0/optparse/shellwords.rb +7 -0
- package/lib/ruby/3.4.0/optparse/time.rb +11 -0
- package/lib/ruby/3.4.0/optparse/uri.rb +7 -0
- package/lib/ruby/3.4.0/optparse/version.rb +80 -0
- package/lib/ruby/3.4.0/optparse.rb +2429 -0
- package/lib/ruby/3.4.0/ostruct.rb +489 -0
- package/lib/ruby/3.4.0/pathname.rb +621 -0
- package/lib/ruby/3.4.0/pp.rb +699 -0
- package/lib/ruby/3.4.0/prettyprint.rb +558 -0
- package/lib/ruby/3.4.0/prism/compiler.rb +801 -0
- package/lib/ruby/3.4.0/prism/desugar_compiler.rb +392 -0
- package/lib/ruby/3.4.0/prism/dispatcher.rb +2210 -0
- package/lib/ruby/3.4.0/prism/dsl.rb +1003 -0
- package/lib/ruby/3.4.0/prism/ffi.rb +570 -0
- package/lib/ruby/3.4.0/prism/inspect_visitor.rb +2392 -0
- package/lib/ruby/3.4.0/prism/lex_compat.rb +928 -0
- package/lib/ruby/3.4.0/prism/mutation_compiler.rb +772 -0
- package/lib/ruby/3.4.0/prism/node.rb +18816 -0
- package/lib/ruby/3.4.0/prism/node_ext.rb +511 -0
- package/lib/ruby/3.4.0/prism/pack.rb +230 -0
- package/lib/ruby/3.4.0/prism/parse_result/comments.rb +188 -0
- package/lib/ruby/3.4.0/prism/parse_result/errors.rb +66 -0
- package/lib/ruby/3.4.0/prism/parse_result/newlines.rb +155 -0
- package/lib/ruby/3.4.0/prism/parse_result.rb +911 -0
- package/lib/ruby/3.4.0/prism/pattern.rb +269 -0
- package/lib/ruby/3.4.0/prism/polyfill/append_as_bytes.rb +15 -0
- package/lib/ruby/3.4.0/prism/polyfill/byteindex.rb +13 -0
- package/lib/ruby/3.4.0/prism/polyfill/scan_byte.rb +14 -0
- package/lib/ruby/3.4.0/prism/polyfill/unpack1.rb +14 -0
- package/lib/ruby/3.4.0/prism/polyfill/warn.rb +36 -0
- package/lib/ruby/3.4.0/prism/reflection.rb +416 -0
- package/lib/ruby/3.4.0/prism/relocation.rb +505 -0
- package/lib/ruby/3.4.0/prism/serialize.rb +2400 -0
- package/lib/ruby/3.4.0/prism/string_query.rb +31 -0
- package/lib/ruby/3.4.0/prism/translation/parser/builder.rb +62 -0
- package/lib/ruby/3.4.0/prism/translation/parser/compiler.rb +2234 -0
- package/lib/ruby/3.4.0/prism/translation/parser/lexer.rb +820 -0
- package/lib/ruby/3.4.0/prism/translation/parser.rb +374 -0
- package/lib/ruby/3.4.0/prism/translation/parser33.rb +13 -0
- package/lib/ruby/3.4.0/prism/translation/parser34.rb +13 -0
- package/lib/ruby/3.4.0/prism/translation/parser35.rb +13 -0
- package/lib/ruby/3.4.0/prism/translation/parser_current.rb +24 -0
- package/lib/ruby/3.4.0/prism/translation/ripper/sexp.rb +126 -0
- package/lib/ruby/3.4.0/prism/translation/ripper/shim.rb +5 -0
- package/lib/ruby/3.4.0/prism/translation/ripper.rb +3474 -0
- package/lib/ruby/3.4.0/prism/translation/ruby_parser.rb +1929 -0
- package/lib/ruby/3.4.0/prism/translation.rb +16 -0
- package/lib/ruby/3.4.0/prism/visitor.rb +813 -0
- package/lib/ruby/3.4.0/prism.rb +91 -0
- package/lib/ruby/3.4.0/pstore.rb +736 -0
- package/lib/ruby/3.4.0/psych/class_loader.rb +104 -0
- package/lib/ruby/3.4.0/psych/coder.rb +95 -0
- package/lib/ruby/3.4.0/psych/core_ext.rb +19 -0
- package/lib/ruby/3.4.0/psych/exception.rb +28 -0
- package/lib/ruby/3.4.0/psych/handler.rb +255 -0
- package/lib/ruby/3.4.0/psych/handlers/document_stream.rb +23 -0
- package/lib/ruby/3.4.0/psych/handlers/recorder.rb +40 -0
- package/lib/ruby/3.4.0/psych/json/ruby_events.rb +20 -0
- package/lib/ruby/3.4.0/psych/json/stream.rb +17 -0
- package/lib/ruby/3.4.0/psych/json/tree_builder.rb +13 -0
- package/lib/ruby/3.4.0/psych/json/yaml_events.rb +30 -0
- package/lib/ruby/3.4.0/psych/nodes/alias.rb +21 -0
- package/lib/ruby/3.4.0/psych/nodes/document.rb +63 -0
- package/lib/ruby/3.4.0/psych/nodes/mapping.rb +59 -0
- package/lib/ruby/3.4.0/psych/nodes/node.rb +75 -0
- package/lib/ruby/3.4.0/psych/nodes/scalar.rb +70 -0
- package/lib/ruby/3.4.0/psych/nodes/sequence.rb +84 -0
- package/lib/ruby/3.4.0/psych/nodes/stream.rb +40 -0
- package/lib/ruby/3.4.0/psych/nodes.rb +78 -0
- package/lib/ruby/3.4.0/psych/omap.rb +5 -0
- package/lib/ruby/3.4.0/psych/parser.rb +65 -0
- package/lib/ruby/3.4.0/psych/scalar_scanner.rb +141 -0
- package/lib/ruby/3.4.0/psych/set.rb +5 -0
- package/lib/ruby/3.4.0/psych/stream.rb +38 -0
- package/lib/ruby/3.4.0/psych/streaming.rb +28 -0
- package/lib/ruby/3.4.0/psych/syntax_error.rb +22 -0
- package/lib/ruby/3.4.0/psych/tree_builder.rb +137 -0
- package/lib/ruby/3.4.0/psych/versions.rb +10 -0
- package/lib/ruby/3.4.0/psych/visitors/depth_first.rb +27 -0
- package/lib/ruby/3.4.0/psych/visitors/emitter.rb +52 -0
- package/lib/ruby/3.4.0/psych/visitors/json_tree.rb +25 -0
- package/lib/ruby/3.4.0/psych/visitors/to_ruby.rb +435 -0
- package/lib/ruby/3.4.0/psych/visitors/visitor.rb +34 -0
- package/lib/ruby/3.4.0/psych/visitors/yaml_tree.rb +583 -0
- package/lib/ruby/3.4.0/psych/visitors.rb +7 -0
- package/lib/ruby/3.4.0/psych/y.rb +10 -0
- package/lib/ruby/3.4.0/psych.rb +763 -0
- package/lib/ruby/3.4.0/random/formatter.rb +372 -0
- package/lib/ruby/3.4.0/rdoc/code_object/alias.rb +104 -0
- package/lib/ruby/3.4.0/rdoc/code_object/anon_class.rb +10 -0
- package/lib/ruby/3.4.0/rdoc/code_object/any_method.rb +374 -0
- package/lib/ruby/3.4.0/rdoc/code_object/attr.rb +172 -0
- package/lib/ruby/3.4.0/rdoc/code_object/class_module.rb +888 -0
- package/lib/ruby/3.4.0/rdoc/code_object/constant.rb +186 -0
- package/lib/ruby/3.4.0/rdoc/code_object/context/section.rb +175 -0
- package/lib/ruby/3.4.0/rdoc/code_object/context.rb +1222 -0
- package/lib/ruby/3.4.0/rdoc/code_object/extend.rb +9 -0
- package/lib/ruby/3.4.0/rdoc/code_object/ghost_method.rb +6 -0
- package/lib/ruby/3.4.0/rdoc/code_object/include.rb +9 -0
- package/lib/ruby/3.4.0/rdoc/code_object/meta_method.rb +6 -0
- package/lib/ruby/3.4.0/rdoc/code_object/method_attr.rb +410 -0
- package/lib/ruby/3.4.0/rdoc/code_object/mixin.rb +120 -0
- package/lib/ruby/3.4.0/rdoc/code_object/normal_class.rb +92 -0
- package/lib/ruby/3.4.0/rdoc/code_object/normal_module.rb +73 -0
- package/lib/ruby/3.4.0/rdoc/code_object/require.rb +51 -0
- package/lib/ruby/3.4.0/rdoc/code_object/single_class.rb +30 -0
- package/lib/ruby/3.4.0/rdoc/code_object/top_level.rb +273 -0
- package/lib/ruby/3.4.0/rdoc/code_object.rb +395 -0
- package/lib/ruby/3.4.0/rdoc/code_objects.rb +5 -0
- package/lib/ruby/3.4.0/rdoc/comment.rb +236 -0
- package/lib/ruby/3.4.0/rdoc/cross_reference.rb +228 -0
- package/lib/ruby/3.4.0/rdoc/encoding.rb +120 -0
- package/lib/ruby/3.4.0/rdoc/erb_partial.rb +18 -0
- package/lib/ruby/3.4.0/rdoc/erbio.rb +37 -0
- package/lib/ruby/3.4.0/rdoc/generator/darkfish.rb +812 -0
- package/lib/ruby/3.4.0/rdoc/generator/json_index.rb +284 -0
- package/lib/ruby/3.4.0/rdoc/generator/markup.rb +171 -0
- package/lib/ruby/3.4.0/rdoc/generator/pot/message_extractor.rb +68 -0
- package/lib/ruby/3.4.0/rdoc/generator/pot/po.rb +84 -0
- package/lib/ruby/3.4.0/rdoc/generator/pot/po_entry.rb +141 -0
- package/lib/ruby/3.4.0/rdoc/generator/pot.rb +94 -0
- package/lib/ruby/3.4.0/rdoc/generator/ri.rb +30 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/_footer.rhtml +5 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/_head.rhtml +48 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/_sidebar_classes.rhtml +5 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +15 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/_sidebar_includes.rhtml +15 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/_sidebar_installed.rhtml +15 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/_sidebar_methods.rhtml +21 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/_sidebar_navigation.rhtml +11 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/_sidebar_pages.rhtml +32 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/_sidebar_parent.rhtml +6 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/_sidebar_search.rhtml +14 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/_sidebar_sections.rhtml +11 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml +39 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/_sidebar_toggle.rhtml +3 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/class.rhtml +221 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/css/fonts.css +167 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/css/rdoc.css +683 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/fonts/Lato-Light.ttf +0 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/fonts/Lato-LightItalic.ttf +0 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/fonts/Lato-Regular.ttf +0 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/fonts/Lato-RegularItalic.ttf +0 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/fonts/SourceCodePro-Bold.ttf +0 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/fonts/SourceCodePro-Regular.ttf +0 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/images/add.png +0 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/images/arrow_up.png +0 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/images/brick.png +0 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/images/brick_link.png +0 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/images/bug.png +0 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/images/bullet_black.png +0 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/images/bullet_toggle_minus.png +0 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/images/bullet_toggle_plus.png +0 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/images/date.png +0 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/images/delete.png +0 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/images/find.png +0 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/images/loadingAnimation.gif +0 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/images/macFFBgHack.png +0 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/images/package.png +0 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/images/page_green.png +0 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/images/page_white_text.png +0 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/images/page_white_width.png +0 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/images/plugin.png +0 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/images/ruby.png +0 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/images/tag_blue.png +0 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/images/tag_green.png +0 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/images/transparent.png +0 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/images/wrench.png +0 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/images/wrench_orange.png +0 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/images/zoom.png +0 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/index.rhtml +23 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/js/darkfish.js +120 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/js/search.js +110 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/page.rhtml +18 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/servlet_not_found.rhtml +20 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/servlet_root.rhtml +65 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/darkfish/table_of_contents.rhtml +70 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/json_index/js/navigation.js +105 -0
- package/lib/ruby/3.4.0/rdoc/generator/template/json_index/js/searcher.js +229 -0
- package/lib/ruby/3.4.0/rdoc/generator.rb +51 -0
- package/lib/ruby/3.4.0/rdoc/i18n/locale.rb +102 -0
- package/lib/ruby/3.4.0/rdoc/i18n/text.rb +126 -0
- package/lib/ruby/3.4.0/rdoc/i18n.rb +10 -0
- package/lib/ruby/3.4.0/rdoc/known_classes.rb +74 -0
- package/lib/ruby/3.4.0/rdoc/markdown/entities.rb +2131 -0
- package/lib/ruby/3.4.0/rdoc/markdown/literals.rb +454 -0
- package/lib/ruby/3.4.0/rdoc/markdown.rb +16806 -0
- package/lib/ruby/3.4.0/rdoc/markup/attr_changer.rb +22 -0
- package/lib/ruby/3.4.0/rdoc/markup/attr_span.rb +35 -0
- package/lib/ruby/3.4.0/rdoc/markup/attribute_manager.rb +405 -0
- package/lib/ruby/3.4.0/rdoc/markup/attributes.rb +70 -0
- package/lib/ruby/3.4.0/rdoc/markup/blank_line.rb +27 -0
- package/lib/ruby/3.4.0/rdoc/markup/block_quote.rb +14 -0
- package/lib/ruby/3.4.0/rdoc/markup/document.rb +164 -0
- package/lib/ruby/3.4.0/rdoc/markup/formatter.rb +272 -0
- package/lib/ruby/3.4.0/rdoc/markup/hard_break.rb +31 -0
- package/lib/ruby/3.4.0/rdoc/markup/heading.rb +84 -0
- package/lib/ruby/3.4.0/rdoc/markup/include.rb +42 -0
- package/lib/ruby/3.4.0/rdoc/markup/indented_paragraph.rb +47 -0
- package/lib/ruby/3.4.0/rdoc/markup/list.rb +101 -0
- package/lib/ruby/3.4.0/rdoc/markup/list_item.rb +99 -0
- package/lib/ruby/3.4.0/rdoc/markup/paragraph.rb +28 -0
- package/lib/ruby/3.4.0/rdoc/markup/parser.rb +585 -0
- package/lib/ruby/3.4.0/rdoc/markup/pre_process.rb +318 -0
- package/lib/ruby/3.4.0/rdoc/markup/raw.rb +69 -0
- package/lib/ruby/3.4.0/rdoc/markup/regexp_handling.rb +40 -0
- package/lib/ruby/3.4.0/rdoc/markup/rule.rb +20 -0
- package/lib/ruby/3.4.0/rdoc/markup/table.rb +56 -0
- package/lib/ruby/3.4.0/rdoc/markup/to_ansi.rb +93 -0
- package/lib/ruby/3.4.0/rdoc/markup/to_bs.rb +102 -0
- package/lib/ruby/3.4.0/rdoc/markup/to_html.rb +462 -0
- package/lib/ruby/3.4.0/rdoc/markup/to_html_crossref.rb +226 -0
- package/lib/ruby/3.4.0/rdoc/markup/to_html_snippet.rb +287 -0
- package/lib/ruby/3.4.0/rdoc/markup/to_joined_paragraph.rb +46 -0
- package/lib/ruby/3.4.0/rdoc/markup/to_label.rb +74 -0
- package/lib/ruby/3.4.0/rdoc/markup/to_markdown.rb +191 -0
- package/lib/ruby/3.4.0/rdoc/markup/to_rdoc.rb +353 -0
- package/lib/ruby/3.4.0/rdoc/markup/to_table_of_contents.rb +88 -0
- package/lib/ruby/3.4.0/rdoc/markup/to_test.rb +69 -0
- package/lib/ruby/3.4.0/rdoc/markup/to_tt_only.rb +120 -0
- package/lib/ruby/3.4.0/rdoc/markup/verbatim.rb +83 -0
- package/lib/ruby/3.4.0/rdoc/markup.rb +240 -0
- package/lib/ruby/3.4.0/rdoc/options.rb +1416 -0
- package/lib/ruby/3.4.0/rdoc/parser/c.rb +1257 -0
- package/lib/ruby/3.4.0/rdoc/parser/changelog.rb +350 -0
- package/lib/ruby/3.4.0/rdoc/parser/markdown.rb +22 -0
- package/lib/ruby/3.4.0/rdoc/parser/prism_ruby.rb +1092 -0
- package/lib/ruby/3.4.0/rdoc/parser/rd.rb +22 -0
- package/lib/ruby/3.4.0/rdoc/parser/ripper_state_lex.rb +302 -0
- package/lib/ruby/3.4.0/rdoc/parser/ruby.rb +2378 -0
- package/lib/ruby/3.4.0/rdoc/parser/ruby_tools.rb +165 -0
- package/lib/ruby/3.4.0/rdoc/parser/simple.rb +61 -0
- package/lib/ruby/3.4.0/rdoc/parser/text.rb +11 -0
- package/lib/ruby/3.4.0/rdoc/parser.rb +297 -0
- package/lib/ruby/3.4.0/rdoc/rd/block_parser.rb +1706 -0
- package/lib/ruby/3.4.0/rdoc/rd/inline.rb +71 -0
- package/lib/ruby/3.4.0/rdoc/rd/inline_parser.rb +1854 -0
- package/lib/ruby/3.4.0/rdoc/rd.rb +99 -0
- package/lib/ruby/3.4.0/rdoc/rdoc.rb +551 -0
- package/lib/ruby/3.4.0/rdoc/ri/driver.rb +1566 -0
- package/lib/ruby/3.4.0/rdoc/ri/formatter.rb +6 -0
- package/lib/ruby/3.4.0/rdoc/ri/paths.rb +171 -0
- package/lib/ruby/3.4.0/rdoc/ri/store.rb +6 -0
- package/lib/ruby/3.4.0/rdoc/ri/task.rb +71 -0
- package/lib/ruby/3.4.0/rdoc/ri.rb +20 -0
- package/lib/ruby/3.4.0/rdoc/rubygems_hook.rb +327 -0
- package/lib/ruby/3.4.0/rdoc/servlet.rb +452 -0
- package/lib/ruby/3.4.0/rdoc/stats/normal.rb +58 -0
- package/lib/ruby/3.4.0/rdoc/stats/quiet.rb +59 -0
- package/lib/ruby/3.4.0/rdoc/stats/verbose.rb +44 -0
- package/lib/ruby/3.4.0/rdoc/stats.rb +461 -0
- package/lib/ruby/3.4.0/rdoc/store.rb +997 -0
- package/lib/ruby/3.4.0/rdoc/task.rb +354 -0
- package/lib/ruby/3.4.0/rdoc/text.rb +322 -0
- package/lib/ruby/3.4.0/rdoc/token_stream.rb +118 -0
- package/lib/ruby/3.4.0/rdoc/tom_doc.rb +257 -0
- package/lib/ruby/3.4.0/rdoc/version.rb +10 -0
- package/lib/ruby/3.4.0/rdoc.rb +211 -0
- package/lib/ruby/3.4.0/readline.rb +7 -0
- package/lib/ruby/3.4.0/reline/config.rb +373 -0
- package/lib/ruby/3.4.0/reline/face.rb +199 -0
- package/lib/ruby/3.4.0/reline/history.rb +76 -0
- package/lib/ruby/3.4.0/reline/io/ansi.rb +325 -0
- package/lib/ruby/3.4.0/reline/io/dumb.rb +120 -0
- package/lib/ruby/3.4.0/reline/io/windows.rb +530 -0
- package/lib/ruby/3.4.0/reline/io.rb +55 -0
- package/lib/ruby/3.4.0/reline/key_actor/base.rb +37 -0
- package/lib/ruby/3.4.0/reline/key_actor/composite.rb +17 -0
- package/lib/ruby/3.4.0/reline/key_actor/emacs.rb +517 -0
- package/lib/ruby/3.4.0/reline/key_actor/vi_command.rb +518 -0
- package/lib/ruby/3.4.0/reline/key_actor/vi_insert.rb +517 -0
- package/lib/ruby/3.4.0/reline/key_actor.rb +8 -0
- package/lib/ruby/3.4.0/reline/key_stroke.rb +119 -0
- package/lib/ruby/3.4.0/reline/kill_ring.rb +125 -0
- package/lib/ruby/3.4.0/reline/line_editor.rb +2382 -0
- package/lib/ruby/3.4.0/reline/unicode/east_asian_width.rb +1267 -0
- package/lib/ruby/3.4.0/reline/unicode.rb +415 -0
- package/lib/ruby/3.4.0/reline/version.rb +3 -0
- package/lib/ruby/3.4.0/reline.rb +519 -0
- package/lib/ruby/3.4.0/resolv.rb +3587 -0
- package/lib/ruby/3.4.0/ripper/core.rb +74 -0
- package/lib/ruby/3.4.0/ripper/filter.rb +86 -0
- package/lib/ruby/3.4.0/ripper/lexer.rb +379 -0
- package/lib/ruby/3.4.0/ripper/sexp.rb +187 -0
- package/lib/ruby/3.4.0/ripper.rb +74 -0
- package/lib/ruby/3.4.0/ruby_vm/rjit/assembler.rb +1160 -0
- package/lib/ruby/3.4.0/ruby_vm/rjit/block.rb +11 -0
- package/lib/ruby/3.4.0/ruby_vm/rjit/branch_stub.rb +24 -0
- package/lib/ruby/3.4.0/ruby_vm/rjit/c_pointer.rb +394 -0
- package/lib/ruby/3.4.0/ruby_vm/rjit/c_type.rb +99 -0
- package/lib/ruby/3.4.0/ruby_vm/rjit/code_block.rb +91 -0
- package/lib/ruby/3.4.0/ruby_vm/rjit/compiler.rb +518 -0
- package/lib/ruby/3.4.0/ruby_vm/rjit/context.rb +377 -0
- package/lib/ruby/3.4.0/ruby_vm/rjit/entry_stub.rb +7 -0
- package/lib/ruby/3.4.0/ruby_vm/rjit/exit_compiler.rb +164 -0
- package/lib/ruby/3.4.0/ruby_vm/rjit/hooks.rb +36 -0
- package/lib/ruby/3.4.0/ruby_vm/rjit/insn_compiler.rb +6046 -0
- package/lib/ruby/3.4.0/ruby_vm/rjit/instruction.rb +1326 -0
- package/lib/ruby/3.4.0/ruby_vm/rjit/invariants.rb +155 -0
- package/lib/ruby/3.4.0/ruby_vm/rjit/jit_state.rb +65 -0
- package/lib/ruby/3.4.0/ruby_vm/rjit/stats.rb +191 -0
- package/lib/ruby/3.4.0/ruby_vm/rjit/type.rb +221 -0
- package/lib/ruby/3.4.0/rubygems/available_set.rb +165 -0
- package/lib/ruby/3.4.0/rubygems/basic_specification.rb +383 -0
- package/lib/ruby/3.4.0/rubygems/bundler_version_finder.rb +77 -0
- package/lib/ruby/3.4.0/rubygems/ci_detector.rb +75 -0
- package/lib/ruby/3.4.0/rubygems/command.rb +664 -0
- package/lib/ruby/3.4.0/rubygems/command_manager.rb +255 -0
- package/lib/ruby/3.4.0/rubygems/commands/build_command.rb +127 -0
- package/lib/ruby/3.4.0/rubygems/commands/cert_command.rb +325 -0
- package/lib/ruby/3.4.0/rubygems/commands/check_command.rb +97 -0
- package/lib/ruby/3.4.0/rubygems/commands/cleanup_command.rb +178 -0
- package/lib/ruby/3.4.0/rubygems/commands/contents_command.rb +196 -0
- package/lib/ruby/3.4.0/rubygems/commands/dependency_command.rb +206 -0
- package/lib/ruby/3.4.0/rubygems/commands/environment_command.rb +181 -0
- package/lib/ruby/3.4.0/rubygems/commands/exec_command.rb +256 -0
- package/lib/ruby/3.4.0/rubygems/commands/fetch_command.rb +109 -0
- package/lib/ruby/3.4.0/rubygems/commands/generate_index_command.rb +51 -0
- package/lib/ruby/3.4.0/rubygems/commands/help_command.rb +375 -0
- package/lib/ruby/3.4.0/rubygems/commands/info_command.rb +38 -0
- package/lib/ruby/3.4.0/rubygems/commands/install_command.rb +269 -0
- package/lib/ruby/3.4.0/rubygems/commands/list_command.rb +42 -0
- package/lib/ruby/3.4.0/rubygems/commands/lock_command.rb +109 -0
- package/lib/ruby/3.4.0/rubygems/commands/mirror_command.rb +26 -0
- package/lib/ruby/3.4.0/rubygems/commands/open_command.rb +83 -0
- package/lib/ruby/3.4.0/rubygems/commands/outdated_command.rb +33 -0
- package/lib/ruby/3.4.0/rubygems/commands/owner_command.rb +124 -0
- package/lib/ruby/3.4.0/rubygems/commands/pristine_command.rb +217 -0
- package/lib/ruby/3.4.0/rubygems/commands/push_command.rb +135 -0
- package/lib/ruby/3.4.0/rubygems/commands/query_command.rb +43 -0
- package/lib/ruby/3.4.0/rubygems/commands/rdoc_command.rb +90 -0
- package/lib/ruby/3.4.0/rubygems/commands/rebuild_command.rb +262 -0
- package/lib/ruby/3.4.0/rubygems/commands/search_command.rb +41 -0
- package/lib/ruby/3.4.0/rubygems/commands/server_command.rb +26 -0
- package/lib/ruby/3.4.0/rubygems/commands/setup_command.rb +663 -0
- package/lib/ruby/3.4.0/rubygems/commands/signin_command.rb +34 -0
- package/lib/ruby/3.4.0/rubygems/commands/signout_command.rb +32 -0
- package/lib/ruby/3.4.0/rubygems/commands/sources_command.rb +227 -0
- package/lib/ruby/3.4.0/rubygems/commands/specification_command.rb +156 -0
- package/lib/ruby/3.4.0/rubygems/commands/stale_command.rb +40 -0
- package/lib/ruby/3.4.0/rubygems/commands/uninstall_command.rb +204 -0
- package/lib/ruby/3.4.0/rubygems/commands/unpack_command.rb +168 -0
- package/lib/ruby/3.4.0/rubygems/commands/update_command.rb +326 -0
- package/lib/ruby/3.4.0/rubygems/commands/which_command.rb +88 -0
- package/lib/ruby/3.4.0/rubygems/commands/yank_command.rb +99 -0
- package/lib/ruby/3.4.0/rubygems/compatibility.rb +41 -0
- package/lib/ruby/3.4.0/rubygems/config_file.rb +618 -0
- package/lib/ruby/3.4.0/rubygems/core_ext/kernel_gem.rb +68 -0
- package/lib/ruby/3.4.0/rubygems/core_ext/kernel_require.rb +149 -0
- package/lib/ruby/3.4.0/rubygems/core_ext/kernel_warn.rb +45 -0
- package/lib/ruby/3.4.0/rubygems/core_ext/tcpsocket_init.rb +54 -0
- package/lib/ruby/3.4.0/rubygems/defaults.rb +308 -0
- package/lib/ruby/3.4.0/rubygems/dependency.rb +348 -0
- package/lib/ruby/3.4.0/rubygems/dependency_installer.rb +335 -0
- package/lib/ruby/3.4.0/rubygems/dependency_list.rb +243 -0
- package/lib/ruby/3.4.0/rubygems/deprecate.rb +169 -0
- package/lib/ruby/3.4.0/rubygems/doctor.rb +132 -0
- package/lib/ruby/3.4.0/rubygems/errors.rb +177 -0
- package/lib/ruby/3.4.0/rubygems/exceptions.rb +293 -0
- package/lib/ruby/3.4.0/rubygems/ext/build_error.rb +9 -0
- package/lib/ruby/3.4.0/rubygems/ext/builder.rb +260 -0
- package/lib/ruby/3.4.0/rubygems/ext/cargo_builder/link_flag_converter.rb +27 -0
- package/lib/ruby/3.4.0/rubygems/ext/cargo_builder.rb +346 -0
- package/lib/ruby/3.4.0/rubygems/ext/cmake_builder.rb +21 -0
- package/lib/ruby/3.4.0/rubygems/ext/configure_builder.rb +26 -0
- package/lib/ruby/3.4.0/rubygems/ext/ext_conf_builder.rb +77 -0
- package/lib/ruby/3.4.0/rubygems/ext/rake_builder.rb +37 -0
- package/lib/ruby/3.4.0/rubygems/ext.rb +20 -0
- package/lib/ruby/3.4.0/rubygems/gem_runner.rb +89 -0
- package/lib/ruby/3.4.0/rubygems/gemcutter_utilities/webauthn_listener/response.rb +163 -0
- package/lib/ruby/3.4.0/rubygems/gemcutter_utilities/webauthn_listener.rb +105 -0
- package/lib/ruby/3.4.0/rubygems/gemcutter_utilities/webauthn_poller.rb +80 -0
- package/lib/ruby/3.4.0/rubygems/gemcutter_utilities.rb +397 -0
- package/lib/ruby/3.4.0/rubygems/gemspec_helpers.rb +19 -0
- package/lib/ruby/3.4.0/rubygems/install_default_message.rb +13 -0
- package/lib/ruby/3.4.0/rubygems/install_message.rb +13 -0
- package/lib/ruby/3.4.0/rubygems/install_update_options.rb +204 -0
- package/lib/ruby/3.4.0/rubygems/installer.rb +1031 -0
- package/lib/ruby/3.4.0/rubygems/installer_uninstaller_utils.rb +27 -0
- package/lib/ruby/3.4.0/rubygems/local_remote_options.rb +146 -0
- package/lib/ruby/3.4.0/rubygems/name_tuple.rb +119 -0
- package/lib/ruby/3.4.0/rubygems/openssl.rb +7 -0
- package/lib/ruby/3.4.0/rubygems/package/digest_io.rb +63 -0
- package/lib/ruby/3.4.0/rubygems/package/file_source.rb +32 -0
- package/lib/ruby/3.4.0/rubygems/package/io_source.rb +48 -0
- package/lib/ruby/3.4.0/rubygems/package/old.rb +169 -0
- package/lib/ruby/3.4.0/rubygems/package/source.rb +4 -0
- package/lib/ruby/3.4.0/rubygems/package/tar_header.rb +277 -0
- package/lib/ruby/3.4.0/rubygems/package/tar_reader/entry.rb +244 -0
- package/lib/ruby/3.4.0/rubygems/package/tar_reader.rb +101 -0
- package/lib/ruby/3.4.0/rubygems/package/tar_writer.rb +332 -0
- package/lib/ruby/3.4.0/rubygems/package.rb +742 -0
- package/lib/ruby/3.4.0/rubygems/package_task.rb +123 -0
- package/lib/ruby/3.4.0/rubygems/path_support.rb +85 -0
- package/lib/ruby/3.4.0/rubygems/platform.rb +269 -0
- package/lib/ruby/3.4.0/rubygems/psych_tree.rb +37 -0
- package/lib/ruby/3.4.0/rubygems/query_utils.rb +349 -0
- package/lib/ruby/3.4.0/rubygems/rdoc.rb +26 -0
- package/lib/ruby/3.4.0/rubygems/remote_fetcher.rb +341 -0
- package/lib/ruby/3.4.0/rubygems/request/connection_pools.rb +95 -0
- package/lib/ruby/3.4.0/rubygems/request/http_pool.rb +47 -0
- package/lib/ruby/3.4.0/rubygems/request/https_pool.rb +10 -0
- package/lib/ruby/3.4.0/rubygems/request.rb +298 -0
- package/lib/ruby/3.4.0/rubygems/request_set/gem_dependency_api.rb +841 -0
- package/lib/ruby/3.4.0/rubygems/request_set/lockfile/parser.rb +344 -0
- package/lib/ruby/3.4.0/rubygems/request_set/lockfile/tokenizer.rb +122 -0
- package/lib/ruby/3.4.0/rubygems/request_set/lockfile.rb +235 -0
- package/lib/ruby/3.4.0/rubygems/request_set.rb +468 -0
- package/lib/ruby/3.4.0/rubygems/requirement.rb +298 -0
- package/lib/ruby/3.4.0/rubygems/resolver/activation_request.rb +159 -0
- package/lib/ruby/3.4.0/rubygems/resolver/api_set/gem_parser.rb +21 -0
- package/lib/ruby/3.4.0/rubygems/resolver/api_set.rb +139 -0
- package/lib/ruby/3.4.0/rubygems/resolver/api_specification.rb +105 -0
- package/lib/ruby/3.4.0/rubygems/resolver/best_set.rb +49 -0
- package/lib/ruby/3.4.0/rubygems/resolver/composed_set.rb +65 -0
- package/lib/ruby/3.4.0/rubygems/resolver/conflict.rb +146 -0
- package/lib/ruby/3.4.0/rubygems/resolver/current_set.rb +12 -0
- package/lib/ruby/3.4.0/rubygems/resolver/dependency_request.rb +119 -0
- package/lib/ruby/3.4.0/rubygems/resolver/git_set.rb +120 -0
- package/lib/ruby/3.4.0/rubygems/resolver/git_specification.rb +57 -0
- package/lib/ruby/3.4.0/rubygems/resolver/index_set.rb +79 -0
- package/lib/ruby/3.4.0/rubygems/resolver/index_specification.rb +101 -0
- package/lib/ruby/3.4.0/rubygems/resolver/installed_specification.rb +57 -0
- package/lib/ruby/3.4.0/rubygems/resolver/installer_set.rb +271 -0
- package/lib/ruby/3.4.0/rubygems/resolver/local_specification.rb +40 -0
- package/lib/ruby/3.4.0/rubygems/resolver/lock_set.rb +81 -0
- package/lib/ruby/3.4.0/rubygems/resolver/lock_specification.rb +86 -0
- package/lib/ruby/3.4.0/rubygems/resolver/requirement_list.rb +82 -0
- package/lib/ruby/3.4.0/rubygems/resolver/set.rb +55 -0
- package/lib/ruby/3.4.0/rubygems/resolver/source_set.rb +47 -0
- package/lib/ruby/3.4.0/rubygems/resolver/spec_specification.rb +76 -0
- package/lib/ruby/3.4.0/rubygems/resolver/specification.rb +126 -0
- package/lib/ruby/3.4.0/rubygems/resolver/stats.rb +46 -0
- package/lib/ruby/3.4.0/rubygems/resolver/vendor_set.rb +86 -0
- package/lib/ruby/3.4.0/rubygems/resolver/vendor_specification.rb +23 -0
- package/lib/ruby/3.4.0/rubygems/resolver.rb +341 -0
- package/lib/ruby/3.4.0/rubygems/s3_uri_signer.rb +177 -0
- package/lib/ruby/3.4.0/rubygems/safe_marshal/elements.rb +146 -0
- package/lib/ruby/3.4.0/rubygems/safe_marshal/reader.rb +325 -0
- package/lib/ruby/3.4.0/rubygems/safe_marshal/visitors/stream_printer.rb +31 -0
- package/lib/ruby/3.4.0/rubygems/safe_marshal/visitors/to_ruby.rb +428 -0
- package/lib/ruby/3.4.0/rubygems/safe_marshal/visitors/visitor.rb +74 -0
- package/lib/ruby/3.4.0/rubygems/safe_marshal.rb +74 -0
- package/lib/ruby/3.4.0/rubygems/safe_yaml.rb +45 -0
- package/lib/ruby/3.4.0/rubygems/security/policies.rb +114 -0
- package/lib/ruby/3.4.0/rubygems/security/policy.rb +288 -0
- package/lib/ruby/3.4.0/rubygems/security/signer.rb +212 -0
- package/lib/ruby/3.4.0/rubygems/security/trust_dir.rb +117 -0
- package/lib/ruby/3.4.0/rubygems/security.rb +615 -0
- package/lib/ruby/3.4.0/rubygems/security_option.rb +43 -0
- package/lib/ruby/3.4.0/rubygems/source/git.rb +244 -0
- package/lib/ruby/3.4.0/rubygems/source/installed.rb +39 -0
- package/lib/ruby/3.4.0/rubygems/source/local.rb +131 -0
- package/lib/ruby/3.4.0/rubygems/source/lock.rb +49 -0
- package/lib/ruby/3.4.0/rubygems/source/specific_file.rb +73 -0
- package/lib/ruby/3.4.0/rubygems/source/vendor.rb +24 -0
- package/lib/ruby/3.4.0/rubygems/source.rb +247 -0
- package/lib/ruby/3.4.0/rubygems/source_list.rb +146 -0
- package/lib/ruby/3.4.0/rubygems/spec_fetcher.rb +290 -0
- package/lib/ruby/3.4.0/rubygems/specification.rb +2666 -0
- package/lib/ruby/3.4.0/rubygems/specification_policy.rb +558 -0
- package/lib/ruby/3.4.0/rubygems/specification_record.rb +212 -0
- package/lib/ruby/3.4.0/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA.pem +21 -0
- package/lib/ruby/3.4.0/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA_R3.pem +21 -0
- package/lib/ruby/3.4.0/rubygems/stub_specification.rb +235 -0
- package/lib/ruby/3.4.0/rubygems/target_rbconfig.rb +50 -0
- package/lib/ruby/3.4.0/rubygems/text.rb +85 -0
- package/lib/ruby/3.4.0/rubygems/uninstaller.rb +429 -0
- package/lib/ruby/3.4.0/rubygems/unknown_command_spell_checker.rb +21 -0
- package/lib/ruby/3.4.0/rubygems/update_suggestion.rb +56 -0
- package/lib/ruby/3.4.0/rubygems/uri.rb +126 -0
- package/lib/ruby/3.4.0/rubygems/uri_formatter.rb +47 -0
- package/lib/ruby/3.4.0/rubygems/user_interaction.rb +650 -0
- package/lib/ruby/3.4.0/rubygems/util/licenses.rb +834 -0
- package/lib/ruby/3.4.0/rubygems/util/list.rb +40 -0
- package/lib/ruby/3.4.0/rubygems/util.rb +118 -0
- package/lib/ruby/3.4.0/rubygems/validator.rb +144 -0
- package/lib/ruby/3.4.0/rubygems/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +57 -0
- package/lib/ruby/3.4.0/rubygems/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +88 -0
- package/lib/ruby/3.4.0/rubygems/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +36 -0
- package/lib/ruby/3.4.0/rubygems/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +66 -0
- package/lib/ruby/3.4.0/rubygems/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +62 -0
- package/lib/ruby/3.4.0/rubygems/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +63 -0
- package/lib/ruby/3.4.0/rubygems/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +61 -0
- package/lib/ruby/3.4.0/rubygems/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +126 -0
- package/lib/ruby/3.4.0/rubygems/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +46 -0
- package/lib/ruby/3.4.0/rubygems/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +36 -0
- package/lib/ruby/3.4.0/rubygems/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +164 -0
- package/lib/ruby/3.4.0/rubygems/vendor/molinillo/lib/molinillo/dependency_graph.rb +255 -0
- package/lib/ruby/3.4.0/rubygems/vendor/molinillo/lib/molinillo/errors.rb +149 -0
- package/lib/ruby/3.4.0/rubygems/vendor/molinillo/lib/molinillo/gem_metadata.rb +6 -0
- package/lib/ruby/3.4.0/rubygems/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +112 -0
- package/lib/ruby/3.4.0/rubygems/vendor/molinillo/lib/molinillo/modules/ui.rb +67 -0
- package/lib/ruby/3.4.0/rubygems/vendor/molinillo/lib/molinillo/resolution.rb +839 -0
- package/lib/ruby/3.4.0/rubygems/vendor/molinillo/lib/molinillo/resolver.rb +46 -0
- package/lib/ruby/3.4.0/rubygems/vendor/molinillo/lib/molinillo/state.rb +58 -0
- package/lib/ruby/3.4.0/rubygems/vendor/molinillo/lib/molinillo.rb +11 -0
- package/lib/ruby/3.4.0/rubygems/vendor/net-http/lib/net/http/exceptions.rb +34 -0
- package/lib/ruby/3.4.0/rubygems/vendor/net-http/lib/net/http/generic_request.rb +414 -0
- package/lib/ruby/3.4.0/rubygems/vendor/net-http/lib/net/http/header.rb +981 -0
- package/lib/ruby/3.4.0/rubygems/vendor/net-http/lib/net/http/proxy_delta.rb +17 -0
- package/lib/ruby/3.4.0/rubygems/vendor/net-http/lib/net/http/request.rb +88 -0
- package/lib/ruby/3.4.0/rubygems/vendor/net-http/lib/net/http/requests.rb +430 -0
- package/lib/ruby/3.4.0/rubygems/vendor/net-http/lib/net/http/response.rb +738 -0
- package/lib/ruby/3.4.0/rubygems/vendor/net-http/lib/net/http/responses.rb +1174 -0
- package/lib/ruby/3.4.0/rubygems/vendor/net-http/lib/net/http/status.rb +84 -0
- package/lib/ruby/3.4.0/rubygems/vendor/net-http/lib/net/http.rb +2580 -0
- package/lib/ruby/3.4.0/rubygems/vendor/net-http/lib/net/https.rb +23 -0
- package/lib/ruby/3.4.0/rubygems/vendor/net-protocol/lib/net/protocol.rb +544 -0
- package/lib/ruby/3.4.0/rubygems/vendor/optparse/lib/optionparser.rb +2 -0
- package/lib/ruby/3.4.0/rubygems/vendor/optparse/lib/optparse/ac.rb +70 -0
- package/lib/ruby/3.4.0/rubygems/vendor/optparse/lib/optparse/date.rb +18 -0
- package/lib/ruby/3.4.0/rubygems/vendor/optparse/lib/optparse/kwargs.rb +27 -0
- package/lib/ruby/3.4.0/rubygems/vendor/optparse/lib/optparse/shellwords.rb +7 -0
- package/lib/ruby/3.4.0/rubygems/vendor/optparse/lib/optparse/time.rb +11 -0
- package/lib/ruby/3.4.0/rubygems/vendor/optparse/lib/optparse/uri.rb +7 -0
- package/lib/ruby/3.4.0/rubygems/vendor/optparse/lib/optparse/version.rb +80 -0
- package/lib/ruby/3.4.0/rubygems/vendor/optparse/lib/optparse.rb +2426 -0
- package/lib/ruby/3.4.0/rubygems/vendor/resolv/lib/resolv.rb +3455 -0
- package/lib/ruby/3.4.0/rubygems/vendor/securerandom/lib/securerandom.rb +102 -0
- package/lib/ruby/3.4.0/rubygems/vendor/timeout/lib/timeout.rb +198 -0
- package/lib/ruby/3.4.0/rubygems/vendor/tsort/lib/tsort.rb +455 -0
- package/lib/ruby/3.4.0/rubygems/vendor/uri/lib/uri/common.rb +880 -0
- package/lib/ruby/3.4.0/rubygems/vendor/uri/lib/uri/file.rb +100 -0
- package/lib/ruby/3.4.0/rubygems/vendor/uri/lib/uri/ftp.rb +267 -0
- package/lib/ruby/3.4.0/rubygems/vendor/uri/lib/uri/generic.rb +1592 -0
- package/lib/ruby/3.4.0/rubygems/vendor/uri/lib/uri/http.rb +125 -0
- package/lib/ruby/3.4.0/rubygems/vendor/uri/lib/uri/https.rb +23 -0
- package/lib/ruby/3.4.0/rubygems/vendor/uri/lib/uri/ldap.rb +261 -0
- package/lib/ruby/3.4.0/rubygems/vendor/uri/lib/uri/ldaps.rb +22 -0
- package/lib/ruby/3.4.0/rubygems/vendor/uri/lib/uri/mailto.rb +293 -0
- package/lib/ruby/3.4.0/rubygems/vendor/uri/lib/uri/rfc2396_parser.rb +546 -0
- package/lib/ruby/3.4.0/rubygems/vendor/uri/lib/uri/rfc3986_parser.rb +206 -0
- package/lib/ruby/3.4.0/rubygems/vendor/uri/lib/uri/version.rb +6 -0
- package/lib/ruby/3.4.0/rubygems/vendor/uri/lib/uri/ws.rb +83 -0
- package/lib/ruby/3.4.0/rubygems/vendor/uri/lib/uri/wss.rb +23 -0
- package/lib/ruby/3.4.0/rubygems/vendor/uri/lib/uri.rb +104 -0
- package/lib/ruby/3.4.0/rubygems/vendored_molinillo.rb +3 -0
- package/lib/ruby/3.4.0/rubygems/vendored_net_http.rb +5 -0
- package/lib/ruby/3.4.0/rubygems/vendored_optparse.rb +3 -0
- package/lib/ruby/3.4.0/rubygems/vendored_securerandom.rb +3 -0
- package/lib/ruby/3.4.0/rubygems/vendored_timeout.rb +5 -0
- package/lib/ruby/3.4.0/rubygems/vendored_tsort.rb +3 -0
- package/lib/ruby/3.4.0/rubygems/version.rb +441 -0
- package/lib/ruby/3.4.0/rubygems/version_option.rb +80 -0
- package/lib/ruby/3.4.0/rubygems/yaml_serializer.rb +98 -0
- package/lib/ruby/3.4.0/rubygems.rb +1417 -0
- package/lib/ruby/3.4.0/securerandom.rb +102 -0
- package/lib/ruby/3.4.0/set/sorted_set.rb +6 -0
- package/lib/ruby/3.4.0/set.rb +855 -0
- package/lib/ruby/3.4.0/shellwords.rb +254 -0
- package/lib/ruby/3.4.0/singleton.rb +239 -0
- package/lib/ruby/3.4.0/socket.rb +1790 -0
- package/lib/ruby/3.4.0/strscan/strscan.rb +25 -0
- package/lib/ruby/3.4.0/syntax_suggest/api.rb +233 -0
- package/lib/ruby/3.4.0/syntax_suggest/around_block_scan.rb +232 -0
- package/lib/ruby/3.4.0/syntax_suggest/block_expand.rb +165 -0
- package/lib/ruby/3.4.0/syntax_suggest/capture/before_after_keyword_ends.rb +85 -0
- package/lib/ruby/3.4.0/syntax_suggest/capture/falling_indent_lines.rb +71 -0
- package/lib/ruby/3.4.0/syntax_suggest/capture_code_context.rb +245 -0
- package/lib/ruby/3.4.0/syntax_suggest/clean_document.rb +306 -0
- package/lib/ruby/3.4.0/syntax_suggest/cli.rb +130 -0
- package/lib/ruby/3.4.0/syntax_suggest/code_block.rb +100 -0
- package/lib/ruby/3.4.0/syntax_suggest/code_frontier.rb +178 -0
- package/lib/ruby/3.4.0/syntax_suggest/code_line.rb +243 -0
- package/lib/ruby/3.4.0/syntax_suggest/code_search.rb +139 -0
- package/lib/ruby/3.4.0/syntax_suggest/core_ext.rb +96 -0
- package/lib/ruby/3.4.0/syntax_suggest/display_code_with_line_numbers.rb +70 -0
- package/lib/ruby/3.4.0/syntax_suggest/display_invalid_blocks.rb +83 -0
- package/lib/ruby/3.4.0/syntax_suggest/explain_syntax.rb +117 -0
- package/lib/ruby/3.4.0/syntax_suggest/left_right_lex_count.rb +168 -0
- package/lib/ruby/3.4.0/syntax_suggest/lex_all.rb +74 -0
- package/lib/ruby/3.4.0/syntax_suggest/lex_value.rb +70 -0
- package/lib/ruby/3.4.0/syntax_suggest/mini_stringio.rb +30 -0
- package/lib/ruby/3.4.0/syntax_suggest/parse_blocks_from_indent_line.rb +60 -0
- package/lib/ruby/3.4.0/syntax_suggest/pathname_from_message.rb +59 -0
- package/lib/ruby/3.4.0/syntax_suggest/priority_engulf_queue.rb +63 -0
- package/lib/ruby/3.4.0/syntax_suggest/priority_queue.rb +105 -0
- package/lib/ruby/3.4.0/syntax_suggest/ripper_errors.rb +39 -0
- package/lib/ruby/3.4.0/syntax_suggest/scan_history.rb +134 -0
- package/lib/ruby/3.4.0/syntax_suggest/unvisited_lines.rb +36 -0
- package/lib/ruby/3.4.0/syntax_suggest/version.rb +5 -0
- package/lib/ruby/3.4.0/syntax_suggest.rb +3 -0
- package/lib/ruby/3.4.0/tempfile.rb +640 -0
- package/lib/ruby/3.4.0/time.rb +731 -0
- package/lib/ruby/3.4.0/timeout.rb +200 -0
- package/lib/ruby/3.4.0/tmpdir.rb +189 -0
- package/lib/ruby/3.4.0/tsort.rb +455 -0
- package/lib/ruby/3.4.0/un.rb +441 -0
- package/lib/ruby/3.4.0/unicode_normalize/normalize.rb +181 -0
- package/lib/ruby/3.4.0/unicode_normalize/tables.rb +9259 -0
- package/lib/ruby/3.4.0/uri/common.rb +880 -0
- package/lib/ruby/3.4.0/uri/file.rb +100 -0
- package/lib/ruby/3.4.0/uri/ftp.rb +267 -0
- package/lib/ruby/3.4.0/uri/generic.rb +1592 -0
- package/lib/ruby/3.4.0/uri/http.rb +125 -0
- package/lib/ruby/3.4.0/uri/https.rb +23 -0
- package/lib/ruby/3.4.0/uri/ldap.rb +261 -0
- package/lib/ruby/3.4.0/uri/ldaps.rb +22 -0
- package/lib/ruby/3.4.0/uri/mailto.rb +293 -0
- package/lib/ruby/3.4.0/uri/rfc2396_parser.rb +546 -0
- package/lib/ruby/3.4.0/uri/rfc3986_parser.rb +206 -0
- package/lib/ruby/3.4.0/uri/version.rb +6 -0
- package/lib/ruby/3.4.0/uri/ws.rb +83 -0
- package/lib/ruby/3.4.0/uri/wss.rb +23 -0
- package/lib/ruby/3.4.0/uri.rb +104 -0
- package/lib/ruby/{3.4.11 → 3.4.0/wasm32-wasi}/rbconfig.rb +11 -11
- package/lib/ruby/3.4.0/weakref.rb +58 -0
- package/lib/ruby/3.4.0/yaml/dbm.rb +295 -0
- package/lib/ruby/3.4.0/yaml/store.rb +98 -0
- package/lib/ruby/3.4.0/yaml.rb +70 -0
- package/lib/ruby/gems/3.4.0/cache/abbrev-0.1.2.gem +0 -0
- package/lib/ruby/gems/3.4.0/cache/base64-0.2.0.gem +0 -0
- package/lib/ruby/gems/3.4.0/cache/csv-3.3.2.gem +0 -0
- package/lib/ruby/gems/3.4.0/cache/drb-2.2.1.gem +0 -0
- package/lib/ruby/gems/3.4.0/cache/getoptlong-0.2.1.gem +0 -0
- package/lib/ruby/gems/3.4.0/cache/matrix-0.4.2.gem +0 -0
- package/lib/ruby/gems/3.4.0/cache/minitest-5.25.4.gem +0 -0
- package/lib/ruby/gems/3.4.0/cache/mutex_m-0.3.0.gem +0 -0
- package/lib/ruby/gems/3.4.0/cache/net-ftp-0.3.8.gem +0 -0
- package/lib/ruby/gems/3.4.0/cache/net-imap-0.5.15.gem +0 -0
- package/lib/ruby/gems/3.4.0/cache/net-pop-0.1.2.gem +0 -0
- package/lib/ruby/gems/3.4.0/cache/net-smtp-0.5.1.gem +0 -0
- package/lib/ruby/gems/3.4.0/cache/observer-0.1.2.gem +0 -0
- package/lib/ruby/gems/3.4.0/cache/power_assert-2.0.5.gem +0 -0
- package/lib/ruby/gems/3.4.0/cache/prime-0.1.3.gem +0 -0
- package/lib/ruby/gems/3.4.0/cache/rake-13.2.1.gem +0 -0
- package/lib/ruby/gems/3.4.0/cache/repl_type_completor-0.1.9.gem +0 -0
- package/lib/ruby/gems/3.4.0/cache/resolv-replace-0.1.1.gem +0 -0
- package/lib/ruby/gems/3.4.0/cache/rexml-3.4.4.gem +0 -0
- package/lib/ruby/gems/3.4.0/cache/rinda-0.2.0.gem +0 -0
- package/lib/ruby/gems/3.4.0/cache/rss-0.3.1.gem +0 -0
- package/lib/ruby/gems/3.4.0/cache/test-unit-3.6.7.gem +0 -0
- package/lib/ruby/gems/3.4.0/cache/typeprof-0.30.1.gem +0 -0
- package/lib/ruby/gems/3.4.0/gems/abbrev-0.1.2/Gemfile +4 -0
- package/lib/ruby/gems/3.4.0/gems/abbrev-0.1.2/LICENSE.txt +22 -0
- package/lib/ruby/gems/3.4.0/gems/abbrev-0.1.2/README.md +45 -0
- package/lib/ruby/gems/3.4.0/gems/abbrev-0.1.2/Rakefile +10 -0
- package/lib/ruby/gems/3.4.0/gems/abbrev-0.1.2/bin/console +14 -0
- package/lib/ruby/gems/3.4.0/gems/abbrev-0.1.2/bin/setup +8 -0
- package/lib/ruby/gems/3.4.0/gems/abbrev-0.1.2/lib/abbrev.rb +133 -0
- package/lib/ruby/gems/3.4.0/gems/base64-0.2.0/LICENSE.txt +22 -0
- package/lib/ruby/gems/3.4.0/gems/base64-0.2.0/README.md +48 -0
- package/lib/ruby/gems/3.4.0/gems/base64-0.2.0/lib/base64.rb +363 -0
- package/lib/ruby/gems/3.4.0/gems/bundler-2.6.9/exe/bundle +29 -0
- package/lib/ruby/gems/3.4.0/gems/bundler-2.6.9/exe/bundler +4 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/LICENSE.txt +33 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/NEWS.md +965 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/README.md +55 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/doc/csv/arguments/io.rdoc +5 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/doc/csv/options/common/col_sep.rdoc +57 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/doc/csv/options/common/quote_char.rdoc +42 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/doc/csv/options/common/row_sep.rdoc +91 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/doc/csv/options/generating/force_quotes.rdoc +17 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/doc/csv/options/generating/quote_empty.rdoc +12 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/doc/csv/options/generating/write_converters.rdoc +25 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/doc/csv/options/generating/write_empty_value.rdoc +15 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/doc/csv/options/generating/write_headers.rdoc +29 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/doc/csv/options/generating/write_nil_value.rdoc +14 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/doc/csv/options/parsing/converters.rdoc +46 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/doc/csv/options/parsing/empty_value.rdoc +13 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/doc/csv/options/parsing/field_size_limit.rdoc +39 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/doc/csv/options/parsing/header_converters.rdoc +43 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/doc/csv/options/parsing/headers.rdoc +63 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/doc/csv/options/parsing/liberal_parsing.rdoc +38 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/doc/csv/options/parsing/nil_value.rdoc +12 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/doc/csv/options/parsing/return_headers.rdoc +22 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/doc/csv/options/parsing/skip_blanks.rdoc +31 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/doc/csv/options/parsing/skip_lines.rdoc +37 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/doc/csv/options/parsing/strip.rdoc +15 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/doc/csv/options/parsing/unconverted_fields.rdoc +27 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/doc/csv/recipes/filtering.rdoc +226 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/doc/csv/recipes/generating.rdoc +298 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/doc/csv/recipes/parsing.rdoc +554 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/doc/csv/recipes/recipes.rdoc +6 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/lib/csv/core_ext/array.rb +9 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/lib/csv/core_ext/string.rb +9 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/lib/csv/fields_converter.rb +96 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/lib/csv/input_record_separator.rb +18 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/lib/csv/parser.rb +1292 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/lib/csv/row.rb +757 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/lib/csv/table.rb +1055 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/lib/csv/version.rb +6 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/lib/csv/writer.rb +209 -0
- package/lib/ruby/gems/3.4.0/gems/csv-3.3.2/lib/csv.rb +3017 -0
- package/lib/ruby/gems/3.4.0/gems/drb-2.2.1/LICENSE.txt +22 -0
- package/lib/ruby/gems/3.4.0/gems/drb-2.2.1/lib/drb/acl.rb +239 -0
- package/lib/ruby/gems/3.4.0/gems/drb-2.2.1/lib/drb/drb.rb +1943 -0
- package/lib/ruby/gems/3.4.0/gems/drb-2.2.1/lib/drb/eq.rb +15 -0
- package/lib/ruby/gems/3.4.0/gems/drb-2.2.1/lib/drb/extserv.rb +44 -0
- package/lib/ruby/gems/3.4.0/gems/drb-2.2.1/lib/drb/extservm.rb +94 -0
- package/lib/ruby/gems/3.4.0/gems/drb-2.2.1/lib/drb/gw.rb +161 -0
- package/lib/ruby/gems/3.4.0/gems/drb-2.2.1/lib/drb/invokemethod.rb +35 -0
- package/lib/ruby/gems/3.4.0/gems/drb-2.2.1/lib/drb/observer.rb +26 -0
- package/lib/ruby/gems/3.4.0/gems/drb-2.2.1/lib/drb/ssl.rb +354 -0
- package/lib/ruby/gems/3.4.0/gems/drb-2.2.1/lib/drb/timeridconv.rb +97 -0
- package/lib/ruby/gems/3.4.0/gems/drb-2.2.1/lib/drb/unix.rb +118 -0
- package/lib/ruby/gems/3.4.0/gems/drb-2.2.1/lib/drb/version.rb +3 -0
- package/lib/ruby/gems/3.4.0/gems/drb-2.2.1/lib/drb/weakidconv.rb +59 -0
- package/lib/ruby/gems/3.4.0/gems/drb-2.2.1/lib/drb.rb +3 -0
- package/lib/ruby/gems/3.4.0/gems/erb-4.0.4.1/libexec/erb +164 -0
- package/lib/ruby/gems/3.4.0/gems/getoptlong-0.2.1/Gemfile +4 -0
- package/lib/ruby/gems/3.4.0/gems/getoptlong-0.2.1/LICENSE.txt +22 -0
- package/lib/ruby/gems/3.4.0/gems/getoptlong-0.2.1/README.md +99 -0
- package/lib/ruby/gems/3.4.0/gems/getoptlong-0.2.1/Rakefile +10 -0
- package/lib/ruby/gems/3.4.0/gems/getoptlong-0.2.1/bin/console +7 -0
- package/lib/ruby/gems/3.4.0/gems/getoptlong-0.2.1/bin/setup +6 -0
- package/lib/ruby/gems/3.4.0/gems/getoptlong-0.2.1/lib/getoptlong.rb +867 -0
- package/lib/ruby/gems/3.4.0/gems/getoptlong-0.2.1/sample/getoptlong/abbrev.rb +9 -0
- package/lib/ruby/gems/3.4.0/gems/getoptlong-0.2.1/sample/getoptlong/aliases.rb +8 -0
- package/lib/ruby/gems/3.4.0/gems/getoptlong-0.2.1/sample/getoptlong/argv.rb +12 -0
- package/lib/ruby/gems/3.4.0/gems/getoptlong-0.2.1/sample/getoptlong/each.rb +12 -0
- package/lib/ruby/gems/3.4.0/gems/getoptlong-0.2.1/sample/getoptlong/fibonacci.rb +62 -0
- package/lib/ruby/gems/3.4.0/gems/getoptlong-0.2.1/sample/getoptlong/permute.rb +12 -0
- package/lib/ruby/gems/3.4.0/gems/getoptlong-0.2.1/sample/getoptlong/require_order.rb +13 -0
- package/lib/ruby/gems/3.4.0/gems/getoptlong-0.2.1/sample/getoptlong/return_in_order.rb +13 -0
- package/lib/ruby/gems/3.4.0/gems/getoptlong-0.2.1/sample/getoptlong/simple.rb +7 -0
- package/lib/ruby/gems/3.4.0/gems/getoptlong-0.2.1/sample/getoptlong/types.rb +10 -0
- package/lib/ruby/gems/3.4.0/gems/irb-1.14.3/exe/irb +9 -0
- package/lib/ruby/gems/3.4.0/gems/matrix-0.4.2/LICENSE.txt +22 -0
- package/lib/ruby/gems/3.4.0/gems/matrix-0.4.2/lib/matrix/eigenvalue_decomposition.rb +882 -0
- package/lib/ruby/gems/3.4.0/gems/matrix-0.4.2/lib/matrix/lup_decomposition.rb +219 -0
- package/lib/ruby/gems/3.4.0/gems/matrix-0.4.2/lib/matrix/version.rb +5 -0
- package/lib/ruby/gems/3.4.0/gems/matrix-0.4.2/lib/matrix.rb +2493 -0
- package/lib/ruby/gems/3.4.0/gems/minitest-5.25.4/History.rdoc +1681 -0
- package/lib/ruby/gems/3.4.0/gems/minitest-5.25.4/Manifest.txt +32 -0
- package/lib/ruby/gems/3.4.0/gems/minitest-5.25.4/README.rdoc +835 -0
- package/lib/ruby/gems/3.4.0/gems/minitest-5.25.4/Rakefile +81 -0
- package/lib/ruby/gems/3.4.0/gems/minitest-5.25.4/design_rationale.rb +52 -0
- package/lib/ruby/gems/3.4.0/gems/minitest-5.25.4/lib/hoe/minitest.rb +29 -0
- package/lib/ruby/gems/3.4.0/gems/minitest-5.25.4/lib/minitest/assertions.rb +855 -0
- package/lib/ruby/gems/3.4.0/gems/minitest-5.25.4/lib/minitest/autorun.rb +6 -0
- package/lib/ruby/gems/3.4.0/gems/minitest-5.25.4/lib/minitest/benchmark.rb +452 -0
- package/lib/ruby/gems/3.4.0/gems/minitest-5.25.4/lib/minitest/compress.rb +94 -0
- package/lib/ruby/gems/3.4.0/gems/minitest-5.25.4/lib/minitest/error_on_warning.rb +11 -0
- package/lib/ruby/gems/3.4.0/gems/minitest-5.25.4/lib/minitest/expectations.rb +321 -0
- package/lib/ruby/gems/3.4.0/gems/minitest-5.25.4/lib/minitest/hell.rb +11 -0
- package/lib/ruby/gems/3.4.0/gems/minitest-5.25.4/lib/minitest/manual_plugins.rb +16 -0
- package/lib/ruby/gems/3.4.0/gems/minitest-5.25.4/lib/minitest/mock.rb +347 -0
- package/lib/ruby/gems/3.4.0/gems/minitest-5.25.4/lib/minitest/parallel.rb +70 -0
- package/lib/ruby/gems/3.4.0/gems/minitest-5.25.4/lib/minitest/pride.rb +4 -0
- package/lib/ruby/gems/3.4.0/gems/minitest-5.25.4/lib/minitest/pride_plugin.rb +135 -0
- package/lib/ruby/gems/3.4.0/gems/minitest-5.25.4/lib/minitest/spec.rb +350 -0
- package/lib/ruby/gems/3.4.0/gems/minitest-5.25.4/lib/minitest/test.rb +237 -0
- package/lib/ruby/gems/3.4.0/gems/minitest-5.25.4/lib/minitest/test_task.rb +307 -0
- package/lib/ruby/gems/3.4.0/gems/minitest-5.25.4/lib/minitest/unit.rb +42 -0
- package/lib/ruby/gems/3.4.0/gems/minitest-5.25.4/lib/minitest.rb +1235 -0
- package/lib/ruby/gems/3.4.0/gems/minitest-5.25.4/test/minitest/metametameta.rb +150 -0
- package/lib/ruby/gems/3.4.0/gems/minitest-5.25.4/test/minitest/test_minitest_assertions.rb +1720 -0
- package/lib/ruby/gems/3.4.0/gems/minitest-5.25.4/test/minitest/test_minitest_benchmark.rb +137 -0
- package/lib/ruby/gems/3.4.0/gems/minitest-5.25.4/test/minitest/test_minitest_mock.rb +1218 -0
- package/lib/ruby/gems/3.4.0/gems/minitest-5.25.4/test/minitest/test_minitest_reporter.rb +436 -0
- package/lib/ruby/gems/3.4.0/gems/minitest-5.25.4/test/minitest/test_minitest_spec.rb +1163 -0
- package/lib/ruby/gems/3.4.0/gems/minitest-5.25.4/test/minitest/test_minitest_test.rb +1356 -0
- package/lib/ruby/gems/3.4.0/gems/minitest-5.25.4/test/minitest/test_minitest_test_task.rb +57 -0
- package/lib/ruby/gems/3.4.0/gems/mutex_m-0.3.0/BSDL +22 -0
- package/lib/ruby/gems/3.4.0/gems/mutex_m-0.3.0/COPYING +56 -0
- package/lib/ruby/gems/3.4.0/gems/mutex_m-0.3.0/README.md +62 -0
- package/lib/ruby/gems/3.4.0/gems/mutex_m-0.3.0/lib/mutex_m.rb +121 -0
- package/lib/ruby/gems/3.4.0/gems/mutex_m-0.3.0/sig/mutex_m.rbs +99 -0
- package/lib/ruby/gems/3.4.0/gems/net-ftp-0.3.8/BSDL +22 -0
- package/lib/ruby/gems/3.4.0/gems/net-ftp-0.3.8/COPYING +56 -0
- package/lib/ruby/gems/3.4.0/gems/net-ftp-0.3.8/Gemfile +6 -0
- package/lib/ruby/gems/3.4.0/gems/net-ftp-0.3.8/LICENSE.txt +2 -0
- package/lib/ruby/gems/3.4.0/gems/net-ftp-0.3.8/README.md +56 -0
- package/lib/ruby/gems/3.4.0/gems/net-ftp-0.3.8/Rakefile +10 -0
- package/lib/ruby/gems/3.4.0/gems/net-ftp-0.3.8/lib/net/ftp.rb +1580 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/BSDL +22 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/COPYING +56 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/Gemfile +25 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/LICENSE.txt +65 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/README.md +77 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/Rakefile +13 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/docs/styles.css +85 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/authenticators.rb +37 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/command_data.rb +507 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/config/attr_accessors.rb +75 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/config/attr_inheritance.rb +90 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/config/attr_type_coercion.rb +74 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/config/attr_version_defaults.rb +93 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/config.rb +500 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/connection_state.rb +48 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/data_encoding.rb +214 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/data_lite.rb +226 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/deprecated_client_options.rb +142 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/errors.rb +118 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/esearch_result.rb +219 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/fetch_data.rb +597 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/flags.rb +262 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/response_data.rb +1113 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/response_parser/parser_utils.rb +245 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/response_parser.rb +2282 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/response_reader.rb +92 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/sasl/anonymous_authenticator.rb +69 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/sasl/authentication_exchange.rb +139 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/sasl/authenticators.rb +122 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/sasl/client_adapter.rb +123 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/sasl/cram_md5_authenticator.rb +61 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/sasl/digest_md5_authenticator.rb +342 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/sasl/external_authenticator.rb +83 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/sasl/gs2_header.rb +80 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/sasl/login_authenticator.rb +56 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/sasl/oauthbearer_authenticator.rb +199 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/sasl/plain_authenticator.rb +101 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/sasl/protocol_adapters.rb +101 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/sasl/scram_algorithm.rb +58 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/sasl/scram_authenticator.rb +361 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/sasl/stringprep.rb +12 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/sasl/xoauth2_authenticator.rb +106 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/sasl.rb +182 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/sasl_adapter.rb +20 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/search_result.rb +145 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/sequence_set.rb +1952 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/stringprep/nameprep.rb +70 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/stringprep/saslprep.rb +69 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/stringprep/saslprep_tables.rb +96 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/stringprep/tables.rb +146 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/stringprep/trace.rb +85 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/stringprep.rb +159 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/uidplus_data.rb +244 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap/vanished_data.rb +65 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/lib/net/imap.rb +3968 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/rakelib/benchmarks.rake +91 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/rakelib/rdoc.rake +70 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/rakelib/rfcs.rake +170 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/rakelib/saslprep.rake +30 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/rakelib/string_prep_tables_generator.rb +449 -0
- package/lib/ruby/gems/3.4.0/gems/net-imap-0.5.15/sample/net-imap.rb +167 -0
- package/lib/ruby/gems/3.4.0/gems/net-pop-0.1.2/Gemfile +7 -0
- package/lib/ruby/gems/3.4.0/gems/net-pop-0.1.2/LICENSE.txt +22 -0
- package/lib/ruby/gems/3.4.0/gems/net-pop-0.1.2/README.md +66 -0
- package/lib/ruby/gems/3.4.0/gems/net-pop-0.1.2/Rakefile +17 -0
- package/lib/ruby/gems/3.4.0/gems/net-pop-0.1.2/lib/net/pop.rb +1025 -0
- package/lib/ruby/gems/3.4.0/gems/net-smtp-0.5.1/LICENSE.txt +2 -0
- package/lib/ruby/gems/3.4.0/gems/net-smtp-0.5.1/NEWS.md +133 -0
- package/lib/ruby/gems/3.4.0/gems/net-smtp-0.5.1/README.md +97 -0
- package/lib/ruby/gems/3.4.0/gems/net-smtp-0.5.1/lib/net/smtp/auth_cram_md5.rb +48 -0
- package/lib/ruby/gems/3.4.0/gems/net-smtp-0.5.1/lib/net/smtp/auth_login.rb +11 -0
- package/lib/ruby/gems/3.4.0/gems/net-smtp-0.5.1/lib/net/smtp/auth_plain.rb +9 -0
- package/lib/ruby/gems/3.4.0/gems/net-smtp-0.5.1/lib/net/smtp/auth_xoauth2.rb +17 -0
- package/lib/ruby/gems/3.4.0/gems/net-smtp-0.5.1/lib/net/smtp/authenticator.rb +57 -0
- package/lib/ruby/gems/3.4.0/gems/net-smtp-0.5.1/lib/net/smtp.rb +1164 -0
- package/lib/ruby/gems/3.4.0/gems/observer-0.1.2/Gemfile +9 -0
- package/lib/ruby/gems/3.4.0/gems/observer-0.1.2/LICENSE.txt +22 -0
- package/lib/ruby/gems/3.4.0/gems/observer-0.1.2/README.md +139 -0
- package/lib/ruby/gems/3.4.0/gems/observer-0.1.2/Rakefile +10 -0
- package/lib/ruby/gems/3.4.0/gems/observer-0.1.2/bin/console +14 -0
- package/lib/ruby/gems/3.4.0/gems/observer-0.1.2/bin/setup +8 -0
- package/lib/ruby/gems/3.4.0/gems/observer-0.1.2/lib/observer.rb +229 -0
- package/lib/ruby/gems/3.4.0/gems/power_assert-2.0.5/BSDL +22 -0
- package/lib/ruby/gems/3.4.0/gems/power_assert-2.0.5/COPYING +57 -0
- package/lib/ruby/gems/3.4.0/gems/power_assert-2.0.5/Gemfile +19 -0
- package/lib/ruby/gems/3.4.0/gems/power_assert-2.0.5/LEGAL +4 -0
- package/lib/ruby/gems/3.4.0/gems/power_assert-2.0.5/README.md +98 -0
- package/lib/ruby/gems/3.4.0/gems/power_assert-2.0.5/Rakefile +59 -0
- package/lib/ruby/gems/3.4.0/gems/power_assert-2.0.5/lib/power_assert/colorize.rb +7 -0
- package/lib/ruby/gems/3.4.0/gems/power_assert-2.0.5/lib/power_assert/configuration.rb +46 -0
- package/lib/ruby/gems/3.4.0/gems/power_assert-2.0.5/lib/power_assert/context.rb +233 -0
- package/lib/ruby/gems/3.4.0/gems/power_assert-2.0.5/lib/power_assert/enable_tracepoint_events.rb +62 -0
- package/lib/ruby/gems/3.4.0/gems/power_assert-2.0.5/lib/power_assert/inspector.rb +66 -0
- package/lib/ruby/gems/3.4.0/gems/power_assert-2.0.5/lib/power_assert/parser.rb +251 -0
- package/lib/ruby/gems/3.4.0/gems/power_assert-2.0.5/lib/power_assert/version.rb +3 -0
- package/lib/ruby/gems/3.4.0/gems/power_assert-2.0.5/lib/power_assert.rb +93 -0
- package/lib/ruby/gems/3.4.0/gems/prime-0.1.3/BSDL +22 -0
- package/lib/ruby/gems/3.4.0/gems/prime-0.1.3/COPYING +56 -0
- package/lib/ruby/gems/3.4.0/gems/prime-0.1.3/README.md +49 -0
- package/lib/ruby/gems/3.4.0/gems/prime-0.1.3/Rakefile +10 -0
- package/lib/ruby/gems/3.4.0/gems/prime-0.1.3/lib/prime.rb +561 -0
- package/lib/ruby/gems/3.4.0/gems/prime-0.1.3/sig/integer-extension.rbs +41 -0
- package/lib/ruby/gems/3.4.0/gems/prime-0.1.3/sig/manifest.yaml +2 -0
- package/lib/ruby/gems/3.4.0/gems/prime-0.1.3/sig/prime.rbs +372 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/History.rdoc +2403 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/MIT-LICENSE +21 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/README.rdoc +155 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/doc/command_line_usage.rdoc +158 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/doc/example/Rakefile1 +38 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/doc/example/Rakefile2 +35 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/doc/example/a.c +6 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/doc/example/b.c +6 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/doc/example/main.c +11 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/doc/glossary.rdoc +42 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/doc/jamis.rb +592 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/doc/proto_rake.rdoc +127 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/doc/rake.1 +156 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/doc/rakefile.rdoc +622 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/doc/rational.rdoc +151 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/exe/rake +27 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/application.rb +861 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/backtrace.rb +25 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/clean.rb +78 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/cloneable.rb +17 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/cpu_counter.rb +107 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/default_loader.rb +15 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/dsl_definition.rb +196 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/early_time.rb +22 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/ext/core.rb +26 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/ext/string.rb +176 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/file_creation_task.rb +25 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/file_list.rb +435 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/file_task.rb +58 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/file_utils.rb +132 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/file_utils_ext.rb +134 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/invocation_chain.rb +57 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/invocation_exception_mixin.rb +17 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/late_time.rb +18 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/linked_list.rb +112 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/loaders/makefile.rb +54 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/multi_task.rb +14 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/name_space.rb +38 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/packagetask.rb +222 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/phony.rb +16 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/private_reader.rb +21 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/promise.rb +100 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/pseudo_status.rb +30 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/rake_module.rb +67 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb +27 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/rule_recursion_overflow_error.rb +20 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/scope.rb +43 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/task.rb +434 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/task_argument_error.rb +8 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/task_arguments.rb +109 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/task_manager.rb +331 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/tasklib.rb +12 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/testtask.rb +189 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/thread_history_display.rb +49 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/thread_pool.rb +163 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/trace_output.rb +23 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/version.rb +10 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake/win32.rb +51 -0
- package/lib/ruby/gems/3.4.0/gems/rake-13.2.1/lib/rake.rb +70 -0
- package/lib/ruby/gems/3.4.0/gems/rdoc-6.14.0/exe/rdoc +43 -0
- package/lib/ruby/gems/3.4.0/gems/rdoc-6.14.0/exe/ri +12 -0
- package/lib/ruby/gems/3.4.0/gems/repl_type_completor-0.1.9/Gemfile +27 -0
- package/lib/ruby/gems/3.4.0/gems/repl_type_completor-0.1.9/LICENSE.txt +21 -0
- package/lib/ruby/gems/3.4.0/gems/repl_type_completor-0.1.9/README.md +60 -0
- package/lib/ruby/gems/3.4.0/gems/repl_type_completor-0.1.9/Rakefile +37 -0
- package/lib/ruby/gems/3.4.0/gems/repl_type_completor-0.1.9/lib/repl_type_completor/methods.rb +11 -0
- package/lib/ruby/gems/3.4.0/gems/repl_type_completor-0.1.9/lib/repl_type_completor/require_paths.rb +80 -0
- package/lib/ruby/gems/3.4.0/gems/repl_type_completor-0.1.9/lib/repl_type_completor/result.rb +170 -0
- package/lib/ruby/gems/3.4.0/gems/repl_type_completor-0.1.9/lib/repl_type_completor/scope.rb +409 -0
- package/lib/ruby/gems/3.4.0/gems/repl_type_completor-0.1.9/lib/repl_type_completor/type_analyzer.rb +1190 -0
- package/lib/ruby/gems/3.4.0/gems/repl_type_completor-0.1.9/lib/repl_type_completor/types.rb +452 -0
- package/lib/ruby/gems/3.4.0/gems/repl_type_completor-0.1.9/lib/repl_type_completor/version.rb +5 -0
- package/lib/ruby/gems/3.4.0/gems/repl_type_completor-0.1.9/lib/repl_type_completor.rb +141 -0
- package/lib/ruby/gems/3.4.0/gems/repl_type_completor-0.1.9/sig/repl_type_completor.rbs +19 -0
- package/lib/ruby/gems/3.4.0/gems/resolv-replace-0.1.1/Gemfile +4 -0
- package/lib/ruby/gems/3.4.0/gems/resolv-replace-0.1.1/LICENSE.txt +22 -0
- package/lib/ruby/gems/3.4.0/gems/resolv-replace-0.1.1/README.md +30 -0
- package/lib/ruby/gems/3.4.0/gems/resolv-replace-0.1.1/Rakefile +1 -0
- package/lib/ruby/gems/3.4.0/gems/resolv-replace-0.1.1/bin/console +14 -0
- package/lib/ruby/gems/3.4.0/gems/resolv-replace-0.1.1/bin/setup +8 -0
- package/lib/ruby/gems/3.4.0/gems/resolv-replace-0.1.1/lib/resolv-replace.rb +76 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/LICENSE.txt +22 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/NEWS.md +843 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/README.md +57 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/doc/rexml/context.rdoc +143 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/doc/rexml/tasks/rdoc/child.rdoc +87 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/doc/rexml/tasks/rdoc/document.rdoc +276 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/doc/rexml/tasks/rdoc/element.rdoc +602 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/doc/rexml/tasks/rdoc/node.rdoc +97 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/doc/rexml/tasks/rdoc/parent.rdoc +267 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/doc/rexml/tasks/tocs/child_toc.rdoc +12 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/doc/rexml/tasks/tocs/document_toc.rdoc +30 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/doc/rexml/tasks/tocs/element_toc.rdoc +55 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/doc/rexml/tasks/tocs/master_toc.rdoc +135 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/doc/rexml/tasks/tocs/node_toc.rdoc +16 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/doc/rexml/tasks/tocs/parent_toc.rdoc +25 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/doc/rexml/tutorial.rdoc +1358 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/attlistdecl.rb +63 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/attribute.rb +210 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/cdata.rb +68 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/child.rb +96 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/comment.rb +80 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/doctype.rb +306 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/document.rb +471 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/dtd/attlistdecl.rb +11 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/dtd/dtd.rb +47 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/dtd/elementdecl.rb +18 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/dtd/entitydecl.rb +57 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/dtd/notationdecl.rb +40 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/element.rb +2578 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/encoding.rb +48 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/entity.rb +142 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/formatters/default.rb +116 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/formatters/pretty.rb +142 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/formatters/transitive.rb +58 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/functions.rb +446 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/instruction.rb +79 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/light/node.rb +188 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/namespace.rb +63 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/node.rb +80 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/output.rb +30 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/parent.rb +166 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/parseexception.rb +53 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/parsers/baseparser.rb +949 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/parsers/lightparser.rb +59 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/parsers/pullparser.rb +213 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/parsers/sax2parser.rb +270 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/parsers/streamparser.rb +67 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/parsers/treeparser.rb +89 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/parsers/ultralightparser.rb +57 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/parsers/xpathparser.rb +739 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/quickpath.rb +267 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/rexml.rb +39 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/sax2listener.rb +98 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/security.rb +28 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/source.rb +388 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/streamlistener.rb +93 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/text.rb +420 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/undefinednamespaceexception.rb +9 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/validation/relaxng.rb +540 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/validation/validation.rb +144 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/validation/validationexception.rb +10 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/xmldecl.rb +130 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/xmltokens.rb +85 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/xpath.rb +70 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml/xpath_parser.rb +980 -0
- package/lib/ruby/gems/3.4.0/gems/rexml-3.4.4/lib/rexml.rb +3 -0
- package/lib/ruby/gems/3.4.0/gems/rinda-0.2.0/Gemfile +6 -0
- package/lib/ruby/gems/3.4.0/gems/rinda-0.2.0/LICENSE.txt +22 -0
- package/lib/ruby/gems/3.4.0/gems/rinda-0.2.0/README.md +32 -0
- package/lib/ruby/gems/3.4.0/gems/rinda-0.2.0/Rakefile +9 -0
- package/lib/ruby/gems/3.4.0/gems/rinda-0.2.0/bin/console +14 -0
- package/lib/ruby/gems/3.4.0/gems/rinda-0.2.0/bin/setup +8 -0
- package/lib/ruby/gems/3.4.0/gems/rinda-0.2.0/lib/rinda/rinda.rb +329 -0
- package/lib/ruby/gems/3.4.0/gems/rinda-0.2.0/lib/rinda/ring.rb +484 -0
- package/lib/ruby/gems/3.4.0/gems/rinda-0.2.0/lib/rinda/tuplespace.rb +641 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/LICENSE.txt +22 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/NEWS.md +87 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/README.md +88 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/0.9.rb +462 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/1.0.rb +485 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/2.0.rb +143 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/atom.rb +1025 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/content/1.0.rb +10 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/content/2.0.rb +12 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/content.rb +34 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/converter.rb +171 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/dublincore/1.0.rb +13 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/dublincore/2.0.rb +13 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/dublincore/atom.rb +17 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/dublincore.rb +164 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/image.rb +198 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/itunes.rb +482 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/maker/0.9.rb +509 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/maker/1.0.rb +436 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/maker/2.0.rb +224 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/maker/atom.rb +173 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/maker/base.rb +945 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/maker/content.rb +22 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/maker/dublincore.rb +122 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/maker/entry.rb +164 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/maker/feed.rb +427 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/maker/image.rb +112 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/maker/itunes.rb +258 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/maker/slash.rb +34 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/maker/syndication.rb +19 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/maker/taxonomy.rb +119 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/maker/trackback.rb +62 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/maker.rb +79 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/parser.rb +589 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/rexmlparser.rb +50 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/rss.rb +1370 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/slash.rb +52 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/syndication.rb +69 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/taxonomy.rb +148 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/trackback.rb +291 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/utils.rb +182 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/version.rb +4 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/xml-stylesheet.rb +105 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/xml.rb +73 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/xmlparser.rb +95 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss/xmlscanner.rb +122 -0
- package/lib/ruby/gems/3.4.0/gems/rss-0.3.1/lib/rss.rb +94 -0
- package/lib/ruby/gems/3.4.0/gems/syntax_suggest-2.0.3/exe/syntax_suggest +7 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/BSDL +24 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/COPYING +64 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/PSFL +271 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/README.md +108 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/Rakefile +74 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/doc/text/getting-started.md +246 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/doc/text/how-to.md +90 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/doc/text/news.md +1853 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/assertion-failed-error.rb +60 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/assertions.rb +2541 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/attribute-matcher.rb +26 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/attribute.rb +228 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/auto-runner-loader.rb +17 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/autorunner.rb +629 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/code-snippet-fetcher.rb +58 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/collector/descendant.rb +20 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/collector/dir.rb +110 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/collector/load.rb +201 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/collector/objectspace.rb +35 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/collector/xml.rb +249 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/collector.rb +104 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/color-scheme.rb +225 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/color.rb +134 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/data-sets.rb +127 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/data.rb +371 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/diff.rb +745 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/error.rb +158 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/exception-handler.rb +82 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/failure.rb +169 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/fault-location-detector.rb +104 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/fixture.rb +304 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/notification.rb +138 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/omission.rb +198 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/pending.rb +155 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/priority.rb +194 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/runner/console.rb +86 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/runner/emacs.rb +8 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/runner/xml.rb +15 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/sub-test-result.rb +59 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/test-suite-creator.rb +103 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/test-suite-runner.rb +128 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/test-suite-thread-runner.rb +69 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/testcase.rb +963 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/testresult.rb +132 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/testsuite.rb +108 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/ui/console/outputlevel.rb +15 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/ui/console/testrunner.rb +891 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/ui/emacs/testrunner.rb +49 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/ui/testrunner.rb +53 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/ui/testrunnermediator.rb +119 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/ui/testrunnerutilities.rb +41 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/ui/xml/testrunner.rb +224 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/util/backtracefilter.rb +59 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/util/memory-usage.rb +47 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/util/method-owner-finder.rb +28 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/util/observable.rb +86 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/util/output.rb +32 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/util/procwrapper.rb +48 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/version.rb +5 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit/warning.rb +3 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test/unit.rb +521 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/lib/test-unit.rb +19 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/sample/adder.rb +13 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/sample/subtracter.rb +12 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/sample/test_adder.rb +20 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/sample/test_subtracter.rb +20 -0
- package/lib/ruby/gems/3.4.0/gems/test-unit-3.6.7/sample/test_user.rb +23 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/LICENSE +21 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/README.md +25 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/bin/typeprof +5 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/doc/doc.ja.md +134 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/doc/doc.md +136 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/cli/cli.rb +178 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/cli.rb +5 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/code_range.rb +112 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/core/ast/base.rb +263 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/core/ast/call.rb +259 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/core/ast/const.rb +126 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/core/ast/control.rb +433 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/core/ast/meta.rb +150 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/core/ast/method.rb +339 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/core/ast/misc.rb +263 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/core/ast/module.rb +123 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/core/ast/pattern.rb +140 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/core/ast/sig_decl.rb +471 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/core/ast/sig_type.rb +663 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/core/ast/value.rb +319 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/core/ast/variable.rb +315 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/core/ast.rb +472 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/core/builtin.rb +146 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/core/env/method.rb +137 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/core/env/method_entity.rb +55 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/core/env/module_entity.rb +408 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/core/env/static_read.rb +155 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/core/env/type_alias_entity.rb +27 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/core/env/value_entity.rb +32 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/core/env.rb +366 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/core/graph/box.rb +998 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/core/graph/change_set.rb +224 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/core/graph/filter.rb +155 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/core/graph/vertex.rb +225 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/core/service.rb +514 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/core/type.rb +352 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/core/util.rb +81 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/core.rb +31 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/diagnostic.rb +35 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/lsp/messages.rb +415 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/lsp/server.rb +203 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/lsp/text.rb +69 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/lsp/util.rb +51 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/lsp.rb +7 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof/version.rb +3 -0
- package/lib/ruby/gems/3.4.0/gems/typeprof-0.30.1/lib/typeprof.rb +6 -0
- package/lib/ruby/gems/3.4.0/specifications/abbrev-0.1.2.gemspec +23 -0
- package/lib/ruby/gems/3.4.0/specifications/base64-0.2.0.gemspec +23 -0
- package/lib/ruby/gems/3.4.0/specifications/csv-3.3.2.gemspec +24 -0
- package/lib/ruby/gems/3.4.0/specifications/default/benchmark-0.4.0.gemspec +22 -0
- package/lib/ruby/gems/3.4.0/specifications/default/bundler-2.6.9.gemspec +23 -0
- package/lib/ruby/gems/3.4.0/specifications/default/cgi-0.4.2.gemspec +23 -0
- package/lib/ruby/gems/3.4.0/specifications/default/date-3.4.1.gemspec +23 -0
- package/lib/ruby/gems/3.4.0/specifications/default/delegate-0.4.0.gemspec +21 -0
- package/lib/ruby/gems/3.4.0/specifications/default/did_you_mean-2.0.0.gemspec +20 -0
- package/lib/ruby/gems/3.4.0/specifications/default/digest-3.2.0.gemspec +22 -0
- package/lib/ruby/gems/3.4.0/specifications/default/english-0.8.0.gemspec +21 -0
- package/lib/ruby/gems/3.4.0/specifications/default/erb-4.0.4.1.gemspec +29 -0
- package/lib/ruby/gems/3.4.0/specifications/default/error_highlight-0.7.0.gemspec +20 -0
- package/lib/ruby/gems/3.4.0/specifications/default/etc-1.4.6.gemspec +25 -0
- package/lib/ruby/gems/3.4.0/specifications/default/fcntl-1.2.0.gemspec +24 -0
- package/lib/ruby/gems/3.4.0/specifications/default/fileutils-1.7.3.gemspec +21 -0
- package/lib/ruby/gems/3.4.0/specifications/default/find-0.2.0.gemspec +21 -0
- package/lib/ruby/gems/3.4.0/specifications/default/forwardable-1.3.3.gemspec +21 -0
- package/lib/ruby/gems/3.4.0/specifications/default/io-console-0.8.1.gemspec +23 -0
- package/lib/ruby/gems/3.4.0/specifications/default/io-nonblock-0.3.2.gemspec +23 -0
- package/lib/ruby/gems/3.4.0/specifications/default/io-wait-0.3.2.gemspec +24 -0
- package/lib/ruby/gems/3.4.0/specifications/default/ipaddr-1.2.7.gemspec +20 -0
- package/lib/ruby/gems/3.4.0/specifications/default/irb-1.14.3.gemspec +28 -0
- package/lib/ruby/gems/3.4.0/specifications/default/json-2.9.1.gemspec +23 -0
- package/lib/ruby/gems/3.4.0/specifications/default/logger-1.6.4.gemspec +20 -0
- package/lib/ruby/gems/3.4.0/specifications/default/net-http-0.6.0.gemspec +26 -0
- package/lib/ruby/gems/3.4.0/specifications/default/net-protocol-0.2.2.gemspec +25 -0
- package/lib/ruby/gems/3.4.0/specifications/default/open-uri-0.5.0.gemspec +27 -0
- package/lib/ruby/gems/3.4.0/specifications/default/open3-0.2.1.gemspec +22 -0
- package/lib/ruby/gems/3.4.0/specifications/default/openssl-3.3.3.gemspec +24 -0
- package/lib/ruby/gems/3.4.0/specifications/default/optparse-0.6.0.gemspec +23 -0
- package/lib/ruby/gems/3.4.0/specifications/default/ostruct-0.6.1.gemspec +20 -0
- package/lib/ruby/gems/3.4.0/specifications/default/pathname-0.4.0.gemspec +24 -0
- package/lib/ruby/gems/3.4.0/specifications/default/pp-0.6.2.gemspec +26 -0
- package/lib/ruby/gems/3.4.0/specifications/default/prettyprint-0.2.0.gemspec +22 -0
- package/lib/ruby/gems/3.4.0/specifications/default/prism-1.5.3.gemspec +22 -0
- package/lib/ruby/gems/3.4.0/specifications/default/pstore-0.2.1.gemspec +21 -0
- package/lib/ruby/gems/3.4.0/specifications/default/psych-5.2.2.gemspec +30 -0
- package/lib/ruby/gems/3.4.0/specifications/default/rdoc-6.14.0.gemspec +30 -0
- package/lib/ruby/gems/3.4.0/specifications/default/readline-0.0.4.gemspec +23 -0
- package/lib/ruby/gems/3.4.0/specifications/default/reline-0.6.0.gemspec +25 -0
- package/lib/ruby/gems/3.4.0/specifications/default/resolv-0.7.2.gemspec +24 -0
- package/lib/ruby/gems/3.4.0/specifications/default/ruby2_keywords-0.0.5.gemspec +20 -0
- package/lib/ruby/gems/3.4.0/specifications/default/securerandom-0.4.1.gemspec +22 -0
- package/lib/ruby/gems/3.4.0/specifications/default/set-1.1.1.gemspec +21 -0
- package/lib/ruby/gems/3.4.0/specifications/default/shellwords-0.2.2.gemspec +22 -0
- package/lib/ruby/gems/3.4.0/specifications/default/singleton-0.3.0.gemspec +21 -0
- package/lib/ruby/gems/3.4.0/specifications/default/stringio-3.1.2.gemspec +23 -0
- package/lib/ruby/gems/3.4.0/specifications/default/strscan-3.1.2.gemspec +24 -0
- package/lib/ruby/gems/3.4.0/specifications/default/syntax_suggest-2.0.3.gemspec +23 -0
- package/lib/ruby/gems/3.4.0/specifications/default/tempfile-0.3.1.gemspec +21 -0
- package/lib/ruby/gems/3.4.0/specifications/default/time-0.4.1.gemspec +26 -0
- package/lib/ruby/gems/3.4.0/specifications/default/timeout-0.4.3.gemspec +21 -0
- package/lib/ruby/gems/3.4.0/specifications/default/tmpdir-0.3.1.gemspec +26 -0
- package/lib/ruby/gems/3.4.0/specifications/default/tsort-0.2.0.gemspec +22 -0
- package/lib/ruby/gems/3.4.0/specifications/default/un-0.3.0.gemspec +22 -0
- package/lib/ruby/gems/3.4.0/specifications/default/uri-1.0.4.gemspec +22 -0
- package/lib/ruby/gems/3.4.0/specifications/default/weakref-0.1.3.gemspec +25 -0
- package/lib/ruby/gems/3.4.0/specifications/default/yaml-0.4.0.gemspec +21 -0
- package/lib/ruby/gems/3.4.0/specifications/default/zlib-3.2.3.gemspec +23 -0
- package/lib/ruby/gems/3.4.0/specifications/drb-2.2.1.gemspec +22 -0
- package/lib/ruby/gems/3.4.0/specifications/getoptlong-0.2.1.gemspec +21 -0
- package/lib/ruby/gems/3.4.0/specifications/matrix-0.4.2.gemspec +22 -0
- package/lib/ruby/gems/3.4.0/specifications/minitest-5.25.4.gemspec +31 -0
- package/lib/ruby/gems/3.4.0/specifications/mutex_m-0.3.0.gemspec +22 -0
- package/lib/ruby/gems/3.4.0/specifications/net-ftp-0.3.8.gemspec +27 -0
- package/lib/ruby/gems/3.4.0/specifications/net-imap-0.5.15.gemspec +28 -0
- package/lib/ruby/gems/3.4.0/specifications/net-pop-0.1.2.gemspec +26 -0
- package/lib/ruby/gems/3.4.0/specifications/net-smtp-0.5.1.gemspec +26 -0
- package/lib/ruby/gems/3.4.0/specifications/observer-0.1.2.gemspec +22 -0
- package/lib/ruby/gems/3.4.0/specifications/power_assert-2.0.5.gemspec +24 -0
- package/lib/ruby/gems/3.4.0/specifications/prime-0.1.3.gemspec +27 -0
- package/lib/ruby/gems/3.4.0/specifications/rake-13.2.1.gemspec +26 -0
- package/lib/ruby/gems/3.4.0/specifications/repl_type_completor-0.1.9.gemspec +28 -0
- package/lib/ruby/gems/3.4.0/specifications/resolv-replace-0.1.1.gemspec +26 -0
- package/lib/ruby/gems/3.4.0/specifications/rexml-3.4.4.gemspec +25 -0
- package/lib/ruby/gems/3.4.0/specifications/rinda-0.2.0.gemspec +29 -0
- package/lib/ruby/gems/3.4.0/specifications/rss-0.3.1.gemspec +24 -0
- package/lib/ruby/gems/3.4.0/specifications/test-unit-3.6.7.gemspec +25 -0
- package/lib/ruby/gems/3.4.0/specifications/typeprof-0.30.1.gemspec +28 -0
- package/package.json +47 -4
- package/lib/ruby/3.4.11/wasm32-wasi/rbconfig.rb +0 -366
|
@@ -0,0 +1,2493 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
# frozen_string_literal: false
|
|
3
|
+
#
|
|
4
|
+
# = matrix.rb
|
|
5
|
+
#
|
|
6
|
+
# An implementation of Matrix and Vector classes.
|
|
7
|
+
#
|
|
8
|
+
# See classes Matrix and Vector for documentation.
|
|
9
|
+
#
|
|
10
|
+
# Current Maintainer:: Marc-André Lafortune
|
|
11
|
+
# Original Author:: Keiju ISHITSUKA
|
|
12
|
+
# Original Documentation:: Gavin Sinclair (sourced from <i>Ruby in a Nutshell</i> (Matsumoto, O'Reilly))
|
|
13
|
+
##
|
|
14
|
+
|
|
15
|
+
require_relative "matrix/version"
|
|
16
|
+
|
|
17
|
+
module ExceptionForMatrix # :nodoc:
|
|
18
|
+
class ErrDimensionMismatch < StandardError
|
|
19
|
+
def initialize(val = nil)
|
|
20
|
+
if val
|
|
21
|
+
super(val)
|
|
22
|
+
else
|
|
23
|
+
super("Dimension mismatch")
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
class ErrNotRegular < StandardError
|
|
29
|
+
def initialize(val = nil)
|
|
30
|
+
if val
|
|
31
|
+
super(val)
|
|
32
|
+
else
|
|
33
|
+
super("Not Regular Matrix")
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
class ErrOperationNotDefined < StandardError
|
|
39
|
+
def initialize(vals)
|
|
40
|
+
if vals.is_a?(Array)
|
|
41
|
+
super("Operation(#{vals[0]}) can't be defined: #{vals[1]} op #{vals[2]}")
|
|
42
|
+
else
|
|
43
|
+
super(vals)
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
class ErrOperationNotImplemented < StandardError
|
|
49
|
+
def initialize(vals)
|
|
50
|
+
super("Sorry, Operation(#{vals[0]}) not implemented: #{vals[1]} op #{vals[2]}")
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
#
|
|
56
|
+
# The +Matrix+ class represents a mathematical matrix. It provides methods for creating
|
|
57
|
+
# matrices, operating on them arithmetically and algebraically,
|
|
58
|
+
# and determining their mathematical properties such as trace, rank, inverse, determinant,
|
|
59
|
+
# or eigensystem.
|
|
60
|
+
#
|
|
61
|
+
class Matrix
|
|
62
|
+
include Enumerable
|
|
63
|
+
include ExceptionForMatrix
|
|
64
|
+
autoload :EigenvalueDecomposition, "matrix/eigenvalue_decomposition"
|
|
65
|
+
autoload :LUPDecomposition, "matrix/lup_decomposition"
|
|
66
|
+
|
|
67
|
+
# instance creations
|
|
68
|
+
private_class_method :new
|
|
69
|
+
attr_reader :rows
|
|
70
|
+
protected :rows
|
|
71
|
+
|
|
72
|
+
#
|
|
73
|
+
# Creates a matrix where each argument is a row.
|
|
74
|
+
# Matrix[ [25, 93], [-1, 66] ]
|
|
75
|
+
# # => 25 93
|
|
76
|
+
# # -1 66
|
|
77
|
+
#
|
|
78
|
+
def Matrix.[](*rows)
|
|
79
|
+
rows(rows, false)
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
#
|
|
83
|
+
# Creates a matrix where +rows+ is an array of arrays, each of which is a row
|
|
84
|
+
# of the matrix. If the optional argument +copy+ is false, use the given
|
|
85
|
+
# arrays as the internal structure of the matrix without copying.
|
|
86
|
+
# Matrix.rows([[25, 93], [-1, 66]])
|
|
87
|
+
# # => 25 93
|
|
88
|
+
# # -1 66
|
|
89
|
+
#
|
|
90
|
+
def Matrix.rows(rows, copy = true)
|
|
91
|
+
rows = convert_to_array(rows, copy)
|
|
92
|
+
rows.map! do |row|
|
|
93
|
+
convert_to_array(row, copy)
|
|
94
|
+
end
|
|
95
|
+
size = (rows[0] || []).size
|
|
96
|
+
rows.each do |row|
|
|
97
|
+
raise ErrDimensionMismatch, "row size differs (#{row.size} should be #{size})" unless row.size == size
|
|
98
|
+
end
|
|
99
|
+
new rows, size
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
#
|
|
103
|
+
# Creates a matrix using +columns+ as an array of column vectors.
|
|
104
|
+
# Matrix.columns([[25, 93], [-1, 66]])
|
|
105
|
+
# # => 25 -1
|
|
106
|
+
# # 93 66
|
|
107
|
+
#
|
|
108
|
+
def Matrix.columns(columns)
|
|
109
|
+
rows(columns, false).transpose
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
#
|
|
113
|
+
# Creates a matrix of size +row_count+ x +column_count+.
|
|
114
|
+
# It fills the values by calling the given block,
|
|
115
|
+
# passing the current row and column.
|
|
116
|
+
# Returns an enumerator if no block is given.
|
|
117
|
+
#
|
|
118
|
+
# m = Matrix.build(2, 4) {|row, col| col - row }
|
|
119
|
+
# # => Matrix[[0, 1, 2, 3], [-1, 0, 1, 2]]
|
|
120
|
+
# m = Matrix.build(3) { rand }
|
|
121
|
+
# # => a 3x3 matrix with random elements
|
|
122
|
+
#
|
|
123
|
+
def Matrix.build(row_count, column_count = row_count)
|
|
124
|
+
row_count = CoercionHelper.coerce_to_int(row_count)
|
|
125
|
+
column_count = CoercionHelper.coerce_to_int(column_count)
|
|
126
|
+
raise ArgumentError if row_count < 0 || column_count < 0
|
|
127
|
+
return to_enum :build, row_count, column_count unless block_given?
|
|
128
|
+
rows = Array.new(row_count) do |i|
|
|
129
|
+
Array.new(column_count) do |j|
|
|
130
|
+
yield i, j
|
|
131
|
+
end
|
|
132
|
+
end
|
|
133
|
+
new rows, column_count
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
#
|
|
137
|
+
# Creates a matrix where the diagonal elements are composed of +values+.
|
|
138
|
+
# Matrix.diagonal(9, 5, -3)
|
|
139
|
+
# # => 9 0 0
|
|
140
|
+
# # 0 5 0
|
|
141
|
+
# # 0 0 -3
|
|
142
|
+
#
|
|
143
|
+
def Matrix.diagonal(*values)
|
|
144
|
+
size = values.size
|
|
145
|
+
return Matrix.empty if size == 0
|
|
146
|
+
rows = Array.new(size) {|j|
|
|
147
|
+
row = Array.new(size, 0)
|
|
148
|
+
row[j] = values[j]
|
|
149
|
+
row
|
|
150
|
+
}
|
|
151
|
+
new rows
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
#
|
|
155
|
+
# Creates an +n+ by +n+ diagonal matrix where each diagonal element is
|
|
156
|
+
# +value+.
|
|
157
|
+
# Matrix.scalar(2, 5)
|
|
158
|
+
# # => 5 0
|
|
159
|
+
# # 0 5
|
|
160
|
+
#
|
|
161
|
+
def Matrix.scalar(n, value)
|
|
162
|
+
diagonal(*Array.new(n, value))
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
#
|
|
166
|
+
# Creates an +n+ by +n+ identity matrix.
|
|
167
|
+
# Matrix.identity(2)
|
|
168
|
+
# # => 1 0
|
|
169
|
+
# # 0 1
|
|
170
|
+
#
|
|
171
|
+
def Matrix.identity(n)
|
|
172
|
+
scalar(n, 1)
|
|
173
|
+
end
|
|
174
|
+
class << Matrix
|
|
175
|
+
alias_method :unit, :identity
|
|
176
|
+
alias_method :I, :identity
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
#
|
|
180
|
+
# Creates a zero matrix.
|
|
181
|
+
# Matrix.zero(2)
|
|
182
|
+
# # => 0 0
|
|
183
|
+
# # 0 0
|
|
184
|
+
#
|
|
185
|
+
def Matrix.zero(row_count, column_count = row_count)
|
|
186
|
+
rows = Array.new(row_count){Array.new(column_count, 0)}
|
|
187
|
+
new rows, column_count
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
#
|
|
191
|
+
# Creates a single-row matrix where the values of that row are as given in
|
|
192
|
+
# +row+.
|
|
193
|
+
# Matrix.row_vector([4,5,6])
|
|
194
|
+
# # => 4 5 6
|
|
195
|
+
#
|
|
196
|
+
def Matrix.row_vector(row)
|
|
197
|
+
row = convert_to_array(row)
|
|
198
|
+
new [row]
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
#
|
|
202
|
+
# Creates a single-column matrix where the values of that column are as given
|
|
203
|
+
# in +column+.
|
|
204
|
+
# Matrix.column_vector([4,5,6])
|
|
205
|
+
# # => 4
|
|
206
|
+
# # 5
|
|
207
|
+
# # 6
|
|
208
|
+
#
|
|
209
|
+
def Matrix.column_vector(column)
|
|
210
|
+
column = convert_to_array(column)
|
|
211
|
+
new [column].transpose, 1
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
#
|
|
215
|
+
# Creates a empty matrix of +row_count+ x +column_count+.
|
|
216
|
+
# At least one of +row_count+ or +column_count+ must be 0.
|
|
217
|
+
#
|
|
218
|
+
# m = Matrix.empty(2, 0)
|
|
219
|
+
# m == Matrix[ [], [] ]
|
|
220
|
+
# # => true
|
|
221
|
+
# n = Matrix.empty(0, 3)
|
|
222
|
+
# n == Matrix.columns([ [], [], [] ])
|
|
223
|
+
# # => true
|
|
224
|
+
# m * n
|
|
225
|
+
# # => Matrix[[0, 0, 0], [0, 0, 0]]
|
|
226
|
+
#
|
|
227
|
+
def Matrix.empty(row_count = 0, column_count = 0)
|
|
228
|
+
raise ArgumentError, "One size must be 0" if column_count != 0 && row_count != 0
|
|
229
|
+
raise ArgumentError, "Negative size" if column_count < 0 || row_count < 0
|
|
230
|
+
|
|
231
|
+
new([[]]*row_count, column_count)
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
#
|
|
235
|
+
# Create a matrix by stacking matrices vertically
|
|
236
|
+
#
|
|
237
|
+
# x = Matrix[[1, 2], [3, 4]]
|
|
238
|
+
# y = Matrix[[5, 6], [7, 8]]
|
|
239
|
+
# Matrix.vstack(x, y) # => Matrix[[1, 2], [3, 4], [5, 6], [7, 8]]
|
|
240
|
+
#
|
|
241
|
+
def Matrix.vstack(x, *matrices)
|
|
242
|
+
x = CoercionHelper.coerce_to_matrix(x)
|
|
243
|
+
result = x.send(:rows).map(&:dup)
|
|
244
|
+
matrices.each do |m|
|
|
245
|
+
m = CoercionHelper.coerce_to_matrix(m)
|
|
246
|
+
if m.column_count != x.column_count
|
|
247
|
+
raise ErrDimensionMismatch, "The given matrices must have #{x.column_count} columns, but one has #{m.column_count}"
|
|
248
|
+
end
|
|
249
|
+
result.concat(m.send(:rows))
|
|
250
|
+
end
|
|
251
|
+
new result, x.column_count
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
#
|
|
256
|
+
# Create a matrix by stacking matrices horizontally
|
|
257
|
+
#
|
|
258
|
+
# x = Matrix[[1, 2], [3, 4]]
|
|
259
|
+
# y = Matrix[[5, 6], [7, 8]]
|
|
260
|
+
# Matrix.hstack(x, y) # => Matrix[[1, 2, 5, 6], [3, 4, 7, 8]]
|
|
261
|
+
#
|
|
262
|
+
def Matrix.hstack(x, *matrices)
|
|
263
|
+
x = CoercionHelper.coerce_to_matrix(x)
|
|
264
|
+
result = x.send(:rows).map(&:dup)
|
|
265
|
+
total_column_count = x.column_count
|
|
266
|
+
matrices.each do |m|
|
|
267
|
+
m = CoercionHelper.coerce_to_matrix(m)
|
|
268
|
+
if m.row_count != x.row_count
|
|
269
|
+
raise ErrDimensionMismatch, "The given matrices must have #{x.row_count} rows, but one has #{m.row_count}"
|
|
270
|
+
end
|
|
271
|
+
result.each_with_index do |row, i|
|
|
272
|
+
row.concat m.send(:rows)[i]
|
|
273
|
+
end
|
|
274
|
+
total_column_count += m.column_count
|
|
275
|
+
end
|
|
276
|
+
new result, total_column_count
|
|
277
|
+
end
|
|
278
|
+
|
|
279
|
+
# :call-seq:
|
|
280
|
+
# Matrix.combine(*matrices) { |*elements| ... }
|
|
281
|
+
#
|
|
282
|
+
# Create a matrix by combining matrices entrywise, using the given block
|
|
283
|
+
#
|
|
284
|
+
# x = Matrix[[6, 6], [4, 4]]
|
|
285
|
+
# y = Matrix[[1, 2], [3, 4]]
|
|
286
|
+
# Matrix.combine(x, y) {|a, b| a - b} # => Matrix[[5, 4], [1, 0]]
|
|
287
|
+
#
|
|
288
|
+
def Matrix.combine(*matrices)
|
|
289
|
+
return to_enum(__method__, *matrices) unless block_given?
|
|
290
|
+
|
|
291
|
+
return Matrix.empty if matrices.empty?
|
|
292
|
+
matrices.map!(&CoercionHelper.method(:coerce_to_matrix))
|
|
293
|
+
x = matrices.first
|
|
294
|
+
matrices.each do |m|
|
|
295
|
+
raise ErrDimensionMismatch unless x.row_count == m.row_count && x.column_count == m.column_count
|
|
296
|
+
end
|
|
297
|
+
|
|
298
|
+
rows = Array.new(x.row_count) do |i|
|
|
299
|
+
Array.new(x.column_count) do |j|
|
|
300
|
+
yield matrices.map{|m| m[i,j]}
|
|
301
|
+
end
|
|
302
|
+
end
|
|
303
|
+
new rows, x.column_count
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
# :call-seq:
|
|
307
|
+
# combine(*other_matrices) { |*elements| ... }
|
|
308
|
+
#
|
|
309
|
+
# Creates new matrix by combining with <i>other_matrices</i> entrywise,
|
|
310
|
+
# using the given block.
|
|
311
|
+
#
|
|
312
|
+
# x = Matrix[[6, 6], [4, 4]]
|
|
313
|
+
# y = Matrix[[1, 2], [3, 4]]
|
|
314
|
+
# x.combine(y) {|a, b| a - b} # => Matrix[[5, 4], [1, 0]]
|
|
315
|
+
def combine(*matrices, &block)
|
|
316
|
+
Matrix.combine(self, *matrices, &block)
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
#
|
|
320
|
+
# Matrix.new is private; use ::rows, ::columns, ::[], etc... to create.
|
|
321
|
+
#
|
|
322
|
+
def initialize(rows, column_count = rows[0].size)
|
|
323
|
+
# No checking is done at this point. rows must be an Array of Arrays.
|
|
324
|
+
# column_count must be the size of the first row, if there is one,
|
|
325
|
+
# otherwise it *must* be specified and can be any integer >= 0
|
|
326
|
+
@rows = rows
|
|
327
|
+
@column_count = column_count
|
|
328
|
+
end
|
|
329
|
+
|
|
330
|
+
private def new_matrix(rows, column_count = rows[0].size) # :nodoc:
|
|
331
|
+
self.class.send(:new, rows, column_count) # bypass privacy of Matrix.new
|
|
332
|
+
end
|
|
333
|
+
|
|
334
|
+
#
|
|
335
|
+
# Returns element (+i+,+j+) of the matrix. That is: row +i+, column +j+.
|
|
336
|
+
#
|
|
337
|
+
def [](i, j)
|
|
338
|
+
@rows.fetch(i){return nil}[j]
|
|
339
|
+
end
|
|
340
|
+
alias element []
|
|
341
|
+
alias component []
|
|
342
|
+
|
|
343
|
+
#
|
|
344
|
+
# :call-seq:
|
|
345
|
+
# matrix[range, range] = matrix/element
|
|
346
|
+
# matrix[range, integer] = vector/column_matrix/element
|
|
347
|
+
# matrix[integer, range] = vector/row_matrix/element
|
|
348
|
+
# matrix[integer, integer] = element
|
|
349
|
+
#
|
|
350
|
+
# Set element or elements of matrix.
|
|
351
|
+
def []=(i, j, v)
|
|
352
|
+
raise FrozenError, "can't modify frozen Matrix" if frozen?
|
|
353
|
+
rows = check_range(i, :row) or row = check_int(i, :row)
|
|
354
|
+
columns = check_range(j, :column) or column = check_int(j, :column)
|
|
355
|
+
if rows && columns
|
|
356
|
+
set_row_and_col_range(rows, columns, v)
|
|
357
|
+
elsif rows
|
|
358
|
+
set_row_range(rows, column, v)
|
|
359
|
+
elsif columns
|
|
360
|
+
set_col_range(row, columns, v)
|
|
361
|
+
else
|
|
362
|
+
set_value(row, column, v)
|
|
363
|
+
end
|
|
364
|
+
end
|
|
365
|
+
alias set_element []=
|
|
366
|
+
alias set_component []=
|
|
367
|
+
private :set_element, :set_component
|
|
368
|
+
|
|
369
|
+
# Returns range or nil
|
|
370
|
+
private def check_range(val, direction)
|
|
371
|
+
return unless val.is_a?(Range)
|
|
372
|
+
count = direction == :row ? row_count : column_count
|
|
373
|
+
CoercionHelper.check_range(val, count, direction)
|
|
374
|
+
end
|
|
375
|
+
|
|
376
|
+
private def check_int(val, direction)
|
|
377
|
+
count = direction == :row ? row_count : column_count
|
|
378
|
+
CoercionHelper.check_int(val, count, direction)
|
|
379
|
+
end
|
|
380
|
+
|
|
381
|
+
private def set_value(row, col, value)
|
|
382
|
+
raise ErrDimensionMismatch, "Expected a value, got a #{value.class}" if value.respond_to?(:to_matrix)
|
|
383
|
+
|
|
384
|
+
@rows[row][col] = value
|
|
385
|
+
end
|
|
386
|
+
|
|
387
|
+
private def set_row_and_col_range(row_range, col_range, value)
|
|
388
|
+
if value.is_a?(Matrix)
|
|
389
|
+
if row_range.size != value.row_count || col_range.size != value.column_count
|
|
390
|
+
raise ErrDimensionMismatch, [
|
|
391
|
+
'Expected a Matrix of dimensions',
|
|
392
|
+
"#{row_range.size}x#{col_range.size}",
|
|
393
|
+
'got',
|
|
394
|
+
"#{value.row_count}x#{value.column_count}",
|
|
395
|
+
].join(' ')
|
|
396
|
+
end
|
|
397
|
+
source = value.instance_variable_get :@rows
|
|
398
|
+
row_range.each_with_index do |row, i|
|
|
399
|
+
@rows[row][col_range] = source[i]
|
|
400
|
+
end
|
|
401
|
+
elsif value.is_a?(Vector)
|
|
402
|
+
raise ErrDimensionMismatch, 'Expected a Matrix or a value, got a Vector'
|
|
403
|
+
else
|
|
404
|
+
value_to_set = Array.new(col_range.size, value)
|
|
405
|
+
row_range.each do |i|
|
|
406
|
+
@rows[i][col_range] = value_to_set
|
|
407
|
+
end
|
|
408
|
+
end
|
|
409
|
+
end
|
|
410
|
+
|
|
411
|
+
private def set_row_range(row_range, col, value)
|
|
412
|
+
if value.is_a?(Vector)
|
|
413
|
+
raise ErrDimensionMismatch unless row_range.size == value.size
|
|
414
|
+
set_column_vector(row_range, col, value)
|
|
415
|
+
elsif value.is_a?(Matrix)
|
|
416
|
+
raise ErrDimensionMismatch unless value.column_count == 1
|
|
417
|
+
value = value.column(0)
|
|
418
|
+
raise ErrDimensionMismatch unless row_range.size == value.size
|
|
419
|
+
set_column_vector(row_range, col, value)
|
|
420
|
+
else
|
|
421
|
+
@rows[row_range].each{|e| e[col] = value }
|
|
422
|
+
end
|
|
423
|
+
end
|
|
424
|
+
|
|
425
|
+
private def set_column_vector(row_range, col, value)
|
|
426
|
+
value.each_with_index do |e, index|
|
|
427
|
+
r = row_range.begin + index
|
|
428
|
+
@rows[r][col] = e
|
|
429
|
+
end
|
|
430
|
+
end
|
|
431
|
+
|
|
432
|
+
private def set_col_range(row, col_range, value)
|
|
433
|
+
value = if value.is_a?(Vector)
|
|
434
|
+
value.to_a
|
|
435
|
+
elsif value.is_a?(Matrix)
|
|
436
|
+
raise ErrDimensionMismatch unless value.row_count == 1
|
|
437
|
+
value.row(0).to_a
|
|
438
|
+
else
|
|
439
|
+
Array.new(col_range.size, value)
|
|
440
|
+
end
|
|
441
|
+
raise ErrDimensionMismatch unless col_range.size == value.size
|
|
442
|
+
@rows[row][col_range] = value
|
|
443
|
+
end
|
|
444
|
+
|
|
445
|
+
#
|
|
446
|
+
# Returns the number of rows.
|
|
447
|
+
#
|
|
448
|
+
def row_count
|
|
449
|
+
@rows.size
|
|
450
|
+
end
|
|
451
|
+
|
|
452
|
+
alias_method :row_size, :row_count
|
|
453
|
+
#
|
|
454
|
+
# Returns the number of columns.
|
|
455
|
+
#
|
|
456
|
+
attr_reader :column_count
|
|
457
|
+
alias_method :column_size, :column_count
|
|
458
|
+
|
|
459
|
+
#
|
|
460
|
+
# Returns row vector number +i+ of the matrix as a Vector (starting at 0 like
|
|
461
|
+
# an array). When a block is given, the elements of that vector are iterated.
|
|
462
|
+
#
|
|
463
|
+
def row(i, &block) # :yield: e
|
|
464
|
+
if block_given?
|
|
465
|
+
@rows.fetch(i){return self}.each(&block)
|
|
466
|
+
self
|
|
467
|
+
else
|
|
468
|
+
Vector.elements(@rows.fetch(i){return nil})
|
|
469
|
+
end
|
|
470
|
+
end
|
|
471
|
+
|
|
472
|
+
#
|
|
473
|
+
# Returns column vector number +j+ of the matrix as a Vector (starting at 0
|
|
474
|
+
# like an array). When a block is given, the elements of that vector are
|
|
475
|
+
# iterated.
|
|
476
|
+
#
|
|
477
|
+
def column(j) # :yield: e
|
|
478
|
+
if block_given?
|
|
479
|
+
return self if j >= column_count || j < -column_count
|
|
480
|
+
row_count.times do |i|
|
|
481
|
+
yield @rows[i][j]
|
|
482
|
+
end
|
|
483
|
+
self
|
|
484
|
+
else
|
|
485
|
+
return nil if j >= column_count || j < -column_count
|
|
486
|
+
col = Array.new(row_count) {|i|
|
|
487
|
+
@rows[i][j]
|
|
488
|
+
}
|
|
489
|
+
Vector.elements(col, false)
|
|
490
|
+
end
|
|
491
|
+
end
|
|
492
|
+
|
|
493
|
+
#
|
|
494
|
+
# Returns a matrix that is the result of iteration of the given block over all
|
|
495
|
+
# elements of the matrix.
|
|
496
|
+
# Elements can be restricted by passing an argument:
|
|
497
|
+
# * :all (default): yields all elements
|
|
498
|
+
# * :diagonal: yields only elements on the diagonal
|
|
499
|
+
# * :off_diagonal: yields all elements except on the diagonal
|
|
500
|
+
# * :lower: yields only elements on or below the diagonal
|
|
501
|
+
# * :strict_lower: yields only elements below the diagonal
|
|
502
|
+
# * :strict_upper: yields only elements above the diagonal
|
|
503
|
+
# * :upper: yields only elements on or above the diagonal
|
|
504
|
+
# Matrix[ [1,2], [3,4] ].collect { |e| e**2 }
|
|
505
|
+
# # => 1 4
|
|
506
|
+
# # 9 16
|
|
507
|
+
#
|
|
508
|
+
def collect(which = :all, &block) # :yield: e
|
|
509
|
+
return to_enum(:collect, which) unless block_given?
|
|
510
|
+
dup.collect!(which, &block)
|
|
511
|
+
end
|
|
512
|
+
alias_method :map, :collect
|
|
513
|
+
|
|
514
|
+
#
|
|
515
|
+
# Invokes the given block for each element of matrix, replacing the element with the value
|
|
516
|
+
# returned by the block.
|
|
517
|
+
# Elements can be restricted by passing an argument:
|
|
518
|
+
# * :all (default): yields all elements
|
|
519
|
+
# * :diagonal: yields only elements on the diagonal
|
|
520
|
+
# * :off_diagonal: yields all elements except on the diagonal
|
|
521
|
+
# * :lower: yields only elements on or below the diagonal
|
|
522
|
+
# * :strict_lower: yields only elements below the diagonal
|
|
523
|
+
# * :strict_upper: yields only elements above the diagonal
|
|
524
|
+
# * :upper: yields only elements on or above the diagonal
|
|
525
|
+
#
|
|
526
|
+
def collect!(which = :all)
|
|
527
|
+
return to_enum(:collect!, which) unless block_given?
|
|
528
|
+
raise FrozenError, "can't modify frozen Matrix" if frozen?
|
|
529
|
+
each_with_index(which){ |e, row_index, col_index| @rows[row_index][col_index] = yield e }
|
|
530
|
+
end
|
|
531
|
+
|
|
532
|
+
alias map! collect!
|
|
533
|
+
|
|
534
|
+
def freeze
|
|
535
|
+
@rows.each(&:freeze).freeze
|
|
536
|
+
|
|
537
|
+
super
|
|
538
|
+
end
|
|
539
|
+
|
|
540
|
+
#
|
|
541
|
+
# Yields all elements of the matrix, starting with those of the first row,
|
|
542
|
+
# or returns an Enumerator if no block given.
|
|
543
|
+
# Elements can be restricted by passing an argument:
|
|
544
|
+
# * :all (default): yields all elements
|
|
545
|
+
# * :diagonal: yields only elements on the diagonal
|
|
546
|
+
# * :off_diagonal: yields all elements except on the diagonal
|
|
547
|
+
# * :lower: yields only elements on or below the diagonal
|
|
548
|
+
# * :strict_lower: yields only elements below the diagonal
|
|
549
|
+
# * :strict_upper: yields only elements above the diagonal
|
|
550
|
+
# * :upper: yields only elements on or above the diagonal
|
|
551
|
+
#
|
|
552
|
+
# Matrix[ [1,2], [3,4] ].each { |e| puts e }
|
|
553
|
+
# # => prints the numbers 1 to 4
|
|
554
|
+
# Matrix[ [1,2], [3,4] ].each(:strict_lower).to_a # => [3]
|
|
555
|
+
#
|
|
556
|
+
def each(which = :all, &block) # :yield: e
|
|
557
|
+
return to_enum :each, which unless block_given?
|
|
558
|
+
last = column_count - 1
|
|
559
|
+
case which
|
|
560
|
+
when :all
|
|
561
|
+
@rows.each do |row|
|
|
562
|
+
row.each(&block)
|
|
563
|
+
end
|
|
564
|
+
when :diagonal
|
|
565
|
+
@rows.each_with_index do |row, row_index|
|
|
566
|
+
yield row.fetch(row_index){return self}
|
|
567
|
+
end
|
|
568
|
+
when :off_diagonal
|
|
569
|
+
@rows.each_with_index do |row, row_index|
|
|
570
|
+
column_count.times do |col_index|
|
|
571
|
+
yield row[col_index] unless row_index == col_index
|
|
572
|
+
end
|
|
573
|
+
end
|
|
574
|
+
when :lower
|
|
575
|
+
@rows.each_with_index do |row, row_index|
|
|
576
|
+
0.upto([row_index, last].min) do |col_index|
|
|
577
|
+
yield row[col_index]
|
|
578
|
+
end
|
|
579
|
+
end
|
|
580
|
+
when :strict_lower
|
|
581
|
+
@rows.each_with_index do |row, row_index|
|
|
582
|
+
[row_index, column_count].min.times do |col_index|
|
|
583
|
+
yield row[col_index]
|
|
584
|
+
end
|
|
585
|
+
end
|
|
586
|
+
when :strict_upper
|
|
587
|
+
@rows.each_with_index do |row, row_index|
|
|
588
|
+
(row_index+1).upto(last) do |col_index|
|
|
589
|
+
yield row[col_index]
|
|
590
|
+
end
|
|
591
|
+
end
|
|
592
|
+
when :upper
|
|
593
|
+
@rows.each_with_index do |row, row_index|
|
|
594
|
+
row_index.upto(last) do |col_index|
|
|
595
|
+
yield row[col_index]
|
|
596
|
+
end
|
|
597
|
+
end
|
|
598
|
+
else
|
|
599
|
+
raise ArgumentError, "expected #{which.inspect} to be one of :all, :diagonal, :off_diagonal, :lower, :strict_lower, :strict_upper or :upper"
|
|
600
|
+
end
|
|
601
|
+
self
|
|
602
|
+
end
|
|
603
|
+
|
|
604
|
+
#
|
|
605
|
+
# Same as #each, but the row index and column index in addition to the element
|
|
606
|
+
#
|
|
607
|
+
# Matrix[ [1,2], [3,4] ].each_with_index do |e, row, col|
|
|
608
|
+
# puts "#{e} at #{row}, #{col}"
|
|
609
|
+
# end
|
|
610
|
+
# # => Prints:
|
|
611
|
+
# # 1 at 0, 0
|
|
612
|
+
# # 2 at 0, 1
|
|
613
|
+
# # 3 at 1, 0
|
|
614
|
+
# # 4 at 1, 1
|
|
615
|
+
#
|
|
616
|
+
def each_with_index(which = :all) # :yield: e, row, column
|
|
617
|
+
return to_enum :each_with_index, which unless block_given?
|
|
618
|
+
last = column_count - 1
|
|
619
|
+
case which
|
|
620
|
+
when :all
|
|
621
|
+
@rows.each_with_index do |row, row_index|
|
|
622
|
+
row.each_with_index do |e, col_index|
|
|
623
|
+
yield e, row_index, col_index
|
|
624
|
+
end
|
|
625
|
+
end
|
|
626
|
+
when :diagonal
|
|
627
|
+
@rows.each_with_index do |row, row_index|
|
|
628
|
+
yield row.fetch(row_index){return self}, row_index, row_index
|
|
629
|
+
end
|
|
630
|
+
when :off_diagonal
|
|
631
|
+
@rows.each_with_index do |row, row_index|
|
|
632
|
+
column_count.times do |col_index|
|
|
633
|
+
yield row[col_index], row_index, col_index unless row_index == col_index
|
|
634
|
+
end
|
|
635
|
+
end
|
|
636
|
+
when :lower
|
|
637
|
+
@rows.each_with_index do |row, row_index|
|
|
638
|
+
0.upto([row_index, last].min) do |col_index|
|
|
639
|
+
yield row[col_index], row_index, col_index
|
|
640
|
+
end
|
|
641
|
+
end
|
|
642
|
+
when :strict_lower
|
|
643
|
+
@rows.each_with_index do |row, row_index|
|
|
644
|
+
[row_index, column_count].min.times do |col_index|
|
|
645
|
+
yield row[col_index], row_index, col_index
|
|
646
|
+
end
|
|
647
|
+
end
|
|
648
|
+
when :strict_upper
|
|
649
|
+
@rows.each_with_index do |row, row_index|
|
|
650
|
+
(row_index+1).upto(last) do |col_index|
|
|
651
|
+
yield row[col_index], row_index, col_index
|
|
652
|
+
end
|
|
653
|
+
end
|
|
654
|
+
when :upper
|
|
655
|
+
@rows.each_with_index do |row, row_index|
|
|
656
|
+
row_index.upto(last) do |col_index|
|
|
657
|
+
yield row[col_index], row_index, col_index
|
|
658
|
+
end
|
|
659
|
+
end
|
|
660
|
+
else
|
|
661
|
+
raise ArgumentError, "expected #{which.inspect} to be one of :all, :diagonal, :off_diagonal, :lower, :strict_lower, :strict_upper or :upper"
|
|
662
|
+
end
|
|
663
|
+
self
|
|
664
|
+
end
|
|
665
|
+
|
|
666
|
+
SELECTORS = {all: true, diagonal: true, off_diagonal: true, lower: true, strict_lower: true, strict_upper: true, upper: true}.freeze
|
|
667
|
+
#
|
|
668
|
+
# :call-seq:
|
|
669
|
+
# index(value, selector = :all) -> [row, column]
|
|
670
|
+
# index(selector = :all){ block } -> [row, column]
|
|
671
|
+
# index(selector = :all) -> an_enumerator
|
|
672
|
+
#
|
|
673
|
+
# The index method is specialized to return the index as [row, column]
|
|
674
|
+
# It also accepts an optional +selector+ argument, see #each for details.
|
|
675
|
+
#
|
|
676
|
+
# Matrix[ [1,2], [3,4] ].index(&:even?) # => [0, 1]
|
|
677
|
+
# Matrix[ [1,1], [1,1] ].index(1, :strict_lower) # => [1, 0]
|
|
678
|
+
#
|
|
679
|
+
def index(*args)
|
|
680
|
+
raise ArgumentError, "wrong number of arguments(#{args.size} for 0-2)" if args.size > 2
|
|
681
|
+
which = (args.size == 2 || SELECTORS.include?(args.last)) ? args.pop : :all
|
|
682
|
+
return to_enum :find_index, which, *args unless block_given? || args.size == 1
|
|
683
|
+
if args.size == 1
|
|
684
|
+
value = args.first
|
|
685
|
+
each_with_index(which) do |e, row_index, col_index|
|
|
686
|
+
return row_index, col_index if e == value
|
|
687
|
+
end
|
|
688
|
+
else
|
|
689
|
+
each_with_index(which) do |e, row_index, col_index|
|
|
690
|
+
return row_index, col_index if yield e
|
|
691
|
+
end
|
|
692
|
+
end
|
|
693
|
+
nil
|
|
694
|
+
end
|
|
695
|
+
alias_method :find_index, :index
|
|
696
|
+
|
|
697
|
+
#
|
|
698
|
+
# Returns a section of the matrix. The parameters are either:
|
|
699
|
+
# * start_row, nrows, start_col, ncols; OR
|
|
700
|
+
# * row_range, col_range
|
|
701
|
+
#
|
|
702
|
+
# Matrix.diagonal(9, 5, -3).minor(0..1, 0..2)
|
|
703
|
+
# # => 9 0 0
|
|
704
|
+
# # 0 5 0
|
|
705
|
+
#
|
|
706
|
+
# Like Array#[], negative indices count backward from the end of the
|
|
707
|
+
# row or column (-1 is the last element). Returns nil if the starting
|
|
708
|
+
# row or column is greater than row_count or column_count respectively.
|
|
709
|
+
#
|
|
710
|
+
def minor(*param)
|
|
711
|
+
case param.size
|
|
712
|
+
when 2
|
|
713
|
+
row_range, col_range = param
|
|
714
|
+
from_row = row_range.first
|
|
715
|
+
from_row += row_count if from_row < 0
|
|
716
|
+
to_row = row_range.end
|
|
717
|
+
to_row += row_count if to_row < 0
|
|
718
|
+
to_row += 1 unless row_range.exclude_end?
|
|
719
|
+
size_row = to_row - from_row
|
|
720
|
+
|
|
721
|
+
from_col = col_range.first
|
|
722
|
+
from_col += column_count if from_col < 0
|
|
723
|
+
to_col = col_range.end
|
|
724
|
+
to_col += column_count if to_col < 0
|
|
725
|
+
to_col += 1 unless col_range.exclude_end?
|
|
726
|
+
size_col = to_col - from_col
|
|
727
|
+
when 4
|
|
728
|
+
from_row, size_row, from_col, size_col = param
|
|
729
|
+
return nil if size_row < 0 || size_col < 0
|
|
730
|
+
from_row += row_count if from_row < 0
|
|
731
|
+
from_col += column_count if from_col < 0
|
|
732
|
+
else
|
|
733
|
+
raise ArgumentError, param.inspect
|
|
734
|
+
end
|
|
735
|
+
|
|
736
|
+
return nil if from_row > row_count || from_col > column_count || from_row < 0 || from_col < 0
|
|
737
|
+
rows = @rows[from_row, size_row].collect{|row|
|
|
738
|
+
row[from_col, size_col]
|
|
739
|
+
}
|
|
740
|
+
new_matrix rows, [column_count - from_col, size_col].min
|
|
741
|
+
end
|
|
742
|
+
|
|
743
|
+
#
|
|
744
|
+
# Returns the submatrix obtained by deleting the specified row and column.
|
|
745
|
+
#
|
|
746
|
+
# Matrix.diagonal(9, 5, -3, 4).first_minor(1, 2)
|
|
747
|
+
# # => 9 0 0
|
|
748
|
+
# # 0 0 0
|
|
749
|
+
# # 0 0 4
|
|
750
|
+
#
|
|
751
|
+
def first_minor(row, column)
|
|
752
|
+
raise RuntimeError, "first_minor of empty matrix is not defined" if empty?
|
|
753
|
+
|
|
754
|
+
unless 0 <= row && row < row_count
|
|
755
|
+
raise ArgumentError, "invalid row (#{row.inspect} for 0..#{row_count - 1})"
|
|
756
|
+
end
|
|
757
|
+
|
|
758
|
+
unless 0 <= column && column < column_count
|
|
759
|
+
raise ArgumentError, "invalid column (#{column.inspect} for 0..#{column_count - 1})"
|
|
760
|
+
end
|
|
761
|
+
|
|
762
|
+
arrays = to_a
|
|
763
|
+
arrays.delete_at(row)
|
|
764
|
+
arrays.each do |array|
|
|
765
|
+
array.delete_at(column)
|
|
766
|
+
end
|
|
767
|
+
|
|
768
|
+
new_matrix arrays, column_count - 1
|
|
769
|
+
end
|
|
770
|
+
|
|
771
|
+
#
|
|
772
|
+
# Returns the (row, column) cofactor which is obtained by multiplying
|
|
773
|
+
# the first minor by (-1)**(row + column).
|
|
774
|
+
#
|
|
775
|
+
# Matrix.diagonal(9, 5, -3, 4).cofactor(1, 1)
|
|
776
|
+
# # => -108
|
|
777
|
+
#
|
|
778
|
+
def cofactor(row, column)
|
|
779
|
+
raise RuntimeError, "cofactor of empty matrix is not defined" if empty?
|
|
780
|
+
raise ErrDimensionMismatch unless square?
|
|
781
|
+
|
|
782
|
+
det_of_minor = first_minor(row, column).determinant
|
|
783
|
+
det_of_minor * (-1) ** (row + column)
|
|
784
|
+
end
|
|
785
|
+
|
|
786
|
+
#
|
|
787
|
+
# Returns the adjugate of the matrix.
|
|
788
|
+
#
|
|
789
|
+
# Matrix[ [7,6],[3,9] ].adjugate
|
|
790
|
+
# # => 9 -6
|
|
791
|
+
# # -3 7
|
|
792
|
+
#
|
|
793
|
+
def adjugate
|
|
794
|
+
raise ErrDimensionMismatch unless square?
|
|
795
|
+
Matrix.build(row_count, column_count) do |row, column|
|
|
796
|
+
cofactor(column, row)
|
|
797
|
+
end
|
|
798
|
+
end
|
|
799
|
+
|
|
800
|
+
#
|
|
801
|
+
# Returns the Laplace expansion along given row or column.
|
|
802
|
+
#
|
|
803
|
+
# Matrix[[7,6], [3,9]].laplace_expansion(column: 1)
|
|
804
|
+
# # => 45
|
|
805
|
+
#
|
|
806
|
+
# Matrix[[Vector[1, 0], Vector[0, 1]], [2, 3]].laplace_expansion(row: 0)
|
|
807
|
+
# # => Vector[3, -2]
|
|
808
|
+
#
|
|
809
|
+
#
|
|
810
|
+
def laplace_expansion(row: nil, column: nil)
|
|
811
|
+
num = row || column
|
|
812
|
+
|
|
813
|
+
if !num || (row && column)
|
|
814
|
+
raise ArgumentError, "exactly one the row or column arguments must be specified"
|
|
815
|
+
end
|
|
816
|
+
|
|
817
|
+
raise ErrDimensionMismatch unless square?
|
|
818
|
+
raise RuntimeError, "laplace_expansion of empty matrix is not defined" if empty?
|
|
819
|
+
|
|
820
|
+
unless 0 <= num && num < row_count
|
|
821
|
+
raise ArgumentError, "invalid num (#{num.inspect} for 0..#{row_count - 1})"
|
|
822
|
+
end
|
|
823
|
+
|
|
824
|
+
send(row ? :row : :column, num).map.with_index { |e, k|
|
|
825
|
+
e * cofactor(*(row ? [num, k] : [k,num]))
|
|
826
|
+
}.inject(:+)
|
|
827
|
+
end
|
|
828
|
+
alias_method :cofactor_expansion, :laplace_expansion
|
|
829
|
+
|
|
830
|
+
|
|
831
|
+
#--
|
|
832
|
+
# TESTING -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
|
833
|
+
#++
|
|
834
|
+
|
|
835
|
+
#
|
|
836
|
+
# Returns +true+ if this is a diagonal matrix.
|
|
837
|
+
# Raises an error if matrix is not square.
|
|
838
|
+
#
|
|
839
|
+
def diagonal?
|
|
840
|
+
raise ErrDimensionMismatch unless square?
|
|
841
|
+
each(:off_diagonal).all?(&:zero?)
|
|
842
|
+
end
|
|
843
|
+
|
|
844
|
+
#
|
|
845
|
+
# Returns +true+ if this is an empty matrix, i.e. if the number of rows
|
|
846
|
+
# or the number of columns is 0.
|
|
847
|
+
#
|
|
848
|
+
def empty?
|
|
849
|
+
column_count == 0 || row_count == 0
|
|
850
|
+
end
|
|
851
|
+
|
|
852
|
+
#
|
|
853
|
+
# Returns +true+ if this is an hermitian matrix.
|
|
854
|
+
# Raises an error if matrix is not square.
|
|
855
|
+
#
|
|
856
|
+
def hermitian?
|
|
857
|
+
raise ErrDimensionMismatch unless square?
|
|
858
|
+
each_with_index(:upper).all? do |e, row, col|
|
|
859
|
+
e == rows[col][row].conj
|
|
860
|
+
end
|
|
861
|
+
end
|
|
862
|
+
|
|
863
|
+
#
|
|
864
|
+
# Returns +true+ if this is a lower triangular matrix.
|
|
865
|
+
#
|
|
866
|
+
def lower_triangular?
|
|
867
|
+
each(:strict_upper).all?(&:zero?)
|
|
868
|
+
end
|
|
869
|
+
|
|
870
|
+
#
|
|
871
|
+
# Returns +true+ if this is a normal matrix.
|
|
872
|
+
# Raises an error if matrix is not square.
|
|
873
|
+
#
|
|
874
|
+
def normal?
|
|
875
|
+
raise ErrDimensionMismatch unless square?
|
|
876
|
+
rows.each_with_index do |row_i, i|
|
|
877
|
+
rows.each_with_index do |row_j, j|
|
|
878
|
+
s = 0
|
|
879
|
+
rows.each_with_index do |row_k, k|
|
|
880
|
+
s += row_i[k] * row_j[k].conj - row_k[i].conj * row_k[j]
|
|
881
|
+
end
|
|
882
|
+
return false unless s == 0
|
|
883
|
+
end
|
|
884
|
+
end
|
|
885
|
+
true
|
|
886
|
+
end
|
|
887
|
+
|
|
888
|
+
#
|
|
889
|
+
# Returns +true+ if this is an orthogonal matrix
|
|
890
|
+
# Raises an error if matrix is not square.
|
|
891
|
+
#
|
|
892
|
+
def orthogonal?
|
|
893
|
+
raise ErrDimensionMismatch unless square?
|
|
894
|
+
|
|
895
|
+
rows.each_with_index do |row_i, i|
|
|
896
|
+
rows.each_with_index do |row_j, j|
|
|
897
|
+
s = 0
|
|
898
|
+
row_count.times do |k|
|
|
899
|
+
s += row_i[k] * row_j[k]
|
|
900
|
+
end
|
|
901
|
+
return false unless s == (i == j ? 1 : 0)
|
|
902
|
+
end
|
|
903
|
+
end
|
|
904
|
+
true
|
|
905
|
+
end
|
|
906
|
+
|
|
907
|
+
#
|
|
908
|
+
# Returns +true+ if this is a permutation matrix
|
|
909
|
+
# Raises an error if matrix is not square.
|
|
910
|
+
#
|
|
911
|
+
def permutation?
|
|
912
|
+
raise ErrDimensionMismatch unless square?
|
|
913
|
+
cols = Array.new(column_count)
|
|
914
|
+
rows.each_with_index do |row, i|
|
|
915
|
+
found = false
|
|
916
|
+
row.each_with_index do |e, j|
|
|
917
|
+
if e == 1
|
|
918
|
+
return false if found || cols[j]
|
|
919
|
+
found = cols[j] = true
|
|
920
|
+
elsif e != 0
|
|
921
|
+
return false
|
|
922
|
+
end
|
|
923
|
+
end
|
|
924
|
+
return false unless found
|
|
925
|
+
end
|
|
926
|
+
true
|
|
927
|
+
end
|
|
928
|
+
|
|
929
|
+
#
|
|
930
|
+
# Returns +true+ if all entries of the matrix are real.
|
|
931
|
+
#
|
|
932
|
+
def real?
|
|
933
|
+
all?(&:real?)
|
|
934
|
+
end
|
|
935
|
+
|
|
936
|
+
#
|
|
937
|
+
# Returns +true+ if this is a regular (i.e. non-singular) matrix.
|
|
938
|
+
#
|
|
939
|
+
def regular?
|
|
940
|
+
not singular?
|
|
941
|
+
end
|
|
942
|
+
|
|
943
|
+
#
|
|
944
|
+
# Returns +true+ if this is a singular matrix.
|
|
945
|
+
#
|
|
946
|
+
def singular?
|
|
947
|
+
determinant == 0
|
|
948
|
+
end
|
|
949
|
+
|
|
950
|
+
#
|
|
951
|
+
# Returns +true+ if this is a square matrix.
|
|
952
|
+
#
|
|
953
|
+
def square?
|
|
954
|
+
column_count == row_count
|
|
955
|
+
end
|
|
956
|
+
|
|
957
|
+
#
|
|
958
|
+
# Returns +true+ if this is a symmetric matrix.
|
|
959
|
+
# Raises an error if matrix is not square.
|
|
960
|
+
#
|
|
961
|
+
def symmetric?
|
|
962
|
+
raise ErrDimensionMismatch unless square?
|
|
963
|
+
each_with_index(:strict_upper) do |e, row, col|
|
|
964
|
+
return false if e != rows[col][row]
|
|
965
|
+
end
|
|
966
|
+
true
|
|
967
|
+
end
|
|
968
|
+
|
|
969
|
+
#
|
|
970
|
+
# Returns +true+ if this is an antisymmetric matrix.
|
|
971
|
+
# Raises an error if matrix is not square.
|
|
972
|
+
#
|
|
973
|
+
def antisymmetric?
|
|
974
|
+
raise ErrDimensionMismatch unless square?
|
|
975
|
+
each_with_index(:upper) do |e, row, col|
|
|
976
|
+
return false unless e == -rows[col][row]
|
|
977
|
+
end
|
|
978
|
+
true
|
|
979
|
+
end
|
|
980
|
+
alias_method :skew_symmetric?, :antisymmetric?
|
|
981
|
+
|
|
982
|
+
#
|
|
983
|
+
# Returns +true+ if this is a unitary matrix
|
|
984
|
+
# Raises an error if matrix is not square.
|
|
985
|
+
#
|
|
986
|
+
def unitary?
|
|
987
|
+
raise ErrDimensionMismatch unless square?
|
|
988
|
+
rows.each_with_index do |row_i, i|
|
|
989
|
+
rows.each_with_index do |row_j, j|
|
|
990
|
+
s = 0
|
|
991
|
+
row_count.times do |k|
|
|
992
|
+
s += row_i[k].conj * row_j[k]
|
|
993
|
+
end
|
|
994
|
+
return false unless s == (i == j ? 1 : 0)
|
|
995
|
+
end
|
|
996
|
+
end
|
|
997
|
+
true
|
|
998
|
+
end
|
|
999
|
+
|
|
1000
|
+
#
|
|
1001
|
+
# Returns +true+ if this is an upper triangular matrix.
|
|
1002
|
+
#
|
|
1003
|
+
def upper_triangular?
|
|
1004
|
+
each(:strict_lower).all?(&:zero?)
|
|
1005
|
+
end
|
|
1006
|
+
|
|
1007
|
+
#
|
|
1008
|
+
# Returns +true+ if this is a matrix with only zero elements
|
|
1009
|
+
#
|
|
1010
|
+
def zero?
|
|
1011
|
+
all?(&:zero?)
|
|
1012
|
+
end
|
|
1013
|
+
|
|
1014
|
+
#--
|
|
1015
|
+
# OBJECT METHODS -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
|
1016
|
+
#++
|
|
1017
|
+
|
|
1018
|
+
#
|
|
1019
|
+
# Returns whether the two matrices contain equal elements.
|
|
1020
|
+
#
|
|
1021
|
+
def ==(other)
|
|
1022
|
+
return false unless Matrix === other &&
|
|
1023
|
+
column_count == other.column_count # necessary for empty matrices
|
|
1024
|
+
rows == other.rows
|
|
1025
|
+
end
|
|
1026
|
+
|
|
1027
|
+
def eql?(other)
|
|
1028
|
+
return false unless Matrix === other &&
|
|
1029
|
+
column_count == other.column_count # necessary for empty matrices
|
|
1030
|
+
rows.eql? other.rows
|
|
1031
|
+
end
|
|
1032
|
+
|
|
1033
|
+
#
|
|
1034
|
+
# Called for dup & clone.
|
|
1035
|
+
#
|
|
1036
|
+
private def initialize_copy(m)
|
|
1037
|
+
super
|
|
1038
|
+
@rows = @rows.map(&:dup) unless frozen?
|
|
1039
|
+
end
|
|
1040
|
+
|
|
1041
|
+
#
|
|
1042
|
+
# Returns a hash-code for the matrix.
|
|
1043
|
+
#
|
|
1044
|
+
def hash
|
|
1045
|
+
@rows.hash
|
|
1046
|
+
end
|
|
1047
|
+
|
|
1048
|
+
#--
|
|
1049
|
+
# ARITHMETIC -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
|
1050
|
+
#++
|
|
1051
|
+
|
|
1052
|
+
#
|
|
1053
|
+
# Matrix multiplication.
|
|
1054
|
+
# Matrix[[2,4], [6,8]] * Matrix.identity(2)
|
|
1055
|
+
# # => 2 4
|
|
1056
|
+
# # 6 8
|
|
1057
|
+
#
|
|
1058
|
+
def *(m) # m is matrix or vector or number
|
|
1059
|
+
case(m)
|
|
1060
|
+
when Numeric
|
|
1061
|
+
new_rows = @rows.collect {|row|
|
|
1062
|
+
row.collect {|e| e * m }
|
|
1063
|
+
}
|
|
1064
|
+
return new_matrix new_rows, column_count
|
|
1065
|
+
when Vector
|
|
1066
|
+
m = self.class.column_vector(m)
|
|
1067
|
+
r = self * m
|
|
1068
|
+
return r.column(0)
|
|
1069
|
+
when Matrix
|
|
1070
|
+
raise ErrDimensionMismatch if column_count != m.row_count
|
|
1071
|
+
m_rows = m.rows
|
|
1072
|
+
new_rows = rows.map do |row_i|
|
|
1073
|
+
Array.new(m.column_count) do |j|
|
|
1074
|
+
vij = 0
|
|
1075
|
+
column_count.times do |k|
|
|
1076
|
+
vij += row_i[k] * m_rows[k][j]
|
|
1077
|
+
end
|
|
1078
|
+
vij
|
|
1079
|
+
end
|
|
1080
|
+
end
|
|
1081
|
+
return new_matrix new_rows, m.column_count
|
|
1082
|
+
else
|
|
1083
|
+
return apply_through_coercion(m, __method__)
|
|
1084
|
+
end
|
|
1085
|
+
end
|
|
1086
|
+
|
|
1087
|
+
#
|
|
1088
|
+
# Matrix addition.
|
|
1089
|
+
# Matrix.scalar(2,5) + Matrix[[1,0], [-4,7]]
|
|
1090
|
+
# # => 6 0
|
|
1091
|
+
# # -4 12
|
|
1092
|
+
#
|
|
1093
|
+
def +(m)
|
|
1094
|
+
case m
|
|
1095
|
+
when Numeric
|
|
1096
|
+
raise ErrOperationNotDefined, ["+", self.class, m.class]
|
|
1097
|
+
when Vector
|
|
1098
|
+
m = self.class.column_vector(m)
|
|
1099
|
+
when Matrix
|
|
1100
|
+
else
|
|
1101
|
+
return apply_through_coercion(m, __method__)
|
|
1102
|
+
end
|
|
1103
|
+
|
|
1104
|
+
raise ErrDimensionMismatch unless row_count == m.row_count && column_count == m.column_count
|
|
1105
|
+
|
|
1106
|
+
rows = Array.new(row_count) {|i|
|
|
1107
|
+
Array.new(column_count) {|j|
|
|
1108
|
+
self[i, j] + m[i, j]
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
new_matrix rows, column_count
|
|
1112
|
+
end
|
|
1113
|
+
|
|
1114
|
+
#
|
|
1115
|
+
# Matrix subtraction.
|
|
1116
|
+
# Matrix[[1,5], [4,2]] - Matrix[[9,3], [-4,1]]
|
|
1117
|
+
# # => -8 2
|
|
1118
|
+
# # 8 1
|
|
1119
|
+
#
|
|
1120
|
+
def -(m)
|
|
1121
|
+
case m
|
|
1122
|
+
when Numeric
|
|
1123
|
+
raise ErrOperationNotDefined, ["-", self.class, m.class]
|
|
1124
|
+
when Vector
|
|
1125
|
+
m = self.class.column_vector(m)
|
|
1126
|
+
when Matrix
|
|
1127
|
+
else
|
|
1128
|
+
return apply_through_coercion(m, __method__)
|
|
1129
|
+
end
|
|
1130
|
+
|
|
1131
|
+
raise ErrDimensionMismatch unless row_count == m.row_count && column_count == m.column_count
|
|
1132
|
+
|
|
1133
|
+
rows = Array.new(row_count) {|i|
|
|
1134
|
+
Array.new(column_count) {|j|
|
|
1135
|
+
self[i, j] - m[i, j]
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
new_matrix rows, column_count
|
|
1139
|
+
end
|
|
1140
|
+
|
|
1141
|
+
#
|
|
1142
|
+
# Matrix division (multiplication by the inverse).
|
|
1143
|
+
# Matrix[[7,6], [3,9]] / Matrix[[2,9], [3,1]]
|
|
1144
|
+
# # => -7 1
|
|
1145
|
+
# # -3 -6
|
|
1146
|
+
#
|
|
1147
|
+
def /(other)
|
|
1148
|
+
case other
|
|
1149
|
+
when Numeric
|
|
1150
|
+
rows = @rows.collect {|row|
|
|
1151
|
+
row.collect {|e| e / other }
|
|
1152
|
+
}
|
|
1153
|
+
return new_matrix rows, column_count
|
|
1154
|
+
when Matrix
|
|
1155
|
+
return self * other.inverse
|
|
1156
|
+
else
|
|
1157
|
+
return apply_through_coercion(other, __method__)
|
|
1158
|
+
end
|
|
1159
|
+
end
|
|
1160
|
+
|
|
1161
|
+
#
|
|
1162
|
+
# Hadamard product
|
|
1163
|
+
# Matrix[[1,2], [3,4]].hadamard_product(Matrix[[1,2], [3,2]])
|
|
1164
|
+
# # => 1 4
|
|
1165
|
+
# # 9 8
|
|
1166
|
+
#
|
|
1167
|
+
def hadamard_product(m)
|
|
1168
|
+
combine(m){|a, b| a * b}
|
|
1169
|
+
end
|
|
1170
|
+
alias_method :entrywise_product, :hadamard_product
|
|
1171
|
+
|
|
1172
|
+
#
|
|
1173
|
+
# Returns the inverse of the matrix.
|
|
1174
|
+
# Matrix[[-1, -1], [0, -1]].inverse
|
|
1175
|
+
# # => -1 1
|
|
1176
|
+
# # 0 -1
|
|
1177
|
+
#
|
|
1178
|
+
def inverse
|
|
1179
|
+
raise ErrDimensionMismatch unless square?
|
|
1180
|
+
self.class.I(row_count).send(:inverse_from, self)
|
|
1181
|
+
end
|
|
1182
|
+
alias_method :inv, :inverse
|
|
1183
|
+
|
|
1184
|
+
private def inverse_from(src) # :nodoc:
|
|
1185
|
+
last = row_count - 1
|
|
1186
|
+
a = src.to_a
|
|
1187
|
+
|
|
1188
|
+
0.upto(last) do |k|
|
|
1189
|
+
i = k
|
|
1190
|
+
akk = a[k][k].abs
|
|
1191
|
+
(k+1).upto(last) do |j|
|
|
1192
|
+
v = a[j][k].abs
|
|
1193
|
+
if v > akk
|
|
1194
|
+
i = j
|
|
1195
|
+
akk = v
|
|
1196
|
+
end
|
|
1197
|
+
end
|
|
1198
|
+
raise ErrNotRegular if akk == 0
|
|
1199
|
+
if i != k
|
|
1200
|
+
a[i], a[k] = a[k], a[i]
|
|
1201
|
+
@rows[i], @rows[k] = @rows[k], @rows[i]
|
|
1202
|
+
end
|
|
1203
|
+
akk = a[k][k]
|
|
1204
|
+
|
|
1205
|
+
0.upto(last) do |ii|
|
|
1206
|
+
next if ii == k
|
|
1207
|
+
q = a[ii][k].quo(akk)
|
|
1208
|
+
a[ii][k] = 0
|
|
1209
|
+
|
|
1210
|
+
(k + 1).upto(last) do |j|
|
|
1211
|
+
a[ii][j] -= a[k][j] * q
|
|
1212
|
+
end
|
|
1213
|
+
0.upto(last) do |j|
|
|
1214
|
+
@rows[ii][j] -= @rows[k][j] * q
|
|
1215
|
+
end
|
|
1216
|
+
end
|
|
1217
|
+
|
|
1218
|
+
(k+1).upto(last) do |j|
|
|
1219
|
+
a[k][j] = a[k][j].quo(akk)
|
|
1220
|
+
end
|
|
1221
|
+
0.upto(last) do |j|
|
|
1222
|
+
@rows[k][j] = @rows[k][j].quo(akk)
|
|
1223
|
+
end
|
|
1224
|
+
end
|
|
1225
|
+
self
|
|
1226
|
+
end
|
|
1227
|
+
|
|
1228
|
+
#
|
|
1229
|
+
# Matrix exponentiation.
|
|
1230
|
+
# Equivalent to multiplying the matrix by itself N times.
|
|
1231
|
+
# Non integer exponents will be handled by diagonalizing the matrix.
|
|
1232
|
+
#
|
|
1233
|
+
# Matrix[[7,6], [3,9]] ** 2
|
|
1234
|
+
# # => 67 96
|
|
1235
|
+
# # 48 99
|
|
1236
|
+
#
|
|
1237
|
+
def **(exp)
|
|
1238
|
+
case exp
|
|
1239
|
+
when Integer
|
|
1240
|
+
case
|
|
1241
|
+
when exp == 0
|
|
1242
|
+
raise ErrDimensionMismatch unless square?
|
|
1243
|
+
self.class.identity(column_count)
|
|
1244
|
+
when exp < 0
|
|
1245
|
+
inverse.power_int(-exp)
|
|
1246
|
+
else
|
|
1247
|
+
power_int(exp)
|
|
1248
|
+
end
|
|
1249
|
+
when Numeric
|
|
1250
|
+
v, d, v_inv = eigensystem
|
|
1251
|
+
v * self.class.diagonal(*d.each(:diagonal).map{|e| e ** exp}) * v_inv
|
|
1252
|
+
else
|
|
1253
|
+
raise ErrOperationNotDefined, ["**", self.class, exp.class]
|
|
1254
|
+
end
|
|
1255
|
+
end
|
|
1256
|
+
|
|
1257
|
+
protected def power_int(exp)
|
|
1258
|
+
# assumes `exp` is an Integer > 0
|
|
1259
|
+
#
|
|
1260
|
+
# Previous algorithm:
|
|
1261
|
+
# build M**2, M**4 = (M**2)**2, M**8, ... and multiplying those you need
|
|
1262
|
+
# e.g. M**0b1011 = M**11 = M * M**2 * M**8
|
|
1263
|
+
# ^ ^
|
|
1264
|
+
# (highlighted the 2 out of 5 multiplications involving `M * x`)
|
|
1265
|
+
#
|
|
1266
|
+
# Current algorithm has same number of multiplications but with lower exponents:
|
|
1267
|
+
# M**11 = M * (M * M**4)**2
|
|
1268
|
+
# ^ ^ ^
|
|
1269
|
+
# (highlighted the 3 out of 5 multiplications involving `M * x`)
|
|
1270
|
+
#
|
|
1271
|
+
# This should be faster for all (non nil-potent) matrices.
|
|
1272
|
+
case
|
|
1273
|
+
when exp == 1
|
|
1274
|
+
self
|
|
1275
|
+
when exp.odd?
|
|
1276
|
+
self * power_int(exp - 1)
|
|
1277
|
+
else
|
|
1278
|
+
sqrt = power_int(exp / 2)
|
|
1279
|
+
sqrt * sqrt
|
|
1280
|
+
end
|
|
1281
|
+
end
|
|
1282
|
+
|
|
1283
|
+
def +@
|
|
1284
|
+
self
|
|
1285
|
+
end
|
|
1286
|
+
|
|
1287
|
+
# Unary matrix negation.
|
|
1288
|
+
#
|
|
1289
|
+
# -Matrix[[1,5], [4,2]]
|
|
1290
|
+
# # => -1 -5
|
|
1291
|
+
# # -4 -2
|
|
1292
|
+
def -@
|
|
1293
|
+
collect {|e| -e }
|
|
1294
|
+
end
|
|
1295
|
+
|
|
1296
|
+
#
|
|
1297
|
+
# Returns the absolute value elementwise
|
|
1298
|
+
#
|
|
1299
|
+
def abs
|
|
1300
|
+
collect(&:abs)
|
|
1301
|
+
end
|
|
1302
|
+
|
|
1303
|
+
#--
|
|
1304
|
+
# MATRIX FUNCTIONS -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
|
1305
|
+
#++
|
|
1306
|
+
|
|
1307
|
+
#
|
|
1308
|
+
# Returns the determinant of the matrix.
|
|
1309
|
+
#
|
|
1310
|
+
# Beware that using Float values can yield erroneous results
|
|
1311
|
+
# because of their lack of precision.
|
|
1312
|
+
# Consider using exact types like Rational or BigDecimal instead.
|
|
1313
|
+
#
|
|
1314
|
+
# Matrix[[7,6], [3,9]].determinant
|
|
1315
|
+
# # => 45
|
|
1316
|
+
#
|
|
1317
|
+
def determinant
|
|
1318
|
+
raise ErrDimensionMismatch unless square?
|
|
1319
|
+
m = @rows
|
|
1320
|
+
case row_count
|
|
1321
|
+
# Up to 4x4, give result using Laplacian expansion by minors.
|
|
1322
|
+
# This will typically be faster, as well as giving good results
|
|
1323
|
+
# in case of Floats
|
|
1324
|
+
when 0
|
|
1325
|
+
+1
|
|
1326
|
+
when 1
|
|
1327
|
+
+ m[0][0]
|
|
1328
|
+
when 2
|
|
1329
|
+
+ m[0][0] * m[1][1] - m[0][1] * m[1][0]
|
|
1330
|
+
when 3
|
|
1331
|
+
m0, m1, m2 = m
|
|
1332
|
+
+ m0[0] * m1[1] * m2[2] - m0[0] * m1[2] * m2[1] \
|
|
1333
|
+
- m0[1] * m1[0] * m2[2] + m0[1] * m1[2] * m2[0] \
|
|
1334
|
+
+ m0[2] * m1[0] * m2[1] - m0[2] * m1[1] * m2[0]
|
|
1335
|
+
when 4
|
|
1336
|
+
m0, m1, m2, m3 = m
|
|
1337
|
+
+ m0[0] * m1[1] * m2[2] * m3[3] - m0[0] * m1[1] * m2[3] * m3[2] \
|
|
1338
|
+
- m0[0] * m1[2] * m2[1] * m3[3] + m0[0] * m1[2] * m2[3] * m3[1] \
|
|
1339
|
+
+ m0[0] * m1[3] * m2[1] * m3[2] - m0[0] * m1[3] * m2[2] * m3[1] \
|
|
1340
|
+
- m0[1] * m1[0] * m2[2] * m3[3] + m0[1] * m1[0] * m2[3] * m3[2] \
|
|
1341
|
+
+ m0[1] * m1[2] * m2[0] * m3[3] - m0[1] * m1[2] * m2[3] * m3[0] \
|
|
1342
|
+
- m0[1] * m1[3] * m2[0] * m3[2] + m0[1] * m1[3] * m2[2] * m3[0] \
|
|
1343
|
+
+ m0[2] * m1[0] * m2[1] * m3[3] - m0[2] * m1[0] * m2[3] * m3[1] \
|
|
1344
|
+
- m0[2] * m1[1] * m2[0] * m3[3] + m0[2] * m1[1] * m2[3] * m3[0] \
|
|
1345
|
+
+ m0[2] * m1[3] * m2[0] * m3[1] - m0[2] * m1[3] * m2[1] * m3[0] \
|
|
1346
|
+
- m0[3] * m1[0] * m2[1] * m3[2] + m0[3] * m1[0] * m2[2] * m3[1] \
|
|
1347
|
+
+ m0[3] * m1[1] * m2[0] * m3[2] - m0[3] * m1[1] * m2[2] * m3[0] \
|
|
1348
|
+
- m0[3] * m1[2] * m2[0] * m3[1] + m0[3] * m1[2] * m2[1] * m3[0]
|
|
1349
|
+
else
|
|
1350
|
+
# For bigger matrices, use an efficient and general algorithm.
|
|
1351
|
+
# Currently, we use the Gauss-Bareiss algorithm
|
|
1352
|
+
determinant_bareiss
|
|
1353
|
+
end
|
|
1354
|
+
end
|
|
1355
|
+
alias_method :det, :determinant
|
|
1356
|
+
|
|
1357
|
+
#
|
|
1358
|
+
# Private. Use Matrix#determinant
|
|
1359
|
+
#
|
|
1360
|
+
# Returns the determinant of the matrix, using
|
|
1361
|
+
# Bareiss' multistep integer-preserving gaussian elimination.
|
|
1362
|
+
# It has the same computational cost order O(n^3) as standard Gaussian elimination.
|
|
1363
|
+
# Intermediate results are fraction free and of lower complexity.
|
|
1364
|
+
# A matrix of Integers will have thus intermediate results that are also Integers,
|
|
1365
|
+
# with smaller bignums (if any), while a matrix of Float will usually have
|
|
1366
|
+
# intermediate results with better precision.
|
|
1367
|
+
#
|
|
1368
|
+
private def determinant_bareiss
|
|
1369
|
+
size = row_count
|
|
1370
|
+
last = size - 1
|
|
1371
|
+
a = to_a
|
|
1372
|
+
no_pivot = Proc.new{ return 0 }
|
|
1373
|
+
sign = +1
|
|
1374
|
+
pivot = 1
|
|
1375
|
+
size.times do |k|
|
|
1376
|
+
previous_pivot = pivot
|
|
1377
|
+
if (pivot = a[k][k]) == 0
|
|
1378
|
+
switch = (k+1 ... size).find(no_pivot) {|row|
|
|
1379
|
+
a[row][k] != 0
|
|
1380
|
+
}
|
|
1381
|
+
a[switch], a[k] = a[k], a[switch]
|
|
1382
|
+
pivot = a[k][k]
|
|
1383
|
+
sign = -sign
|
|
1384
|
+
end
|
|
1385
|
+
(k+1).upto(last) do |i|
|
|
1386
|
+
ai = a[i]
|
|
1387
|
+
(k+1).upto(last) do |j|
|
|
1388
|
+
ai[j] = (pivot * ai[j] - ai[k] * a[k][j]) / previous_pivot
|
|
1389
|
+
end
|
|
1390
|
+
end
|
|
1391
|
+
end
|
|
1392
|
+
sign * pivot
|
|
1393
|
+
end
|
|
1394
|
+
|
|
1395
|
+
#
|
|
1396
|
+
# deprecated; use Matrix#determinant
|
|
1397
|
+
#
|
|
1398
|
+
def determinant_e
|
|
1399
|
+
warn "Matrix#determinant_e is deprecated; use #determinant", uplevel: 1
|
|
1400
|
+
determinant
|
|
1401
|
+
end
|
|
1402
|
+
alias_method :det_e, :determinant_e
|
|
1403
|
+
|
|
1404
|
+
#
|
|
1405
|
+
# Returns a new matrix resulting by stacking horizontally
|
|
1406
|
+
# the receiver with the given matrices
|
|
1407
|
+
#
|
|
1408
|
+
# x = Matrix[[1, 2], [3, 4]]
|
|
1409
|
+
# y = Matrix[[5, 6], [7, 8]]
|
|
1410
|
+
# x.hstack(y) # => Matrix[[1, 2, 5, 6], [3, 4, 7, 8]]
|
|
1411
|
+
#
|
|
1412
|
+
def hstack(*matrices)
|
|
1413
|
+
self.class.hstack(self, *matrices)
|
|
1414
|
+
end
|
|
1415
|
+
|
|
1416
|
+
#
|
|
1417
|
+
# Returns the rank of the matrix.
|
|
1418
|
+
# Beware that using Float values can yield erroneous results
|
|
1419
|
+
# because of their lack of precision.
|
|
1420
|
+
# Consider using exact types like Rational or BigDecimal instead.
|
|
1421
|
+
#
|
|
1422
|
+
# Matrix[[7,6], [3,9]].rank
|
|
1423
|
+
# # => 2
|
|
1424
|
+
#
|
|
1425
|
+
def rank
|
|
1426
|
+
# We currently use Bareiss' multistep integer-preserving gaussian elimination
|
|
1427
|
+
# (see comments on determinant)
|
|
1428
|
+
a = to_a
|
|
1429
|
+
last_column = column_count - 1
|
|
1430
|
+
last_row = row_count - 1
|
|
1431
|
+
pivot_row = 0
|
|
1432
|
+
previous_pivot = 1
|
|
1433
|
+
0.upto(last_column) do |k|
|
|
1434
|
+
switch_row = (pivot_row .. last_row).find {|row|
|
|
1435
|
+
a[row][k] != 0
|
|
1436
|
+
}
|
|
1437
|
+
if switch_row
|
|
1438
|
+
a[switch_row], a[pivot_row] = a[pivot_row], a[switch_row] unless pivot_row == switch_row
|
|
1439
|
+
pivot = a[pivot_row][k]
|
|
1440
|
+
(pivot_row+1).upto(last_row) do |i|
|
|
1441
|
+
ai = a[i]
|
|
1442
|
+
(k+1).upto(last_column) do |j|
|
|
1443
|
+
ai[j] = (pivot * ai[j] - ai[k] * a[pivot_row][j]) / previous_pivot
|
|
1444
|
+
end
|
|
1445
|
+
end
|
|
1446
|
+
pivot_row += 1
|
|
1447
|
+
previous_pivot = pivot
|
|
1448
|
+
end
|
|
1449
|
+
end
|
|
1450
|
+
pivot_row
|
|
1451
|
+
end
|
|
1452
|
+
|
|
1453
|
+
#
|
|
1454
|
+
# deprecated; use Matrix#rank
|
|
1455
|
+
#
|
|
1456
|
+
def rank_e
|
|
1457
|
+
warn "Matrix#rank_e is deprecated; use #rank", uplevel: 1
|
|
1458
|
+
rank
|
|
1459
|
+
end
|
|
1460
|
+
|
|
1461
|
+
#
|
|
1462
|
+
# Returns a new matrix with rotated elements.
|
|
1463
|
+
# The argument specifies the rotation (defaults to `:clockwise`):
|
|
1464
|
+
# * :clockwise, 1, -3, etc.: "turn right" - first row becomes last column
|
|
1465
|
+
# * :half_turn, 2, -2, etc.: first row becomes last row, elements in reverse order
|
|
1466
|
+
# * :counter_clockwise, -1, 3: "turn left" - first row becomes first column
|
|
1467
|
+
# (but with elements in reverse order)
|
|
1468
|
+
#
|
|
1469
|
+
# m = Matrix[ [1, 2], [3, 4] ]
|
|
1470
|
+
# r = m.rotate_entries(:clockwise)
|
|
1471
|
+
# # => Matrix[[3, 1], [4, 2]]
|
|
1472
|
+
#
|
|
1473
|
+
def rotate_entries(rotation = :clockwise)
|
|
1474
|
+
rotation %= 4 if rotation.respond_to? :to_int
|
|
1475
|
+
|
|
1476
|
+
case rotation
|
|
1477
|
+
when 0
|
|
1478
|
+
dup
|
|
1479
|
+
when 1, :clockwise
|
|
1480
|
+
new_matrix @rows.transpose.each(&:reverse!), row_count
|
|
1481
|
+
when 2, :half_turn
|
|
1482
|
+
new_matrix @rows.map(&:reverse).reverse!, column_count
|
|
1483
|
+
when 3, :counter_clockwise
|
|
1484
|
+
new_matrix @rows.transpose.reverse!, row_count
|
|
1485
|
+
else
|
|
1486
|
+
raise ArgumentError, "expected #{rotation.inspect} to be one of :clockwise, :counter_clockwise, :half_turn or an integer"
|
|
1487
|
+
end
|
|
1488
|
+
end
|
|
1489
|
+
|
|
1490
|
+
# Returns a matrix with entries rounded to the given precision
|
|
1491
|
+
# (see Float#round)
|
|
1492
|
+
#
|
|
1493
|
+
def round(ndigits=0)
|
|
1494
|
+
map{|e| e.round(ndigits)}
|
|
1495
|
+
end
|
|
1496
|
+
|
|
1497
|
+
#
|
|
1498
|
+
# Returns the trace (sum of diagonal elements) of the matrix.
|
|
1499
|
+
# Matrix[[7,6], [3,9]].trace
|
|
1500
|
+
# # => 16
|
|
1501
|
+
#
|
|
1502
|
+
def trace
|
|
1503
|
+
raise ErrDimensionMismatch unless square?
|
|
1504
|
+
(0...column_count).inject(0) do |tr, i|
|
|
1505
|
+
tr + @rows[i][i]
|
|
1506
|
+
end
|
|
1507
|
+
end
|
|
1508
|
+
alias_method :tr, :trace
|
|
1509
|
+
|
|
1510
|
+
#
|
|
1511
|
+
# Returns the transpose of the matrix.
|
|
1512
|
+
# Matrix[[1,2], [3,4], [5,6]]
|
|
1513
|
+
# # => 1 2
|
|
1514
|
+
# # 3 4
|
|
1515
|
+
# # 5 6
|
|
1516
|
+
# Matrix[[1,2], [3,4], [5,6]].transpose
|
|
1517
|
+
# # => 1 3 5
|
|
1518
|
+
# # 2 4 6
|
|
1519
|
+
#
|
|
1520
|
+
def transpose
|
|
1521
|
+
return self.class.empty(column_count, 0) if row_count.zero?
|
|
1522
|
+
new_matrix @rows.transpose, row_count
|
|
1523
|
+
end
|
|
1524
|
+
alias_method :t, :transpose
|
|
1525
|
+
|
|
1526
|
+
#
|
|
1527
|
+
# Returns a new matrix resulting by stacking vertically
|
|
1528
|
+
# the receiver with the given matrices
|
|
1529
|
+
#
|
|
1530
|
+
# x = Matrix[[1, 2], [3, 4]]
|
|
1531
|
+
# y = Matrix[[5, 6], [7, 8]]
|
|
1532
|
+
# x.vstack(y) # => Matrix[[1, 2], [3, 4], [5, 6], [7, 8]]
|
|
1533
|
+
#
|
|
1534
|
+
def vstack(*matrices)
|
|
1535
|
+
self.class.vstack(self, *matrices)
|
|
1536
|
+
end
|
|
1537
|
+
|
|
1538
|
+
#--
|
|
1539
|
+
# DECOMPOSITIONS -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
|
1540
|
+
#++
|
|
1541
|
+
|
|
1542
|
+
#
|
|
1543
|
+
# Returns the Eigensystem of the matrix; see +EigenvalueDecomposition+.
|
|
1544
|
+
# m = Matrix[[1, 2], [3, 4]]
|
|
1545
|
+
# v, d, v_inv = m.eigensystem
|
|
1546
|
+
# d.diagonal? # => true
|
|
1547
|
+
# v.inv == v_inv # => true
|
|
1548
|
+
# (v * d * v_inv).round(5) == m # => true
|
|
1549
|
+
#
|
|
1550
|
+
def eigensystem
|
|
1551
|
+
EigenvalueDecomposition.new(self)
|
|
1552
|
+
end
|
|
1553
|
+
alias_method :eigen, :eigensystem
|
|
1554
|
+
|
|
1555
|
+
#
|
|
1556
|
+
# Returns the LUP decomposition of the matrix; see +LUPDecomposition+.
|
|
1557
|
+
# a = Matrix[[1, 2], [3, 4]]
|
|
1558
|
+
# l, u, p = a.lup
|
|
1559
|
+
# l.lower_triangular? # => true
|
|
1560
|
+
# u.upper_triangular? # => true
|
|
1561
|
+
# p.permutation? # => true
|
|
1562
|
+
# l * u == p * a # => true
|
|
1563
|
+
# a.lup.solve([2, 5]) # => Vector[(1/1), (1/2)]
|
|
1564
|
+
#
|
|
1565
|
+
def lup
|
|
1566
|
+
LUPDecomposition.new(self)
|
|
1567
|
+
end
|
|
1568
|
+
alias_method :lup_decomposition, :lup
|
|
1569
|
+
|
|
1570
|
+
#--
|
|
1571
|
+
# COMPLEX ARITHMETIC -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
|
1572
|
+
#++
|
|
1573
|
+
|
|
1574
|
+
#
|
|
1575
|
+
# Returns the conjugate of the matrix.
|
|
1576
|
+
# Matrix[[Complex(1,2), Complex(0,1), 0], [1, 2, 3]]
|
|
1577
|
+
# # => 1+2i i 0
|
|
1578
|
+
# # 1 2 3
|
|
1579
|
+
# Matrix[[Complex(1,2), Complex(0,1), 0], [1, 2, 3]].conjugate
|
|
1580
|
+
# # => 1-2i -i 0
|
|
1581
|
+
# # 1 2 3
|
|
1582
|
+
#
|
|
1583
|
+
def conjugate
|
|
1584
|
+
collect(&:conjugate)
|
|
1585
|
+
end
|
|
1586
|
+
alias_method :conj, :conjugate
|
|
1587
|
+
|
|
1588
|
+
#
|
|
1589
|
+
# Returns the adjoint of the matrix.
|
|
1590
|
+
#
|
|
1591
|
+
# Matrix[ [i,1],[2,-i] ].adjoint
|
|
1592
|
+
# # => -i 2
|
|
1593
|
+
# # 1 i
|
|
1594
|
+
#
|
|
1595
|
+
def adjoint
|
|
1596
|
+
conjugate.transpose
|
|
1597
|
+
end
|
|
1598
|
+
|
|
1599
|
+
#
|
|
1600
|
+
# Returns the imaginary part of the matrix.
|
|
1601
|
+
# Matrix[[Complex(1,2), Complex(0,1), 0], [1, 2, 3]]
|
|
1602
|
+
# # => 1+2i i 0
|
|
1603
|
+
# # 1 2 3
|
|
1604
|
+
# Matrix[[Complex(1,2), Complex(0,1), 0], [1, 2, 3]].imaginary
|
|
1605
|
+
# # => 2i i 0
|
|
1606
|
+
# # 0 0 0
|
|
1607
|
+
#
|
|
1608
|
+
def imaginary
|
|
1609
|
+
collect(&:imaginary)
|
|
1610
|
+
end
|
|
1611
|
+
alias_method :imag, :imaginary
|
|
1612
|
+
|
|
1613
|
+
#
|
|
1614
|
+
# Returns the real part of the matrix.
|
|
1615
|
+
# Matrix[[Complex(1,2), Complex(0,1), 0], [1, 2, 3]]
|
|
1616
|
+
# # => 1+2i i 0
|
|
1617
|
+
# # 1 2 3
|
|
1618
|
+
# Matrix[[Complex(1,2), Complex(0,1), 0], [1, 2, 3]].real
|
|
1619
|
+
# # => 1 0 0
|
|
1620
|
+
# # 1 2 3
|
|
1621
|
+
#
|
|
1622
|
+
def real
|
|
1623
|
+
collect(&:real)
|
|
1624
|
+
end
|
|
1625
|
+
|
|
1626
|
+
#
|
|
1627
|
+
# Returns an array containing matrices corresponding to the real and imaginary
|
|
1628
|
+
# parts of the matrix
|
|
1629
|
+
#
|
|
1630
|
+
# m.rect == [m.real, m.imag] # ==> true for all matrices m
|
|
1631
|
+
#
|
|
1632
|
+
def rect
|
|
1633
|
+
[real, imag]
|
|
1634
|
+
end
|
|
1635
|
+
alias_method :rectangular, :rect
|
|
1636
|
+
|
|
1637
|
+
#--
|
|
1638
|
+
# CONVERTING -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
|
1639
|
+
#++
|
|
1640
|
+
|
|
1641
|
+
#
|
|
1642
|
+
# The coerce method provides support for Ruby type coercion.
|
|
1643
|
+
# This coercion mechanism is used by Ruby to handle mixed-type
|
|
1644
|
+
# numeric operations: it is intended to find a compatible common
|
|
1645
|
+
# type between the two operands of the operator.
|
|
1646
|
+
# See also Numeric#coerce.
|
|
1647
|
+
#
|
|
1648
|
+
def coerce(other)
|
|
1649
|
+
case other
|
|
1650
|
+
when Numeric
|
|
1651
|
+
return Scalar.new(other), self
|
|
1652
|
+
else
|
|
1653
|
+
raise TypeError, "#{self.class} can't be coerced into #{other.class}"
|
|
1654
|
+
end
|
|
1655
|
+
end
|
|
1656
|
+
|
|
1657
|
+
#
|
|
1658
|
+
# Returns an array of the row vectors of the matrix. See Vector.
|
|
1659
|
+
#
|
|
1660
|
+
def row_vectors
|
|
1661
|
+
Array.new(row_count) {|i|
|
|
1662
|
+
row(i)
|
|
1663
|
+
}
|
|
1664
|
+
end
|
|
1665
|
+
|
|
1666
|
+
#
|
|
1667
|
+
# Returns an array of the column vectors of the matrix. See Vector.
|
|
1668
|
+
#
|
|
1669
|
+
def column_vectors
|
|
1670
|
+
Array.new(column_count) {|i|
|
|
1671
|
+
column(i)
|
|
1672
|
+
}
|
|
1673
|
+
end
|
|
1674
|
+
|
|
1675
|
+
#
|
|
1676
|
+
# Explicit conversion to a Matrix. Returns self
|
|
1677
|
+
#
|
|
1678
|
+
def to_matrix
|
|
1679
|
+
self
|
|
1680
|
+
end
|
|
1681
|
+
|
|
1682
|
+
#
|
|
1683
|
+
# Returns an array of arrays that describe the rows of the matrix.
|
|
1684
|
+
#
|
|
1685
|
+
def to_a
|
|
1686
|
+
@rows.collect(&:dup)
|
|
1687
|
+
end
|
|
1688
|
+
|
|
1689
|
+
# Deprecated.
|
|
1690
|
+
#
|
|
1691
|
+
# Use <code>map(&:to_f)</code>
|
|
1692
|
+
def elements_to_f
|
|
1693
|
+
warn "Matrix#elements_to_f is deprecated, use map(&:to_f)", uplevel: 1
|
|
1694
|
+
map(&:to_f)
|
|
1695
|
+
end
|
|
1696
|
+
|
|
1697
|
+
# Deprecated.
|
|
1698
|
+
#
|
|
1699
|
+
# Use <code>map(&:to_i)</code>
|
|
1700
|
+
def elements_to_i
|
|
1701
|
+
warn "Matrix#elements_to_i is deprecated, use map(&:to_i)", uplevel: 1
|
|
1702
|
+
map(&:to_i)
|
|
1703
|
+
end
|
|
1704
|
+
|
|
1705
|
+
# Deprecated.
|
|
1706
|
+
#
|
|
1707
|
+
# Use <code>map(&:to_r)</code>
|
|
1708
|
+
def elements_to_r
|
|
1709
|
+
warn "Matrix#elements_to_r is deprecated, use map(&:to_r)", uplevel: 1
|
|
1710
|
+
map(&:to_r)
|
|
1711
|
+
end
|
|
1712
|
+
|
|
1713
|
+
#--
|
|
1714
|
+
# PRINTING -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
|
1715
|
+
#++
|
|
1716
|
+
|
|
1717
|
+
#
|
|
1718
|
+
# Overrides Object#to_s
|
|
1719
|
+
#
|
|
1720
|
+
def to_s
|
|
1721
|
+
if empty?
|
|
1722
|
+
"#{self.class}.empty(#{row_count}, #{column_count})"
|
|
1723
|
+
else
|
|
1724
|
+
"#{self.class}[" + @rows.collect{|row|
|
|
1725
|
+
"[" + row.collect{|e| e.to_s}.join(", ") + "]"
|
|
1726
|
+
}.join(", ")+"]"
|
|
1727
|
+
end
|
|
1728
|
+
end
|
|
1729
|
+
|
|
1730
|
+
#
|
|
1731
|
+
# Overrides Object#inspect
|
|
1732
|
+
#
|
|
1733
|
+
def inspect
|
|
1734
|
+
if empty?
|
|
1735
|
+
"#{self.class}.empty(#{row_count}, #{column_count})"
|
|
1736
|
+
else
|
|
1737
|
+
"#{self.class}#{@rows.inspect}"
|
|
1738
|
+
end
|
|
1739
|
+
end
|
|
1740
|
+
|
|
1741
|
+
# Private helper modules
|
|
1742
|
+
|
|
1743
|
+
module ConversionHelper # :nodoc:
|
|
1744
|
+
#
|
|
1745
|
+
# Converts the obj to an Array. If copy is set to true
|
|
1746
|
+
# a copy of obj will be made if necessary.
|
|
1747
|
+
#
|
|
1748
|
+
private def convert_to_array(obj, copy = false) # :nodoc:
|
|
1749
|
+
case obj
|
|
1750
|
+
when Array
|
|
1751
|
+
copy ? obj.dup : obj
|
|
1752
|
+
when Vector
|
|
1753
|
+
obj.to_a
|
|
1754
|
+
else
|
|
1755
|
+
begin
|
|
1756
|
+
converted = obj.to_ary
|
|
1757
|
+
rescue Exception => e
|
|
1758
|
+
raise TypeError, "can't convert #{obj.class} into an Array (#{e.message})"
|
|
1759
|
+
end
|
|
1760
|
+
raise TypeError, "#{obj.class}#to_ary should return an Array" unless converted.is_a? Array
|
|
1761
|
+
converted
|
|
1762
|
+
end
|
|
1763
|
+
end
|
|
1764
|
+
end
|
|
1765
|
+
|
|
1766
|
+
extend ConversionHelper
|
|
1767
|
+
|
|
1768
|
+
module CoercionHelper # :nodoc:
|
|
1769
|
+
#
|
|
1770
|
+
# Applies the operator +oper+ with argument +obj+
|
|
1771
|
+
# through coercion of +obj+
|
|
1772
|
+
#
|
|
1773
|
+
private def apply_through_coercion(obj, oper)
|
|
1774
|
+
coercion = obj.coerce(self)
|
|
1775
|
+
raise TypeError unless coercion.is_a?(Array) && coercion.length == 2
|
|
1776
|
+
coercion[0].public_send(oper, coercion[1])
|
|
1777
|
+
rescue
|
|
1778
|
+
raise TypeError, "#{obj.inspect} can't be coerced into #{self.class}"
|
|
1779
|
+
end
|
|
1780
|
+
|
|
1781
|
+
#
|
|
1782
|
+
# Helper method to coerce a value into a specific class.
|
|
1783
|
+
# Raises a TypeError if the coercion fails or the returned value
|
|
1784
|
+
# is not of the right class.
|
|
1785
|
+
# (from Rubinius)
|
|
1786
|
+
#
|
|
1787
|
+
def self.coerce_to(obj, cls, meth) # :nodoc:
|
|
1788
|
+
return obj if obj.kind_of?(cls)
|
|
1789
|
+
raise TypeError, "Expected a #{cls} but got a #{obj.class}" unless obj.respond_to? meth
|
|
1790
|
+
begin
|
|
1791
|
+
ret = obj.__send__(meth)
|
|
1792
|
+
rescue Exception => e
|
|
1793
|
+
raise TypeError, "Coercion error: #{obj.inspect}.#{meth} => #{cls} failed:\n" \
|
|
1794
|
+
"(#{e.message})"
|
|
1795
|
+
end
|
|
1796
|
+
raise TypeError, "Coercion error: obj.#{meth} did NOT return a #{cls} (was #{ret.class})" unless ret.kind_of? cls
|
|
1797
|
+
ret
|
|
1798
|
+
end
|
|
1799
|
+
|
|
1800
|
+
def self.coerce_to_int(obj)
|
|
1801
|
+
coerce_to(obj, Integer, :to_int)
|
|
1802
|
+
end
|
|
1803
|
+
|
|
1804
|
+
def self.coerce_to_matrix(obj)
|
|
1805
|
+
coerce_to(obj, Matrix, :to_matrix)
|
|
1806
|
+
end
|
|
1807
|
+
|
|
1808
|
+
# Returns `nil` for non Ranges
|
|
1809
|
+
# Checks range validity, return canonical range with 0 <= begin <= end < count
|
|
1810
|
+
def self.check_range(val, count, kind)
|
|
1811
|
+
canonical = (val.begin + (val.begin < 0 ? count : 0))..
|
|
1812
|
+
(val.end ? val.end + (val.end < 0 ? count : 0) - (val.exclude_end? ? 1 : 0)
|
|
1813
|
+
: count - 1)
|
|
1814
|
+
unless 0 <= canonical.begin && canonical.begin <= canonical.end && canonical.end < count
|
|
1815
|
+
raise IndexError, "given range #{val} is outside of #{kind} dimensions: 0...#{count}"
|
|
1816
|
+
end
|
|
1817
|
+
canonical
|
|
1818
|
+
end
|
|
1819
|
+
|
|
1820
|
+
def self.check_int(val, count, kind)
|
|
1821
|
+
val = CoercionHelper.coerce_to_int(val)
|
|
1822
|
+
if val >= count || val < -count
|
|
1823
|
+
raise IndexError, "given #{kind} #{val} is outside of #{-count}...#{count}"
|
|
1824
|
+
end
|
|
1825
|
+
val
|
|
1826
|
+
end
|
|
1827
|
+
end
|
|
1828
|
+
|
|
1829
|
+
include CoercionHelper
|
|
1830
|
+
|
|
1831
|
+
# Private CLASS
|
|
1832
|
+
|
|
1833
|
+
class Scalar < Numeric # :nodoc:
|
|
1834
|
+
include ExceptionForMatrix
|
|
1835
|
+
include CoercionHelper
|
|
1836
|
+
|
|
1837
|
+
def initialize(value)
|
|
1838
|
+
@value = value
|
|
1839
|
+
end
|
|
1840
|
+
|
|
1841
|
+
# ARITHMETIC
|
|
1842
|
+
def +(other)
|
|
1843
|
+
case other
|
|
1844
|
+
when Numeric
|
|
1845
|
+
Scalar.new(@value + other)
|
|
1846
|
+
when Vector, Matrix
|
|
1847
|
+
raise ErrOperationNotDefined, ["+", @value.class, other.class]
|
|
1848
|
+
else
|
|
1849
|
+
apply_through_coercion(other, __method__)
|
|
1850
|
+
end
|
|
1851
|
+
end
|
|
1852
|
+
|
|
1853
|
+
def -(other)
|
|
1854
|
+
case other
|
|
1855
|
+
when Numeric
|
|
1856
|
+
Scalar.new(@value - other)
|
|
1857
|
+
when Vector, Matrix
|
|
1858
|
+
raise ErrOperationNotDefined, ["-", @value.class, other.class]
|
|
1859
|
+
else
|
|
1860
|
+
apply_through_coercion(other, __method__)
|
|
1861
|
+
end
|
|
1862
|
+
end
|
|
1863
|
+
|
|
1864
|
+
def *(other)
|
|
1865
|
+
case other
|
|
1866
|
+
when Numeric
|
|
1867
|
+
Scalar.new(@value * other)
|
|
1868
|
+
when Vector, Matrix
|
|
1869
|
+
other.collect{|e| @value * e}
|
|
1870
|
+
else
|
|
1871
|
+
apply_through_coercion(other, __method__)
|
|
1872
|
+
end
|
|
1873
|
+
end
|
|
1874
|
+
|
|
1875
|
+
def /(other)
|
|
1876
|
+
case other
|
|
1877
|
+
when Numeric
|
|
1878
|
+
Scalar.new(@value / other)
|
|
1879
|
+
when Vector
|
|
1880
|
+
raise ErrOperationNotDefined, ["/", @value.class, other.class]
|
|
1881
|
+
when Matrix
|
|
1882
|
+
self * other.inverse
|
|
1883
|
+
else
|
|
1884
|
+
apply_through_coercion(other, __method__)
|
|
1885
|
+
end
|
|
1886
|
+
end
|
|
1887
|
+
|
|
1888
|
+
def **(other)
|
|
1889
|
+
case other
|
|
1890
|
+
when Numeric
|
|
1891
|
+
Scalar.new(@value ** other)
|
|
1892
|
+
when Vector
|
|
1893
|
+
raise ErrOperationNotDefined, ["**", @value.class, other.class]
|
|
1894
|
+
when Matrix
|
|
1895
|
+
#other.powered_by(self)
|
|
1896
|
+
raise ErrOperationNotImplemented, ["**", @value.class, other.class]
|
|
1897
|
+
else
|
|
1898
|
+
apply_through_coercion(other, __method__)
|
|
1899
|
+
end
|
|
1900
|
+
end
|
|
1901
|
+
end
|
|
1902
|
+
|
|
1903
|
+
end
|
|
1904
|
+
|
|
1905
|
+
|
|
1906
|
+
#
|
|
1907
|
+
# The +Vector+ class represents a mathematical vector, which is useful in its own right, and
|
|
1908
|
+
# also constitutes a row or column of a Matrix.
|
|
1909
|
+
#
|
|
1910
|
+
# == Method Catalogue
|
|
1911
|
+
#
|
|
1912
|
+
# To create a Vector:
|
|
1913
|
+
# * Vector.[](*array)
|
|
1914
|
+
# * Vector.elements(array, copy = true)
|
|
1915
|
+
# * Vector.basis(size: n, index: k)
|
|
1916
|
+
# * Vector.zero(n)
|
|
1917
|
+
#
|
|
1918
|
+
# To access elements:
|
|
1919
|
+
# * #[](i)
|
|
1920
|
+
#
|
|
1921
|
+
# To set elements:
|
|
1922
|
+
# * #[]=(i, v)
|
|
1923
|
+
#
|
|
1924
|
+
# To enumerate the elements:
|
|
1925
|
+
# * #each2(v)
|
|
1926
|
+
# * #collect2(v)
|
|
1927
|
+
#
|
|
1928
|
+
# Properties of vectors:
|
|
1929
|
+
# * #angle_with(v)
|
|
1930
|
+
# * Vector.independent?(*vs)
|
|
1931
|
+
# * #independent?(*vs)
|
|
1932
|
+
# * #zero?
|
|
1933
|
+
#
|
|
1934
|
+
# Vector arithmetic:
|
|
1935
|
+
# * #*(x) "is matrix or number"
|
|
1936
|
+
# * #+(v)
|
|
1937
|
+
# * #-(v)
|
|
1938
|
+
# * #/(v)
|
|
1939
|
+
# * #+@
|
|
1940
|
+
# * #-@
|
|
1941
|
+
#
|
|
1942
|
+
# Vector functions:
|
|
1943
|
+
# * #inner_product(v), #dot(v)
|
|
1944
|
+
# * #cross_product(v), #cross(v)
|
|
1945
|
+
# * #collect
|
|
1946
|
+
# * #collect!
|
|
1947
|
+
# * #magnitude
|
|
1948
|
+
# * #map
|
|
1949
|
+
# * #map!
|
|
1950
|
+
# * #map2(v)
|
|
1951
|
+
# * #norm
|
|
1952
|
+
# * #normalize
|
|
1953
|
+
# * #r
|
|
1954
|
+
# * #round
|
|
1955
|
+
# * #size
|
|
1956
|
+
#
|
|
1957
|
+
# Conversion to other data types:
|
|
1958
|
+
# * #covector
|
|
1959
|
+
# * #to_a
|
|
1960
|
+
# * #coerce(other)
|
|
1961
|
+
#
|
|
1962
|
+
# String representations:
|
|
1963
|
+
# * #to_s
|
|
1964
|
+
# * #inspect
|
|
1965
|
+
#
|
|
1966
|
+
class Vector
|
|
1967
|
+
include ExceptionForMatrix
|
|
1968
|
+
include Enumerable
|
|
1969
|
+
include Matrix::CoercionHelper
|
|
1970
|
+
extend Matrix::ConversionHelper
|
|
1971
|
+
#INSTANCE CREATION
|
|
1972
|
+
|
|
1973
|
+
private_class_method :new
|
|
1974
|
+
attr_reader :elements
|
|
1975
|
+
protected :elements
|
|
1976
|
+
|
|
1977
|
+
#
|
|
1978
|
+
# Creates a Vector from a list of elements.
|
|
1979
|
+
# Vector[7, 4, ...]
|
|
1980
|
+
#
|
|
1981
|
+
def Vector.[](*array)
|
|
1982
|
+
new convert_to_array(array, false)
|
|
1983
|
+
end
|
|
1984
|
+
|
|
1985
|
+
#
|
|
1986
|
+
# Creates a vector from an Array. The optional second argument specifies
|
|
1987
|
+
# whether the array itself or a copy is used internally.
|
|
1988
|
+
#
|
|
1989
|
+
def Vector.elements(array, copy = true)
|
|
1990
|
+
new convert_to_array(array, copy)
|
|
1991
|
+
end
|
|
1992
|
+
|
|
1993
|
+
#
|
|
1994
|
+
# Returns a standard basis +n+-vector, where k is the index.
|
|
1995
|
+
#
|
|
1996
|
+
# Vector.basis(size:, index:) # => Vector[0, 1, 0]
|
|
1997
|
+
#
|
|
1998
|
+
def Vector.basis(size:, index:)
|
|
1999
|
+
raise ArgumentError, "invalid size (#{size} for 1..)" if size < 1
|
|
2000
|
+
raise ArgumentError, "invalid index (#{index} for 0...#{size})" unless 0 <= index && index < size
|
|
2001
|
+
array = Array.new(size, 0)
|
|
2002
|
+
array[index] = 1
|
|
2003
|
+
new convert_to_array(array, false)
|
|
2004
|
+
end
|
|
2005
|
+
|
|
2006
|
+
#
|
|
2007
|
+
# Return a zero vector.
|
|
2008
|
+
#
|
|
2009
|
+
# Vector.zero(3) # => Vector[0, 0, 0]
|
|
2010
|
+
#
|
|
2011
|
+
def Vector.zero(size)
|
|
2012
|
+
raise ArgumentError, "invalid size (#{size} for 0..)" if size < 0
|
|
2013
|
+
array = Array.new(size, 0)
|
|
2014
|
+
new convert_to_array(array, false)
|
|
2015
|
+
end
|
|
2016
|
+
|
|
2017
|
+
#
|
|
2018
|
+
# Vector.new is private; use Vector[] or Vector.elements to create.
|
|
2019
|
+
#
|
|
2020
|
+
def initialize(array)
|
|
2021
|
+
# No checking is done at this point.
|
|
2022
|
+
@elements = array
|
|
2023
|
+
end
|
|
2024
|
+
|
|
2025
|
+
# ACCESSING
|
|
2026
|
+
|
|
2027
|
+
#
|
|
2028
|
+
# :call-seq:
|
|
2029
|
+
# vector[range]
|
|
2030
|
+
# vector[integer]
|
|
2031
|
+
#
|
|
2032
|
+
# Returns element or elements of the vector.
|
|
2033
|
+
#
|
|
2034
|
+
def [](i)
|
|
2035
|
+
@elements[i]
|
|
2036
|
+
end
|
|
2037
|
+
alias element []
|
|
2038
|
+
alias component []
|
|
2039
|
+
|
|
2040
|
+
#
|
|
2041
|
+
# :call-seq:
|
|
2042
|
+
# vector[range] = new_vector
|
|
2043
|
+
# vector[range] = row_matrix
|
|
2044
|
+
# vector[range] = new_element
|
|
2045
|
+
# vector[integer] = new_element
|
|
2046
|
+
#
|
|
2047
|
+
# Set element or elements of vector.
|
|
2048
|
+
#
|
|
2049
|
+
def []=(i, v)
|
|
2050
|
+
raise FrozenError, "can't modify frozen Vector" if frozen?
|
|
2051
|
+
if i.is_a?(Range)
|
|
2052
|
+
range = Matrix::CoercionHelper.check_range(i, size, :vector)
|
|
2053
|
+
set_range(range, v)
|
|
2054
|
+
else
|
|
2055
|
+
index = Matrix::CoercionHelper.check_int(i, size, :index)
|
|
2056
|
+
set_value(index, v)
|
|
2057
|
+
end
|
|
2058
|
+
end
|
|
2059
|
+
alias set_element []=
|
|
2060
|
+
alias set_component []=
|
|
2061
|
+
private :set_element, :set_component
|
|
2062
|
+
|
|
2063
|
+
private def set_value(index, value)
|
|
2064
|
+
@elements[index] = value
|
|
2065
|
+
end
|
|
2066
|
+
|
|
2067
|
+
private def set_range(range, value)
|
|
2068
|
+
if value.is_a?(Vector)
|
|
2069
|
+
raise ArgumentError, "vector to be set has wrong size" unless range.size == value.size
|
|
2070
|
+
@elements[range] = value.elements
|
|
2071
|
+
elsif value.is_a?(Matrix)
|
|
2072
|
+
raise ErrDimensionMismatch unless value.row_count == 1
|
|
2073
|
+
@elements[range] = value.row(0).elements
|
|
2074
|
+
else
|
|
2075
|
+
@elements[range] = Array.new(range.size, value)
|
|
2076
|
+
end
|
|
2077
|
+
end
|
|
2078
|
+
|
|
2079
|
+
# Returns a vector with entries rounded to the given precision
|
|
2080
|
+
# (see Float#round)
|
|
2081
|
+
#
|
|
2082
|
+
def round(ndigits=0)
|
|
2083
|
+
map{|e| e.round(ndigits)}
|
|
2084
|
+
end
|
|
2085
|
+
|
|
2086
|
+
#
|
|
2087
|
+
# Returns the number of elements in the vector.
|
|
2088
|
+
#
|
|
2089
|
+
def size
|
|
2090
|
+
@elements.size
|
|
2091
|
+
end
|
|
2092
|
+
|
|
2093
|
+
#--
|
|
2094
|
+
# ENUMERATIONS -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
|
2095
|
+
#++
|
|
2096
|
+
|
|
2097
|
+
#
|
|
2098
|
+
# Iterate over the elements of this vector
|
|
2099
|
+
#
|
|
2100
|
+
def each(&block)
|
|
2101
|
+
return to_enum(:each) unless block_given?
|
|
2102
|
+
@elements.each(&block)
|
|
2103
|
+
self
|
|
2104
|
+
end
|
|
2105
|
+
|
|
2106
|
+
#
|
|
2107
|
+
# Iterate over the elements of this vector and +v+ in conjunction.
|
|
2108
|
+
#
|
|
2109
|
+
def each2(v) # :yield: e1, e2
|
|
2110
|
+
raise TypeError, "Integer is not like Vector" if v.kind_of?(Integer)
|
|
2111
|
+
raise ErrDimensionMismatch if size != v.size
|
|
2112
|
+
return to_enum(:each2, v) unless block_given?
|
|
2113
|
+
size.times do |i|
|
|
2114
|
+
yield @elements[i], v[i]
|
|
2115
|
+
end
|
|
2116
|
+
self
|
|
2117
|
+
end
|
|
2118
|
+
|
|
2119
|
+
#
|
|
2120
|
+
# Collects (as in Enumerable#collect) over the elements of this vector and +v+
|
|
2121
|
+
# in conjunction.
|
|
2122
|
+
#
|
|
2123
|
+
def collect2(v) # :yield: e1, e2
|
|
2124
|
+
raise TypeError, "Integer is not like Vector" if v.kind_of?(Integer)
|
|
2125
|
+
raise ErrDimensionMismatch if size != v.size
|
|
2126
|
+
return to_enum(:collect2, v) unless block_given?
|
|
2127
|
+
Array.new(size) do |i|
|
|
2128
|
+
yield @elements[i], v[i]
|
|
2129
|
+
end
|
|
2130
|
+
end
|
|
2131
|
+
|
|
2132
|
+
#--
|
|
2133
|
+
# PROPERTIES -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
|
2134
|
+
#++
|
|
2135
|
+
|
|
2136
|
+
#
|
|
2137
|
+
# Returns whether all of vectors are linearly independent.
|
|
2138
|
+
#
|
|
2139
|
+
# Vector.independent?(Vector[1,0], Vector[0,1])
|
|
2140
|
+
# # => true
|
|
2141
|
+
#
|
|
2142
|
+
# Vector.independent?(Vector[1,2], Vector[2,4])
|
|
2143
|
+
# # => false
|
|
2144
|
+
#
|
|
2145
|
+
def Vector.independent?(*vs)
|
|
2146
|
+
vs.each do |v|
|
|
2147
|
+
raise TypeError, "expected Vector, got #{v.class}" unless v.is_a?(Vector)
|
|
2148
|
+
raise ErrDimensionMismatch unless v.size == vs.first.size
|
|
2149
|
+
end
|
|
2150
|
+
return false if vs.count > vs.first.size
|
|
2151
|
+
Matrix[*vs].rank.eql?(vs.count)
|
|
2152
|
+
end
|
|
2153
|
+
|
|
2154
|
+
#
|
|
2155
|
+
# Returns whether all of vectors are linearly independent.
|
|
2156
|
+
#
|
|
2157
|
+
# Vector[1,0].independent?(Vector[0,1])
|
|
2158
|
+
# # => true
|
|
2159
|
+
#
|
|
2160
|
+
# Vector[1,2].independent?(Vector[2,4])
|
|
2161
|
+
# # => false
|
|
2162
|
+
#
|
|
2163
|
+
def independent?(*vs)
|
|
2164
|
+
self.class.independent?(self, *vs)
|
|
2165
|
+
end
|
|
2166
|
+
|
|
2167
|
+
#
|
|
2168
|
+
# Returns whether all elements are zero.
|
|
2169
|
+
#
|
|
2170
|
+
def zero?
|
|
2171
|
+
all?(&:zero?)
|
|
2172
|
+
end
|
|
2173
|
+
|
|
2174
|
+
#
|
|
2175
|
+
# Makes the matrix frozen and Ractor-shareable
|
|
2176
|
+
#
|
|
2177
|
+
def freeze
|
|
2178
|
+
@elements.freeze
|
|
2179
|
+
super
|
|
2180
|
+
end
|
|
2181
|
+
|
|
2182
|
+
#
|
|
2183
|
+
# Called for dup & clone.
|
|
2184
|
+
#
|
|
2185
|
+
private def initialize_copy(v)
|
|
2186
|
+
super
|
|
2187
|
+
@elements = @elements.dup unless frozen?
|
|
2188
|
+
end
|
|
2189
|
+
|
|
2190
|
+
|
|
2191
|
+
#--
|
|
2192
|
+
# COMPARING -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
|
2193
|
+
#++
|
|
2194
|
+
|
|
2195
|
+
#
|
|
2196
|
+
# Returns whether the two vectors have the same elements in the same order.
|
|
2197
|
+
#
|
|
2198
|
+
def ==(other)
|
|
2199
|
+
return false unless Vector === other
|
|
2200
|
+
@elements == other.elements
|
|
2201
|
+
end
|
|
2202
|
+
|
|
2203
|
+
def eql?(other)
|
|
2204
|
+
return false unless Vector === other
|
|
2205
|
+
@elements.eql? other.elements
|
|
2206
|
+
end
|
|
2207
|
+
|
|
2208
|
+
#
|
|
2209
|
+
# Returns a hash-code for the vector.
|
|
2210
|
+
#
|
|
2211
|
+
def hash
|
|
2212
|
+
@elements.hash
|
|
2213
|
+
end
|
|
2214
|
+
|
|
2215
|
+
#--
|
|
2216
|
+
# ARITHMETIC -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
|
2217
|
+
#++
|
|
2218
|
+
|
|
2219
|
+
#
|
|
2220
|
+
# Multiplies the vector by +x+, where +x+ is a number or a matrix.
|
|
2221
|
+
#
|
|
2222
|
+
def *(x)
|
|
2223
|
+
case x
|
|
2224
|
+
when Numeric
|
|
2225
|
+
els = @elements.collect{|e| e * x}
|
|
2226
|
+
self.class.elements(els, false)
|
|
2227
|
+
when Matrix
|
|
2228
|
+
Matrix.column_vector(self) * x
|
|
2229
|
+
when Vector
|
|
2230
|
+
raise ErrOperationNotDefined, ["*", self.class, x.class]
|
|
2231
|
+
else
|
|
2232
|
+
apply_through_coercion(x, __method__)
|
|
2233
|
+
end
|
|
2234
|
+
end
|
|
2235
|
+
|
|
2236
|
+
#
|
|
2237
|
+
# Vector addition.
|
|
2238
|
+
#
|
|
2239
|
+
def +(v)
|
|
2240
|
+
case v
|
|
2241
|
+
when Vector
|
|
2242
|
+
raise ErrDimensionMismatch if size != v.size
|
|
2243
|
+
els = collect2(v) {|v1, v2|
|
|
2244
|
+
v1 + v2
|
|
2245
|
+
}
|
|
2246
|
+
self.class.elements(els, false)
|
|
2247
|
+
when Matrix
|
|
2248
|
+
Matrix.column_vector(self) + v
|
|
2249
|
+
else
|
|
2250
|
+
apply_through_coercion(v, __method__)
|
|
2251
|
+
end
|
|
2252
|
+
end
|
|
2253
|
+
|
|
2254
|
+
#
|
|
2255
|
+
# Vector subtraction.
|
|
2256
|
+
#
|
|
2257
|
+
def -(v)
|
|
2258
|
+
case v
|
|
2259
|
+
when Vector
|
|
2260
|
+
raise ErrDimensionMismatch if size != v.size
|
|
2261
|
+
els = collect2(v) {|v1, v2|
|
|
2262
|
+
v1 - v2
|
|
2263
|
+
}
|
|
2264
|
+
self.class.elements(els, false)
|
|
2265
|
+
when Matrix
|
|
2266
|
+
Matrix.column_vector(self) - v
|
|
2267
|
+
else
|
|
2268
|
+
apply_through_coercion(v, __method__)
|
|
2269
|
+
end
|
|
2270
|
+
end
|
|
2271
|
+
|
|
2272
|
+
#
|
|
2273
|
+
# Vector division.
|
|
2274
|
+
#
|
|
2275
|
+
def /(x)
|
|
2276
|
+
case x
|
|
2277
|
+
when Numeric
|
|
2278
|
+
els = @elements.collect{|e| e / x}
|
|
2279
|
+
self.class.elements(els, false)
|
|
2280
|
+
when Matrix, Vector
|
|
2281
|
+
raise ErrOperationNotDefined, ["/", self.class, x.class]
|
|
2282
|
+
else
|
|
2283
|
+
apply_through_coercion(x, __method__)
|
|
2284
|
+
end
|
|
2285
|
+
end
|
|
2286
|
+
|
|
2287
|
+
def +@
|
|
2288
|
+
self
|
|
2289
|
+
end
|
|
2290
|
+
|
|
2291
|
+
def -@
|
|
2292
|
+
collect {|e| -e }
|
|
2293
|
+
end
|
|
2294
|
+
|
|
2295
|
+
#--
|
|
2296
|
+
# VECTOR FUNCTIONS -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
|
2297
|
+
#++
|
|
2298
|
+
|
|
2299
|
+
#
|
|
2300
|
+
# Returns the inner product of this vector with the other.
|
|
2301
|
+
# Vector[4,7].inner_product Vector[10,1] # => 47
|
|
2302
|
+
#
|
|
2303
|
+
def inner_product(v)
|
|
2304
|
+
raise ErrDimensionMismatch if size != v.size
|
|
2305
|
+
|
|
2306
|
+
p = 0
|
|
2307
|
+
each2(v) {|v1, v2|
|
|
2308
|
+
p += v1 * v2.conj
|
|
2309
|
+
}
|
|
2310
|
+
p
|
|
2311
|
+
end
|
|
2312
|
+
alias_method :dot, :inner_product
|
|
2313
|
+
|
|
2314
|
+
#
|
|
2315
|
+
# Returns the cross product of this vector with the others.
|
|
2316
|
+
# Vector[1, 0, 0].cross_product Vector[0, 1, 0] # => Vector[0, 0, 1]
|
|
2317
|
+
#
|
|
2318
|
+
# It is generalized to other dimensions to return a vector perpendicular
|
|
2319
|
+
# to the arguments.
|
|
2320
|
+
# Vector[1, 2].cross_product # => Vector[-2, 1]
|
|
2321
|
+
# Vector[1, 0, 0, 0].cross_product(
|
|
2322
|
+
# Vector[0, 1, 0, 0],
|
|
2323
|
+
# Vector[0, 0, 1, 0]
|
|
2324
|
+
# ) #=> Vector[0, 0, 0, 1]
|
|
2325
|
+
#
|
|
2326
|
+
def cross_product(*vs)
|
|
2327
|
+
raise ErrOperationNotDefined, "cross product is not defined on vectors of dimension #{size}" unless size >= 2
|
|
2328
|
+
raise ArgumentError, "wrong number of arguments (#{vs.size} for #{size - 2})" unless vs.size == size - 2
|
|
2329
|
+
vs.each do |v|
|
|
2330
|
+
raise TypeError, "expected Vector, got #{v.class}" unless v.is_a? Vector
|
|
2331
|
+
raise ErrDimensionMismatch unless v.size == size
|
|
2332
|
+
end
|
|
2333
|
+
case size
|
|
2334
|
+
when 2
|
|
2335
|
+
Vector[-@elements[1], @elements[0]]
|
|
2336
|
+
when 3
|
|
2337
|
+
v = vs[0]
|
|
2338
|
+
Vector[ v[2]*@elements[1] - v[1]*@elements[2],
|
|
2339
|
+
v[0]*@elements[2] - v[2]*@elements[0],
|
|
2340
|
+
v[1]*@elements[0] - v[0]*@elements[1] ]
|
|
2341
|
+
else
|
|
2342
|
+
rows = self, *vs, Array.new(size) {|i| Vector.basis(size: size, index: i) }
|
|
2343
|
+
Matrix.rows(rows).laplace_expansion(row: size - 1)
|
|
2344
|
+
end
|
|
2345
|
+
end
|
|
2346
|
+
alias_method :cross, :cross_product
|
|
2347
|
+
|
|
2348
|
+
#
|
|
2349
|
+
# Like Array#collect.
|
|
2350
|
+
#
|
|
2351
|
+
def collect(&block) # :yield: e
|
|
2352
|
+
return to_enum(:collect) unless block_given?
|
|
2353
|
+
els = @elements.collect(&block)
|
|
2354
|
+
self.class.elements(els, false)
|
|
2355
|
+
end
|
|
2356
|
+
alias_method :map, :collect
|
|
2357
|
+
|
|
2358
|
+
#
|
|
2359
|
+
# Like Array#collect!
|
|
2360
|
+
#
|
|
2361
|
+
def collect!(&block)
|
|
2362
|
+
return to_enum(:collect!) unless block_given?
|
|
2363
|
+
raise FrozenError, "can't modify frozen Vector" if frozen?
|
|
2364
|
+
@elements.collect!(&block)
|
|
2365
|
+
self
|
|
2366
|
+
end
|
|
2367
|
+
alias map! collect!
|
|
2368
|
+
|
|
2369
|
+
#
|
|
2370
|
+
# Returns the modulus (Pythagorean distance) of the vector.
|
|
2371
|
+
# Vector[5,8,2].r # => 9.643650761
|
|
2372
|
+
#
|
|
2373
|
+
def magnitude
|
|
2374
|
+
Math.sqrt(@elements.inject(0) {|v, e| v + e.abs2})
|
|
2375
|
+
end
|
|
2376
|
+
alias_method :r, :magnitude
|
|
2377
|
+
alias_method :norm, :magnitude
|
|
2378
|
+
|
|
2379
|
+
#
|
|
2380
|
+
# Like Vector#collect2, but returns a Vector instead of an Array.
|
|
2381
|
+
#
|
|
2382
|
+
def map2(v, &block) # :yield: e1, e2
|
|
2383
|
+
return to_enum(:map2, v) unless block_given?
|
|
2384
|
+
els = collect2(v, &block)
|
|
2385
|
+
self.class.elements(els, false)
|
|
2386
|
+
end
|
|
2387
|
+
|
|
2388
|
+
class ZeroVectorError < StandardError
|
|
2389
|
+
end
|
|
2390
|
+
#
|
|
2391
|
+
# Returns a new vector with the same direction but with norm 1.
|
|
2392
|
+
# v = Vector[5,8,2].normalize
|
|
2393
|
+
# # => Vector[0.5184758473652127, 0.8295613557843402, 0.20739033894608505]
|
|
2394
|
+
# v.norm # => 1.0
|
|
2395
|
+
#
|
|
2396
|
+
def normalize
|
|
2397
|
+
n = magnitude
|
|
2398
|
+
raise ZeroVectorError, "Zero vectors can not be normalized" if n == 0
|
|
2399
|
+
self / n
|
|
2400
|
+
end
|
|
2401
|
+
|
|
2402
|
+
#
|
|
2403
|
+
# Returns an angle with another vector. Result is within the [0..Math::PI].
|
|
2404
|
+
# Vector[1,0].angle_with(Vector[0,1])
|
|
2405
|
+
# # => Math::PI / 2
|
|
2406
|
+
#
|
|
2407
|
+
def angle_with(v)
|
|
2408
|
+
raise TypeError, "Expected a Vector, got a #{v.class}" unless v.is_a?(Vector)
|
|
2409
|
+
raise ErrDimensionMismatch if size != v.size
|
|
2410
|
+
prod = magnitude * v.magnitude
|
|
2411
|
+
raise ZeroVectorError, "Can't get angle of zero vector" if prod == 0
|
|
2412
|
+
dot = inner_product(v)
|
|
2413
|
+
if dot.abs >= prod
|
|
2414
|
+
dot.positive? ? 0 : Math::PI
|
|
2415
|
+
else
|
|
2416
|
+
Math.acos(dot / prod)
|
|
2417
|
+
end
|
|
2418
|
+
end
|
|
2419
|
+
|
|
2420
|
+
#--
|
|
2421
|
+
# CONVERTING
|
|
2422
|
+
#++
|
|
2423
|
+
|
|
2424
|
+
#
|
|
2425
|
+
# Creates a single-row matrix from this vector.
|
|
2426
|
+
#
|
|
2427
|
+
def covector
|
|
2428
|
+
Matrix.row_vector(self)
|
|
2429
|
+
end
|
|
2430
|
+
|
|
2431
|
+
#
|
|
2432
|
+
# Returns the elements of the vector in an array.
|
|
2433
|
+
#
|
|
2434
|
+
def to_a
|
|
2435
|
+
@elements.dup
|
|
2436
|
+
end
|
|
2437
|
+
|
|
2438
|
+
#
|
|
2439
|
+
# Return a single-column matrix from this vector
|
|
2440
|
+
#
|
|
2441
|
+
def to_matrix
|
|
2442
|
+
Matrix.column_vector(self)
|
|
2443
|
+
end
|
|
2444
|
+
|
|
2445
|
+
def elements_to_f
|
|
2446
|
+
warn "Vector#elements_to_f is deprecated", uplevel: 1
|
|
2447
|
+
map(&:to_f)
|
|
2448
|
+
end
|
|
2449
|
+
|
|
2450
|
+
def elements_to_i
|
|
2451
|
+
warn "Vector#elements_to_i is deprecated", uplevel: 1
|
|
2452
|
+
map(&:to_i)
|
|
2453
|
+
end
|
|
2454
|
+
|
|
2455
|
+
def elements_to_r
|
|
2456
|
+
warn "Vector#elements_to_r is deprecated", uplevel: 1
|
|
2457
|
+
map(&:to_r)
|
|
2458
|
+
end
|
|
2459
|
+
|
|
2460
|
+
#
|
|
2461
|
+
# The coerce method provides support for Ruby type coercion.
|
|
2462
|
+
# This coercion mechanism is used by Ruby to handle mixed-type
|
|
2463
|
+
# numeric operations: it is intended to find a compatible common
|
|
2464
|
+
# type between the two operands of the operator.
|
|
2465
|
+
# See also Numeric#coerce.
|
|
2466
|
+
#
|
|
2467
|
+
def coerce(other)
|
|
2468
|
+
case other
|
|
2469
|
+
when Numeric
|
|
2470
|
+
return Matrix::Scalar.new(other), self
|
|
2471
|
+
else
|
|
2472
|
+
raise TypeError, "#{self.class} can't be coerced into #{other.class}"
|
|
2473
|
+
end
|
|
2474
|
+
end
|
|
2475
|
+
|
|
2476
|
+
#--
|
|
2477
|
+
# PRINTING -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
|
2478
|
+
#++
|
|
2479
|
+
|
|
2480
|
+
#
|
|
2481
|
+
# Overrides Object#to_s
|
|
2482
|
+
#
|
|
2483
|
+
def to_s
|
|
2484
|
+
"Vector[" + @elements.join(", ") + "]"
|
|
2485
|
+
end
|
|
2486
|
+
|
|
2487
|
+
#
|
|
2488
|
+
# Overrides Object#inspect
|
|
2489
|
+
#
|
|
2490
|
+
def inspect
|
|
2491
|
+
"Vector" + @elements.inspect
|
|
2492
|
+
end
|
|
2493
|
+
end
|