• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

markrogoyski / math-php / 6793412299
100%
master: 100%

Build:
Build:
LAST BUILD BRANCH: develop
DEFAULT BRANCH: master
Ran 08 Nov 2023 03:33AM UTC
Jobs 1
Files 165
Run time 12s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

08 Nov 2023 03:31AM UTC coverage: 99.921% (+0.001%) from 99.92%
6793412299

push

github

web-flow
Replace array_search with floating-point filter in `Eigenvector::eigenvectors` (#473)

* Test Eigenvectors can handle numerical imprecision

To mimic the error found in the QR algorithm, we have to test with matrices that have duplicate eigenvalues and introduce numerical precision errors.

To do this, a list of perturbed eigenvalues is passed to the eigenvectors method. The perturbation is achieved by adding a random +/- offset on an order of magnitude smaller than the default matrix error. This should allow the math to work out fine while causing the floating point comparison to fail.

* Replace array_search with floating-point filter

array_search seems to fail in most cases when looking for a float in an array of floats. And even if it does find a match, if the key is 0, php evaluates `!0` to true.

To find a match, we can instead loop through and compare the numbers with `Arithmetic::almostEqual` and then explicitly check if `$key === false`

6 of 6 new or added lines in 1 file covered. (100.0%)

7543 of 7549 relevant lines covered (99.92%)

184.94 hits per line

Jobs
ID Job ID Ran Files Coverage
1 6793412299.1 08 Nov 2023 03:32AM UTC 165
99.92
GitHub Action Run
Source Files on build 6793412299
  • Tree
  • List 165
  • Changed 165
  • Source Changed 165
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • da47751e on github
  • Prev Build on develop (#5020897816)
  • Next Build on develop (#8125849986)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc