Home My Page Projects Code Snippets Project Openings diderot

# SCM Repository

[diderot] Diff of /branches/charisee/src/compiler/ein/operators.sml
 [diderot] / branches / charisee / src / compiler / ein / operators.sml

# Diff of /branches/charisee/src/compiler/ein/operators.sml

revision 2427, Wed Sep 18 15:20:54 2013 UTC revision 2428, Wed Sep 18 18:04:04 2013 UTC
# Line 268  Line 268
268
269
270
fun createDels([],_)= []
|createDels(d::ds,dim)= [( E.C([dim]),E.V([d]))]@createDels(ds,dim)
271

fun createKRN(0,_,pairs)=[E.Probe(E.Field(0,E.V([0]),E.V([])),E.Pair pairs)]
| createKRN(dim,[E.V(deltas)],pairs)=
let
val n= length deltas -1
val dels=createDels(deltas,dim-1)
in
createKRN(dim-1,[E.V(deltas)],pos@pairs) @
[E.Probe(E.Kernel(dels),
E.Sub(E.Tensor(1,E.C([dim-1])),E.Value(n+dim))
)]
end
|createKRN(dim,[],pairs)= let
in
createKRN(dim-1,[],pos@pairs) @
[E.Probe(E.Kernel([]),E.Sub(E.Tensor(1,E.C([dim-1])),E.Value(dim-1))
)]
end

|createKRN _= ("Delta index is Incorrect"; [])

val j= createKRN(3,[E.V([0,1])],[])

(*
fun probeExpand(E.EIN{params, index, body})=(case body
of E.Probe(E.Conv(E.Field(id, shape, _),deltas), E.Tensor(tid,[dimI]))=>
val dimV=index[dimI]
(case dimV of E.IX(dim))
val body'='E.prod createKRN(dim, deltas,[])
|_=>"Incorrect Probe")
*)
272  (***************************Deleted Terms*********************************)  (***************************Deleted Terms*********************************)
273          (*          (*
274  val Curl3d=E.EIN{  val Curl3d=E.EIN{

Legend:
 Removed from v.2427 changed lines Added in v.2428