digitalmars.D.announce - dlib - d utility library
- Timur Gafarov (14/14) Sep 28 2012 dlib is a growing collection of native D language libraries serving as a...
- Craig Dillabaugh (5/23) Sep 28 2012 Apart from a description of the project this site seems empty! Is
- Danny Arends (4/8) Sep 28 2012 If you want to browse it online (without check-out):
- Craig Dillabaugh (3/11) Sep 28 2012 Thanks. Now I was able to find it.
- Peter Alexander (23/28) Sep 28 2012 A note on your Vector implementation. Currently you use the
- Timur Gafarov (6/33) Sep 29 2012 Thanks! I didn't realize that about vectors. I'm interested in
- Jacob Carlborg (8/23) Sep 29 2012 Isn't the whole point of the array operators that it gives the compiler
- Rory McGuire (5/27) Sep 29 2012 more semantic understanding of the code. Just as a foreach-loop does
- Dmitry Olshansky (10/31) Sep 29 2012 In this case simply unrolling it would be much better
- Dmitry Olshansky (4/38) Sep 29 2012 --
dlib is a growing collection of native D language libraries serving as a framework for various higher-level projects - such as game engines, rendering pipelines and multimedia applications. It is written in D2 and has no external external dependencies aside D's standart library, Phobos. Currently dlib contains the following packages: dlib.core - standard algorithms, data structures, useful templates, etc. dlib.functional - some functional programming idioms (HOFs, combiners, quantifiers, etc.) dlib.math - linear algebra (vectors, matrices, quaternions, etc.) dlib.geometry - computational geometry (ray casting, primitives, etc.) dlib.image - image processing (filters, color correction, graphics formats I/O, support for 8 and 16-bit RGBA buffers and floating point operations). http://code.google.com/p/dlib/
Sep 28 2012
On Friday, 28 September 2012 at 09:43:34 UTC, Timur Gafarov wrote:dlib is a growing collection of native D language libraries serving as a framework for various higher-level projects - such as game engines, rendering pipelines and multimedia applications. It is written in D2 and has no external external dependencies aside D's standart library, Phobos. Currently dlib contains the following packages: dlib.core - standard algorithms, data structures, useful templates, etc. dlib.functional - some functional programming idioms (HOFs, combiners, quantifiers, etc.) dlib.math - linear algebra (vectors, matrices, quaternions, etc.) dlib.geometry - computational geometry (ray casting, primitives, etc.) dlib.image - image processing (filters, color correction, graphics formats I/O, support for 8 and 16-bit RGBA buffers and floating point operations). http://code.google.com/p/dlib/Apart from a description of the project this site seems empty! Is there anywhere a person can download the source code/try this out. Thanks. Craig
Sep 28 2012
Apart from a description of the project this site seems empty! Is there anywhere a person can download the source code/try this out.If you want to browse it online (without check-out): http://code.google.com/p/dlib/source/browse/ Gr, Danny
Sep 28 2012
On Friday, 28 September 2012 at 13:29:05 UTC, Danny Arends wrote:Thanks. Now I was able to find it. CraigApart from a description of the project this site seems empty! Is there anywhere a person can download the source code/try this out.If you want to browse it online (without check-out): http://code.google.com/p/dlib/source/browse/ Gr, Danny
Sep 28 2012
On Friday, 28 September 2012 at 09:43:34 UTC, Timur Gafarov wrote:dlib is a growing collection of native D language libraries serving as a framework for various higher-level projects - such as game engines, rendering pipelines and multimedia applications. It is written in D2 and has no external external dependencies aside D's standart library, Phobos.A note on your Vector implementation. Currently you use the vector operators, e.g. Vector!(T,size) opAddAssign (Vector!(T,size) v) body { arrayof[] += v.arrayof[]; return this; } This is fine for large vectors, but (correct me if I'm wrong), your vector class appears to be designed for small vectors. Those vector ops currently call a asm optimised function that uses SIMD instructions in a loop - it works well for larger vectors with hundreds of elements, but for small vectors it's significantly faster to just use: foreach (i; 0..size) arrayof[i] += v.arrayof[i]; I've also noticed that you've provided Matrix2x2 and Matrix4x4 as separate structs from the more generic Matrix. I'm guessing this is for specialisation. A more idiomatic way to handle this would be to use template specialisation to provide the optimised versions. That way, when people use Matrix!(T, 2, 2) they get all the benefits of Matrix2x2!T as well.
Sep 28 2012
28.09.2012 20:47, Peter Alexander пишет:On Friday, 28 September 2012 at 09:43:34 UTC, Timur Gafarov wrote:Thanks! I didn't realize that about vectors. I'm interested in performance optimization, so I will fix that as soon as possible. As for matrices - I used Matrix4x4 for a long time (that was just the simplest way), and recently introduced that generalized version. Eventually I will port everything into it.dlib is a growing collection of native D language libraries serving as a framework for various higher-level projects - such as game engines, rendering pipelines and multimedia applications. It is written in D2 and has no external external dependencies aside D's standart library, Phobos.A note on your Vector implementation. Currently you use the vector operators, e.g. Vector!(T,size) opAddAssign (Vector!(T,size) v) body { arrayof[] += v.arrayof[]; return this; } This is fine for large vectors, but (correct me if I'm wrong), your vector class appears to be designed for small vectors. Those vector ops currently call a asm optimised function that uses SIMD instructions in a loop - it works well for larger vectors with hundreds of elements, but for small vectors it's significantly faster to just use: foreach (i; 0..size) arrayof[i] += v.arrayof[i]; I've also noticed that you've provided Matrix2x2 and Matrix4x4 as separate structs from the more generic Matrix. I'm guessing this is for specialisation. A more idiomatic way to handle this would be to use template specialisation to provide the optimised versions. That way, when people use Matrix!(T, 2, 2) they get all the benefits of Matrix2x2!T as well.
Sep 29 2012
On 2012-09-28 19:47, Peter Alexander wrote:A note on your Vector implementation. Currently you use the vector operators, e.g. Vector!(T,size) opAddAssign (Vector!(T,size) v) body { arrayof[] += v.arrayof[]; return this; } This is fine for large vectors, but (correct me if I'm wrong), your vector class appears to be designed for small vectors. Those vector ops currently call a asm optimised function that uses SIMD instructions in a loop - it works well for larger vectors with hundreds of elements, but for small vectors it's significantly faster to just use: foreach (i; 0..size) arrayof[i] += v.arrayof[i];Isn't the whole point of the array operators that it gives the compiler more semantic understanding of the code. Just as a foreach-loop does compared to a for-loop. So the compiler should be able to optimize this and generated the most optimal code. But the compiler might not be that good. -- /Jacob Carlborg
Sep 29 2012
On Sep 29, 2012 2:55 PM, "Jacob Carlborg" <doob me.com> wrote:On 2012-09-28 19:47, Peter Alexander wrote:more semantic understanding of the code. Just as a foreach-loop does compared to a for-loop. So the compiler should be able to optimize this and generated the most optimal code. But the compiler might not be that good.A note on your Vector implementation. Currently you use the vector operators, e.g. Vector!(T,size) opAddAssign (Vector!(T,size) v) body { arrayof[] += v.arrayof[]; return this; } This is fine for large vectors, but (correct me if I'm wrong), your vector class appears to be designed for small vectors. Those vector ops currently call a asm optimised function that uses SIMD instructions in a loop - it works well for larger vectors with hundreds of elements, but for small vectors it's significantly faster to just use: foreach (i; 0..size) arrayof[i] += v.arrayof[i];Isn't the whole point of the array operators that it gives the compiler-- /Jacob Carlborg+1
Sep 29 2012
On 28-Sep-12 21:47, Peter Alexander wrote:On Friday, 28 September 2012 at 09:43:34 UTC, Timur Gafarov wrote:In this case simply unrolling it would be much better (if size is fixed and is small e.g. < 10). foreach (i; TypeTuple!(1, 2, 3, 4 ... )) //too bad we still don't have static Iota in Phobos { arrayof[i] += v.arrayof[i]; } -- Dmitry Olshanskydlib is a growing collection of native D language libraries serving as a framework for various higher-level projects - such as game engines, rendering pipelines and multimedia applications. It is written in D2 and has no external external dependencies aside D's standart library, Phobos.A note on your Vector implementation. Currently you use the vector operators, e.g. Vector!(T,size) opAddAssign (Vector!(T,size) v) body { arrayof[] += v.arrayof[]; return this; } This is fine for large vectors, but (correct me if I'm wrong), your vector class appears to be designed for small vectors. Those vector ops currently call a asm optimised function that uses SIMD instructions in a loop - it works well for larger vectors with hundreds of elements, but for small vectors it's significantly faster to just use: foreach (i; 0..size) arrayof[i] += v.arrayof[i];
Sep 29 2012
On 29-Sep-12 20:39, Dmitry Olshansky wrote:On 28-Sep-12 21:47, Peter Alexander wrote:Sorry I've meant 0, 1, 2, 3 ...On Friday, 28 September 2012 at 09:43:34 UTC, Timur Gafarov wrote:In this case simply unrolling it would be much better (if size is fixed and is small e.g. < 10). foreach (i; TypeTuple!(1, 2, 3, 4 ... ))dlib is a growing collection of native D language libraries serving as a framework for various higher-level projects - such as game engines, rendering pipelines and multimedia applications. It is written in D2 and has no external external dependencies aside D's standart library, Phobos.A note on your Vector implementation. Currently you use the vector operators, e.g. Vector!(T,size) opAddAssign (Vector!(T,size) v) body { arrayof[] += v.arrayof[]; return this; } This is fine for large vectors, but (correct me if I'm wrong), your vector class appears to be designed for small vectors. Those vector ops currently call a asm optimised function that uses SIMD instructions in a loop - it works well for larger vectors with hundreds of elements, but for small vectors it's significantly faster to just use: foreach (i; 0..size) arrayof[i] += v.arrayof[i];//too bad we still don't have static Iota in Phobos { arrayof[i] += v.arrayof[i]; }-- Dmitry Olshansky
Sep 29 2012