POV-Ray : Newsgroups : povray.text.scene-files : [Minimum Volume] Bounding Ellipsoid via SVD : Re: [Minimum Volume] Bounding Ellipsoid via SVD Server Time
23 Jun 2024 14:58:27 EDT (-0400)
  Re: [Minimum Volume] Bounding Ellipsoid via SVD  
From: jr
Date: 10 Nov 2019 09:50:01
Message: <web.5dc82312f7b9a3affeeb22ff0@news.povray.org>

"Bald Eagle" <cre### [at] netscapenet> wrote:
> "jr" <cre### [at] gmailcom> wrote:
> > the latter, I'm confident, although somewhat unsure of exact syntax.
> OK - I just usually search-engine my way to a solution   :)
> > suggestion: attach your working version of svd.cpp, so we talk same code.  I'll
> > play with it here to test; are the matrices filled just with floats?
> Right on.
> At the moment, my thoughts are:
> 1. the data must get read into a faux-matrix std::vector container, which I
> suppose has to be created before assigning the data to it
> 2. it should have m rows - the number of vectors to process, and m columns - the
> first 3 are x, y, and z, and all the remaining columns are zeros
> Then hopefully I can use that lesson to apply the SVD output to the data in the
> SDL scene.
> There's hardly any data in the header file - I'm assuming that can just be added
> to the top of the .cpp file to keep it all self-contained.

it's been .. quiet.  in case you haven't addressed 1/2 yet, here's a quick,
though inefficient (and inelegant), hack.  in the 'generate_matrix' function,
there's an assignment in the innermost 'for()'.  if you change that line to
  std::cin >> matrix[row[col];
then you can pipe your data in.  inefficient because you're reading one value at
a time.  say you want a 2x2 matrix:
1.0 2.0
3.0 4.0

then your data file should read:

and you'd execute:
$ ./a.out < myfile

while I haven't actually tried it here, I'm quite confident it'll work.  in the
long run you'd want to read and process a row of data at a time though.  hth.

regards, jr.

Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.