|
Manoj Kumar Rai wrote: but "^" is a logical exclusive - OR for binary type.
Actually for single bits.
Manoj Kumar Rai wrote: "^" for the integral types (as above in your case) computes bitwise exclusive-OR of its operand. hence it will compare the each bit and apply exclusive-OR on each bits to find the last result.
He asked about doubles!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
I expect that Math.Pow is what you want, but in some organizations you can get in trouble for thinking, so use the statement as told and shrug your shoulders when someone reports a bug.
|
|
|
|
|
Hi Matthias,
Try **. Just kidding
Jeff
|
|
|
|
|
Hey folks,
I've got a simple question:
What's your favorite Math-Library (besides Math.h
I need a really good math-library which has FFT and SVD and a bunge of other stuff...
*I tried JAMA, which is not too bad, but has too few functions for me
*Matpack (surely a great Library but I only get errors when trying to compile)
(www.matpack.de - maybe someone can help me get this running)
*I even tried copying (well, more like typing from) "Numerical recipes in C" and even those ended in an endless loop when trying to do an svd.
any suggestions?
|
|
|
|
|
|
I don't know what your detailed requirements are, there is no gold standard of which I am aware. Recently I have been using Intel MKL - this has impressive FFT performance, haven't used SVD yet. For freeware FFT, FFTW is probably the best. I have used IMSL but it is expensive, and I have a query in my mind over licensing for use in products. For free linear algebra you could consider getting a fortran compiler and compiling the NETLIB routines you want into a library.
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
how about Blitz its gives you matlab like capabilities for C++
here is the link: http://www.oonumerics.org/blitz/
|
|
|
|
|
I'm on the same hunt for other reasons. Blitz looks good but even it seems to rely on the IEEE 754:1985 approx implementation built into the C Runtime . Do you know of any indepenent IEEE/libm implementation in C++?
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Hi Queezy,
I can't speak for FFTs and SVD (what are you doing with decomposition, BTW? I recently read a paper which used SVDs as a text indexing algorithm such as Google), but I personally love Crypto++ for anything Cryptography related. This includes its Large Integer package, and Elliptical Curve implementation.
Jeff
|
|
|
|
|
Does anyone know of any good algorithms for calculating a total shipment cube size based on the sizes and quantities of the products in that shipment?
|
|
|
|
|
You may have to look at figuring the volume of each individual product, how many to ship at a time, and then figure out the cube size based on the total volume of the products being shipped...
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Hi All,
I need to find the value after decimal in mathematical way...
Ex: I have a number 19.56 and my formula gives me .56
Please help me...
Thanks in advance...
|
|
|
|
|
What language are you programming in?
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
Thanks for the help.I need a mathematical way I dont want to use programming language for this....
|
|
|
|
|
By convention there is the [] operator, defined the following way
[x] = the integer part of x
hence you can use
x-[x]
to extract the decimal part of x
But, I know, it's just another way to say: 'take the decimal part of x ' (BTW it is also a perfectly accetable function definition).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
ExpertComing wrote: The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
LOL...
|
|
|
|
|
in mathematical way I would say
.56 = 19.56 - floor(19.56)
or in c++
float rest = 19.56 - int(19.56);
sufficient?
|
|
|
|
|
|
|
I think it is important for you to clarify what to do with negative numbers. What would you want to obtain with -19.56? -.56 or .44 (=-19.56-20.00)? The formula is usually simple for positive numbers because we all agree the integer part is the largest integer not greater than the given number, but for negative numbers we have to decide which reference to have (either 0 or -oo).
Rilhas
|
|
|
|
|
|
Hi.
I have a multidimensional integer array that represents the colors of a image:
<br />
0 0 1 0 0 0<br />
0 0 1 0 0 0<br />
0 1 0 1 0 0<br />
0 1 0 1 0 0<br />
0 0 1 0 0 0<br />
0 0 1 0 0 0<br />
(in this case, white = 0 & black = 1)
This color map can vary in size, but I don't think that tributes to the solution here.
What I need is a edge detection that detects only the side of the black image;
<br />
0 2 1 2 0 0<br />
0 2 1 2 0 0<br />
2 1 0 1 2 0<br />
2 1 0 1 2 0<br />
0 2 1 2 0 0<br />
0 2 1 2 0 0<br />
2 = detected edge, 1 = black, 0 = white.
I was trying to traverse the hole color map, row by row, pixel by pixel on each side of the rectangle, and when a black color was found, the loop would break and save the position it was at, like this:
textureData[,] - Contains the color map.<br />
<br />
for (int x = 0; x < texture.Width; x++)<br />
{<br />
for (int y = 0; y < texture.Height; y++)<br />
{<br />
if (textureData[x, y] != 0)<br />
{<br />
edgePoints.Add(new Point(x , y));<br />
break;<br />
}<br />
}<br />
}
This works for finding one side, but i can't seem to make a loop for other sides. Please help me.
|
|
|
|
|
Hi,
you should not break out of the for loop; instead you should record every
transition: whenever 0 is followed by 1 you have a positive edge, whenever
1 is followed by 0 you have a negative edge.
So the sequence 0 0 1 1 1 1 0 1 1 0 0 0 has two positive and two negative edges.
You can apply this in any direction you want, typically you only need two
directions (left->right and top->bottom).
Of course a negative edge in left->right direction would be the same as
a positive edge in right->left direction.
Hope this helps
|
|
|
|
|
Yeah, that would make the detection more simple. Thanks.
|
|
|
|
|
hey folks,
I've got quite a complex question for you...
suppose I've got two triangles in different pictures. I can easily compute the homography between those.
Is there a way to compute a Homography for each so that the distortion for each triangle is minimized???
I guess the aspect ratio (or diagonals in a square using this homography) can be used for measuring the amount of distortion.
but how to compute those "points in the middle" where distortion is least??
Say, given are:
x_1,x_2,x_3 (for one triangle)
x_4,x_5,x_6 (for the other one)
We want to know:
x_7,x_8,x_9 ( our destination triangle )
We also know:
H*x_i = x_j (where i = 1,2,3 and j=7,8,9)
H = Homography (/Affine transformation)
and
G*x_i = x_j (where i = 4,5,6 and j=7,8,9)
G = Homography (/Affine transformation)
H =
a b t_x
c d t_y
0 0 1
a/d should be minimal... for H and G
Is it true that b=-c because of rotation which gives no distortion??
any hints and links are appreciated
|
|
|
|