max@0: // Copyright (C) 2008-2011 NICTA (www.nicta.com.au) max@0: // Copyright (C) 2008-2011 Conrad Sanderson max@0: // max@0: // This file is part of the Armadillo C++ library. max@0: // It is provided without any warranty of fitness max@0: // for any purpose. You can redistribute this file max@0: // and/or modify it under the terms of the GNU max@0: // Lesser General Public License (LGPL) as published max@0: // by the Free Software Foundation, either version 3 max@0: // of the License or (at your option) any later version. max@0: // (see http://www.opensource.org/licenses for more info) max@0: max@0: max@0: //! \addtogroup Row max@0: //! @{ max@0: max@0: max@0: //! construct an empty row vector max@0: template max@0: inline max@0: Row::Row() max@0: : Mat(1, 0) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: access::rw(Mat::vec_state) = 2; max@0: } max@0: max@0: max@0: max@0: template max@0: inline max@0: Row::Row(const Row& X) max@0: : Mat(1, X.n_elem) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: access::rw(Mat::vec_state) = 2; max@0: max@0: arrayops::copy((*this).memptr(), X.memptr(), X.n_elem); max@0: } max@0: max@0: max@0: max@0: //! construct a row vector with the specified number of n_elem max@0: template max@0: inline max@0: Row::Row(const uword in_n_elem) max@0: : Mat(1, in_n_elem) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: access::rw(Mat::vec_state) = 2; max@0: } max@0: max@0: max@0: max@0: template max@0: inline max@0: Row::Row(const uword in_n_rows, const uword in_n_cols) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: access::rw(Mat::vec_state) = 2; max@0: max@0: Mat::init_warm(in_n_rows, in_n_cols); max@0: } max@0: max@0: max@0: max@0: template max@0: inline max@0: Row::Row(const char* text) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: access::rw(Mat::vec_state) = 2; max@0: max@0: Mat::operator=(text); max@0: } max@0: max@0: max@0: max@0: template max@0: inline max@0: const Row& max@0: Row::operator=(const char* text) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: Mat::operator=(text); max@0: max@0: return *this; max@0: } max@0: max@0: max@0: max@0: template max@0: inline max@0: Row::Row(const std::string& text) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: access::rw(Mat::vec_state) = 2; max@0: max@0: Mat::operator=(text); max@0: } max@0: max@0: max@0: max@0: template max@0: inline max@0: const Row& max@0: Row::operator=(const std::string& text) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: Mat::operator=(text); max@0: max@0: return *this; max@0: } max@0: max@0: max@0: max@0: #if defined(ARMA_USE_CXX11) max@0: max@0: template max@0: inline max@0: Row::Row(const std::initializer_list& list) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: access::rw(Mat::vec_state) = 2; max@0: max@0: Mat::operator=(list); max@0: } max@0: max@0: max@0: max@0: template max@0: inline max@0: const Row& max@0: Row::operator=(const std::initializer_list& list) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: Mat::operator=(list); max@0: max@0: return *this; max@0: } max@0: max@0: #endif max@0: max@0: max@0: max@0: template max@0: inline max@0: const Row& max@0: Row::operator=(const eT val) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: Mat::operator=(val); max@0: max@0: return *this; max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: inline max@0: Row::Row(const Base& X) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: access::rw(Mat::vec_state) = 2; max@0: max@0: Mat::operator=(X.get_ref()); max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: inline max@0: const Row& max@0: Row::operator=(const Base& X) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: Mat::operator=(X.get_ref()); max@0: max@0: return *this; max@0: } max@0: max@0: max@0: max@0: //! construct a row vector from a given auxiliary array max@0: template max@0: inline max@0: Row::Row(eT* aux_mem, const uword aux_length, const bool copy_aux_mem, const bool strict) max@0: : Mat(aux_mem, 1, aux_length, copy_aux_mem, strict) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: access::rw(Mat::vec_state) = 2; max@0: } max@0: max@0: max@0: max@0: //! construct a row vector from a given auxiliary array max@0: template max@0: inline max@0: Row::Row(const eT* aux_mem, const uword aux_length) max@0: : Mat(aux_mem, 1, aux_length) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: access::rw(Mat::vec_state) = 2; max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: inline max@0: Row::Row max@0: ( max@0: const Base::pod_type, T1>& A, max@0: const Base::pod_type, T2>& B max@0: ) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: access::rw(Mat::vec_state) = 2; max@0: max@0: Mat::init(A,B); max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: inline max@0: Row::Row(const BaseCube& X) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: access::rw(Mat::vec_state) = 2; max@0: max@0: Mat::operator=(X); max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: inline max@0: const Row& max@0: Row::operator=(const BaseCube& X) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: Mat::operator=(X); max@0: max@0: return *this; max@0: } max@0: max@0: max@0: max@0: template max@0: inline max@0: Row::Row(const subview_cube& X) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: access::rw(Mat::vec_state) = 2; max@0: max@0: Mat::operator=(X); max@0: } max@0: max@0: max@0: max@0: template max@0: inline max@0: const Row& max@0: Row::operator=(const subview_cube& X) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: Mat::operator=(X); max@0: max@0: return *this; max@0: } max@0: max@0: max@0: max@0: template max@0: inline max@0: mat_injector< Row > max@0: Row::operator<<(const eT val) max@0: { max@0: return mat_injector< Row >(*this, val); max@0: } max@0: max@0: max@0: max@0: template max@0: arma_inline max@0: eT& max@0: Row::col(const uword col_num) max@0: { max@0: arma_debug_check( (col_num >= Mat::n_cols), "Row::col(): out of bounds" ); max@0: max@0: return access::rw(Mat::mem[col_num]); max@0: } max@0: max@0: max@0: max@0: template max@0: arma_inline max@0: eT max@0: Row::col(const uword col_num) const max@0: { max@0: arma_debug_check( (col_num >= Mat::n_cols), "Row::col(): out of bounds" ); max@0: max@0: return Mat::mem[col_num]; max@0: } max@0: max@0: max@0: max@0: template max@0: arma_inline max@0: subview_row max@0: Row::cols(const uword in_col1, const uword in_col2) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: arma_debug_check( ( (in_col1 > in_col2) || (in_col2 >= Mat::n_cols) ), "Row::cols(): indices out of bounds or incorrectly used"); max@0: max@0: const uword subview_n_cols = in_col2 - in_col1 + 1; max@0: max@0: return subview_row(*this, 0, in_col1, subview_n_cols); max@0: } max@0: max@0: max@0: max@0: template max@0: arma_inline max@0: const subview_row max@0: Row::cols(const uword in_col1, const uword in_col2) const max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: arma_debug_check( ( (in_col1 > in_col2) || (in_col2 >= Mat::n_cols) ), "Row::cols(): indices out of bounds or incorrectly used"); max@0: max@0: const uword subview_n_cols = in_col2 - in_col1 + 1; max@0: max@0: return subview_row(*this, 0, in_col1, subview_n_cols); max@0: } max@0: max@0: max@0: max@0: template max@0: arma_inline max@0: subview_row max@0: Row::subvec(const uword in_col1, const uword in_col2) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: arma_debug_check( ( (in_col1 > in_col2) || (in_col2 >= Mat::n_cols) ), "Row::subvec(): indices out of bounds or incorrectly used"); max@0: max@0: const uword subview_n_cols = in_col2 - in_col1 + 1; max@0: max@0: return subview_row(*this, 0, in_col1, subview_n_cols); max@0: } max@0: max@0: max@0: max@0: template max@0: arma_inline max@0: const subview_row max@0: Row::subvec(const uword in_col1, const uword in_col2) const max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: arma_debug_check( ( (in_col1 > in_col2) || (in_col2 >= Mat::n_cols) ), "Row::subvec(): indices out of bounds or incorrectly used"); max@0: max@0: const uword subview_n_cols = in_col2 - in_col1 + 1; max@0: max@0: return subview_row(*this, 0, in_col1, subview_n_cols); max@0: } max@0: max@0: max@0: max@0: template max@0: arma_inline max@0: subview_row max@0: Row::subvec(const span& col_span) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: const bool col_all = col_span.whole; max@0: max@0: const uword local_n_cols = Mat::n_cols; max@0: max@0: const uword in_col1 = col_all ? 0 : col_span.a; max@0: const uword in_col2 = col_span.b; max@0: const uword subvec_n_cols = col_all ? local_n_cols : in_col2 - in_col1 + 1; max@0: max@0: arma_debug_check( ( col_all ? false : ((in_col1 > in_col2) || (in_col2 >= local_n_cols)) ), "Row::subvec(): indices out of bounds or incorrectly used"); max@0: max@0: return subview_row(*this, 0, in_col1, subvec_n_cols); max@0: } max@0: max@0: max@0: max@0: template max@0: arma_inline max@0: const subview_row max@0: Row::subvec(const span& col_span) const max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: const bool col_all = col_span.whole; max@0: max@0: const uword local_n_cols = Mat::n_cols; max@0: max@0: const uword in_col1 = col_all ? 0 : col_span.a; max@0: const uword in_col2 = col_span.b; max@0: const uword subvec_n_cols = col_all ? local_n_cols : in_col2 - in_col1 + 1; max@0: max@0: arma_debug_check( ( col_all ? false : ((in_col1 > in_col2) || (in_col2 >= local_n_cols)) ), "Row::subvec(): indices out of bounds or incorrectly used"); max@0: max@0: return subview_row(*this, 0, in_col1, subvec_n_cols); max@0: } max@0: max@0: max@0: max@0: // template max@0: // arma_inline max@0: // subview_row max@0: // Row::operator()(const span& col_span) max@0: // { max@0: // arma_extra_debug_sigprint(); max@0: // max@0: // return subvec(col_span); max@0: // } max@0: // max@0: // max@0: // max@0: // template max@0: // arma_inline max@0: // const subview_row max@0: // Row::operator()(const span& col_span) const max@0: // { max@0: // arma_extra_debug_sigprint(); max@0: // max@0: // return subvec(col_span); max@0: // } max@0: max@0: max@0: max@0: //! remove specified columns max@0: template max@0: inline max@0: void max@0: Row::shed_col(const uword col_num) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: arma_debug_check( col_num >= Mat::n_cols, "Row::shed_col(): out of bounds"); max@0: max@0: shed_cols(col_num, col_num); max@0: } max@0: max@0: max@0: max@0: //! remove specified columns max@0: template max@0: inline max@0: void max@0: Row::shed_cols(const uword in_col1, const uword in_col2) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: arma_debug_check max@0: ( max@0: (in_col1 > in_col2) || (in_col2 >= Mat::n_cols), max@0: "Row::shed_cols(): indices out of bounds or incorrectly used" max@0: ); max@0: max@0: const uword n_keep_front = in_col1; max@0: const uword n_keep_back = Mat::n_cols - (in_col2 + 1); max@0: max@0: Row X(n_keep_front + n_keep_back); max@0: max@0: eT* X_mem = X.memptr(); max@0: const eT* t_mem = (*this).memptr(); max@0: max@0: if(n_keep_front > 0) max@0: { max@0: arrayops::copy( X_mem, t_mem, n_keep_front ); max@0: } max@0: max@0: if(n_keep_back > 0) max@0: { max@0: arrayops::copy( &(X_mem[n_keep_front]), &(t_mem[in_col2+1]), n_keep_back); max@0: } max@0: max@0: Mat::steal_mem(X); max@0: } max@0: max@0: max@0: max@0: //! insert N cols at the specified col position, max@0: //! optionally setting the elements of the inserted cols to zero max@0: template max@0: inline max@0: void max@0: Row::insert_cols(const uword col_num, const uword N, const bool set_to_zero) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: const uword t_n_cols = Mat::n_cols; max@0: max@0: const uword A_n_cols = col_num; max@0: const uword B_n_cols = t_n_cols - col_num; max@0: max@0: // insertion at col_num == n_cols is in effect an append operation max@0: arma_debug_check( (col_num > t_n_cols), "Row::insert_cols(): out of bounds"); max@0: max@0: if(N > 0) max@0: { max@0: Row out(t_n_cols + N); max@0: max@0: eT* out_mem = out.memptr(); max@0: const eT* t_mem = (*this).memptr(); max@0: max@0: if(A_n_cols > 0) max@0: { max@0: arrayops::copy( out_mem, t_mem, A_n_cols ); max@0: } max@0: max@0: if(B_n_cols > 0) max@0: { max@0: arrayops::copy( &(out_mem[col_num + N]), &(t_mem[col_num]), B_n_cols ); max@0: } max@0: max@0: if(set_to_zero == true) max@0: { max@0: arrayops::inplace_set( &(out_mem[col_num]), eT(0), N ); max@0: } max@0: max@0: Mat::steal_mem(out); max@0: } max@0: } max@0: max@0: max@0: max@0: //! insert the given object at the specified col position; max@0: //! the given object must have one row max@0: template max@0: template max@0: inline max@0: void max@0: Row::insert_cols(const uword col_num, const Base& X) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: Mat::insert_cols(col_num, X); max@0: } max@0: max@0: max@0: max@0: template max@0: inline max@0: typename Row::row_iterator max@0: Row::begin_row(const uword row_num) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: arma_debug_check( (row_num >= Mat::n_rows), "begin_row(): index out of bounds"); max@0: max@0: return Mat::memptr(); max@0: } max@0: max@0: max@0: max@0: template max@0: inline max@0: typename Row::const_row_iterator max@0: Row::begin_row(const uword row_num) const max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: arma_debug_check( (row_num >= Mat::n_rows), "begin_row(): index out of bounds"); max@0: max@0: return Mat::memptr(); max@0: } max@0: max@0: max@0: max@0: template max@0: inline max@0: typename Row::row_iterator max@0: Row::end_row(const uword row_num) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: arma_debug_check( (row_num >= Mat::n_rows), "end_row(): index out of bounds"); max@0: max@0: return Mat::memptr() + Mat::n_cols; max@0: } max@0: max@0: max@0: max@0: template max@0: inline max@0: typename Row::const_row_iterator max@0: Row::end_row(const uword row_num) const max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: arma_debug_check( (row_num >= Mat::n_rows), "end_row(): index out of bounds"); max@0: max@0: return Mat::memptr() + Mat::n_cols; max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: arma_inline max@0: void max@0: Row::fixed::mem_setup() max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: access::rw(Mat::n_rows) = 1; max@0: access::rw(Mat::n_cols) = fixed_n_elem; max@0: access::rw(Mat::n_elem) = fixed_n_elem; max@0: access::rw(Mat::vec_state) = 2; max@0: access::rw(Mat::mem_state) = 3; max@0: access::rw(Mat::mem) = (use_extra) ? mem_local_extra : Mat::mem_local; max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: inline max@0: Row::fixed::fixed() max@0: { max@0: arma_extra_debug_sigprint_this(this); max@0: max@0: mem_setup(); max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: arma_inline max@0: Row::fixed::fixed(const fixed& X) max@0: { max@0: arma_extra_debug_sigprint_this(this); max@0: max@0: mem_setup(); max@0: max@0: eT* dest = (use_extra) ? mem_local_extra : Mat::mem_local; max@0: max@0: arrayops::copy( dest, X.mem, fixed_n_elem ); max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: arma_inline max@0: Row::fixed::fixed(const subview_cube& X) max@0: { max@0: arma_extra_debug_sigprint_this(this); max@0: max@0: mem_setup(); max@0: max@0: Row::operator=(X); max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: template max@0: arma_inline max@0: Row::fixed::fixed(const Base& A) max@0: { max@0: arma_extra_debug_sigprint_this(this); max@0: max@0: mem_setup(); max@0: max@0: Row::operator=(A.get_ref()); max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: template max@0: arma_inline max@0: Row::fixed::fixed(const Base& A, const Base& B) max@0: { max@0: arma_extra_debug_sigprint_this(this); max@0: max@0: mem_setup(); max@0: max@0: Row::init(A,B); max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: inline max@0: Row::fixed::fixed(eT* aux_mem, const bool copy_aux_mem) max@0: { max@0: arma_extra_debug_sigprint_this(this); max@0: max@0: access::rw(Mat::n_rows) = 1; max@0: access::rw(Mat::n_cols) = fixed_n_elem; max@0: access::rw(Mat::n_elem) = fixed_n_elem; max@0: access::rw(Mat::vec_state) = 2; max@0: access::rw(Mat::mem_state) = 3; max@0: max@0: if(copy_aux_mem == true) max@0: { max@0: eT* dest = (use_extra) ? mem_local_extra : Mat::mem_local; max@0: max@0: access::rw(Mat::mem) = dest; max@0: max@0: arrayops::copy( dest, aux_mem, fixed_n_elem ); max@0: } max@0: else max@0: { max@0: access::rw(Mat::mem) = aux_mem; max@0: } max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: inline max@0: Row::fixed::fixed(const eT* aux_mem) max@0: { max@0: arma_extra_debug_sigprint_this(this); max@0: max@0: mem_setup(); max@0: max@0: arrayops::copy( const_cast(Mat::mem), aux_mem, fixed_n_elem ); max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: inline max@0: Row::fixed::fixed(const char* text) max@0: { max@0: arma_extra_debug_sigprint_this(this); max@0: max@0: mem_setup(); max@0: max@0: Row::operator=(text); max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: inline max@0: Row::fixed::fixed(const std::string& text) max@0: { max@0: arma_extra_debug_sigprint_this(this); max@0: max@0: mem_setup(); max@0: max@0: Row::operator=(text); max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: inline max@0: subview_row max@0: Row::fixed::operator()(const uword row_num, const span& col_span) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: return Mat::operator()(row_num, col_span); max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: template max@0: const Row& max@0: Row::fixed::operator=(const Base& A) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: Row::operator=(A.get_ref()); max@0: max@0: return *this; max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: const Row& max@0: Row::fixed::operator=(const eT val) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: Row::operator=(val); max@0: max@0: return *this; max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: const Row& max@0: Row::fixed::operator=(const char* text) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: Row::operator=(text); max@0: max@0: return *this; max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: const Row& max@0: Row::fixed::operator=(const std::string& text) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: Row::operator=(text); max@0: max@0: return *this; max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: const Row& max@0: Row::fixed::operator=(const subview_cube& X) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: Row::operator=(X); max@0: max@0: return *this; max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: inline max@0: const subview_row max@0: Row::fixed::operator()(const uword row_num, const span& col_span) const max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: return Mat::operator()(row_num, col_span); max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: inline max@0: subview_col max@0: Row::fixed::operator()(const span& row_span, const uword col_num) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: return Mat::operator()(row_span, col_num); max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: inline max@0: const subview_col max@0: Row::fixed::operator()(const span& row_span, const uword col_num) const max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: return Mat::operator()(row_span, col_num); max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: inline max@0: subview max@0: Row::fixed::operator()(const span& row_span, const span& col_span) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: return Mat::operator()(row_span, col_span); max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: inline max@0: const subview max@0: Row::fixed::operator()(const span& row_span, const span& col_span) const max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: return Mat::operator()(row_span, col_span); max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: arma_inline max@0: arma_warn_unused max@0: eT& max@0: Row::fixed::operator[] (const uword i) max@0: { max@0: return access::rw( Mat::mem[i] ); max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: arma_inline max@0: arma_warn_unused max@0: eT max@0: Row::fixed::operator[] (const uword i) const max@0: { max@0: return ( Mat::mem[i] ); max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: arma_inline max@0: arma_warn_unused max@0: eT& max@0: Row::fixed::at(const uword i) max@0: { max@0: return access::rw( Mat::mem[i] ); max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: arma_inline max@0: arma_warn_unused max@0: eT max@0: Row::fixed::at(const uword i) const max@0: { max@0: return ( Mat::mem[i] ); max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: arma_inline max@0: arma_warn_unused max@0: eT& max@0: Row::fixed::operator() (const uword i) max@0: { max@0: arma_debug_check( (i >= fixed_n_elem), "Row::fixed::operator(): out of bounds"); max@0: max@0: return access::rw( Mat::mem[i] ); max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: arma_inline max@0: arma_warn_unused max@0: eT max@0: Row::fixed::operator() (const uword i) const max@0: { max@0: arma_debug_check( (i >= fixed_n_elem), "Row::fixed::operator(): out of bounds"); max@0: max@0: return ( Mat::mem[i] ); max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: arma_inline max@0: arma_warn_unused max@0: eT& max@0: Row::fixed::at(const uword in_row, const uword in_col) max@0: { max@0: return access::rw( Mat::mem[in_col] ); max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: arma_inline max@0: arma_warn_unused max@0: eT max@0: Row::fixed::at(const uword in_row, const uword in_col) const max@0: { max@0: return ( Mat::mem[in_col] ); max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: arma_inline max@0: arma_warn_unused max@0: eT& max@0: Row::fixed::operator() (const uword in_row, const uword in_col) max@0: { max@0: arma_debug_check( ((in_row >= 1) || (in_col >= fixed_n_elem)), "Row::fixed::operator(): out of bounds" ); max@0: max@0: return access::rw( Mat::mem[in_col] ); max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: arma_inline max@0: arma_warn_unused max@0: eT max@0: Row::fixed::operator() (const uword in_row, const uword in_col) const max@0: { max@0: arma_debug_check( ((in_row >= 1) || (in_col >= fixed_n_elem)), "Row::fixed::operator(): out of bounds" ); max@0: max@0: return ( Mat::mem[in_col] ); max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: arma_hot max@0: inline max@0: const Row& max@0: Row::fixed::fill(const eT val) max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: arrayops::inplace_set( const_cast(Mat::mem), val, fixed_n_elem ); max@0: max@0: return *this; max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: arma_hot max@0: inline max@0: const Row& max@0: Row::fixed::zeros() max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: arrayops::inplace_set( const_cast(Mat::mem), eT(0), fixed_n_elem ); max@0: max@0: return *this; max@0: } max@0: max@0: max@0: max@0: template max@0: template max@0: arma_hot max@0: inline max@0: const Row& max@0: Row::fixed::ones() max@0: { max@0: arma_extra_debug_sigprint(); max@0: max@0: arrayops::inplace_set( const_cast(Mat::mem), eT(1), fixed_n_elem ); max@0: max@0: return *this; max@0: } max@0: max@0: max@0: max@0: #ifdef ARMA_EXTRA_ROW_MEAT max@0: #include ARMA_INCFILE_WRAP(ARMA_EXTRA_ROW_MEAT) max@0: #endif max@0: max@0: max@0: max@0: //! @}