Custom Search
 Join the PC homebuilding revolution! Read the all-new, FREE 200-page online guide: How to Build Your Own PC! NOTE: Using robot software to mass-download the site degrades the server and is prohibited. See here for more. Find The PC Guide helpful? Please consider a donation to The PC Guide Tip Jar. Visa/MC/Paypal accepted.

# Thread: A problem in computer programming, can you help

1. Geek Disciple
Join Date
Feb 2004
Posts
50

## A problem in computer programming, can you help

I have a matrix called A
Code:
```0  1  5  6
2  4  7 12
3  8 11 13
9 10 14 15```
I would like to map it into another matrix called B initialized with all zeros. I say 'map' because the way I am doin is to read the matrix A element by element, and take the number behind it, the ones (diag) below it. For example, if my position is at 0, then I have to take 3 numbers 1, 2, 4, this also means B[0][1]=B[0][2]=B[0][4]=1, because I am trying to assign 1 to any place where there is a direction (dgraph, I mean)..

But do you have any other way to solve this instead the one I just describe ???

Thanks a lot

2. Geek Disciple
Join Date
Feb 2004
Posts
50
Here is what I have done but unfortunately received an error in memory access violation and system asks me to report the problem to Microsoft....
lol.

PHP Code:
``` for(int i=0;i<rows;i++)     for(int j=0;j<cols;j++){         B[A[row][col]][A[row][col+1]]=1;         B[A[row][col]][A[row+1][col+1]]=1;         B[A[row][col]][A[row+1][col]]=1; }  ```

3. Geek Disciple
Join Date
Feb 2004
Posts
50
Why no one helps me ?
Please give me some hints ?
You have never helped me even once, can you just treat me as we are in A NORMAL RELATIONSHIP??????

4. i would love to help. but i dont know the answer as well. sorry