Home > manopt > manifolds > essential > essential_egradE2egrad.m

## PURPOSE

Converts the gradient in essential matrix E to the gradient in X.

## DESCRIPTION

``` Converts the gradient in essential matrix E to the gradient in X.

egradE is the function handle for the gradient in E.

The output is a matrix in the space of X.

## CROSS-REFERENCE INFORMATION

This function calls:
• multiprod Multiplying 1-D or 2-D subarrays contained in two N-D arrays.
• multitransp Transposing arrays of matrices.
This function is called by:
• essential_svd Sample solution of an optimization problem on the essential manifold.

## SOURCE CODE

```0001 function egrad = essential_egradE2egrad(X, egradE)
0002 % Converts the gradient in essential matrix E to the gradient in X.
0003 %
0005 %
0006 % egradE is the function handle for the gradient in E.
0007 %
0008 % The output is a matrix in the space of X.
0009 %
0011
0012
0013 % This file is part of Manopt: www.manopt.org.
0014 % Original author: Roberto Tron, Aug. 8, 2014
0015 % Contributors: Bamdev Mishra, May 22, 2015.
0016
0017     e3hat = [0 -1 0; 1 0 0; 0 0 0];
0018     RA = X(:,1:3,:);
0019     RB = X(:,4:6,:);
0020     E = multiprod(multiprod(multitransp(RA), e3hat), RB);
0021     G =  egradE(E);
0022
0023     %The following is the vectorized version of egrad = e3hat*[RB*G' -RA*G];
0024     egrad = multiprod(e3hat, cat(2,...
0025         multiprod(RB, multitransp(G)),...
0026         -multiprod(RA, G)));
0027 end
0028```

Generated on Mon 10-Sep-2018 11:48:06 by m2html © 2005