-
Notifications
You must be signed in to change notification settings - Fork 2
Docs: V0.2-tutorials/consistent linear system example #129
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
base: main
Are you sure you want to change the base?
Changes from 42 commits
53c4e55
f82346b
95b0cd8
64760f1
1633503
c6de884
f7a284f
0d10ada
1d5ac70
ffba348
2c54d6a
ff88338
6708ae9
63a9479
c557f17
25f4099
7c3fb87
7b0534d
6226f6b
e83a636
e5b94a9
99fa32a
bba815a
b6760bd
0827c79
ff201f0
43bec29
3198fad
c6caee7
45f413f
2b5de08
80129e4
34c0dcc
1909a3e
80aeb6b
c79ffec
c359f9d
20fea52
8c51331
543f3e5
8863bcb
569da4e
52d8322
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,143 @@ | ||||||||
| # Solving a Consistent Linear System | ||||||||
|
|
||||||||
| This guide demonstrates how to use `RLinearAlgebra.jl` package to solve a | ||||||||
| **consistent linear system**—a system where at least one solution | ||||||||
| exists—expressed in the form: | ||||||||
|
||||||||
|
|
||||||||
| $$Ax = b$$ | ||||||||
|
||||||||
|
|
||||||||
| We'll walk through setting up the problem, using a solver, and verifying the result. | ||||||||
|
|
||||||||
| --- | ||||||||
| ## Problem setup and solve the system | ||||||||
|
||||||||
|
|
||||||||
| First, let's define our linear system $Ax = b$. | ||||||||
|
||||||||
| First, let's define our linear system $Ax = b$. | |
| First, let's define our linear system $Ax = b$ with some known solution `x_true`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove this.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove this line as it is not relevant to problem setup.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| As simple as you can imagine, `RLinearAlgebra.jl` can solve this system in just a | |
| few lines of codes and high efficiency: | |
| `RLinearAlgebra.jl` can solve this system in just a few lines of codes: |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| logger = BasicLogger(max_it = 300) | |
| kaczmarz_solver = Kaczmarz(log = logger) | |
| solver = Kaczmarz(log = BasicLogger(max_it = 300)) |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| solver_recipe = complete_solver(kaczmarz_solver, x_init, A, b) | |
| solution = zeros(Float64, num_cols) |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| rsolve!(solver_recipe, x_init, A, b) | |
| rsolve!(solver, solution, A, b) |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove these
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"rsolve! puts the solution in the vector solution.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can go somewhere else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--->---