Return field get access in algebras
This commit is contained in:
parent
522f39cef3
commit
fd51564628
@ -50,7 +50,7 @@ public object MstGroup : Group<MST>, NumericAlgebra<MST>, ScaleOperations<MST> {
|
|||||||
*/
|
*/
|
||||||
@OptIn(UnstableKMathAPI::class)
|
@OptIn(UnstableKMathAPI::class)
|
||||||
public object MstRing : Ring<MST>, NumbersAddOperations<MST>, ScaleOperations<MST> {
|
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 val one: MST.Numeric = number(1.0)
|
||||||
|
|
||||||
public override fun number(value: Number): MST.Numeric = MstGroup.number(value)
|
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.
|
* [ExtendedField] over [MST] nodes.
|
||||||
*/
|
*/
|
||||||
public object MstExtendedField : ExtendedField<MST>, NumericAlgebra<MST> {
|
public object MstExtendedField : ExtendedField<MST>, NumericAlgebra<MST> {
|
||||||
public override val zero: MST.Numeric = MstField.zero
|
public override val zero: MST.Numeric get() = MstField.zero
|
||||||
public override val one: MST.Numeric = MstField.one
|
public override val one: MST.Numeric get() = MstField.one
|
||||||
|
|
||||||
public override fun bindSymbol(value: String): MST.Symbolic = MstField.bindSymbol(value)
|
public override fun bindSymbol(value: String): MST.Symbolic = MstField.bindSymbol(value)
|
||||||
public override fun number(value: Number): MST.Numeric = MstRing.number(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
|
else -> produce { this@f64Buffer[it] }.f64Buffer
|
||||||
}
|
}
|
||||||
|
|
||||||
public override val zero: ViktorNDStructure
|
public override val zero: ViktorNDStructure by lazy { F64Array.full(init = 0.0, shape = shape).asStructure() }
|
||||||
get() = F64Array.full(init = 0.0, shape = shape).asStructure()
|
|
||||||
|
|
||||||
public override val one: ViktorNDStructure
|
public override val one: ViktorNDStructure by lazy { F64Array.full(init = 1.0, shape = shape).asStructure() }
|
||||||
get() = F64Array.full(init = 1.0, shape = shape).asStructure()
|
|
||||||
|
|
||||||
private val strides: Strides = DefaultStrides(shape)
|
private val strides: Strides = DefaultStrides(shape)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user