Add mapping for other dynamic operations

This commit is contained in:
Iaroslav 2020-06-26 14:57:07 +07:00
parent e47ec1aeb9
commit a275e74cf2
No known key found for this signature in database
GPG Key ID: 46E15E4A31B3BCD7
2 changed files with 5 additions and 1 deletions

View File

@ -17,6 +17,10 @@ interface ExtendedFieldOperations<T> :
override fun unaryOperation(operation: String, arg: T): T = when (operation) { override fun unaryOperation(operation: String, arg: T): T = when (operation) {
TrigonometricOperations.COS_OPERATION -> cos(arg) TrigonometricOperations.COS_OPERATION -> cos(arg)
TrigonometricOperations.SIN_OPERATION -> sin(arg) TrigonometricOperations.SIN_OPERATION -> sin(arg)
TrigonometricOperations.TAN_OPERATION -> tan(arg)
InverseTrigonometricOperations.ACOS_OPERATION -> acos(arg)
InverseTrigonometricOperations.ASIN_OPERATION -> asin(arg)
InverseTrigonometricOperations.ATAN_OPERATION -> atan(arg)
PowerOperations.SQRT_OPERATION -> sqrt(arg) PowerOperations.SQRT_OPERATION -> sqrt(arg)
ExponentialOperations.EXP_OPERATION -> exp(arg) ExponentialOperations.EXP_OPERATION -> exp(arg)
ExponentialOperations.LN_OPERATION -> ln(arg) ExponentialOperations.LN_OPERATION -> ln(arg)

View File

@ -13,7 +13,7 @@ package scientifik.kmath.operations
interface TrigonometricOperations<T> : FieldOperations<T> { interface TrigonometricOperations<T> : FieldOperations<T> {
fun sin(arg: T): T fun sin(arg: T): T
fun cos(arg: T): T fun cos(arg: T): T
fun tan(arg: T): T = sin(arg) / cos(arg) fun tan(arg: T): T
companion object { companion object {
const val SIN_OPERATION = "sin" const val SIN_OPERATION = "sin"