From 426caa587cfa8fdf546b6e8cbccfdb0fccea9c36 Mon Sep 17 00:00:00 2001 From: Nadesh Ramanathan Date: Tue, 10 Nov 2020 10:55:18 +0000 Subject: fixing nussinov --- benchmarks/polybench-syn/medley/nussinov.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'benchmarks/polybench-syn/medley/nussinov.c') diff --git a/benchmarks/polybench-syn/medley/nussinov.c b/benchmarks/polybench-syn/medley/nussinov.c index fd33ec4..f39f742 100644 --- a/benchmarks/polybench-syn/medley/nussinov.c +++ b/benchmarks/polybench-syn/medley/nussinov.c @@ -19,10 +19,11 @@ void init_array (int n, { int i, j; int ONE = 1; + int FOUR = 4; for (i=0; i = 0; i=i-ONE) { + for (i = n-ONE; i >= ZERO; i=i-ONE) { for (j=i+ONE; j=0) + if (j-ONE>=ZERO) table[i][j] = ((table[i][j] >= table[i][j-ONE]) ? table[i][j] : table[i][j-ONE]); if (i+ONE= table[i+ONE][j]) ? table[i][j] : table[i+ONE][j]); - if (j-ONE>=0 && i+ONE=ZERO && i+ONE= table[i+ONE][j-ONE]+(((seq[i])+(seq[j])) == THREE ? ONE : 0)) ? table[i][j] : table[i+ONE][j-ONE]+(((seq[i])+(seq[j])) == THREE ? ONE : 0)); + table[i][j] = ((table[i][j] >= table[i+ONE][j-ONE]+(((seq[i])+(seq[j])) == THREE ? ONE : ZERO)) ? table[i][j] : table[i+ONE][j-ONE]+(((seq[i])+(seq[j])) == THREE ? ONE : ZERO)); else table[i][j] = ((table[i][j] >= table[i+ONE][j-ONE]) ? table[i][j] : table[i+ONE][j-ONE]); } -- cgit From 95861dbef966e2cb612b303615681fc29c3acd3d Mon Sep 17 00:00:00 2001 From: Nadesh Ramanathan Date: Wed, 11 Nov 2020 19:47:42 +0000 Subject: polybench edits --- benchmarks/polybench-syn/medley/nussinov.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'benchmarks/polybench-syn/medley/nussinov.c') diff --git a/benchmarks/polybench-syn/medley/nussinov.c b/benchmarks/polybench-syn/medley/nussinov.c index f39f742..a2c3b70 100644 --- a/benchmarks/polybench-syn/medley/nussinov.c +++ b/benchmarks/polybench-syn/medley/nussinov.c @@ -11,6 +11,8 @@ typedef int base; +#include "../include/misc.h" + #define plus(i) i = i + ONE static void init_array (int n, @@ -23,7 +25,7 @@ void init_array (int n, for (i=0; i = ZERO; i=i-ONE) { for (j=i+ONE; j