Channels

#mathematics

- b
breandan

02/06/2019, 3:04 PM**@altavir**Have you thought about using F-bounded quantification in your algebra? It’s a nice way to get concrete types out of an abstract structure while only defining behavior once on the most generic type. For example, try to define an extension function

over an arbitrary buffer whose elements are subtypes of`buffer.min()`

where`Comparable`

returns a specific type (i.e. not a`min()`

)? Can you implement it using a single function?`Comparable`

a- 2
- 21

- m
Micah Church

02/21/2019, 5:04 AMI'm having difficulties with getting gradle to use the kmath repository, I have followed the steps for the dependency and repository as provided by the link but I cant seem to find the right Tag to put there👍 1a- 2
- 23

- m
Micah Church

02/21/2019, 7:00 AMWhere could I find documentation for initialization of the Buffer structure? Edit never mind I'm pretty sure I'll figure it out soona- 2
- 5

- m
Micah Church

02/21/2019, 8:13 AMI'm not really sure if this would be something for this project, I know when it comes to large matrices simple operations like dot product, transposition etc can be very slow due to the number of elements. A while back was looking into cache oblivious algorithms, so in the case of matrix multiplication it would divide the matrix into smaller block matrices that would at run time determine the optimal size to put data into the caches of the cpu, these oblivious algorithms, some search algorithms as well, ran at nearly constant speed in terms of effiencey regardless of the dimensions. Like I said not sure if it would be something for hear or elsewhere but attempting to implement some on intensive algorithms may be useful. For instance I know that tensorflow at points can be very slow just due to tensor operationsa- 2
- 8

- m
Micah Church

02/21/2019, 2:30 PMI keep getting an error related to Import scientifik.kmath.transform its saying it's an unresolved reference, everything else is imported and works finea- 2
- 17

- m
Micah Church

02/22/2019, 6:22 AMDue to my limited familiarity with Kotlin, and Java in general I think it would be in everyone's best interest if I attempted to start in on the documentation of what is already implemented. This way i waste as little of everyone's time as is possible. It would also be good for my familiarity with the language. I will attempt and a documentation of something that isnt documented as well as at least one example. If it alright with you I could send an example one and based on your input kind of go my own way from there. Then I could let you know at the end when I'm done with say documenting Complex. Please let me know what you think of this for I dont want to bother anyone with rudimentary questions, in the meantime I will also try to get the aformentioned stuff done that I am already working on namely the checking of the fourier transforma- 2
- 3

- t
thomasnield

03/23/2019, 2:49 PMPresentation proposal for KotlinConf submitted.a- 2
- 8

- t
thomasnield

03/23/2019, 2:53 PM**@altavir**I am going to resume my use case for kmath hopefully this week. I kind of want to learn how to build MIP solvers from scratch (minus the matrix work which kmath will do) so I can create hybrid optimization models at work. I've got a massive, critical project at work using simulated annealing, and it seems to work great. But I want to explore linear/integer programming solutions and see if I can avoid 3rd party solvers by using my own heuristics and hybrid models.a- 2
- 4

- b
bjonnh

03/26/2019, 11:33 PMAs soon as matrix stuff is here, I'll give it a try for my spin simulator.a- 2
- 3

- b
bjonnh

04/12/2019, 2:34 AM**@altavir**how dynamic are these additional metadata? wouldn't that add some overhead for each matrix? Is that something other libs do?a- 2
- 3

- a
Ahmed hamuda

04/12/2019, 10:33 AMHi**@altavir**in this class you use a

as an external library for transforms: https://github.com/mipt-npm/kmath/blob/master/kmath-commons/src/main/kotlin/scientifik/kmath/transform/Transformations.kt but it can be compiled for other platforms (`apache-commons`

**kolin/native**,**kotlin/js**) ?a- 2
- 3

- a
Ahmed hamuda

04/13/2019, 7:34 PMWelcome**@altavir**at bottom of this doc https://github.com/mipt-npm/kmath/blob/master/doc/algebra.md there's note

What do you mean with jvm boxing?`Fields themselves do not solve the problem of JVM boxing, but it is possible to solve with special contexts like MemorySpec.`

a- 2
- 1

- t
thomasnield

04/21/2019, 2:31 PM**@altavir**Awesome! I think this exciting and just in time when my need to do linear algebra is starting to intensify. Regarding priorities with performance, I agree.**@elizarov**posted something relevant the other day: https://twitter.com/relizarov/status/1119290897705906178a- 2
- 1

- a
Ahmed hamuda

04/28/2019, 9:19 PMHello every body i’m trying the lib, i wanna do some thing like in picture but the nd struct not have setter, what’s the alternative way?a- 2
- 5

- a
altavir

05/12/2019, 1:19 PMA new article: https://medium.com/@altavir/diving-deeper-into-context-oriented-programming-in-kotlin-3ecb4ec38814 . Second and third examples are about mathematics.👍 7b- 2
- 2

- a
altavir

06/05/2019, 5:20 PMI am thinking about names and pronunciation. Currently we have

, which could be pronounced as`kmath`

, which sounds good, and similar to ktor. On the other hand, we have`key-math`

which could be pronounced as`plotly.kt`

, it is probably even better. Do we need to rename`plotly-kit`

to`kmath`

(kould be pronounced as`math.kt`

), while it is not so popular and the name could be changed painlessly.`math-kit`

th- 3
- 20

- t
thomasnield

06/05/2019, 10:40 PM**@altavir**have operators not been plugged in yet as extension functions or something? I can help here if you like.a- 2
- 2

- t
thomasnield

06/05/2019, 10:40 PM-.kta- 2
- 1

- t
thomasnield

06/05/2019, 10:40 PMAlso I do think we will need to bring in a few random distribution functions.a- 2
- 1

- t
thomasnield

06/06/2019, 4:57 PM-.ma- 2
- 1

- t
thomasnield

06/06/2019, 5:04 PM**@altavir**yes, let me see if I can run with that and hammer out a number of top-level functions I find necessary. Then we can find a home for thema- 2
- 1

- t
thomasnield

06/06/2019, 5:06 PMI'd like this to have a NumPy-like interface, but less Pythony and more Kotlina- 2
- 7

- t
thomasnield

06/06/2019, 6:42 PMI created an experimental repository here. https://github.com/thomasnield/numkya- 2
- 3

- t
thomasnield

06/07/2019, 3:10 PM**@altavir**we definitely need some random distributions.a- 2
- 5

- a
altavir

06/09/2019, 5:10 AMFrankly speaking, I was waiting for a question about why random number generation from distribution is coroutine-based. But since it never came, I can answer it (since It is important). There are several concerns, like remote chain sampling, but for now I am thinking about a feature very important to Monte-Carlo sampling. Namely, ability to use PRNG with fixed seed in a deterministic way even with parallel execution (it is important for testing). This feature does not exist in most frameworks (I believe they have something like this in Julia, but it has limitations). In kotlint, I believe, it could be done by attaching RNG or at least its seed to the coroutine context, which in turn requires deterministic order of context initialization. The issue is here: https://github.com/mipt-npm/kmath/issues/65 and I invite everyone (especially**@elizarov**and coroutine specialists) to the discussion. It won't be implemented in near future, but I think that if we can manage it, it would be quite an achievement.😮 1 - m
mccorby

06/09/2019, 2:57 PMHi, Can KMath work with

?`BigInteger`

ab- 3
- 6

- b
breandan

06/21/2019, 6:07 AMNice example of a shape-safe linear algebra API in Rust: https://www.nalgebra.org/vectors_and_matrices/a- 2
- 7

- a
altavir

06/21/2019, 9:36 AM**@breandan**Here you are: https://github.com/mipt-npm/kmath/blob/dimensions/kmath-dimensions/src/commonTest/kotlin/scientifik/kmath/dimensions/DMatrixContextTest.kt This is all I can do today, but it seems to be lie what you wanted. I have not tried to work with with custom dimensions, but it should work as well.b- 2
- 2

- b
breandan

08/14/2019, 8:50 PMDSL for building mathematical functions which supports type-safe variable capture and partial application: https://github.com/breandan/kotlingrad/blob/master/src/main/kotlin/edu/umontreal/kotlingrad/samples/VariableCapture.kt👍 2🤯 1a- 2
- 8

- m
mccorby

09/21/2019, 5:52 AMHow could I create and operate on a multidimensional structure? I can do it with

butI get a bit lost when I try to do it with a more generic structure`Matrix`

a- 2
- 6