Commit f032adfa authored by luc.moulinier's avatar luc.moulinier

shufflelist

parent cef9ae41
......@@ -1091,10 +1091,10 @@ proc Cnp {n p} {
}
proc prmcnp {} {
proc prmcnp {n} {
set sum 0
for {set i 3} {$i < 32} {incr i} {
incr sum [Cnp 32 $i]
for {set i 3} {$i < $n} {incr i} {
incr sum [Cnp $n $i]
}
incr sum
......
......@@ -13578,3 +13578,26 @@ proc thom {} {
}
proc EnumerateCnp { list size } {
if { $size == 0 } {
return [list [list]]
}
set retval {}
for { set i 0 } { ($i + $size) <= [llength $list] } { incr i } {
set firstElement [lindex $list $i]
set remainingElements [lrange $list [expr { $i + 1 }] end]
foreach subset [EnumerateCnp $remainingElements [expr { $size - 1 }]] {
lappend retval [linsert $subset 0 $firstElement]
}
}
return $retval
}
proc tsubs {} {
for { set i 0 } { $i <= 4 } { incr i } {
set res [subsets2 {a b c d e f} $i]
puts "\ni= $i,Cnp= [Cnp 6 $i] n [llength $res]"
}
return
}
......@@ -1577,15 +1577,24 @@ proc read_Rsock {} {
}
proc RpipeClean {} {
Rpipe "rm(list = ls(all.names = T))"
Rpipe "gc()"
return
}
proc Rpipe {args} {
# Sur ena/machines labo ;
# module load R/R-3.4.4
# module load R/R-3.6.1
#
# faire un package require Rtcl quelque part
#::rtcl::eval -verbose $cmd
return [::rtcl::eval {*}$args]
}
proc Rpipe_tmp {Cmd} {
global SckR
......@@ -4856,3 +4865,8 @@ proc plist {liste format} {
}
# SLURM_ARRAY_TASK_ID
# est execute la ou il est lance
# cree un log pour chaque job
# sbatch -a 0-50 script
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment