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

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

Build:
Build:
LAST BUILD BRANCH: multilinear-regression
DEFAULT BRANCH: master
Ran 08 Nov 2023 03:33AM UTC
Files 165
Run time 2s
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.1

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`

7543 of 7549 relevant lines covered (99.92%)

184.94 hits per line

Source Files on job 6793412299.1
  • Tree
  • List 0
  • Changed 165
  • Source Changed 165
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 6793412299
  • da47751e on github
  • Prev Job for on develop (#5020897816.1)
  • Next Job for on develop (#8125849986.1)
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

© 2026 Coveralls, Inc