protected DenseMatrix64F computeL(DenseMatrix64F kMatrix, DenseMatrix64F pMatrix) { computeK( kMatrix ); // fill P matrix if the affine parameters need to be computed if ( computeAffine ) { computeP( pMatrix ); DenseMatrix64F lMatrix = new DenseMatrix64F( ndims * ( nLandmarks + ndims + 1 ), ndims * ( nLandmarks + ndims + 1 ) ); CommonOps.insert( kMatrix, lMatrix, 0, 0 ); CommonOps.insert( pMatrix, lMatrix, 0, kMatrix.getNumCols() ); CommonOps.transpose( pMatrix ); CommonOps.insert( pMatrix, lMatrix, kMatrix.getNumRows(), 0 ); CommonOps.insert( kMatrix, lMatrix, 0, 0 ); // P matrix should be zero if points are already affinely aligned // bottom left O2 is already zeros after initializing 'lMatrix' return lMatrix; } else { // in this case the L matrix // consists only of the K block. return kMatrix; } }