Tcl Library Source Code

Check-in [61f5d52a95]
Login

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

Overview
Comment:Fixed a typo in permutations proc.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk | main
Files: files | file ages | folders
SHA3-256: 61f5d52a951e578e391ac7712bdda1ea1b43d454c84e078676cd63f3428f44f5
User & Date: arjenmarkus 2025-02-09 15:47:55.508
Context
2025-06-10
01:34
Fix [e5f3dfc055c]: Tcllib 2.0 installer fails with default Tcl build Leaf check-in: 20d3697afb user: culler tags: trunk, main
2025-06-09
02:45
fix [e5f3dfc055c]: Tcllib 2.0 installer fails with default Tcl build check-in: 4e7d192896 user: culler tags: bug-e5f3dfc055c
2025-02-09
15:47
Fixed a typo in permutations proc. check-in: 61f5d52a95 user: arjenmarkus tags: trunk, main
2025-01-15
19:49
fix: ticket b01462dff7, integrated from branch. version bumped. testsuite extended. doc regenerated. check-in: 870b1002a4 user: aku tags: trunk, main
Changes
Unified Diff Ignore Whitespace Patch
Changes to modules/math/ChangeLog.



1
2
3
4
5
6
7



2025-01-04  Arjen Markus <[email protected]>
        * filtergen.tcl: Replace the existing implementation by one based on an MIT license, add Chebyshev filters
        * filtergen.man: Document the new Chebyshev filters
        * filtergen.test: Added tests for the Chebyshev filters

2024-11-19  Arjen Markus <[email protected]>
        * statistics.tcl: Check if the x and y values for the linear model show variation
>
>
>







1
2
3
4
5
6
7
8
9
10
2025-02-09  Arjen Markus <[email protected]>
        * combinatoricsExt.tcl: Fix a typo (ticket e99fe133e61b7868a4c2f7d9c2e6cb2f164a7246)

2025-01-04  Arjen Markus <[email protected]>
        * filtergen.tcl: Replace the existing implementation by one based on an MIT license, add Chebyshev filters
        * filtergen.man: Document the new Chebyshev filters
        * filtergen.test: Added tests for the Chebyshev filters

2024-11-19  Arjen Markus <[email protected]>
        * statistics.tcl: Check if the x and y values for the linear model show variation
Changes to modules/math/combinatoricsExt.tcl.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# combinatoricsExt.tcl --
#     Procedures for combinatorial functions and generating combinatorial collections
#
#     Note:
#     The older procedures factorial and choose assume Tcl 8.0, so no large integer support
#     The versions in this package, permutations and combinations, depend on Tcl 8.6 and later
#     for the large integer support and for TclOO.
#
#     Several parts based on: https://wiki.tcl-lang.org/page/Permutations and other Wiki pages
#
package require Tcl 8.6 9
package require TclOO
package provide math::combinatorics 2.1

# ::math::combinatorics --
#     Encompassing namespace and auxiliary variables
#
namespace eval ::math::combinatorics {
    variable factorial
    variable partition












|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# combinatoricsExt.tcl --
#     Procedures for combinatorial functions and generating combinatorial collections
#
#     Note:
#     The older procedures factorial and choose assume Tcl 8.0, so no large integer support
#     The versions in this package, permutations and combinations, depend on Tcl 8.6 and later
#     for the large integer support and for TclOO.
#
#     Several parts based on: https://wiki.tcl-lang.org/page/Permutations and other Wiki pages
#
package require Tcl 8.6 9
package require TclOO
package provide math::combinatorics 2.1.1

# ::math::combinatorics --
#     Encompassing namespace and auxiliary variables
#
namespace eval ::math::combinatorics {
    variable factorial
    variable partition
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
        return 1
    }

    if { $n < [llength $factorial] } {
        return [lindex $factorial $n]
    }

    set newfactorial [lindex $$factorial end]

    for {set k [llength $factorial]} { $k <= $n} {incr k} {
        set newfactorial [expr {$newfactorial * $k}]
        lappend factorial $newfactorial
    }

    return $newfactorial







|







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
        return 1
    }

    if { $n < [llength $factorial] } {
        return [lindex $factorial $n]
    }

    set newfactorial [lindex $factorial end]

    for {set k [llength $factorial]} { $k <= $n} {incr k} {
        set newfactorial [expr {$newfactorial * $k}]
        lappend factorial $newfactorial
    }

    return $newfactorial
Changes to modules/math/pkgIndex.tcl.
28
29
30
31
32
33
34
35
if {![package vsatisfies [package require Tcl] 8.6 9]} {return}
package ifneeded math::exact             1.0.2 [list source [file join $dir exact.tcl]]
package ifneeded math::PCA               1.1   [list source [file join $dir pca.tcl]]
package ifneeded math::figurate          1.1   [list source [file join $dir figurate.tcl]]
package ifneeded math::filters           0.3   [list source [file join $dir filtergen.tcl]]
package ifneeded math::probopt           1.1   [list source [file join $dir probopt.tcl]]
package ifneeded math::changepoint       0.2   [list source [file join $dir changepoint.tcl]]
package ifneeded math::combinatorics     2.1   [list source [file join $dir combinatoricsExt.tcl]]







|
28
29
30
31
32
33
34
35
if {![package vsatisfies [package require Tcl] 8.6 9]} {return}
package ifneeded math::exact             1.0.2 [list source [file join $dir exact.tcl]]
package ifneeded math::PCA               1.1   [list source [file join $dir pca.tcl]]
package ifneeded math::figurate          1.1   [list source [file join $dir figurate.tcl]]
package ifneeded math::filters           0.3   [list source [file join $dir filtergen.tcl]]
package ifneeded math::probopt           1.1   [list source [file join $dir probopt.tcl]]
package ifneeded math::changepoint       0.2   [list source [file join $dir changepoint.tcl]]
package ifneeded math::combinatorics     2.1.1 [list source [file join $dir combinatoricsExt.tcl]]