71 template<
typename T, K_UINT_32 BEG,
bool DBG>
136 inline void get(std::istream& is);
139 inline void put(std::ostream& os)
const;
156 template<
typename T, K_UINT_32 BEG,
bool DBG>
157 inline std::istream&
operator>>(std::istream& is,
161 template<
typename T, K_UINT_32 BEG,
bool DBG>
162 inline std::ostream&
operator<<(std::ostream& os,
173 std::string startDelim =
"",
174 std::string endDelim =
"",
void put(std::ostream &os) const
Writes a vector to a stream.
KVectorContext createKVectorContext(std::string elemDelim=" ", std::string startDelim="", std::string endDelim="", unsigned prec=4)
Creates a vector printing context.
Starting index of vector, either 0 or 1.
void resize(K_UINT_32 n)
Resizes the vector. Resulting vector contents are undefined.
KVector & operator=(const T &a)
Assigns a copy of a to all elements of the vector.
Minimalist vector template class.
T type
Type of objects contained in the vector.
unsigned short KVectorContext
Handle type to a vector printing context.
Contains the implementation of the KVector template class.
T * v_
Pointer to start of vimpl_ array.
unsigned long int K_UINT_32
Unsigned 32-bits integral type.
void swap(KVector &v)
Constant-time swap function between two vectors.
KVectorContext selectKVectorContext(KVectorContext c)
Selects a vector printing context as the current context.
T & operator()(K_UINT_32 i)
Returns the i'th element.
KVectorContext DEFAULT_VECTOR_CONTEXT
Default vector printing context object.
Contains type definitions specific to each platform.
K_UINT_32 n_
Number of elements in vimpl_.
std::ostream & operator<<(std::ostream &os, const KMatrix< T, BEG, DBG > &M)
Writes a matrix to a stream.
std::vector< T > vimpl_
Underlying vector implementation.
void assign(K_UINT_32 n, const T *v)
Copies an array of n instances of T.
K_UINT_32 size() const
Returns the vector size.
std::istream & operator>>(std::istream &is, KMatrix< T, BEG, DBG > &M)
Reads a matrix from a stream.
KVector()
Default constructor. Creates an empty vector.