T &operator()(unsigned i, unsigned j) { return element(i, j); }
const T &operator()(unsigned i, unsigned j) const { return element(i, j); }
+ Vector<T, M> column(unsigned i) const { return Vector<T, M>(data+M*i); }
+ Vector<T, N> row(unsigned i) const { return Vector<T, N>(data+i, M); }
+
template<unsigned P, unsigned Q>
Matrix<T, P, Q> select(const Vector<unsigned, P> &, const Vector<unsigned, Q> &) const;
Vector();
Vector(const T *);
+
+ /** Constructs a vector from an array of interleaved values. Intended for
+ use by Matrix row accessor. */
+ Vector(const T *, unsigned);
+
Vector(T, T);
Vector(T, T, T);
Vector(T, T, T, T);
(*this)[i] = d[i];
}
+template<typename T, unsigned N>
+inline Vector<T, N>::Vector(const T *d, unsigned stride)
+{
+ for(unsigned i=0; i<N; ++i)
+ (*this)[i] = d[i*stride];
+}
+
/* The compiler won't instantiate these unless they are used. Trying to use
them on the wrong class results in an error. */
template<typename T, unsigned N>