Thread: Matrix Calculation

  1. #1
    Registered User
    Join Date
    Dec 2014
    Posts
    7

    Matrix Calculation

    I have a matrix and 2 pointers i,j.
    Sub-matrix is a square or rectangle, which begins in one of the cells in the matrix and continues until the cell [n-1] [m-1].
    The function has to calculate the starting cells that sum of the values of its sub-matrix is the highest, and save the the this sub-matrix indexes with the pointers i,j.

    Can anyone help me with this?

  2. #2
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,909
    Read the homework policy (Announcements - General Programming Boards), you will need to make some effort on your own before we get to helping you with code.

    As has been pointed out to you in one of your other threads, working this out on paper first is a good idea. You can start with a 5x5 matrix with random numbers; check sub-matrices of, say, 2x2 size. Do it by hand and pay close attention to how you move through the matrix and the sub-matrices, and how the sub-matrix moves. Also, pay close attention to how you handle this near the edges.

    Note, you call i and j "pointers". You could do this with pointers, but it seems declaring i and j as ints and using them as array indices would be easier.

    You likely wont get any more help until you make a real effort and show us your code. Remember, it needs to be posted in [code][/code] tags, and it should be properly formatted and indented: Indent style - Wikipedia, the free encyclopedia.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 05-19-2014, 07:32 PM
  2. Finding a sub-matrix in a bigger matrix
    By pashakhanloo in forum C++ Programming
    Replies: 1
    Last Post: 10-31-2012, 10:42 AM
  3. Need help in Matrix Addition & finding Inverse of a Matrix
    By ssatyan.129 in forum C Programming
    Replies: 6
    Last Post: 05-15-2009, 02:48 PM
  4. Matrix Determination calculation
    By disruptivetech in forum C Programming
    Replies: 1
    Last Post: 04-17-2008, 06:46 AM
  5. Matrix: Reloaded + Enter The Matrix (the game)
    By LuckY in forum A Brief History of Cprogramming.com
    Replies: 10
    Last Post: 04-18-2003, 12:35 AM