I'm trying to address the issue of odd matrices for strassen's algorithm. My implementation truncates the recursion at a certain point, call it Q, and switches over to the standard implementation. Therefore in doing static padding, I don't actually need to pad up to the next power of 2. I just need to pad up to the least m*2^k greater than the input matrix dimension such that m < Q.
I'm having some trouble implementing this - mainly because I'm not sure what would be most efficient. Do I need to loop through all possible m values, or do I increment from each given input, testing if they fulfill the criteria?