bool CLinkMatrix::rightMultiply(const C_FLOAT64 & alpha, const CMatrix< C_FLOAT64> & m, CMatrix< C_FLOAT64> & p) const { bool success = true; if (m.numCols() != mRowPivots.size()) { return false; } // p := alpha * (m1, m2) * (I, L0')' = alpha * m1 + alpha * m2 * L0 p.resize(m.numRows(), getNumIndependent()); char T = 'N'; C_INT M = (C_INT) p.numCols(); C_INT N = (C_INT) p.numRows(); C_INT K = (C_INT) numRows(); C_INT LDA = (C_INT) numCols(); C_INT LDB = (C_INT) m.numCols(); C_INT LDC = (C_INT) p.numCols(); // p := m1 C_FLOAT64 *pRowP = p.array(); const C_FLOAT64 *pRowM = m.array(); C_FLOAT64 *pEnd = p.array() + p.size(); for (; pRowP < pEnd; pRowP += LDC, pRowM += LDB) { memcpy(pRowP, pRowM, sizeof(C_FLOAT64) * LDC); } // DGEMM (TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC) // C := alpha A B + beta C dgemm_(&T, &T, &M, &N, &K, const_cast< C_FLOAT64 * >(&alpha), const_cast< C_FLOAT64 * >(array()), &LDA, const_cast< C_FLOAT64 * >(m.array()) + LDA, &LDB, const_cast< C_FLOAT64 * >(&alpha), p.array(), &LDC); return success; }
C_FLOAT64 * CState::resize(const unsigned C_INT32 & size) { if (mSize != size) { C_FLOAT64 * pTmp = mpValues; if (size > 0) { mpValues = new C_FLOAT64[size]; memcpy(mpValues, pTmp, sizeof(C_FLOAT64) * std::min(mSize, size)); } else mpValues = NULL; pdeletev(pTmp); mSize = size; } updateIterator(getNumIndependent(), getNumDependent(), getNumFixed()); return mpValues; }