# Boost :

From: Patrick Kowalzick (Patrick.Kowalzick_at_[hidden])
Date: 2003-06-10 09:00:16

Hi Justinus,

> I've been quite busy with anything but geometrical things lately.
Anyways,
> right now, I'm intensively working on clarifying vector/matrix
interfaces
> and adding more stuff that could be quite useful (e.g., vectorial
iterators
> for matrices; boost iterator_adaptor is just [pause] cool).

that is nice.

> Well... back to the topic.
>
> <Patrick's code snip>
>
> template< typename T, int N >
> class X;
>
> subletly differs from
>
> template< typename T, size_t N >
> class X1;
[snip]
> Actually that's BC++ problem that it cannot digest valid code. On the
other
> hand, workaround would be nice. Is such a workaround possible without
> sacrifying the clarity of template parameters?..

For BC++ just use int and not size_t. It is not aching because we use
ONLY specialized classes, like point<double,3> which could be
instaciated, or?

> Comments and other thoughts are nice, sometimes there're philosophical
[snip]
> Well, after Uni exams are over, I'll be working on this lib. Shortly,
I'll
> give a message where interested people could take a look at this.

Congratulations.
Okay, where could we discuss that topic? Would be nice to have a place.

Another code snippet for you without any comment ;-) :

#ifndef _ENTITIES_HPP_
#define _ENTITIES_HPP_

#include <boost/numeric/ublas/vector.hpp>
#include <boost/numeric/ublas/matrix.hpp>

class GeometricEntity {};

template <typename T,int s> class GeometricVectorEntity :
public GeometricEntity, public
boost::numeric::ublas::bounded_vector<T,s> {};

template <typename T,int r,int c> class GeometricMatrixEntity :
public GeometricEntity, public
boost::numeric::ublas::bounded_matrix<T,r,c> {};

// int used for second parameter because borland gets confused with
size_t
template <typename T,int> class point;
template <typename T,int> class line;
template <typename T,int> class plane;
template <typename T,int> class circle;

// Specialization of the basic elements
template <typename T> class point<T,2> : public
GeometricVectorEntity<T,3> {};
template <typename T> class line<T,2> : public
GeometricVectorEntity<T,3> {};
template <typename T> class plane<T,2> : public
GeometricVectorEntity<T,3> {};
template <typename T> class circle<T,2> : public
GeometricMatrixEntity<T,3,3> {};

template <typename T> class point<T,3> : public
GeometricVectorEntity<T,4> {};
template <typename T> class line<T,3> : public
GeometricVectorEntity<T,6> {};
template <typename T> class plane<T,3> : public
GeometricVectorEntity<T,4> {};
template <typename T> class circle<T,3> : public
GeometricMatrixEntity<T,3,3> {};

#endif

Greetings,
Patrick