Skip to content

Commit

Permalink
Linux changes
Browse files Browse the repository at this point in the history
  • Loading branch information
areslp committed Sep 1, 2013
2 parents eadeb06 + 4e27898 commit 5849072
Show file tree
Hide file tree
Showing 1,612 changed files with 97,161 additions and 7,328 deletions.
6 changes: 4 additions & 2 deletions LADM_LRR/adm_lrr.m
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@
else
Y1 = Y1 + mu*leq1;
Y2 = Y2 + mu*leq2;
mu = min(max_mu,mu*rho);
% if relChg < tol2
mu = min(max_mu,mu*rho);
% end
end
end

Expand All @@ -124,4 +126,4 @@
x = (nw-lambda)*w/nw;
else
x = zeros(length(w),1);
end
end
52 changes: 52 additions & 0 deletions Ncut_9/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Normalized Cut Segmentation Code %
% %
% Timothee Cour (INRIA), Stella Yu (Berkeley), Jianbo Shi (UPENN) %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

License
This software is made publicly for research use only. It may be modified and redistributed under the terms of the GNU General Public License.

Citation
Please cite the following if you plan to use the code in your own work:
* Normalized Cuts and Image Segmentation, Jianbo Shi and Jitendra Malik, IEEE Transactions on Pattern Analysis and Machine Intelligence (PAMI) 2000
* Normalized Cut Segmentation Code, Timothee Cour, Stella Yu, Jianbo Shi. Copyright 2004 University of Pennsylvania, Computer and Information Science Department.

Tested on matlab R2009b.

Installation Notes :

1) After you unzipped the files to mydir,
put the Current Directory in Matlab to mydir

2) In the matlab command prompt,
type compileDir_simple to compile the mex files (ignore the error on the C++ non-mex file; needs to be done once)

3) You can now try any of the functions

type demoNcutImage to see a demo of image segmentation
type demoNcutClustering to see a demo of point cloud clustering


Other top level functions:

NcutImage.m: given image "I", segment it into "nbSegments" segments
[SegLabel,NcutDiscrete,NcutEigenvectors,NcutEigenvalues,W]= NcutImage(I,nbSegments);

ICgraph.m: compute Intervening Contour based pixel similarity matrix W
W = ICgraph(I);

ncutW.m: Given a similarity graph "W", computes Ncut clustering on the graph into "nbSegments" groups;
[NcutDiscrete,NcutEigenvectors,NcutEigenvalues] = ncutW(W,nbSegments);


Release notes:

2010, January 22: release of all c++ source mex files compatible with matlab R2009b
2006, May 04: release version 8: fixed incompatibility issues with new matlab
2004, June 18: release version 7: initial release

Maintained by Timothee Cour, timothee dot cour at gmail dot com

January 22, 2010.
Empty file added Ncut_9/a_times_b_cmplx.mexw64
Empty file.
Binary file added Ncut_9/affinityic.mexw64
Binary file not shown.
Binary file added Ncut_9/cimgnbmap.mexw64
Binary file not shown.
4 changes: 2 additions & 2 deletions Ncut_9/eigs_new.m
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@
t0 = cputime; % start timing ARPACK calls **aupd

if isrealprob
arpackc( aupdfun, ido, ...
[ido, info] = arpackc( aupdfun, ido, ...
bmat, intconvert(n), whch, nev, tol, resid, ncv, ...
v, ldv, iparam, ipntr, workd, workl, lworkl, info );
else
Expand Down Expand Up @@ -316,7 +316,7 @@

if isrealprob
if issymA
arpackc( eupdfun, rvec, 'A', select, ...
[ido,info]=arpackc( eupdfun, rvec, 'A', select, ...
d, v, ldv, sigma, ...
bmat, intconvert(n), whch, nev, tol, resid, ncv, ...
v, ldv, iparam, ipntr, workd, workl, lworkl, info );
Expand Down
Binary file added Ncut_9/hide/._ICgraph.m
Binary file not shown.
Binary file added Ncut_9/hide/._NcutImage.m
Binary file not shown.
Binary file added Ncut_9/hide/._README.txt
Binary file not shown.
Binary file added Ncut_9/hide/._X2distances.m
Binary file not shown.
Binary file added Ncut_9/hide/._a_times_b_cmplx.cpp
Binary file not shown.
Binary file added Ncut_9/hide/._affinityic.cpp
Binary file not shown.
Binary file added Ncut_9/hide/._build_scene.m
Binary file not shown.
Binary file added Ncut_9/hide/._cimgnbmap.cpp
Binary file not shown.
Binary file added Ncut_9/hide/._compileDir_simple.m
Binary file not shown.
Binary file added Ncut_9/hide/._computeEdges.m
Binary file not shown.
Binary file added Ncut_9/hide/._computeW.m
Binary file not shown.
Binary file added Ncut_9/hide/._compute_relation.m
Binary file not shown.
Binary file added Ncut_9/hide/._compute_relation2.m
Binary file not shown.
Binary file added Ncut_9/hide/._demoNcutClustering.m
Binary file not shown.
Binary file added Ncut_9/hide/._demoNcutImage.m
Binary file not shown.
Binary file added Ncut_9/hide/._discretisation.m
Binary file not shown.
Binary file added Ncut_9/hide/._discretisationEigenVectorData.m
Binary file not shown.
Binary file added Ncut_9/hide/._doog1.m
Binary file not shown.
Binary file added Ncut_9/hide/._doog2.m
Binary file not shown.
Binary file added Ncut_9/hide/._eigs_new.m
Binary file not shown.
Binary file added Ncut_9/hide/._fft_filt_2.m
Binary file not shown.
Binary file added Ncut_9/hide/._gaussian.m
Binary file not shown.
Binary file added Ncut_9/hide/._imread_ncut.m
Binary file not shown.
Binary file added Ncut_9/hide/._make_filterbank_even2.m
Binary file not shown.
Binary file added Ncut_9/hide/._make_filterbank_odd2.m
Binary file not shown.
Binary file added Ncut_9/hide/._mex_w_times_x_symmetric.cpp
Binary file not shown.
Binary file added Ncut_9/hide/._ncut.m
Binary file not shown.
Binary file added Ncut_9/hide/._ncutW.m
Binary file not shown.
Binary file added Ncut_9/hide/._quadedgep.m
Binary file not shown.
Binary file added Ncut_9/hide/._showmask.m
Binary file not shown.
Binary file added Ncut_9/hide/._sparsifyc.cpp
Binary file not shown.
Binary file added Ncut_9/hide/._spmtimesd.cpp
Binary file not shown.
Binary file added Ncut_9/jpg_images/._1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Ncut_9/jpg_images/._2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Ncut_9/jpg_images/._3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Ncut_9/jpg_images/._Thumbs.db
Binary file not shown.
Binary file added Ncut_9/jpg_images/1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Ncut_9/jpg_images/2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Ncut_9/jpg_images/3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Ncut_9/jpg_images/Thumbs.db
Binary file not shown.
Binary file added Ncut_9/mex_w_times_x_symmetric.mexw64
Binary file not shown.
6 changes: 6 additions & 0 deletions Ncut_9/ncut.m
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,14 @@

%warning off
% [vbar,s,convergence] = eigs2(@mex_w_times_x_symmetric,size(P,1),nbEigenValues,'LA',options,tril(P));
<<<<<<< HEAD
% [vbar,s,convergence] = eigs_new(@mex_w_times_x_symmetric,size(P,1),nbEigenValues,'LA',options,tril(P));
[vbar,s,convergence] = eigs(@mex_w_times_x_symmetric,size(P,1),nbEigenValues,'LA',options,tril(P));
=======
% [vbar,s,convergence] = eigs_new(@mex_w_times_x_symmetric,size(P,1),nbEigenValues,'LA',options,tril(P));
P=0.5*(P+P');
[vbar,s,convergence] = eigs(P,nbEigenValues,'LA',options);
>>>>>>> 4e2789888db39b134173590ff8bfd29ee6c32a79
%warning on

s = real(diag(s));
Expand Down
Binary file added Ncut_9/sparsifyc.mexw64
Binary file not shown.
Binary file added Ncut_9/spmtimesd.mexw64
Binary file not shown.
Binary file added RPCA/LRSD-Code.zip
Binary file not shown.
Binary file added RPCA/LRSD/mexsvd.mexw32
Binary file not shown.
Binary file added RPCA/exact_alm_rpca.zip
Binary file not shown.
Binary file added RPCA/exact_alm_rpca/.DS_Store
Binary file not shown.
Binary file added RPCA/exact_alm_rpca/PROPACK/bdsqr.mexglx
Binary file not shown.
Binary file added RPCA/exact_alm_rpca/PROPACK/bdsqr.mexsg
Binary file not shown.
Binary file added RPCA/exact_alm_rpca/PROPACK/bdsqr.mexsg64
Binary file not shown.
Binary file added RPCA/exact_alm_rpca/PROPACK/bdsqr.mexsol
Binary file not shown.
Binary file added RPCA/exact_alm_rpca/PROPACK/bdsqr.mexw32
Binary file not shown.
85 changes: 85 additions & 0 deletions RPCA/exact_alm_rpca/PROPACK/lanbpro.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
LANBPRO Lanczos bidiagonalization with partial reorthogonalization.

LANBPRO computes the Lanczos bidiagonalization of a real
matrix using the with partial reorthogonalization.

[U_k,B_k,V_k,R,ierr,work] = LANBPRO(A,K,R0,OPTIONS,U_old,B_old,V_old)
[U_k,B_k,V_k,R,ierr,work] = LANBPRO('Afun','Atransfun',M,N,K,R0, ...
OPTIONS,U_old,B_old,V_old)

Computes K steps of the Lanczos bidiagonalization algorithm with partial
reorthogonalization (BPRO) with M-by-1 starting vector R0, producing a
lower bidiagonal K-by-K matrix B_k, an N-by-K matrix V_k, an M-by-K
matrix U_k and a M-by-1 vector such that
A*V_k = U_k*B_k + R
Partial reorthogonalization is used to keep the columns of V_K and U_k
semiorthogonal:
MAX(DIAG((EYE(K) - V_K'*V_K))) <= OPTIONS.delta
and
MAX(DIAG((EYE(K) - U_K'*U_K))) <= OPTIONS.delta.

B_k = LANBPRO(...) returns the bidiagonal matrix only.

The first input argument is either a real matrix, or a string
containing the name of an M-file which applies a linear operator
to the columns of a given matrix. In the latter case, the second
input must be the name of an M-file which applies the transpose of
the same linear operator to the columns of a given matrix,
and the third and fourth arguments must be M and N, the dimensions
of then problem.

The OPTIONS structure is used to control the reorthogonalization:
OPTIONS.delta: Desired level of orthogonality
(default = sqrt(eps/K)).
OPTIONS.eta : Level of orthogonality after reorthogonalization
(default = eps^(3/4)/sqrt(K)).
OPTIONS.cgs : Flag for switching between different reorthogonalization
algorithms:
0 = iterated modified Gram-Schmidt (default)
1 = iterated classical Gram-Schmidt
OPTIONS.elr : If OPTIONS.elr = 1 (default) then extended local
reorthogonalization is enforced.
OPTIONS.onesided
: If OPTIONS.onesided = 0 (default) then both the left
(U) and right (V) Lanczos vectors are kept
semiorthogonal.
OPTIONS.onesided = 1 then only the columns of U are
are reorthogonalized.
OPTIONS.onesided = -1 then only the columns of V are
are reorthogonalized.
OPTIONS.waitbar
: The progress of the algorithm is display graphically.

If both R0, U_old, B_old, and V_old are provided, they must
contain a partial Lanczos bidiagonalization of A on the form

A V_old = U_old B_old + R0 .

In this case the factorization is extended to dimension K x K by
continuing the Lanczos bidiagonalization algorithm with R0 as a
starting vector.

The output array work contains information about the work used in
reorthogonalizing the u- and v-vectors.
work = [ RU PU ]
[ RV PV ]
where
RU = Number of reorthogonalizations of U.
PU = Number of inner products used in reorthogonalizing U.
RV = Number of reorthogonalizations of V.
PV = Number of inner products used in reorthogonalizing V.

References:
R.M. Larsen, Ph.D. Thesis, Aarhus University, 1998.

G. H. Golub & C. F. Van Loan, "Matrix Computations",
3. Ed., Johns Hopkins, 1996. Section 9.3.4.

B. N. Parlett, ``The Symmetric Eigenvalue Problem'',
Prentice-Hall, Englewood Cliffs, NJ, 1980.

H. D. Simon, ``The Lanczos algorithm with partial reorthogonalization'',
Math. Comp. 42 (1984), no. 165, 115--142.


Rasmus Munk Larsen, DAIMI, 1998.
62 changes: 62 additions & 0 deletions RPCA/exact_alm_rpca/PROPACK/laneig.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
LANEIG Compute a few eigenvalues and eigenvectors.
LANEIG solves the eigenvalue problem A*v=lambda*v, when A is
real and symmetric using the Lanczos algorithm with partial
reorthogonalization (PRO).

[V,D] = LANEIG(A)
[V,D] = LANEIG('Afun',N)

The first input argument is either a real symmetric matrix, or a
string containing the name of an M-file which applies a linear
operator to the columns of a given matrix. In the latter case,
the second input argument must be N, the order of the problem.

The full calling sequence is

[V,D,ERR] = LANEIG(A,K,SIGMA,OPTIONS)
[V,D,ERR] = LANEIG('Afun',N,K,SIGMA,OPTIONS)

On exit ERR contains the computed error bounds. K is the number of
eigenvalues desired and SIGMA is numerical shift or a two letter string
which specifies which part of the spectrum should be computed:

SIGMA Specified eigenvalues

'AL' Algebraically Largest
'AS' Algebraically Smallest
'LM' Largest Magnitude (default)
'SM' Smallest Magnitude (does not work when A is an m-file)
'BE' Both Ends. Computes k/2 eigenvalues
from each end of the spectrum (one more
from the high end if k is odd.)

The OPTIONS structure specifies certain parameters in the algorithm.

Field name Parameter Default

OPTIONS.tol Convergence tolerance 16*eps
OPTIONS.lanmax Dimension of the Lanczos basis.
OPTIONS.v0 Starting vector for the Lanczos rand(n,1)-0.5
iteration.
OPTIONS.delta Level of orthogonality among the sqrt(eps/K)
Lanczos vectors.
OPTIONS.eta Level of orthogonality after 10*eps^(3/4)
reorthogonalization.
OPTIONS.cgs reorthogonalization method used 0
'0' : iterated modified Gram-Schmidt
'1' : iterated classical Gram-Schmidt
OPTIONS.elr If equal to 1 then extended local 1
reorthogonalization is enforced.

See also LANPRO, EIGS, EIG.

References:
R.M. Larsen, Ph.D. Thesis, Aarhus University, 1998.

B. N. Parlett, ``The Symmetric Eigenvalue Problem'',
Prentice-Hall, Englewood Cliffs, NJ, 1980.

H. D. Simon, ``The Lanczos algorithm with partial reorthogonalization'',
Math. Comp. 42 (1984), no. 165, 115--142.

Rasmus Munk Larsen, DAIMI, 1998
75 changes: 75 additions & 0 deletions RPCA/exact_alm_rpca/PROPACK/lanpro.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
LANPRO Lanczos tridiagonalization with partial reorthogonalization
LANPRO computes the Lanczos tridiagonalization of a real symmetric
matrix using the symmetric Lanczos algorithm with partial
reorthogonalization.

[Q_K,T_K,R,ANORM,IERR,WORK] = LANPRO(A,K,R0,OPTIONS,Q_old,T_old)
[Q_K,T_K,R,ANORM,IERR,WORK] = LANPRO('Afun',N,K,R0,OPTIONS,Q_old,T_old)

Computes K steps of the Lanczos algorithm with starting vector R0,
and returns the K x K tridiagonal T_K, the N x K matrix Q_K
with semiorthonormal columns and the residual vector R such that

A*Q_K = Q_K*T_K + R .

Partial reorthogonalization is used to keep the columns of Q_K
semiorthogonal:
MAX(DIAG((eye(k) - Q_K'*Q_K))) <= OPTIONS.delta.


The first input argument is either a real symmetric matrix, a struct with
components A.L and A.U or a string containing the name of an M-file which
applies a linear operator to the columns of a given matrix. In the latter
case, the second input argument must be N, the order of the problem.

If A is a struct with components A.L and A.U, such that
L*U = (A - sigma*I), a shift-and-invert Lanczos iteration is performed

The OPTIONS structure is used to control the reorthogonalization:
OPTIONS.delta: Desired level of orthogonality
(default = sqrt(eps/K)).
OPTIONS.eta : Level of orthogonality after reorthogonalization
(default = eps^(3/4)/sqrt(K)).
OPTIONS.cgs : Flag for switching between different reorthogonalization
algorithms:
0 = iterated modified Gram-Schmidt (default)
1 = iterated classical Gram-Schmidt
OPTIONS.elr : If OPTIONS.elr = 1 (default) then extended local
reorthogonalization is enforced.
OPTIONS.Y : The lanczos vectors are reorthogonalized against
the columns of the matrix OPTIONS.Y.

If both R0, Q_old and T_old are provided, they must contain
a partial Lanczos tridiagonalization of A on the form

A Q_old = Q_old T_old + R0 .

In this case the factorization is extended to dimension K x K by
continuing the Lanczos algorithm with R0 as starting vector.

On exit ANORM contains an approximation to ||A||_2.
IERR = 0 : K steps were performed succesfully.
IERR > 0 : K steps were performed succesfully, but the algorithm
switched to full reorthogonalization after IERR steps.
IERR < 0 : Iteration was terminated after -IERR steps because an
invariant subspace was found, and 3 deflation attempts
were unsuccessful.
On exit WORK(1) contains the number of reorthogonalizations performed, and
WORK(2) contains the number of inner products performed in the
reorthogonalizations.

See also LANEIG, REORTH, COMPUTE_INT

References:
R.M. Larsen, Ph.D. Thesis, Aarhus University, 1998.

G. H. Golub & C. F. Van Loan, "Matrix Computations",
3. Ed., Johns Hopkins, 1996. Chapter 9.

B. N. Parlett, ``The Symmetric Eigenvalue Problem'',
Prentice-Hall, Englewood Cliffs, NJ, 1980.

H. D. Simon, ``The Lanczos algorithm with partial reorthogonalization'',
Math. Comp. 42 (1984), no. 165, 115--142.

Rasmus Munk Larsen, DAIMI, 1998
58 changes: 58 additions & 0 deletions RPCA/exact_alm_rpca/PROPACK/lansvd.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
LANSVD Compute a few singular values and singular vectors.
LANSVD computes singular triplets (u,v,sigma) such that
A*u = sigma*v and A'*v = sigma*u. Only a few singular values
and singular vectors are computed using the Lanczos
bidiagonalization algorithm with partial reorthogonalization (BPRO).

S = LANSVD(A)
S = LANSVD('Afun','Atransfun',M,N)

The first input argument is either a matrix or a
string containing the name of an M-file which applies a linear
operator to the columns of a given matrix. In the latter case,
the second input must be the name of an M-file which applies the
transpose of the same operator to the columns of a given matrix,
and the third and fourth arguments must be M and N, the dimensions
of the problem.

[U,S,V] = LANSVD(A,K,'L',...) computes the K largest singular values.

[U,S,V] = LANSVD(A,K,'S',...) computes the K smallest singular values.

The full calling sequence is

[U,S,V] = LANSVD(A,K,SIGMA,OPTIONS)
[U,S,V] = LANSVD('Afun','Atransfun',M,N,K,SIGMA,OPTIONS)

where K is the number of singular values desired and
SIGMA is 'L' or 'S'.

The OPTIONS structure specifies certain parameters in the algorithm.
Field name Parameter Default

OPTIONS.tol Convergence tolerance 16*eps
OPTIONS.lanmax Dimension of the Lanczos basis.
OPTIONS.p0 Starting vector for the Lanczos rand(n,1)-0.5
iteration.
OPTIONS.delta Level of orthogonality among the sqrt(eps/K)
Lanczos vectors.
OPTIONS.eta Level of orthogonality after 10*eps^(3/4)
reorthogonalization.
OPTIONS.cgs reorthogonalization method used 0
'0' : iterated modified Gram-Schmidt
'1' : iterated classical Gram-Schmidt
OPTIONS.elr If equal to 1 then extended local 1
reorthogonalization is enforced.

See also LANBPRO, SVDS, SVD

References:
R.M. Larsen, Ph.D. Thesis, Aarhus University, 1998.

B. N. Parlett, ``The Symmetric Eigenvalue Problem'',
Prentice-Hall, Englewood Cliffs, NJ, 1980.

H. D. Simon, ``The Lanczos algorithm with partial reorthogonalization'',
Math. Comp. 42 (1984), no. 165, 115--142.

Rasmus Munk Larsen, DAIMI, 1998
Binary file added RPCA/exact_alm_rpca/PROPACK/reorth.mexglx
Binary file not shown.
Binary file added RPCA/exact_alm_rpca/PROPACK/reorth.mexsg
Binary file not shown.
Binary file added RPCA/exact_alm_rpca/PROPACK/reorth.mexsg64
Binary file not shown.
Binary file added RPCA/exact_alm_rpca/PROPACK/reorth.mexsol
Binary file not shown.
Binary file added RPCA/exact_alm_rpca/PROPACK/tqlb.mexglx
Binary file not shown.
Binary file added RPCA/exact_alm_rpca/PROPACK/tqlb.mexsg
Binary file not shown.
Binary file added RPCA/exact_alm_rpca/PROPACK/tqlb.mexsg64
Binary file not shown.
Binary file added RPCA/exact_alm_rpca/PROPACK/tqlb.mexsol
Binary file not shown.
Binary file added RPCA/inexact_alm_rpca.zip
Binary file not shown.
Binary file added RPCA/inexact_alm_rpca/.DS_Store
Binary file not shown.
Binary file added RPCA/inexact_alm_rpca/PROPACK/bdsqr.mexglx
Binary file not shown.
Binary file added RPCA/inexact_alm_rpca/PROPACK/bdsqr.mexsg
Binary file not shown.
Binary file added RPCA/inexact_alm_rpca/PROPACK/bdsqr.mexsg64
Binary file not shown.
Binary file added RPCA/inexact_alm_rpca/PROPACK/bdsqr.mexsol
Binary file not shown.
Binary file added RPCA/inexact_alm_rpca/PROPACK/bdsqr.mexw32
Binary file not shown.
Loading

0 comments on commit 5849072

Please sign in to comment.