diff --git a/notes.md b/notes.md index c21d765..7f779f0 100644 --- a/notes.md +++ b/notes.md @@ -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. \ No newline at end of file + - 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 +``` \ No newline at end of file