Add adapters of scalar functions to MST and vice versa #150

Merged
CommanderTvis merged 23 commits from kotlingrad into dev 2020-11-01 21:09:45 +03:00
CommanderTvis commented 2020-10-12 16:27:16 +03:00 (Migrated from github.com)

closes #149

closes #149
CommanderTvis commented 2020-10-12 16:33:28 +03:00 (Migrated from github.com)

$ ping @breandan

$ ping @breandan
altavir commented 2020-10-12 17:04:43 +03:00 (Migrated from github.com)

Please add tests and at least some documentation. Also an example in examples would be welcome.

Please add tests and at least some documentation. Also an example in `examples` would be welcome.
altavir (Migrated from github.com) reviewed 2020-10-13 15:36:56 +03:00
altavir (Migrated from github.com) commented 2020-10-13 15:36:56 +03:00

change to toMst()

change to toMst()
altavir (Migrated from github.com) reviewed 2020-10-13 15:37:57 +03:00
altavir (Migrated from github.com) commented 2020-10-13 15:37:57 +03:00

I think simple kmath-kotlingrad is appropriate

I think simple kmath-kotlingrad is appropriate
altavir (Migrated from github.com) approved these changes 2020-11-01 12:13:06 +03:00
@ -15,3 +23,4 @@
mavenCentral()
}
group = "kscience.kmath"
altavir (Migrated from github.com) commented 2020-11-01 12:04:44 +03:00

I do not like jitpack dependency here as well as other custom dependencies. You'd better move it to specific projects and explicitly list them in README both for the module and for examples.

I do not like jitpack dependency here as well as other custom dependencies. You'd better move it to specific projects and explicitly list them in README both for the module and for examples.
@ -11,3 +12,3 @@
repositories {
maven("https://dl.bintray.com/mipt-npm/kscience")
jcenter()
altavir (Migrated from github.com) commented 2020-11-01 12:05:25 +03:00

See the comment above. I think it makes sense to leave them here for people to see which repositories to use.

See the comment above. I think it makes sense to leave them here for people to see which repositories to use.
@ -0,0 +34,4 @@
@Test
fun simpleFunctionShape() {
val linear = "2*x+16".parseMath().toSFun<KMathNumber<Double, RealField>>()
if (linear !is Sum) fail()
altavir (Migrated from github.com) commented 2020-11-01 12:12:39 +03:00

Better to use AssertFalse

Better to use AssertFalse
CommanderTvis (Migrated from github.com) reviewed 2020-11-01 13:41:02 +03:00
@ -0,0 +34,4 @@
@Test
fun simpleFunctionShape() {
val linear = "2*x+16".parseMath().toSFun<KMathNumber<Double, RealField>>()
if (linear !is Sum) fail()
CommanderTvis (Migrated from github.com) commented 2020-11-01 13:41:01 +03:00

No. fail is better since it returns Nothing, so Kotlin DFA makes smart-cast of linear to Sum

No. `fail` is better since it returns Nothing, so Kotlin DFA makes smart-cast of `linear` to `Sum`
Sign in to join this conversation.
No description provided.