Kotlin

From Efficient Java Matrix Library
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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);