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

SCM Repository

[diderot] Diff of /branches/ein16/synth/d2/test_compare.py
ViewVC logotype

Diff of /branches/ein16/synth/d2/test_compare.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3874, Wed May 18 16:45:54 2016 UTC revision 3915, Fri May 27 21:32:46 2016 UTC
# Line 1  Line 1 
 from test_examples import value_scalarT  
 from test_examples import value_vec2T  
 from test_examples import value_mat2x2T  
   
1  #needs output tensor types  #needs output tensor types
2  ty_scalarT = value_scalarT()  from obj_ty import *
3  ty_vec2T = value_vec2T()  from obj_operator import *
 ty_mat2x2T=value_mat2x2T()  
4    
5  #difference and error between observed data and correct data  #difference and error between observed data and correct data
6  #output is length 1  #output is length 1
# Line 112  Line 107 
107    
108    
109  #chose function based on length of output  #chose function based on length of output
110  def compare(ex_otype, obv, cor):  def compare(app, obv, cor):
111      if(ex_otype==ty_scalarT):      ex_otype=app.oty
112        if(ty_scalarT==ex_otype):
113          return checkdiff_1(obv, cor)          return checkdiff_1(obv, cor)
114      elif(ex_otype==ty_vec2T):      elif(ty_vec2T==ex_otype):
115          return checkdiff_2(obv, cor)          return checkdiff_2(obv, cor)
116      elif(ex_otype==ty_mat2x2T):      elif(ty_mat2x2T==ex_otype):
117          return checkdiff_4(obv, cor)          return checkdiff_4(obv, cor)
118      else:      else:
119          raise Exception("return value  more than 2 or less than 1 not supported")          raise Exception("return value  more than 2 or less than 1 not supported")

Legend:
Removed from v.3874  
changed lines
  Added in v.3915

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