a bombard book timing way measures during 0 seconds


my highbrow wrote bombard book program, arrangement results. reason only outputs 0s program. presumption following files:



timeit.csh
sequence
ecoli2500.txt
ecoli3000.txt
ecoli5000.txt
ecoli7000.txt
ecoli8000.txt
ecoli9000.txt
ecoli10000.txt


here essence sequence



java editdistance


the essence timeit.csh offer below.



java editdistance < ecoli2500.txt works expected



in fact way executes remarkably any above files sequence.



what i don't know since



./timeit.csh sequence


produces zeros



here timeit.csh... (further next editdistance.java):



#!/bin/csh
#
# unix book programs.
#
# management line: timeit sequence


# array programs commandline
set way = $argv[1]

# adjust needed
set cpulimit = 120
limit cpu $cpulimit seconds
limit core 0

# quarrel files
set quarrel = ( stx1230.txt \
ecoli2500.txt \
ecoli3000.txt \
ecoli5000.txt \
ecoli7000.txt \
ecoli8000.txt \
ecoli9000.txt \
ecoli10000.txt)

# adjust needed
set inputpath = `pwd`

# imitation header
printf "cpu border = %d seconds\n\n" $cpulimit
printf "%-25s" "data file"
foreach way ($argv)
printf "%16s" $program
end
printf "\n"

# imitation right array = table
@ i = 25 + 16 * $#argv
while ($i > 0)
printf "="
@ i = $i - 1
end
printf "\n"


# imitation out quarrel any information record buttress any program
foreach datafile ($input)
printf "%-25s" $datafile
if (-f $inputpath/$datafile) then
foreach way ($argv)
# duplicate controlling way datafile
# -p fall pledge the cost totalled seconds minutes
good /usr/bin/time -p $program < \
$inputpath/$datafile |& \
egrep '^user[ ]*[0-9]' | \
awk '{ ($2 >= '$cpulimit') printf " cpu limit"; else printf("%16.2f", $2) }'
# egrep, awk commands mislay second buttress quarrel analogous user time

end
else printf "could open" $datafile
endif
printf "\n"

end


here editdistance.java



import java.util.*;

class editdistance {
open stationary int min(int a, int b, int c) {
relapse math.min(a,math.min(b,c));
}
open stationary int distance(string one, twine two) {
(one.length()>two.length()) {
twine temp1 = one;
twine temp2 = two;
= temp2;
twin = temp1;
}
int[][] d = new int[one.length()+1][two.length()+1];
d[0][0] = 0;
int top, left, topleft, cost;
(int i = 1; i <= one.length(); i++) {
d[0][i] = 2*i;
d[i][0] = 2*i;
}
(int i = 1; i <= one.length(); i++) {
(int j = 1; j <= two.length(); j++) {

(one.charat(i-1) == two.charat(j-1))
cost = 0;
else
cost = 1;

tip = d[i][j-1];
left = d[i-1][j];
topleft = d[i-1][j-1];
d[i][j] = min(top+2,left+2,topleft+cost);
}
}
relapse d[one.length()][two.length()];
}
open stationary vacant main(string[] args) {
scanner scanner = new scanner(system.in);
twine = scanner.next();
twine twin = scanner.next();
system.out.println(distance(one,two));
}
}


any ideas since things aren't working? i don't know many bombard scripts, nonetheless domain bombard script:



nice /usr/bin/time -p $program <                    \
$inputpath/$datafile |& \
egrep '^user[ ]*[0-9]' | \
awk '{ ($2 >= '$cpulimit') printf " cpu limit"; else printf("%16.2f", $2) }'


confirms mind way should awaiting command:



java editdistance < ecoli2500.txt
java editdistance...etc. etc.


but way works those commands. i need set adult way respond justly bombard script. maybe help.



Comments

Popular posts from this blog

list macos calm editors formula editors

how i practical urls indicate .aspx pages asp.net deployed an iis? (preferably but iis)

jaxb - xjc - reworking generated typesafe enum category members