i envy anybody who debugs this!

This is a discussion on i envy anybody who debugs this! within the C Programming forums, part of the General Programming Boards category; ok my program doesnt run it reads from a file called points.txt it uses subroutines from linear_algebra.h and shared.h and ...

  1. #1
    Registered User
    Join Date
    Nov 2006
    Posts
    19

    i envy anybody who debugs this!

    ok my program doesnt run
    it reads from a file called points.txt
    it uses subroutines from linear_algebra.h and shared.h
    and it is supposed to output 9 points into a csv file called matrix

    i attached everything you need

    if i dont call the Min_Eigen_Vector() function then it runs fine so the problem has to do with that


    please help ... i hafta submit this 2moro

    thank you
    Attached Files Attached Files

  2. #2
    Registered User whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    7,738
    > i hafta submit this 2moro
    Why did you wait so long to debug your program?

  3. #3
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,484
    num_rows read from the file is 7
    A has 9 rows
    you access upto 2*(num_rows-1)+1 rows ==13 is more than you allocate - memory overrun
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  4. #4
    Registered User
    Join Date
    Nov 2006
    Posts
    19
    ur right it does look like i have a malloc problem

    but i dont understand where you get 2*(num_rows-1)+1 rows ==13 is more than you allocate

    and how do i fix it?

  5. #5
    Registered User
    Join Date
    Nov 2006
    Posts
    19
    a is 7 x 6.........where (7=n)
    A is 14 x 9.......where (14=2*n )
    At is 9 x 14
    W is 9 x 9
    and W_in1d is an array of 81

  6. #6
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,484
    I missed something... Allocation is OK

    But still there is a problem with dimentions
    A is 14x9
    and
    At is 14x9 but should be 9x14
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  7. #7
    Registered User
    Join Date
    Nov 2006
    Posts
    19
    ok yayyyyyyyyyyyyy


    i just fixed it!
    thank you soooooooooooooooooooooooooooooooo much
    now i can get some sleep!

    this will be my last post because that was my final assingment for my first and probly my last computer class ever!

  8. #8
     is offline
    ex-samurai 's Avatar
    Join Date
    Nov 2006
    Location
    England
    Posts
    18
    congrats!
    Code:
    int val=0; while(val==0) printf("\a");

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Visual C++ 6.0 Debugs my computer lol
    By RoD in forum Tech Board
    Replies: 9
    Last Post: 03-30-2003, 04:13 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21