Re: Template error on compiling ...

2014-03-01 Thread Robin
Hiho, thank you for your responses. This D language meta programming sounds funny and strange to someone who has never really worked with something like this but I understand its importance and will look more into working with it. =) Robin

Re: Template error on compiling ...

2014-02-28 Thread Meta
EOn Saturday, 1 March 2014 at 00:17:55 UTC, Stanislav Blinov wrote: /// Tests if type M is a Matrix enum bool isSomeMatrix(M) = is(M == Matrix!T, T); Unrelated, but it may be of some interest. This isn't really a good way to define your isSomeMatrix template, i.e., tying it to a specific type.

Re: Template error on compiling ...

2014-02-28 Thread Stanislav Blinov
On Friday, 28 February 2014 at 23:16:48 UTC, Robin wrote: Hiho, just for you: the whole code! =) http://dpaste.dzfl.pl/cd1537571a4d The idea is that I have matrix instances and so-called ElementalOperations which are able to operate on matrices to solve certain algorithms object oriented with

Re: Template error on compiling ...

2014-02-28 Thread Robin
Hiho, just for you: the whole code! =) http://dpaste.dzfl.pl/cd1537571a4d The idea is that I have matrix instances and so-called ElementalOperations which are able to operate on matrices to solve certain algorithms object oriented without nasty loops and so on. This had worked perfectly in

Re: Template error on compiling ...

2014-02-28 Thread Ali Çehreli
On 02/28/2014 02:21 PM, Robin wrote: > I am only working with references to matrix and in my understanding this > shouldn't affect the compilate. As I understand it, Matrix is not a type; rather a type template. Only instances of that template like Matrix!double can be used as types. I was in

Re: Template error on compiling ...

2014-02-28 Thread Robin
Hiho, aww, that's a noob mistake of me. Thanks! Should take a closer look at the error messages next time a should think more about their special meaning ... It works now while it feels strange that I have to template the three classes as I am only working with references to matrix and in

Re: Template error on compiling ...

2014-02-28 Thread anonymous
On Friday, 28 February 2014 at 20:54:42 UTC, Robin wrote: Hiho, with import neoLab.core.Matrix; abstract class ElementalOperation(T = double) { abstract void opCall(ref Matrix!T m); abstract override string toString(); } where I have made the abstract class templated "(T = double)" a

Re: Template error on compiling ...

2014-02-28 Thread Robin
Hiho, with import neoLab.core.Matrix; abstract class ElementalOperation(T = double) { abstract void opCall(ref Matrix!T m); abstract override string toString(); } where I have made the abstract class templated "(T = double)" and where I have added a "!T" after "Matrix" in the opCall p

Re: Template error on compiling ...

2014-02-28 Thread anonymous
On Friday, 28 February 2014 at 19:33:17 UTC, Robin wrote: opCall(ref Matrix!() m) opCall(ref Matrix!T m) aswell as opCall(ref Matrix!(m)) This one's just nonsense. or just opCall(ref Matrix m) This one gives you the "used as a type" kind of error message. give me all the same error as

Re: Template error on compiling ...

2014-02-28 Thread Robin
Hiho, both opCall(ref Matrix!() m) opCall(ref Matrix!T m) aswell as opCall(ref Matrix!(m)) or just opCall(ref Matrix m) give me all the same error as the one stated in the first post ... :/ Nothing really seems to work here. Robin

Re: Template error on compiling ...

2014-02-28 Thread anonymous
On Friday, 28 February 2014 at 19:16:11 UTC, Tobias Pankrath wrote: On Friday, 28 February 2014 at 19:09:11 UTC, Robin wrote: override void opCall(ref Matrix m) pure nothrow { foreach (immutable col; 0 .. m.getDimension().cols) { m[this.row, col]

Re: Template error on compiling ...

2014-02-28 Thread Tobias Pankrath
On Friday, 28 February 2014 at 19:09:11 UTC, Robin wrote: override void opCall(ref Matrix m) pure nothrow { foreach (immutable col; 0 .. m.getDimension().cols) { m[this.row, col] *= this.factor; } I guess this is the culprit. You

Template error on compiling ...

2014-02-28 Thread Robin
Hiho, I am currently working on a matrix library (matrices are templated structs) and have just implemented so-called "ElementalOperations" which perform certain tasks on mutable matrices. There is an abstract ElementalOperation where three different ElementalOperation types inherit from. T