Create object with factory method for generating RealNDElement. #36

Merged
Zelenyy merged 1 commits from dev into zelenyy 2019-01-23 11:34:23 +03:00
Zelenyy commented 2019-01-23 05:02:28 +03:00 (Migrated from github.com)
No description provided.
altavir (Migrated from github.com) reviewed 2019-01-23 10:59:35 +03:00
@ -0,0 +24,4 @@
*
* @param offset Index of the diagonal: 0 (the default) refers to the main diagonal, a positive value refers to an upper diagonal, and a negative value to a lower diagonal.
*/
fun triangle(dim1: Int, dim2: Int, offset : Int = 0) = NDElement.real2D(dim1, dim2){i, j -> if (i <= j + offset) 1.0 else 0.0}
altavir (Migrated from github.com) commented 2019-01-23 10:22:18 +03:00

Switch IDEA to modern codestyle convention: Settings->Editor->Code Style->Kotlin->set from->predefined-> Kotlin style guide

Switch IDEA to modern codestyle convention: Settings->Editor->Code Style->Kotlin->set from->predefined-> Kotlin style guide
@ -0,0 +71,4 @@
*/
fun logspace(range : Pair<ClosedFloatingPointRange<Double>,Int>, endPoint: Boolean = true, base : Double = 10.0) : RealNDElement {
val lin = linspace(range, endPoint).first
val fun_ = {x: Double -> power(base, x)}
altavir (Migrated from github.com) commented 2019-01-23 10:22:38 +03:00

Avoid python conventions

Avoid python conventions
Sign in to join this conversation.
No description provided.