k

[kdb+/q]: Convert adjacency matrix to adjacency list

喜欢而已 提交于 2020-01-16 08:23:26
问题 Given (rectangular) adjacency matrix m , how to construct adjacency list in q language? In QIdioms wiki I've found solution in the k language which when run through q console with k) command gives me 'vs error: m:(1 0 1;1 0 1) k) (^m)_vs &,/m 'vs Result should be: 0 0 1 1 0 2 0 2 This is what I was able to replicate in q : k) &,/m 0 2 3 5 q) where raze m 0 2 3 5 k 's ^ a.k.a. shape verb is missing in q so I just did: k) (^m) 000b 000b q) 2 3#0b 000b 000b Now, since: q) parse "vs" k) {x\:y} I

[kdb+/q]: Convert adjacency matrix to adjacency list

吃可爱长大的小学妹 提交于 2020-01-16 08:23:11
问题 Given (rectangular) adjacency matrix m , how to construct adjacency list in q language? In QIdioms wiki I've found solution in the k language which when run through q console with k) command gives me 'vs error: m:(1 0 1;1 0 1) k) (^m)_vs &,/m 'vs Result should be: 0 0 1 1 0 2 0 2 This is what I was able to replicate in q : k) &,/m 0 2 3 5 q) where raze m 0 2 3 5 k 's ^ a.k.a. shape verb is missing in q so I just did: k) (^m) 000b 000b q) 2 3#0b 000b 000b Now, since: q) parse "vs" k) {x\:y} I

Keeping your code in L1 cache

痞子三分冷 提交于 2019-12-04 11:13:06
问题 I have been reading Wikipedia's article on K programming language and this is what I saw: The small size of the interpreter and compact syntax of the language makes it possible for K applications to fit entirely within the level 1 cache of the processor. I am intrigued. How is it possible to have the whole program in L1 cache? Say, CPU has 256kb L1 cache. Say my program is way less than that and it needs a very little amount of memory (say, just for the call stack and such). Say, it doesn't

Keeping your code in L1 cache

空扰寡人 提交于 2019-12-03 07:45:34
I have been reading Wikipedia's article on K programming language and this is what I saw: The small size of the interpreter and compact syntax of the language makes it possible for K applications to fit entirely within the level 1 cache of the processor. I am intrigued. How is it possible to have the whole program in L1 cache? Say, CPU has 256kb L1 cache. Say my program is way less than that and it needs a very little amount of memory (say, just for the call stack and such). Say, it doesn't need any libraries (although if a program is for an OS, it would need to include kernel32.dll or

APL versus A versus J versus K?

百般思念 提交于 2019-12-03 00:29:17
问题 The array-language landscape, while fascinating, is confusing to no end. Is there a reason to pick one of J or K or APL or A? None of these options seem to be open-sourced -- are there open sourced versions? I would love the expand my mind, but I remain befuddled. 回答1: The differences among these languages are relatively subtle. APL "proper" has the advantages, and disadvantages, of the original symbolic notation. (There are minor changes that have been made to the symbol set over the years,

APL versus A versus J versus K?

馋奶兔 提交于 2019-12-02 14:06:11
The array-language landscape, while fascinating, is confusing to no end. Is there a reason to pick one of J or K or APL or A? None of these options seem to be open-sourced -- are there open sourced versions? I would love the expand my mind, but I remain befuddled. kaleidic The differences among these languages are relatively subtle. APL "proper" has the advantages, and disadvantages, of the original symbolic notation. (There are minor changes that have been made to the symbol set over the years, but they're all true enough to the original vision.) The A+ language is available open source. It