Search is not available for this dataset
repo stringlengths 2 152 ⌀ | file stringlengths 15 239 | code stringlengths 0 58.4M | file_length int64 0 58.4M | avg_line_length float64 0 1.81M | max_line_length int64 0 12.7M | extension_type stringclasses 364
values |
|---|---|---|---|---|---|---|
null | SymbolicPCC-main/src/pcc/utility/pcc_vivace_ucalc.h |
#ifndef _PCC_VIVACE_UCALC_H_
#define _PCC_VIVACE_UCALC_H_
#include "pcc_ucalc.h"
class PccVivaceUtilityCalculator : public PccUtilityCalculator {
public:
PccVivaceUtilityCalculator(PccEventLogger* log) {this->log = log;};
~PccVivaceUtilityCalculator() {};
float CalculateUtility(PccMonitorIntervalAnalys... | 448 | 23.944444 | 100 | h |
null | SymbolicPCC-main/udt-plugins/testing/loaded_agent.py | # Copyright 2019 Nathan Jay and Noga Rotman
#
# 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
#
# Unless required by applicable law or agreed ... | 3,586 | 34.166667 | 95 | py |
null | SymbolicPCC-main/udt-plugins/testing/loaded_client.py | # Copyright 2019 Nathan Jay and Noga Rotman
#
# 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
#
# Unless required by applicable law or agreed ... | 5,404 | 30.063218 | 86 | py |
null | SymbolicPCC-main/udt-plugins/testing/skeleton_client.py | # Copyright 2019 Nathan Jay and Noga Rotman
#
# 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
#
# Unless required by applicable law or agreed ... | 1,440 | 33.309524 | 74 | py |
null | SymbolicPCC-main/udt-plugins/training/shim.py | print("Beginning module import!")
import socket
class PccShimDriver():
flow_lookup = {}
def __init__(self, flow_id):
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.sock.connect(("localhost", 9787))
self.replay_rate = False
self.last_rate = None
... | 2,201 | 28.756757 | 71 | py |
null | SymbolicPCC-main/util/Readme.md | #Utilities
These utilities should be in the util directory:
##port.sh
This script ports UDT core into QUIC by evaluating the QUIC_PORT and QUIC_PORT_LOCAL defines in the code.
usage: ./port.sh . /path/to/chrome/src
##send_to_emulab.sh
This script sends the pccserver and pccclient from the src/app directory to a ... | 530 | 28.5 | 162 | md |
null | SymbolicPCC-main/util/port.sh | #!/bin/bash
sunifdef -DQUIC_PORT -DQUIC_PORT_LOCAL "$1/src/pcc/pcc_monitor_interval_queue.cpp" > "$2/pcc_monitor_interval_queue.cc"
sunifdef -DQUIC_PORT -DQUIC_PORT_LOCAL "$1/src/pcc/pcc_monitor_interval_queue.h" > "$2/pcc_monitor_interval_queue.h"
sunifdef -DQUIC_PORT -DQUIC_PORT_LOCAL "$1/src/pcc/pcc_sender.cpp" > "... | 423 | 59.571429 | 119 | sh |
afterglowpy | afterglowpy-master/.readthedocs.yaml | # .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/source/conf.py
# Build documentation with MkDocs
#mkdocs:
# configuration: mk... | 575 | 23 | 83 | yaml |
afterglowpy | afterglowpy-master/README.md | # Numeric GRB Afterglow models
A Python 3 module to calculate GRB afterglow light curves and spectra. Details of the methods can be found in [Ryan et al 2020](https://ui.adsabs.harvard.edu/abs/2020ApJ...896..166R/abstract). Builds on [van Eerten & MacFadyen 2010](https://arxiv.org/abs/1006.5125) and [van Eerten 2018](... | 5,018 | 49.19 | 466 | md |
afterglowpy | afterglowpy-master/setup.py | #!/usr/bin/env python3
import site
from setuptools import setup, Extension
import numpy as np
# import imp
# PEP 517 Workaround for edittable user installs
site.ENABLE_USER_SITE = True
# version = imp.load_source('afterglowpy.version', 'afterglowpy/version.py')
version = {}
with open("afterglowpy/version.py", "r") a... | 2,335 | 33.865672 | 78 | py |
afterglowpy | afterglowpy-master/.github/workflows/buildwheels.yml | name: Build wheels
on:
push:
branches:
- master
- dev
tags:
- v*
env:
CIBW_SKIP: cp2* pp*
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubun... | 1,862 | 23.84 | 86 | yml |
afterglowpy | afterglowpy-master/afterglowpy/__init__.py | #!/usr/bin/env python3
"""
===========
afterglowpy
===========
Top-level module for *afterglowpy*, computes light curves and spectra of
Gamma-ray burst (GRB) afterglows.
This module provides the primary user-facing functions provided by afterglowpy,
useful physical constants, and conversion factors. Internal computat... | 2,372 | 38.55 | 79 | py |
afterglowpy | afterglowpy-master/afterglowpy/cocoon.py | import math
import numpy as np
import scipy.integrate as integrate
from . import shock
from . import jet
c = 2.99792458e10
me = 9.1093897e-28
mp = 1.6726231e-24
h = 6.6260755e-27
hbar = 1.05457266e-27
ee = 4.803e-10
sigmaT = 6.65e-25
Msun = 1.98892e33
cgs2mJy = 1.0e26
mJy2cgs = 1.0e-26
deg2rad = np.pi/180.0
rad2deg =... | 3,074 | 24.413223 | 79 | py |
afterglowpy | afterglowpy-master/afterglowpy/flux.py | from . import cocoon
from . import jet
import numpy as np
import warnings
def fluxDensity(t, nu, *args, **kwargs):
"""
Compute the flux density F_nu of a GRB afterglow.
Utiliizes the single shell approximation described in Ryan et al 2020
to compute the synchrotron emission from the forward shoc... | 23,423 | 32.947826 | 79 | py |
afterglowpy | afterglowpy-master/afterglowpy/integrate.c | #include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include "integrate.h"
#define KMAX 20
#define MAX_GAUSS_N 10 //Largest number of Gauss Points used. 10 for the
//Gauss-Kronrod 21 quadrature (10 Gauss, 11 Kronrod)
static const double g4x[4] = {-0.86113631159405257522,
... | 45,162 | 27.620406 | 80 | c |
afterglowpy | afterglowpy-master/afterglowpy/integrate.h | #ifndef AFTERGLOWPY_INTEGRATE
#define AFTERGLOWPY_INTEGRATE
#include "interval.h"
/*
* Various routines for integrating 1D functions.
* trap() and simp() are fixed stencil implementations of the Trapezoid Rule
* and Simpson's Rule respectively.
*
* romb() is an adaptive Romberg integrator.
*
* trap_adapt... | 9,276 | 54.885542 | 80 | h |
afterglowpy | afterglowpy-master/afterglowpy/interval.c | #include <stdio.h>
#include <stdlib.h>
#include "interval.h"
/*
* Here are 3 helper structs for performing global adaptive integration.
* Each Mesh struct is a priority queue implemented with as a simple
* binary heap. Elements may be added, and the element with the worst error can
* be retrieved.
*
* Each mesh ... | 12,908 | 19.523052 | 79 | c |
afterglowpy | afterglowpy-master/afterglowpy/interval.h | #ifndef AFTERGLOWPY_INTERVAL
#define AFTERGLOWPY_INTERVAL
/*
* Here are 3 helper structs for performing global adaptive integration.
* Each Mesh struct is a priority queue implemented with as a simple
* binary heap. Elements may be added, and the element with the worst error can
* be retrieved.
*
* Each mesh is ... | 3,654 | 23.046053 | 79 | h |
afterglowpy | afterglowpy-master/afterglowpy/jetmodule.c | #include <Python.h>
#define NPY_NO_DEPRECATED_API NPY_1_11_API_VERSION
#include <numpy/arrayobject.h>
#include <time.h>
#include "offaxis_struct.h"
#define PROFILE
#define PROFILE1
#define PROFILE2
#define PROFILEOUTA
static const int jet_type_default = -1;
static const int spec_type_default = 0;
static const double ... | 38,495 | 31.241206 | 81 | c |
afterglowpy | afterglowpy-master/afterglowpy/offaxis_struct.h | #ifndef AFTERGLOWPY_STRUCT
#define AFTERGLOWPY_STRUCT
// offaxis.h
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include "integrate.h"
#define ERR_CHK_VOID(pars) if(pars->error){ return;}
#define ERR_CHK_INT(pars) if(pars->error){ return 0;}
#define ERR_CHK_DBL(pars) if(pars->error){ return 0.0;}
#define... | 11,405 | 37.147157 | 86 | h |
afterglowpy | afterglowpy-master/afterglowpy/offaxis_struct_funcs.c | #include <string.h>
#include "offaxis_struct.h"
#include "shockEvolution.h"
double dmin(const double a, const double b)
{
if(a <= b)
return a;
else
return b;
}
/////////////////////////////////////////////////////////////////////////
double f_E_tophat(double theta, void *params)
{
struct... | 79,229 | 31.875519 | 97 | c |
afterglowpy | afterglowpy-master/afterglowpy/shockEvolution.c | #include <stdio.h>
#include <math.h>
#include "offaxis_struct.h"
#include "shockEvolution.h"
double shockVel(double u)
{
return 4*u*sqrt((u*u+1) / (8*u*u+9));
}
double E_inj(double te, double L0, double q, double ts)
{
if(te < T0_inj)
return L0*te;
if (te > ts)
te = ts;
double E... | 16,115 | 24.7856 | 93 | c |
afterglowpy | afterglowpy-master/afterglowpy/shockEvolution.h | #ifndef AFTERGLOWPY_SHOCK
#define AFTERGLOWPY_SHOCK
static const double T0_inj = 1.0e3;
double shockVel(double u);
double E_inj(double te, double L0, double q, double ts);
double L_inj(double te, double L0, double q, double ts);
void shockInitDecel(double t0, double *R0, double *u0, void *argv);
void shockInitFind(d... | 834 | 40.75 | 79 | h |
afterglowpy | afterglowpy-master/afterglowpy/shockmodule.c | #include <Python.h>
#define NPY_NO_DEPRECATED_API NPY_1_11_API_VERSION
#include <numpy/arrayobject.h>
#include "shockEvolution.h"
static char shock_docstring[] =
"This module calculates evolution of relativistic shocks.";
static char shockEvolRK4_docstring[] =
"Evolve a spherical shock with RK4";
static char... | 6,487 | 26.146444 | 79 | c |
afterglowpy | afterglowpy-master/afterglowpy/version.py | #!/usr/bin/env python3
"""Version info"""
__short_version__ = '0.7'
__version__ = '0.7.3'
| 91 | 14.333333 | 25 | py |
afterglowpy | afterglowpy-master/docs/source/conf.py | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 2,177 | 33.03125 | 79 | py |
afterglowpy | afterglowpy-master/examples/plotLightCurve.py | import numpy as np
import matplotlib.pyplot as plt
import afterglowpy as grb
# For convenience, place arguments into a dict.
Z = {'jetType': grb.jet.TopHat, # Top-Hat jet
'specType': 0, # Basic Synchrotron Emission Spectrum
'thetaObs': 0.05, # Viewing angle in radians
'... | 1,556 | 27.833333 | 77 | py |
afterglowpy | afterglowpy-master/examples/plotMultibandLightCurve.py | import numpy as np
import matplotlib.pyplot as plt
import afterglowpy as grb
# Jet Parameters
Z = {'jetType': grb.jet.Gaussian, # Gaussian jet
'specType': 0, # Basic Synchrotron Emission Spectrum
'thetaObs': 0.3, # Viewing angle in radians
'E0': 1.0e53, # Isotr... | 1,610 | 27.263158 | 77 | py |
afterglowpy | afterglowpy-master/examples/plotMultibandLightCurveBatch.py | import numpy as np
import matplotlib.pyplot as plt
import afterglowpy as grb
# Jet Parameters
Z = {'jetType': grb.jet.Gaussian, # Gaussian jet
'specType': 0, # Basic Synchrotron Emission Spectrum
'thetaObs': 0.3, # Viewing angle in radians
'E0': 1.0e53, # Isotr... | 1,666 | 26.327869 | 77 | py |
afterglowpy | afterglowpy-master/examples/plotSpectrum.py | import numpy as np
import matplotlib.pyplot as plt
import afterglowpy as grb
Z = {'jetType': grb.jet.TopHat, # Top-Hat jet
'specType': 0, # Basic Synchrotron Emission Spectrum
'thetaObs': 0.05, # Viewing angle in radians
'E0': 1.0e53, # Isotropic-equivalent ene... | 1,465 | 28.32 | 77 | py |
afterglowpy | afterglowpy-master/test/__init__.py | 0 | 0 | 0 | py | |
afterglowpy | afterglowpy-master/test/test_flux.py | import unittest
import numpy as np
import afterglowpy.flux as flux
class TestFlux(unittest.TestCase):
def compareArrayEqualSingle(a1, a2):
return (a1 == a2).all()
def compareArrayTuple(self, func, argin, out):
res = func(*argin)
self.assertEqual(len(res), len(out))
for i, a ... | 20,114 | 39.718623 | 79 | py |
BRITS | BRITS-master/README.md | # Description
The source codes of RITS-I, RITS, BRITS-I, BRITS for health-care data imputation/classification
To run the code:
python main.py --epochs 1000 --batch_size 32 --model brist
# Data Format
In json folder, we provide the sample data (400 patients).
The data format is as follows:
* Each line in json/json i... | 1,372 | 36.108108 | 196 | md |
BRITS | BRITS-master/data_loader.py | import os
import time
import ujson as json
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
from torch.utils.data import Dataset, DataLoader
class MySet(Dataset):
def __init__(self):
super(MySet, self).__init__()
self.content = open('./json/json').readlines()
ind... | 2,247 | 33.060606 | 131 | py |
BRITS | BRITS-master/main.py | import copy
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.optim.lr_scheduler import StepLR
import numpy as np
import time
import utils
import models
import argparse
import data_loader
import pandas as pd
import ujson as json
from sklearn import metrics
fro... | 2,615 | 24.90099 | 141 | py |
BRITS | BRITS-master/utils.py | import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.autograd import Variable
import pandas as pd
def to_var(var):
if torch.is_tensor(var):
var = Variable(var)
if torch.cuda.is_available():
var = var.cuda()
return var
if... | 922 | 23.289474 | 78 | py |
BRITS | BRITS-master/models/__init__.py | import rits_i, brits_i, rits, brits
| 36 | 17.5 | 35 | py |
BRITS | BRITS-master/models/brits.py | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable
from torch.nn.parameter import Parameter
import math
import utils
import argparse
import data_loader
import rits
from sklearn import metrics
from ipdb import set_trace
SEQ_LEN = 36
RNN... | 2,096 | 23.103448 | 86 | py |
BRITS | BRITS-master/models/brits_i.py | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable
from torch.nn.parameter import Parameter
import math
import utils
import argparse
import data_loader
import rits_i
from sklearn import metrics
from ipdb import set_trace
SEQ_LEN = 36
R... | 2,102 | 23.172414 | 86 | py |
BRITS | BRITS-master/models/rits.py | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable
from torch.nn.parameter import Parameter
import math
import utils
import argparse
import data_loader
from ipdb import set_trace
from sklearn import metrics
SEQ_LEN = 49
RNN_HID_SIZE = 6... | 5,649 | 29.213904 | 116 | py |
BRITS | BRITS-master/models/rits_i.py | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable
from torch.nn.parameter import Parameter
import math
import utils
import argparse
import data_loader
from ipdb import set_trace
from sklearn import metrics
SEQ_LEN = 49
RNN_HID_SIZE = 6... | 3,862 | 27.19708 | 116 | py |
DYNACL | DYNACL-master/LPAFT.py | import torch.nn as nn
import torch
import argparse
from autoattack import AutoAttack
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
import torchvision.datasets as datasets
from torch.utils.data.sampler import SubsetRandomSampler
from utils import *
import torchvision.transforms as tran... | 19,028 | 34.701689 | 132 | py |
DYNACL | DYNACL-master/LPAFT_AFF.py | import torch.nn as nn
import torch
import argparse
from autoattack import AutoAttack
import numpy as np
import os
import time
import copy
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
import torchvision.datasets as datasets
from torch.utils.data.sampler import SubsetRandomSampler
# fr... | 20,752 | 34.904844 | 117 | py |
DYNACL | DYNACL-master/README.md | # [ICLR23] Rethinking the Effect of Data Augmentation in Adversarial Contrastive Learning
Authors: Rundong Luo*, Yifei Wang*, Yisen Wang from Peking University
*: Equal contribution
[Paper](https://openreview.net/forum?id=0qmwFNJyxCL¬eId=ZXhFXELOcQ)
## Introduction
Recent works have shown that self-supervised l... | 6,517 | 66.195876 | 1,179 | md |
DYNACL | DYNACL-master/assign_label.py |
import os
import numpy as np
from kmeans_pytorch import kmeans
import torch
import torchvision.datasets as datasets
import torchvision.transforms as transforms
import copy
import torch.nn as nn
import argparse
'''
Assign and store the pseudo labels according to the
features extracted by the normal route of the back... | 3,045 | 31.404255 | 97 | py |
DYNACL | DYNACL-master/test_AFF.py | import os
import argparse
import torch
import torch.nn.functional as F
import torchvision
import torch.optim as optim
from torchvision import datasets, transforms
from utils import pgd_attack, accuracy
import torch.nn as nn
from autoattack import AutoAttack
import torch.backends.cudnn as cudnn
from torch.autograd impor... | 14,182 | 37.645777 | 117 | py |
DYNACL | DYNACL-master/test_LF.py | import os
import argparse
import torch
import torch.nn.functional as F
import torchvision
import torch.optim as optim
from torchvision import datasets, transforms
from utils import pgd_attack
from autoattack import AutoAttack
import torch.backends.cudnn as cudnn
import time
from utils import AverageMeter, eval_adv_tes... | 13,807 | 39.492669 | 137 | py |
DYNACL | DYNACL-master/train_DynACL.py | import argparse
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
import torchvision.datasets as datasets
from torch.utils.data.sampler import SubsetRandomSampler
from utils import *
import torchvision.transforms as transforms
import torch.nn.functional as F
from torch import nn
import ti... | 17,496 | 34.928131 | 126 | py |
DYNACL | DYNACL-master/utils.py | import torch
import torch.nn as nn
import os
import time
import numpy as np
import random
import copy
from pdb import set_trace
from collections import OrderedDict
from torch.autograd import Variable
import torch.nn.functional as F
def normalize_fn(tensor, mean, std):
"""Differentiable version of torchvision.func... | 16,138 | 33.048523 | 151 | py |
DYNACL | DYNACL-master/data/dataset.py | from torchvision import transforms, datasets
from torch.utils.data import Dataset, DataLoader
from copy import deepcopy
import torch
from torchvision.datasets import CIFAR10, CIFAR100, STL10
from PIL import Image
import numpy as np
class CustomCIFAR10(CIFAR10):
def __init__(self, withLabel=False, labelSubSet=None,... | 4,189 | 31.734375 | 83 | py |
DYNACL | DYNACL-master/models/__init__.py | from . import resnet
__all__ = [
'resnet',
] | 49 | 9 | 20 | py |
DYNACL | DYNACL-master/models/resnet.py | import torch
import torch.nn as nn
from torch.hub import load_state_dict_from_url
from utils import NormalizeByChannelMeanStd
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
'resnet152', 'resnext50_32x4d', 'resnext101_32x8d',
'wide_resnet50_2', 'wide_resnet101_2']
model_u... | 14,896 | 36.523929 | 107 | py |
DYNACL | DYNACL-master/models/resnet_multi_bn.py | import torch
import torch.nn as nn
from torch.hub import load_state_dict_from_url
from utils import NormalizeByChannelMeanStd
from pdb import set_trace
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
'resnet152', 'resnext50_32x4d', 'resnext101_32x8d',
'wide_resnet50_2', 'wide_resnet101... | 17,173 | 31.465028 | 114 | py |
DYNACL | DYNACL-master/models/resnet_multi_bn_stl.py | import torch
import torch.nn as nn
from torch.hub import load_state_dict_from_url
from utils import NormalizeByChannelMeanStd
from pdb import set_trace
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
'resnet152', 'resnext50_32x4d', 'resnext101_32x8d',
'wide_resnet50_2', 'wide_resnet101... | 17,245 | 31.417293 | 114 | py |
DYNACL | DYNACL-master/models/resnet_stl.py | import torch
import torch.nn as nn
from torch.hub import load_state_dict_from_url
from utils import NormalizeByChannelMeanStd
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
'resnet152', 'resnext50_32x4d', 'resnext101_32x8d',
'wide_resnet50_2', 'wide_resnet101_2']
model_u... | 15,458 | 36.704878 | 107 | py |
DYNACL | DYNACL-master/models/utils.py | import torch
import torch.nn as nn
def normalize_fn(tensor, mean, std):
"""Differentiable version of torchvision.functional.normalize"""
# here we assume the color channel is in at dim=1
mean = mean[None, :, None, None]
std = std[None, :, None, None]
return tensor.sub(mean).div(std)
class Normal... | 873 | 30.214286 | 68 | py |
DYNACL | DYNACL-master/optimizer/lars.py | """ Layer-wise adaptive rate scaling for SGD in PyTorch! """
import torch
from torch.optim.optimizer import Optimizer, required
class LARS(Optimizer):
r"""Implements layer-wise adaptive rate scaling for SGD.
Args:
params (iterable): iterable of parameters to optimize or dicts defining
par... | 4,123 | 37.185185 | 113 | py |
FMM3D | FMM3D-master/.codepod.yml | image: "magland/codepod_gfortran"
tasks:
- command: pip install numpy
# - command: cd python && python setup.py develop && python test/test_hfmm.py
| 151 | 29.4 | 78 | yml |
FMM3D | FMM3D-master/.gitpod.yml | image: "magland/gitpod_gfortran"
tasks:
- command: cd python && python setup.py develop && python test/test_hfmm.py
| 118 | 28.75 | 77 | yml |
FMM3D | FMM3D-master/README.md | # Flatiron Institute Fast Multipole Libraries
[](https://github.com/flatironinstitute/FMM3D/actions)
This codebase is a set of libraries to compute N-body interactions
governed by the Laplace and Helmholtz equations, to a s... | 521 | 51.2 | 150 | md |
FMM3D | FMM3D-master/makefile | # Makefile for FMM3D
# # This is the only makefile; there are no makefiles in subdirectories.
# Users should not need to edit this makefile (doing so would make it
# hard to stay up to date with repo version). Rather in order to
# change OS/environment-specific compilers and flags, create
# the file make.inc, which ove... | 16,920 | 33.253036 | 207 | FMM3D-master/makefile |
FMM3D | FMM3D-master/.github/workflows/python.yml | name: Python Build
on:
push:
branches:
- master
tags:
- v*
- py_v*
pull_request:
branches:
- master
jobs:
Linux:
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux2014_x86_64:latest
steps:
- uses: actions/checkout@v3
- name: install gfortran-7
... | 8,385 | 35.146552 | 110 | yml |
FMM3D | FMM3D-master/.github/workflows/python_build_posix.sh | #!/bin/bash -e
# This is an auxiliary script to build wheels
PYTHON=$1
echo "PYTHON=$PYTHON" >> make.inc
$PYTHON -m pip install --upgrade setuptools wheel numpy pip
make python-dist FAST_KER=ON
| 195 | 27 | 59 | sh |
FMM3D | FMM3D-master/.github/workflows/python_test_posix.sh | #!/bin/bash -e
# This is an auxiliary script to test wheels
PYTHON=$1
$PYTHON -m pip install pytest
$PYTHON -m pip install fmm3dpy -f wheelhouse/ --no-index --no-cache
$PYTHON -m pytest -s python/test
| 201 | 27.857143 | 67 | sh |
FMM3D | FMM3D-master/c/README.md | This folder contains the header files for the c wrappers,
some utility files, and a few examples.
- The Helmholtz wrappers are contained in ``hfmm3d_c.h``
- The Laplace wrappers are contained in ``lfmm3d_c.h``
- The Helmholtz FMM example files are ``hfmm3d_example.c`` and
``hfmm3d_vec_example.c`` (for ... | 917 | 30.655172 | 72 | md |
FMM3D | FMM3D-master/c/cprini.c |
#include <string.h>
#include "cprini.h"
/*
*
***************************************************************************
*
* This is the end of the debugging code, and the beginning
* of the printing functions proper. The code below contains
* five user-callable functions: cprini, cprin, cprin2, ... | 7,785 | 17.806763 | 80 | c |
FMM3D | FMM3D-master/c/cprini.h |
#include <stdio.h>
void cprin_init(char *str1, char *str2);
void cprin_master(char *mes, float *ap, int *afp, double *adp, char *acp, int m,
int n, int itype, char *str17, char *str27, int i1, int i2);
void cprin_all(char *mes, float *ap, int *afp, double *adp, char *acp,
int m, in... | 649 | 23.074074 | 80 | h |
FMM3D | FMM3D-master/c/hfmm3d_c.h | #include "utils.h"
void hfmm3d_s_c_p_(double *eps, CPX *zk, int *nsource,
double *source, CPX *charge, CPX *pot, int *ier);
void hfmm3d_s_c_g_(double *eps, CPX *zk, int *nsource,
double *source, CPX *charge, CPX *pot, CPX *grad, int *ier);
void hfmm3d_s_d_p_(double *... | 7,773 | 35.669811 | 82 | h |
FMM3D | FMM3D-master/c/hfmm3d_example.c | #include "stdlib.h"
#include "stdio.h"
#include "math.h"
#include "hfmm3d_c.h"
#include "complex.h"
#include "cprini.h"
int main(int argc, char **argv)
{
cprin_init("stdout", "fort.13");
cprin_skipline(2);
int ns=2000;
int ier=0;
double *source = (double *)malloc(3*ns*sizeof(double));
CPX *charge = (CPX... | 991 | 18.84 | 65 | c |
FMM3D | FMM3D-master/c/hfmm3d_vec_example.c | #include "stdlib.h"
#include "stdio.h"
#include "math.h"
#include "hfmm3d_c.h"
#include "complex.h"
#include "cprini.h"
int main(int argc, char **argv)
{
cprin_init("stdout", "fort.13");
cprin_skipline(2);
int ns=2000;
int nt=1999;
int nd=5;
int ier=0;
double *source = (double *)malloc(3*ns*sizeof(doubl... | 1,455 | 21.75 | 67 | c |
FMM3D | FMM3D-master/c/lfmm3d_c.h | #include "utils.h"
void lfmm3d_s_c_p_(double *eps, int *nsource,
double *source, double *charge, double *pot, int *ier);
void lfmm3d_s_c_g_(double *eps, int *nsource,
double *source, double *charge, double *pot, double *grad, int *ier);
void lfmm3d_s_c_h_(double *eps,... | 12,636 | 39.764516 | 91 | h |
FMM3D | FMM3D-master/c/lfmm3d_example.c | #include "stdlib.h"
#include "stdio.h"
#include "math.h"
#include "lfmm3d_c.h"
#include "complex.h"
#include "cprini.h"
int main(int argc, char **argv)
{
cprin_init("stdout", "fort.13");
cprin_skipline(2);
int ns=2000;
int ier=0;
double *source = (double *)malloc(3*ns*sizeof(double));
double *charge = (... | 975 | 19.333333 | 62 | c |
FMM3D | FMM3D-master/c/lfmm3d_vec_example.c | #include "stdlib.h"
#include "stdio.h"
#include "math.h"
#include "lfmm3d_c.h"
#include "complex.h"
#include "cprini.h"
int main(int argc, char **argv)
{
cprin_init("stdout", "fort.13");
cprin_skipline(2);
int ns=2000;
int nt=1999;
int nd=5;
int ier=0;
double *source = (double *)malloc(3*ns*sizeof(doubl... | 1,410 | 21.396825 | 65 | c |
FMM3D | FMM3D-master/c/test_hfmm3d.c | #include "stdlib.h"
#include "stdio.h"
#include "math.h"
#include "hfmm3d_c.h"
#include "complex.h"
#include "cprini.h"
int main(int argc, char **argv)
{
cprin_init("stdout", "fort.13");
int ns=4000;
int nt=3999;
double *source = (double *)malloc(3*ns*sizeof(double));
double *targ = (double *)malloc(3*nt*siz... | 27,687 | 20.665102 | 95 | c |
FMM3D | FMM3D-master/c/test_lfmm3d.c | #include "stdlib.h"
#include "stdio.h"
#include "math.h"
#include "lfmm3d_c.h"
#include "complex.h"
#include "cprini.h"
int main(int argc, char **argv)
{
cprin_init("stdout", "fort.13");
int ns=4000;
int nt=3999;
double *source = (double *)malloc(3*ns*sizeof(double));
double *targ = (double *)malloc(3*nt*siz... | 43,553 | 21.791209 | 90 | c |
FMM3D | FMM3D-master/c/utils.c | #include "utils.h"
#include "math.h"
void dzero(int n, double *a)
{
for(int i=0; i<n;i=i+1)
{
a[i] = 0;
}
return;
}
void czero(int n, CPX *a)
{
for(int i=0; i<n;i=i+1)
{
a[i] = 0;
}
return;
}
void comp_err_lap(int n, int pg, int pgt, double *pot, double *potex, double *pottarg,
double... | 2,345 | 16.772727 | 93 | c |
FMM3D | FMM3D-master/c/utils.h | #ifndef UTILS_H
#define UTILS_H
#include <stdint.h>
#include <complex.h>
typedef double complex CPX;
#define rand01() ((double)rand()/RAND_MAX)
void dzero(int n, double *a);
void czero(int n, CPX *a);
void comp_err_helm(int n,int pg, int pgt, CPX *pot, CPX *potex, CPX *pottarg, CPX *pottargex,
CPX *grad,... | 683 | 30.090909 | 93 | h |
FMM3D | FMM3D-master/devel/code-generation/instructions.md | ## Code generation instructions
See the following example files in this directory
* jinjaroot.yaml -- Contains the data for all the laplace wrappers. In the future we could even auto-generate this file
* lfmm3dwrap.f.j2 -- Template file with jinja2 syntax (see: https://jinja.palletsprojects.com/en/3.0.x/templates/)
*... | 871 | 23.222222 | 119 | md |
FMM3D | FMM3D-master/devel/code-generation/jinjaroot.yaml | laplaceWrappers:
-
name: lfmm3d_s_c_p
evaluationPoints: Sources
interactionKernel: Charges
outputsRequested:
Potential: True
Gradient: False
Hessians: False
-
name: lfmm3d_s_c_g
evaluationPoints: Sources
interactionKernel: Charges
outputsRequested:
Potential: ... | 1,069 | 20.4 | 30 | yaml |
FMM3D | FMM3D-master/devel/code-generation/lfmm3dwrap.f | c This file contains the Laplace FMM wrappers
c
c The laplace FMM evaluates the following potential
c and its gradient
c
c u(x) = \sum_{j=1}^{N} c_{j}/|x-x_{j}| - v_{j}.\nabla (1/|x-x_{j}|)
c
c Here x_{j} are the source locations, c_{j} are the charge strengths,
c v_{j} are the dipole strengths. We refer t... | 63,996 | 25.532753 | 72 | f |
FMM3D | FMM3D-master/docs/conf.py | # -*- coding: utf-8 -*-
#
# fmm3d documentation build configuration file, created by
# sphinx-quickstart on Wed Nov 1 16:19:13 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All... | 10,426 | 32.744337 | 216 | py |
FMM3D | FMM3D-master/docs/genfortdocumentation_helm.py | from numpy import *
intro = "This subroutine evaluates the "
pgstr = ["potential ", "potential and its gradient "]
intro2 = "\n\n .. math::\n\n"
eq_start = "u(x) = "
eq_start2 = "\sum_{j=1}^{N} "
str1 = "c_{j} \\frac{e^{ik\|x- x_{j}\|}}{\|x-x_{j}\|}"
str2 = "v_{j} \cdot \\nabla \\left( \\frac{e^{ik\|x-x_{j}\|}}{\|x-... | 13,755 | 50.520599 | 140 | py |
FMM3D | FMM3D-master/docs/genfortdocumentation_lap.py | from numpy import *
intro = "This subroutine evaluates the "
pgstr = ["potential ", "potential and its gradient ","potential, its gradient and its hessian"]
intro2 = "\n\n .. math::\n\n"
eq_start = "u(x) = "
eq_start2 = "\sum_{j=1}^{N} "
str1 = "c_{j} \\frac{1}{\|x-x_{j}\|}"
str2 = "v_{j} \cdot \\nabla \\left( \\fra... | 15,083 | 51.193772 | 140 | py |
FMM3D | FMM3D-master/docs/genpdfmanual.sh | #!/bin/bash
# This makes the PDF manual then moves it and renames to the top directory.
# Barnett 12/6/17
make latexpdf
mv _build/latex/finufft.pdf ../finufft-manual.pdf
| 171 | 23.571429 | 75 | sh |
FMM3D | FMM3D-master/docs/page.html | {% extends "!page.html" %}
{% block footer %}
<script type="text/javascript">
$(document).ready(function() {
$(".toggle > *").hide();
$(".toggle .header").show();
$(".toggle .header").click(function() {
$(this).parent().children().not(".header").toggle(400);
$(this)... | 415 | 26.733333 | 69 | html |
FMM3D | FMM3D-master/docs/_static/custom.css | .center {text-align: center;}
.rttext {text-align: right;}
.hruleaft {display: block; border-bottom: 1px solid #000000;}
| 123 | 19.666667 | 61 | css |
FMM3D | FMM3D-master/docs/_templates/page.html | {% extends "!page.html" %}
{% block footer %}
<script type="text/javascript">
$(document).ready(function() {
$(".toggle > *").hide();
$(".toggle .header").show();
$(".toggle .header").click(function() {
$(this).parent().children().not(".header").toggle(400);
$(this)... | 415 | 26.733333 | 69 | html |
FMM3D | FMM3D-master/examples/README.md | This folder contains the examples for the Fortran wrappers.
- The Helmholtz FMM example files are ``hfmm3d_example.f``
``hfmm3d_vec_example.f`` (for vectorized routines), and
``hfmm3d_legacy_example.f`` (for the legacy routines).
To run these examples, run their corresponding makefiles,
``hfmm3d_example.... | 944 | 31.586207 | 72 | md |
FMM3D | FMM3D-master/examples/emfmm3d_example.f | implicit real *8 (a-h,o-z)
integer ns,nt
double complex zk
double precision, allocatable :: sources(:,:),targs(:,:)
double complex, allocatable :: h_current(:,:,:),e_charge(:,:)
double complex, allocatable :: e_current(:,:,:)
double complex, allocatable :: E(:,:,:),divE(:,:),cu... | 2,346 | 21.786408 | 69 | f |
FMM3D | FMM3D-master/examples/hfmm3d_example.f | implicit none
integer ns
double precision, allocatable :: source(:,:)
double complex, allocatable :: charge(:)
double complex, allocatable :: pot(:)
double complex, allocatable :: grad(:,:)
double precision eps
double complex eye,zk
integer i,j,k,ier
double p... | 1,630 | 18.416667 | 67 | f |
FMM3D | FMM3D-master/examples/hfmm3d_legacy_example.f | cc Copyright (C) 2009-2012: Leslie Greengard and Zydrunas Gimbutas
cc Contact: greengard@cims.nyu.edu
cc
cc This software is being released under a modified FreeBSD license
cc (see COPYING in home directory).
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c
c This is the third release... | 8,067 | 25.025806 | 76 | f |
FMM3D | FMM3D-master/examples/hfmm3d_memest_example.f | implicit real *8 (a-h,o-z)
double precision, allocatable :: source(:,:),targ(:,:)
double complex zk,ier
call prini(6,13)
ns = 100000
nt = 100000
allocate(source(3,ns),targ(3,nt))
eps = 0.51d-10
do i=1,ns
source(1,i) = hkrand(0)**2
source(2,i... | 825 | 18.209302 | 63 | f |
FMM3D | FMM3D-master/examples/hfmm3d_vec_example.f | implicit none
integer ns,nt,nd
double precision, allocatable :: source(:,:),targ(:,:)
double complex, allocatable :: charge(:,:),dipvec(:,:,:)
double complex, allocatable :: pot(:,:)
double complex, allocatable :: pottarg(:,:)
double precision eps
double complex eye,zk
... | 2,257 | 21.137255 | 70 | f |
FMM3D | FMM3D-master/examples/lfmm3d_debug1.f | implicit none
integer ns,nt
double precision, allocatable :: source(:,:)
double precision, allocatable :: targ(:,:)
double precision, allocatable :: charge(:)
double precision, allocatable :: pot(:),potex(:)
double precision, allocatable :: grad(:,:),gradex(:,:)
double pr... | 4,398 | 23.713483 | 67 | f |
FMM3D | FMM3D-master/examples/lfmm3d_example.f | implicit none
integer ns
double precision, allocatable :: source(:,:)
double precision, allocatable :: charge(:)
double precision, allocatable :: pot(:)
double precision, allocatable :: grad(:,:)
double precision, allocatable :: hess(:,:)
double precision eps
integ... | 1,827 | 19.539326 | 67 | f |
FMM3D | FMM3D-master/examples/lfmm3d_legacy_example.f | cc Copyright (C) 2009-2012: Leslie Greengard and Zydrunas Gimbutas
cc Contact: greengard@cims.nyu.edu
cc
cc This software is being released under a modified FreeBSD license
cc (see COPYING in home directory).
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
c
c This is the third release... | 7,645 | 25.006803 | 76 | f |
FMM3D | FMM3D-master/examples/lfmm3d_vec_example.f | implicit none
integer ns,nt,nd
double precision, allocatable :: source(:,:),targ(:,:)
double precision, allocatable :: charge(:,:),dipvec(:,:,:)
double precision, allocatable :: pot(:,:)
double precision, allocatable :: pottarg(:,:)
double precision eps
integer i,j,k,idi... | 2,000 | 20.287234 | 70 | f |
FMM3D | FMM3D-master/examples/stfmm3d_example.f | c
c TESTING SUITE FOR STOKES FMM: June 18th, 2020
c
c
c$ use omp_lib
implicit real *8 (a-h,o-z)
real *8, allocatable :: pot(:,:), pre(:), grad(:,:,:)
real *8, allocatable :: source(:,:), targ(:,:)
real *8, allocatable :: pottarg(:,:), pretarg(:), gradtarg(:,:,:)
real *8, ... | 2,077 | 22.885057 | 71 | f |
FMM3D | FMM3D-master/julia/README.md | # FMM3D.jl
FMM3D.jl is a set of julia interfaces for
computing N-body interactions using the
Flatiron Institute's `FMM3D` library.
## Using FMM3D.jl
For now, FMM3D.jl can be obtained by downloading this
git repository and a recent version of julia
(1.6 or later is required). Then, from the
root directory (the parent... | 1,603 | 29.264151 | 56 | md |
FMM3D | FMM3D-master/julia/examples/hfmm3dexample.jl | using FMM3D
using Random
using LinearAlgebra
# This is a sample code to demonstrate how to use
# the fmm libraries
#
# sample with one density, sources to sources,
# charge interactions, and potential only
#
n = 2000
nd = 1
sources = rand(3,n)
eps = 10.0^(-5)
zk = 1.1 + im*0
charges = rand(n) + im*rand(n)
vals = h... | 668 | 19.272727 | 50 | jl |