# ---------------------------------------------------------------------- # FindBounds proc FindBounds {varName lowerBoundName upperBoundName} { upvar $varName var upvar $lowerBoundName lowerBound upvar $upperBoundName upperBound foreach x $var { if {$x < $lowerBound} { set lowerBound $x } elseif {$x > $upperBound} { set upperBound $x } } } # FindBounds - end # ---------------------------------------------------------------------- if $argv { # usage examples set argv 0 console show set initial [clock milliseconds] set switchNumber 1 switch $switchNumber 1 { set filePath ./image/arquivoTeste.txt ;# 1 ms - 0.000000 3552.935059 } 2 { set filePath ./image/distCanaArAbertaAguaMB2016F5x5_GRR.txt ;# 1529 ms - 0.000000 22660.839844 } 3 { set filePath ./image/MCP_masc-dist-agua-aberta-cana_GRR.txt ;# 69203 ms - -9.999000000e+003 161935.890625 } set lowerBound 1000000 set upperBound -1000000 source LoadBigImage.tcl LoadBigImage $filePath data FindBounds data lowerBound upperBound set final [clock milliseconds] puts "processing time = [expr $final - $initial] ms" puts [list $lowerBound $upperBound] }