Kotlin

From Efficient Java Matrix Library
Revision as of 05:47, 29 October 2020 by Peter (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

EJML in Kotlin!

EJML works just fine when used in the Kotlin JVM environment. EJML also provides specialized Kotlin support in the form of Kotlin extensions. A complete list of extensions can be found on Github. This is still considered a preview feature. Suggestions and pull requests to improve the Kotlin support are most welcomed!

Kotlin

val c = H*P
val S = multTransB(c,H,null)
S += R
S_inv = S.invert()
multTransA(H,S_inv,d);
K = P*D


Java

mult(H,P,c);
multTransB(c,H,S);
addEquals(S,R);
if( !invert(S,S_inv) ) 
    throw new RuntimeException("Invert failed");
multTransA(H,S_inv,d);
mult(P,d,K);