22 #ifndef fixed_row_vector_h 23 #define fixed_row_vector_h 25 #include "fixed_general_matrix.h" 43 static constexpr
bool isVector {
true};
46 typedef const AT* const_iterator;
48 typedef AT value_type;
88 template<
class Type,
class Row,
class Col>
123 FMATVEC_ASSERT(x.size() == N, AT);
145 FMATVEC_ASSERT(i>=0, AT);
146 FMATVEC_ASSERT(i<N, AT);
155 FMATVEC_ASSERT(i>=0, AT);
156 FMATVEC_ASSERT(i<N, AT);
160 iterator begin() {
return &ele[0][0]; }
161 iterator end() {
return &ele[0][N]; }
162 const_iterator begin()
const {
return &ele[0][0]; }
163 const_iterator end()
const {
return &ele[0][N]; }
164 const_iterator cbegin() const noexcept {
return &ele[0][0]; }
165 const_iterator cend() const noexcept {
return &ele[0][N]; }
175 const AT&
e(
int i)
const {
188 inline RowVector<Fixed<N>,AT>& init(Noinit,
const AT &a=AT()) {
return *
this; }
194 constexpr
int size()
const {
return N;}
200 throw std::runtime_error(
"A fixed row vector cannot be resized.");
209 int inc()
const {
return 1;}
231 template <
int N,
class AT>
233 for(
int i=0; i<N; i++)
238 template <
int N,
class AT>
241 for(
int i=0; i<N; i++)
248 template <
int N,
class AT>
template <
class Col>
250 for(
int i=0; i<N; i++)
This is the basic matrix class for arbitrary matrices.
Definition: fmatvec.h:41
const AT & operator()(int i) const
Element operator.
Definition: fixed_row_vector.h:154
const AT & e(int i) const
Element operator.
Definition: fixed_row_vector.h:175
RowVector(const RowVector< Row, AT > &A)
Copy Constructor.
Definition: fixed_row_vector.h:81
constexpr int size() const
Size.
Definition: fixed_row_vector.h:194
RowVector(const Matrix< Type, Row, Col, AT > &A)
Copy Constructor.
Definition: fixed_row_vector.h:89
int inc() const
Increment.
Definition: fixed_row_vector.h:209
Namespace fmatvec.
Definition: _memory.cc:28
void resize(int n)
Definition: fixed_row_vector.h:198
RowVector< Fixed< N >, AT > & operator=(const RowVector< Row, AT > &x)
Assignment operator.
Definition: fixed_row_vector.h:122
Basic shape class for matrices.
Definition: types.h:132
AT & operator()(int i)
Element operator.
Definition: fixed_row_vector.h:144
RowVector(const char *str)
String Constructor.
Definition: fixed_row_vector.h:104