Prepared fractal tocta numbers
This commit is contained in:
parent
278b686562
commit
d793add3de
|
@ -7,6 +7,7 @@ package love.distributedrebirth.demo4d.base2t;
|
||||||
*/
|
*/
|
||||||
public final class V003Timble implements BaseNumber<V003Timble> {
|
public final class V003Timble implements BaseNumber<V003Timble> {
|
||||||
|
|
||||||
|
public static int BIT_COUNT = T08PartOctal.BIT_COUNT;
|
||||||
private T08PartOctal value;
|
private T08PartOctal value;
|
||||||
|
|
||||||
public V003Timble() {
|
public V003Timble() {
|
||||||
|
@ -31,7 +32,7 @@ public final class V003Timble implements BaseNumber<V003Timble> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getBitCount() {
|
public int getBitCount() {
|
||||||
return T08PartOctal.BIT_COUNT;
|
return BIT_COUNT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -7,6 +7,7 @@ package love.distributedrebirth.demo4d.base2t;
|
||||||
*/
|
*/
|
||||||
public final class V006Tixte implements BaseNumber<V006Tixte> {
|
public final class V006Tixte implements BaseNumber<V006Tixte> {
|
||||||
|
|
||||||
|
public static int BIT_COUNT = V003Timble.BIT_COUNT * T02PartBinary.LENGTH;
|
||||||
private V003Timble[] values = new V003Timble[T02PartBinary.LENGTH];
|
private V003Timble[] values = new V003Timble[T02PartBinary.LENGTH];
|
||||||
|
|
||||||
public V006Tixte() {
|
public V006Tixte() {
|
||||||
|
@ -32,7 +33,7 @@ public final class V006Tixte implements BaseNumber<V006Tixte> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getBitCount() {
|
public int getBitCount() {
|
||||||
return T08PartOctal.BIT_COUNT * T02PartBinary.LENGTH;
|
return BIT_COUNT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -7,6 +7,7 @@ package love.distributedrebirth.demo4d.base2t;
|
||||||
*/
|
*/
|
||||||
public final class V009Tyte implements BaseNumberTyte<V009Tyte> {
|
public final class V009Tyte implements BaseNumberTyte<V009Tyte> {
|
||||||
|
|
||||||
|
public static int BIT_COUNT = V003Timble.BIT_COUNT * T03PartTrit.LENGTH;
|
||||||
private V003Timble[] values = new V003Timble[T03PartTrit.LENGTH];
|
private V003Timble[] values = new V003Timble[T03PartTrit.LENGTH];
|
||||||
|
|
||||||
public V009Tyte() {
|
public V009Tyte() {
|
||||||
|
@ -37,7 +38,7 @@ public final class V009Tyte implements BaseNumberTyte<V009Tyte> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getBitCount() {
|
public int getBitCount() {
|
||||||
return T08PartOctal.BIT_COUNT * T03PartTrit.LENGTH;
|
return BIT_COUNT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -7,6 +7,7 @@ package love.distributedrebirth.demo4d.base2t;
|
||||||
*/
|
*/
|
||||||
public final class V018Tord implements BaseNumberTyte<V018Tord> {
|
public final class V018Tord implements BaseNumberTyte<V018Tord> {
|
||||||
|
|
||||||
|
public static int BIT_COUNT = V009Tyte.BIT_COUNT * T02PartBinary.LENGTH;
|
||||||
private V009Tyte[] values = new V009Tyte[T02PartBinary.LENGTH];
|
private V009Tyte[] values = new V009Tyte[T02PartBinary.LENGTH];
|
||||||
|
|
||||||
public V018Tord() {
|
public V018Tord() {
|
||||||
|
@ -44,7 +45,7 @@ public final class V018Tord implements BaseNumberTyte<V018Tord> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getBitCount() {
|
public int getBitCount() {
|
||||||
return T08PartOctal.BIT_COUNT * T06PartSeximal.LENGTH;
|
return BIT_COUNT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -7,6 +7,7 @@ package love.distributedrebirth.demo4d.base2t;
|
||||||
*/
|
*/
|
||||||
public final class V027Temvig implements BaseNumberTyte<V027Temvig> {
|
public final class V027Temvig implements BaseNumberTyte<V027Temvig> {
|
||||||
|
|
||||||
|
public static int BIT_COUNT = V009Tyte.BIT_COUNT * T03PartTrit.LENGTH;
|
||||||
private V009Tyte[] values = new V009Tyte[T03PartTrit.LENGTH];
|
private V009Tyte[] values = new V009Tyte[T03PartTrit.LENGTH];
|
||||||
|
|
||||||
public V027Temvig() {
|
public V027Temvig() {
|
||||||
|
@ -37,7 +38,7 @@ public final class V027Temvig implements BaseNumberTyte<V027Temvig> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getBitCount() {
|
public int getBitCount() {
|
||||||
return T08PartOctal.BIT_COUNT * T03PartTrit.LENGTH * T03PartTrit.LENGTH;
|
return BIT_COUNT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -7,6 +7,7 @@ package love.distributedrebirth.demo4d.base2t;
|
||||||
*/
|
*/
|
||||||
public final class V036Teger implements BaseNumberTyte<V036Teger> {
|
public final class V036Teger implements BaseNumberTyte<V036Teger> {
|
||||||
|
|
||||||
|
public static int BIT_COUNT = V018Tord.BIT_COUNT * T02PartBinary.LENGTH;
|
||||||
private V018Tord[] values = new V018Tord[T02PartBinary.LENGTH];
|
private V018Tord[] values = new V018Tord[T02PartBinary.LENGTH];
|
||||||
|
|
||||||
public V036Teger() {
|
public V036Teger() {
|
||||||
|
@ -46,7 +47,7 @@ public final class V036Teger implements BaseNumberTyte<V036Teger> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getBitCount() {
|
public int getBitCount() {
|
||||||
return T08PartOctal.BIT_COUNT * T12PartUncial.LENGTH;
|
return BIT_COUNT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -7,6 +7,7 @@ package love.distributedrebirth.demo4d.base2t;
|
||||||
*/
|
*/
|
||||||
public final class V072Tong implements BaseNumberTyte<V072Tong> {
|
public final class V072Tong implements BaseNumberTyte<V072Tong> {
|
||||||
|
|
||||||
|
public static int BIT_COUNT = V036Teger.BIT_COUNT * T02PartBinary.LENGTH;
|
||||||
private V036Teger[] values = new V036Teger[T02PartBinary.LENGTH];
|
private V036Teger[] values = new V036Teger[T02PartBinary.LENGTH];
|
||||||
|
|
||||||
public V072Tong() {
|
public V072Tong() {
|
||||||
|
@ -36,7 +37,7 @@ public final class V072Tong implements BaseNumberTyte<V072Tong> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getBitCount() {
|
public int getBitCount() {
|
||||||
return T08PartOctal.BIT_COUNT * T12PartUncial.LENGTH * T02PartBinary.LENGTH;
|
return BIT_COUNT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -7,6 +7,7 @@ package love.distributedrebirth.demo4d.base2t;
|
||||||
*/
|
*/
|
||||||
public final class V144Tocta implements BaseNumberTyte<V144Tocta> {
|
public final class V144Tocta implements BaseNumberTyte<V144Tocta> {
|
||||||
|
|
||||||
|
public static int BIT_COUNT = V072Tong.BIT_COUNT * T02PartBinary.LENGTH;
|
||||||
private V072Tong[] values = new V072Tong[T02PartBinary.LENGTH];
|
private V072Tong[] values = new V072Tong[T02PartBinary.LENGTH];
|
||||||
|
|
||||||
public V144Tocta() {
|
public V144Tocta() {
|
||||||
|
@ -62,7 +63,7 @@ public final class V144Tocta implements BaseNumberTyte<V144Tocta> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getBitCount() {
|
public int getBitCount() {
|
||||||
return T08PartOctal.BIT_COUNT * T12PartUncial.LENGTH * T04PartQuad.LENGTH;
|
return BIT_COUNT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
66
core/src/love/distributedrebirth/demo4d/base2t/VŌṁglyph.java
Normal file
66
core/src/love/distributedrebirth/demo4d/base2t/VŌṁglyph.java
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
package love.distributedrebirth.demo4d.base2t;
|
||||||
|
|
||||||
|
abstract public class VŌṁglyph<V extends VŌṁglyph<V> & BaseNumber<V>> implements BaseNumber<V> {
|
||||||
|
|
||||||
|
private V144Tocta[] values;
|
||||||
|
private int valuesLength;
|
||||||
|
private byte fractalLevel;
|
||||||
|
|
||||||
|
public VŌṁglyph(byte fractalLevel) {
|
||||||
|
this.fractalLevel = fractalLevel;
|
||||||
|
this.valuesLength = resolveFractalLevel(fractalLevel);
|
||||||
|
this.values = new V144Tocta[valuesLength];
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract protected int resolveFractalLevel(byte level);
|
||||||
|
|
||||||
|
public final byte getFractalLevel() {
|
||||||
|
return fractalLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public final int getValuesLength() {
|
||||||
|
return valuesLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
private final int validatePartRequest(int part) {
|
||||||
|
if (part < 0) {
|
||||||
|
throw new IllegalArgumentException("Requested part is negative");
|
||||||
|
}
|
||||||
|
if (part > valuesLength) {
|
||||||
|
throw new IllegalArgumentException("Requested part exceeds fractal storage");
|
||||||
|
}
|
||||||
|
return part;
|
||||||
|
}
|
||||||
|
|
||||||
|
public final V144Tocta getValue(int part) {
|
||||||
|
return values[validatePartRequest(part)];
|
||||||
|
}
|
||||||
|
|
||||||
|
public final void setValue(int part, V144Tocta value) {
|
||||||
|
values[validatePartRequest(part)] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract protected V toCloneFractal(byte level);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public final V toClone() {
|
||||||
|
V result = toCloneFractal(getFractalLevel());
|
||||||
|
T08PartOctalBaseIterator clonedOctals = cloneIterator();
|
||||||
|
for (int i=0;i<getValuesLength();i++) {
|
||||||
|
result.setValue(i, new V144Tocta(clonedOctals));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public final int getBitCount() {
|
||||||
|
return V144Tocta.BIT_COUNT * valuesLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public final void fillOctalValues(T08PartOctalBaseAppender appender) {
|
||||||
|
for (V144Tocta value:values) {
|
||||||
|
value.fillOctalValues(appender);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,10 +1,24 @@
|
||||||
package love.distributedrebirth.demo4d.base2t;
|
package love.distributedrebirth.demo4d.base2t;
|
||||||
|
|
||||||
public class VŌṁglyphDiamond {
|
public class VŌṁglyphDiamond extends VŌṁglyph<VŌṁglyphDiamond> {
|
||||||
|
|
||||||
// 0th = 1 * V144Tocta (1)
|
// 0th = 1 * V144Tocta (1)
|
||||||
// 1th = 1+3 * V144Tocta (4)
|
// 1th = 1+3 * V144Tocta (4)
|
||||||
// 2th = 1+3+6 * V144Tocta (10)
|
// 2th = 1+3+6 * V144Tocta (10)
|
||||||
// 3th = 1+3+6+14 * V144Tocta (24)
|
// 3th = 1+3+6+14 * V144Tocta (24)
|
||||||
// etc
|
// etc
|
||||||
|
|
||||||
|
public VŌṁglyphDiamond(byte level) {
|
||||||
|
super(level);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected int resolveFractalLevel(byte level) {
|
||||||
|
// TODO
|
||||||
|
return level;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected VŌṁglyphDiamond toCloneFractal(byte level) {
|
||||||
|
return new VŌṁglyphDiamond(level);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,23 @@
|
||||||
package love.distributedrebirth.demo4d.base2t;
|
package love.distributedrebirth.demo4d.base2t;
|
||||||
|
|
||||||
public class VŌṁglyphHyperStar {
|
public class VŌṁglyphHyperStar extends VŌṁglyph<VŌṁglyphHyperStar> {
|
||||||
|
|
||||||
// 0th = V144Tocta
|
// 0th = V144Tocta
|
||||||
// 1th = 5 * V144Tocta
|
// 1th = 5 * V144Tocta
|
||||||
// 2th = 5 * 12 * V144Tocta
|
// 2th = 5 * 12 * V144Tocta
|
||||||
// etc
|
// etc
|
||||||
}
|
|
||||||
|
public VŌṁglyphHyperStar(byte level) {
|
||||||
|
super(level);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected int resolveFractalLevel(byte level) {
|
||||||
|
// TODO
|
||||||
|
return level;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected VŌṁglyphHyperStar toCloneFractal(byte level) {
|
||||||
|
return new VŌṁglyphHyperStar(level);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue