Home > manopt > manifolds > essential > essential_egradE2egrad.m

# essential_egradE2egrad

## PURPOSE

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

## SYNOPSIS

function egrad = essential_egradE2egrad(X, egradE)

## DESCRIPTION

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

function egrad = essential_egradE2egrad(X, egradE)

egradE is the function handle for the gradient in E.

The output is a matrix in the space of X.

See also: essential_costE2cost essential_ehessE2ehess```

## CROSS-REFERENCE INFORMATION

This function calls:
• cat CAT concatenation of two TT/MPS tensors.
• multiprod Matrix multiply 2-D slices of N-D arrays
• multitransp Transpose the matrix slices of an N-D array (no complex conjugate)
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 %
0004 % function egrad = essential_egradE2egrad(X, egradE)
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 %
0010 % See also: essential_costE2cost essential_ehessE2ehess
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 Fri 30-Sep-2022 13:18:25 by m2html © 2005