plateform stringclasses 1
value | repo_name stringlengths 13 113 | name stringlengths 3 74 | ext stringclasses 1
value | path stringlengths 12 229 | size int64 23 843k | source_encoding stringclasses 9
values | md5 stringlengths 32 32 | text stringlengths 23 843k |
|---|---|---|---|---|---|---|---|---|
github | zhaENS/Project-master | ChromSDE.m | .m | Project-master/Code/3rdParty/chromSDE/program/ChromSDE.m | 1,517 | utf_8 | 60d75681042a20ef674a4cc1e98d8375 | %method_type=1 Quadratic SDP
%method_type=0 Linear SDP
function ChromSDE(trainBin,trainFreq,method_type)
bigend=10000000000;
figure
record=[];
posMatrix_combined=[];
chromNum=min(24,max(trainBin(:,1)));
rowNum=ceil(chromNum/5);
colNum=min(5,chromNum);
for chrom=1:chromNum
selchrom=(trainBin(:,1)==chrom);
if sum... |
github | zhaENS/Project-master | readpipeline_output.m | .m | Project-master/Code/3rdParty/chromSDE/program/readpipeline_output.m | 691 | utf_8 | c19f69bcce64fba4d14c431ca627ef16 | function [binAnno,FreqMat,normFreqMat]=readpipeline_output(prefix)
spMat= importdata([prefix '.n_contact'], '\t', 1);
sel=spMat.data(:,4)>0;%need more than 2 pet count support
FreqMat=spconvert(spMat.data(sel,[1 2 4]));
FreqMat=max(FreqMat,FreqMat');
normF=spMat.data(sel,4)./spMat.data(sel,3);
normFreqMat=spconvert([sp... |
github | zhaENS/Project-master | cheby0.m | .m | Project-master/Code/3rdParty/chromSDE/program/SDPT3-4.0/Examples/cheby0.m | 2,576 | utf_8 | a31e95ee5e80694cd1c3f2ceb594d369 | %%**********************************************************
%% cheby0:
%%
%% minimize || p(d) ||_infty
%% p = polynomial of degree <= m such that p(0) = 1.
%%
%% Here d = n-vector
%%----------------------------------------------------------
%% [blk,Avec,C,b,X0,y0,Z0,objval,p] = cheby0(d,m,solve);
%%
%% d ... |
github | zhaENS/Project-master | randmat.m | .m | Project-master/Code/3rdParty/chromSDE/program/SDPT3-4.0/Solver/randmat.m | 731 | utf_8 | 8dd81b149ece99e621e47e5ea60fd114 | %%******************************************************
%% randmat: generate an mxn matrix using matlab's
%% rand or randn functions using state = k.
%%
%%******************************************************
function v = randmat(m,n,k,randtype)
try
s = rng;
rng(k);
if strcmp(randtype,'n')
... |
github | zhaENS/Project-master | computermsd.m | .m | Project-master/Code/3rdParty/chromSDE/program/geom/computermsd.m | 449 | utf_8 | 008a3d51adc1a7db6907df7130d218dd | % computermsd Compute the RMSD between two sets of points.
%
% rmsd = computermsd(A,B,shouldAlign)
% Created : 6 Jul 07
% Last modified : 5 Nov 07
function rmsd = computermsd(A,Aest,shouldAlign)
if shouldAlign
Info = alignatoms(A,Aest);
Aest = Info.Aest;
end
n = size(A,2);
minx=min(min(A));%min(m... |
github | zhaENS/Project-master | computeseparation.m | .m | Project-master/Code/3rdParty/chromSDE/program/geom/computeseparation.m | 535 | utf_8 | 41889f4ac6d73b0ee766d21321da80d8 | % computeseparation Compute the separation of a set of points.
%
% The separation is defined as
% sqrt(sum(||x_i-x_j||^2)).
%
% separation = computeseparation(points)
% Created : 6 Jul 07
% Last modified : 6 Jul 07
function separation = computeseparation(points)
nPoints = size(poi... |
github | zhaENS/Project-master | rotateold.m | .m | Project-master/Code/3rdParty/chromSDE/program/geom/etc/rotateold.m | 229 | utf_8 | 89f883538a553be1ce4ac5fb8c2c2371 | % rotate Rotate points by a rotation matrix.
%
% points = rotate(points,rotationMatrix)
% Created : 6 Jul 07
% Last modified : 6 Jul 07
function points = rotate(points,rotationMatrix)
points = rotationMatrix * points;
|
github | zhaENS/Project-master | rotmatto.m | .m | Project-master/Code/3rdParty/chromSDE/program/geom/etc/rotmatto.m | 427 | utf_8 | 8f5eb0ec2e81b8a7343536f477683caf | % rotmatto axis, angle
%
% x = Qzy-Qyz
% y = Qxz-Qzx
% z = Qyx-Qxy
% r = sqrt(x^2+y^2+z^2)
% t = Qxx+Qyy+Qzz
% theta = atan2(r,t-1)
%
% Reference: http://en.wikipedia.org/wiki/Rotation_matrix
%
% [myaxis,myangle] = rotmatto(Q)
function [myaxis,myangle] = rotmatto(Q)
x = Q(3,2)-Q(2,3);
y = Q(1,3)-Q(3,1);
z = Q(2,1)-Q(... |
github | zhaENS/Project-master | isomatto.m | .m | Project-master/Code/3rdParty/chromSDE/program/geom/etc/isomatto.m | 182 | utf_8 | 0d02e2dfd92124d5c2ac7fd0aa6b902f | % isomatto sign, axis, angle
%
% [mysign,myaxis,myangle] = isomat2(Q)
function [mysign,myaxis,myangle] = isomatto(Q)
mysign = sign(det(Q));
[myaxis,myangle] = rotmatto(mysign*Q);
|
github | zhaENS/Project-master | isomatfrom.m | .m | Project-master/Code/3rdParty/chromSDE/program/geom/etc/isomatfrom.m | 164 | utf_8 | 21e703cb275f714d3bc0f28fd4ded494 | % isomatfrom sign, axis, angle
%
% Q = isomatfrom(mysign,myaxis,myangle)
function Q = isomatfrom(mysign,myaxis,myangle)
Q = mysign * rotmatfrom(myaxis,myangle);
|
github | zhaENS/Project-master | orthogonalprocrustes.m | .m | Project-master/Code/3rdParty/chromSDE/program/geom/etc/orthogonalprocrustes.m | 343 | utf_8 | 76bede0be87d35fcb1630ae4b74b6305 | % orthogonalprocurstes Solve the orthogonal Procrustes problem.
%
% Solves the orthogonal Procrustes problem:
% Find U such that U^TU = I, and U minimizes ||A-UB||_F.
%
% U = orthogonalprocrustes(A,B)
% Created : 6 Jul 07
% Last modified : 6 Jul 07
function U = orthogonalprocrustes(A,B)
[W,S,Z] = ... |
github | zhaENS/Project-master | rotmatfrom.m | .m | Project-master/Code/3rdParty/chromSDE/program/geom/etc/rotmatfrom.m | 704 | utf_8 | 679df41c21f47fb2c6fe66222c9d37ad | % rotmatfrom axis, angle
%
% c = cos(theta); s = sin(theta); C = 1-c
% xs = x*s; ys = y*s; zs = z*s
% xC = x*C; yC = y*C; zC = z*C
% xyC = x*yC; yzC = y*zC; zxC = z*xC
% [ x*xC+c xyC-zs zxC+ys ]
% [ xyC+zs y*yC+c yzC-xs ]
% [ zxC-ys yzC+xs z*zC+c ]
%
% http://en.wikipedia.org/wiki/Rotation_matrix
%
... |
github | zhaENS/Project-master | compilesos.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/modules/sos/compilesos.m | 40,095 | utf_8 | 561f1089f1e74dd54c43e02924b62b87 | function [F,obj,m] = solvesos(F,obj,options,params,candidateMonomials)
%COMPILESOS Sum of squares decomposition
%
% [F,obj,m] = compilesos(F,h,options,params,monomials) derives the SOS
% problem without actually solving it
%
% See also SOLVESOS
%% Time YALMIP
yalmip_time = clock;
% ****************************... |
github | zhaENS/Project-master | solvesos.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/modules/sos/solvesos.m | 53,725 | utf_8 | d618a056c153cd78d7a6d77530f1dd20 | function [sol,m,Q,residuals,everything] = solvesos(F,obj,options,params,candidateMonomials)
%SOLVESOS Sum of squares decomposition
%
% [sol,m,B,residual] = solvesos(F,h,options,params,monomials) is used
% for finding SOS decompositions of polynomials.
%
% The coefficients of the polynomials are assumed linear ... |
github | zhaENS/Project-master | postprocesssos.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/modules/sos/postprocesssos.m | 3,702 | utf_8 | 6716cb77d4d92dcbb793f478d7c47993 | function [BlockedQ,residuals] = postprocesssos(BlockedA,Blockedb,BlockedQ,sparsityPattern,options);
BlockedQ=applysparsity(BlockedQ,sparsityPattern);
for passes = 1:1:options.sos.postprocess
for constraint = 1:length(BlockedQ)
mismatch = computeresiduals(BlockedA,Blockedb,BlockedQ,constraint);
[ii... |
github | zhaENS/Project-master | robust_classify_variables_newest.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/modules/robust/robust_classify_variables_newest.m | 4,944 | utf_8 | 57c62609aefa72ea7342fc148f33ae42 | function [VariableType,F_x,F_w,F_xw,h] = robust_classify_variables_newest(F,h,ops,w);
Dependency = iterateDependance( yalmip('monomtable') | yalmip('getdependence') | yalmip('getdependenceUser'));
DependsOnw = find(any((Dependency(:,getvariables(w))),2));
h_variables = getvariables(h);
h_w = find(ismember(h_variable... |
github | zhaENS/Project-master | filter_polya.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/modules/robust/filter_polya.m | 5,017 | utf_8 | 6952fd0edb864a9a540056ee66af95df | function [F_xw,F_polya] = polya_constraints(F_xw,w,N)
F_polya = [];
Fvars = getvariables(F_xw);
wvars = getvariables(w);
[mt,vt] = yalmip('monomtable');
if ~(N==ceil(N)) & (N>=0)
error('The power in robust.polya must be a non-negative integer');
end
F_new = [];
if any(sum(mt(Fvars,wvars),2)>1)
removeF = zeros(... |
github | zhaENS/Project-master | filter_duality.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/modules/robust/filter_duality.m | 8,198 | utf_8 | 1fb7bd5147d318362a9686f5458096f2 | function [F,feasible] = filter_duality(F_xw,Zmodel,x,w,ops)
% Creates robustified version of the uncertain set of linear inequalities
% s.t A(w)*x <= b(w) for all F(w) >= 0 where F(w) is a conic set, here
% given in YALMIP numerical format.
%
% Based on Robust Optimization - Methodology and Applications. A. Ben-Tal
% ... |
github | zhaENS/Project-master | filter_enumeration.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/modules/robust/filter_enumeration.m | 7,125 | utf_8 | a3133824a6ee358c210f5338c95619b7 | function [F,mptmissing] = filter_enumeration(F_xw,Zmodel,x,w,ops,uncertaintyTypes,separatedZmodel,VariableType)
mptmissing = 0;
if length(F_xw) == 0
F = [];
return;
else
if any(Zmodel.K.q) | any(Zmodel.K.s)
error('Only polytope uncertainty supported in duality based robustification');
else... |
github | zhaENS/Project-master | decomposeUncertain.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/modules/robust/decomposeUncertain.m | 23,801 | utf_8 | 10c26bebd017de52f51d266e2ef02e47 | function [UncertainModel,Uncertainty,VariableType,ops,failure] = decomposeUncertain(F,h,w,ops)
failure = 0;
% Do we have any uncertainty declarations variables?
[F,w] = extractUncertain(F,w);
if isempty(w)
error('There is no uncertainty in the model.');
end
% Partition the model into
% F_x : Constraints in de... |
github | zhaENS/Project-master | root_node_tighten.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/modules/global/root_node_tighten.m | 2,633 | utf_8 | 6f3566bd7d84e8fd20341cbbc5d2955b | % *************************************************************************
% Tighten bounds at root
% *************************************************************************
function p = root_node_tighten(p,upper);
p.feasible = all(p.lb<=p.ub) & p.feasible;
if p.options.bmibnb.roottight & p.feasible
pin = p;
... |
github | zhaENS/Project-master | presolve_bounds_from_equalities.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/modules/global/presolve_bounds_from_equalities.m | 7,934 | utf_8 | 74023071c791cf4138653415ce590833 | function p = presolve_bounds_from_equalities(p)
p.equalitypresolved = 1;
LU = [p.lb p.ub];
p_F_struc = p.F_struc;
n_p_F_struc_cols = size(p_F_struc,2);
if p.K.f >0
% Find bounds from sum(xi) = 1, xi>0
for j = 1:p.K.f
if p_F_struc(j,1)>0
[row,col,val] = find(p_F_struc(j,:));
... |
github | zhaENS/Project-master | updateonenonlinearbound.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/modules/global/updateonenonlinearbound.m | 805 | utf_8 | 97d5341706cf3ef397ec3383332f38ee | % *************************************************************************
% Code for setting the numerical values of nonlinear terms
% *************************************************************************
function p = updateonenonlinearbound(p,changed_var)
if ~isempty(p.bilinears)
impactedVariables = find((p.... |
github | zhaENS/Project-master | evaluate_nonlinear.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/modules/global/evaluate_nonlinear.m | 1,184 | utf_8 | 6cee29d0c8963567fd541ab3ee434dcf | function x = evaluate_nonlinear(p,x,qq)
% FIX: We have to apply computations to make sure we are evaluating
% expressions such as log(1+sin(x.^2).^2) correctly
if ~isempty(p.bilinears) & all(p.variabletype <= 2) & length(p.evalMap)==0
x(p.bilinears(:,1)) = x(p.bilinears(:,2)).*x(p.bilinears(:,3));
else
oldx =... |
github | zhaENS/Project-master | bnb_solvelower.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/modules/global/bnb_solvelower.m | 6,321 | utf_8 | cac82f738ffd31752d7c008d68f29b40 | function output = bnb_solvelower(lowersolver,relaxed_p,upper,lower)
if all(relaxed_p.lb==relaxed_p.ub)
x = relaxed_p.lb;
if checkfeasiblefast(relaxed_p,relaxed_p.lb,relaxed_p.options.bnb.feastol)
output.problem = 0;
else
output.problem = 1;
end
output.Primal = x;
return
end
p ... |
github | zhaENS/Project-master | convexhullConvex.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/modules/global/convexhullConvex.m | 769 | utf_8 | 82bd9d4ad4a19355cd104cb44bd5e390 | %function [Ax,Ay,b] = convexhullConvex(xL,xU,fL,fU,dfL,dfU)
function [Ax,Ay,b,K] = convexhullConvex(varargin)
% Two upper bounds from tangents
% y > f(xL) + (x-xL)*df(xL)
% y > f(xU) + (x-xL)*df(xU)
% Upper bound from conneting extreme points
% y < f(xU)(x-xL)/(xU-xL) + f(xL)(xU-x)/(xU-xL)
% can be wrtitten as
% Ax*x ... |
github | zhaENS/Project-master | branch_and_bound.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/modules/global/branch_and_bound.m | 25,192 | utf_8 | 1422e9bf396019fef5687cc08be808c1 | function [x_min,solved_nodes,lower,upper,lower_hist,upper_hist] = branch_and_bound(p,x_min,upper)
% *************************************************************************
% Create handles to solvers
% *************************************************************************
lowersolver = p.solver.lowersolver.call; ... |
github | zhaENS/Project-master | updatebounds_recursive_evaluation.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/modules/global/updatebounds_recursive_evaluation.m | 1,065 | utf_8 | 3602a438ddb1013e1ad212fba7184679 | function p = updatebounds_recursive_evaluation(p)
if p.changedbounds
if isempty(p.evalMap) & all(p.variabletype <= 2)
% Bilinear/quadratic case can be done much faster
p = updatemonomialbounds(p);
else
for i = 1:length(p.evaluation_scheme)
switch p.evaluation_scheme{i}.group... |
github | zhaENS/Project-master | rounder.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/modules/global/rounder.m | 5,369 | utf_8 | 0080fc90c1c2c9382189e410ee6832eb | function [upper,x_min] = rounder(p,relaxedsolution)
% Extremely simple heuristic for finding integer
% solutions.
%
% Rounds up and down, fixes etc.
% This was the relaxed solution
x = relaxedsolution.Primal;
% Assume we fail
upper = inf;
x_min = x;
% These should be integer
intvars = [p.integer_variables(:);p.bina... |
github | zhaENS/Project-master | initializesolution.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/modules/global/initializesolution.m | 2,615 | utf_8 | 83935cafa17f99952ada7003c4c7817a | function [p,x_min,upper] = initializesolution(p);
x_min = zeros(length(p.c),1);
upper = inf;
if p.options.usex0
x = p.x0;
z = evaluate_nonlinear(p,x);
residual = constraint_residuals(p,z);
relaxed_feasible = all(residual(1:p.K.f)>=-p.options.bmibnb.eqtol) & all(residual(1+p.K.f:end)>=p.options.bmibnb.p... |
github | zhaENS/Project-master | mpt_solvenode.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/modules/parametric/mpt_solvenode.m | 5,114 | utf_8 | 1c24744e0d5c990a107dc9a44e4a6648 | function model = mpt_solvenode(Matrices,lower,upper,OriginalModel,model,options)
% This is the core code. Lot of pre-processing to get rid of strange stuff
% arising from odd problems, big-M etc etc
Matrices.lb = lower;
Matrices.ub = upper;
% Remove equality constraints and trivial stuff from big-M
[equalities,redund... |
github | zhaENS/Project-master | mpt_parbb.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/modules/parametric/mpt_parbb.m | 5,202 | utf_8 | 4f5358e429eb96a5bba16e38a8f1f11e | function model = mpt_parbb(Matrices,options)
% For simple development, the code is currently implemented in high-level
% YALMIP and MPT code. Hence, a substantial part of the computation time is
% stupid over-head.
[Matrices.lb,Matrices.ub] = mpt_detect_and_improve_bounds(Matrices,Matrices.lb,Matrices.ub,Matrices.bin... |
github | zhaENS/Project-master | mpt_appendmodel.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/modules/parametric/mpt_appendmodel.m | 9,553 | utf_8 | 88aa3e21db652cf6c0b5a9f74c49bdf3 | function model = savemptmodel(model,Pfinal,Pn,Fi,Gi,details);
if length(Fi)>0
if length(model) == 0
model{1} = fakemptmodel(Pfinal, Pn, Fi, Gi, details.Ai, details.Bi, details.Ci);
[H,K] = double(Pfinal);
model{1}.epicost = [];
model{1}.convex = 1;
else
anyqp = nnz([deta... |
github | zhaENS/Project-master | variable_replace.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/extras/variable_replace.m | 2,976 | utf_8 | 24789bb29ef27f6c6f2e20d6ea39217f | function Z = variable_replace(X,Y,W)
% Check so that Y is a simple unit variable
Ybase = getbase(Y);
Yvariables = getvariablesSORTED(Y);
Xbase = getbase(X);
Xvariables = getvariables(X);
[i,j,k] = find(Ybase);
if ~isequal(sort(i),1:length(i))
end
if ~isequal(sort(j),2:(length(i)+1))
end
if ~all(k == 1)
end
[mt,variab... |
github | zhaENS/Project-master | convert_polynomial_to_sdpfun.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/extras/convert_polynomial_to_sdpfun.m | 5,293 | utf_8 | 1282b1c3b7f96c19912ea8bbbc911873 | function [model,changed] = convert_polynomial_to_sdpfun(model)
% Assume we don't do anything
changed = 0;
found_and_converted = [];
if any(model.variabletype > 2)
% Bugger...
changed = 1;
% Find a higher order term
sigmonials = find(model.variabletype == 3);
model = update_monomial_bounds(model)... |
github | zhaENS/Project-master | apply_recursive_evaluation.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/extras/apply_recursive_evaluation.m | 2,095 | utf_8 | b58bd00e6a096f7d525cc191174df8b9 | function xevaled = apply_recursive_evaluation(p,xevaled)
xevaled = xevaled(:)';
for i = 1:length(p.evaluation_scheme)
switch p.evaluation_scheme{i}.group
case 'eval'
xevaled = process_evals(p,xevaled,p.evaluation_scheme{i}.variables);
case 'monom'
xevaled = process_monomials... |
github | zhaENS/Project-master | convert_sigmonial_to_sdpfun.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/extras/convert_sigmonial_to_sdpfun.m | 9,289 | utf_8 | a746c47b32bd892d52021bb7e0fdcd49 | function [model,changed] = convert_sigmonial_to_sdpfun(model)
% Always add this dummy struct
model.high_monom_model = [];
% Assume we don't do anything
changed = 0;
found_and_converted = [];
if any(model.variabletype > 3)
% Bugger...
changed = 1;
% Find a higher order term
sigmonials = find(model.va... |
github | zhaENS/Project-master | convert_polynomial_to_quadratic.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/extras/convert_polynomial_to_quadratic.m | 6,093 | utf_8 | e42036044ee1903d0c693160c460a838 | function [model,changed] = convert_polynomial_to_quadratic(model)
% Assume we don't do anything
changed = 0;
% Are there really any non-quadratic terms?
already_done = 0;
while any(model.variabletype > 2)
% Bugger...
changed = 1;
% Find a higher order term
polynomials = find(model.variabletype >= 3);... |
github | zhaENS/Project-master | convert_perspective_log.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/extras/convert_perspective_log.m | 6,062 | utf_8 | cd2335f8bd9267a1d6397500ad2cfcf3 | function p = convert_perspective_log(p)
p.kept = 1:length(p.c);
if isempty(p.evalMap)
return
end
if ~any(p.variabletype == 4)
return
end
variableIndex = [];
for i=1:length(p.evalMap)
variableIndex = [variableIndex p.evalMap{i}.variableIndex];
end
removable = [];
for i = 1:length(p.evalMap)
if strcmp... |
github | zhaENS/Project-master | sdisplay2.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/extras/sdisplay2.m | 7,460 | utf_8 | 1580149b36a2d9dad048527aa6633013 | function symb_pvec = sdisplay2(p,names)
% TODO: sdpvar a b
% x = (a+b)^0.3 -- writes "mpower_internal"
%
% TODO: sdpvar h x k
% sdisplay2(h*x - k) -- misses the minus in front of "k"
if nargin < 2
LinearVariables = 1:yalmip('nvars');
x = recover(LinearVariables);
names = cell(length(x... |
github | zhaENS/Project-master | sedumi2sdpt3.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/extras/sedumi2sdpt3.m | 4,093 | utf_8 | 8f142cc073201468ac59c3aab8d61e4b | %SEDUMI2SDPT3 Internal function, obsolete
%%*******************************************************************
%% Converts from SeDuMi format.
%%
%% [blk,A,C,b] = sedumi2sdpt3(c,A,b,K)
%%
%% Input: fname.mat = name of the file containing SDP data in
%% SeDuMi format.
%%
%% Important note: Sedum... |
github | zhaENS/Project-master | sdpvar2str.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/extras/sdpvar2str.m | 2,503 | utf_8 | dcd7bff7503ead1c19e49a6497f6e84b | function symb_pvec = sdpvar2str(pvec)
%SDPVAR2STR Converts an SDPVAR object to MATLAB string representation
%
% S = SDPVAR2STR(P)
%
% S : String
% P : SDPVAR object
for pi = 1:size(pvec,1)
for pj = 1:size(pvec,2)
p = pvec(pi,pj);
if isa(p,'double')
symb_p = num2str(p);
... |
github | zhaENS/Project-master | yalmip2nonlinearsolver.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/extras/yalmip2nonlinearsolver.m | 6,909 | utf_8 | fe14697a63df3ed723d954ddf2a698ce | function model = yalmip2nonlinearsolver(model)
if ~model.equalitypresolved
model = presolve_bounds_from_equalities(model);
end
K = model.K;
lb = model.lb;
ub = model.ub;
x0 = model.x0;
c = model.c;
if isempty(model.evaluation_scheme)
model = build_recursive_scheme(model);
end
model = compress_evaluation_sche... |
github | zhaENS/Project-master | compileinterfacedata.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/extras/compileinterfacedata.m | 50,124 | utf_8 | 43424c0adeb648d82c9c08e166a6cdab | function [interfacedata,recoverdata,solver,diagnostic,F,Fremoved] = compileinterfacedata(F,aux_obsolete,logdetStruct,h,options,findallsolvers,parametric)
persistent CACHED_SOLVERS
persistent EXISTTIME
persistent NCHECKS
%% Initilize default empty outputs
diagnostic = [];
interfacedata = [];
recoverdata = [];
solver =... |
github | zhaENS/Project-master | build_recursive_scheme.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/extras/build_recursive_scheme.m | 4,569 | utf_8 | 1cdc25166f3f069aba0df8ff628c1f56 | function model = build_recursive_scheme(model);
model.evaluation_scheme = [];
model.deppattern = model.monomtable | model.monomtable;
% Figure out arguments in all polynomials & sigmonials. This info is
% used on several places, so we might just as well save it
model.monomials = find(model.variabletype);
model.monomi... |
github | zhaENS/Project-master | savecplexlp.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/extras/savecplexlp.m | 3,809 | utf_8 | eb730bc2bdd401df1d4a272bd5403225 | function filename = savecplexlp(varargin)
%SAVCPLEXLP Saves a problem definition in CPLEX-LP format
%
% SAVCPLEXLP(F,h,'filename') Saves the problem min(h(x)), F(x)>0 to the file filename
% SAVCPLEXLP(F,h) A "Save As"- box will be opened
%
% Note that YALMIP changes the variable names. Continuous... |
github | zhaENS/Project-master | solvesdp_multiple.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/extras/solvesdp_multiple.m | 5,402 | utf_8 | 84dcd46a31b49453a8471fbedc15d3c1 | function diagnostic = solvesdp_multiple(varargin);
yalmiptime = clock;
h = varargin{2};
varargin{2} = sum(recover(depends(h)));
if ~is(h,'linear')
error('Your objective is not a scalar (multiple solutions can currently only be obtained for linear objectives)');
end
if nargin<3
ops = sdpsettings('saveyalmipmo... |
github | zhaENS/Project-master | computedimacs.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/extras/computedimacs.m | 2,052 | utf_8 | 87d06eb1f6270fd74593f205c3343f1d | function dimacs = computedimacs(b,c,A,xin,y,s,K);
% COMPUTEDIMACS
%
% min <C,X> s.t AX = b, X > 0
% max b'y s.t S-C+A'y =0, S > 0
% If no primal exist, fake till later
if isempty(xin)
x = c*0;
else
x = xin;
end
if isempty(s)
s = c-A'*y;
end
xres = inf;
sres = inf;
% Not officially defined in DIMAC... |
github | zhaENS/Project-master | export.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/extras/export.m | 11,481 | utf_8 | 07e0d66ac5aebd5f85ec0690ad1c5400 | function [model,recoverdata,diagnostic,interfacedata] = export(varargin)
%EXPORT Exports YALMIP problem to solver specific format
%
% [MODEL,RECOVERYMODEL,DIAGNOSTIC,INTERNAL] = EXPORT(F,h,options) is the common command to
% export optimization problems of the following kind
%
% min h
% subject to
% ... |
github | zhaENS/Project-master | gams2yalmip.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/extras/gams2yalmip.m | 14,054 | utf_8 | 9d65364152b4bd07a31f7880ffeb36ed | function varargout = gams2yalmip(fileName,filenameOut);
% GAMS2YALMIP Converts GAMS model to YALMIP
%
% [F,h] = GAMS2YALMIP(gamsfile,yalmipfile) converts the GAMS model in
% the file 'gamsfile' to a YALMIP mpodel
%
% Input
% GAMSFILE : Char with filename for GAMS model
% YALMIPFILE : Char with filenam... |
github | zhaENS/Project-master | getvariables.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/extras/@lmi/getvariables.m | 1,204 | utf_8 | d53c5a788007cb74d38257e29ea6fc42 | function used = getvariables(F)
used = recursivegetvariables(F,1,length(F.clauses));
return
m = length(F.clauses);
if m == 1
used = getvariables(F.clauses{1}.data);
else
if m>50
for i = 1:m
Fivars = getvariables(F.clauses{i}.data);
used = [used Fivars(:)'];
end
... |
github | zhaENS/Project-master | pwamodel.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/extras/@lmi/pwamodel.m | 1,084 | utf_8 | b0d6a88e6f4c02018d6c85b072b057de | function [A,b] = pwamodel(F,x)
[dummy,aux,s,model] = export(F,[]);
A = -model.F_struc(:,2:end);
b = model.F_struc(:,1);
keep_these = find(ismember(aux.used_variables,getvariables(x)));
A = [A(:,keep_these) A(:,setdiff(1:size(A,2),keep_these))];
[A,b] = fourier_motzkin(A,b,length(keep_these));
function [A,b] = four... |
github | zhaENS/Project-master | addfactors.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/@sdpvar/addfactors.m | 2,572 | utf_8 | bdc66bbd28537962706a2749665377d1 | function Z = addfactors(Z,X,Y)
if isa(X,'double') | isa(X,'logical')
if length(Y.midfactors)==0
return
end
% Y = refactor(Y);
Z.midfactors = Y.midfactors;
Z.leftfactors = Y.leftfactors;
Z.rightfactors = Y.rightfactors;
Z.midfactors{end+1} = X;
if length(X)>1
Z.leftfacto... |
github | zhaENS/Project-master | yalmip2xpress.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/solvers/yalmip2xpress.m | 3,380 | utf_8 | 939c179fa34ef53a916b36c325cff8ab | function model = yalmip2xpress(interfacedata)
options = interfacedata.options;
F_struc = interfacedata.F_struc;
H = interfacedata.Q;
c = interfacedata.c;
K = interfacedata.K;
x0 = interfacedata.x0;
integer_variables = interfacedata.integer_variables;
binary_variables = interfacedata.binary_varia... |
github | zhaENS/Project-master | yalmip2mosek.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/solvers/yalmip2mosek.m | 3,020 | utf_8 | cad3759a634990d7f92664874e0c6443 | function prob = yalmip2mosek(interfacedata);
% Retrieve needed data
options = interfacedata.options;
F_struc = interfacedata.F_struc;
c = interfacedata.c;
Q = interfacedata.Q;
K = interfacedata.K;
x0 = interfacedata.x0;
integer_variables = interfacedata.integer_variables;
binary_variables = inte... |
github | zhaENS/Project-master | max_internal.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/operators/max_internal.m | 2,772 | utf_8 | 240c95e295a5cb99fe4c6a8e554f9c8c | function varargout = max_internal(varargin)
switch class(varargin{1})
case 'double'
varargout{1} = max(varargin{:});
case 'char'
extstruct.var = varargin{2};
extstruct.arg = {varargin{3:end}};
[F,properties,arguments]=max_model([],varargin{1},[],extstruct);
varargout{1} ... |
github | zhaENS/Project-master | min_internal.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/operators/min_internal.m | 2,281 | utf_8 | 5359163d3a014283af13d04b5e378667 | function varargout = min_internal(varargin)
switch class(varargin{1})
case 'double'
varargout{1} = min(varargin{:});
case 'char'
extstruct.var = varargin{2};
extstruct.arg = {varargin{3:end}};
[F,properties,arguments]=min_model([],varargin{1},[],extstruct);
varargout{1} ... |
github | zhaENS/Project-master | iff_internal.m | .m | Project-master/Code/3rdParty/chromSDE/program/yalmip/operators/iff_internal.m | 2,978 | utf_8 | cc07187a84632c89f7af36acbda3467f | function varargout = iff_internal(varargin)
X = varargin{1};
Y = varargin{2};
switch class(varargin{1})
case 'sdpvar'
if length(X)>1
error('IMPLIES not implemented for this case');
end
switch class(Y)
case 'sdpvar' % X <--> Y
varargout... |
github | zhaENS/Project-master | distance.m | .m | Project-master/Code/3rdParty/chromSDE/program/helperfunctions/distance.m | 1,937 | utf_8 | 0aaa02bb7f4644985939667e90a2935d | function dist=distance(X,x);
% dist=distance(X,x)
%
% computes the pairwise squared distance matrix between any column vectors in X and
% in x
%
% INPUT:
%
% X dxN matrix consisting of N column vectors
% x dxn matrix consisting of n column vectors
%
% OUTPUT:
%
% dist Nxn matrix
%
% Example:
% Dist=distance(X... |
github | zhaENS/Project-master | scat.m | .m | Project-master/Code/3rdParty/chromSDE/program/helperfunctions/scat.m | 3,237 | utf_8 | bb0f1b966edbe2f02523ba92cf9794a1 | function H=scat(Y,d,color,varargin);
% function scat(Y,d,color,varargin);
%
% displays points in Y with neigghbors from X
% within d dimensions
% and color
%
% Optional: pars.size size of ball (40 default)
% pars.circles=0 switches circles off
% pars.cla=0 does not clear screen
% par... |
github | zhaENS/Project-master | dissimilar.m | .m | Project-master/Code/3rdParty/chromSDE/program/helperfunctions/dissimilar.m | 4,066 | utf_8 | 528a337f22268e45b30a354e87507356 | function [DD,AA,b]=dissimilar(x,epsilon,knn,noise);
% function [DD,AA,b]=dissimilar(x,epsilon,knn,noise);
%
% Computes a sparse similarity matrix with the given epsilon ball or knn rule
%
% e.g.
% D=disssimilar(x,(0.3)^2); % generates sparse NN-distance matrix of columns of x (with epsilon ball of squared distance ... |
github | zhaENS/Project-master | Installmex.m | .m | Project-master/Code/3rdParty/chromSDE/program/PPA_Semismooth_new/Installmex.m | 2,350 | utf_8 | 6880d8a4e0ae9cbf8f67aa86bc553f7b | %%******************************************************
%% Run this script in Matlab command window
%%
%%******************************************************
function Installmex
computer_model = computer;
matlabversion = sscanf(version,'%f');
matlabversion = matlabversion(1);
%%
if strcmp(computer_model,'PCWIN')
... |
github | zhaENS/Project-master | randMCsym.m | .m | Project-master/Code/3rdParty/chromSDE/program/PPA_Semismooth_new/util/randMCsym.m | 2,209 | utf_8 | bea8a34e56a84b3c30d3d75a99c3519b |
%%*******************************************************************
%% [blk,At,b,M,Omega] = randMCsym(p,r,ratio,noiseLevel,randstate);
%% ratio = m/dr;
%%*******************************************************************
function [blk,At,b,M,Omega] = randMCsym(p,r,ratio,noiseLevel,randstate)
if ~exist('noiseLeve... |
github | zhaENS/Project-master | randMC.m | .m | Project-master/Code/3rdParty/chromSDE/program/PPA_Semismooth_new/util/randMC.m | 1,008 | utf_8 | a19655264c9d5488d84f445a446683db | %%
%% assume p<= q
%%
function [At,C,b,M,Omega] = randMC(p,q,r,ratio,noiseLevel,randstate)
if ~exist('noiseLevel'); noiseLevel = 0; end
if ~exist('randstate'); randstate = 0; end
randnstate_old = randn('state');
randstate_old = rand('twister');
randn('state',randstate);
rand('twister',randstate);
ML =... |
github | zhaENS/Project-master | readjoke.m | .m | Project-master/Code/3rdParty/chromSDE/program/PPA_Semismooth_new/util/readjoke.m | 1,285 | utf_8 | c5a47c847f38ceb34506f0d9eb887947 | %%
%% readjokens.m
%% read Jester Joke data set for nuclear norm minimization
%%
function [At,C,b,p,q,Gamma,Omega,samplerate,transposed] = readjoke(Data, randstate)
if ~exist('randstate')
randstate = 0;
end
randstate_old = rand('twister');
rand('twister',randstate);
M = Data(:,[2:101]);
[p,q]= size(M);
p0 = p; M... |
github | zhaENS/Project-master | readmovie.m | .m | Project-master/Code/3rdParty/chromSDE/program/PPA_Semismooth_new/util/readmovie.m | 1,552 | utf_8 | 3afa2a92be9a2e4e716f971faf0dde66 | %%
%% readmoive.m
%%
function [At,C,b,p,q,Gamma,Omega,samplerate,transposed] = readmovie(randstate)
if ~exist('randstate')
randstate = 0;
end
randstate_old = rand('state');
rand('state',randstate);
M = load('u100k.data');
p=943; q=1682;
% M = load('1Mratings.dat');
% p = 6040; q = 3900;
ii = M(:,1);
jj = M(:,2... |
github | zhaENS/Project-master | psqmrsym.m | .m | Project-master/Code/3rdParty/chromSDE/program/PPA_Semismooth_new/solver/psqmrsym.m | 4,286 | utf_8 | 87b5c6f0d7be45b138f08753b80bcbab | %%*************************************************************************
%% psqmr: preconditioned symmetric QMR with left (symmetric) preconditioner.
%%
%% b = rhs vector.
%% resnrm = norm of qmr-generated residual vector b-Ax.
%%
%% M=M1M2. Here M2 = I , left preconditioning
%%***********************************... |
github | zhaENS/Project-master | psqmr.m | .m | Project-master/Code/3rdParty/chromSDE/program/PPA_Semismooth_new/solver/psqmr.m | 2,982 | utf_8 | aeebd3ba6c517ed2e223883bab69a5a9 | %%*************************************************************************
%% psqmr: preconditioned symmetric QMR with left (symmetric)
%% preconditioner.
%% b = rhs vector.
%% resnrm = norm of qmr-generated residual vector b-Ax.
%%
%%*************************************************************************
... |
github | zhaENS/Project-master | project.m | .m | Project-master/Code/3rdParty/chromSDE/program/PPA_Semismooth_new/solver/project.m | 2,593 | utf_8 | b67ef9712005441ac171ae6e56061619 | %%***************************************************************************
%% project: compute X = Xp-Xn, where Xp,Xn are positive semidefinite.
%%
%% [Xp,Xn,d,rankXp] = project(blk,X);
%%
%% SDPNAL:
%% Copyright (c) 2008 by
%% Xinyuan Zhao, Defeng Sun, and Kim-Chuan Toh
%%*******************************************... |
github | zhaENS/Project-master | threshold2.m | .m | Project-master/Code/3rdParty/chromSDE/program/PPA_Semismooth_new/solver/threshold2.m | 3,854 | utf_8 | 80408554fda684870bd7f10ac38e58bf | %%************************************************************************
%% soft-thresholding operator:
%% [Xp,par] = threshold(X,par,tol);
%% Omega1 := Omega_alpha,alpha
%% Omega2 := Omega_alpha,gamma
%% Omega3 := Omega_alpha,beta
%%************************************************************************
func... |
github | zhaENS/Project-master | blktrace.m | .m | Project-master/Code/3rdParty/chromSDE/program/PPA_Semismooth_new/solver/blktrace.m | 485 | utf_8 | 3329e61c0c6c5f14f8ad67cb2fbe564a | %%**********************************************************************
%% blktrace: compute <X1,Z1> + ... <Xp,Zp>
%%
%%**********************************************************************
function trXZ = blktrace(blk,X,Z);
trXZ = 0;
for p = 1:size(blk,1)
pblk = blk(p,:);
if strcmp(pblk{1},'s')
trX... |
github | zhaENS/Project-master | diagapproxsym.m | .m | Project-master/Code/3rdParty/chromSDE/program/PPA_Semismooth_new/solver/diagapproxsym.m | 2,038 | utf_8 | c0a8a0c7e51dcf6b8f716956838f3133 | %%*****************************************************************
%% diagapprox: compute an approximation to
%% diag (A diag((PxP) Dsch (PtxPt)) At)
%%
%% SDPNAL:
%% Copyright (c) 2008 by
%% Xinyuan Zhao, Defeng Sun, and Kim-Chuan Toh
%%*****************************************************************
fu... |
github | zhaENS/Project-master | threshold.m | .m | Project-master/Code/3rdParty/chromSDE/program/PPA_Semismooth_new/solver/threshold.m | 1,275 | utf_8 | 59f66cb7057f4717c1b09b0a04202825 | %%
%% soft-thresholding operator:
%%
function [Wp,svdWp,rankWp,Wn] = threshold(W,par)
tmpversion = version('-release');
matlabrelease = str2num(tmpversion(1:4));
[p,q] = size(W);
postol = 1e-12; % postol = 1e-16;
if isfield(par,'sig');
rho = par.rho*par.sig; % rho = rho*sigma;
else
rho = par.rho;
end
if (... |
github | zhaENS/Project-master | svec.m | .m | Project-master/Code/3rdParty/chromSDE/program/PPA_Semismooth_new/solver/svec.m | 1,874 | utf_8 | a103add96469bed0d07596666373cb9d | %*********************************************************
%% svec: compute the vector svec(M),
%%
%% x = svec(blk,M,isspx);
%%
%% SDPT3: version 3.0
%% Copyright (c) 1997 by
%% K.C. Toh, M.J. Todd, R.H. Tutuncu
%% Last modified: 2 Feb 01
%%**********************************************************
function x = svec... |
github | zhaENS/Project-master | findstepsym.m | .m | Project-master/Code/3rdParty/chromSDE/program/PPA_Semismooth_new/solver/findstepsym.m | 1,910 | utf_8 | a31a3268d0432f389a66fa272eec688f | %%************************************************************
%% findstep: strong Wolfe line search
%%
%%************************************************************
function [par,y,W,Wp,alp,iter] = ...
findstepsym(blk,At,par,y0,W0,Wp0,dy,tol,options)
if ~exist('tol'); tol = 1e-4; end
if ~exi... |
github | zhaENS/Project-master | AXfunsym.m | .m | Project-master/Code/3rdParty/chromSDE/program/PPA_Semismooth_new/solver/AXfunsym.m | 966 | utf_8 | fc72239db1ecca067ac592218c1522d8 | %%*********************************************************
%% AXfun: compute AX(k) = <Ak,X>, k = 1:m
%%
%% AX = AXfun(blk,At,X);
%%
%%**********************************************************
function AX = AXfunsym(blk,At,X)
if iscell(At)
m = size(At{1},2);
AX = zeros(m,1);
for p = 1:size(blk,1);
... |
github | zhaENS/Project-master | PPASolversym.m | .m | Project-master/Code/3rdParty/chromSDE/program/PPA_Semismooth_new/solver/PPASolversym.m | 23,666 | utf_8 | 8082390c2ecbf8bb29b4d8fe84e92c94 | %%********************************************************************
%% PPASolversym
%% solve: min{ 0.5*norm(AU-b)^2 + <C,U> + rho*<I,U> : U nxn positive semidefinite}
%%
%% [X,y,Z,runhist,W] = ...
%% PPASolversym(blk,At,b,numeq,C,rho_target,OPTIONS,X,y,Z)
%%
%%**********************************************... |
github | zhaENS/Project-master | Atyfunsym.m | .m | Project-master/Code/3rdParty/chromSDE/program/PPA_Semismooth_new/solver/Atyfunsym.m | 721 | utf_8 | d26ae2f61dc5660d333f538673d8b658 | %%*********************************************************
%% Atyfun: compute sum_{k=1}^m yk*Ak.
%%
%% Q = Atyfun(blk,At,y);
%%**********************************************************
function Q = Atyfunsym(blk,At,y,isspAy)
if (nargin < 4); isspAy = ones(size(blk,1),1); end
Q = cell(size(blk,1),1);
%%
if iscell(A... |
github | zhaENS/Project-master | diagapprox.m | .m | Project-master/Code/3rdParty/chromSDE/program/PPA_Semismooth_new/solver/diagapprox.m | 1,421 | utf_8 | ea747cdcb8c58682e3e40649e1347ed9 |
%% diagonal preconditioner for IDR(s)
%% L.invdiagM
function L = diagapprox(AAt,par)
p = par.p; q = par.q;
r = length(par.posidx);
if (r==0)
diagH = max(1e-4,par.msk);
L.invdiagM = 1./diagH;
return
end
Usquare = par.U.*par.U;
% Vsquare = par.V1.*par.V1;
V1tsquare = par.V1t.*par.V1t;
% M = 0.5*(par.Omeg... |
github | zhaENS/Project-master | findstep.m | .m | Project-master/Code/3rdParty/chromSDE/program/PPA_Semismooth_new/solver/findstep.m | 1,781 | utf_8 | 0752ba48d22926c2b4462508635d709f | %%************************************************************
%% For SVD case
%% findstep: strong Wolfe line search
%%************************************************************
function [par,y,W,Wp,alp,iter] = ...
findstep(At,par,y0,W0,Wp0,dy,tol,options)
if ~exist('tol'); tol = 1e-4; end
if ~exist('options... |
github | zhaENS/Project-master | PPASolver.m | .m | Project-master/Code/3rdParty/chromSDE/program/PPA_Semismooth_new/solver/PPASolver.m | 22,171 | utf_8 | 859988937c265a88f92f56944396bb59 | %%********************************************************************
%% PPASolver:
%% Solve: min{ 0.5*norm(AX-b)^2 + rho*sum(svd(X)) : BX = d; X\in R^{p*q}}
%% Assume: p<= q
%% AhatT = [AT BT] bhat = (b;d); yhat =(y; z);
%% [X,y,Z,info,runhist] =PPASolver(At,b,numeq,p,q,rho_target,OPTIONS,X,y,Z)
%% numeq: ... |
github | zhaENS/Project-master | vectriu.m | .m | Project-master/Code/3rdParty/chromSDE/program/PPA_Semismooth_new/solver/vectriu.m | 771 | utf_8 | ae62dd2d4a92ba1e19d6a6466885d58a | %%***********************************************************
%% vectriu: stack the upper triangular part of a matrix
%% into a vector.
%%
%% xvec = vectriu(blk,x);
%%
%%***********************************************************
function xvec = vectriu(blk,x)
if ~iscell(x)
r = blk{1,2};
ismt = isemp... |
github | zhaENS/Project-master | precondsym.m | .m | Project-master/Code/3rdParty/chromSDE/program/PPA_Semismooth_new/solver/precondsym.m | 5,381 | utf_8 | e831b2a770a5564a40c0061ceebbcdf9 | %%*****************************************************************
%% precondsym: compute an approximation to
%% (1/sigma)V approx = [M, q; q', alpha],
%% q = A(H) and alpha = sum(sum(H));
%% PrcondData provide the indices for generating the matrix J
%% it is easier to generate Jt (the transpose of J)
%% by ... |
github | zhaENS/Project-master | matvec.m | .m | Project-master/Code/3rdParty/chromSDE/program/PPA_Semismooth_new/solver/matvec.m | 2,803 | utf_8 | 3e1f5db11eff5d0c19c528a9058e5343 | %%************************************************************************
%% For SVD use nonsymmetric case
%% matvec: matrix-vector multiply.
%% matrix B = diag(msk) + sig* (A*DP_rhosigma*At)
%%************************************************************************
function By = matvec(At,par,y)
N = length(y);
p = ... |
github | zhaENS/Project-master | matvecAAt.m | .m | Project-master/Code/3rdParty/chromSDE/program/PPA_Semismooth_new/solver/matvecAAt.m | 210 | utf_8 | aeaf0c3b61ea8348bed5e82754d75bc0 | %%
%% By = msk.*y + sig*AAt(y)
%%
function By = matvecAAt(At,par,y)
m = length(y);
By = zeros(m,1);
if (norm(y)==0); return; end
%%
Aty = Atyfun(At,y,par.p,par.q);
By = par.msk.*y + par.sig*AXfun(At,Aty);
|
github | zhaENS/Project-master | smat.m | .m | Project-master/Code/3rdParty/chromSDE/program/PPA_Semismooth_new/solver/smat.m | 878 | utf_8 | 9ca68488466f848a736c539151b0bd89 | %%*********************************************************
%% smat: compute the matrix smat(x).
%%
%% M = smat(blk,x,isspM);
%%
%% SDPT3: version 3.0
%% Copyright (c) 1997 by
%% K.C. Toh, M.J. Todd, R.H. Tutuncu
%% Last modified: 2 Feb 01
%%**********************************************************
function M = sma... |
github | zhaENS/Project-master | project2.m | .m | Project-master/Code/3rdParty/chromSDE/program/PPA_Semismooth_new/solver/project2.m | 2,614 | utf_8 | 7f13f6d54ecca8532b92235be6af9369 | %%************************************************************************
%% project2: compute projection onto the cone of positive
%% semidefinite matrices.
%%
%% [Xp,par] = project2(blk,X,par);
%%
%% SDPNAL:
%% Copyright (c) 2008 by
%% Xinyuan Zhao, Defeng Sun, and Kim-Chuan Toh
%%*************************... |
github | zhaENS/Project-master | Newton_matrixcg.m | .m | Project-master/Code/3rdParty/chromSDE/program/PPA_Semismooth_new/solver/Newton_matrixcg.m | 5,148 | utf_8 | b8c7c9bd6605a8b9825f15b62b6a98e6 | %%
%% Matrix CG For alternating Newton Step
%%
function [p,flag,relres,iterk] = Newton_matrixcg(blk, At, b,par,L, tol,maxit)
% Initializations
n=blk{1,2};
r = b; %We take the initial guess x0=0 to save time in calculating A(x0)
n2b =norm(b,'fro'); % norm of b
tolb = tol * n2b; % relative tolerance
p = zeros(n,n... |
github | zhaENS/Project-master | invmatvecfun.m | .m | Project-master/Code/3rdParty/chromSDE/program/PPA_Semismooth_new/solver/invmatvecfun.m | 878 | utf_8 | 6263b5acffc6ed1ec01f4eaa5c1ae0e7 | %%******************************************************************
%% computer y = inv(S)*x;
%% inv(S) = invD - invDJhat*Ginv*invDJhat'
%%
%% For RKE and EDM problems
%%******************************************************************
function y = invmatvecfun(L,x)
if (norm(x) == 0); y = zeros(length(x),1); return;... |
github | zhaENS/Project-master | matvecAAtsym.m | .m | Project-master/Code/3rdParty/chromSDE/program/PPA_Semismooth_new/solver/matvecAAtsym.m | 530 | utf_8 | 1ed74288331ba21bd170ec6f772fb5b3 | %%************************************************************************
%% alternatingmatvec: matrix-vector multiply.
%% matrix B = tau*I + sig*A*At
%%************************************************************************
function By = matvecAAtsym(blk,At,par,y)
N = length(y);
By = zeros(N,1);
if (norm(y) == 0);... |
github | zhaENS/Project-master | matvecsym.m | .m | Project-master/Code/3rdParty/chromSDE/program/PPA_Semismooth_new/solver/matvecsym.m | 1,680 | utf_8 | 5cdfeedac5b2ae5ee2ef6edc554e2f10 | %%************************************************************************
%% matvec: matrix-vector multiply.
%% matrix B = diag(msk) + sig* (A*DPi*At)
%% = diag(msk) + sig * A(PxP) Dsch (PtxPt)At
%%************************************************************************
function By = matvecsym(blk,At,par,y)
... |
github | zhaENS/Project-master | precondEDM.m | .m | Project-master/Code/3rdParty/chromSDE/program/PPA_Semismooth_new/solver/precondEDM.m | 4,308 | utf_8 | 7ca340c33cae0f43a443f0b5be1f06a1 | %%*****************************************************************
%% precondEDM: compute an approximation to
%% (1/sigma)V approx = [M, q; q', alpha],
%% q = A(H) and alpha = sum(sum(H));
%% PrcondData provide the indices for generating the matrix J
%% it is easier to generate Jt (the transpose of J)
%% by ... |
github | zhaENS/Project-master | SimpleRouseParams.m | .m | Project-master/Code/SimpleRouse/SimpleRouseParams.m | 9,008 | utf_8 | 95278c0ca0c65eb044b8f4c77b9dd1d6 | classdef SimpleRouseParams<handle
% Parameters for the SimpleRouse class and simulations framework
properties (SetObservable,GetObservable,AbortSet)
affineBeadsNum@double % a fixed pair indices of affine beads
analyzeResults@logical % perform analysis post simulations
b@double % std of bead distance
... |
github | zhaENS/Project-master | scrTestBendingElasticityWithJointForces.m | .m | Project-master/Code/TestCodes/scrTestBendingElasticityWithJointForces.m | 2,768 | utf_8 | 404d38b7ba88f75f03643db2ec6c97e3 | % scr test bending elasticity with force at all joints
function scrTestBendingElasticityWithJointForces
close all
numPoints = 130;
dimension = 3;
diffusionConst = 0.0;
partSTD = 5;
springConst = 0;%(dimension*diffusionConst./partSTD^2);
rMat = RouseMatrix(numPoints);
fixedParticles = [];
... |
github | zhaENS/Project-master | GaussianChainEigenvalues.m | .m | Project-master/Code/TestCodes/GaussianChainEigenvalues.m | 743 | utf_8 | 93c36677ac14b4d58278e1666a15a463 | function GaussianChainEigenvalues % unfinished
% This function follows the Eichinger algorithm to calculate the
% eigenvalues of generalized Gaussian chain.
% Sub units of the chain are identical
numBeads = 10; % number of beads
chainGraph = zeros(numBeads); % the connected compoent
% label nodes
[nodeLabels] = ... |
github | zhaENS/Project-master | SmoothUsingHeatEquation.m | .m | Project-master/Code/TestCodes/SmoothUsingHeatEquation.m | 1,076 | utf_8 | 3834d713cbc0ba237255155dad6a1526 | % test eig fitting
function SmoothUsingHeatEquation(sig)
% eMat is the encounter matrix
% r = RouseMatrix(size(eMat,1));
sig = sig./sum(sig);% normalize the signal
b0 = zeros(1,2*numel(sig));% initial guess
b0 = ones(1,30);
D = 1;% diffusion constant
% lambda = (0:(2*numel(sig)-... |
github | zhaENS/Project-master | scrCharacterizeMeanDensityInTADs.m | .m | Project-master/Code/ExperimentDataAnalysis/scrCharacterizeMeanDensityInTADs.m | 2,160 | utf_8 | f180ee8cf8f77708158caaaa11d818da | function scrCharacterizeMeanDensityInTADs
close all
% for TAD D
load('savedAnalysisTADD.mat');
e1j = a.encounterMatrix.average;
[m, meanB]=Analyze(e1j);
figure, plot(m),title(['TAD D, mean b= ', num2str(meanB)]), xlabel('bead'),ylabel('mean distance')
% TAD E
load('savedAnalysisTADE.mat')
e1j = a.encounterMatrix.avera... |
github | satwikkottur/VisualWord2Vec-master | alignAbstractFeatures.m | .m | VisualWord2Vec-master/word2vecVisual/utils/vp/alignAbstractFeatures.m | 2,266 | utf_8 | 27948cb5eb6d1f58d3c72003a619f350 | % Script to align the textual and visual features in the Abstract image dataset
% (ADS)
function alignAbstractFeatures(vpPath, featPath, savePath)
idMapFile = 'SceneMapV1_10020.txt';
nameMapFile = 'SceneMap.txt';
idMapFile = fopen(idMapFile, 'rb');
nameMapFile = fopen(nameMapFile, 'rb');
names = t... |
github | satwikkottur/VisualWord2Vec-master | fetchVPTrainData.m | .m | VisualWord2Vec-master/word2vecVisual/utils/vp/fetchVPTrainData.m | 522 | utf_8 | 52f2e022c805902907bfed422708f3bc | % Script to extract all the relevant data to perform VP training
function fetchVPTrainData(absPath, vpPath, savePath)
% Input:
% absPath - path to abstract scene dataset
% vpPath - path to the VP dataset
% savePath - path to save all the files
% Extract all the features
extractAbstractFeatures(absPath, s... |
github | satwikkottur/VisualWord2Vec-master | extractAbstractFeatures.m | .m | VisualWord2Vec-master/word2vecVisual/utils/vp/extractAbstractFeatures.m | 1,173 | utf_8 | 06bd20046574cf398a79fb2a0cb10126 | % Script to get the features from abstract dataset, concatenate all the feature files
function extractAbstractFeatures(dataPath, savePath)
% Get the listing of the feature files
listing = dir(fullfile(dataPath, 'VisualFeatures', '*.txt'));
listing = {listing.name}';
% Remove Rel GMM as flip account ver... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.