Welcome to mirror list, hosted at ThFree Co, Russian Federation.

FWeight.java « ghgd « statmt « org « attempt1 « hypergraph-prototype - github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: bc10c6b0182374c41cb664bb7e96df008946058c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package org.statmt.ghgd;

public class FWeight extends Weight {

	float f;
	
	public FWeight(float x) { f = x; }
	@Override
	public Weight add(Weight x) {
		return new FWeight(((FWeight)x).f + f);
	}

	public int compareTo(Weight o) {
		float d = f - ((FWeight)o).f;
		if (d != 0.0f) {
			if (d < 0.0f) return -1; else return 1;
		}
		return 0;
	}
	
	public String toString() { return Float.toString(f); }

}