Friday, June 5, 2020

Digest for comp.lang.c++@googlegroups.com - 5 updates in 3 topics

Dash <dash.fischer@gmail.com>: Jun 05 11:16PM +0200

On 05/06/2020 21:41, alelvb wrote:
 
> Thank you so so much.
 
> But the curious thing is that it worked for size smaller than 4.
> thank you
 
No it doesn't work either.
 
Replace the line
Matrix<double> m {{0,1,0},{0,1,2},{1,0,1}}; //OK
with
Matrix<double> m {{0,0,1},{0,1,2},{1,0,1}}; //OK
 
and you'll get the same bounding error.
 
-- Dash
Paavo Helde <eesnimi@osa.pri.ee>: Jun 06 12:58AM +0300

05.06.2020 22:41 alelvb kirjutas:
 
> Thank you Mr Helde,
> that was right the problem. Now it works. If I tell you that I watched
> the code for a couple of days without any clue do you believe me?
 
I guess you don't have the right tools, or you don't know how to use
them. My compiler pinpointed the problem in seconds:
 
Debug Assertion Failed!
 
Program: C:\WINDOWS\SYSTEM32\MSVCP140D.dll
File: c:\program files (x86)\microsoft visual
studio\2017\professional\vc\tools\msvc\14.11.25503\include\vector
Line: 1796
 
Expression: vector subscript out of range
 
 
> Thank you so so much.
 
> But the curious thing is that it worked for size smaller than 4.
> thank you
 
That's what is called undefined behavior. The code might appear to work,
crash mysteriously, or fail with assert failures like above. And yes, in
my setup it also fails with assert failures for smaller sizes than 4.
Maciej Sobczak <see.my.homepage@gmail.com>: Jun 05 01:52PM -0700

Hi,
 
I am pleased to announce the release of Embedded HTTP Server, which is a simple library for C++ that allows to treat a web browser as a display device for program's GUI:
 
http://www.inspirel.com/httpserver/
 
The library is free and open source with the Boost license.
 
 
Disclaimer: the idea behind this library is not particularly novel and the term is already established:
 
https://en.wikipedia.org/wiki/Embedded_HTTP_server
 
This package offers a straightforward, C++11 implementation of that idea.
 
--
Maciej Sobczak * http://www.inspirel.com
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Jun 05 01:42PM -0700

On 6/4/2020 7:06 PM, Chris M. Thomasson wrote:
> [...]
 
> Wrt fast, check this out wrt obtaining the hypotenuse:
 
> https://forums.parallax.com/discussion/147522/dog-leg-hypotenuse-approximation
 
Humm... Fwiw, imvho, it would be fun to use this interesting
approximation for normalization of vectors in my experimental field.
sqrt is used to gain the length of a vector wrt normalization, well,
that makes a triangle, that can be used with the approx...
 
For instance the following animation uses the test vector field with
sqrt. It uses cos sin as well to gain the spirals wrt interpolating from
0...pi/2 where 0 is neutral and pi/2 is the equipotential in a 2d field.
However, I want to focus on the sqrt approx for now. Actually, I do not
need cos and sin to gain the perpendicular field in 2d. I use them to be
able to smoothly animate an interpolation of angles from 0...pi/2.
 
https://youtu.be/JIM-QioOhdY
 
Wonder what the approximation would look like visually when compared to
the original... Humm...
 
Fwiw, this can go 3d, humm... Need to add a z parameter the the dog leg
approx... In 2d they are alwyas zero. Here is an example in 3d using sqrt:
 
https://skfb.ly/6QU86
 
Here is a field where the lines are drawn from a 3d grid:
 
https://skfb.ly/6St9p
 
 
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>: Jun 05 01:45PM -0700

On 6/4/2020 7:06 PM, Chris M. Thomasson wrote:
 
> Btw, can you run this?
 
> It really should be using an arbitrary precision floating point package.
> Or perhaps, rationals might work as well.
 
I have a lot of examples that can be tested against the approximation:
 
https://youtu.be/Q-qEPlK7-NE
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com.

No comments: