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

SCM Repository

[diderot] Diff of /trunk/src/compiler/fields/kernel.sml
ViewVC logotype

Diff of /trunk/src/compiler/fields/kernel.sml

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

revision 2355, Sun Apr 7 11:35:08 2013 UTC revision 2356, Sun Apr 7 14:45:25 2013 UTC
# Line 44  Line 44 
44      val ctmr : kernel           (* Catmull-Rom interpolation *)      val ctmr : kernel           (* Catmull-Rom interpolation *)
45      val bspln3 : kernel         (* cubic bspline reconstruction, doesn't interpolate *)      val bspln3 : kernel         (* cubic bspline reconstruction, doesn't interpolate *)
46      val bspln5 : kernel         (* quintic bspline reconstruction, doesn't interpolate *)      val bspln5 : kernel         (* quintic bspline reconstruction, doesn't interpolate *)
47        val c4hexic : kernel        (* C4 hexic kernel; doesn't interpolate *)
48    
49    end = struct    end = struct
50    
# Line 96  Line 97 
97    (* determine if a list of polynomials represents a continuous piece-wise polynomial *)    (* determine if a list of polynomials represents a continuous piece-wise polynomial *)
98      fun isContinuous polys = let      fun isContinuous polys = let
99            val s = List.length polys div 2            val s = List.length polys div 2
100            fun chk (i, y_i, []) = (R.zero = y_i)            fun chk (i, y_i, []) = R.isZero y_i
101              | chk (i, y_i, f_i::r) = let              | chk (i, y_i, f_i::r) = let
102                  val y = evaluate(f_i, i)                  val y = evaluate(f_i, i)
103                  in                  in
104                    (y_i = y) andalso chk(i+1, evaluate(f_i, i+1), r)                    R.same(y_i, y) andalso chk(i+1, evaluate(f_i, i+1), r)
105                  end                  end
106            in            in
107              chk (~s, R.zero, polys)              chk (~s, R.zero, polys)
# Line 177  Line 178 
178                  [r 2, r ~4, 5/2, ~1/2]  (*  1 .. 2 *)                  [r 2, r ~4, 5/2, ~1/2]  (*  1 .. 2 *)
179                ]                ]
180            }            }
181      val bspln3 : kernel = mkKernel{     (* cubic bspline reconstruction, doesn't interpolate *)      val bspln3 : kernel = mkKernel{     (* cubic bspline reconstruction; doesn't interpolate *)
182              name = "bspln3",              name = "bspln3",
183              support = 2,              support = 2,
184              segs = [              segs = [
# Line 187  Line 188 
188                  [ 4/3, r ~2, r 1,  ~1/6 ]       (*  1 .. 2 *)                  [ 4/3, r ~2, r 1,  ~1/6 ]       (*  1 .. 2 *)
189                ]                ]
190            }            }
191      val bspln5 : kernel = mkKernel{     (* quintic bspline reconstruction, doesn't interpolate *)      val bspln5 : kernel = mkKernel{     (* quintic bspline reconstruction; doesn't interpolate *)
192              name = "bspln5",              name = "bspln5",
193              support = 3,              support = 3,
194              segs = [              segs = [
# Line 199  Line 200 
200                  [ 81/40, ~27/8, 9/4, ~3/4, 1/8, ~1/120 ]        (*  2 .. 3 *)                  [ 81/40, ~27/8, 9/4, ~3/4, 1/8, ~1/120 ]        (*  2 .. 3 *)
201                ]                ]
202            }            }
203        val c4hexic : kernel = mkKernel{    (* C4 hexic kernel; doesn't interpolate *)
204                name = "c4hexic",
205                support = 3,
206                segs = [
207                    [ 1539/160, 189/8,  747/32,  r 12,  109/32,  61/120,  1/32 ],   (* -3 .. -2 *)
208                    [ 3/160,    ~35/8,  ~341/32, r ~10, ~147/32, ~25/24,  ~3/32 ],  (* -2 .. -1 *)
209                    [ 69/80,    r 0,    ~23/16,  r 0,   19/16,   7/12,    1/16 ],   (* -1 .. 0 *)
210                    [ 69/80,    r 0,    ~23/16,  r 0,   19/16,   ~7/12,   1/16 ],   (*  0 .. 1 *)
211                    [ 3/160,    35/8,   ~341/32, r 10,  ~147/32, 25/24,   ~3/32 ],  (*  1 .. 2 *)
212                    [ 1539/160, ~189/8, 747/32,  r ~12, 109/32,  ~61/120, 1/32 ]    (*  2 .. 3 *)
213                  ]
214              }
215      end      end
216    
217    end    end

Legend:
Removed from v.2355  
changed lines
  Added in v.2356

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