max@0: // Copyright (C) 2010 NICTA (www.nicta.com.au) max@0: // Copyright (C) 2010 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 injector max@0: //! @{ max@0: max@0: max@0: max@0: template max@0: class mat_injector_row max@0: { max@0: public: max@0: max@0: inline mat_injector_row(); max@0: max@0: inline void insert(const eT val) const; max@0: max@0: mutable uword n_cols; max@0: mutable podarray A; max@0: mutable podarray B; max@0: }; max@0: max@0: max@0: max@0: template max@0: class mat_injector max@0: { max@0: public: max@0: max@0: typedef typename T1::elem_type elem_type; max@0: max@0: inline void insert(const elem_type val) const; max@0: inline void end_of_row() const; max@0: inline ~mat_injector(); max@0: max@0: max@0: private: max@0: max@0: inline mat_injector(T1& in_X, const elem_type val); max@0: inline mat_injector(T1& in_X, const injector_end_of_row& x); max@0: max@0: T1& X; max@0: mutable uword n_rows; max@0: max@0: mutable podarray< mat_injector_row* >* AA; max@0: mutable podarray< mat_injector_row* >* BB; max@0: max@0: friend class Mat; max@0: friend class Row; max@0: friend class Col; max@0: }; max@0: max@0: max@0: max@0: // max@0: max@0: max@0: max@0: template max@0: class field_injector_row max@0: { max@0: public: max@0: max@0: inline field_injector_row(); max@0: inline ~field_injector_row(); max@0: max@0: inline void insert(const oT& val) const; max@0: max@0: mutable uword n_cols; max@0: mutable field* AA; max@0: mutable field* BB; max@0: }; max@0: max@0: max@0: max@0: template max@0: class field_injector max@0: { max@0: public: max@0: max@0: typedef typename T1::object_type object_type; max@0: max@0: inline void insert(const object_type& val) const; max@0: inline void end_of_row() const; max@0: inline ~field_injector(); max@0: max@0: max@0: private: max@0: max@0: inline field_injector(T1& in_X, const object_type& val); max@0: inline field_injector(T1& in_X, const injector_end_of_row& x); max@0: max@0: T1& X; max@0: mutable uword n_rows; max@0: max@0: mutable podarray< field_injector_row* >* AA; max@0: mutable podarray< field_injector_row* >* BB; max@0: max@0: friend class field; max@0: }; max@0: max@0: max@0: max@0: //! @}