Fully refactor algebra split ScaleOperations from Space. #219
@ -50,7 +50,7 @@ public object MstGroup : Group<MST>, NumericAlgebra<MST>, ScaleOperations<MST> {
|
||||
*/
|
||||
@OptIn(UnstableKMathAPI::class)
|
||||
public object MstRing : Ring<MST>, NumbersAddOperations<MST>, ScaleOperations<MST> {
|
||||
public override val zero: MST.Numeric = MstGroup.zero
|
||||
public override val zero: MST.Numeric get() = MstGroup.zero
|
||||
public override val one: MST.Numeric = number(1.0)
|
||||
|
||||
public override fun number(value: Number): MST.Numeric = MstGroup.number(value)
|
||||
@ -109,8 +109,8 @@ public object MstField : Field<MST>, NumbersAddOperations<MST>, ScaleOperations<
|
||||
* [ExtendedField] over [MST] nodes.
|
||||
*/
|
||||
public object MstExtendedField : ExtendedField<MST>, NumericAlgebra<MST> {
|
||||
public override val zero: MST.Numeric = MstField.zero
|
||||
public override val one: MST.Numeric = MstField.one
|
||||
public override val zero: MST.Numeric get() = MstField.zero
|
||||
public override val one: MST.Numeric get() = MstField.one
|
||||
|
||||
public override fun bindSymbol(value: String): MST.Symbolic = MstField.bindSymbol(value)
|
||||
public override fun number(value: Number): MST.Numeric = MstRing.number(value)
|
||||
|
@ -40,11 +40,9 @@ public class ViktorNDField(public override val shape: IntArray) : NDField<Double
|
||||
else -> produce { this@f64Buffer[it] }.f64Buffer
|
||||
}
|
||||
|
||||
public override val zero: ViktorNDStructure
|
||||
get() = F64Array.full(init = 0.0, shape = shape).asStructure()
|
||||
public override val zero: ViktorNDStructure by lazy { F64Array.full(init = 0.0, shape = shape).asStructure() }
|
||||
|
||||
public override val one: ViktorNDStructure
|
||||
get() = F64Array.full(init = 1.0, shape = shape).asStructure()
|
||||
public override val one: ViktorNDStructure by lazy { F64Array.full(init = 1.0, shape = shape).asStructure() }
|
||||
|
||||
private val strides: Strides = DefaultStrides(shape)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user