Optimal division of a matrix for processing

sam_wilson
Messages
4
Reaction score
0
I apologies if this is in the wrong place!

I'm a Computer science person with a keen interest in maths and occasionally the two topics cross paths.

I am working on an matrix manipulation package in Java/C but seriously require some help with the maths, I am witting into it, parallelization at the moments and i am looking for a solution to this problem below, Hopefully if there is a method to calculate this in linear time i would be great full, if not a heuristic algorithm will have to do

Given a Matrix NxM find a solution x, y which meets the following constraints

z is a Real Positive Interger which is greater than 0 (Set by some processor loading statistics, not variable and could be treated as a constant)

x * y <= z

x mod n = 0

y mod m = 0

n, m, x, y, z > 0

if there is a solution to this, x,y will be the dimensions of a submatrix which will be able to be processed independently of the rest.

Initially I though this would be a trivial Linear programming solution, But up until yet in my maths career i am unaware of how to express a mod function as a feasibility region. From Some of my scribbles on paper and from some simple benchmarking of the problem in my framework i have discovered that the optimal answer is around the sqrt of z, which is would made scene as so far i have only been trying with square matrices.

This problem if solved would provide a fast way of distributing Matrix multiplication across a cluster.
 
Last edited:
Mathematics news on Phys.org
bump :D
 
Refinement of one of the constraints

(n/x)*(m/y) <= z

N.BN = n, M = m
 
Is this really the no brainer, that I think you ask for?

you are looking for multiples of n and m we may call a*n and b*m that fulfill the requirement a*b<=z

So if z>=1 you pick any a < z/2 and b can be chosen as b = z /a


But I think you messed up the modules and you are really looking for: m mod x = 0 This will require prime factorization and you will not find a general linear time algorithm for this.
 
You are correct i did mess up the modulus constraints opps!

So is the only solution to this problem factorization?


Thanks
 
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Fermat's Last Theorem has long been one of the most famous mathematical problems, and is now one of the most famous theorems. It simply states that the equation $$ a^n+b^n=c^n $$ has no solutions with positive integers if ##n>2.## It was named after Pierre de Fermat (1607-1665). The problem itself stems from the book Arithmetica by Diophantus of Alexandria. It gained popularity because Fermat noted in his copy "Cubum autem in duos cubos, aut quadratoquadratum in duos quadratoquadratos, et...
Thread 'Imaginary Pythagorus'
I posted this in the Lame Math thread, but it's got me thinking. Is there any validity to this? Or is it really just a mathematical trick? Naively, I see that i2 + plus 12 does equal zero2. But does this have a meaning? I know one can treat the imaginary number line as just another axis like the reals, but does that mean this does represent a triangle in the complex plane with a hypotenuse of length zero? Ibix offered a rendering of the diagram using what I assume is matrix* notation...
Back
Top