Fix matrix1 and countnegative return values
This commit is contained in:
+5
-4
@@ -81,10 +81,11 @@ countnegative_initialize(matrix Array) {
|
|||||||
register int OuterIndex, InnerIndex;
|
register int OuterIndex, InnerIndex;
|
||||||
|
|
||||||
__pragma_loopbound(20, 20);
|
__pragma_loopbound(20, 20);
|
||||||
for (OuterIndex = 0; OuterIndex < MAXSIZE; OuterIndex++)
|
for (OuterIndex = 0; OuterIndex < MAXSIZE; OuterIndex++) {
|
||||||
__pragma_loopbound(20, 20);
|
__pragma_loopbound(20, 20);
|
||||||
for (InnerIndex = 0; InnerIndex < MAXSIZE; InnerIndex++)
|
for (InnerIndex = 0; InnerIndex < MAXSIZE; InnerIndex++)
|
||||||
Array[OuterIndex][InnerIndex] = countnegative_randomInteger();
|
Array[OuterIndex][InnerIndex] = countnegative_randomInteger();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -98,7 +99,7 @@ countnegative_return(void) {
|
|||||||
int checksum = (countnegative_postotal + countnegative_poscnt +
|
int checksum = (countnegative_postotal + countnegative_poscnt +
|
||||||
countnegative_negtotal + countnegative_negcnt);
|
countnegative_negtotal + countnegative_negcnt);
|
||||||
|
|
||||||
return ((checksum == (int) 0x1778de) ? 0 : -1);
|
return ((checksum == (int) 0x3edcf) ? 0 : -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ matrix1_return(void) {
|
|||||||
for (i = 0; i < X * Z; i++)
|
for (i = 0; i < X * Z; i++)
|
||||||
checksum += matrix1_C[i];
|
checksum += matrix1_C[i];
|
||||||
|
|
||||||
return (checksum == 1000 ? 0 : -1);
|
return (checksum == 125 ? 0 : -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user