add: example and Readme

This commit is contained in:
therealansh 2021-06-05 11:14:02 +05:30
parent abb3d9fe50
commit 590910ac2d
4 changed files with 49 additions and 0 deletions

View File

@ -200,6 +200,12 @@ One can still use generic algebras though.
> **Maturity**: PROTOTYPE > **Maturity**: PROTOTYPE
<hr/> <hr/>
* ### [kmath-jafama](kmath-jafama)
>
>
> **Maturity**: PROTOTYPE
<hr/>
* ### [kmath-jupyter](kmath-jupyter) * ### [kmath-jupyter](kmath-jupyter)
> >
> >

View File

@ -44,6 +44,8 @@ dependencies {
implementation("org.slf4j:slf4j-simple:1.7.30") implementation("org.slf4j:slf4j-simple:1.7.30")
// plotting // plotting
implementation("space.kscience:plotlykt-server:0.4.0") implementation("space.kscience:plotlykt-server:0.4.0")
//jafama
implementation(project(":kmath-jafama"))
} }
kotlin.sourceSets.all { kotlin.sourceSets.all {

View File

@ -0,0 +1,17 @@
/*
* Copyright 2018-2021 KMath contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package space.kscience.kmath.jafama
import net.jafama.FastMath
fun main(){
val a = JafamaDoubleField.number(2.0)
val b = StrictJafamaDoubleField.power(FastMath.E,a)
println(JafamaDoubleField.add(b,a))
println(StrictJafamaDoubleField.ln(b))
}

24
kmath-jafama/README.md Normal file
View File

@ -0,0 +1,24 @@
# Module kmath-jafama
Jafama based implementation of DoubleField of kmath-operations.
- JafamaDoubleField : DoubleField implementation using FastMath
- StrictJafamaDoubleField - DoubleField implementation using StrictFastMath
## Examples
Different Operations on DoubleField
```kotlin
package space.kscience.kmath.jafama
import net.jafama.FastMath
fun main(){
val a = JafamaDoubleField.number(2.0)
val b = StrictJafamaDoubleField.power(FastMath.E,a)
println(JafamaDoubleField.add(b,a))
println(StrictJafamaDoubleField.ln(b))
}
```