What's the name for the mathematical operation that takes out a common factor from a matrix?

66 Views Asked by At

I have a simple problem that I want to solve, I digged into matrix factorization algorithms and several Octave/Matlab functions but there isn't much that is helping me with that, I think that I need to formalize my problem in a different way .

I have a matrix of real floating-point numbers $M_R$, this matrix is guaranteed to have a rational common factor $k$ among all the members of $M_R$ that makes $M_R$ itself a matrix of integers $M_I$ .

In another words $$M_R = k * M_I$$ where $k$ is something in the form of $\frac{n}{m}$

I have to get the integer form for 2 reasons: better machine precision and algorithms/computational complexity .

the obvious choice is some form of $gcd$ but that doesn't work well with floating point numbers and it's basically an approximation of what I want, it all depends where I truncate the floating point number, I see that more like an hack than a real math solution .

The problem is : given the $M_R$ matrix how you find $M_I$ or $k$ ?

PS: all the members of $M_R$ are non-zero and non-negative