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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4459 - (download) (as text) (annotate)
Mon Aug 29 15:57:31 2016 UTC (2 years, 10 months ago) by cchiw
File size: 2718 byte(s)
add d-4 type
#include <math.h>
from constants import *
from obj_frame import *

cpath =  "/Users/chariseechiw/diderot/"

# want to make your own testing frame?
# go for it!
# options are commented out

name = "user-created frame"
# branch information
s_branch  = branch_vis15 #branch_ein16
s_revision = "current"
s_precision = precision_double  #precision_single
s_path = cpath # "--whatever the path to diderot is"
# order of coefficients
s_coeff_style = coeff_cubic # coeff_quadratic
# kernel
s_krn = h_hex #h_bs3
#s_krn = h_bs3
#s_krn = h_tent
#s_krn = h_tent
# types
#ty_F ="all fields"
#ty_T ="all tensors"
#ty_All ="mix of tensors and fields"
# what type of arguments do we want to test?
s_in_tys  = ty_All
#s_in_tys  = ty_F
#s_in_tys  = ty_T

# op1(t1) -> t2, what is the type of t2?
s_rst_ty  = ty_All  #ty_F #ty_T
#-------------- constants ----------------------
#coeff bounds
s_ucoeff_range = 5
#position bounds
s_lpos =  -0.4
s_upos = 0.4
# number of positions
s_num_pos = 7 #10
# number of samples
#s_samples = 30 #70
s_samples = 70
#--------------------------------------------------------------------------------

def mk_default(name, s_branch, s_coeff_style, s_path, s_samples, krn):
    s_precision = precision_double
    s_in_tys  = ty_All
    s_rst_ty  = ty_All
    s_samples = 70 #outSize
    s_num_pos = 7 # number of positions
    s_lpos =  -0.4
    s_upos = 0.4
    s_ucoeff_range = 5
    t_frame = frame(name, s_branch, "current", s_precision, s_path, s_coeff_style, s_in_tys, s_rst_ty, s_ucoeff_range, s_lpos, s_upos, s_num_pos, s_samples, krn)
    return t_frame

########## frames ######
t_new = frame(name, s_branch, s_revision, s_precision, s_path, s_coeff_style, s_in_tys, s_rst_ty, s_ucoeff_range, s_lpos, s_upos, s_num_pos, s_samples, s_krn)

t_vdefault = mk_default("default-vis", branch_vis15, coeff_quadratic, cpath, 70, h_hex)
t_vsmall_sample = mk_default("small sample", branch_vis15, coeff_quadratic, cpath, 30, h_hex)
t_vcubic = mk_default("cubic", branch_vis15 , coeff_cubic, cpath, 70, h_hex)
t_vkrn = mk_default("bspln3", branch_vis15, coeff_quadratic, cpath, 70, h_bs3)

t_edefault = mk_default("default-ein branch", branch_ein16 , coeff_quadratic, cpath, 70, h_hex)
t_esmall_sample = mk_default("small sample", branch_ein16, coeff_quadratic, cpath, 30, h_hex)
t_ecubic = mk_default("cubic", branch_ein16 , coeff_cubic, cpath, 70, h_hex)
t_ekrn = mk_default("default-ein branch", branch_ein16 , coeff_quadratic, cpath, 70, h_bs3)
frames = [t_new, t_vdefault,t_edefault, t_vsmall_sample, t_esmall_sample,t_vcubic, t_ecubic,t_vkrn, t_ekrn]
def get_testing_frame(n_frame):
    if(len(frames)< n_frame):
        raise Exception ("frame outside range")
    else:
        return frames[n_frame]

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