Skip to content

Commit 3bcce87

Browse files
authored
Merge pull request #1094 from vorth/too-much-legacy
Three defect fixes for online vZome
2 parents 0178329 + 1ae37ca commit 3bcce87

File tree

14 files changed

+1343
-240
lines changed

14 files changed

+1343
-240
lines changed

core/src/main/java/com/vzome/core/algebra/AbstractAlgebraicField.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ public AlgebraicNumber parseVefNumber( String string, boolean isRational )
821821
String[] parts = string .split( "/" );
822822
fractions[ 0 ] = parts[ 0 ] + "/" + ((parts.length > 1)? parts[ 1 ] : "1");
823823
}
824-
return this .parseNumber( String.join( " ", fractions ) );
824+
return this .parseNumberStrs( fractions );
825825
}
826826

827827
@Override
@@ -847,6 +847,19 @@ private AlgebraicNumber parseNumber( StringTokenizer tokens )
847847
return this.numberFactory .createAlgebraicNumberFromBRs( this, bigs );
848848
}
849849

850+
private AlgebraicNumber parseNumberStrs( String[] numStrs )
851+
{
852+
int order = this .getOrder();
853+
if ( numStrs .length != order ) {
854+
throw new IllegalStateException( "Field order (" + order + ") does not match token count: " + numStrs .length );
855+
}
856+
BigRational[] bigs = new BigRational[ order ];
857+
for ( int i = 0; i < order; i++ ) {
858+
bigs[ i ] = this.numberFactory .parseBigRational( numStrs[ i ] );
859+
}
860+
return this.numberFactory .createAlgebraicNumberFromBRs( this, bigs );
861+
}
862+
850863
@Override
851864
public AlgebraicVector parseVector( String nums )
852865
{

online/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ core.config {
165165
'com/vzome/core/kinds/HeptagonFieldApplication.java',
166166
'com/vzome/core/kinds/SnubCubeFieldApplication.java',
167167
'com/vzome/core/kinds/SnubDodecFieldApplication.java',
168+
'com/vzome/core/kinds/PlasticPhiFieldApplication.java',
168169
'com/vzome/core/kinds/PolygonFieldApplication.java',
169170
'com/vzome/core/kinds/AbstractSymmetryPerspective.java',
170171
'com/vzome/core/kinds/OctahedralSymmetryPerspective.java',

0 commit comments

Comments
 (0)