sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
1763a238cfac5e26a37457263f686a050dfe0b4040635c3ed919f8309bf3b376
C
12,123
362
/******************************************************************************* ** CalculateProbability.c ** Part of the mutual information toolbox ** ** Contains functions to calculate the probability of each state in the array ** and to calculate the probability of the joint state of two arrays ** ** Author: Adam P...
2bab9046dfcbc2885c11e651cbb883034180cf4f00fd3d6ad352ccf1f3b396ec
C
12,143
346
#define PY_SSIZE_T_CLEAN #include <Python.h> #include <math.h> #define NO_IMPORT_ARRAY #define NO_IMPORT_UFUNC #define PY_ARRAY_UNIQUE_SYMBOL shapely_ARRAY_API #define PY_UFUNC_UNIQUE_SYMBOL shapely_UFUNC_API #include <numpy/ndarraytypes.h> #include <numpy/npy_3kcompat.h> #include <numpy/ufuncobject.h> #include "fas...
5fd050d3902b43ec4233ed29a7214ff777ed4f45c1985d856e86bb6912568b2b
C
12,168
342
/******************************************************************************* ** ArrayOperations.c ** Part of the mutual information toolbox ** ** Contains functions to floor arrays, and to merge arrays into a joint ** state. ** ** Author: Adam Pocock ** Created 17/2/2010 ** Updated - 22/02/2014 - Added ch...
0a3ab482057233cd13712de3ee956349a83bae6f715aed9000f6b402c8c92d23
C
12,254
310
/******************************************************************************* ** FSToolboxMex.c is the entry point for the feature selection toolbox. ** It provides a MATLAB interface to the various selection algorithms. ** ** Initial Version - 27/06/2011 ** Updated - 22/02/2014 - Moved increment of feature ...
b0f4ab1e992b72d4e325d9f41daba34714e2fce1a5fe5367ddbc0941b79b458d
C
12,300
419
/* * ParseArgv.c -- * * This file contains a procedure that handles table-based * argv-argc parsing. * * Copyright 1990 Regents of the University of California * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without * fee is hereby granted, provided t...
6d30ce35076a83f02630f2c91c9f9cc2abb2dee7ca5b5f51f5261de90aa94c5f
C
12,471
504
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include "../svm.h" #include "mex.h" #include "svm_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)) void print_nu...
e9cbb9eec29781fb5e7225dd6e25491057408210088b9d7b9b3dcb43f7ac55eb
C
12,722
370
#define PY_SSIZE_T_CLEAN #include <Python.h> #include <math.h> #define NO_IMPORT_ARRAY #define NO_IMPORT_UFUNC #define PY_ARRAY_UNIQUE_SYMBOL shapely_ARRAY_API #define PY_UFUNC_UNIQUE_SYMBOL shapely_UFUNC_API #include <numpy/ndarraytypes.h> #include <numpy/npy_3kcompat.h> #include <numpy/ufuncobject.h> #include "fas...
17f55d8590627ff73dcfe5cb4770a277e572a508cc13c0a38d239371661b0766
C
12,845
369
#define PY_SSIZE_T_CLEAN #include <Python.h> #include <math.h> #define NO_IMPORT_ARRAY #define NO_IMPORT_UFUNC #define PY_ARRAY_UNIQUE_SYMBOL shapely_ARRAY_API #define PY_UFUNC_UNIQUE_SYMBOL shapely_UFUNC_API #include <numpy/ndarraytypes.h> #include <numpy/npy_3kcompat.h> #include <numpy/ufuncobject.h> #include "fas...
079e63c464768bce4a44908501b051ed9a09d5d103a3d97111dca01dfab368dc
C
12,899
402
/******************************************************************************* ** WeightedMIToolboxMex.c ** is the MATLAB entry point for the WeightedMIToolbox functions when called ** from a MATLAB/OCTAVE script. ** ** Copyright 2011-2017 Adam Pocock, The University Of Manchester ** www.cs.manchester.ac.uk ** ** Th...
c1f60e3d1950e504db0693c126e311b36a678b699b5e562a9cc00b3751f6cdff
C
13,117
405
#define PY_SSIZE_T_CLEAN #include <Python.h> #include <math.h> #define NO_IMPORT_ARRAY #define NO_IMPORT_UFUNC #define PY_ARRAY_UNIQUE_SYMBOL shapely_ARRAY_API #define PY_UFUNC_UNIQUE_SYMBOL shapely_UFUNC_API #include <numpy/ndarraytypes.h> #include <numpy/npy_3kcompat.h> #include <numpy/ufuncobject.h> #include "fas...
a1b93d2f9f3cbfd91d22d096bc0c532d2cb282d6933aa323320d852baad72a2a
C
13,325
523
#include <math.h> #include <stdlib.h> #include <string.h> #include <ctype.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)) #define INF ...
4968784d05799f17465a05dfbb3f262694883bdfefe49a7b3d148782ab6322d3
C
13,346
498
#define PY_SSIZE_T_CLEAN #include "pygeom.h" #include <Python.h> #include <structmember.h> #include "geos.h" #include "pygeos.h" /* This initializes a global geometry type registry */ PyObject* geom_registry[1] = {NULL}; /* Initializes a new geometry object */ PyObject* GeometryObject_FromGEOS(GEOSGeometry* ptr, G...
fdf5074fa2ece7fc3531fb4499396f358cf2db8b1e33e3f0df153360409783a3
C
13,438
417
/******************************************************************************* ** ** WeightedMIToolboxMex.c ** is the MATLAB entry point for the WeightedMIToolbox functions when called ** from a MATLAB/OCTAVE script. ** ** Copyright 2011 Adam Pocock, The University Of Manchester ** www.cs.manchester.ac.uk ** **...
321b97d87d6338072600d55c2d0a5c40ce7dd0f0a385e362b0768b2b3cae38dd
C
14,982
496
/******************************************************************************* ** MIToolboxMex.c ** is the MATLAB entry point for the MIToolbox functions when called from ** a MATLAB/OCTAVE script. ** ** Copyright 2010-2017 Adam Pocock, The University Of Manchester ** www.cs.manchester.ac.uk ** ** This file is part o...
c8b92ce4c35b3fd4399f845c415dd52a4e952f1e539c0242863ca14107bffef0
C
15,362
502
/******************************************************************************* ** ** MIToolboxMex.c ** is the MATLAB entry point for the MIToolbox functions when called from ** a MATLAB/OCTAVE script. ** ** Copyright 2010 Adam Pocock, The University Of Manchester ** www.cs.manchester.ac.uk ** ** This file is pa...
38c43e6186594b9f7ecb3457b36196f882a388ddbd509ee454285aae55497083
C
15,713
633
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include <errno.h> #include "svm.h" #include <math.h> #include "mex.h" #include "svm_model_matlab.h" #include "matrix.h" #if MX_API_VER < 0x07030000 typedef int mwIndex; #endif #define CMD_LEN 2048 #define Malloc(type,n) (type *)malloc((n)...
5ff237b85e54472e648f5409b9d3e8d2b10256ccabbbb05df69a1b1f3a843a59
C
15,714
633
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include <errno.h> #include "svm.h" #include <math.h> #include "mex.h" #include "svm_model_matlab.h" #include "matrix.h" #if MX_API_VER < 0x07030000 typedef int mwIndex; #endif #define CMD_LEN 2048 #define Malloc(type,n) (type *)malloc((n)...
e942de0a4de409fb02fbdfaf4d6fea50c96ef7504b3d129ab371a5494946ad46
C
17,281
659
/* * $Id: file2mat.c 7510 2019-01-02 15:06:12Z guillaume $ * John Ashburner */ /* Memory mapping is used by this module. For more information on this, see: http://www.mathworks.com/company/newsletters/digest/mar04/memory_map.html */ #define _FILE_OFFSET_BITS 64 #include <math.h> #include <fcntl.h> #include <sys/s...
bb2c5f916097490dd02659e66afadba98f56d6719c0c56029fbf55d24f5f9157
C
19,199
857
/****************************************************************************** File : blogreg.c Date : Thursday 30th March 2006 Author : Dr Gavin C. Cawley Description : MEX implementation of a Bayesian logsitic regression method based on the training algorithm for Shevade and Keer...
431a38e1552fda5eea8c96f663d11321622e2fc06db7884de1181187fb064924
C
19,323
656
#define PY_SSIZE_T_CLEAN #include <Python.h> #include <math.h> #define NO_IMPORT_ARRAY #define PY_ARRAY_UNIQUE_SYMBOL shapely_ARRAY_API #include <numpy/arrayobject.h> #include <numpy/ndarraytypes.h> #include <numpy/npy_3kcompat.h> #include "geos.h" #include "pygeom.h" /* These function prototypes enables that thes...
663d54aa79b19093f8caf4169a07dac7b27206414c6d939a4bb626df7f5c06cd
C
23,216
572
/* SPC.c Performs hierarchical clustering using a superparamagnetic-inspired algorithm. Uses a fair split tree to construct an approximate minimum spanning graph and the mutual k-nearest neighbors graph. Returns the clusters and the hierarchical structure of the clusters. INPUTS V - po...
aa1b902f9408b101feb650b0a64014a3a2bf7b9783c3c45b7e75d787f3a65df2
C
27,791
750
/* Copyright (c) 2009 Dave Gamble 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, distr...
da427533a24f2ce1684969d036196d41dbae70d834da4f02941f27a8e2be0737
C
30,625
744
/* FAIRSPLIT.c Fair-split decomposition and application functions Brendan Hasz haszx010@umn.edu Feb 2015 David Redish Lab University of Minnesota, Twin Cities */ #include "mex.h" #include <math.h> #include <stdlib.h> #include <stdio.h> #include "FAIRSPLIT.h" /******************************...
0d870230b49fb75e8beaf0428c507883961ae651e3f0262d2844199ef6b674c2
C
36,122
1,218
#define PY_SSIZE_T_CLEAN #include "geos.h" #include <Python.h> #include <numpy/ndarraytypes.h> #include <numpy/npy_math.h> #include <structmember.h> /* Threadlocal GEOS context support - private to this file */ typedef struct { GEOSContextHandle_t context; char last_error[1024]; } ThreadLocalGEOS; /* This init...
4e47c7f4b960a9aa8720c9e8098d42fc406659be6e555ff152f38f7d28779988
C
38,022
1,210
#define PY_SSIZE_T_CLEAN #include <Python.h> #include <float.h> #include <numpy/npy_math.h> #include <structmember.h> #define NO_IMPORT_ARRAY #define PY_ARRAY_UNIQUE_SYMBOL shapely_ARRAY_API #include <numpy/arrayobject.h> #include <numpy/ndarraytypes.h> #include <numpy/npy_3kcompat.h> #include "coords.h" #include "...
27412b02d366cd27582dab1f661840e3a85b04de92bb18b312015af345212507
C
41,740
1,220
/*************************************************************************** *cr *cr (C) Copyright 1995-2009 The Board of Trustees of the *cr University of Illinois *cr ...
69c4f596790734611c58d5f0931cb2c97b6bd0d9e0a85f3b570a4266bcf81104
C
41,807
1,219
/*************************************************************************** *cr *cr (C) Copyright 1995-2009 The Board of Trustees of the *cr University of Illinois *cr ...
4385823d1034ee57b1a5c39983125394f80290d2e458fea50ab5aed5d0a3ba3f
C
43,044
1,088
/* ALGRAPH.c Adjacency-list representation of graph, and various utility functions NOTE: in this case it might not be best to use adjacency binary heap (instead of list) because the list len is max of k (so for us, 11) To create a new graph: G = NEW_ALGRAPH(N, d); where N is the numb...
77957c49ecbd88a2671aa78b558db856e3e686725fb3e009635d58ab98a5c29b
C
56,975
1,327
/* SPDX-License-Identifier: MIT */ /* * Project: CellRDA-LS (Mechanochemical cell motility simulations) * File: main.c * Brief: Program entry point; parses JSON parameters and runs batch simulations. * * Author: Blaž Ivšić * Contact: bivsic@irb.hr * Copyright: (c) 2023–2025 Blaž Ivšić * *...
af7d77ccc01acc0f6904c84c371dfc9575dcb776070d5e9a0c312e21c9ca5196
C
61,880
1,997
#define PY_SSIZE_T_CLEAN #include <Python.h> #include <math.h> #define NO_IMPORT_ARRAY #define NO_IMPORT_UFUNC #define PY_ARRAY_UNIQUE_SYMBOL shapely_ARRAY_API #define PY_UFUNC_UNIQUE_SYMBOL shapely_UFUNC_API #include <numpy/ndarraytypes.h> #include <numpy/npy_3kcompat.h> #include <numpy/ufuncobject.h> #include "fas...
a1761c1b8c17648e2d3288cd95eb8af77c9d6773405a036bcd583401d85d8f14
C
69,610
1,676
/* SPDX-License-Identifier: MIT */ /* * Project: CellRDA-LS * File: simulation.c * Brief: Top-level simulation control: initialization, time loop, finalization. * * Author: Blaž Ivšić * Contact: bivsic@irb.hr; 19blazz95@gmail.com * Copyright: (c) 2023–2025 Blaž Ivšić * * License: MIT —...
083cf66d4acbda84bcd5b97c8beef4477c11517bc383aee6e2fb2320d6bf05f2
C
82,503
1,919
/* * readPLXFileC - A MEX function to read a PLX file (Plexon, Inc.). * * For detailed help run: readPLXFileC('help') * * Author: Benjamin Kraus (bkraus@bu.edu, ben@benkraus.com) * Last Modified: $Date: 2013-06-04 13:21:41 -0400 (Tue, 04 Jun 2013) $ * Copyright (c) 2012-2013, Benjamin Kraus * $Id: readPLXFileC....
3d272656d78a1b60728d1276a8acf2b4a940f69ac5a0c155d66b98e39cf54383
C
200,000
4,672
/* Generated by Cython 0.27.3 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [], "extra_compile_args": [ "-fopenmp", "-ffast-math" ], "extra_link_args": [ "-fopenmp" ], "name": "velocyto.speedboosted", "sources": ...
a92c10ff57b8c6b1a73d8793c1cb505c6087c9ebfe025e34aa672ded39687698
C
200,000
4,953
/* Generated by Cython 0.29.24 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSIO...
f536fcae0a13a436f2622d0475312533794516599d84893ded377e3bd36af6ad
C
200,000
4,194
<<<<<<< HEAD /************************************************************************** * * Copyright 2013-2014 RAD Game Tools and Valve Software * Copyright 2010-2014 Rich Geldreich and Tenacious Software LLC * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining ...
731ccefb080519d83d5d24fb8683a6aa97acbe92eeb429e4e820983a5e3d94ca
C++
155
8
#include "caffe/layers/parameter_layer.hpp" namespace caffe { INSTANTIATE_CLASS(ParameterLayer); REGISTER_LAYER_CLASS(Parameter); } // namespace caffe
5053763538bde92542f86e220e562f6b3d893631866070496a6423eddc3d1c7b
C++
166
7
#include "caffe/caffe.hpp" int main(int argc, char** argv) { LOG(FATAL) << "Deprecated. Use caffe test --model=... " "--weights=... instead."; return 0; }
d24b3a04004814a9f5430d7c86c8b219ce1bf1ff0eaba14308908811a7fc5e1c
C++
171
15
#include <cstdint> #include <cfloat> #include <cmath> extern "C" { double logn(double x) { return log(x); } double asDouble(int32_t x) { return (double)x; } }
beadfb4de9edb301049ab1a7b08d219146e0d78c0fda48e61b6d50982cc5facd
C++
175
7
#include "caffe/common.hpp" int main(int argc, char** argv) { LOG(FATAL) << "Deprecated. Use caffe device_query " "[--device_id=0] instead."; return 0; }
8cc776169e0f9d7222e42879e4c34501dcf7c54ddaad9edaa1486e0611ba9cce
C++
180
7
#include "caffe/caffe.hpp" int main(int argc, char** argv) { LOG(FATAL) << "Deprecated. Use caffe train --solver=... " "[--weights=...] instead."; return 0; }
0cbfcc11d82d4f7086d1210a4d36752e16beb984e8b3b6330c9aced93d14536b
C++
181
7
#include "caffe/caffe.hpp" int main(int argc, char** argv) { LOG(FATAL) << "Deprecated. Use caffe train --solver=... " "[--snapshot=...] instead."; return 0; }
f2bdf0d1937ee62af1f80794abd2d2ec291f7e1f41913de91ec54f5729be4b63
C++
192
7
#include "caffe/caffe.hpp" int main(int argc, char** argv) { LOG(FATAL) << "Deprecated. Use caffe time --model=... " "[--iterations=50] [--gpu] [--device_id=0]"; return 0; }
8e2c14f2f72ca8f79ba451c7f6b27cd4373e24099b9e3f76af4edc187dbe2c1c
C++
309
15
#include <vector> #include "caffe/layers/neuron_layer.hpp" namespace caffe { template <typename Dtype> void NeuronLayer<Dtype>::Reshape(const vector<Blob<Dtype>*>& bottom, const vector<Blob<Dtype>*>& top) { top[0]->ReshapeLike(*bottom[0]); } INSTANTIATE_CLASS(NeuronLayer); } // namespace caffe
d169d5c299e04c0557e5a002064354c3a6f8555da17dbd97dedddb7125ed2c50
C++
436
20
#include <Rcpp.h> using namespace Rcpp; // [[Rcpp::export]] NumericMatrix asMatrix(NumericVector rp, NumericVector cp, NumericVector z, int nrows, int ncols){ int k = z.size() ; NumericMatrix mat(nrows...
8c507cc4a5008d8bf5192ffa313d5f93502cb34016d8b2128ab3886364b907ad
C++
446
24
#include "mex.h" #include "math.h" /* Compute the arithmetic mean rapidly */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { int ii; double media; double *x; int dimx; double *out; dimx=mxGetNumberOfElements(prhs[0]); media=0; x=(double *)mxGetPr(prhs[0]); for (ii=0;ii<dimx;ii++) ...
8f848297a3516443e2a912e4526d40376e82f9d155c88f34b98491f1eab3b6c2
C++
452
27
#include <boost/thread.hpp> #include "caffe/layer.hpp" namespace caffe { template <typename Dtype> void Layer<Dtype>::InitMutex() { forward_mutex_.reset(new boost::mutex()); } template <typename Dtype> void Layer<Dtype>::Lock() { if (IsShared()) { forward_mutex_->lock(); } } template <typename Dtype> void...
57f56adbe93a2f1baae6589311bd743131621672172abb07f5882a976fc177d9
C++
524
27
#include "mex.h" #include "math.h" #include "matrix.h" double intpow( double base, int exponent ){ if (exponent == 0) return 1; else { double curpwr = base; int i; for(i=1; i<exponent; ++i) curpwr = base * curpwr; return curpwr; } } void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {...
f42718fbec6b77263d660f9a5238d6a745b03204f4e1faeee6a8fa77cf282b29
C++
550
31
#include "mex.h" #include "math.h" #include "matrix.h" inline double intpow( double base, int exponent ) { double curpwr = base; int i; for(i=1; i<=exponent; ++i) curpwr = base * curpwr; return curpwr; } void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { double *out, *in; int i,j, M, N; i...
ab81225ff32f732d17d1462669c28718d12cc3ca799c0c0616f0cb83056a6e1c
C++
615
26
#include <vector> #include "caffe/layers/silence_layer.hpp" #include "caffe/util/math_functions.hpp" namespace caffe { template <typename Dtype> void SilenceLayer<Dtype>::Backward_cpu(const vector<Blob<Dtype>*>& top, const vector<bool>& propagate_down, const vector<Blob<Dtype>*>& bottom) { for (int i = 0; i ...
4f58cfaf6350ba9f4b86e1ee8a83956394b3987c15de1aae46e3deda5b4c99b6
C++
630
38
#include <RcppArmadillo.h> #include <RcppZiggurat.h> #include <Ziggurat.h> // [[Rcpp::depends(RcppArmadillo, RcppZiggurat)]] using namespace Rcpp; static Ziggurat::Ziggurat::Ziggurat zigg; //' random normal //' //' @description random normal //' //' @param n int; number of random draws //' //' @return random numbers ...
765b75ec26dd65df9147a757fecce313ada14c6822d58969836f07ee3e7cb4d7
C++
646
23
#ifdef USE_CUDNN #include "caffe/util/cudnn.hpp" namespace caffe { namespace cudnn { float dataType<float>::oneval = 1.0; float dataType<float>::zeroval = 0.0; const void* dataType<float>::one = static_cast<void *>(&dataType<float>::oneval); const void* dataType<float>::zero = static_cast<void *>(&dataType<fl...
b767ebdcf17301bb4f7febe1a9bc25b0d3e4da3a9275109a5fd50462e234b379
C++
676
23
#ifdef USE_LEVELDB #include "caffe/util/db_leveldb.hpp" #include <string> namespace caffe { namespace db { void LevelDB::Open(const string& source, Mode mode) { leveldb::Options options; options.block_size = 65536; options.write_buffer_size = 268435456; options.max_open_files = 100; options.error_if_exists...
21939026b21ce3eba50da436b57260ea7cafc84dbc710159ced9150e039a5a6a
C++
750
18
/* * Copyright 2022 Google LLC. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
8131b59595113b85bf54a2c9a6817f063793f7e90b16553f4d0c9f3371ce9666
C++
781
19
/* * Copyright 2022 Google LLC. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
88ddacc5ee5e366b9ecbc6ac61843137c5952bcac0589934d1552799e9450489
C++
788
27
#include <vector> #include "caffe/layers/loss_layer.hpp" namespace caffe { template <typename Dtype> void LossLayer<Dtype>::LayerSetUp( const vector<Blob<Dtype>*>& bottom, const vector<Blob<Dtype>*>& top) { // LossLayers have a non-zero (1) loss by default. if (this->layer_param_.loss_weight_size() == 0) { ...
17a58ad1a92c57b6da13bc8f91437bf6495db7f28db5b08840105e6b79b9f94f
C++
802
20
/* * Copyright 2022 Google LLC. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
ce96a172d06df0f8b3a4ac0d2fe6bb5834c4f23019f1092cd7f4bbff0bccda73
C++
813
29
// This is simply a script that tries serializing protocol buffer in text // format. Nothing special here and no actual code is being tested. #include <string> #include "google/protobuf/text_format.h" #include "gtest/gtest.h" #include "caffe/proto/caffe.pb.h" #include "caffe/test/test_caffe_main.hpp" namespace caff...
8af10085e4d919683fd889ebda3dcc3dadfc78823c85cba47e7b8a329089412c
C++
815
41
#include "caffe/util/db.hpp" #include "caffe/util/db_leveldb.hpp" #include "caffe/util/db_lmdb.hpp" #include <string> namespace caffe { namespace db { DB* GetDB(DataParameter::DB backend) { switch (backend) { #ifdef USE_LEVELDB case DataParameter_DB_LEVELDB: return new LevelDB(); #endif // USE_LEVELDB #ifde...
a22062c47b8b7a8af80a90bc011d561de22c5d5176cb54047ea17d384a99d438
C++
834
27
#include <vector> #include "caffe/layers/input_layer.hpp" namespace caffe { template <typename Dtype> void InputLayer<Dtype>::LayerSetUp(const vector<Blob<Dtype>*>& bottom, const vector<Blob<Dtype>*>& top) { const int num_top = top.size(); const InputParameter& param = this->layer_param_.input_param(); c...
b3497a079c1ffda1df3c4dd0314094c6fecd60e1a8d799b941b425f232e949f6
C++
871
26
/* * Copyright 2022 Google LLC. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
681a31803e6b4d4149d49e05647463842b2ad099aef65d3dd62a75cd65699ad2
C++
881
34
#include "mex.h" #include "math.h" #include "matrix.h" void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { double *oY = mxGetPr(prhs[0]); double *I = mxGetPr(prhs[1]); //Reorder index int mrows1 = mxGetM(prhs[0]); int ncols1 = mxGetN(prhs[0]); int mrowsI = mxGetM(prhs[1]); int numthread...
bccc079d6d309dd3744e038d4eba4b507a4f2dfb0de4e66703238e276c08b81b
C++
893
32
#include <vector> #include "caffe/layers/threshold_layer.hpp" namespace caffe { template <typename Dtype> void ThresholdLayer<Dtype>::LayerSetUp(const vector<Blob<Dtype>*>& bottom, const vector<Blob<Dtype>*>& top) { NeuronLayer<Dtype>::LayerSetUp(bottom, top); threshold_ = this->layer_param_.threshold_para...
d5a782e85ec01ec9d51b1b3fa009a20b288f3e67b30d2f0b94b3127a3120ddc9
C++
916
25
/* * Copyright 2022 Google LLC. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
73f74455852afb80c89beb5f17f6418d09c3fa0b57a190d21260213a0581d9f3
C++
921
31
/* * Medical Image Registration ToolKit (MIRTK) * * Copyright 2008-2015 Imperial College London * Copyright 2008-2015 Daniel Rueckert, Julia Schnabel * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of ...
b6aa41f2b084746310cfb7443ad3053ada8517711b45cf01801026f60e8f0567
C++
933
30
/* * Copyright 2022 Google LLC. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
6d4e56e206198fe24ef7e594f6f036f8767dce61ffb674441edfc5a65585fdf0
C++
986
32
/* * Copyright 2022 Google LLC. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
0b56ab965bbab26e794eae033e4b88d8b73b54906fecbdfd3c7dd64a13b26aaa
C++
1,021
51
#include "mex.h" #include "math.h" #include "matrix.h" void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { int errfl = 0; double *Y = mxGetPr(prhs[0]); double *iY = mxGetPr(prhs[1]); double *out; int mY = mxGetM(prhs[0]); int nY = mxGetN(prhs[0]); int miY = mxGetM(prhs[1]); int niY = mxGetN(...
367c365aec05e30a981e1e0cc1096864546a8a4693da04803263093422a9c5e5
C++
1,026
29
/* * Copyright 2022 Google LLC. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
ffef0b88b8d002c2c8b4256f2ae6d7a0378b3325bfcc1bfe5b6a58afb4efff5b
C++
1,076
56
#include "mex.h" #include "math.h" /* Compute the arithmetic mean rapidly */ double mean1d(double *x, int dimx); double cov1d(double *x, int dimx, double avg); void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { int ii; int dimx1, dimx2; double *x1; double *x2; double *out; double avg1, avg...
0c7957797e9c12c2db4eca7980df0e5ebbac8057a68133c502fe49bf083f309f
C++
1,094
38
#include "caffe/caffe.hpp" #include "caffe/test/test_caffe_main.hpp" namespace caffe { #ifndef CPU_ONLY cudaDeviceProp CAFFE_TEST_CUDA_PROP; #endif } #ifndef CPU_ONLY using caffe::CAFFE_TEST_CUDA_PROP; #endif int main(int argc, char** argv) { ::testing::InitGoogleTest(&argc, argv); caffe::GlobalInit(&argc, &ar...
7d0cc2c73ccd6c48ad7aa3934c18d2a3b74daa712bc908d16775968e752864f5
C++
1,138
38
/* * Copyright 2022 Google LLC. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
c32f919f931e73e86dde1e5289b2856573c81c79f0aeaa382b054c50366512b5
C++
1,142
37
/* * Copyright 2022 Google LLC. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
de110b62ccd231bf8ede7124e8239980ec7d6b3763627f748f202cc5e6d0c4c1
C++
1,146
54
#include "mex.h" #include "math.h" #include "matrix.h" //#include <omp.h> void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { int errfl = 0; double *Y = mxGetPr(prhs[0]); double *iX = mxGetPr(prhs[1]); double *out; int mY = mxGetM(prhs[0]); int nY = mxGetN(prhs[0]); int miX = mxGetM(prhs[1])...
9f799dfd3332b5fc8fa91f2a4f09e20404adecb33d0cd3d25a87801f89494ed5
C++
1,150
53
#include "glog/logging.h" #include "gtest/gtest.h" #include "caffe/internal_thread.hpp" #include "caffe/util/math_functions.hpp" #include "caffe/test/test_caffe_main.hpp" namespace caffe { class InternalThreadTest : public ::testing::Test {}; TEST_F(InternalThreadTest, TestStartAndExit) { InternalThread thread;...
2458fe760b4b942c5454014118f09bd3fe99a15ea561264fb788691dd0ab1c98
C++
1,160
37
#include <RcppArmadillo.h> using namespace Rcpp; //[[Rcpp::depends(RcppArmadillo)]] //' Get pulse stimulus //' //' @description get full pulse stimulus //' //' @param stim_seq numeric vector; vecotr of timepoint by timepoint evidence //' @param dur numeric; duration of pulse, default = .01 //' @param isi numeric; inte...
c1b11521a55a1178bf8f45123f7fe44ed0ed9a0201801e4e8b42c842a24f2299
C++
1,185
44
// TanH neuron activation function layer. // Adapted from ReLU layer code written by Yangqing Jia #include <vector> #include "caffe/layers/tanh_layer.hpp" namespace caffe { template <typename Dtype> void TanHLayer<Dtype>::Forward_cpu(const vector<Blob<Dtype>*>& bottom, const vector<Blob<Dtype>*>& top) { const...
dbb4a0e9053ee8abee849d3411539d1d8d8205e322c2087e2a6a16a7fcb33c5e
C++
1,186
39
/* * Medical Image Registration ToolKit (MIRTK) * * Copyright 2016 Imperial College London * Copyright 2016 Andreas Schuh * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * htt...
feedd701ca6bb0f6bc0feab2185c0b8791503cc9ab555ccc0480be64386bc529
C++
1,192
28
// --------------------------------------------------------------- // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. // --------------------------------------------------------------- // Originated from https://github.com/rosinality/stylegan2-pytorch // The license for the original version of this file c...
77d00eac5d12689e9105b874fd5917dddebc3ebdcab50f3aba9ffd3b3b02e660
C++
1,210
45
#include <QtTest> #include <opencv2/core/core.hpp> #include "avfframegrabbermac.h" // Hardware-free smoke tests for the uniqueID-pinned frame grabber: the // failure paths must fail cleanly (message, no crash), because the stream // loop leans on them for its reconnect handling. class TestAvfFrameGrabber : public QO...
03ae794dbb5c8a715a64f4732dd548a47219fe22277d36d2be37716d484409bc
C++
1,215
39
/* * Medical Image Registration ToolKit (MIRTK) * * Copyright <copyright> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unl...
ab572f8225e0db613434a705e1b4829f657b6a151998b9caf2e390d23be01c30
C++
1,221
47
#include <cmath> #include <vector> #include "caffe/layers/sigmoid_layer.hpp" namespace caffe { template <typename Dtype> inline Dtype sigmoid(Dtype x) { return 1. / (1. + exp(-x)); } template <typename Dtype> void SigmoidLayer<Dtype>::Forward_cpu(const vector<Blob<Dtype>*>& bottom, const vector<Blob<Dtype>*>&...
7cfeaa908e7c8e18bafcee2d39ffd455ad93cdda530974042fc74b93c10e13d2
C++
1,229
61
#include "mex.h" #include "math.h" #include "matrix.h" void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { double *out; double *x2,*x1; int i,j; double avg1, avg2, var1, var2, avgdiff, val; int mrows1,ncols1,mrows2,ncols2; mrows1 = mxGetM(prhs[0]); ncols1 = mxGetN(prhs[0]); mrows2 = mxGe...
4426ce7fcf40ac02e1fd641c68ed2696b80bae3156900d981b06188ec5c6ecd0
C++
1,233
61
#include "mex.h" #include "math.h" #include "matrix.h" void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { double *out; double *x2,*x1; int i,j; double avg1, avg2, var1, var2, avgdiff, val; int mrows1,ncols1,mrows2,ncols2; mrows1 = mxGetM(prhs[0]); ncols1 = mxGetN(prhs[0]); mrows2 = mxGe...
8ba5ad0093d3b27915db5c1f1c439e2bc20fdc06fb1b01592db5daa8aecdb162
C++
1,245
38
/* * Copyright 2022 Google LLC. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
7a9adf3a0f4ee81e2b019a2a44c32bd2563daec001bd1fe2f0e6b653c9b698e1
C++
1,249
53
//========================================================= // //This is a prog in the MutualInfo 0.9 package written by // Hanchuan Peng. // //Disclaimer: The author of program is Hanchuan Peng // at <penghanchuan@yahoo.com> and <phc@cbmv.jhu.edu>. // //The CopyRight is reserved by the author. // //Last modificat...
f382ff31dd7aa80cd6092be9cc86f848921771b5ae6d6c3969ffc2085cbdbede
C++
1,251
53
//========================================================= // //This is a prog in the MutualInfo 0.9 package written by // Hanchuan Peng. // //Disclaimer: The author of program is Hanchuan Peng // at <penghanchuan@yahoo.com> and <phc@cbmv.jhu.edu>. // //The CopyRight is reserved by the author. // //Last modificat...
682d83f682d158f4c8ca82a4671acb214472e717fb586ad33874fd6cd62b8a2f
C++
1,283
62
#include "mex.h" #include "math.h" #include "matrix.h" void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { int errfl = 0; if (nrhs > 2){ errfl=1; } double *Y = mxGetPr(prhs[0]); int dim = mxGetScalar(prhs[1]); int mY = mxGetM(prhs[0]); int nY = mxGetN(prhs[0]); //int chunk = nY/4; if ...
d1fa5c0a08552643c6700ea14712d5f28c1497400a091ff9c808111d9f084209
C++
1,300
46
#ifdef USE_CUDNN #include <vector> #include "thrust/device_vector.h" #include "caffe/layers/cudnn_softmax_layer.hpp" namespace caffe { template <typename Dtype> void CuDNNSoftmaxLayer<Dtype>::LayerSetUp(const vector<Blob<Dtype>*>& bottom, const vector<Blob<Dtype>*>& top) { SoftmaxLayer<Dtype>::LayerSetUp(bo...
91b00d2f92443675ce137174e89d9d1b7d992e3de96a6f3ef402cab0029a23dd
C++
1,320
47
#include <algorithm> #include <vector> #include "caffe/layers/bnll_layer.hpp" namespace caffe { const float kBNLL_THRESHOLD = 50.; template <typename Dtype> void BNLLLayer<Dtype>::Forward_cpu(const vector<Blob<Dtype>*>& bottom, const vector<Blob<Dtype>*>& top) { const Dtype* bottom_data = bottom[0]->cpu_data(...
d9d93a2cbe6dbba38faef798a75cc5fdaca1d7d0092f13a2e37cfde9d31ea12f
C++
1,329
39
/* * Copyright 2022 Google LLC. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
3f1a41d2ce8581872209b770439293a6fcb26ca323c09a4477a9fd43bc0c987e
C++
1,333
31
// --------------------------------------------------------------- // Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. // --------------------------------------------------------------- // Originated from https://github.com/rosinality/stylegan2-pytorch // The license for the original version of this file c...
efc2c94a97b9c3192547a5dfb3eb918dfd1edb3c736ae0b2c3090a291ba73ccd
C++
1,337
37
// Generated by using Rcpp::compileAttributes() -> do not edit by hand // Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 #include <Rcpp.h> using namespace Rcpp; #ifdef RCPP_USE_GLOBAL_ROSTREAM Rcpp::Rostream<true>& Rcpp::Rcout = Rcpp::Rcpp_cout_get(); Rcpp::Rostream<false>& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get(...
53bdfc62c0b5073efcc9ee6bf12f897bd04a3a664d5871e947d889c43c26b9d3
C++
1,338
44
#include <vector> #include "caffe/layers/absval_layer.hpp" #include "caffe/util/math_functions.hpp" namespace caffe { template <typename Dtype> void AbsValLayer<Dtype>::LayerSetUp(const vector<Blob<Dtype>*>& bottom, const vector<Blob<Dtype>*>& top) { NeuronLayer<Dtype>::LayerSetUp(bottom, top); CHECK_NE(to...
e1ae189d39d9ec300e668b70566ef2f54010d7a3f027f830ca227afdd6b74073
C++
1,347
45
/* * Copyright 2022 Google LLC. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
91f3480978056f5064f26fa8354ed11c051bdd56bb9578d489c4766857c8da7c
C++
1,352
45
#include <algorithm> #include <vector> #include "caffe/layers/relu_layer.hpp" namespace caffe { template <typename Dtype> void ReLULayer<Dtype>::Forward_cpu(const vector<Blob<Dtype>*>& bottom, const vector<Blob<Dtype>*>& top) { const Dtype* bottom_data = bottom[0]->cpu_data(); Dtype* top_data = top[0]->mutab...
bde85fb62a52ec5431e6f790eeb5136869f747f33e40793421819f5be7553ead
C++
1,361
44
/* * Copyright 2022 Google LLC. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
a138bff71e2570aed03676fa5efc64ce9d3dfb1c28707dd16e378c017ecde442
C++
1,365
37
/* * Copyright 2022 Google LLC. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in...
2bc4f0a7cbf3b1508d1e307d6d05fdc6bdef891ea714b5830c4cf67d12901b41
C++
1,367
45
#ifdef USE_CUDNN #include <vector> #include "caffe/layers/cudnn_relu_layer.hpp" namespace caffe { template <typename Dtype> void CuDNNReLULayer<Dtype>::LayerSetUp(const vector<Blob<Dtype>*>& bottom, const vector<Blob<Dtype>*>& top) { ReLULayer<Dtype>::LayerSetUp(bottom, top); // initialize cuDNN CUDNN_CH...
ceae709bfa48b140da3d5683b27c692724fb746e96d9491f81588170df9261ac
C++
1,367
45
#ifdef USE_CUDNN #include <vector> #include "caffe/layers/cudnn_tanh_layer.hpp" namespace caffe { template <typename Dtype> void CuDNNTanHLayer<Dtype>::LayerSetUp(const vector<Blob<Dtype>*>& bottom, const vector<Blob<Dtype>*>& top) { TanHLayer<Dtype>::LayerSetUp(bottom, top); // initialize cuDNN CUDNN_CH...
003861355e3c1cec97f2fa0734d3b1a32444d8646197c13d142d75f3886c600b
C++
1,390
52
/* * Medical Image Registration ToolKit (MIRTK) * * Copyright 2008-2016 Imperial College London * Copyright 2008-2015 Daniel Rueckert, Julia Schnabel * Copyright 2016 Andreas Schuh * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the ...