|
From: <arj...@us...> - 2008-08-30 07:00:23
|
Revision: 8722
http://plplot.svn.sourceforge.net/plplot/?rev=8722&view=rev
Author: arjenmarkus
Date: 2008-08-30 07:00:32 +0000 (Sat, 30 Aug 2008)
Log Message:
-----------
Initial commit for example x20 (almost working - calls to plimagefr need correction).
Various corrections in example x21, still needs work
Modified Paths:
--------------
trunk/examples/tcl/x21.tcl
Added Paths:
-----------
trunk/examples/tcl/x20
trunk/examples/tcl/x20.tcl
Added: trunk/examples/tcl/x20
===================================================================
--- trunk/examples/tcl/x20 (rev 0)
+++ trunk/examples/tcl/x20 2008-08-30 07:00:32 UTC (rev 8722)
@@ -0,0 +1,19 @@
+#!/bin/sh
+#--------------------------------*- Tcl -*------------------------------------#
+# $Id$
+#
+# Maurice LeBrun
+# 12/24/02
+#
+# A front-end to x06.tcl for running directly from the command line, locating
+# pltcl via PATH.
+# Handles all usual plplot command arguments. See "pltcl -h" for info.
+#-----------------------------------------------------------------------------#
+#\
+exec pltcl -f "$0" ${1+"$@"}
+
+source x20.tcl
+
+plinit
+x20
+plend
Property changes on: trunk/examples/tcl/x20
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Added: trunk/examples/tcl/x20.tcl
===================================================================
--- trunk/examples/tcl/x20.tcl (rev 0)
+++ trunk/examples/tcl/x20.tcl 2008-08-30 07:00:32 UTC (rev 8722)
@@ -0,0 +1,548 @@
+# $Id$
+#
+# Copyright (C) 2004 Alan W. Irwin
+# Copyright (C) 2008 Arjen Markus
+#
+#
+# This file is part of PLplot.
+#
+# PLplot is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Library Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# PLplot is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with PLplot; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+#
+# plimage demo
+#
+#
+
+#static PLOptionTable options[] = {
+#{
+# "dbg", /* extra debugging plot */
+# NULL,
+# NULL,
+# &dbg,
+# PL_OPT_BOOL,
+# "-dbg",
+# "Extra debugging plot" },
+#{
+# "nosombrero", /* Turns on test of xor function */
+# NULL,
+# NULL,
+# &nosombrero,
+# PL_OPT_BOOL,
+# "-nosombrero",
+# "No sombrero plot" },
+#{
+# "nointeractive", /* Turns on test of xor function */
+# NULL,
+# NULL,
+# &nointeractive,
+# PL_OPT_BOOL,
+# "-nointeractive",
+# "No interactive selection" },
+#{
+# "save", /* For saving in postscript */
+# NULL,
+# NULL,
+# &f_name,
+# PL_OPT_STRING,
+# "-save filename",
+# "Save sombrero plot in color postscript `filename'" },
+#{
+# NULL, /* option */
+# NULL, /* handler */
+# NULL, /* client data */
+# NULL, /* address of variable to set */
+# 0, /* mode flag */
+# NULL, /* short syntax */
+# NULL } /* long syntax */
+#};
+
+proc x20 {{w loopback}} {
+
+ set PI [expr {4.0*atan(1.0)}]
+
+ set XDIM 260
+ set YDIM 220
+
+ matrix x f $XDIM
+ matrix y f $YDIM
+ matrix z f $XDIM $YDIM
+ matrix r f $XDIM $YDIM
+
+#
+# Bugs in plimage():
+# -at high magnifications, the left and right edge are ragged, try
+# ./x20c -dev xwin -wplt 0.3,0.3,0.6,0.6 -ori 0.5
+#
+# Bugs in x20c.c:
+# -if the window is resized after a selection is made on 'lena', when
+# making a new selection the old one will re-appear.
+#
+#
+# Parse and process command line arguments
+#
+# $w cmd plMergeOpts options "x20c options" NULL
+
+ set dbg 0
+ set nosombrero 0
+ set nointeractive 0
+ set f_name ""
+
+ set XDIMM1 [expr {$XDIM-1}]
+ set YDIMM1 [expr {$YDIM-1}]
+
+# View image border pixels
+ if { $dbg} {
+ $w cmd plenv 1. $XDIM 1. $YDIM 1 1
+
+ for { set i 0 } { $i < $YDIM } { incr i } {
+ for { set j 0 } { $j < $YDIM } { incr j } {
+ z $i $j = 0.0
+ }
+ }
+
+# Build a one pixel square border, for diagnostics
+
+ for { set i 0 } { $i <$XDIM } { incr i } {
+# Right
+ z $i $YDIMM1 = 1.0
+# Left
+ z $i 0 = 1.0
+ }
+
+ for { set i 0 } { $i <$YDIM } { incr i } {
+# Top
+ z 0 $i = 1.0
+# Bottom
+ z $XDIMM1 $i = 1.0
+ }
+
+ $w cmd pllab "...around a blue square."" " \
+ "A red border should appear...")
+
+ $w cmd plimage z 1. $XDIM 1. $YDIM 0. 0. 1. $XDIM 1.$YDIM
+
+ $w cmd pladv 0
+ }
+
+# Sombrero-like demo
+ if { ! $nosombrero } {
+# draw a yellow plot box, useful for diagnostics# :(
+ $w cmd plcol0 2
+ $w cmd plenv 0. [expr {2.*$PI}] 0.0 [expr {3.*$PI}] 1 -1
+
+ for { set i 0 } { $i < $XDIM } { incr i } {
+ x $i = [expr {double($i)*2.*$PI/double($XDIMM1)}]
+ }
+ for { set i 0 } { $i < $YDIM } { incr i } {
+ y $i = [expr {double($i)*3.*$PI/double($YDIMM1)}]
+ }
+
+ for { set i 0 } { $i < $XDIM } { incr i } {
+ for { set j 0 } { $j < $YDIM } { incr j } {
+ set xx [x $i]
+ set yy [y $j]
+ r $i $j = [expr {sqrt($xx*$xx+$yy*$yy)+0.001}]
+ set rr [r $i $j]
+ z $i $j = [expr {sin($rr) / $rr}]
+ }
+ }
+
+ $w cmd pllab "No an amplitude clipped \"sombrero\"" "" "Saturn?"
+ $w cmd plptex 2. 2. 3. 4. 0. "Transparent image"
+ $w cmd plimage z 0. [expr {2.*$PI}] 0.0 [expr {3.*$PI}] \
+ 0.05 1. 0. [expr {2.*$PI}] 0. [expr {3.*$PI}]
+
+# Save the plot
+ if { $f_name != "" } {
+ save_plot $w $f_name
+ }
+
+ $w cmd pladv 0
+ }
+
+#
+# Read Lena image
+# Note we try two different locations to cover the case where this
+# examples is being run from the test_c.sh script
+#
+ if { ![read_img "lena.pgm" img_f width height num_col] } {
+ if { ![read_img "../lena.pgm" img_f width height num_col] } {
+#C $w cmd plabort "No such file"
+ puts "Image could not be read"
+ $w cmd plend
+ exit
+ }
+ }
+
+# Set gray colormap
+ gray_cmap $w $num_col
+
+# Display Lena
+ $w cmd plenv 1. $width 1. $height 1 -1
+
+ if { !$nointeractive } {
+ $w cmd pllab "Set and drag Button 1 to re set selection Button 2 to finish." \
+ "" "Lena..."
+ } else {
+ $w cmd pllab """ ""Lena..."
+ }
+
+ $w cmd plimage img_f 1. $width 1. $height 0. 0. 1. $width 1. $height
+
+# Selection/expansion demo
+ if { !$nointeractive } {
+ set xi 200.0
+ set xe 330.0
+ set yi 280.0
+ set ye 220.0
+
+ if { [get_clip $w $xi $xe $yi $ye] } {
+ $w cmd plend
+ $w cmd exit 0
+ }
+
+#
+# I'm unable to continue, clearing the plot and advancing to the next
+# one, without hiting the enter key, or pressing the button... help#
+# Forcing the xwin driver to leave locate mode and destroying the
+# xhairs in GetCursorCmd solves some problems but I still have
+# to press the enter key or press Button-2 to go to next plot, even
+# if a pladv() is not present# Using plbop() solves the problem, but
+# it shouldn't be needed#
+#
+# plspause(0), pladv(0), plspause(1), also works,
+# but the above question remains.
+# With this approach, the previous pause state is lost,
+# as there is no API $w cmd to get its current state.
+#
+
+ $w cmd plspause 0
+ $w cmd pladv 0
+
+# Display selection only
+ $w cmd plimage img_f 1. $width 1. $height 0. 0. $xi $xe $ye $yi
+
+ $w cmd plspause 1
+ $w cmd pladv 0
+
+# Zoom in selection
+ $w cmd plenv $xi $xe $ye $yi 1 -1
+ $w cmd plimage img_f 1. $width 1. $height 0. 0. $xi $xe $ye $yi
+ $w cmd pladv 0
+ }
+
+# Base the dynamic range on the image contents.
+
+ a2mnmx img_f $width $height img_min img_max
+
+ $w cmd plcol 2
+ $w cmd plenv 0. $width 0. $height 1 -1
+ $w cmd pllab "" "" "Reduced dynamic range image example"
+ $w cmd plimagefr img_f 0. $width 0. $height 0. 0. \
+ [expr {$img_min + $img_max * 0.25}] \
+ [expr {$img_max - $img_max * 0.25}]
+
+# Draw a distorted version of the original image, showing its
+# full dynamic range.
+ $w cmd plenv 0. $width 0. $height 1 -1
+ $w cmd pllab "" "" "Distorted image example"
+
+# Populate the 2-d grids used for the distortion
+# NB grids must be 1 larger in each dimension than the image
+# since the coordinates are for the corner of each pixel.
+
+ set widthp1 [expr {$width+1}]
+ set heightp1 [expr {$height+1}]
+ matrix xg f $withp1 $heightp1
+ matrix yg f $withp1 $heightp1
+
+ set x0 [expr {0.5*$width}]
+ set y0 [expr {0.5*$height}]
+ set dy [expr {0.5*$height}]
+ set stretch 0.5
+ for { set i 0 } { $i < $widthp1 } { incr i } {
+ for { set j 0 } { $j < $widthp1 } { incr j } {
+ xg $i $j = [expr {$x0 + ($x0-double($i))*(1.0 - $stretch *
+ cos((double($j)-$y0)/$dy*$PI*0.5))}]
+ yg $i $j = $j
+ }
+ }
+ $w cmd plimagefr img_f 0. $width_r 0. $height_r 0. 0. $img_min \
+ $img_max xg yg
+ $w cmd pladv 0
+
+ $w cmd plend
+ $w cmd exit 0
+}
+
+# -------------------------------------------
+# Read image from file in binary ppm format
+proc read_img {fname img_f_name width_name height_name num_col_name} {
+ upvar 1 $img_f_name img_f
+ upvar 1 $width_name width
+ upvar 1 $height_name height
+ upvar 1 $num_col_name num_col
+
+# Naive grayscale binary ppm reading. If you know how to, improve it
+
+ if { [catch {
+ set infile [open $fname r]
+ }] } {
+ return 0 ;# File does not exist
+ }
+
+ if { [catch {
+# I only understand "P5"#
+ set ver [gets $infile]
+ if { $ver != "P5" } {
+ return 0
+ }
+
+ while {1} {
+ set ver [gets $infile]
+
+ if { [string index $ver 0] != "#" } {
+ break
+ }
+ }
+
+# Found the line with the sizes
+
+ scan $ver "%d %d" w h
+
+ set ver [gets $infile]
+ scan $ver "%d" num_col
+
+ matrix img_f f $w $h
+
+#
+# Read the second part - it becomes binary
+#
+ fconfigure $infile -translation binary
+
+ set picture [read $infile]
+ close $infile
+
+#
+# The picture needs to be flipped vertically.
+# So do that rightaway
+#
+#
+ set count 0
+ for { set j 0 } { $j < $h } { incr j } {
+ for { set i 0 } { $i < $w } { incr i } {
+
+ binary scan [string index $picture $count] c value
+ if { $value < 0 } {
+ set value [expr {256+$value}]
+ }
+ img_f $i [expr {$h-$j-1}] = $value
+ incr count
+ }
+ }
+
+ set width $w
+ set height $h
+ } msg] } {
+ # Some error occurred
+ puts "Error reading picture file: $msg"
+ return 0
+ } else {
+ return 1
+ }
+}
+
+# Save plot
+proc save_plot {w fname} {
+
+# Get current stream
+ $w cmd plgstrm cur_strm
+
+# Create a new one
+ $w cmd plmkstrm new_strm
+
+# New device type. _Use_ a known existing driver
+ $w cmd plsdev "psc"
+ $w cmd plsfnam $fname
+
+# Copy old stream parameters to new stream
+ $w cmd plcpstrm $cur_strm 0
+ $w cmd plreplot
+ $w cmd plend1
+
+# Return to previous one
+ $w cmd plsstrm $cur_strm
+}
+
+# Get selection square interactively
+proc get_clip {w xi xe yi ye} {
+
+# How do we translate that?
+# type(PLGraphicsIn) :: gin
+
+ return 0 ;# getcursor not supported!
+
+ matrix sx f 5
+ matrix sy f 5
+
+ set PLK_Return "\r"
+
+ scan "Q" %c Q
+
+ set xxi $xi
+ set yyi $yi
+ set xxe $xe
+ set yye $ye
+ set start 0
+
+# Enter xor mode to draw a selection rectangle
+ $w cmd plxormod 1 st
+
+
+# Driver has xormod capability, continue
+ if { $st } {
+ while {1} {
+
+ $w cmd plxormod 0 st
+ $w cmd plgetcursor gin
+ $w cmd plxormod 1 st
+
+ if { $gin_button == 1 } {
+ set xxi $gin_wX
+ set yyi $gin_wY
+ if { start } {
+#C clear previous rectangle
+ $w cmd plline 5 sx sy
+ }
+
+ set start 0
+
+ sx 0 = $xxi
+ sy 0 = $yyi
+ sx 4 = $xxi
+ sy 4 = $yyi
+ }
+
+ if { gin%state & 0x100 != 0 } {
+ set xxe $gin_wX
+ set yye $gin_wY
+ if { $start } {
+# Clear previous rectangle
+ $w cmd plline 5 sx sy
+ }
+ set start 1
+
+ sx 2 = $xxe
+ sy 2 = $yye
+ sx 1 = $xxe
+ sy 1 = $yyi
+ sx 3 = $xxi
+ sy 3 = $yye
+# Draw new rectangle
+ $w cmd plline 5 sx sy
+ }
+
+ if {($gin_button == 3) || ($gin_keysym == $PLK_Return) ||
+ ($gin_keysym == $Q } {
+ if { $start } {
+# Clear previous rectangle
+ $w cmd plline 5 sx sy
+ break
+ }
+ }
+ }
+
+# Leave xor mode
+ $w cmd plxormod 0 st
+
+ if { $xxe < $xxi } {
+ set t $xxi
+ set xxi $xxe
+ set xxe $t
+ }
+
+ if { $yyi < $yye } {
+ set t $yyi
+ set yyi $yye
+ set yye $t
+ }
+
+ set xe $xxe
+ set xi $xxi
+ set ye $yye
+ set yi $yyi
+
+ set get_clip [expr { $gin_keysym == $Q}]
+ } else {
+# driver has no xormod capability, just do nothing
+ get_clip = 0
+ return
+ }
+}
+
+# Set gray colormap
+proc gray_cmap {w num_col} {
+
+ matrix R f 2
+ matrix G f 2
+ matrix B f 2
+ matrix pos f 2
+ matrix rev i 2
+
+ R 0 = 0.0
+ G 0 = 0.0
+ B 0 = 0.0
+ R 1 = 1.0
+ G 1 = 1.0
+ B 1 = 1.0
+
+ pos 0 = 0.0
+ pos 1 = 1.0
+ rev 0 = 0
+ rev 1 = 0
+
+ $w cmd plscmap1n num_col
+ $w cmd plscmap1l 1 2 pos R G B rev
+
+}
+
+
+#----------------------------------------------------------------------------
+# proc max and min
+proc max {x y} {
+ expr {$x > $y? $x : $y}
+}
+proc min {x y} {
+ expr {$x > $y? $y : $x}
+}
+
+
+#----------------------------------------------------------------------------
+# proc a2mnmx
+# Minimum and the maximum elements of a 2-d array.
+
+proc a2mnmx {f nx ny fmin fmax} {
+ upvar 1 $fmin vmin
+ upvar 1 $fmax vmax
+
+ set vmax [$f 0 0]
+ set vmin $vmax
+ for {set j 0} {$j < $ny} {incr j} {
+ for {set i 0} {$i < $nx} {incr i} {
+ set vmax [max $vmax [$f $i $j]]
+ set vmin [min $vmin [$f $i $j]]
+ }
+ }
+}
Property changes on: trunk/examples/tcl/x20.tcl
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Modified: trunk/examples/tcl/x21.tcl
===================================================================
--- trunk/examples/tcl/x21.tcl 2008-08-30 06:56:00 UTC (rev 8721)
+++ trunk/examples/tcl/x21.tcl 2008-08-30 07:00:32 UTC (rev 8722)
@@ -58,12 +58,13 @@
matrix x f $pts
matrix y f $pts
matrix z f $pts
- matrix clev f $pts
+ matrix clev f $nl
matrix xg f $xp
matrix yg f $yp
matrix zg f $xp $yp
- set title {"Cubic Spline Approximation"
+ set title {"-dummy-"
+ "Cubic Spline Approximation"
"Delaunay Linear Interpolation"
"Natural Neighbors Interpolation"
"KNN Inv. Distance Weighted"
@@ -77,9 +78,9 @@
set xmax 0.6
set ymax 0.6
- opt 3 = $wmin
- opt 4 = [expr {double($knn_order)}]
- opt 5 = $threshold
+ opt 2 = $wmin
+ opt 3 = [expr {double($knn_order)}]
+ opt 4 = $threshold
for {set i 0} {$i < $pts} {incr i} {
set xt [expr {($xmax-$xmin)*[plrandd]}]
@@ -111,10 +112,12 @@
}
for {set i 0} {$i < $xp} {incr i} {
- xg $i = [expr {$xmin + ($xmax-$xmin)*($i-1.)/($xp-1.)}]
+ xg $i = [expr {$xmin + ($xmax-$xmin)*$i/double($xp-1.)}]
+ puts "xg: $i [xg $i]"
}
for {set i 0} {$i < $yp} {incr i} {
- yg $i = [expr {$ymin + ($ymax-$ymin)*($i-1.)/($yp-1.)}]
+ yg $i = [expr {$ymin + ($ymax-$ymin)*$i/double($yp-1.)}]
+ puts "yg: $i [yg $i]"
}
$w cmd plcol0 1
@@ -131,7 +134,7 @@
$w cmd pladv 0
for {set alg 1} {$alg <= 6} {incr alg} {
- $w cmd plgriddata x y z xg yg zg $alg [opt $alg]
+ $w cmd plgriddata x y z xg yg zg $alg [opt [expr {$alg-1}]]
# - CSA can generate NaNs (only interpolates? #).
# - DTLI and NNI can generate NaNs for points outside the convex hull
@@ -144,7 +147,7 @@
#
if {($alg == $GRID_CSA) || ($alg == $GRID_DTLI) ||
- ($alg == $GRID_NNLI) || ($alg == $GRID_NNI} {
+ ($alg == $GRID_NNLI) || ($alg == $GRID_NNI)} {
for {set i 0} {$i < $xp} {incr i} {
for {set j 0} {$j < $yp} {incr j} {
@@ -155,10 +158,10 @@
set dist 0.
set ii [expr {$i-1}]
- while {($ii < $i+1) && ($ii < $xp)} {
+ while {($ii <= $i+1) && ($ii < $xp)} {
set jj [expr {$j-1}]
- while {($jj == $j+1) && ($jj < $yp)} {
- if {($ii >= 0) && (jj >= 1) &&
+ while {($jj <= $j+1) && ($jj < $yp)} {
+ if {($ii >= 0) && ($jj >= 0) &&
![isnan [zg $ii $jj]] } {
if {abs($ii-$i) + abs($jj-$j) == 1)} {
set d 1.
@@ -182,13 +185,13 @@
}
}
- a2mnmx zg xp yp lzmin lzmax xp
+ a2mnmx zg $xp $yp lzmin lzmax
- set lzmin = [min $lzmin $zmin]
- set lzmax = [max $lzmax $zmax]
+ set lzmin [min $lzmin $zmin]
+ set lzmax [max $lzmax $zmax]
- set lzmin = [expr {lzmin - 0.01}]
- set lzmax = [expr {lzmax + 0.01}]
+ set lzmin [expr {$lzmin - 0.01}]
+ set lzmax [expr {$lzmax + 0.01}]
$w cmd plcol0 1
$w cmd pladv $alg
@@ -196,20 +199,19 @@
if {$k == 0} {
for {set i 0} {$i < $nl} {incr i} {
- clev $i = [expr {$lzmin + ($lzmax-$lzmin)/($nl-1.)*($i-1.)}]
+ clev $i = [expr {$lzmin + ($lzmax-$lzmin)/double($nl-1.)*$i}]
}
- $w cmd plenv0 xmin xmax ymin ymax 2 0
+ $w cmd plenv0 $xmin $xmax $ymin $ymax 2 0
$w cmd plcol0 15
$w cmd pllab "X" "Y" [lindex $title $alg]
- $w cmd plshades zg $defined $xmin $xmax $ymin \
- $ymax clev 1 0 1
+ $w cmd plshades zg $xmin $xmax $ymin $ymax clev 1 0 1 2
$w cmd plcol0 2
} else {
for {set i 0} {$i < $nl} {incr i} {
- clev $i = [expr {$lzmin + ($lzmax-$lzmin)/($nl-1.)*($i-1.)}]
+ clev $i = [expr {$lzmin + ($lzmax-$lzmin)/double($nl-1.)*$i}]
}
- cmap1_init
+ cmap1_init $w
$w cmd plvpor 0. 1. 0. 0.9
$w cmd plwind -1.1 0.75 -0.65 1.20
#
@@ -227,12 +229,13 @@
"bcdfntu" "Z" 0.5 0
$w cmd plcol0 15
$w cmd pllab "" "" [lindex $title $alg]
- $w cmd plot3dc xg yg zg ior ior $DRAW_LINEXY
- $MAG_COLOR $BASE_CONT clev
+ $w cmd plot3dc xg yg zg $xp $yp \
+ [expr {$DRAW_LINEXY|$MAG_COLOR|$BASE_CONT}] clev $nl
}
}
}
+ $w cmd plflush
$w cmd plend
}
@@ -250,41 +253,47 @@
#----------------------------------------------------------------------------
# proc cmap1_init
# Set up the colour map
-proc cmap1_init {} {
+proc cmap1_init {w} {
- matrix i i 2
- matrix h i 2
- matrix l i 2
- matrix s i 2
+ matrix i f 2
+ matrix h f 2
+ matrix l f 2
+ matrix s f 2
+ matrix r i 2
- i 1 = 0.
- i 2 = 1.
+ i 0 = 0.
+ i 1 = 1.
- h 1 = 240.
- h 2 = 0.
+ h 0 = 240.
+ h 1 = 0.
+ l 0 = 0.6
l 1 = 0.6
- l 2 = 0.6
+ s 0 = 0.8
s 1 = 0.8
- s 2 = 0.8
+ r 0 = 0
+ r 1 = 0
+
$w cmd plscmap1n 256
- $w cmd plscmap1l .false. i h l s
+ $w cmd plscmap1l 0 2 i h l s r
}
#----------------------------------------------------------------------------
# proc a2mnmx
# Minimum and the maximum elements of a 2-d array.
-proc a2mnmx {f nx ny fmin fmax xdim} {
+proc a2mnmx {f nx ny fmin fmax} {
+ upvar 1 $fmin vmin
+ upvar 1 $fmax vmax
- set fmax [f 0 0]
- set fmin $fmax
+ set vmax [$f 0 0]
+ set vmin $vmax
for {set j 0} {$j < $ny} {incr j} {
for {set i 0} {$i < $nx} {incr i} {
- set fmax [max $fmax [f $i $j]]
- set fmin [min $fmin [f $i $j]]
+ set vmax [max $vmax [$f $i $j]]
+ set vmin [min $vmin [$f $i $j]]
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|