yolo
This commit is contained in:
parent
6c538d91b5
commit
6af0f377d3
12
5/code.py
Normal file
12
5/code.py
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
import numpy as np
|
||||||
|
from copy import deepcopy as dp
|
||||||
|
|
||||||
|
def gradient_conjugué(A, b, nb=50):
|
||||||
|
p = dp(b)
|
||||||
|
r = dp(b)
|
||||||
|
x = np.zeroes(b.shape)
|
||||||
|
for i in range(nb):
|
||||||
|
α = (r.transpose() @ r) / (p.transpose() @ A @ p)
|
||||||
|
x = x + α @ p
|
||||||
|
r = r - α @ A @ p
|
6
5/tableau_prof.txt
Normal file
6
5/tableau_prof.txt
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
Méthode du gradient conjugué
|
||||||
|
|
||||||
|
On cherche x tq A.x=b
|
||||||
|
A matrice p×p symétrique définie positive (donc inversible)
|
||||||
|
|
||||||
|
On cherche à résoudre cette équation (les t dans la formule c'est la transposée)
|
Reference in New Issue
Block a user