Vector product (cross product).

@param a
an Atom object
@param b
an Atom object
@return an Atom object
165008
public static final Atom vectorProduct(Atom a , Atom b){

		Atom c = new AtomImpl();
		c.setX( a.getY() * b.getZ() - a.getZ() * b.getY() ) ;
		c.setY( a.getZ() * b.getX() - a.getX() * b.getZ() ) ;
		c.setZ( a.getX() * b.getY() - a.getY() * b.getX() ) ;
		return c ;

	}
534652
public Vector3f cross(float x, float y, float z) {
        return cross(x, y, z, thisOrNew());
    }
437557
def cross(self, vector):
        """"""
        return Vector((self.y * vector.z - self.z * vector.y),
                      (self.z * vector.x - self.x * vector.z),
                      (self.x * vector.y - self.y * vector.x))
393746
public double dot(SparseVector b) {
		SparseVector a = this;
		if (a.N != b.N) throw new IllegalArgumentException("Vector lengths disagree. " + a.N + " != " + b.N);
		double sum = 0.0;

		// iterate over the vector with the fewest nonzeros
		if (a.symbolTable.size() <= b.symbolTable.size()) {
			for (int i : a.symbolTable)
				if (b.symbolTable.contains(i)) sum += a.get(i) * b.get(i);
		}
		else  {
			for (int i : b.symbolTable)
				if (a.symbolTable.contains(i)) sum += a.get(i) * b.get(i);
		}
		return sum;
	}
1201372
private static double cross(Coordinate a1, Coordinate a2, Coordinate b1, Coordinate b2) {
		return (a2.getX() - a1.getX()) * (b2.getY() - b1.getY()) - (a2.getY() - a1.getY()) * (b2.getX() - b1.getX());
	}
490723
public Vector4f fma(Vector4fc a, Vector4fc b, Vector4f dest) {
        dest.x = x + a.x() * b.x();
        dest.y = y + a.y() * b.y();
        dest.z = z + a.z() * b.z();
        dest.w = w + a.w() * b.w();
        return dest;
    }
1172747
public void product(IntIntVector other) {
        // TODO: Add special case for IntIntDenseVector.
        for (int i=0; i<size; i++) {
            elements[i + start] *= other.get(i);
        }
    }
357042
public static final void shift(Atom a, Atom b){

		Atom natom = add(a,b);
		double x = natom.getX();
		double y = natom.getY() ;
		double z = natom.getZ();
		a.setX(x);
		a.setY(y);
		a.setZ(z);
	}
1002022
def cross(self, vec):
        """"""
        if not isinstance(vec, Vector3Array):
            raise TypeError('Cross product operand must be a Vector3Array')
        if self.nV != 1 and vec.nV != 1 and self.nV != vec.nV:
            raise ValueError('Cross product operands must have the same '
                             'number of elements.')
        return Vector3Array(np.cross(self, vec))
226736
function cross(a, b){
    var ax = x(a), ay = y(a), az = z(a);
    var bx = y(a), by = y(b), bz = z(b);
    return Vector3(
      ay*bz-az*by,
      az*bx-bz*ax,
      ax*by-ay*bx);
  }
1222069
public static double jaccardIndex(DoubleVector a, DoubleVector b) {
        Set<Double> intersection = new HashSet<Double>();
        Set<Double> union = new HashSet<Double>();
        for (int i = 0; i < a.length(); ++i) {
            double d = a.get(i);
            intersection.add(d);
            union.add(d);
        }
        Set<Double> tmp = new HashSet<Double>();
        for (int i = 0; i < b.length(); ++i) {
            double d = b.get(i);
            tmp.add(d);
            union.add(d);
        }

        intersection.retainAll(tmp);
        return ((double)(intersection.size())) / union.size();
    }
398961
public Vector4d fma(Vector4dc a, Vector4dc b) {
        return fma(a, b, thisOrNew());
    }
1158520
public static double jaccardIndex(Vector a, Vector b) {
        return jaccardIndex(Vectors.asDouble(a), Vectors.asDouble(b));
    }
527915
private static double[] crossProduct(double[] u, double[] v) {
        return new double[]{(u[1] * v[2]) - (v[1] * u[2]), (u[2] * v[0]) - (v[2] * u[0]), (u[0] * v[1]) - (v[0] * u[1])};
    }
347105
static Vector2d sum(final Tuple2d a, final Tuple2d b) {
        return new Vector2d(a.x + b.x, a.y + b.y);
    }
337564
public static final <A,B> Set<OrderedPair<A,B>> cartesianProduct(Set<A> a, Set<B> b)
    {
        Set<OrderedPair<A,B>> set = new HashSet<>();
        for (A t : a)
        {
            for (B v : b)
            {
                set.add(new OrderedPair(t, v));
            }
        }
        return set;
    }
996740
public static double dot(@javax.annotation.Nonnull final List<double[]> a, @javax.annotation.Nonnull final List<double[]> b) {
    return com.simiacryptus.util.ArrayUtil.sum(com.simiacryptus.util.ArrayUtil.multiply(a, b));
  }