class CompositeShape: public Shape<T, D>
{
protected:
- typedef O Ops;
- typedef std::vector<std::unique_ptr<Shape<T, D>>> ShapeArray;
+ using Ops = O;
- ShapeArray shapes;
+ std::vector<std::unique_ptr<Shape<T, D>>> shapes;
unsigned max_isect;
CompositeShape() = default;
inline BezierSpline<T, D, N>::BezierSpline(const std::vector<Knot> &k):
Spline<T, D, N>(k.front())
{
- typedef SplineValue<T, N> SV;
+ using SV = SplineValue<T, N>;
if((k.size()-1)%D)
throw std::invalid_argument("BezierSpline::BezierSpline");
inline HermiteSpline<T, N>::HermiteSpline(const std::vector<Knot> &k):
Spline<T, 3, N>(k.front())
{
- typedef SplineValue<T, N> SV;
+ using SV = SplineValue<T, N>;
this->reserve(k.size()-1);
for(unsigned i=1; i<k.size(); ++i)
inline HermiteSpline<T, N>::HermiteSpline(Value p0, Value m0, Value p1, Value m1):
Spline<T, 3, N>(Knot(0, p0, m0))
{
- typedef SplineValue<T, N> SV;
+ using SV = SplineValue<T, N>;
this->reserve(1);
Polynomial<T, 3> p[N];
LinearSpline(const std::vector<Knot> &k):
Spline<T, 1, N>(k.front())
{
- typedef SplineValue<T, N> SV;
+ using SV = SplineValue<T, N>;
this->reserve(k.size()-1);
for(unsigned i=1; i<k.size(); ++i)
template<typename T, unsigned N>
struct SplineValue
{
- typedef LinAl::Vector<T, N> Type;
+ using Type = LinAl::Vector<T, N>;
static T get(const Type &v, unsigned i) { return v[i]; }
static Type make(const T *v) { return Type(v); }
};
template<typename T>
struct SplineValue<T, 1>
{
- typedef T Type;
+ using Type = T;
static T get(const Type &v, unsigned) { return v; }
static Type make(const T *v) { return *v; }
};
template<typename T, unsigned N>
struct SplineKnot
{
- typedef typename SplineValue<T, N>::Type Value;
+ using Value = typename SplineValue<T, N>::Type;
T x;
Value y;
class Spline
{
public:
- typedef typename SplineValue<T, N>::Type Value;
- typedef SplineKnot<T, N> Knot;
+ using Value = typename SplineValue<T, N>::Type;
+ using Knot = SplineKnot<T, N>;
struct Segment
{
class DynamicMatrix
{
public:
- typedef T ElementType;
+ using ElementType = T;
private:
unsigned rows_ = 0;
class DynamicVector
{
public:
- typedef T ElementType;
+ using ElementType = T;
private:
unsigned size_ = 0;
class Matrix
{
public:
- typedef T ElementType;
+ using ElementType = T;
private:
T data[M*N];
template<typename T>
inline T &gauss_jordan(T &m, T &r)
{
- typedef typename T::ElementType V;
+ using V = typename T::ElementType;
using std::abs;
for(unsigned i=0; i<m.columns(); ++i)
class Vector: public VectorComponents<T, N>
{
public:
- typedef T ElementType;
+ using ElementType = T;
Vector();
Vector(const T *);