gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Matrix problem for Fuzzy Networked Opal


From: Johan Ceuppens
Subject: Matrix problem for Fuzzy Networked Opal
Date: Mon, 15 Dec 2014 07:47:25 +0100

Hello,

I have the following macro problem in the code below : I want to put out a struct with elements such as in NSAffineTransform from Foundation, I'll give an example with i = 2 and j = 2 :
 typedef struct {
OpalFuzzyNode *m11;
OpalFuzzyNode *m21;
OpalFuzzyNode *m12;
OpalFuzzyNode *m22;
} _OpalMatrix;

As you can see I want to write out the struct not parse it or use common "functionality".

If you know how to do this, please send some email.

Here you see the parsed version :

#ifndef OpalFuzzyMatrix_h_defined
#define OpalFuzzyMatrix_h_defined

#define makeMatrixElement(i,j) \
        OpalFuzzyNode * m#i#j;

#define makeMatrix(w, h) \
        typedef struct {
                for (i = 0; i < h; i++) \
                        for (j = 0; j < w; j++) \
                                makeMatrixElement(i,j) \
} _OpalMatrix;

@interface OpalFuzzyMatrix : NSObject {
        long int _w,_h;
        _OpalMatrix *_matrix;
}

- (id) new;
- (void)setWidth:(long int)w height:(long int)h;
- (BOOL)hasDimensionsBeenSet:(BOOL)b;
- (void) calibrateDimensions;

@end

#endif

`Enry

reply via email to

[Prev in Thread] Current Thread [Next in Thread]