logarithm

Logarithmic y axis with morris.js

不羁岁月 提交于 2019-12-04 14:07:48
I'm trying to get a logarithmic scale for the y-axis of a morris.js line chart. http://www.oesmith.co.uk/morris.js/lines.html I already tried playing with the yLabelFormat option, but it's not what I need. Any hint is appreciated. If there is no way of doing this with morris.js, you can suggest another lightweight javascript library to make simple line charts with logarithmic scale. You can extend Morris and modify the transY function to do the logarithmic scale. I also added the gridIntegers parameter to have only integers on the y-Axis. Remove the code after the transY function if you want

Logarithm Function in SPARQL Query

与世无争的帅哥 提交于 2019-12-04 13:51:49
I am trying to create a SPARQL query that performs the logarithm function on the returned results. I have implemented the Jena SPARQL engine in my java program, but have only been able to find these available functions : http://jena.sourceforge.net/ARQ/library-function.html Does anybody know of a way to take the logarithm (preferably the natural log) of a SPARQL return variable? Example query that works: SELECT DISTINCT ((?Transactions_Num) AS ?BusinessValue) WHERE {{?BusinessProcess relation:Transactions_Num ?Transactions_Num ;} } Example of query that I want to work (though currently does

How to draw a circle in a log-log plot in R?

 ̄綄美尐妖づ 提交于 2019-12-04 09:31:41
I have a plot with two logarithmic axes. I'd like to add a circle to a certain position of the plot. I tried to use plotrix , but this does not give options for "log-radius". # data to plot x = 10^(-1 * c(5:0)) y = x ^-1.5 #install.packages("plotrix", dependencies=T) # use require() within functions library("plotrix") plot (x, y, log="xy", type="o") draw.circle(x=1e-2, y=1e2, radius=1e1, col=2) How can I add a circle to my log-log plot? As krlmlr suggests, the easiest solution is to slightly modify plotrix::draw.circle() . The log-log coordinate system distorts coordinates of a circle given in

How do I compute logarithms in cryptography?

和自甴很熟 提交于 2019-12-04 05:58:28
问题 I am trying to perform non-linear functions on bytes to implement SAFER+. The algorithm requires computing base-45 logarithm on bytes, and I don't understand how to do it. log 45 (201) = 1.39316393 When I assign this to a byte, the value is truncated to 1, and I can't recover the exact result. How am I supposed to handle this? 回答1: Cryptography often uses prime fields, in this case, GF(257). Create an exponentiation table that looks like this: exp | log ----+---- 0 | 1 1 | 45 2 | 226 3 | 147

How to get lg2 of a number that is 2^k

╄→尐↘猪︶ㄣ 提交于 2019-12-04 03:31:10
What is the best solution for getting the base 2 logarithm of a number that I know is a power of two ( 2^k ). (Of course I know only the value 2^k not k itself.) One way I thought of doing is by subtracting 1 and then doing a bitcount: lg2(n) = bitcount( n - 1 ) = k, iff k is an integer 0b10000 - 1 = 0b01111, bitcount(0b01111) = 4 But is there a faster way of doing it (without caching)? Also something that doesn't involve bitcount about as fast would be nice to know? One of the applications this is: suppose you have bitmask 0b0110111000 and value 0b0101010101 and you are interested of (value &

axis equal in a Matlab loglog plot

好久不见. 提交于 2019-12-03 23:31:39
In Matlab the command 'axis equal': sets the aspect ratio so that equal tick mark increments on the x-,y- and z-axis are equal in size. This makes SPHERE(25) look like a sphere, instead of an ellipsoid However, when using the loglog plotting function, this doesn't work "properly". What I would like to happen is that I get an aspect ratio so that a given factor occupies the same visual distance. What actually happens is that >> loglog(2.^[1:20]*1e10,(2.^[1:20]).^2) >> axis equal results in rather than So that the slope 2 (from the squared) could be easily observed, and so that there wouldn't be

Find logarithm in cuda

我只是一个虾纸丫 提交于 2019-12-03 21:38:20
问题 How do I find logarithm in cuda? I'm looking for a device function. Thanks 回答1: You can use: logf(x) __logf(x) log2f(x) __log2f(x) log10f(x) __log10f(x) Taken from the CUDA Programming Guide (Appendix D). 回答2: As Ade says log* functions. Keep in mind that __log* might be fast but not accurate. 来源: https://stackoverflow.com/questions/5355557/find-logarithm-in-cuda

Compute logarithmic expression without floating point arithmetics or log

…衆ロ難τιáo~ 提交于 2019-12-03 17:09:22
I need to compute the mathematical expression floor(ln(u)/ln(1-p)) for 0 < u < 1 and 0 < p < 1 in C on an embedded processor with no floating point arithmetics and no ln function. The result is a positive integer. I know about the limit cases (p=0), I'll deal with them later... I imagine that the solution involves having u and p range over 0..UINT16_MAX , and appeal to a lookup table for the logarithm, but I cannot figure out how exactly: what does the lookup table map to? The result needs not be 100% exact, approximations are OK. Thanks! Since the logarithm is used in both dividend and

Logarithm Calculation with Windows 7 Calculator [closed]

帅比萌擦擦* 提交于 2019-12-03 14:58:52
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . I would like to use the Windows Calculator in Scientific Mode in order solve a very basic Logarithm equation but, unfortunately, I couldn't do that. Here is the problem: log_5 125=? Thank you very much for your help... Well, I know it equals to "3", but, how can I use the Windows Calculator to get computed that

What does “log*” mean?

烈酒焚心 提交于 2019-12-03 09:35:49
I have come across the term O(log* N) in a book I'm reading on data structures. What does log* mean? I cannot find it on Google , and WolframAlpha doesn't understand it either . It's iterated logarithm. See here for a description of lots of different time complexities, and here for more details on the iterated logarithm itself. The iterated logarithm is the number of times the logarithm has to be applied before the result becomes one or less. It's called iterated logarithm function . It is a very slowly growing function. For example: lg*(2) = 1 lg*(4) = 2 lg*(16) = 3 lg*(65536) = 4 lg*(2^65536