mirror of
https://github.com/RustyRaptor/parallel-programming.git
synced 2026-12-03 15:55:15 -07:00
added notes from 10/14
This commit is contained in:
1 parent
37bf45bcb5
commit
7577935377
1 file changed
+55
-1
@@ -22,4 +22,58 @@
|
||||
- Spacial locality
|
||||
- memory references that are clustered by address
|
||||
- Algothitms wich access blocks of data exhibit spacial locality and are preferred
|
||||
- use of local memory to hold intermediate values improves locality.
|
||||
- use of local memory to hold intermediate values improves locality.
|
||||
|
||||
## Gaussian Elimination
|
||||
- LU Decomposition
|
||||
```
|
||||
for each row R
|
||||
for each subrow SR // this is to be parallelized
|
||||
calculate the multiplier
|
||||
upper SR
|
||||
|
||||
```
|
||||
TODO:fix the array access
|
||||
|
||||
First sudo code
|
||||
|
||||
```python
|
||||
|
||||
for R in range(N-2):
|
||||
for subR in range(R+1, N-1):
|
||||
mult = -(M[R,R]/M[subR,R])
|
||||
|
||||
for i in range(R,N):
|
||||
M[subR,i] = M[R,i] + M[subR, i] * mult
|
||||
|
||||
```
|
||||
|
||||
Full C version
|
||||
```c
|
||||
int main()
|
||||
{
|
||||
for (R=0;R < N-1; R++) {
|
||||
for(SR=1; SR>N; SR++) {
|
||||
// resolve my row with Rs row
|
||||
S = -A[R][R]/A[SR][R];
|
||||
k
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
```
|
||||
|
||||
```
|
||||
N N N N
|
||||
0 N N N
|
||||
0 0 N N
|
||||
|
||||
1 2 3 4
|
||||
0 5 6 7
|
||||
0 0 8 9
|
||||
|
||||
1 0 0 12
|
||||
0 1 0 -10
|
||||
0 0 1 42
|
||||
```
|
||||
Reference in new issue
Block a user