class WeightedInput implements Comparable<WeightedInput>, SimilarityInput {

    public SimilarityResult cosineSquares(RleDecoder decoder, double similarityCutoff, WeightedInput other, boolean bidirectional) {
        double[] thisWeights = weights;
        double[] otherWeights = other.weights;
        if (decoder != null) {
            decoder.reset(weights, other.weights);
            thisWeights = decoder.item1();
            otherWeights = decoder.item2();
        }

        int len = Math.min(thisWeights.length, otherWeights.length);
        double cosineSquares = Intersections.cosineSquare(thisWeights, otherWeights, len);
        long intersection = 0;

        if (similarityCutoff >= 0d && (cosineSquares == 0 || cosineSquares < similarityCutoff)) return null;
        return new SimilarityResult(id, other.id, itemCount, other.itemCount, intersection, cosineSquares, bidirectional, false);
    }

    public  WeightedInput(long id, double[] weights, int fullSize, int itemCount);
    public  WeightedInput(long id, double[] weights, double skipValue);
    public  WeightedInput(long id, double[] weights);

}