I have a drug-target matrix A (5000 rows(target) * 6000 columns (drugs)), in which each element is a_ij, The second matrix is S, which is 6000 * 6000 matrix (drug-drug similarity matrix), where each element is s_lk. I would like to calculate the following formula: m_ij = sum(k=1..m, l=1..m) (a_il*a_jk*s_lk), [i.e., https://www.dropbox.com/s/5nw7ha5j8pkgcr9/sum.pdf?dl=0] which should a 5000 * 5000 matrix. Here m_ij will be used to calculate the target-target similarity as described in Bioinformatics Journal <<Drug-target interaction prediction through domain-tuned network-based inference>>
What is the efficient way to calculate such summation of product?
Can you give me a tip to calculate such formula, or some course to give a presentation to deal with such formula efficiently.