/* SCCS @(#)NslNeq.java 1.6 --- 09/01/99 -- 00:18:18 */
// Copyright: Copyright (c) 1997 University of Southern California Brain Project.
// Copyright: This software may be freely copied provided the toplevel
// Copyright: COPYRIGHT file is included with each such copy.
// Copyright: Email nsl@java.usc.edu.
////////////////////////////////////////////////////////////
//
// Not equal routines
//
//
/**
Not equal routines.
There are two basic format for the evaluation method in
this routine:
1, eval(a, b) -> c
a, b are the parameter to evaluate the maximum value of
a and b pointwise and the result is passed out as c
2. eval(dest, a, b) -> c
a, b are the parameter of the evaluation function and
dest is the temporary space to hold the result.
The method returns the reference to dest.
*/
package nslj.src.math;
import nslj.src.lang.*;
public final class NslNeq {
public static boolean eval(int a, int b) {
return a!=b;
}
public static boolean[] eval(int[] a, int[] b) {
return eval(new boolean[a.length], a, b);
}
public static boolean[] eval(boolean[] dest, int[] a, int[] b) {
int i;
int len = dest.length;
if (a.length != b.length) {
System.out.println("NslNeq: boolean[] eval(int[] a, int[] b): Array size inconsistent");
return dest;
}
if (len!=a.length || len!= b.length) {
len = a.length;
dest = new boolean[len];
}
for (i=0; i