SDPSolver.cpp
// Solve the Schur complement equation for dx, dy.
//
// - As inputs, dx and dy are the residues r_x and r_y on the
//   right-hand side of the Schur complement equation.
// - As outputs, dx and dy are overwritten with the solutions of the
//   Schur complement equation.
//
// The equation is solved using the block-decomposition described in
// the manual.
//
Solve the Schur complement equation for dx, dy.
As inputs, dx and dy are the residues r_x and r_y on the
right-hand side of the Schur complement equation.
As outputs, dx and dy are overwritten with the solutions of the
Schur complement equation.

The equation is solved using the block-decomposition described in
the manual.
Solve the Schur complement equation for dx dy . As inputs dx and dy are the residues r_x and r_y on the right - hand side of the Schur complement equation . As outputs dx and dy are overwritten with the solutions of the Schur complement equation . The equation is solved using the block - decomposition described in the manual .
void SDPSolver::solveSchurComplementEquation(Vector &dx, Vector &dy) {
  blockMatrixLowerTriangularSolve(SchurComplementCholesky, dx);
  dyExtended.resize(Q.rows);
  for (unsigned int n = 0; n < dy.size(); n++)
    dyExtended[n] = dy[n];
  vectorScaleMatrixMultiplyTransposeAdd(-1, SchurOffDiagonal, dx, 1, dyExtended);
  for (unsigned int j = 0; j < stabilizeBlockIndices.size(); j++) {
    int b = stabilizeBlockIndices[j];
    int pTopLeft = stabilizeBlockUpdateRow[j];
    int cTopLeft = stabilizeBlockUpdateColumn[j];
    for (int c = 0; c < stabilizeBlocks[b].cols; c++) {
      dyExtended[cTopLeft + c] = 0;
      for (int r = 0; r < stabilizeBlocks[b].rows; r++)
        dyExtended[cTopLeft + c] -= dx[pTopLeft + r] * stabilizeBlocks[b].elt(r, c);
    }
  }
  solveWithLUDecomposition(Q, Qpivots, dyExtended);
  vectorScaleMatrixMultiplyAdd(1, SchurOffDiagonal, dyExtended, 1, dx);
  for (unsigned int j = 0; j < stabilizeBlockIndices.size(); j++) {
    int b = stabilizeBlockIndices[j];
    int pTopLeft = stabilizeBlockUpdateRow[j];
    int cTopLeft = stabilizeBlockUpdateColumn[j];
    for (int c = 0; c < stabilizeBlocks[b].cols; c++)
      for (int r = 0; r < stabilizeBlocks[b].rows; r++)
        dx[pTopLeft + r] += dyExtended[cTopLeft + c] * stabilizeBlocks[b].elt(r, c);
  }
  blockMatrixLowerTriangularTransposeSolve(SchurComplementCholesky, dx);
  for (unsigned int n = 0; n < dy.size(); n++)
    dy[n] = dyExtended[n];
}
void SDPSolver :: solveSchurComplementEquation ( Vector & dx , Vector & dy ) { blockMatrixLowerTriangularSolve ( SchurComplementCholesky , dx ) ; dyExtended . resize ( Q . rows ) ; for ( unsigned int n = 0 ; n < dy . size ( ) ; n ++ ) dyExtended [ n ] = dy [ n ] ; vectorScaleMatrixMultiplyTransposeAdd ( -1 , SchurOffDiagonal , dx , 1 , dyExtended ) ; for ( unsigned int j = 0 ; j < stabilizeBlockIndices . size ( ) ; j ++ ) { int b = stabilizeBlockIndices [ j ] ; int pTopLeft = stabilizeBlockUpdateRow [ j ] ; int cTopLeft = stabilizeBlockUpdateColumn [ j ] ; for ( int c = 0 ; c < stabilizeBlocks [ b ] . cols ; c ++ ) { dyExtended [ cTopLeft + c ] = 0 ; for ( int r = 0 ; r < stabilizeBlocks [ b ] . rows ; r ++ ) dyExtended [ cTopLeft + c ] -= dx [ pTopLeft + r ] * stabilizeBlocks [ b ] . elt ( r , c ) ; } } solveWithLUDecomposition ( Q , Qpivots , dyExtended ) ; vectorScaleMatrixMultiplyAdd ( 1 , SchurOffDiagonal , dyExtended , 1 , dx ) ; for ( unsigned int j = 0 ; j < stabilizeBlockIndices . size ( ) ; j ++ ) { int b = stabilizeBlockIndices [ j ] ; int pTopLeft = stabilizeBlockUpdateRow [ j ] ; int cTopLeft = stabilizeBlockUpdateColumn [ j ] ; for ( int c = 0 ; c < stabilizeBlocks [ b ] . cols ; c ++ ) for ( int r = 0 ; r < stabilizeBlocks [ b ] . rows ; r ++ ) dx [ pTopLeft + r ] += dyExtended [ cTopLeft + c ] * stabilizeBlocks [ b ] . elt ( r , c ) ; } blockMatrixLowerTriangularTransposeSolve ( SchurComplementCholesky , dx ) ; for ( unsigned int n = 0 ; n < dy . size ( ) ; n ++ ) dy [ n ] = dyExtended [ n ] ; }
Solve the Schur complement equation for dx, dy.
Solve the Schur complement equation for dx dy .
// dx = SchurComplementCholesky^{-1} dx // extend dy by additional coordinates z needed for stabilizing // dyExtended = (dy, z) // dy = r_y - SchurOffDiagonal^T dx // z = -V^T dx // dyExtended = Q^{-1} dyExtended // dx += SchurOffDiagonal dy // dx += V z // dx = SchurComplementCholesky^{-T} dx // dy = first few entries of dyExtended