Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] View of /branches/ein16/synth/d2/set.py
ViewVC logotype

View of /branches/ein16/synth/d2/set.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4456 - (download) (as text) (annotate)
Thu Aug 25 04:03:27 2016 UTC (2 years, 6 months ago) by cchiw
File size: 1430 byte(s)
added missing cubic
#include <math.h>
import random

# change to hard-coded arguments
isVis15 = True
layer = 2
shift = 1

#-------------- constants ----------------------
#position bounds
lpos=  -0.4
upos= 0.4
num_pos = 7 # number of positions
#coeff bounds
lcoeff=-5
ucoeff=5
# number of samples
samples=30 #70


# name of programs and data
p_Observ="p_observ"                     # name of diderot program testing function created
output="data/output5_"+p_Observ         # name of output file with observed data
inputfile="data/inputfile"              # name of synthetic field created

# type of arguments (tensors, fields)
#args_types = 1 # FT args, T args
args_types = 3


coeff_cubic = "cubic"
coeff_quadratic ="quadratic"
coeff_style = coeff_cubic

#--------------------samples, positions --------------------
#outSize
def get_size(dim):
    return samples

# testing positions
def get_positions(dim):
    if(dim==1):
        posL=[]
        for s in range(num_pos):
            # random number for positions
            x=random.uniform(lpos, upos)
            posL.append(round(x ,2))
        return posL
    elif(dim==2 or dim==3):
        posL=[]
        for s in range(num_pos):
            pos=[]
            for i in range(dim):
                # random number for positions
                x=random.uniform(lpos, upos)
                pos.append(round(x ,2))
            posL.append(pos)
        return posL
    else:
       return [0]

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0