sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
414fb9c4a93000cb697902f4089ea9b35256e38014fb10cdfa7a3645c57961fc
C
5,028
132
/* Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions */ /*========================================================================= Copyright (c) 2008 Thomas Yeo and Mert Sabuncu All rights reserved. Redistribution and use in source and binary forms, with or without modification, are ...
5588c554974ab41d90230aa56f6bdf84286f58d5c79aa10bcea208623b8fe324
C
5,032
198
#include "mex.h" #include <stddef.h> #if !defined(HAVE_OCTAVE) && ( !defined(MX_API_VER) || ( MX_API_VER < 0x07030000 ) ) typedef int mwIndex; typedef int mwSize; #endif /* % Copyright 2005-2016 CVX Research, Inc. % See the file LICENSE.txt for full copyright information. % The command 'cvx_where' will show where thi...
7e0c029663f372120632146fefd29217fb7dd8bb81159f0db0b1948c889ab88a
C
5,033
130
/* % [zhi,zlo] = quadadd(xhi,xlo,y) % QUADADD Compute (zhi+zlo) = (xhi+xlo) + y. % x an z are in double-double format (quad precision) % % SEE ALSO sedumi % ********** INTERNAL FUNCTION OF SEDUMI ********** function [zhi,zlo] = quadadd(xhi,xlo,y) % This file is part of SeDuMi ...
cd43926775c66ed48d181786fdc1e2c5c3187e249008f30e99234fb027ec65e1
C
5,107
168
/*********************************************************************** * mexMatvec: compute * * mexMatvec(A,y,options) * * options = 0, compute A*y * = 1, compute (y'*A)' * * Copyright (c) 2004 by * K.C. Toh * Last Modified: 120404 **************************************************...
5dcc3baf102f15449f9387ccc60288654a6b89d9d9e58b68a779c2b75912e00b
C
5,134
153
/*********************************************************************** * mexinprod.c : C mex file to compute inner product of 2 vectors, * * Ax = mexinprod(blk,Avec,x,k,p); * where Ax = Avec{p}(:,1:k)'*x * * SDPT3: version 3.0 * Copyright (c) 1997 by * K.C. Toh, M.J. Todd, R.H. Tutuncu * Last Modified:...
851bc7ff61e798948b59e462c116ff98bdc7663bad20265f7c650c934ad7949c
C
5,173
218
/* * ============================================================== * matlab_bgl_all_sp_mex.c The mex interface to the matlab bgl wrapper. * * David Gleich * 20 April 2006 * ============================================================= */ /* * 20 April 2006 * Initial version * * 19 February 2007 * Updated ...
d7f1b6e44fee20ab41cef1d650776a039a2348935eb96bcbd294a4096139be3a
C
5,204
186
/* adler32.c -- compute the Adler-32 checksum of a data stream * Copyright (C) 1995-2011, 2016 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ /* @(#) $Id$ */ #include "zutil.h" local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2)); #define BASE 6552...
961cdb9fbb0583d21c9b9855f149255090bdd879aba7c060a8d2a481190eb85f
C
5,230
145
/* Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions */ /*========================================================================= Copyright (c) 2008 Thomas Yeo and Mert Sabuncu All rights reserved. Redistribution and use in source and binary forms, with or without modification, are ...
7b2aa3e9f8804cc5b4bccc61747f6fcc41e28303f926ecbeaa29f7c088179b25
C
5,266
145
/* % y = sqrtinv(q,vlab,K) % SQRTINV Computes for PSD-cone, y = (Q / diag(sqrt(vlab)))', so that % Y'*Y = inv(Q * diag(vlab) * Q'). % % SEE ALSO sedumi % ********** INTERNAL FUNCTION OF SEDUMI ********** function y = sqrtinv(q,vlab,K) % This file is part of SeDuMi 1...
29521cef33c0e9b568f5d5e61d6267c9fc68dc91775c42c36c8e0d047ac9d669
C
5,283
140
/* ************************************************************ % perm = sortnnz(At,Ajc1,Ajc2) % SORTNNZ Sorts columns in At % in increasing order of nnzs; only the nnzs between Ajc1 and Ajc2 % are considered for each column. If Ajc1 or Ajc2 is empty, we use % the ...
533956749a4049cf6e33146cbc6b09361e609ccb18ca845426f59244d342cb2d
C
5,349
158
/* Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions */ /*========================================================================= Copyright (c) 2008 Thomas Yeo and Mert Sabuncu All rights reserved. Redistribution and use in source and binary forms, with or without modification, are ...
9de835527425e81739a5a8da51f1a12bd6539a38e59430a46a6cf01b91ec3782
C
5,391
174
/********************************************************************** * y = mextriang(U,b,options) * Given nxn upper-triangular matrix U, * options = 1 (default), solves U *y = b, * = 2 , solves U'*y = b. * * Important: U is assumed to be dense. **************************************...
5a7f0016b7d8a99688882c597c90409f8562f4ba43d64318ad7d0e3a415145eb
C
5,414
120
#include <math.h> #define FLOAT_T float /* C implementation for sliding Jaccard similarity, based on Ziga Avsec's implementation. * There are two functions here that are exported as Python functions through Numpy's amazing * f2py module. In order to compile this module, make sure you have gcc and gfortran on your pa...
34e3aea93d2f8144db87b67ecddd7b147f0a8626c7b9378a5c7799c4ea30d152
C
5,424
158
// (C) Copyright 2018, Nanbo Sun (nanbosun@u.nus.edu), Xiuming Zhang // This file is part of POLARLDA-C. // POLARLDA-C is free software; you can redistribute it and/or modify it under // the terms of the GNU General Public License as published by the Free // Software Foundation; either version 2 of the License, or (a...
b571b787ea71f6fb8feab02075d5e256248c3fbf542e2c8228b7c3db4330b200
C
5,491
158
/* Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions */ /*========================================================================= Copyright (c) 2008 Thomas Yeo and Mert Sabuncu All rights reserved. Redistribution and use in source and binary forms, with or without modification, are ...
fd11a9d3f30f17300bd93a2239bc2192eb6d9b89bba3901ebfcb4cafb102da56
C
5,564
138
/* perm = ordmmdmex(X) Computes multiple-minimum-degree permutation, for sparse Cholesky. X is a sparse symmetric matrix; only its off- diagonal sparsity structure is used. Invokes SPARSPAK-A Release III. % This file is part of SeDuMi 1.1 by Imre Polik and Oleksandr Romanko % Copyright (C) 2005 McMaster ...
db7a11bab7f9959da5732188c18c7a06bec07ed5fa0a37d13cbbe127d2aeb60f
C
5,611
138
/* Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions */ /*========================================================================= Copyright (c) 2008 Thomas Yeo and Mert Sabuncu All rights reserved. Redistribution and use in source and binary forms, with or without modification, are ...
305ff68420c76e4c79ee8d174c976d19e0d55a4cf52d14e1aaa21ea46fc712a6
C
5,618
167
/* Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions */ /*========================================================================= Copyright (c) 2008 Thomas Yeo and Mert Sabuncu All rights reserved. Redistribution and use in source and binary forms, with or without modification, are ...
43a6d28fc0df4e265f7f2084039c033e26acd2ddc3863f8801f771a4b24d7344
C
5,626
189
#define _GNU_SOURCE #include <string.h> #include <stdbool.h> #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include "medaka_common.h" /** Allocates zero-initialised memory with a message on failure. * * @param num number of elements to allocate. * @param size size of each element. * @param msg me...
cbc768deb0e9869533b98cd99b41fc7dc46d6dec1990e4e8f61d213d39ebd9e7
C
5,641
148
/* Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions */ /*========================================================================= Copyright (c) 2008 Thomas Yeo and Mert Sabuncu All rights reserved. Redistribution and use in source and binary forms, with or without modification, are ...
ad779c5886b130f565b0912300f11c7b1db86b0cedf94324fd70e771fef12c7b
C
5,651
229
#include <stdarg.h> #include <stdio.h> #include <ctype.h> #include <string.h> #include <stdint.h> #include "htslib/kstring.h" int kvsprintf(kstring_t *s, const char *fmt, va_list ap) { va_list args; int l; va_copy(args, ap); l = vsnprintf(s->s + s->l, s->m - s->l, fmt, args); // This line does not work with glibc ...
98766e3bbdab2bc69befdc2b4da203634aadee330395136be821ae0c2977083f
C
5,799
223
/** @file mst_mex.c * @copyright Stanford University, 2006-2008 * @author David F. Gleich * The mex interface to the matlab bgl wrapper. */ /** History * 2006-04-20: Initial version * 2006-11-10: Altered the code to produce the correct number of edges * in the minimum spanning tree by resizing the arrays. Th...
ff3d2e00e31a4216c0ba2ec9b8f844d5ae73ab3b922924eddcac69c0e09f3640
C
5,882
138
/* % 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) 2001 Jos F. Sturm (up to 1.05R5) % Dept. Econometrics & O.R., Tilburg University, the Netherlands. % Supported by the Netherlands Organization for Scien...
976a07a85730331a3ea6ee3c852eb14fa3b575dd9003c43ba056379fd4df2eb1
C
5,910
203
/* CCGEngine.c /* /* This is a bare-bones C program whos purpose is to compute Multi-unit cross correlograms quickly. Not intended for use on its own. It is designed to be wrapped by a MATLAB function. Usage - [CCG, PAIRS] = CCGEngine(TIMES, MARKS, BINSIZE, HALFBINS) TIMES ( is the name of a binary fi...
9acfa87a89bb4ca5e6b50e993a372a59aa2ffdded58fc828b3c4a3aed354b580
C
5,953
212
/** @file bfs_dfs_vis_mex.c * @author David F. Gleich * @date 2008-09-29 * @copyright Stanford University, 2006-2008 * The mex interface to the matlab bgl wrapper for bfs and dfs with a visitor. */ /** History * 2006-05-30: Initial version * 2007-02-19: Updated to use Matlab 2006b sparse matrix interface * ...
cdcd6ff33d053d0963b61ee972eebbb6a171178fb5281cc4825908a3ab62ccf4
C
5,983
159
/* Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions */ /*========================================================================= Copyright (c) 2008 Thomas Yeo and Mert Sabuncu All rights reserved. Redistribution and use in source and binary forms, with or without modification, are ...
70fc52a736ccdf6fbb5fb855b674f7489bff7fec637b913b15e466dca1ec7ab8
C
6,024
197
/* * Calculate cross-correlograms with a range of options. * Called from chXcorr2.m. * * Copyright 2016 University of Surrey. * */ #include "math.h" #include "mex.h" #include "matrix.h" #define max(a,b) \ ({ __typeof__ (a) _a = (a); \ __typeof__ (b) _b = (b); \ _a > _b ? _a : _b; }) /* structur...
35b5ceb85ff8ba70fe268188de06c571b1b3459f5364b455049a759632205fec
C
6,033
145
/* ************************************************************ MODULE sdmaux*.c -- Several low-level subroutines for the mex-files in the Self-Dual-Minimization package. % This file is part of SeDuMi 1.1 by Imre Polik and Oleksandr Romanko % Copyright (C) 2005 McMaster University, Hamilton, CANADA (since 1.1)...
84ca330d36082cfb7df18eafd6763836291d79d17ae469485bfd8fd6babd5ae0
C
6,037
250
// (C) Copyright 2004, David M. Blei (blei [at] cs [dot] cmu [dot] edu) // This file is part of LDA-C. // LDA-C is free software; you can redistribute it and/or modify it under // the terms of the GNU General Public License as published by the Free // Software Foundation; either version 2 of the License, or (at your ...
732f12baaa10647e0993c868e615f24771c9837d92e225a04f051add2f8a13f5
C
6,041
154
/* ************************************************************ % Ablkjc = partitA(At,blkstart) % PARTITA Partition columns of A according to the subscripts listed in blkstart. % % SEE ALSO sedumi % ******************** INTERNAL FUNCTION OF SEDUMI ******************** function Ab...
1356e871c209ea825bfacd79fb597289cf847f17f135bfe8db1674860f756a71
C
6,161
168
/* Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions */ /*========================================================================= Copyright (c) 2008 Thomas Yeo and Mert Sabuncu All rights reserved. Redistribution and use in source and binary forms, with or without modification, are ...
ae2af8d21cec7a573153c1bedd6f4f325e5a7f4d6836ac92fcf9fe2b3d88dbbc
C
6,185
250
#include <stdarg.h> #include <stdio.h> #include <ctype.h> #include <string.h> #include <stdint.h> #include "kstring.h" int kvsprintf(kstring_t *s, const char *fmt, va_list ap) { va_list args; int l; va_copy(args, ap); l = vsnprintf(s->s + s->l, s->m - s->l, fmt, args); // This line does not work with glibc 2.0. Se...
92769918003a834aa53a370686b8616a76509bb0cc766af28d0460b6cb52524c
C
6,213
207
// isMatlabVer.c // Compare Matlab version to specified number // Match = isMatlabVer(Relop, N) // INPUT: // Relop: Comparison operator as string: '<', '<=', '>', '>=', '=='. // N: Number to compare with as DOUBLE vector with 1 to 4 elements. // // OUTPUT: // Match: Locical scalar, TRUE for matching compariso...
c2c0cabbb5e607a9a670597f7ab7cd1c4f2cfd33192b2b271828db05703782ad
C
6,220
145
// This is the ``Mersenne Twister'' random number generator MT19937, which // generates pseudorandom integers uniformly distributed in 0..(2^32 - 1) // starting from any odd seed in 0..(2^32 - 1). This version is a recode // by Shawn Cokus (Cokus@math.washington.edu) on March 8, 1998 of a version by // Takuji Nishimur...
b878e433d0d241dd9bbccfae44a3090ac07bcef0ab753383da2d313573863b99
C
6,263
202
/* * fast_kmeans_step.c - fast pairwise distance matrix * * This MEX file works, but comments and documentation in particular are * a little slim ... * * Syntax: * [assigns,bestdists,clustersizes,centroids] = * fast_kmeans(waves,centroids,normsqr_waves,chunk) * * ##### NOTE #####...
0802a7d5318a0121eb1d7afabed15279fb4a4070b77cabee077efddc813609a4
C
6,268
162
/* C file autogenerated by mexme.m */ #include <mex.h> #include <math.h> #include <matrix.h> #include <stdlib.h> #include <float.h> #include <string.h> /* Translate matlab types to C */ #define uint64 unsigned long int #define int64 long int #define uint32 unsigned int #define int32 int #define uint16 unsigned short #...
804f7cef695cda6150b24ff6de1965018a251e8fc13bcd59a7abc269cca32d7d
C
6,269
192
#include "mex.h" #include "math.h" int mindex3(int x, int y, int z, int sizx, int sizy, int sizz, int wrap) { int index; if(wrap==1) { /* Positive modules */ x=(x % sizx + sizx) % sizx; y=(y % sizy + sizy) % sizy; z=(z % sizz + sizz) % sizz; } else if(wrap>1) ...
8df252b0a770014ef1e9c6d168610d0555058e433ba3d63c1c5f433b12f48737
C
6,276
162
/* C file autogenerated by mexme.m */ #include <mex.h> #include <math.h> #include <matrix.h> #include <stdlib.h> #include <float.h> #include <string.h> /* Translate matlab types to C */ #define uint64 unsigned long int #define int64 long int #define uint32 unsigned int #define int32 int #define uint16 unsigned short #...
a1e7856c38f04dfccdfa97ab281904fd95b7cdfebd9f86ab8031eae9fdf1df64
C
6,296
168
/* % y = invcholfac(u,K, perm) % INVCHOLFAC Computes y(perm,perm) = u' * u, with u upper triangular. % % SEE ALSO sedumi, getada3 % ******************** INTERNAL FUNCTION OF SEDUMI ******************** function y = invcholfac(u,K, perm) % This file is part of SeDuMi 1....
68140a82582ede938159630bca0fb13a93b4bf1cb2e85b08943c26242cf8f3a6
C
6,323
205
/* zpipe.c: example of proper use of zlib's inflate() and deflate() Not copyrighted -- provided to the public domain Version 1.4 11 December 2005 Mark Adler */ /* Version history: 1.0 30 Oct 2004 First version 1.1 8 Nov 2004 Add void casting for unused return values Use switch s...
f2c4973203f665c14dc1a94cfa5d628d3956aaf9728d3409574a9dc716a34442
C
6,341
192
#include <stdio.h> #include "simdxorshift128plus.h" #if defined(__AVX2__) /* used by xorshift128plus_jump_onkeys */ static void xorshift128plus_onkeys(uint64_t * ps0, uint64_t * ps1) { uint64_t s1 = *ps0; const uint64_t s0 = *ps1; *ps0 = s0; s1 ^= s1 << 23; // a *ps1 = s1 ^ s0 ^ (s1 >> 18) ^ (s0 >> 5); // b, c...
423edc9a45572844f30b21dc4916c99715499e8a4ae7626d4adbb6c44e0c5fc5
C
6,363
188
/* Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions */ /*========================================================================= Copyright (c) 2008 Thomas Yeo and Mert Sabuncu All rights reserved. Redistribution and use in source and binary forms, with or without modification, are ...
b0787d59c0c8d40b185e3d9b6a224c574ba31b19f5c63040c43474e8b4a83d50
C
6,409
207
/* CCGEngine.c /* /* This is a bare-bones C program whos purpose is to compute Multi-unit cross correlograms quickly. Not intended for use on its own. It is designed to be wrapped by a MATLAB function. Usage - [CCG, PAIRS] = CCGEngine(TIMES, MARKS, BINSIZE, HALFBINS) TIMES ( is the name of a binary fi...
c4494b831cb6aa0106449dacca6d4cca9d6ddbc4263fd408101e26e7f71a22b6
C
6,431
162
/* ************************************************************ MODULE sdmaux*.c -- Several low-level subroutines for the mex-files in the Self-Dual-Minimization package. % This file is part of SeDuMi 1.1 by Imre Polik and Oleksandr Romanko % Copyright (C) 2005 McMaster University, Hamilton, CANADA (since 1.1)...
eae3c1a58e56a13b8857e921dcff2778ac691deb05027d0ee3a7f46ce355b6bb
C
6,535
193
/****************************************************************** * mexProd2nz: compute the elements of P whose positions are * specified by the variable list. * * P = mexProd2nz(blk,A,B,list), where P = A'*B. * * output: P is sparse, where * P(i,j) = <ith column of A, jth column o...
7ab3582eb3ff9c9c97b817aab118b25f51f82fbe3fce9c1d7794114d6553fba9
C
6,592
177
/* % y = vecsym(x,K) % VECSYM For the PSD submatrices, we let Yk = (Xk+Xk')/2 % % SEE ALSO sedumi % ********** INTERNAL FUNCTION OF SEDUMI ********** function y = vecsym(x,K) % This file is part of SeDuMi 1.1 by Imre Polik and Oleksandr Romanko % Copyright...
7b6c6225aeb3b41f65c96ba340e0266fdb65a756946ee05600883d6a4860eeca
C
6,657
159
/* Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions */ /*========================================================================= Copyright (c) 2008 Thomas Yeo and Mert Sabuncu All rights reserved. Redistribution and use in source and binary forms, with or without modification, are ...
07b725c6e1a725205ac9dc6e5d1b5728501216edba7049c000f38e7f377abf85
C
6,756
171
/* C file autogenerated by mexme.m */ #include <mex.h> #include <math.h> #include <matrix.h> #include <stdlib.h> #include <float.h> #include <string.h> /* Translate matlab types to C */ #define uint64 unsigned long int #define int64 long int #define uint32 unsigned int #define int32 int #define uint16 unsigned short #...
c93017aa4a8af8f863c95538e0b248df7c868a8e5972aaf544b2497fb9ee06b0
C
6,763
168
/* % y = givensrot(gjc,g,x,K) % GIVENSROT % % SEE ALSO sedumi % ********** INTERNAL FUNCTION OF SEDUMI ********** function y = givensrot(gjc,g,x,K) % This file is part of SeDuMi 1.1 by Imre Polik and Oleksandr Romanko % Copyright (C) 2005 McMaster University, Hamil...
255062b9926b4f3f73aed140a530a6337590a14d663f638e2e97cf3511735997
C
6,876
169
/* x = psdframeit(lab,frms,K); Computes x = FRM*lab. The frame "frms" is a product-form Householder reflection. % 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) 2001 Jos F. Sturm (up to 1.05R5) % ...
5eb70f799d791f4d4afe23b0d4f47c11b72db0d03e7f5bf044556ffc93a98e33
C
6,919
223
/* * $Id$ * Guillaume Flandin */ #ifndef MATLAB_MEX_FILE # undef _LARGEFILE64_SOURCE # define _LARGEFILE64_SOURCE # include <stdio.h> # include <sys/stat.h> # if defined(__APPLE__) # define structStat struct stat # define getFileFstat fstat # elif defined(SPM_WIN32) # define structStat struct _stati64 # define...
a8554d035c97f6f006ba2daa2f1c7717ba0405fbf1272f290c55ba134f508a46
C
6,930
163
/* smult = adenscale(dense, d, qblkstart) % 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) 2001 Jos F. Sturm (up to 1.05R5) % Dept. Econometrics & O.R., Tilburg University, the Netherlands. % Supported b...
810975cec35367cdfd452bc21e705609b6ba5edce126378b1c5bf68e7220fc17
C
7,091
181
/*% L = symbchol(X) % SYMBCHOL Symbolic block sparse Cholesky factorization. % L = symbchol(X) returns a structure L that can be used % by the efficient block sparse Cholesky solver SPARCHOL. % The fields in L have the following meaning: % % L.perm - Mu...
8d2efc0fa4c419705de68c00e27765dfbb5cb6f708973ba28340e43428a8495d
C
7,095
213
#include "mex.h" #include "math.h" #include <string.h> /* Coordinates to index */ int mindex3(int x, int y, int z, int sizx, int sizy) { return z*sizx*sizy+y*sizx+x;} int mindex2(int x, int y, int sizx) { return y*sizx+x;} /* The matlab mex function */ void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxAr...
cd5376acfdd65475c78c70590318e01708860e284bfb1c767b49bbbf4216ce0e
C
7,268
227
/* Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions */ /*========================================================================= Copyright (c) 2008 Thomas Yeo and Mert Sabuncu All rights reserved. Redistribution and use in source and binary forms, with or without modification, are ...
d796215fc7c4b462d9279450fbc50ac2ac085c4dad8f9b54ae7965a9ebbe3bfa
C
7,270
191
/* % 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) 2001 Jos F. Sturm (up to 1.05R5) % Dept. Econometrics & O.R., Tilburg University, the Netherlands. % Supported by the Netherlands Organization for Scient...
f7fdc9ef326a2683eb33c794face54e83c751ec17f3d1ba581847a62af36ddcd
C
7,304
325
/* zutil.c -- target dependent utility functions for the compression library * Copyright (C) 1995-2017 Jean-loup Gailly * For conditions of distribution and use, see copyright notice in zlib.h */ /* @(#) $Id$ */ #include "zutil.h" #ifndef Z_SOLO # include "gzguts.h" #endif z_const char * const z_errmsg[10] = { ...
7e2e6a1a4332969ea0c01e4bfaeb240cbb5f05bab19774b829ccd9fd3c56cb69
C
7,316
190
/* ************************************************************ % Apart = extractA(At,Ajc,blk0,blk1,blkstart[,blkstart2]) % EXTRACTA Fast alternative to % Apart = At(blkstart(1):blkstart(2)-1,:). % Instead of blkstart(2), it takes "blkstart2" (if supplied) or % size(At,1)+1 (if neither blkstart(2) nor ...
8df41cbb7180c1c86cad689b03b41cf34c155b3b40236e4fb7c155ff47769398
C
7,368
275
#include <stdio.h> #include <stdlib.h> #include <windows.h> #include "zlib.h" void MyDoMinus64(LARGE_INTEGER *R,LARGE_INTEGER A,LARGE_INTEGER B) { R->HighPart = A.HighPart - B.HighPart; if (A.LowPart >= B.LowPart) R->LowPart = A.LowPart - B.LowPart; else { R->LowPart = A.LowPart - B.L...
f0c55ace6d7775ce0ba8340c68b02170ad9f085c0ff517fd4df6109ac91d5f2a
C
7,391
186
/* inffas8664.c is a hand tuned assembler version of inffast.c - fast decoding * version for AMD64 on Windows using Microsoft C compiler * * Copyright (C) 1995-2003 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h * * Copyright (C) 2003 Chris Anderson <christop@charm.net> * Ple...
8e2f98ccf9beed389b3b7fae6d85934a22a45878895bd7181c1d737c8e6c3d02
C
7,456
220
#include "mex.h" #include <stddef.h> #include <math.h> #if !defined(HAVE_OCTAVE) && ( !defined(MX_API_VER) || ( MX_API_VER < 0x07030000 ) ) typedef int mwIndex; typedef int mwSize; #endif static const double MAX_GROWTH = 16; /* % Copyright 2005-2016 CVX Research, Inc. % See the file LICENSE.txt for full copyright in...
625fd641d49c711d3752ec61f2869606672e8efb24c42d629967132698590c8d
C
7,487
215
#include "mex.h" #include "math.h" #include <string.h> /* * Ne=vertex_neighbours_double2(Fa,Fb,Fc,Vx,Vy,Vz) * */ /* Coordinates to index */ int mindex3(int x, int y, int z, int sizx, int sizy) { return z*sizx*sizy+y*sizx+x;} int mindex2(int x, int y, int sizx) { return y*sizx+x;} /* The matlab mex function */ voi...
7da9424965e24cecec619c4e9afb9a5f03424fee1759e63d8e48578d51f5dbf5
C
7,517
225
/* Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions */ /*========================================================================= Copyright (c) 2008 Thomas Yeo and Mert Sabuncu All rights reserved. Redistribution and use in source and binary forms, with or without modification, are ...
7256394d1c48b968ad27f6c1d05fafabecf463470b1fe42775cd86e5625da321
C
7,584
231
#include "mex.h" #include "math.h" #include "stdio.h" #include <string.h> /* Coordinates to index */ int mindex3(int x, int y, int z, int sizx, int sizy) { return z*sizx*sizy+y*sizx+x;} int mindex2(int x, int y, int sizx) { return y*sizx+x;} /* The matlab mex function */ void mexFunction( int nlhs, mxArray *plhs[], i...
156ed42ca4eae80af9f7aaa58be1f3ec08501ee6fd9e01e6c6fd60eb1114dbe4
C
7,677
173
/* L.tmpsiz = choltmpsiz(L) % 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) 2001 Jos F. Sturm (up to 1.05R5) % Dept. Econometrics & O.R., Tilburg University, the Netherlands. % Supported by the Netherla...
ea3b92fde436d63a7bf00051ba4e0d608c0e6124a1e6e2ffc4783305f9d117b4
C
7,720
203
/* Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions */ /*========================================================================= Copyright (c) 2008 Thomas Yeo and Mert Sabuncu All rights reserved. Redistribution and use in source and binary forms, with or without modification, are ...
00bb9fa5203e3c0d89539dcbd5bfcfcbf6a0a9318362c5daf3bf8f7e3b8184a0
C
7,721
290
#include <stdlib.h> #include <string.h> #include <ctype.h> #include <stdio.h> #include <assert.h> #include "htslib/tbx.h" #include "htslib/bgzf.h" #include "htslib/khash.h" KHASH_DECLARE(s2i, kh_cstr_t, int64_t) tbx_conf_t tbx_conf_gff = { 0, 1, 4, 5, '#', 0 }; tbx_conf_t tbx_conf_bed = { TBX_UCSC, 1, 2, 3, '#', 0 };...
3519026288bfede7108863531a254d8e64cf0461a10b8e77644a61886895e610
C
7,795
324
/* * ============================================================== * astar_search_mex.c The mex interface to the astar_search * wrapper. * * David Gleich * 31 May 2006 * ============================================================= */ /* * 31 May 2006 * Initial version * * 19 February 2007 * Updated to u...
57321c3cf62ab18af6744e11eb0e1a02c7359052a8260ad25f1f4c6f161760d4
C
7,796
213
/* Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions */ /*========================================================================= Copyright (c) 2008 Thomas Yeo and Mert Sabuncu All rights reserved. Redistribution and use in source and binary forms, with or without modification, are ...
5edc12c239b5ff095772524a22f468a05beb6d033719bc174de089e1780747fd
C
7,902
184
/* L.split = cholsplit(L, cachesiz) % 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) 2001 Jos F. Sturm (up to 1.05R5) % Dept. Econometrics & O.R., Tilburg University, the Netherlands. % Supported by the ...
b5025ccdfc1ca51e7393c29a323f2b4c6074c612addb46199075d06e9f0a9405
C
7,935
254
#include <math.h> #include <stdlib.h> #include "htslib/kfunc.h" /* Log gamma function * \log{\Gamma(z)} * AS245, 2nd algorithm, http://lib.stat.cmu.edu/apstat/245 */ double kf_lgamma(double z) { double x = 0; x += 0.1659470187408462e-06 / (z+7); x += 0.9934937113930748e-05 / (z+6); x -= 0.1385710331296526 /...
cd887c4af6d20823bd15f24008b10acf01969b4165d7848656bde843a92428d7
C
8,146
291
/* Additional tools for Minizip Code: Xavier Roche '2004 License: Same as ZLIB (www.gzip.org) */ /* Code */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include "zlib.h" #include "unzip.h" #define READ_8(adr) ((unsigned char)*(adr)) #define READ_16(adr) ( READ_8(adr) | (READ_8(adr+1) << 8) ) #de...
66b39c27042f6ad12cc12efb0c82cdf100c6640b5fa959b8b866e252966113a9
C
8,225
247
/* ioapi.h -- IO base function header for compress/uncompress .zip part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) Modifications for Zip64 support Copyright (C...
6a8f8e8a47b0fcabd78d009d60661b2d9c66a927f5c4bd2d743bd6814559813c
C
8,247
243
/* Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions */ /*========================================================================= Copyright (c) 2008 Thomas Yeo and Mert Sabuncu All rights reserved. Redistribution and use in source and binary forms, with or without modification, are ...
d8ba5e4134208773650bb887ce92ed21ed84331eb21087f4ab55524de14e2812
C
8,254
205
/* ************************************************************ MODULE sdmaux*.c -- Several low-level subroutines for the mex-files in the Self-Dual-Minimization package. % This file is part of SeDuMi 1.1 by Imre Polik and Oleksandr Romanko % Copyright (C) 2005 McMaster University, Hamilton, CANADA (since 1.1)...
0f15e905a890216e5e4d5821e4716986658afa5aff4b309952a0568693f66570
C
8,298
331
#include <stdio.h> #include <stdlib.h> #include <string.h> #include "../linear.h" #include "mex.h" #include "linear_model_matlab.h" #ifdef MX_API_VER #if MX_API_VER < 0x07030000 typedef int mwIndex; #endif #endif #define CMD_LEN 2048 #define Malloc(type,n) (type *)malloc((n)*sizeof(type)) int print_null(const char...
dceae37d45d1230b13e9269aa6269b68894aae066db389a0161921939d231802
C
8,461
295
/* * This is an OpenSSL-compatible implementation of the RSA Data Security, Inc. * MD5 Message-Digest Algorithm (RFC 1321). * * Homepage: * http://openwall.info/wiki/people/solar/software/public-domain-source-code/md5 * * Author: * Alexander Peslyak, better known as Solar Designer <solar at openwall.com> * * ...
3153a773b0f5244c2d3513226266bae0de985f4fe6977f071a34e8ffc8f9f130
C
8,507
252
/* Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions */ /*========================================================================= Copyright (c) 2008 Thomas Yeo and Mert Sabuncu All rights reserved. Redistribution and use in source and binary forms, with or without modification, are ...
b548d16bdc051cd4d134a6d56f366c7a695f3accb60812d55145f65e1c89941e
C
8,577
202
/* % y = fwdpr1(Lden, b) % FWDPR1 Solves "PROD_k L(pk,betak) * y = b", where % where L(p,beta) = eye(n) + tril(p*beta',-1). % % SEE ALSO sedumi, dpr1fact, bwdpr1 % ********** INTERNAL FUNCTION OF SEDUMI ********** function y = fwdpr1(Lden, b) % This file is ...
5d3e0166c9b901fdb4e0ca36647de8c42477cb4753f650bf3e5b6a9f87612576
C
8,591
329
/* * David Gleich * Copyright, Stanford Unviersity, 2007 */ /** * @file matlab_bgl_sp_mex.c * Wrap a call to the libmbgl shortest path functions. */ /* * 20 April 2006 * Initial version * * 19 February 2007 * Updated to use Matlab 2006b sparse matrix interface * * 1 March 2007 * Updated to use expand ma...
950769163c41aff897ee41746a8685d9aa41073b1307f42da19dabe9d3fc8b85
C
8,594
233
/* fitblk.c: example of fitting compressed output to a specified size Not copyrighted -- provided to the public domain Version 1.1 25 November 2004 Mark Adler */ /* Version history: 1.0 24 Nov 2004 First version 1.1 25 Nov 2004 Change deflateInit2() to deflateInit() Use fixed-siz...
355d76166e31af7756b30372957a10daa055365ad775b2b080f9bfa64a18229d
C
8,672
298
// (C) Copyright 2018, Nanbo Sun (nanbosun@u.nus.edu), Xiuming Zhang // This file is part of POLARLDA-C. // POLARLDA-C is free software; you can redistribute it and/or modify it under // the terms of the GNU General Public License as published by the Free // Software Foundation; either version 2 of the License, or (a...
136c2fc045e9e33f553eec9f69ba777af7b643d54a89c77f4f50715aa3dc8df3
C
8,711
266
/* * FILE: CORE_library.c * -------------------- * Common computational routines for Matlab CORE_function_ MEX files. * Function descriptions can be found in CORE_library.h * * samar@cs.stanford.edu, 01/18/06 */ #include <math.h> #include <limits.h> #include <float.h> #include "CORE_library.h" /* --------...
11e317328ab3ad730b8b61531811e57644982d5de263d410c674bf59a1f45ec5
C
8,794
341
// (C) Copyright 2004, David M. Blei (blei [at] cs [dot] cmu [dot] edu) // This file is part of LDA-C. // LDA-C is free software; you can redistribute it and/or modify it under // the terms of the GNU General Public License as published by the Free // Software Foundation; either version 2 of the License, or (at your ...
7781f188a883943ef11b0165fe314260f75a2d082aa3989361bd5dc7606bf43b
C
8,999
282
/*********************************************************************** * mexskron.c : * Find the matrix presentation of * symmetric kronecker product skron(A,B), where * A,B are symmetric. * * K = mexskron(blk,A,B,sym); * * sym = 1 if A=B * = 0 otherwise * * (ij)-column = 0.5*svec(AUB + BUA)*xij, where...
346422dd9abb2a00ddd34bcc2ad37a061254dea4451ab78451aa731d2d27635b
C
9,142
283
/* The MIT License Copyright (c) 2008 Broad Institute / Massachusetts Institute of Technology 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 li...
7f0a2a1ad48d0d3d7799dce7a22631d87699eb7faa99680ad86c6f816d9665d8
C
9,214
360
// (C) Copyright 2018, Nanbo Sun (nanbosun@u.nus.edu) // This file is part of MMLDA-C. // MMLDA-C is free software; you can redistribute it and/or modify it under // the terms of the GNU General Public License as published by the Free // Software Foundation; either version 2 of the License, or (at your // option) any...
5f26cbe1d830f72702f5d365517cfed0560edd40fb77bd6c79da59b92f3922f7
C
9,235
214
/* ************************************************************ % ADA = getada2(ADA, DAt,Aord, K) % GETADA2 Compute ADA += DAt.q'*DAt.q % IMPORTANT: Updated ADA only on triu(ADA(Aord.qperm,Aord.qperm)). % Remaining entries are not affected. % % SEE ALSO sedumi, getada1, geta...
3ff0842b645da7993bfea6d6731a8da5610adc7d7795f96b9293bfb915b9972b
C
9,301
227
/* % z = psdinvjmul(xlab,xfrm, y, K) % PSDINVJMUL solves x jmul z = y, with x = XFRM*diag(xlab)*XFRM' % % SEE ALSO sedumi % ********** INTERNAL FUNCTION OF SEDUMI ********** function z = psdinvjmul(xlab,xfrm, y, K) % This file is part of SeDuMi 1.1 by Imre Polik and Oleksandr...
63d63c082bbbcc240c944c9f01c4ff84170a3d0dce6e7174a7f310af77d054b7
C
9,376
205
/* * Calculate cross-correlograms with a wide range of options. * Called from chXcorr.m. * * Copyright 2016 University of Surrey. * */ #include "math.h" #include "mex.h" #include "matrix.h" #define INHIB_MULTIPLY 1 #define INHIB_SUBTRACT 2 #define MAX(A,B) ((A)>(B) ? (A) : (B)) #define A_TEMP_ARRAY mxCreateD...
2c35d15c86c6a1dad6c3e08d121e0bc4d597c9b0491ffcae692e657eab62122a
C
9,451
214
/* % Lden = finsymbden(LAD,perm,dz,firstq) % FINSYMBDEN Updates perm and dz by inserting the % last Lorentz trace columns (last columns of LAD). It creates the fields % Lden.sign - +1 for "normal" columns, -1 for Lorentz trace columns % Lden.first - First pivot column that will af...
07168d5a426724d7961ec60d7ac9c91324541337cc7019709bf7f6d5a0b04648
C
9,501
357
/* Copyright (c) 2012-2013 Genome Research Ltd. Author: James Bonfield <jkb@sanger.ac.uk> Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this l...
7297bffb048b167f618e7192e4b70edadbdb73dbee63e80a51d1c2fe8367d7a4
C
9,532
388
/* * $Id: mat2file.c 5446 2013-04-24 16:56:51Z guillaume $ * John Ashburner */ #define _LARGEFILE_SOURCE #define _LARGEFILE64_SOURCE #define _FILE_OFFSET_BITS 64 #include <math.h> #include <fcntl.h> #include <sys/stat.h> #include <stdlib.h> #include <stdio.h> #include "mex.h" #ifdef SPM_WIN32 #include <windows.h> ...
41f314d38a15ef3be8bf58ec265485cef81e5d6471c12d065ad031d330f3c368
C
9,667
344
/* Copyright (c) 2007 * Minghui Jiang, James Anderson, Joel Gillespie, and Martin Mayne. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the...
f06d6f8db0a585d30dd13e9f64a0e38fbedbc74f0b66cfbe3850c207366ea08f
C
9,749
235
/* ************************************************************ % Ablk = findblks(At,Ablkjc,blk0,blk1,blkstart) % FINDBLKS Find nonzero blocks % in A, with subscripts per column bounded bij Ablkjc([blk0,blk1]), % block partitioned by blkstart. % If blk0 < 1 (blk1 > size(Ablkjc,2)) then st...
c6a1f604f55421fe7919c185bd9d58d12b23e9d14b7fe74c9a01b35a5b8d5a9a
C
9,775
376
// (C) Copyright 2018, Nanbo Sun (nanbosun@u.nus.edu), Xiuming Zhang // This file is part of POLARLDA-C. // POLARLDA-C is free software; you can redistribute it and/or modify it under // the terms of the GNU General Public License as published by the Free // Software Foundation; either version 2 of the License, or (a...
4e80ad5e11fdcaeaf6c24a8d7ea045616e06fe1dda8a5243daad87df4480f506
C
9,839
286
/* Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions */ /*========================================================================= Copyright (c) 2008 Thomas Yeo and Mert Sabuncu All rights reserved. Redistribution and use in source and binary forms, with or without modification, are ...
e0e4b5d1ac98b59ea472bd7ca753eb86bcadfaab5a2e9d01c782b876fdc032d7
C
9,895
259
#include "mex.h" #include "cokus.cpp" // Syntax // [ X , XD , PQ ] = GibbsSamplerSWR( PQ0 , PQ1 , PQ2 , GAMMA , BURNIN , NS , LAG , SEED , OUTPUT ); // INPUTS // [0] PQ0: NQ x D matrix of query word probabilities for each document according to topic model // [1] PQ1: NQ x D matrix of query word proba...
fcf8fc78a87abc8f46ff971d4a420f58a0f5dd82428c294528ace58d493f9065
C
9,972
305
/****************************************************************** * mexProd2.c : C-MEX file to compute the product of two matrices. * * P = mexProd2(blk,A,B,type) * * input: blk = 1x2 cell array describing the block structure of A and B * A = mxn matrix. * B = nxp matrix. * type ...
5a40bc7002d91eec4a264012971550b9ae8bdc5761c17e1615c254a1e6b453c0
C
10,095
268
/* % [delta,h,alpha] = iswnbr(vSQR,thetaSQR) % ISWNBR Checks feasibility w.r.t. wide region/neighborhood of Sturm-Zhang. % % SEE ALSO sedumi % ********** INTERNAL FUNCTION OF SEDUMI ********** function [delta,h,alpha] = iswnbr(vSQR,thetaSQR) % This file is part of SeDuMi 1.1 by Imre P...