SimuPoLAS / blocky

blocky compression algorithm implementation in c++ for OpenFOAM
GNU General Public License v3.0
1 stars 3 forks source link

blocky compression with vectors or tensors #13

Open UgiNyaa opened 6 years ago

UgiNyaa commented 6 years ago

It does not compress as it should when dealing with lists of vectors or tensors

UgiNyaa commented 6 years ago

So I made a pull request about this issue, and i thought it was fixed, but it wasn't.

The problem is, that the parser would cut out a vector. That means that he parses the first two components, but since the third is not fully in the buffer, it waits for a next buffer fill. This is where the problem occurs. When called with the newly filled buffer, it only sees a single number with a bracket at the end.

I thought of an solution, that would spare us the control in listparser (the bracket checks are currently done in listparser). It would consist of making not only blockyparser, which only parsers single numbers, but to also make a parser for vectors and tensors. With this, the logic would not depend on listparser, and can be fully controlled by the separate parsers: