| 3 | import com.winvector.opt.def.ExampleRow; |
| 4 | |
| 5 | public final class SparseExampleRow implements ExampleRow { |
| 6 | private final int category; |
| 7 | private final double wt; |
| 8 | private final SparseSemiVec v; |
| 9 | |
| 10 | public SparseExampleRow(final SparseSemiVec v, final double weight, final int category) { |
| 11 | this.category = category; |
| 12 | wt = weight; |
| 13 | this.v = v; |
| 14 | } |
| 15 | |
| 16 | |
| 17 | @Override |
| 18 | public int getNIndices() { |
| 19 | return v.getNIndices(); |
| 20 | } |
| 21 | |
| 22 | @Override |
| 23 | public int getKthIndex(final int ii) { |
| 24 | return v.getKthIndex(ii); |
| 25 | } |
| 26 | |
| 27 | @Override |
| 28 | public double getKthValue(final int ii) { |
| 29 | return v.getKthValue(ii); |
| 30 | } |
| 31 | |
| 32 | @Override |
| 33 | public int category() { |
| 34 | return category; |
| 35 | } |
| 36 | |
| 37 | @Override |
| 38 | public double weight() { |
| 39 | return wt; |
| 40 | } |
| 41 | |
| 42 | @Override |
| 43 | public String toString() { |
| 44 | return v.toString() + "(" + wt +"): " + category; |
| 45 | } |
| 46 | } |
nothing calls this directly
no outgoing calls
no test coverage detected