Tcl Library Source Code

Check-in [dfdc7799cc]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Re-join split trunk
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: dfdc7799cce1c9dada7fe7dcbfbdc0f1343a870e
User & Date: andreask 2014-01-06 18:23:27
Context
2014-01-06
23:44
See ticket [6efa4f571af052]. Reworked the Json/C code to use a bison-pased parser provided by Mikhail. No separate data structures to convert, just direct generation of Tcl structures. Changes compared to the original submission: - Use List, not Dict operations for objects, i.e. be Tcl 8.4 compatible. - Do not generate Int/Double objects, only strings. Conversion to actual int is lazy, when actually needed. Also ensures that compile-time Tcl version does not restrict range of integers, only runtime Tcl version. - Allow all values as toplevel json, not just array and object. - Currently no shared objects for the fixed values (null, true, false). Note that the RE-based json validation is still faster on even moderatly sized strings, even when just using a stripped C lexer not generating token values. Bumped jsonc to version 1.1 and tcllibc to version 0.3.12. check-in: 11390a7baa user: andreask tags: trunk
18:23
Re-join split trunk check-in: dfdc7799cc user: andreask tags: trunk
2013-12-20
12:31
Added special case for coincident points in spatial interpolation check-in: de82c45509 user: markus tags: trunk
2013-12-18
18:00
Regenerated embedded documentation. check-in: 6ac9af25d2 user: aku tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to modules/math/ChangeLog.





1
2
3
4
5
6
7



2013-12-17  Andreas Kupries  <[email protected]>

	* decimal.man: Fixed missing requirement of the package
	* machineparameters.man: itself.

2013-11-03  Arjen Markus <[email protected]>

>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
2013-12-20  Arjen Markus <[email protected]>
	* interpolate.tcl: [Ticket 843c2257d2] Added special case for points coincident with the data points
	* interpolate.test: [Ticket 843c2257d2] Added test case for coincident points

2013-12-17  Andreas Kupries  <[email protected]>

	* decimal.man: Fixed missing requirement of the package
	* machineparameters.man: itself.

2013-11-03  Arjen Markus <[email protected]>

Changes to modules/math/interpolate.tcl.

377
378
379
380
381
382
383











384
385
386
387
388
389
390
   }

   foreach point $xyvalues {
      set dist 0.0
      foreach c [lrange $point 0 end-1] cc $coord {
         set dist [expr {$dist+($c-$cc)*($c-$cc)}]
      }











      if { $max_radius2 == {} || $dist <= $max_radius2 } {
         if { $inv_dist_pow == 1 } {
            set dist [expr {sqrt($dist)}]
         }
         set total_weight [expr {$total_weight+1.0/$dist}]

         set idx 0






>
>
>
>
>
>
>
>
>
>
>







377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
   }

   foreach point $xyvalues {
      set dist 0.0
      foreach c [lrange $point 0 end-1] cc $coord {
         set dist [expr {$dist+($c-$cc)*($c-$cc)}]
      }

      #
      # Take care of coincident points
      #
      if { $dist == 0.0 } {
          return [lindex $point end]
      }

      #
      # The general case
      #
      if { $max_radius2 == {} || $dist <= $max_radius2 } {
         if { $inv_dist_pow == 1 } {
            set dist [expr {sqrt($dist)}]
         }
         set total_weight [expr {$total_weight+1.0/$dist}]

         set idx 0

Changes to modules/math/interpolate.test.

208
209
210
211
212
213
214












215
216
217
218
219
220
221
            [::math::interpolate::interp-spatial $xyzvalues $coord]]
   }
   set result
} -result { 0.0       0.0
            0.0       0.0
            1.2      -0.6
            0.039996 -0.019998 }













#
# Test TODO: parameters for spatial interpolation
#

test interpolate-5.1 "neville algorithm" \
    -body {






>
>
>
>
>
>
>
>
>
>
>
>







208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
            [::math::interpolate::interp-spatial $xyzvalues $coord]]
   }
   set result
} -result { 0.0       0.0
            0.0       0.0
            1.2      -0.6
            0.039996 -0.019998 }

test "Interpolate-4.3" "Spatial interpolation - 3 - coincident points" \
   -match numbers -body {
   set result {}

   set xyzvalues { {-1.0 0.0 { -2.0  1.0 } }
                   { 1.0 0.0 {  2.0 -1.0 } } }
   set coord {-1.0 0.0}
      set result [::math::interpolate::interp-spatial $xyzvalues $coord]

   set result
} -result { -2.0 1.0 }

#
# Test TODO: parameters for spatial interpolation
#

test interpolate-5.1 "neville algorithm" \
    -body {

Changes to modules/tcllibc.tcl.

1
2
3
4
5
6
7
8
9
10
11
12
# Umbrella, i.e. Bundle, to put all of the critcl modules which are
# found in Tcllib in one shared library.

package require critcl
package provide tcllibc 0.3.11

namespace eval ::tcllib {
    variable tcllibc_rcsid {$Id: tcllibc.tcl,v 1.13 2010/05/25 19:26:17 andreas_kupries Exp $}
    critcl::ccode {
        /* no code required in this file */
    }
}



|







1
2
3
4
5
6
7
8
9
10
11
12
# Umbrella, i.e. Bundle, to put all of the critcl modules which are
# found in Tcllib in one shared library.

package require critcl
package provide tcllibc 0.3.11.1

namespace eval ::tcllib {
    variable tcllibc_rcsid {$Id: tcllibc.tcl,v 1.13 2010/05/25 19:26:17 andreas_kupries Exp $}
    critcl::ccode {
        /* no code required in this file */
    }
}