- Code: Select all
`Point pt[2][3];`

pt[0][0].x = rng.uniform(x_1, x_2);

pt[0][0].y = rng.uniform(y_1, y_2);

pt[0][1].x = rng.uniform(x_1, x_2);

pt[0][1].y = rng.uniform(y_1, y_2);

pt[0][2].x = rng.uniform(x_1, x_2);

pt[0][2].y = rng.uniform(y_1, y_2);

pt[1][0].x = rng.uniform(x_1, x_2);

pt[1][0].y = rng.uniform(y_1, y_2);

pt[1][1].x = rng.uniform(x_1, x_2);

pt[1][1].y = rng.uniform(y_1, y_2);

pt[1][2].x = rng.uniform(x_1, x_2);

pt[1][2].y = rng.uniform(y_1, y_2);

const Point* ppt[2] = {pt[0], pt[1]};

- Code: Select all
`(defparameter a (foreign-alloc :pointer :count 2 :initial-contents`

(list

(foreign-alloc :pointer :count 3 :initial-contents

(list

(foreign-alloc :pointer :initial-element

(point (uniform rng x-1 x-2) (uniform rng y-1 y-2)))

(foreign-alloc :pointer :initial-element

(point (uniform rng x-1 x-2) (uniform rng y-1 y-2)))

(foreign-alloc :pointer :initial-element

(point (uniform rng x-1 x-2) (uniform rng y-1 y-2)))))

(foreign-alloc :pointer :count 3 :initial-contents

(list

(foreign-alloc :pointer :initial-element

(point (uniform rng x-1 x-2) (uniform rng y-1 y-2)))

(foreign-alloc :pointer :initial-element

(point (uniform rng x-1 x-2) (uniform rng y-1 y-2)))

(foreign-alloc :pointer :initial-element

(point (uniform rng x-1 x-2) (uniform rng y-1 y-2))))))))

Here is how I have point defined it works as intended. The uniform function works well in the point so I didn't post but will if necessary

- Code: Select all
`;; Point* cv_create_Point(int x, int y)`

(defcfun ("cv_create_Point2" point2) (:pointer point)

"Point constructor"

(x :int)

(y :int))