Skip to content

Commit

Permalink
Fixed overflow in VA. column offset was char, changed it to int as th…
Browse files Browse the repository at this point in the history
…ere can be many columns with svm light.
  • Loading branch information
tomasnykodym committed Aug 8, 2013
1 parent a5d996a commit 2b4d8c5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/water/ValueArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ static public class Column extends Iced implements Cloneable {
public long _n;
public int _base; // Base
public char _scale; // Actual value is (((double)(stored_value+base))/scale); 1,10,100,1000
public char _off; // Offset within a row
public int _off; // Offset within a row
public byte _size; // Size is 1,2,4 or 8 bytes, or -4,-8 for float/double data

public Column() { _min = Double.MAX_VALUE; _max = -Double.MAX_VALUE; _scale = 1; }
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/water/parser/DParseTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ protected void createValueArrayHeader() {
cols[i]._base = _bases[i];
assert (char)pow10i(-_scale[i]) == pow10i(-_scale[i]):"scale out of bounds!, col = " + i + ", scale = " + _scale[i];
cols[i]._scale = (char)pow10i(-_scale[i]);
cols[i]._off = (char)off;
cols[i]._off = off;
cols[i]._size = (byte)COL_SIZES[_colTypes[i]];
cols[i]._domain = _colDomains[i];
cols[i]._max = _max[i];
Expand Down

0 comments on commit 2b4d8c5

Please sign in to comment.