Skip to content

Commit

Permalink
add: example and Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
therealansh committed Jun 5, 2021
1 parent de72b73 commit 9a810f9
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ dependencies {
implementation("org.slf4j:slf4j-simple:1.7.30")
// plotting
implementation("space.kscience:plotlykt-server:0.4.0-dev-2")

//jafama
implementation(project(":kmath-jafama"))
}

kotlin.sourceSets.all {
Expand Down
Original file line number Diff line number Diff line change
@@ -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 changes: 24 additions & 0 deletions kmath-jafama/README.md
Original file line number Diff line number Diff line change
@@ -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))
}
```

0 comments on commit 9a810f9

Please sign in to comment.