Wrox Programmer Forums > Java Sum of sub-matrix of a matrix
 |
 Java Basics General beginning Java language questions that don't fit in one of the more specific forums. Please specify what version.
 Welcome to the p2p.wrox.com Forums. You are currently viewing the Java Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com

March 4th, 2007, 03:45 PM
 Gromlok Registered User Join Date: Mar 2007 Posts: 1 Thanks: 0 Thanked 0 Times in 0 Posts
Sum of sub-matrix of a matrix

Hallo:
I need some suggestions:
There is a M int square matrix of NxN, and i need to get the sum of ALL the submatrices, a submatrix is not less than 1x1.
For ex:
M = 1 2 3 4
-5 -6 8 1
9 10 2 8
-6 8 9 1
A first sum would be all the M matrix = 1 + 2 +... + 9 + 1
Another could be the submatrix [1 2 3] [-5 -6 8] = 1 + 2 + .. + (-6) + 8
Another could be [1 2 3 4], and another could be [1 -5 9 -6],
Also the middle matrix could be, for ex [-6 8] [10 2]

As you can see there are a lot of cases, i was trying to do some loops imitating the procedure of calculating a determinant of a Matrix, but there are many cases out.

So, if you could suggest me a way -efficient and short code way- to implement this i would be thankful.

Greetings

Gromlok

 Similar Threads Thread Thread Starter Forum Replies Last Post XSLT - MATRIX JohnnyP XSLT 0 March 12th, 2007 02:24 PM From gridView in matrix pro10 C# 0 February 4th, 2007 06:30 AM Matrix filter jpenn Reporting Services 0 August 10th, 2006 03:46 PM matrix report rhbandagi Classic ASP Databases 0 March 24th, 2006 04:06 AM hadamard matrix detfella Visual C++ 0 February 19th, 2004 02:41 PM