source:
proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/opt/yalmip/extras/detn.m
@
37
Last change on this file since 37 was 37, checked in by , 14 years ago | |
---|---|
File size: 401 bytes |
Line | |
---|---|
1 | function d = detn(X) |
2 | %DETN Internal function used in construction of MAXDET formulations |
3 | |
4 | % Author Johan Löfberg |
5 | % $Id: detn.m,v 1.2 2004/07/02 08:17:30 johanl Exp $ |
6 | |
7 | [n,m]=size(X); |
8 | |
9 | if n~=m |
10 | error |
11 | else |
12 | if n==2 |
13 | d = X(1,1)*X(2,2)-X(1,2)*X(2,1); |
14 | else |
15 | d = 0; |
16 | for i = 1:n |
17 | d = d + (-1)^(i+1)*X(i,1)*detn(X([1:1:i-1 i+1:1:n],2:end)); |
18 | end |
19 | end |
20 | end |
Note: See TracBrowser
for help on using the repository browser.