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.
Results 1 to 4 of 4

Thread: A problem in computer programming, can you help

  1. #1

    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 ???

    Please give me your ideas...

    Thanks a lot

  2. #2
    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;

    Help me please........
    Thanks again in advance

  3. #3
    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. #4
    Join Date
    Jul 2002
    Location
    Philippines/ LA now
    Posts
    504
    i would love to help. but i dont know the answer as well. sorry

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •