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 | noureldien/PortfolioOptimization-master | nzlist.m | .m | PortfolioOptimization-master/sdpt3/Solver/nzlist.m | 5,014 | utf_8 | 1225b63fe9e00df09546243f60599dc2 | %%***********************************************************************
%% nzlist: find the combined list of non-zero elements
%% of Aj, j = 1:k, for each k,
%% assuming that the Aj's are permuted such that
%% A1 has the fewest nonzero elements, followed by A2, and so on.
%%
%% [isspA,nzlistA,... |
github | noureldien/PortfolioOptimization-master | detect_lblk.m | .m | PortfolioOptimization-master/sdpt3/Solver/detect_lblk.m | 4,228 | utf_8 | a69e3486a171d0169d9b62b749ed6cd8 | %%*******************************************************************
%% detect_lblk: detect diagonal blocks in the SDP data.
%%
%% [blk,At,C,diagblkinfo,blockchange,parbarrier,X,Z] = ...
%% detect_lblk(blk,At,C,b,parbarrier,X,Z);
%%
%% SDPT3: version 3.1
%% Copyright (c) 1997 by
%% K.C. Toh, M.J. Todd, R.H. ... |
github | noureldien/PortfolioOptimization-master | gdcomp.m | .m | PortfolioOptimization-master/sdpt3/Solver/gdcomp.m | 4,877 | utf_8 | edb240000afc00b0bd8d14fdc4ab944c | %%*********************************************************************
%% gdcomp: Compute gd = 1/td in Equation (15) of the paper:
%%
%% R.M. Freund, F. Ordonez, and K.C. Toh,
%% Behavioral measures and their correlation with IPM iteration counts
%% on semi-definite programming problems,
%% Mathematical Programming, 1... |
github | noureldien/PortfolioOptimization-master | blkbarrier.m | .m | PortfolioOptimization-master/sdpt3/Solver/blkbarrier.m | 1,795 | utf_8 | 77a6eb1f1708aa69217000d27735efa0 | %%********************************************************************
%% blkbarrier: calculate
%% [-v(p)*logdet(X{p}), v(p)*logdet(Z{p}) + n*v(p)*(1-log(v(p)))]
%% [-v(p)*log(gam(X{p})), v(p)*log(gam(Z{p})) + v(p)]
%% [-v(p)*log(X{p}), v(p)*log(Z{p}) + n*v(p)*(1-log(v(p)))]
%%***********************************... |
github | noureldien/PortfolioOptimization-master | sqlpmain.m | .m | PortfolioOptimization-master/sdpt3/Solver/sqlpmain.m | 29,621 | utf_8 | d052de03de9bd9acef64a9af06d356db | %%*************************************************************************
%% sqlp: main solver
%%
%%*************************************************************************
%% SDPT3: version 3.1
%% Copyright (c) 1997 by
%% K.C. Toh, M.J. Todd, R.H. Tutuncu
%% Last Modified: 16 Sep 2004
%%****************************... |
github | noureldien/PortfolioOptimization-master | HKMpred.m | .m | PortfolioOptimization-master/sdpt3/Solver/HKMpred.m | 2,818 | utf_8 | da0e8d9efacd9a7cebaae5ea2ad63de9 | %%*******************************************************************
%% HKMpred: Compute (dX,dy,dZ) for the H..K..M direction.
%%
%% SDPT3: version 3.1
%% Copyright (c) 1997 by
%% K.C. Toh, M.J. Todd, R.H. Tutuncu
%% Last Modified: 16 Sep 2004
%%*******************************************************************
func... |
github | noureldien/PortfolioOptimization-master | read_sdpa.m | .m | PortfolioOptimization-master/sdpt3/Solver/read_sdpa.m | 7,591 | utf_8 | 211ea10474df1ffe50a0c5456e1cbe41 | %%*******************************************************************
%% Read in a problem in SDPA sparse format.
%%
%% [blk,At,C,b] = read_sdpa(fname)
%%
%% Input: fname = name of the file containing SDP data in
%% SDPA foramt.
%% Important: the data is assumed to contain only
%% semide... |
github | noureldien/PortfolioOptimization-master | sortA.m | .m | PortfolioOptimization-master/sdpt3/Solver/sortA.m | 2,639 | utf_8 | c998ea7df87432b78f6c001d0bbc5318 | %%*********************************************************************
%% sortA: sort columns of At{p} in ascending order according to the
%% number of nonzero elements.
%%
%% [At,C,b,X0,Z0,permA,permZ] = sortA(blk,At,C,b,X0,Z0);
%%
%% SDPT3: version 3.1
%% Copyright (c) 1997 by
%% K.C. Toh, M.J. Todd, R.H. Tut... |
github | noureldien/PortfolioOptimization-master | blkeig.m | .m | PortfolioOptimization-master/sdpt3/Solver/blkeig.m | 2,412 | utf_8 | 97da97f8165585de45eae52a86e0f127 | %%***************************************************************************
%% blkeig: compute eigenvalue decomposition of a cell array
%% whose contents are square matrices or the diagonal
%% of a diagonal matrix.
%%
%% [d,V] = blkeig(blk,X);
%%
%% SDPT3: version 3.1
%% Copyright (c) 1997 by
%% K.C. ... |
github | noureldien/PortfolioOptimization-master | HKMrhsfun.m | .m | PortfolioOptimization-master/sdpt3/Solver/HKMrhsfun.m | 3,358 | utf_8 | b1e6a8305128af799634b9ef7324cfeb | %%*******************************************************************
%% HKMrhsfun: compute the right-hand side vector of the
%% Schur complement equation for the HKM direction.
%%
%% SDPT3: version 3.1
%% Copyright (c) 1997 by
%% K.C. Toh, M.J. Todd, R.H. Tutuncu
%% Last Modified: 16 Sep 2004
%%***********... |
github | noureldien/PortfolioOptimization-master | linsysolve.m | .m | PortfolioOptimization-master/sdpt3/Solver/linsysolve.m | 7,741 | utf_8 | 2091e9d1c0858acfd5c4e07842ed787d | %%***************************************************************
%% linsysolve: solve linear system to get dy, and direction
%% corresponding to unrestricted variables.
%%
%% [xx,coeff,L,resnrm] = linsysolve(schur,UU,Afree,EE,rhs);
%%
%% child functions: symqmr.m, mybicgstable.m, linsysolvefun.m
%%
%% SDPT... |
github | noureldien/PortfolioOptimization-master | schurmat_qblk.m | .m | PortfolioOptimization-master/sdpt3/Solver/schurmat_qblk.m | 3,205 | utf_8 | d154ddca57828c83c43efd37fbe64829 | %%*******************************************************************
%% schurmat_qblk: compute schur matrix corresponding to SOCP blocks.
%%
%% HKM direction: output = schur + Ax*Ae' + Ae*Ax' - Ad*Ad'
%% NT direction: output = schur + Ae*Ae' - Ad*Ad'
%%
%% where schur = A*D*A', and Ad is the modification to ADA'
%% s... |
github | noureldien/PortfolioOptimization-master | ops.m | .m | PortfolioOptimization-master/sdpt3/Solver/ops.m | 11,548 | utf_8 | 0931c97ce9eb7f01a28fac581153ca1c | %%******************************************************************
%% ops:
%%
%% Z = ops(X,operand,Y,alpha);
%%
%% INPUT: X = a matrix or a scalar
%% or a CELL ARRAY consisting only of matrices
%% operand = sym, transpose, triu, tril,
%% real, imag, sqrt, abs, ... |
github | noureldien/PortfolioOptimization-master | schurmat_lblk.m | .m | PortfolioOptimization-master/sdpt3/Solver/schurmat_lblk.m | 1,010 | utf_8 | 11b66919604e457c631f5ed67225fc45 | %%*******************************************************************
%% schurmat_lblk: compute A*D*A'
%%
%% SDPT3: version 3.1
%% Copyright (c) 1997 by
%% K.C. Toh, M.J. Todd, R.H. Tutuncu
%% Last Modified: 16 Sep 2004
%%*******************************************************************
function [schur,UU,EE] = schu... |
github | noureldien/PortfolioOptimization-master | sqlpmisc.m | .m | PortfolioOptimization-master/sdpt3/Solver/sqlpmisc.m | 4,078 | utf_8 | 1dc032b6e1fd72eb26f2f3e519a746dd | %%*****************************************************************************
%% sqlpmisc:
%% unscale and produce infeasibility certificates if appropriate
%%
%% SDPT3: version 3.1
%% Copyright (c) 1997 by
%% K.C. Toh, M.J. Todd, R.H. Tutuncu
%% Last Modified: 16 Sep 2004.
%%******************************************... |
github | noureldien/PortfolioOptimization-master | checkdense.m | .m | PortfolioOptimization-master/sdpt3/Solver/checkdense.m | 730 | utf_8 | 6d44b41643ef16f78b42927e1fc03dd8 | %%********************************************************************
%% checkdense : identify the dense columns of a matrix
%%
%% SDPT3: version 3.1
%% Copyright (c) 1997 by
%% K.C. Toh, M.J. Todd, R.H. Tutuncu
%% Last Modified: 16 Sep 2004
%%********************************************************************
funct... |
github | noureldien/PortfolioOptimization-master | NTrhsfun.m | .m | PortfolioOptimization-master/sdpt3/Solver/NTrhsfun.m | 4,253 | utf_8 | 51c74223afc232c456def8488b51aa3f | %%*******************************************************************
%% NTrhsfun: compute the right-hand side vector of the
%% Schur complement equation for the NT direction.
%%
%% SDPT3: version 3.1
%% Copyright (c) 1997 by
%% K.C. Toh, M.J. Todd, R.H. Tutuncu
%% Last Modified: 16 Sep 2004
%%***************... |
github | noureldien/PortfolioOptimization-master | SDPvalBounds.m | .m | PortfolioOptimization-master/sdpt3/Solver/SDPvalBounds.m | 1,843 | utf_8 | fa3af856805cc15685c38e69218a8ffb | %%*****************************************************************
%% compute lower and upper bounds for the exact primal
%% optimal value.
%%
%% LB <= true optimal dual value = true optimal primal value <= UB.
%%
%%*****************************************************************
function [LB,UB] = SDPvalBo... |
github | noureldien/PortfolioOptimization-master | NTscaling.m | .m | PortfolioOptimization-master/sdpt3/Solver/NTscaling.m | 1,847 | utf_8 | 82a266e8bf9cf33993f0bff10650c15c | %%**********************************************************************
%% NTscaling: Compute NT scaling matrix
%%
%% compute SVD of Xchol*Zchol via eigenvalue decompostion of
%% Zchol * X * Zchol' = V * diag(sv2) * V'.
%% compute W satisfying W*Z*W = X.
%% W = G'*G, where G = diag(sqrt(sv)) * (invZchol*V)'
%... |
github | noureldien/PortfolioOptimization-master | linsysolvefun.m | .m | PortfolioOptimization-master/sdpt3/Solver/linsysolvefun.m | 1,276 | utf_8 | 7ca4a2896ad33a210a95d53138f0676f | %%*************************************************************************
%% linsysolvefun: Solve H*x = b
%%
%% x = linsysolvefun(L,b)
%% where L contains the triangular factors of H.
%%
%% SDPT3: version 3.1
%% Copyright (c) 1997 by
%% K.C. Toh, M.J. Todd, R.H. Tutuncu
%% Last Modified: 16 Sep 2004
%%***************... |
github | noureldien/PortfolioOptimization-master | sqlpdemo.m | .m | PortfolioOptimization-master/sdpt3/Solver/sqlpdemo.m | 6,011 | utf_8 | 793deabad8688259781993ce346cea24 | %%*****************************************************************
%% Examples of SQLP.
%%
%% this is an illustration on how to use our SQLP solvers
%% coded in sqlp.m
%%
%% feas = 1 if want feasible initial iterate
%% = 0 otherwise
%%
%% SDPT3: version 3.1
%% Copyright (c) 1997 by
%% K.C. Toh, M.J. Todd, R.H. Tu... |
github | noureldien/PortfolioOptimization-master | gpcomp.m | .m | PortfolioOptimization-master/sdpt3/Solver/gpcomp.m | 5,095 | utf_8 | 7e23e98588f834156a9f13545f77cb3b | %%*********************************************************************
%% gpcomp: Compute tp=1/gp in Proposition 2 of the paper:
%%
%% R.M. Freund, F. Ordonez, and K.C. Toh,
%% Behavioral measures and their correlation with IPM iteration counts
%% on semi-definite programming problems,
%% Mathematical Programming, 109... |
github | noureldien/PortfolioOptimization-master | sqlparameters.m | .m | PortfolioOptimization-master/sdpt3/Solver/sqlparameters.m | 5,137 | utf_8 | 76bbd09e284250f7770836baabcc95e5 | %%*************************************************************************
%% parameters.m: set OPTIONS structure to specify default
%% parameters for sqlp.m
%%
%% OPTIONS.vers : version of direction to use.
%% 1 for HKM direction
%% 2 for NT direction
%... |
github | noureldien/PortfolioOptimization-master | convertcmpsdp.m | .m | PortfolioOptimization-master/sdpt3/Solver/convertcmpsdp.m | 3,465 | utf_8 | 6bd9a62cfb0249da5d75665cfb26063b | %%*********************************************************
%% convertcmpsdp: convert SDP with complex data into one
%% with real data by converting
%%
%% C - sum_{k=1}^m yk*Ak psd
%% to
%% [CR,-CI] - sum ykR*[AkR,-AkI] psd
%% [CI, CR] [AkI, AkR]
%%
%% ykI = 0 for k = 1:m
%%
%% [bblk,AAt,C... |
github | noureldien/PortfolioOptimization-master | sqlpsummary.m | .m | PortfolioOptimization-master/sdpt3/Solver/sqlpsummary.m | 4,047 | utf_8 | 78361a4e3dfeaeb73a7102b08ad30733 | %%*****************************************************************************
%% sqlpsummary: print summary
%%
%% SDPT3: version 3.1
%% Copyright (c) 1997 by
%% K.C. Toh, M.J. Todd, R.H. Tutuncu
%% Last Modified: 16 Sep 2004
%%*****************************************************************************
function sq... |
github | noureldien/PortfolioOptimization-master | checkdepconstr.m | .m | PortfolioOptimization-master/sdpt3/Solver/checkdepconstr.m | 6,926 | utf_8 | 186362786fef9d7d3328ab9e5a9e117c | %%*****************************************************************************
%% checkdepconst: compute AAt to determine if the
%% constraint matrices Ak are linearly independent.
%%
%% [At,b,y,idxB,neardepconstr,feasible,AAt] = checkdepconstr(blk,At,b,y,rmdepconstr);
%%
%% rmdepconstr = 1, if want to rem... |
github | noureldien/PortfolioOptimization-master | convertRcone.m | .m | PortfolioOptimization-master/sdpt3/Solver/convertRcone.m | 948 | utf_8 | afa3b210699dbf796a257cb53e92ef0d | %%***************************************************************
%% convertRcone: convert rotated cone to socp cone
%%
%% [blk,At,C,b,T] = convertRcone(blk,At,C,b);
%%
%%***************************************************************
function [blk,At,C,b,T] = convertRcone(blk,At,C,b)
T = cell(size(blk,1),1);
for p =... |
github | noureldien/PortfolioOptimization-master | qops.m | .m | PortfolioOptimization-master/sdpt3/Solver/qops.m | 1,421 | utf_8 | bddd4e93643ef0eb5b6868ef41d2bec7 | %%********************************************************
%% qops: Fu = qops(pblk,w,f,options,u);
%%
%% options = 1, Fu(i) = <wi,fi>
%% = 2, Fu(i) = 2*wi(1)*fi(1)-<wi,fi>
%% = 3, Fui = w(i)*fi
%% = 4, Fui = w(i)*fi, Fui(1) = -Fui(1).
%% options = 5, Fu = w [ f'*u ; ub + fb*alp ], where
%% ... |
github | noureldien/PortfolioOptimization-master | HKMdirfun.m | .m | PortfolioOptimization-master/sdpt3/Solver/HKMdirfun.m | 1,703 | utf_8 | 2e90b8de8daed6f5a9a6894232dbff6a | %%*******************************************************************
%% HKMdirfun: compute (dX,dZ), given dy, for the HKM direction.
%%
%% SDPT3: version 3.1
%% Copyright (c) 1997 by
%% K.C. Toh, M.J. Todd, R.H. Tutuncu
%% Last Modified: 16 Sep 2004
%%*******************************************************************... |
github | noureldien/PortfolioOptimization-master | symqmr.m | .m | PortfolioOptimization-master/sdpt3/Solver/symqmr.m | 3,957 | utf_8 | bf28cb72305cb0378a7b572d42f39ff6 | %%*************************************************************************
%% symqmr: symmetric QMR with left (symmetric) preconditioner.
%% The preconditioner used is based on the analytical
%% expression of inv(A).
%%
%% [x,resnrm,solve_ok] = symqmr(A,b,L,tol,maxit)
%%
%% child function: linsysolvefu... |
github | noureldien/PortfolioOptimization-master | validate_startpoint.m | .m | PortfolioOptimization-master/sdpt3/Solver/validate_startpoint.m | 3,067 | utf_8 | 572146bf8639c3d5066b6a790bca3ba8 | %%***********************************************************************
%% validate_startpoint: validate_startpoint starting point X0,y0,Z0
%%
%%
%% SDPT3: version 3.1
%% Copyright (c) 1997 by
%% K.C. Toh, M.J. Todd, R.H. Tutuncu
%% Last Modified: 16 Sep 2004
%%********************************************************... |
github | noureldien/PortfolioOptimization-master | Atyfun.m | .m | PortfolioOptimization-master/sdpt3/Solver/Atyfun.m | 1,471 | utf_8 | 5af173811d5528ab49ca2a48bd4748ce | %%*********************************************************
%% Atyfun: compute sum_{k=1}^m yk*Ak.
%%
%% Q = Atyfun(blk,At,permA,isspAy,y);
%%
%% Note: permA and isspAy may be set to [].
%%
%% SDPT3: version 3.1
%% Copyright (c) 1997 by
%% K.C. Toh, M.J. Todd, R.H. Tutuncu
%% Last Modified: 16 Sep 2004
%%**************... |
github | noureldien/PortfolioOptimization-master | blkcholfun.m | .m | PortfolioOptimization-master/sdpt3/Solver/blkcholfun.m | 1,247 | utf_8 | 6d78842d748fad818d79a003e1238916 | %%******************************************************************
%% blkcholfun: compute Cholesky factorization of X.
%%
%% [Xchol,indef] = blkcholfun(blk,X,permX);
%%
%% X = Xchol'*Xchol;
%%
%% SDPT3: version 3.1
%% Copyright (c) 1997 by
%% K.C. Toh, M.J. Todd, R.H. Tutuncu
%% Last Modified: 16 Sep 2004
%%*******... |
github | noureldien/PortfolioOptimization-master | smat.m | .m | PortfolioOptimization-master/sdpt3/Solver/smat.m | 880 | utf_8 | 184f4081013cebeae6150a22b224ebf9 | %%*********************************************************
%% smat: compute the matrix smat(x).
%%
%% M = smat(blk,x,isspM);
%%
%% SDPT3: version 3.1
%% Copyright (c) 1997 by
%% K.C. Toh, M.J. Todd, R.H. Tutuncu
%% Last Modified: 16 Sep 2004
%%**********************************************************
function M = ... |
github | noureldien/PortfolioOptimization-master | sqlpcheckconvg.m | .m | PortfolioOptimization-master/sdpt3/Solver/sqlpcheckconvg.m | 8,298 | utf_8 | 6acb41aefb05d5a53dbd501dabab2b33 | %%*****************************************************************************
%% sqlpcheckconvg: check convergence.
%%
%% SDPT3: version 3.1
%% Copyright (c) 1997 by
%% K.C. Toh, M.J. Todd, R.H. Tutuncu
%% Last Modified: 16 Sep 2004
%%*****************************************************************************
func... |
github | noureldien/PortfolioOptimization-master | SDPT3soln_SEDUMIsoln.m | .m | PortfolioOptimization-master/sdpt3/Solver/SDPT3soln_SEDUMIsoln.m | 2,743 | utf_8 | 1f7236a38116d782e7084afc40e90a10 | %%**********************************************************
%% SDPT3soln_SEDUMIsoln: convert SQLP solution in SDPT3 format to
%% SeDuMi format
%%
%% [xx,yy,zz] = SDPT3soln_SEDUMIsoln(blk,X,y,Z,perm);
%%
%% usage: load SEDUMI_data_file (containing say, A,b,c,K)
%% [blk,At,C,b,perm] = read_s... |
github | noureldien/PortfolioOptimization-master | detect_ublk.m | .m | PortfolioOptimization-master/sdpt3/Solver/detect_ublk.m | 2,815 | utf_8 | 819f087d73a97e1717b952ca2f3a407d | %%*******************************************************************
%% detect_ublk: search for implied free variables in linear
%% block.
%% [blk2,At2,C2,ublkinfo] = detect_ublk(blk,At,C);
%%
%% i1,i2: indices corresponding to splitting of unrestricted varaibles
%% i3 : remaining indices in the linear ... |
github | noureldien/PortfolioOptimization-master | combine_blk.m | .m | PortfolioOptimization-master/sdpt3/Solver/combine_blk.m | 2,358 | utf_8 | 205279faec8f7b11c04bc75707a6eb77 | %%*******************************************************************
%% combine_blk: combine small SDP blocks together,
%% combine all SOCP blocks together, etc
%%
%% [blk2,At2,C2,blkinfo] = combine_blk(blk,At,C);
%%
%%
%% SDPT3: version 3.1
%% Copyright (c) 1997 by
%% K.C. Toh, M.J. Todd, R.H. Tutuncu
%%... |
github | noureldien/PortfolioOptimization-master | Prod2.m | .m | PortfolioOptimization-master/sdpt3/Solver/Prod2.m | 1,882 | utf_8 | b291dcf07608872ed75bd82e48ff0b54 | %%*******************************************************************
%% Prod2: compute the block diagonal matrix A*B
%%
%% C = Prod2(blk,A,B,options);
%%
%% INPUT: blk = a cell array describing the block structure of A and B
%% A,B = square matrices or column vectors.
%%
%% options = 0 if no special str... |
github | noureldien/PortfolioOptimization-master | NTdirfun.m | .m | PortfolioOptimization-master/sdpt3/Solver/NTdirfun.m | 1,614 | utf_8 | a236e4d45e59db8824375b14ed6090a1 | %%*******************************************************************
%% NTdirfun: compute (dX,dZ), given dy, for the NT direction.
%%
%% SDPT3: version 3.1
%% Copyright (c) 1997 by
%% K.C. Toh, M.J. Todd, R.H. Tutuncu
%% Last Modified: 16 Sep 2004
%%*******************************************************************
... |
github | noureldien/PortfolioOptimization-master | make.m | .m | PortfolioOptimization-master/examples/make.m | 23,079 | utf_8 | 8b04233b872cb2ab50851644ae0e486a | function make( varargin )
%
% Determine the base path
%
odir = pwd;
base = mfilename('fullpath');
base = fileparts( base );
%
% Check the force and runonly flags
%
args = varargin;
is_octave = exist( 'OCTAVE_VERSION', 'builtin' );
if is_octave,
force = true;
runonly = true;
indexonly = false;
page_o... |
github | noureldien/PortfolioOptimization-master | cantilever_beam_plot.m | .m | PortfolioOptimization-master/examples/cvxbook/Ch04_cvx_opt_probs/cantilever_beam_plot.m | 1,050 | utf_8 | e8c8c9e1b601e4102f96e0436649d132 | % Plots a cantilever beam as a 3D figure.
% This is a helper function for the optimal cantilever beam example.
%
% Inputs:
% values: an array of heights and widths of each segment
% [h1 h2 ... hN w1 w2 ... wN]
%
% Almir Mutapcic 01/25/06
function cantilever_beam_plot(values)
N = length(values)/2;
for k ... |
github | noureldien/PortfolioOptimization-master | simple_step.m | .m | PortfolioOptimization-master/examples/circuit_design/simple_step.m | 235 | utf_8 | b8043326fe5966f9432b69b584891e0f | % Computes the step response of a linear system
function X = simple_step(A,B,DT,N)
n = size(A,1);
Ad = expm( full( A * DT ) );
Bd = ( Ad - eye(n) ) * B;
Bd = A \ Bd;
X = zeros(n,N);
for k = 2 : N,
X(:,k) = Ad*X(:,k-1)+Bd;
end
|
github | noureldien/PortfolioOptimization-master | spectral_fact.m | .m | PortfolioOptimization-master/examples/filter_design/spectral_fact.m | 1,292 | utf_8 | 014eebfa2dfbbd038c1383ff2ef97b0e | % Spectral factorization using Kolmogorov 1939 approach.
% (code follows pp. 232-233, Signal Analysis, by A. Papoulis)
%
% Computes the minimum-phase impulse response which satisfies
% given auto-correlation.
%
% Input:
% r: top-half of the auto-correlation coefficients
% starts from 0th element to end of the au... |
github | noureldien/PortfolioOptimization-master | polar_plot_ant.m | .m | PortfolioOptimization-master/examples/antenna_array_design/polar_plot_ant.m | 1,149 | utf_8 | 34a08a3bc75c474d61e01ea58b16e54e | % Plot a polar plot of an antenna array sensitivity
% with lines denoting the target direction and beamwidth.
% This is a helper function used in the broadband antenna examples.
%
% Inputs:
% X: an array of abs(y(theta)) where y is the antenna array pattern
% theta0: target direction
% bw: total beamw... |
github | noureldien/PortfolioOptimization-master | spectral_fact.m | .m | PortfolioOptimization-master/examples/antenna_array_design/spectral_fact.m | 1,385 | utf_8 | 570e7ae2165d19abd477494c52e609f8 | % Spectral factorization using Kolmogorov 1939 approach
% (code follows pp. 232-233, Signal Analysis, by A. Papoulis)
%
% Computes the minimum-phase impulse response which satisfies
% given auto-correlation.
%
% Input:
% r: top-half of the auto-correlation coefficients
% starts from 0th element to end of the aut... |
github | noureldien/PortfolioOptimization-master | plotgraph.m | .m | PortfolioOptimization-master/examples/graph_laplacian/plotgraph.m | 3,172 | utf_8 | a46b1d761798c492e96a5b9504aea9aa | function plotgraph(A,xy,weights)
% Plots a graph with each edge width proportional to its weight.
%
% Edges with positive weights are drawn in blue; negative weights in red.
%
% Input parameters:
% A --- incidence matrix of the graph (size is n x m)
% (n is the number of nodes and m is the number of e... |
github | noureldien/PortfolioOptimization-master | disp.m | .m | PortfolioOptimization-master/lib/@cvxprob/disp.m | 5,405 | utf_8 | 308868023e62c32fac37cc6621ed8af5 | function disp( prob, prefix )
if nargin < 2, prefix = ''; end
global cvx___
p = cvx___.problems( prob.index_ );
if isempty( p.variables ),
nvars = 0;
else
nvars = length( fieldnames( p.variables ) );
end
if isempty( p.duals ),
nduls = 0;
else
nduls = length( fieldnames( p.duals ) );
end
neqns = ( len... |
github | noureldien/PortfolioOptimization-master | apply.m | .m | PortfolioOptimization-master/lib/@cvxtuple/apply.m | 505 | utf_8 | b8d18946eb97e640bab87ef5e3256e8c | function y = apply( func, x )
y = do_apply( func, x.value_ );
function y = do_apply( func, x )
switch class( x ),
case 'struct',
y = cell2struct( do_apply( func, struct2cell( x ) ), fieldnames( x ), 1 );
case 'cell',
y = cellfun( func, x, 'UniformOutput', false );
otherwise,
y = fev... |
github | noureldien/PortfolioOptimization-master | cvx_setdual.m | .m | PortfolioOptimization-master/lib/@cvxtuple/cvx_setdual.m | 954 | utf_8 | f7aebcdf404f92b69aeb57a379454249 | function x = setdual( x, y )
x.dual_ = y;
x.value_ = do_setdual( x.value_, y );
function x = do_setdual( x, y )
switch class( x ),
case 'struct',
nx = numel( x );
if nx > 1,
error( 'Dual variables may not be attached to struct arrays.' );
end
f = fieldnames(x);
y... |
github | noureldien/PortfolioOptimization-master | testall.m | .m | PortfolioOptimization-master/lib/@cvxtuple/testall.m | 452 | utf_8 | a576b02def941cd1a47e7117b3e8bf82 | function y = testall( func, x )
y = do_test( func, x.value_ );
function y = do_test( func, x )
switch class( x ),
case 'struct',
y = do_test( func, struct2cell( x ) );
case 'cell',
y = all( cellfun( func, x ) );
otherwise,
y = feval( func, x );
end
% Copyright 2005-2014 CVX Researc... |
github | noureldien/PortfolioOptimization-master | disp.m | .m | PortfolioOptimization-master/lib/@cvxtuple/disp.m | 1,366 | utf_8 | 3a4d5bcb53c9621413fb3d692ab7e328 | function disp( x, prefix )
if nargin < 2,
prefix = '';
end
disp( [ prefix, 'cvx tuple object: ' ] );
prefix = [ prefix, ' ' ];
do_disp( x.value_, {}, prefix, prefix, '' );
if ~isempty( x.dual_ ),
dn = cvx_subs2str( x.dual_ );
disp( [ prefix, 'dual variable: ', dn(2:end) ] );
end
function do_disp( x, f, f... |
github | noureldien/PortfolioOptimization-master | sparsify.m | .m | PortfolioOptimization-master/lib/@cvx/sparsify.m | 4,031 | utf_8 | 2be6203e258210fdf364daff44f812ad | function x = sparsify( x, mode )
global cvx___
error( nargchk( 2, 2, nargin ) );
persistent remap
%
% Check mode argument
%
if ~ischar( mode ) || size( mode, 1 ) ~= 1,
error( 'Second arugment must be a string.' );
end
isobj = strcmp( mode, 'objective' );
pr = cvx___.problems( end );
touch( pr.self, x );
bz = x.... |
github | noureldien/PortfolioOptimization-master | prelp.m | .m | PortfolioOptimization-master/sedumi/conversion/prelp.m | 3,887 | utf_8 | 4d1e23d094e3f1b35ec666df11a34003 | % PRELP Loads and preprocesses LP from an MPS file.
%
% > [A,b,c,lenx,lbounds] = PRELP('problemname')
% The above command results in an LP in standard form,
% - Instead of specifying the problemname, you can also use PRELP([]), to
% get the problem from the file /tmp/default.mat.
% - Also, you may type PRE... |
github | noureldien/PortfolioOptimization-master | feasreal.m | .m | PortfolioOptimization-master/sedumi/conversion/feasreal.m | 4,144 | utf_8 | 454dcb6c42c0642ed5c5a524e84bec58 | % FEASREAL Generates a random sparse optimization problem with
% linear, quadratic and semi-definite constraints. Output
% can be used by SEDUMI. All data will be real-valued.
%
% The following two lines are typical:
% > [AT,B,C,K] = FEASREAL;
% > [X,Y,INFO] = SEDUMI(AT,B,C,K);
%
% An extended version is:
% > [... |
github | noureldien/PortfolioOptimization-master | sdpa2vec.m | .m | PortfolioOptimization-master/sedumi/conversion/sdpa2vec.m | 2,352 | utf_8 | f055b4df357f6cf3b426ce27869bc738 | % x = sdpavec(E,K)
% Takes an SDPA type sparse data description E, i.e.
% E(1,:) = block, E(2,:) = row, E(3,:) = column, E(4,:) = entry,
% and transforms it into a "long" vector, with vectorized matrices for
% each block stacked under each other. The size of each matrix block
% is given in the field K.s.
% **********... |
github | noureldien/PortfolioOptimization-master | blk2vec.m | .m | PortfolioOptimization-master/sedumi/conversion/blk2vec.m | 1,653 | utf_8 | 0d48b96f66e746fce480e7a3e9c271a5 | % x = blk2vec(X,nL)
%
% Converts a block diagonal matrix into a vector.
%
% ********** INTERNAL FUNCTION OF FROMPACK **********
function x = blk2vec(X,nL)
%
% This file is part of SeDuMi 1.1 by Imre Polik and Oleksandr Romanko
% Copyright (C) 2005 McMaster University, Hamilton, CANADA (since 1.1)
%
% Copyright (C)... |
github | noureldien/PortfolioOptimization-master | writesdp.m | .m | PortfolioOptimization-master/sedumi/conversion/writesdp.m | 4,708 | utf_8 | 31f196bca4c11b9610c98de8e4d7b107 | % This function takes a problem in SeDuMi MATLAB format and writes it out
% in SDPpack format.
%
% Usage:
%
% writesdp(fname,A,b,c,K)
%
% fname Name of SDPpack file, in quotes
% A,b,c,K Problem in SeDuMi form
%
% Notes:
%
% Problems with complex data are not allowed.
%
% ... |
github | noureldien/PortfolioOptimization-master | frompack.m | .m | PortfolioOptimization-master/sedumi/conversion/frompack.m | 2,509 | utf_8 | a4730dcb4ec069944953dce753da973d | % FROMPACK Converts a cone problem in SDPPACK format to SEDUMI format.
%
% [At,c] = frompack(A,b,C,blk) Given a problem (A,b,C,blk) in the
% SDPPACK-0.9-beta format, this produces At and c for use with
% SeDuMi. This lets you execute
%
% [x,y,info] = SEDUMI(At,b,c,blk);
%
% IMPORTANT: this function assumes that th... |
github | noureldien/PortfolioOptimization-master | feascpx.m | .m | PortfolioOptimization-master/sedumi/conversion/feascpx.m | 4,385 | utf_8 | c48c6cf336cdb94ad12b04e1efd2417b | % FEASCPX Generates a random sparse optimization problem with
% linear, quadratic and semi-definite constraints. Output
% can be used by SEDUMI. Includes complex-valued data.
%
% The following two lines are typical:
% > [AT,B,C,K] = FEASCPX;
% > [X,Y,INFO] = SEDUMI(AT,B,C,K);
%
% An extended version is:
% > [AT... |
github | noureldien/PortfolioOptimization-master | cvx_glpk.m | .m | PortfolioOptimization-master/shims/cvx_glpk.m | 4,344 | utf_8 | 2a1ccba01ab8cc7e099853c4bbfe81b1 | function shim = cvx_glpk( shim )
% CVX_SOLVER_SHIM GLPK interface for CVX.
% This procedure returns a 'shim': a structure containing the necessary
% information CVX needs to use this solver in its modeling framework.
if ~isempty( shim.solve ),
return
end
if isempty( shim.name ),
fname = 'glpk.m';
ps =... |
github | noureldien/PortfolioOptimization-master | cvx_sedumi.m | .m | PortfolioOptimization-master/shims/cvx_sedumi.m | 10,740 | utf_8 | fb45695a2c0dd7b2bd1dd9884504f6fb | function shim = cvx_sedumi( shim )
% CVX_SOLVER_SHIM SeDuMi interface for CVX.
% This procedure returns a 'shim': a structure containing the necessary
% information CVX needs to use this solver in its modeling framework.
global cvx___
if ~isempty( shim.solve ),
return
end
if isempty( shim.name ),
fname = ... |
github | noureldien/PortfolioOptimization-master | cvx_sdpt3.m | .m | PortfolioOptimization-master/shims/cvx_sdpt3.m | 12,657 | utf_8 | 508f2ab7f97c915f8b3d4d479b38aa53 | function shim = cvx_sdpt3( shim )
% CVX_SOLVER_SHIM SDPT3 interface for CVX.
% This procedure returns a 'shim': a structure containing the necessary
% information CVX needs to use this solver in its modeling framework.
global cvx___
if ~isempty( shim.solve ),
return
end
if isempty( shim.name ),
fname = 's... |
github | faruto/FQuantToolBox-master | urlread2.m | .m | FQuantToolBox-master/urlread2.m | 14,027 | utf_8 | 280fa630d402a9bc7acb5d8b45a10daf | function [output,extras] = urlread2(urlChar,method,body,headersIn,varargin)
%urlread2 Makes HTTP requests and processes response
%
% [output,extras] = urlread2(urlChar, *method, *body, *headersIn, varargin)
%
% * indicates optional inputs that must be entered in place
%
% UNDOCUMENTED MATLAB VERSION
%
%... |
github | faruto/FQuantToolBox-master | urlreadwrite_General.m | .m | FQuantToolBox-master/urlreadwrite_General.m | 7,568 | utf_8 | 9a56167ad1e28c2b52ed0ee921be51dd | function [output,status] = urlreadwrite_General(fcn,catchErrors,varargin)
%URLREADWRITE A helper function for URLREAD and URLWRITE.
% Matthew J. Simoneau, June 2005
% Sharath Prabhal, September 2012
% Copyright 1984-2012 The MathWorks, Inc.
% This function requires Java.
error(javachk('jvm',fcn))
import com.... |
github | wentaozhu/Extreme-support-vector-regression-master | esvrkernel.m | .m | Extreme-support-vector-regression-master/ESVR/esvrkernel.m | 5,353 | utf_8 | 4842af825835b58b65df08422bc152d8 | function [TrainingTime, TestingTime, TrainingAccuracy, TestingAccuracy,TY] = esvrkernel(TrainingData_File, TestingData_File, Regularization_coefficient, Kernel_type, Kernel_para)
% Usage: elm(TrainingData_File, TestingData_File, Elm_Type, NumberofHiddenNeurons, ActivationFunction)
% OR: [TrainingTime, TestingTime, ... |
github | warmflasha/qPCR-master | procDataBrigitte.m | .m | qPCR-master/procDataBrigitte.m | 284 | utf_8 | c7dfa6fb8c8d48adbc9668db503209a7 | function [fc err]=doOneGeneBrigitte(datafiles,genequadrant,normquadrant,normcond)
genenums=quadtolist(genequadrant);
normnums=quadtolist(normquadrant);
[fc err]=ComputeOnePlate(datafiles,{genenums,normnums},2,normcond,1);
function list=quadtolist(quad)
list=(6*quad-5):(6*quad);
|
github | warmflasha/qPCR-master | ComputeOnePlate.m | .m | qPCR-master/ComputeOnePlate.m | 1,819 | utf_8 | 0cf41f33c9d47684128e86bfa45ecb26 | function [fc, err]=ComputeOnePlate(datafiles,genenumbers,normgene,normcond,delimiter,Brigitte)
%[fc err]=ComputeOnePlate(datafile,genenumbers,normgene,genenames,condnames)
%----------------------------------------------------------------
%Function to read in one plate worth of qPCR data and quantify
%read in the data ... |
github | yw595/FALCON-master | solveFalconLP.m | .m | FALCON-master/src/solveFalconLP.m | 22,147 | utf_8 | da54f5d48f3ed34bb67ef0fc62a89229 | function solution = solveFalconLP(LPproblem, varargin)
%solveCobraLP Solve constraint-based LP problems
%
% solution = solveCobraLP(LPproblem, parameters)
%
%INPUT
% LPproblem Structure containing the following fields describing the LP
% problem to be solved
% A LHS matrix
% b RHS vector
% c Objective... |
github | yw595/FALCON-master | falcon.m | .m | FALCON-master/src/falcon.m | 25,463 | utf_8 | df4e7e3d18d329b8341ec4f926dbe519 | function [v_sol, corrval, nvar, v_all, fTime, fIter, fOpt,f_easyLP,v_easyLP,cost_irrev] = falcon(m, varargin)
% Brandon Barker 2013 - 2014 Based on Kieran Smallbone's script from:
% http://www.biomedcentral.com/1752-0509/6/73
p = inputParser;
p.FunctionName = 'falcon';
p.StructExpand = fals... |
github | yw595/FALCON-master | printFalconProblem.m | .m | FALCON-master/src/printFalconProblem.m | 2,380 | utf_8 | f4b8edcbaf38d8beeea0c8d82e220571 | function printFalconProblem(rowLabels, colLabels, cnt, A, b, lb, ub, f, ...
csense, y)
%
% Used for debugging falcon.m. Normally not called.
% Could be extended to print additional problem info.
%
[nrows, ncols] = size(A);
nOutCols = ncols + 1 + 2; %+2 for each additional column,
... |
github | spunt/bspmview-master | bspmview.m | .m | bspmview-master/bspmview.m | 319,684 | utf_8 | 76a72ea97465c1dc45d2a2ff1e4f6e10 | function varargout = bspmview(ol, ul)
% BSPMVIEW Program for viewing fMRI statistical maps
%
% USAGE: varargout = bspmview(ol*, ul*) *optional inputs
%
% Requires that Statistical Parametric Mapping (SPM; Wellcome Trust Centre for
% Neuroimaging; www.fil.ion.ucl.ac.uk/spm/) be in your MATLAB search path. In
% a... |
github | spunt/bspmview-master | brewermap.m | .m | bspmview-master/supportfiles/brewermap.m | 20,750 | utf_8 | 9dfdb7dd6343ca015b623ccc59cdfd98 | function [map,num,typ] = brewermap(N,scheme)
% The complete selection of ColorBrewer colorschemes (RGB colormaps).
%
% (c) 2016 Stephen Cobeldick
%
% Returns any RGB colormap from the ColorBrewer colorschemes, especially
% intended for mapping and plots with attractive, distinguishable colors.
%
% Syntax (basic... |
github | spunt/bspmview-master | smoothn.m | .m | bspmview-master/supportfiles/smoothn.m | 28,072 | utf_8 | 53703ef952338232280c5c39511e410b | function [z,s,exitflag] = smoothn(varargin)
%SMOOTHN Robust spline smoothing for 1-D to N-D data.
% SMOOTHN provides a fast, automatized and robust discretized spline
% smoothing for data of arbitrary dimension.
%
% Z = SMOOTHN(Y) automatically smoothes the uniformly-sampled array Y. Y
% can be any N-D ... |
github | spunt/bspmview-master | uiinspect.m | .m | bspmview-master/supportfiles/uiinspect.m | 132,823 | utf_8 | b69d1b6f4e235ea9a850fe39523e20ba | function hFig = uiinspect(obj, fig)
% uiinspect Inspect an object handle (Java/COM/HG) and display its methods/props/callbacks in a unified window
%
% Syntax:
% hFig = uiinspect(obj, hFig) % hFig input argument is optional
%
% Description:
% UIINSPECT(OBJ) inspects an object handle (e.g., Java, COM, Han... |
github | spunt/bspmview-master | screencapture.m | .m | bspmview-master/supportfiles/screencapture.m | 36,901 | utf_8 | cca1512e482389d4fee9974f028ff2b4 | function imageData = screencapture(varargin)
% screencapture - get a screen-capture of a figure frame, component handle, or screen area rectangle
%
% ScreenCapture gets a screen-capture of any Matlab GUI handle (including desktop,
% figure, axes, image or uicontrol), or a specified area rectangle located relative ... |
github | spunt/bspmview-master | pgrid.m | .m | bspmview-master/supportfiles/pgrid.m | 7,191 | utf_8 | 58c497c7a5d2bccbb9ffaf32a3ad7722 | function [phandle, pidx] = pgrid(nrow, ncol, varargin)
% PGRID Create a grid of of UIPANELs
%
% USAGE: [phandle, pidx] = pgrid(nrow, ncol, varargin)
%
% OUTPUT
% hpanel: array of handles to uipanels comprising the grid
% hidx: [row,col] indices for the returned uipanel handles
% ________________________________... |
github | spunt/bspmview-master | menuN.m | .m | bspmview-master/supportfiles/menuN.m | 36,069 | utf_8 | 58be09d17f4e2c498da381860dd8c3e7 | function choice = menuN(mtitle, options, Opt)
%% MENUN An alternative to Matlab's menu function with added functionality
%
% Syntax:
% choice = MENUN(mtitle, options)
% choice = MENUN(mtitle, options, Opt)
%
% Input:
% mtitle - [string] - Menu window title
% options - [various] - Multifunctional:
% (b)... |
github | mohnjoosemiller/STLread_for_Octave-master | stlview.m | .m | STLread_for_Octave-master/stlview.m | 1,553 | utf_8 | b39125de4f2d687a507d317d14167e45 | %Copyright 2018 John Moosemiller
%Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sub... |
github | mohnjoosemiller/STLread_for_Octave-master | stlread.m | .m | STLread_for_Octave-master/stlread.m | 4,515 | utf_8 | cc3b2624dd8e8affe82f1d461e50c2b4 | %Copyright 2018 John Moosemiller
%Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sub... |
github | phg1024/BlendshapeGeneration-master | deformationTransfer2.m | .m | BlendshapeGeneration-master/deformationTransfer2.m | 2,575 | utf_8 | 458f934a424d250c1261c19c080912de | %% This implementation uses the simplified formulation in Botsch's paper
% Deformation Transfer for Detail-Preserving Surface Editing
function Td = deformationTransfer2(S0, T0, S1)
% make a copy of T0
Td = T0;
% solve it with vertex formulation
% for each face in the source mesh, compute the deformation matrix
nfaces... |
github | phg1024/BlendshapeGeneration-master | deformationTransfer4.m | .m | BlendshapeGeneration-master/deformationTransfer4.m | 3,156 | utf_8 | 71150b9f083e1de68e90327ab4f3f68e | %% This implementation uses the simplified formulation in Botsch's paper
% Deformation Transfer for Detail-Preserving Surface Editing
function Td = deformationTransfer4(S0, S0grad, T0, T0grad, S1, stationary_indices)
% make a copy of T0
Td = T0;
% solve it with vertex formulation
% for each face in the source mesh, c... |
github | phg1024/BlendshapeGeneration-master | estimateWeights_linear.m | .m | BlendshapeGeneration-master/estimateWeights_linear.m | 694 | utf_8 | b0667a9e87cfe611a04a2619c22f7bc7 | % formulate this as a linear optimization
% [v1 v2 ... vn] * [w1 w2 ... wn]' = vs - v0
function w = estimateWeights_linear(S, B0, dB, stationary_indices, vis)
if nargin < 5
vis = false;
end
nshapes = size(dB, 1);
nverts = size(B0.vertices, 1);
V = zeros(nverts*3, nshapes);
for j=1:nshapes
V(:,j) = reshape(dB... |
github | phg1024/BlendshapeGeneration-master | triangleGradient.m | .m | BlendshapeGeneration-master/triangleGradient.m | 368 | utf_8 | cf258a4a0fd99b71b677e7528ae2828f | function [M, d] = triangleGradient(mesh, fidx)
[v0, v1, v2] = getVertices(mesh, fidx);
n = cross(v1-v0, v2-v0);
n = n/norm(n);
M = [v1-v0, v2-v0, n];
d = 0.5 * dot(cross(v1-v0, v2-v0), n);
end
function [v0, v1, v2] = getVertices(mesh, fidx)
face = mesh.faces(fidx,:);
v0 = mesh.vertices(face(1),:)';
v1 = mesh.vertices(... |
github | phg1024/BlendshapeGeneration-master | deformationTransfer3.m | .m | BlendshapeGeneration-master/deformationTransfer3.m | 2,180 | utf_8 | ff0d1054eff20b3d3641eef7d41d8a95 | %% This implementation uses the simplified formulation in Botsch's paper
% Deformation Transfer for Detail-Preserving Surface Editing
function Td = deformationTransfer3(S0, T0, S1)
% make a copy of T0
Td = T0;
% solve it with vertex formulation
% for each face in the source mesh, compute the deformation matrix
nfaces... |
github | phg1024/BlendshapeGeneration-master | estimateWeights_quadratic.m | .m | BlendshapeGeneration-master/estimateWeights_quadratic.m | 863 | utf_8 | 0e0792a69609c24ea8e80f7159dab76b | % formulate this as a linear optimization
% [v1 v2 ... vn] * [w1 w2 ... wn]' = vs - v0
function w = estimateWeights_quadratic(S, B0, dB, w0, stationary_indices, vis)
if nargin < 5
vis = false;
end
nshapes = size(dB, 1);
nverts = size(B0.vertices, 1);
H = zeros(nshapes, nshapes);
f = zeros(1, nshapes);
for j=1:nv... |
github | phg1024/BlendshapeGeneration-master | estimateTransform.m | .m | BlendshapeGeneration-master/estimateTransform.m | 451 | utf_8 | 69ff1be3545869c4582f49eecd2ab2cf | % MATLAB implementation
function [s, R, t] = estimateTransform(p, q)
[n, m] = size(p);
mu_p = mean(p);
mu_q = mean(q);
dp = p - repmat(mu_p, n, 1);
sig_p2 = sum(sum(dp .* dp))/n;
dq = q - repmat(mu_q, n, 1);
sig_q2 = sum(sum(dq .* dq))/n;
sig_pq = dq' * dp / n;
det_sig_pq = det(sig_pq);
S = diag(ones(m, 1));
if de... |
github | phg1024/BlendshapeGeneration-master | showMeshError.m | .m | BlendshapeGeneration-master/showMeshError.m | 1,149 | utf_8 | 1bfb78c1db010efd4aa378fbef3951c5 | function showMeshError(mesh, ref, name, range, showColorBar)
FV.vertices = mesh.vertices;
FV.faces = mesh.faces;
nverts = size(FV.vertices, 1);
colors = zeros(nverts, 3);
dists = zeros(nverts, 1);
aligned = 1;
if aligned
center1 = zeros(1, 3);
center2 = zeros(1, 3);
else
center1 = mean(mesh.vertices);
... |
github | phg1024/BlendshapeGeneration-master | jac_weights.m | .m | BlendshapeGeneration-master/jac_weights.m | 527 | utf_8 | 74ac1f7fe37d211cbaf95d3d5376b68d | % function x = cost_weights(p, S, B0, dB)
% nshapes = size(dB, 1);
% T = B0.vertices;
% for i=1:nshapes
% T = T + p(i) * dB{i};
% end
% D = S.vertices - T;
% x = sqrt(sum(D.^2, 2));
% end
function J = jac_weights(p, S, B0, dB, w_prior, w_alpha)
nshapes = size(dB, 1);
T = B0.vertices;
for i=1:nshapes
T = T + p(... |
github | phg1024/BlendshapeGeneration-master | deformationTransfer.m | .m | BlendshapeGeneration-master/deformationTransfer.m | 2,122 | utf_8 | 91c9b5d4254eb0a9d18cda89edf64546 | function Td = deformationTransfer(S0, T0, S1)
% make a copy of T0
Td = T0;
% solve it with vertex formulation
% for each face in the source mesh, compute the deformation matrix
nfaces = size(S0.faces, 1);
nverts = size(S0.vertices, 1);
% the
S = cell(nfaces, 1);
T = cell(nfaces, 1);
for i=1:nfaces
[v0, v1, v2] ... |
github | phg1024/BlendshapeGeneration-master | triangulateMesh.m | .m | BlendshapeGeneration-master/triangulateMesh.m | 268 | utf_8 | 3d7a32c7898a0dfc85db60228dc8861d | %% only works for quad mesh
function M = triangulateMesh(S)
M = S;
faces = S.faces;
[nfaces, nverts] = size(faces);
if nverts == 3
return;
end
M.faces = zeros(nfaces*2, 3);
M.faces(1:nfaces,:) = S.faces(:,[1 2 3]);
M.faces(nfaces+1:end,:) = S.faces(:,[1 3 4]);
end |
github | phg1024/BlendshapeGeneration-master | findClosestPoints.m | .m | BlendshapeGeneration-master/LaplacianDeformation/findClosestPoints.m | 1,782 | utf_8 | 4adde446dad9f721f1104da8610950ad | % Find out point to vertex correspondence given a set of points and a mesh
% based on point to surface distance
function [correspondence, weights] = findClosestPoints(points, S)
nverts = size(S.vertices, 1);
nfaces = size(S.faces, 1);
npoints = size(points, 1);
% compute the normals of each face and each vertex
vertN... |
github | phg1024/BlendshapeGeneration-master | showMeshError.m | .m | BlendshapeGeneration-master/LaplacianDeformation/showMeshError.m | 1,149 | utf_8 | 1bfb78c1db010efd4aa378fbef3951c5 | function showMeshError(mesh, ref, name, range, showColorBar)
FV.vertices = mesh.vertices;
FV.faces = mesh.faces;
nverts = size(FV.vertices, 1);
colors = zeros(nverts, 3);
dists = zeros(nverts, 1);
aligned = 1;
if aligned
center1 = zeros(1, 3);
center2 = zeros(1, 3);
else
center1 = mean(mesh.vertices);
... |
github | phg1024/BlendshapeGeneration-master | laplacianDeformation.m | .m | BlendshapeGeneration-master/LaplacianDeformation/laplacianDeformation.m | 7,429 | utf_8 | 71b000740e6289da755af9a3faddb310 | function Td = laplacianDeformation(S, landmarks, lm_points, point_cloud, itmax)
Td = S;
[nverts, ~] = size(S.vertices);
[nfaces, ~] = size(S.faces);
% find the neighbor information for every vertex on the source mesh
N = cell(nverts, 1);
for i=1:nfaces
f = S.faces(i,:);
N{f(1)} = union(N{f(1)}, [f(2) f(... |
github | phg1024/BlendshapeGeneration-master | triangulateMesh.m | .m | BlendshapeGeneration-master/LaplacianDeformation/triangulateMesh.m | 268 | utf_8 | 3d7a32c7898a0dfc85db60228dc8861d | %% only works for quad mesh
function M = triangulateMesh(S)
M = S;
faces = S.faces;
[nfaces, nverts] = size(faces);
if nverts == 3
return;
end
M.faces = zeros(nfaces*2, 3);
M.faces(1:nfaces,:) = S.faces(:,[1 2 3]);
M.faces(nfaces+1:end,:) = S.faces(:,[1 3 4]);
end |
github | phg1024/BlendshapeGeneration-master | laplacianDeformation.m | .m | BlendshapeGeneration-master/LaplacianDeformation/2d/laplacianDeformation.m | 3,292 | utf_8 | ae9a08e25beb622692a9348e2bc09b50 | function pp = laplacianDeformation(p, q, pivots, mode)
% minimize E_fitting + E_distortion
npts = size(p, 1);
% compute laplacians
delta = zeros(npts, 2);
delta(1,:) = p(1,:) - p(2,:);
for i=2:npts-1
delta(i,:) = p(i,:) - 0.5*(p(i-1,:) + p(i+1,:));
end
delta(npts,:) = p(npts,:) - p(npts-1,:);
C = cell(npts, 1);... |
github | alyosama/PatternRecognitionProjects-master | fitnessclustsse.m | .m | PatternRecognitionProjects-master/cluster/fitnessclustsse.m | 933 | utf_8 | fb4116d38acc3c103175842cf80d9ed5 |
% Function fitnessclustsse
%
% Input:
% centers - a (kp x 1) candidate solution vector representing the positions of
% k cluster centers. That is, the dimensionality of the optimization
% problem is kp.
% data - an (n x p) dataset to be clustered (n data points of dimensionality p)
function [fval] =... |
github | alchemyst/ternplot-master | ternplot.m | .m | ternplot-master/ternplot.m | 2,276 | utf_8 | cb63bc7f90abd8d456516ef000a793fc | % TERNPLOT plot ternary phase diagram
% TERNPLOT(A, B) plots ternary phase diagram for three components. C is calculated
% as 1 - A - B.
%
% TERNPLOT(A, B, C) plots ternary phase data for three components A B and C. If the values
% are not fractions, the values are normalised by dividing by the
... |
github | alchemyst/ternplot-master | simpletri.m | .m | ternplot-master/simpletri.m | 863 | utf_8 | 8f30e35c916d445026bcf340dc376195 | % SIMPLETRI return simple triangulation for square datasets
% TRI = SIMPLETRI(N) returns a matrix containing indexes to the
% vertices of triangles fitted onto a square grid of size NxN.
%
% See also TERNSURF
% Method:
% Author Carl Sandrock 20031006
% To do
% Modifications
% Modifiers
... |
github | alchemyst/ternplot-master | terncoords.m | .m | ternplot-master/terncoords.m | 1,149 | utf_8 | a35dc35aeee30d6b3e638edcd2b12f40 | % TERNCOORDS calculate rectangular coordinates of fractions on a ternary plot
% [X, Y] = TERNCOORDS(FA, FB) returns the rectangular X and Y coordinates
% for the point with a fraction defined by FA and FB. It is assumed that
% FA and FB are sensible fractions.
%
% [X, Y] = TERNCOORDS(FA, FB, FC) returns the sa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.