22 #ifndef fixed_vector_h
23 #define fixed_vector_h
25 #include "fixed_general_matrix.h"
39 template <
int M,
class AT>
95 template<
class Type,
class Row,
class Col>
114 #ifndef FMATVEC_NO_BOUNDS_CHECK
128 #ifndef FMATVEC_NO_BOUNDS_CHECK
144 const AT&
e(
int i)
const {
157 inline Vector<Fixed<M>,AT>& init(Noinit,
const AT& a=0) {
return *
this; }
171 int inc()
const {
return 1;};
173 template <
int M1,
int M2>
182 inline operator std::vector<AT>();
188 inline Vector(std::vector<AT> v);
198 template<
class Type,
class Row,
class Col>
203 template <
int M,
class AT>
205 for(
int i=0; i<M; i++)
210 template <
int M,
class AT>
template <
int M1,
int M2>
212 #ifndef FMATVEC_NO_BOUNDS_CHECK
217 for(
int i=0; i<x.size(); i++)
223 template <
int M,
class AT>
template <
class Row>
224 inline Vector<Fixed<M>,AT>& Vector<Fixed<M>,AT>::operator=(
const Vector<Row,AT> &x) {
226 #ifndef FMATVEC_NO_SIZE_CHECK
227 assert(x.size() == M);
235 template <
int M,
class AT>
238 for(
int i=0; i<M; i++)
243 template <
int M,
class AT>
245 std::vector<AT> ret(size());
246 if(size()>0) memcpy(&ret[0], &
operator()(0),
sizeof(AT)*size());
250 template <
int M,
class AT>
252 if(size()>0) memcpy(&
operator()(0), &v[0],
sizeof(AT)*size());
257 template <
int M,
class AT>
template<
class Row>
259 for(
int i=0; i<M; i++)
265 template<
int M,
class AT>
template<
class Type,
class Row,
class Col>
This is the basic matrix class for arbitrary matrices.
Definition: matrix.h:56
Vector(const Matrix< Type, Row, Col, AT > &A)
Copy Constructor.
Definition: fixed_vector.h:96
Vector(const Vector< Row, AT > &x)
Copy Constructor.
Definition: fixed_vector.h:88
This is an index class for creating submatrices.
Definition: range.h:35
const AT & e(int i) const
Element operator.
Definition: fixed_vector.h:144
int size() const
Size.
Definition: fixed_vector.h:163
This is an index class for creating submatrices.
Definition: index.h:34
int inc() const
Increment.
Definition: fixed_vector.h:171
Basic shape class for matrices.
Definition: types.h:100
AT & operator()(int i)
Element operator.
Definition: fixed_vector.h:112
const AT & operator()(int i) const
Element operator.
Definition: fixed_vector.h:126
Vector(const char *str)
String Constructor.
Definition: fixed_vector.h:77
This is an index class for creating submatrices.
Definition: range.h:44