POV-Ray : Newsgroups : povray.programming : Programmng a Sparse Data Structure : Programmng a Sparse Data Structure Server Time
28 Jul 2024 12:36:26 EDT (-0400)
  Programmng a Sparse Data Structure  
From: Geoff Wedig
Date: 17 Jul 2001 11:03:23
Message: <3b5453ba@news.povray.org>
I'm working on a patch for POV, and I'd like to keep it in c, but I've come
up with a problem, namely, I don't really want to program a complex data
structure in c, but I need to.

See, I've got a matrix of edge counts from vertex to vertex in a mesh.  In
general, the count is 0, and only for a very few is it larger (5-7 per
vertex, I'd guess, but there are many thousand vertices in a large mesh)

My initial run works fine, but it uses a basic matrix of values for storing
these.  It's mostly empty, and *very* expensive, due to the large number of
vertices.

If I were working in c++, I could store non-zero elements in a map with a
lookup, but in c that isn't an option.  So I'm left with implementing my own
data structure, which is icky.

Or, maybe there's something already out there.  Does anyone know of such a
data structure that I could use, maybe within POV itself?  If not, I might
just write the bit of code I need in c++ and say to heck with it, but I'd
rather stay 'standard', if such can ever be said when discussing a patch. :/

Geoff


Post a reply to this message

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