Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use gauss_elimination_interval to solve A*b = x in contractors #111

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Kolaru
Copy link
Collaborator

@Kolaru Kolaru commented Feb 8, 2019

This PR forces the used of (preconditionned) Gauss elimination in Newton contractor.

It required some adjustement as the previous definition of the algorithm for SArray was incorrect. In order to stay simple, this PR drops support for vector and matrices that are neither MArray or SArray

The change result in small perfomance improvements. Unfortunately not enough to test the functions mentionned in #108 and #86 in a reasonnable amount of time, but it is a first step towards solving these issues.

Other changes:

  • The benchmarks have been changed to use SArray rather thant Array.
  • Due to the previous, gauss_seidel_contractor had to be modified to handle SArray efficiently.
  • The Smiley tests now also test Krawczyk method.

And finally here is the benchmark report. Note that the improvements concerning the functions in linear_eq.jl do not give much information as the benchmarks where modified.


Benchmark report

Benchmark Report for IntervalRootFinding

Job Properties

  • Time of benchmarks:
    • Target: 8 Feb 2019 - 01:46
    • Baseline: 8 Feb 2019 - 01:49
  • Package commits:
    • Target: 91e0a4
    • Baseline: 8f605c
  • Julia commits:
    • Target: 80516c
    • Baseline: 80516c
  • Julia command flags:
    • Target: None
    • Baseline: None
  • Environment variables:
    • Target: None
    • Baseline: None

Results

A ratio greater than 1.0 denotes a possible regression (marked with ❌), while a ratio less
than 1.0 denotes a possible improvement (marked with ✅). Only significant results - results
that indicate possible regressions or improvements - are shown below (thus, an empty table means that all
benchmark results remained invariant between builds).

ID time ratio memory ratio
["Dietmar-Ratz", "Dietmar-Ratz 9", "Krawczyk"] 0.92 (5%) ✅ 1.00 (1%)
["Linear equations", "n = 10", "Gauss elimination"] 0.61 (5%) ✅ 1.08 (1%) ❌
["Linear equations", "n = 10", "Gauss seidel contractor"] 0.74 (5%) ✅ 0.47 (1%) ✅
["Linear equations", "n = 10", "Gauss seidel"] 0.63 (5%) ✅ 0.14 (1%) ✅
["Linear equations", "n = 2", "Gauss elimination"] 0.14 (5%) ✅ 0.17 (1%) ✅
["Linear equations", "n = 2", "Gauss seidel contractor"] 0.44 (5%) ✅ 0.06 (1%) ✅
["Linear equations", "n = 2", "Gauss seidel"] 0.31 (5%) ✅ 0.02 (1%) ✅
["Linear equations", "n = 5", "Gauss elimination"] 0.61 (5%) ✅ 0.53 (1%) ✅
["Linear equations", "n = 5", "Gauss seidel contractor"] 0.84 (5%) ✅ 0.20 (1%) ✅
["Linear equations", "n = 5", "Gauss seidel"] 0.71 (5%) ✅ 0.06 (1%) ✅
["Rastigrin stationary points", "Newton"] 0.83 (5%) ✅ 0.86 (1%) ✅
["Smiley", "Smiley and Chun (2001), Example 2.2", "Newton"] 0.97 (5%) 0.98 (1%) ✅
["Smiley", "Smiley and Chun (2001), Example 5.2", "Newton"] 0.78 (5%) ✅ 0.83 (1%) ✅
["Smiley", "Smiley and Chun (2001), Example 5.4", "Newton"] 1.00 (5%) 1.01 (1%) ❌

Benchmark Group List

Here's a list of all the benchmark groups executed by this job:

  • ["Dietmar-Ratz", "Dietmar-Ratz 1"]
  • ["Dietmar-Ratz", "Dietmar-Ratz 2"]
  • ["Dietmar-Ratz", "Dietmar-Ratz 3"]
  • ["Dietmar-Ratz", "Dietmar-Ratz 4"]
  • ["Dietmar-Ratz", "Dietmar-Ratz 5"]
  • ["Dietmar-Ratz", "Dietmar-Ratz 6"]
  • ["Dietmar-Ratz", "Dietmar-Ratz 7"]
  • ["Dietmar-Ratz", "Dietmar-Ratz 8"]
  • ["Dietmar-Ratz", "Dietmar-Ratz 9"]
  • ["Linear equations", "n = 10"]
  • ["Linear equations", "n = 2"]
  • ["Linear equations", "n = 5"]
  • ["Rastigrin stationary points"]
  • ["Smiley", "Smiley and Chun (2001), Example 2.2"]
  • ["Smiley", "Smiley and Chun (2001), Example 5.2"]
  • ["Smiley", "Smiley and Chun (2001), Example 5.4"]

Julia versioninfo

Target

Julia Version 1.1.0
Commit 80516ca202 (2019-01-21 21:24 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
      Microsoft Windows [version 10.0.17763.292]
  CPU: Intel(R) Core(TM) i5-6600K CPU @ 3.50GHz: 
              speed         user         nice          sys         idle          irq
       #1  3504 MHz   20717015            0     12064281    136707359      2893265  ticks
       #2  3504 MHz   20986640            0      8425671    140076125       221156  ticks
       #3  3504 MHz   27314125            0      7700046    134474265       157843  ticks
       #4  3504 MHz   27567140            0      8096406    133824890       168750  ticks
       
  Memory: 15.95343017578125 GB (8450.8984375 MB free)
  Uptime: 295600.0 sec
  Load Avg:  0.0  0.0  0.0
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, skylake)

Baseline

Julia Version 1.1.0
Commit 80516ca202 (2019-01-21 21:24 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
      Microsoft Windows [version 10.0.17763.292]
  CPU: Intel(R) Core(TM) i5-6600K CPU @ 3.50GHz: 
              speed         user         nice          sys         idle          irq
       #1  3504 MHz   20752468            0     12070468    136819640      2894718  ticks
       #2  3504 MHz   21026109            0      8430671    140185578       221281  ticks
       #3  3504 MHz   27361468            0      7704109    134576781       157890  ticks
       #4  3504 MHz   27616078            0      8101140    133925140       168750  ticks
       
  Memory: 15.95343017578125 GB (8412.49609375 MB free)
  Uptime: 295754.0 sec
  Load Avg:  0.0  0.0  0.0
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, skylake)

@codecov-io
Copy link

codecov-io commented Feb 8, 2019

Codecov Report

Merging #111 into master will increase coverage by 0.63%.
The diff coverage is 70.37%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #111      +/-   ##
==========================================
+ Coverage   58.48%   59.12%   +0.63%     
==========================================
  Files          11       11              
  Lines         542      526      -16     
==========================================
- Hits          317      311       -6     
+ Misses        225      215      -10
Impacted Files Coverage Δ
src/IntervalRootFinding.jl 5.55% <ø> (ø) ⬆️
src/linear_eq.jl 74.13% <70.37%> (+7.92%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 004994d...d375e57. Read the comment docs.

end
inv_diagA = inv(diagA)
inv_diagA = 1 ./ diagA

for iter in 1:maxiter
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe there should be a more sophisticated convergence check here that checks some kind of rate of convergence?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reference given (Eldon Hansen and G. William Walster : Global Optimization Using Interval Analysis - Chapter 5 - Page 115) does only state the process can be iterated until no changes happen. I'll have to dig a bit more in the litterature to see if something more subtle exist.

Reading the litterature in more detail may also indicate if Gauss elimination is the best choice as default linear equation solver.

@dpsanders
Copy link
Member

From what I've read, it's recommended to use interval Gauss-Seidel. Probably we should change \ to use that.

@dpsanders
Copy link
Member

Or is that what's already being done?

@dpsanders
Copy link
Member

Sorry this fell off the radar; it looks very nice.

@Kolaru Are you able to come back to this or should I try to?

@Kolaru
Copy link
Collaborator Author

Kolaru commented Jul 2, 2020

I tried to rebase or merge, but the conflicts come from #153 with which I'm not familiar, making it hard. So if you still have the changes in mind you may have more luck than me. Otherwise I'll take a deeper look, probably next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants