123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428 |
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta name="generator" content=
- "HTML Tidy for Linux/x86 (vers 1st March 2004), see www.w3.org" />
- <meta http-equiv="Content-Type" content=
- "text/html; charset=us-ascii" />
- <link rel="stylesheet" href="../../../../boost.css" type="text/css"/>
- <link rel="stylesheet" href="ublas.css" type="text/css" />
- <script type="text/javascript" src="js/jquery-1.3.2.min.js" async="async" ></script>
- <script type="text/javascript" src="js/jquery.toc-gw.js" async="async" ></script>
- <title>Matrix Proxies</title>
- </head>
- <body>
- <h1><img src="../../../../boost.png" align="middle" />Matrix Proxies</h1>
- <div class="toc" id="toc"></div>
- <h2><a name="matrix_row"></a>Matrix Row</h2>
- <h4>Description</h4>
- <p>The templated class <code>matrix_row<M></code> allows
- addressing a row of a matrix.</p>
- <h4>Example</h4>
- <pre>
- #include <boost/numeric/ublas/matrix.hpp>
- #include <boost/numeric/ublas/matrix_proxy.hpp>
- #include <boost/numeric/ublas/io.hpp>
- int main () {
- using namespace boost::numeric::ublas;
- matrix<double> m (3, 3);
- for (unsigned i = 0; i < m.size1 (); ++ i) {
- matrix_row<matrix<double> > mr (m, i);
- for (unsigned j = 0; j < mr.size (); ++ j)
- mr (j) = 3 * i + j;
- std::cout << mr << std::endl;
- }
- }
- </pre>
- <h4>Definition</h4>
- <p>Defined in the header matrix_proxy.hpp.</p>
- <h4>Template parameters</h4>
- <table border="1" summary="parameters">
- <tbody>
- <tr>
- <th>Parameter</th>
- <th>Description</th>
- <th>Default</th>
- </tr>
- <tr>
- <td><code>M</code></td>
- <td>The type of matrix referenced.</td>
- <td></td>
- </tr>
- </tbody>
- </table>
- <h4>Model of</h4>
- <p><a href="expression_concept.html#vector_expression">Vector Expression</a>
- .</p>
- <p>If the specified row falls outside that of the row index range
- of the matrix, then the <code>matrix_row</code> is not a well
- formed Vector Expression. That is, access to an element which is
- outside of the matrix is <i>undefined</i>.</p>
- <h4>Type requirements</h4>
- <p>None, except for those imposed by the requirements of <a href=
- "expression_concept.html#vector_expression">Vector Expression</a> .</p>
- <h4>Public base classes</h4>
- <p><code>vector_expression<matrix_row<M> ></code></p>
- <h4>Members</h4>
- <table border="1" summary="members">
- <tbody>
- <tr>
- <th>Member</th>
- <th>Description</th>
- </tr>
- <tr>
- <td><code>matrix_row (matrix_type &data, size_type
- i)</code></td>
- <td>Constructs a sub vector.</td>
- </tr>
- <tr>
- <td><code>size_type size () const</code></td>
- <td>Returns the size of the sub vector.</td>
- </tr>
- <tr>
- <td><code>const_reference operator () (size_type i)
- const</code></td>
- <td>Returns the value of the <code>i</code>-th element.</td>
- </tr>
- <tr>
- <td><code>reference operator () (size_type i)</code></td>
- <td>Returns a reference of the <code>i</code>-th element.</td>
- </tr>
- <tr>
- <td><code>matrix_row &operator = (const matrix_row
- &mr)</code></td>
- <td>The assignment operator.</td>
- </tr>
- <tr>
- <td><code>matrix_row &assign_temporary (matrix_row
- &mr)</code></td>
- <td>Assigns a temporary. May change the matrix row <code>mr</code>
- .</td>
- </tr>
- <tr>
- <td><code>template<class AE><br />
- matrix_row &operator = (const vector_expression<AE>
- &ae)</code></td>
- <td>The extended assignment operator.</td>
- </tr>
- <tr>
- <td><code>template<class AE><br />
- matrix_row &assign (const vector_expression<AE>
- &ae)</code></td>
- <td>Assigns a vector expression to the sub vector. Left and right
- hand side of the assignment should be independent.</td>
- </tr>
- <tr>
- <td><code>template<class AE><br />
- matrix_row &operator += (const vector_expression<AE>
- &ae)</code></td>
- <td>A computed assignment operator. Adds the vector expression to
- the sub vector.</td>
- </tr>
- <tr>
- <td><code>template<class AE><br />
- matrix_row &plus_assign (const vector_expression<AE>
- &ae)</code></td>
- <td>Adds a vector expression to the sub vector. Left and right hand
- side of the assignment should be independent.</td>
- </tr>
- <tr>
- <td><code>template<class AE><br />
- matrix_row &operator -= (const vector_expression<AE>
- &ae)</code></td>
- <td>A computed assignment operator. Subtracts the vector expression
- from the sub vector.</td>
- </tr>
- <tr>
- <td><code>template<class AE><br />
- matrix_row &minus_assign (const vector_expression<AE>
- &ae)</code></td>
- <td>Subtracts a vector expression from the sub vector. Left and
- right hand side of the assignment should be independent.</td>
- </tr>
- <tr>
- <td><code>template<class AT><br />
- matrix_row &operator *= (const AT &at)</code></td>
- <td>A computed assignment operator. Multiplies the sub vector with
- a scalar.</td>
- </tr>
- <tr>
- <td><code>template<class AT><br />
- matrix_row &operator /= (const AT &at)</code></td>
- <td>A computed assignment operator. Divides the sub vector through
- a scalar.</td>
- </tr>
- <tr>
- <td><code>void swap (matrix_row &mr)</code></td>
- <td>Swaps the contents of the sub vectors.</td>
- </tr>
- <tr>
- <td><code>const_iterator begin () const</code></td>
- <td>Returns a <code>const_iterator</code> pointing to the beginning
- of the <code>matrix_row</code>.</td>
- </tr>
- <tr>
- <td><code>const_iterator end () const</code></td>
- <td>Returns a <code>const_iterator</code> pointing to the end of
- the <code>matrix_row</code>.</td>
- </tr>
- <tr>
- <td><code>iterator begin ()</code></td>
- <td>Returns a <code>iterator</code> pointing to the beginning of
- the <code>matrix_row</code>.</td>
- </tr>
- <tr>
- <td><code>iterator end ()</code></td>
- <td>Returns a <code>iterator</code> pointing to the end of the
- <code>matrix_row</code>.</td>
- </tr>
- <tr>
- <td><code>const_reverse_iterator rbegin () const</code></td>
- <td>Returns a <code>const_reverse_iterator</code> pointing to the
- beginning of the reversed <code>matrix_row</code>.</td>
- </tr>
- <tr>
- <td><code>const_reverse_iterator rend () const</code></td>
- <td>Returns a <code>const_reverse_iterator</code> pointing to the
- end of the reversed <code>matrix_row</code>.</td>
- </tr>
- <tr>
- <td><code>reverse_iterator rbegin ()</code></td>
- <td>Returns a <code>reverse_iterator</code> pointing to the
- beginning of the reversed <code>matrix_row</code>.</td>
- </tr>
- <tr>
- <td><code>reverse_iterator rend ()</code></td>
- <td>Returns a <code>reverse_iterator</code> pointing to the end of
- the reversed <code>matrix_row</code>.</td>
- </tr>
- </tbody>
- </table>
- <h3>Projections</h3>
- <h4>Description</h4>
- <p>The free <code>row</code> functions support the construction of
- matrix rows.</p>
- <h4>Prototypes</h4>
- <pre><code>
- template<class M>
- matrix_row<M> row (M &data, std::size_t i);
- template<class M>
- const matrix_row<const M> row (const M &data, std::size_t i);
- </code></pre>
- <h4>Definition</h4>
- <p>Defined in the header matrix_proxy.hpp.</p>
- <h4>Type requirements</h4>
- <ul>
- <li><code>M</code> is a model of <a href=
- "expression_concept.html#matrix_expression">Matrix Expression</a> .</li>
- </ul>
- <h4>Complexity</h4>
- <p>Linear depending from the size of the row.</p>
- <h4>Examples</h4>
- <pre>
- #include <boost/numeric/ublas/matrix.hpp>
- #include <boost/numeric/ublas/matrix_proxy.hpp>
- #include <boost/numeric/ublas/io.hpp>
- int main () {
- using namespace boost::numeric::ublas;
- matrix<double> m (3, 3);
- for (unsigned i = 0; i < m.size1 (); ++ i) {
- for (unsigned j = 0; j < m.size2 (); ++ j)
- row (m, i) (j) = 3 * i + j;
- std::cout << row (m, i) << std::endl;
- }
- }
- </pre>
- <h2><a name="matrix_column"></a>Matrix Column</h2>
- <h4>Description</h4>
- <p>The templated class <code>matrix_column<M></code> allows
- addressing a column of a matrix.</p>
- <h4>Example</h4>
- <pre>
- #include <boost/numeric/ublas/matrix.hpp>
- #include <boost/numeric/ublas/matrix_proxy.hpp>
- #include <boost/numeric/ublas/io.hpp>
- int main () {
- using namespace boost::numeric::ublas;
- matrix<double> m (3, 3);
- for (unsigned j = 0; j < m.size2 (); ++ j) {
- matrix_column<matrix<double> > mc (m, j);
- for (unsigned i = 0; i < mc.size (); ++ i)
- mc (i) = 3 * i + j;
- std::cout << mc << std::endl;
- }
- }
- </pre>
- <h4>Definition</h4>
- <p>Defined in the header matrix_proxy.hpp.</p>
- <h4>Template parameters</h4>
- <table border="1" summary="parameters">
- <tbody>
- <tr>
- <th>Parameter</th>
- <th>Description</th>
- <th>Default</th>
- </tr>
- <tr>
- <td><code>M</code></td>
- <td>The type of matrix referenced.</td>
- <td></td>
- </tr>
- </tbody>
- </table>
- <h4>Model of</h4>
- <p><a href="expression_concept.html#vector_expression">Vector Expression</a>
- .</p>
- <p>If the specified column falls outside that of the column index
- range of the matrix, then the <code>matrix_column</code> is not a
- well formed Vector Expression. That is, access to an element which
- is outside of the matrix is <i>undefined</i>.</p>
- <h4>Type requirements</h4>
- <p>None, except for those imposed by the requirements of <a href=
- "expression_concept.html#vector_expression">Vector Expression</a> .</p>
- <h4>Public base classes</h4>
- <p><code>vector_expression<matrix_column<M>
- ></code></p>
- <h4>Members</h4>
- <table border="1" summary="members">
- <tbody>
- <tr>
- <th>Member</th>
- <th>Description</th>
- </tr>
- <tr>
- <td><code>matrix_column (matrix_type &data, size_type
- j)</code></td>
- <td>Constructs a sub vector.</td>
- </tr>
- <tr>
- <td><code>size_type size () const</code></td>
- <td>Returns the size of the sub vector.</td>
- </tr>
- <tr>
- <td><code>const_reference operator () (size_type i)
- const</code></td>
- <td>Returns the value of the <code>i</code>-th element.</td>
- </tr>
- <tr>
- <td><code>reference operator () (size_type i)</code></td>
- <td>Returns a reference of the <code>i</code>-th element.</td>
- </tr>
- <tr>
- <td><code>matrix_column &operator = (const matrix_column
- &mc)</code></td>
- <td>The assignment operator.</td>
- </tr>
- <tr>
- <td><code>matrix_column &assign_temporary (matrix_column
- &mc)</code></td>
- <td>Assigns a temporary. May change the matrix column
- <code>mc</code> .</td>
- </tr>
- <tr>
- <td><code>template<class AE><br />
- matrix_column &operator = (const vector_expression<AE>
- &ae)</code></td>
- <td>The extended assignment operator.</td>
- </tr>
- <tr>
- <td><code>template<class AE><br />
- matrix_column &assign (const vector_expression<AE>
- &ae)</code></td>
- <td>Assigns a vector expression to the sub vector. Left and right
- hand side of the assignment should be independent.</td>
- </tr>
- <tr>
- <td><code>template<class AE><br />
- matrix_column &operator += (const vector_expression<AE>
- &ae)</code></td>
- <td>A computed assignment operator. Adds the vector expression to
- the sub vector.</td>
- </tr>
- <tr>
- <td><code>template<class AE><br />
- matrix_column &plus_assign (const vector_expression<AE>
- &ae)</code></td>
- <td>Adds a vector expression to the sub vector. Left and right hand
- side of the assignment should be independent.</td>
- </tr>
- <tr>
- <td><code>template<class AE><br />
- matrix_column &operator -= (const vector_expression<AE>
- &ae)</code></td>
- <td>A computed assignment operator. Subtracts the vector expression
- from the sub vector.</td>
- </tr>
- <tr>
- <td><code>template<class AE><br />
- matrix_column &minus_assign (const vector_expression<AE>
- &ae)</code></td>
- <td>Subtracts a vector expression from the sub vector. Left and
- right hand side of the assignment should be independent.</td>
- </tr>
- <tr>
- <td><code>template<class AT><br />
- matrix_column &operator *= (const AT &at)</code></td>
- <td>A computed assignment operator. Multiplies the sub vector with
- a scalar.</td>
- </tr>
- <tr>
- <td><code>template<class AT><br />
- matrix_column &operator /= (const AT &at)</code></td>
- <td>A computed assignment operator. Divides the sub vector through
- a scalar.</td>
- </tr>
- <tr>
- <td><code>void swap (matrix_column &mc)</code></td>
- <td>Swaps the contents of the sub vectors.</td>
- </tr>
- <tr>
- <td><code>const_iterator begin () const</code></td>
- <td>Returns a <code>const_iterator</code> pointing to the beginning
- of the <code>matrix_column</code>.</td>
- </tr>
- <tr>
- <td><code>const_iterator end () const</code></td>
- <td>Returns a <code>const_iterator</code> pointing to the end of
- the <code>matrix_column</code>.</td>
- </tr>
- <tr>
- <td><code>iterator begin ()</code></td>
- <td>Returns a <code>iterator</code> pointing to the beginning of
- the <code>matrix_column</code>.</td>
- </tr>
- <tr>
- <td><code>iterator end ()</code></td>
- <td>Returns a <code>iterator</code> pointing to the end of the
- <code>matrix_column</code>.</td>
- </tr>
- <tr>
- <td><code>const_reverse_iterator rbegin () const</code></td>
- <td>Returns a <code>const_reverse_iterator</code> pointing to the
- beginning of the reversed <code>matrix_column</code>.</td>
- </tr>
- <tr>
- <td><code>const_reverse_iterator rend () const</code></td>
- <td>Returns a <code>const_reverse_iterator</code> pointing to the
- end of the reversed <code>matrix_column</code>.</td>
- </tr>
- <tr>
- <td><code>reverse_iterator rbegin ()</code></td>
- <td>Returns a <code>reverse_iterator</code> pointing to the
- beginning of the reversed <code>matrix_column</code>.</td>
- </tr>
- <tr>
- <td><code>reverse_iterator rend ()</code></td>
- <td>Returns a <code>reverse_iterator</code> pointing to the end of
- the reversed <code>matrix_column</code>.</td>
- </tr>
- </tbody>
- </table>
- <h3>Projections</h3>
- <h4>Description</h4>
- <p>The free <code>column</code> functions support the construction
- of matrix columns.</p>
- <h4>Prototypes</h4>
- <pre><code>
- template<class M>
- matrix_column<M> column (M &data, std::size_t j);
- template<class M>
- const matrix_column<const M> column (const M &data, std::size_t j);
- </code></pre>
- <h4>Definition</h4>
- <p>Defined in the header matrix_proxy.hpp.</p>
- <h4>Type requirements</h4>
- <ul>
- <li><code>M</code> is a model of <a href=
- "expression_concept.html#matrix_expression">Matrix Expression</a> .</li>
- </ul>
- <h4>Complexity</h4>
- <p>Linear depending from the size of the column.</p>
- <h4>Examples</h4>
- <pre>
- #include <boost/numeric/ublas/matrix.hpp>
- #include <boost/numeric/ublas/matrix_proxy.hpp>
- #include <boost/numeric/ublas/io.hpp>
- int main () {
- using namespace boost::numeric::ublas;
- matrix<double> m (3, 3);
- for (unsigned j = 0; j < m.size2 (); ++ j) {
- for (unsigned i = 0; i < m.size1 (); ++ i)
- column (m, j) (i) = 3 * i + j;
- std::cout << column (m, j) << std::endl;
- }
- }
- </pre>
- <h2><a name="vector_range"></a>Vector Range</h2>
- <h4>Description</h4>
- <p>The templated class <code>matrix_vector_range<M></code>
- allows addressing a sub vector of a matrix.</p>
- <h4>Example</h4>
- <pre>
- #include <boost/numeric/ublas/matrix.hpp>
- #include <boost/numeric/ublas/matrix_proxy.hpp>
- #include <boost/numeric/ublas/io.hpp>
- int main () {
- using namespace boost::numeric::ublas;
- matrix<double> m (3, 3);
- for (unsigned i = 0; i < m.size1 (); ++ i)
- for (unsigned j = 0; j < m.size2 (); ++ j)
- m (i, j) = 3 * i + j;
- matrix_vector_range<matrix<double> > mvr (m, range (0, 3), range (0, 3));
- std::cout << mvr << std::endl;
- }
- </pre>
- <h4>Definition</h4>
- <p>Defined in the header matrix_proxy.hpp.</p>
- <h4>Template parameters</h4>
- <table border="1" summary="parameters">
- <tbody>
- <tr>
- <th>Parameter</th>
- <th>Description</th>
- <th>Default</th>
- </tr>
- <tr>
- <td><code>M</code></td>
- <td>The type of matrix referenced.</td>
- <td></td>
- </tr>
- </tbody>
- </table>
- <h4>Model of</h4>
- <p><a href="expression_concept.html#vector_expression">Vector Expression</a>
- .</p>
- <p>If the specified ranges fall outside that of the index range of
- the matrix, then the <code>matrix_vector_range</code> is not a well
- formed Vector Expression. That is, access to an element which is
- outside of the matrix is <i>undefined</i>.</p>
- <h4>Type requirements</h4>
- <p>None, except for those imposed by the requirements of <a href=
- "expression_concept.html#vector_expression">Vector Expression</a> .</p>
- <h4>Public base classes</h4>
- <p><code>vector_expression<matrix_vector_range<M>
- ></code></p>
- <h4>Members</h4>
- <table border="1" summary="members">
- <tbody>
- <tr>
- <th>Member</th>
- <th>Description</th>
- </tr>
- <tr>
- <td><code>matrix_vector_range (matrix_type &data,<br />
- const range &r1, const range &r2)</code></td>
- <td>Constructs a sub vector.</td>
- </tr>
- <tr>
- <td><code>size_type size () const</code></td>
- <td>Returns the size of the sub vector.</td>
- </tr>
- <tr>
- <td><code>const_reference operator () (size_type i)
- const</code></td>
- <td>Returns the value of the <code>i</code>-th element.</td>
- </tr>
- <tr>
- <td><code>reference operator () (size_type i)</code></td>
- <td>Returns a reference of the <code>i</code>-th element.</td>
- </tr>
- <tr>
- <td><code>matrix_vector_range &operator = (const
- matrix_vector_range &mvr)</code></td>
- <td>The assignment operator.</td>
- </tr>
- <tr>
- <td><code>matrix_vector_range &assign_temporary
- (matrix_vector_range &mvr)</code></td>
- <td>Assigns a temporary. May change the matrix vector range
- <code>mvr</code>.</td>
- </tr>
- <tr>
- <td><code>template<class AE><br />
- matrix_vector_range &operator = (const
- vector_expression<AE> &ae)</code></td>
- <td>The extended assignment operator.</td>
- </tr>
- <tr>
- <td><code>template<class AE><br />
- matrix_vector_range &assign (const vector_expression<AE>
- &ae)</code></td>
- <td>Assigns a vector expression to the sub vector. Left and right
- hand side of the assignment should be independent.</td>
- </tr>
- <tr>
- <td><code>template<class AE><br />
- matrix_vector_range &operator += (const
- vector_expression<AE> &ae)</code></td>
- <td>A computed assignment operator. Adds the vector expression to
- the sub vector.</td>
- </tr>
- <tr>
- <td><code>template<class AE><br />
- matrix_vector_range &plus_assign (const
- vector_expression<AE> &ae)</code></td>
- <td>Adds a vector expression to the sub vector. Left and right hand
- side of the assignment should be independent.</td>
- </tr>
- <tr>
- <td><code>template<class AE><br />
- matrix_vector_range &operator -= (const
- vector_expression<AE> &ae)</code></td>
- <td>A computed assignment operator. Subtracts the vector expression
- from the sub vector.</td>
- </tr>
- <tr>
- <td><code>template<class AE><br />
- matrix_vector_range &minus_assign (const
- vector_expression<AE> &ae)</code></td>
- <td>Subtracts a vector expression from the sub vector. Left and
- right hand side of the assignment should be independent.</td>
- </tr>
- <tr>
- <td><code>template<class AT><br />
- matrix_vector_range &operator *= (const AT &at)</code></td>
- <td>A computed assignment operator. Multiplies the sub vector with
- a scalar.</td>
- </tr>
- <tr>
- <td><code>template<class AT><br />
- matrix_vector_range &operator /= (const AT &at)</code></td>
- <td>A computed assignment operator. Divides the sub vector through
- a scalar.</td>
- </tr>
- <tr>
- <td><code>void swap (matrix_vector_range &mvr)</code></td>
- <td>Swaps the contents of the sub vectors.</td>
- </tr>
- <tr>
- <td><code>const_iterator begin () const</code></td>
- <td>Returns a <code>const_iterator</code> pointing to the beginning
- of the <code>matrix_vector_range</code>.</td>
- </tr>
- <tr>
- <td><code>const_iterator end () const</code></td>
- <td>Returns a <code>const_iterator</code> pointing to the end of
- the <code>matrix_vector_range</code>.</td>
- </tr>
- <tr>
- <td><code>iterator begin ()</code></td>
- <td>Returns a <code>iterator</code> pointing to the beginning of
- the <code>matrix_vector_range</code>.</td>
- </tr>
- <tr>
- <td><code>iterator end ()</code></td>
- <td>Returns a <code>iterator</code> pointing to the end of the
- <code>matrix_vector_range</code>.</td>
- </tr>
- <tr>
- <td><code>const_reverse_iterator rbegin () const</code></td>
- <td>Returns a <code>const_reverse_iterator</code> pointing to the
- beginning of the <code>matrix_vector_range</code>.</td>
- </tr>
- <tr>
- <td><code>const_reverse_iterator rend () const</code></td>
- <td>Returns a <code>const_reverse_iterator</code> pointing to the
- end of the reversed <code>matrix_vector_range</code>.</td>
- </tr>
- <tr>
- <td><code>reverse_iterator rbegin ()</code></td>
- <td>Returns a <code>reverse_iterator</code> pointing to the
- beginning of the reversed <code>matrix_vector_range</code>.</td>
- </tr>
- <tr>
- <td><code>reverse_iterator rend ()</code></td>
- <td>Returns a <code>reverse_iterator</code> pointing to the end of
- the reversed <code>matrix_vector_range</code>.</td>
- </tr>
- </tbody>
- </table>
- <h2><a name="vector_slice"></a>Vector Slice</h2>
- <h4>Description</h4>
- <p>The templated class <code>matrix_vector_slice<M></code>
- allows addressing a sliced sub vector of a matrix.</p>
- <h4>Example</h4>
- <pre>
- #include <boost/numeric/ublas/matrix.hpp>
- #include <boost/numeric/ublas/matrix_proxy.hpp>
- #include <boost/numeric/ublas/io.hpp>
- int main () {
- using namespace boost::numeric::ublas;
- matrix<double> m (3, 3);
- for (unsigned i = 0; i < m.size1 (); ++ i)
- for (unsigned j = 0; j < m.size2 (); ++ j)
- m (i, j) = 3 * i + j;
- matrix_vector_slice<matrix<double> > mvs (m, slice (0, 1, 3), slice (0, 1, 3));
- std::cout << mvs << std::endl;
- }
- </pre>
- <h4>Definition</h4>
- <p>Defined in the header matrix_proxy.hpp.</p>
- <h4>Template parameters</h4>
- <table border="1" summary="parameters">
- <tbody>
- <tr>
- <th>Parameter</th>
- <th>Description</th>
- <th>Default</th>
- </tr>
- <tr>
- <td><code>M</code></td>
- <td>The type of matrix referenced.</td>
- <td></td>
- </tr>
- </tbody>
- </table>
- <h4>Model of</h4>
- <p><a href="expression_concept.html#vector_expression">Vector Expression</a>
- .</p>
- <p>If the specified slices fall outside that of the index range of
- the matrix, then the <code>matrix_vector_slice</code> is not a well
- formed Vector Expression. That is, access to an element which is
- outside of the matrix is <i>undefined</i>.</p>
- <h4>Type requirements</h4>
- <p>None, except for those imposed by the requirements of <a href=
- "expression_concept.html#vector_expression">Vector Expression</a> .</p>
- <h4>Public base classes</h4>
- <p><code>vector_expression<matrix_vector_slice<M>
- ></code></p>
- <h4>Members</h4>
- <table border="1" summary="members">
- <tbody>
- <tr>
- <th>Member</th>
- <th>Description</th>
- </tr>
- <tr>
- <td><code>matrix_vector_slice (matrix_type &data,<br />
- const slice &s1, const slice &s2)</code></td>
- <td>Constructs a sub vector.</td>
- </tr>
- <tr>
- <td><code>size_type size () const</code></td>
- <td>Returns the size of the sub vector.</td>
- </tr>
- <tr>
- <td><code>const_reference operator () (size_type i)
- const</code></td>
- <td>Returns the value of the <code>i</code>-th element.</td>
- </tr>
- <tr>
- <td><code>reference operator () (size_type i)</code></td>
- <td>Returns a reference of the <code>i</code>-th element.</td>
- </tr>
- <tr>
- <td><code>matrix_vector_slice &operator = (const
- matrix_vector_slice &mvs)</code></td>
- <td>The assignment operator.</td>
- </tr>
- <tr>
- <td><code>matrix_vector_slice &assign_temporary
- (matrix_vector_slice &mvs)</code></td>
- <td>Assigns a temporary. May change the matrix vector slice
- <code>vs</code>.</td>
- </tr>
- <tr>
- <td><code>template<class AE><br />
- matrix_vector_slice &operator = (const
- vector_expression<AE> &ae)</code></td>
- <td>The extended assignment operator.</td>
- </tr>
- <tr>
- <td><code>template<class AE><br />
- matrix_vector_slice &assign (const vector_expression<AE>
- &ae)</code></td>
- <td>Assigns a vector expression to the sub vector. Left and right
- hand side of the assignment should be independent.</td>
- </tr>
- <tr>
- <td><code>template<class AE><br />
- matrix_vector_slice &operator += (const
- vector_expression<AE> &ae)</code></td>
- <td>A computed assignment operator. Adds the vector expression to
- the sub vector.</td>
- </tr>
- <tr>
- <td><code>template<class AE><br />
- matrix_vector_slice &plus_assign (const
- vector_expression<AE> &ae)</code></td>
- <td>Adds a vector expression to the sub vector. Left and right hand
- side of the assignment should be independent.</td>
- </tr>
- <tr>
- <td><code>template<class AE><br />
- matrix_vector_slice &operator -= (const
- vector_expression<AE> &ae)</code></td>
- <td>A computed assignment operator. Subtracts the vector expression
- from the sub vector.</td>
- </tr>
- <tr>
- <td><code>template<class AE><br />
- matrix_vector_slice &minus_assign (const
- vector_expression<AE> &ae)</code></td>
- <td>Subtracts a vector expression from the sub vector. Left and
- right hand side of the assignment should be independent.</td>
- </tr>
- <tr>
- <td><code>template<class AT><br />
- matrix_vector_slice &operator *= (const AT &at)</code></td>
- <td>A computed assignment operator. Multiplies the sub vector with
- a scalar.</td>
- </tr>
- <tr>
- <td><code>template<class AT><br />
- matrix_vector_slice &operator /= (const AT &at)</code></td>
- <td>A computed assignment operator. Divides the sub vector through
- a scalar.</td>
- </tr>
- <tr>
- <td><code>void swap (matrix_vector_slice &mvs)</code></td>
- <td>Swaps the contents of the sub vectors.</td>
- </tr>
- <tr>
- <td><code>const_iterator begin () const</code></td>
- <td>Returns a <code>const_iterator</code> pointing to the beginning
- of the <code>matrix_vector_slice</code>.</td>
- </tr>
- <tr>
- <td><code>const_iterator end () const</code></td>
- <td>Returns a <code>const_iterator</code> pointing to the end of
- the <code>matrix_vector_slice</code>.</td>
- </tr>
- <tr>
- <td><code>iterator begin ()</code></td>
- <td>Returns a <code>iterator</code> pointing to the beginning of
- the <code>matrix_vector_slice</code>.</td>
- </tr>
- <tr>
- <td><code>iterator end ()</code></td>
- <td>Returns a <code>iterator</code> pointing to the end of the
- <code>matrix_vector_slice</code>.</td>
- </tr>
- <tr>
- <td><code>const_reverse_iterator rbegin () const</code></td>
- <td>Returns a <code>const_reverse_iterator</code> pointing to the
- beginning of the reversed <code>matrix_vector_slice</code>.</td>
- </tr>
- <tr>
- <td><code>const_reverse_iterator rend () const</code></td>
- <td>Returns a <code>const_reverse_iterator</code> pointing to the
- end of the reversed <code>matrix_vector_slice</code>.</td>
- </tr>
- <tr>
- <td><code>reverse_iterator rbegin ()</code></td>
- <td>Returns a <code>reverse_iterator</code> pointing to the
- beginning of the reversed <code>matrix_vector_slice</code>.</td>
- </tr>
- <tr>
- <td><code>reverse_iterator rend ()</code></td>
- <td>Returns a <code>reverse_iterator</code> pointing to the end of
- the reversed <code>matrix_vector_slice</code>.</td>
- </tr>
- </tbody>
- </table>
- <h2><a name="matrix_range"></a>Matrix Range</h2>
- <h4>Description</h4>
- <p>The templated class <code>matrix_range<M></code> allows
- addressing a sub matrix of a matrix.</p>
- <h4>Example</h4>
- <pre>
- #include <boost/numeric/ublas/matrix.hpp>
- #include <boost/numeric/ublas/matrix_proxy.hpp>
- #include <boost/numeric/ublas/io.hpp>
- int main () {
- using namespace boost::numeric::ublas;
- matrix<double> m (3, 3);
- matrix_range<matrix<double> > mr (m, range (0, 3), range (0, 3));
- for (unsigned i = 0; i < mr.size1 (); ++ i)
- for (unsigned j = 0; j < mr.size2 (); ++ j)
- mr (i, j) = 3 * i + j;
- std::cout << mr << std::endl;
- }
- </pre>
- <h4>Definition</h4>
- <p>Defined in the header matrix_proxy.hpp.</p>
- <h4>Template parameters</h4>
- <table border="1" summary="parameters">
- <tbody>
- <tr>
- <th>Parameter</th>
- <th>Description</th>
- <th>Default</th>
- </tr>
- <tr>
- <td><code>M</code></td>
- <td>The type of matrix referenced.</td>
- <td></td>
- </tr>
- </tbody>
- </table>
- <h4>Model of</h4>
- <p><a href="expression_concept.html#matrix_expression">Matrix Expression</a>
- .</p>
- <p>If the specified ranges fall outside that of the index range of
- the matrix, then the <code>matrix_range</code> is not a well formed
- Matrix Expression. That is, access to an element which is outside
- of the matrix is <i>undefined</i>.</p>
- <h4>Type requirements</h4>
- <p>None, except for those imposed by the requirements of <a href=
- "expression_concept.html#matrix_expression">Matrix Expression</a> .</p>
- <h4>Public base classes</h4>
- <p><code>matrix_expression<matrix_range<M> ></code></p>
- <h4>Members</h4>
- <table border="1" summary="members">
- <tbody>
- <tr>
- <th>Member</th>
- <th>Description</th>
- </tr>
- <tr>
- <td><code>matrix_range (matrix_type &data,<br />
- const range &r1, const range &r2)</code></td>
- <td>Constructs a sub matrix.</td>
- </tr>
- <tr>
- <td><code>size_type start1 () const</code></td>
- <td>Returns the index of the first row.</td>
- </tr>
- <tr>
- <td><code>size_type size1 () const</code></td>
- <td>Returns the number of rows.</td>
- </tr>
- <tr>
- <td><code>size_type start2 () const</code></td>
- <td>Returns the index of the first column.</td>
- </tr>
- <tr>
- <td><code>size_type size2 () const</code></td>
- <td>Returns the number of columns.</td>
- </tr>
- <tr>
- <td><code>const_reference operator () (size_type i, size_type j)
- const</code></td>
- <td>Returns the value of the <code>j</code>-th element in the
- <code>i</code>-th row.</td>
- </tr>
- <tr>
- <td><code>reference operator () (size_type i, size_type
- j)</code></td>
- <td>Returns a reference of the <code>j</code>-th element in the
- <code>i</code>-th row.</td>
- </tr>
- <tr>
- <td><code>matrix_range &operator = (const matrix_range
- &mr)</code></td>
- <td>The assignment operator.</td>
- </tr>
- <tr>
- <td><code>matrix_range &assign_temporary (matrix_range
- &mr)</code></td>
- <td>Assigns a temporary. May change the matrix range
- <code>mr</code> .</td>
- </tr>
- <tr>
- <td><code>template<class AE><br />
- matrix_range &operator = (const matrix_expression<AE>
- &ae)</code></td>
- <td>The extended assignment operator.</td>
- </tr>
- <tr>
- <td><code>template<class AE><br />
- matrix_range &assign (const matrix_expression<AE>
- &ae)</code></td>
- <td>Assigns a matrix expression to the sub matrix. Left and right
- hand side of the assignment should be independent.</td>
- </tr>
- <tr>
- <td><code>template<class AE><br />
- matrix_range &operator += (const matrix_expression<AE>
- &ae)</code></td>
- <td>A computed assignment operator. Adds the matrix expression to
- the sub matrix.</td>
- </tr>
- <tr>
- <td><code>template<class AE><br />
- matrix_range &plus_assign (const matrix_expression<AE>
- &ae)</code></td>
- <td>Adds a matrix expression to the sub matrix. Left and right hand
- side of the assignment should be independent.</td>
- </tr>
- <tr>
- <td><code>template<class AE><br />
- matrix_range &operator -= (const matrix_expression<AE>
- &ae)</code></td>
- <td>A computed assignment operator. Subtracts the matrix expression
- from the sub matrix.</td>
- </tr>
- <tr>
- <td><code>template<class AE><br />
- matrix_range &minus_assign (const matrix_expression<AE>
- &ae)</code></td>
- <td>Subtracts a matrix expression from the sub matrix. Left and
- right hand side of the assignment should be independent.</td>
- </tr>
- <tr>
- <td><code>template<class AT><br />
- matrix_range &operator *= (const AT &at)</code></td>
- <td>A computed assignment operator. Multiplies the sub matrix with
- a scalar.</td>
- </tr>
- <tr>
- <td><code>template<class AT><br />
- matrix_range &operator /= (const AT &at)</code></td>
- <td>A computed assignment operator. Divides the sub matrix through
- a scalar.</td>
- </tr>
- <tr>
- <td><code>void swap (matrix_range &mr)</code></td>
- <td>Swaps the contents of the sub matrices.</td>
- </tr>
- <tr>
- <td><code>const_iterator1 begin1 () const</code></td>
- <td>Returns a <code>const_iterator1</code> pointing to the
- beginning of the <code>matrix_range</code>.</td>
- </tr>
- <tr>
- <td><code>const_iterator1 end1 () const</code></td>
- <td>Returns a <code>const_iterator1</code> pointing to the end of
- the <code>matrix_range</code>.</td>
- </tr>
- <tr>
- <td><code>iterator1 begin1 ()</code></td>
- <td>Returns a <code>iterator1</code> pointing to the beginning of
- the <code>matrix_range</code>.</td>
- </tr>
- <tr>
- <td><code>iterator1 end1 ()</code></td>
- <td>Returns a <code>iterator1</code> pointing to the end of the
- <code>matrix_range</code>.</td>
- </tr>
- <tr>
- <td><code>const_iterator2 begin2 () const</code></td>
- <td>Returns a <code>const_iterator2</code> pointing to the
- beginning of the <code>matrix_range</code>.</td>
- </tr>
- <tr>
- <td><code>const_iterator2 end2 () const</code></td>
- <td>Returns a <code>const_iterator2</code> pointing to the end of
- the <code>matrix_range</code>.</td>
- </tr>
- <tr>
- <td><code>iterator2 begin2 ()</code></td>
- <td>Returns a <code>iterator2</code> pointing to the beginning of
- the <code>matrix_range</code>.</td>
- </tr>
- <tr>
- <td><code>iterator2 end2 ()</code></td>
- <td>Returns a <code>iterator2</code> pointing to the end of the
- <code>matrix_range</code>.</td>
- </tr>
- <tr>
- <td><code>const_reverse_iterator1 rbegin1 () const</code></td>
- <td>Returns a <code>const_reverse_iterator1</code> pointing to the
- beginning of the reversed <code>matrix_range</code>.</td>
- </tr>
- <tr>
- <td><code>const_reverse_iterator1 rend1 () const</code></td>
- <td>Returns a <code>const_reverse_iterator1</code> pointing to the
- end of the reversed <code>matrix_range</code>.</td>
- </tr>
- <tr>
- <td><code>reverse_iterator1 rbegin1 ()</code></td>
- <td>Returns a <code>reverse_iterator1</code> pointing to the
- beginning of the reversed <code>matrix_range</code>.</td>
- </tr>
- <tr>
- <td><code>reverse_iterator1 rend1 ()</code></td>
- <td>Returns a <code>reverse_iterator1</code> pointing to the end of
- the reversed <code>matrix_range</code>.</td>
- </tr>
- <tr>
- <td><code>const_reverse_iterator2 rbegin2 () const</code></td>
- <td>Returns a <code>const_reverse_iterator2</code> pointing to the
- beginning of the reversed <code>matrix_range</code>.</td>
- </tr>
- <tr>
- <td><code>const_reverse_iterator2 rend2 () const</code></td>
- <td>Returns a <code>const_reverse_iterator2</code> pointing to the
- end of the reversed <code>matrix_range</code>.</td>
- </tr>
- <tr>
- <td><code>reverse_iterator2 rbegin2 ()</code></td>
- <td>Returns a <code>reverse_iterator2</code> pointing to the
- beginning of the reversed <code>matrix_range</code>.</td>
- </tr>
- <tr>
- <td><code>reverse_iterator2 rend2 ()</code></td>
- <td>Returns a <code>reverse_iterator2</code> pointing to the end of
- reversed the <code>matrix_range</code>.</td>
- </tr>
- </tbody>
- </table>
- <h3>Simple Projections</h3>
- <h4>Description</h4>
- <p>The free <code>subrange</code> functions support the construction
- of matrix ranges.</p>
- <h4>Prototypes</h4>
- <pre><code>
- template<class M>
- matrix_range<M> subrange (M &data,
- M::size_type start1, M::size_type stop1, M::size_type start2, M::size_type, stop2);
- template<class M>
- const matrix_range<const M> subrange (const M &data,
- M::size_type start1, M::size_type stop1, M::size_type start2, M::size_type, stop2);
- </code></pre>
- <h3>Generic Projections</h3>
- <h4>Description</h4>
- <p>The free <code>project</code> functions support the construction
- of matrix ranges. Existing <code>matrix_range</code>'s can be composed with further ranges. The resulting ranges are computed using this existing ranges' <code>compose</code> function.</p>
- <h4>Prototypes</h4>
- <pre><code>
- template<class M>
- matrix_range<M> project (M &data, const range &r1, const range &r2);
- template<class M>
- const matrix_range<const M> project (const M &data, const range &r1, const range &r2);
- template<class M>
- matrix_range<M> project (matrix_range<M> &data, const range &r1, const range &r2);
- template<class M>
- const matrix_range<M> project (const matrix_range<M> &data, const range &r1, const range &r2);
- </code></pre>
- <h4>Definition</h4>
- <p>Defined in the header matrix_proxy.hpp.</p>
- <h4>Type requirements</h4>
- <ul>
- <li><code>M</code> is a model of <a href=
- "expression_concept.html#matrix_expression">Matrix Expression</a> .</li>
- </ul>
- <h4>Complexity</h4>
- <p>Quadratic depending from the size of the ranges.</p>
- <h4>Examples</h4>
- <pre>
- #include <boost/numeric/ublas/matrix.hpp>
- #include <boost/numeric/ublas/matrix_proxy.hpp>
- #include <boost/numeric/ublas/io.hpp>
- int main () {
- using namespace boost::numeric::ublas;
- matrix<double> m (3, 3);
- for (unsigned i = 0; i < m.size1 (); ++ i)
- for (unsigned j = 0; j < m.size2 (); ++ j)
- project (m, range (0, 3), range (0, 3)) (i, j) = 3 * i + j;
- std::cout << project (m, range (0, 3), range (0, 3)) << std::endl;
- }
- </pre>
- <h2><a name="matrix_slice"></a>Matrix Slice</h2>
- <h4>Description</h4>
- <p>The templated class <code>matrix_slice<M></code> allows
- addressing a sliced sub matrix of a matrix.</p>
- <h4>Example</h4>
- <pre>
- #include <boost/numeric/ublas/matrix.hpp>
- #include <boost/numeric/ublas/matrix_proxy.hpp>
- #include <boost/numeric/ublas/io.hpp>
- int main () {
- using namespace boost::numeric::ublas;
- matrix<double> m (3, 3);
- matrix_slice<matrix<double> > ms (m, slice (0, 1, 3), slice (0, 1, 3));
- for (unsigned i = 0; i < ms.size1 (); ++ i)
- for (unsigned j = 0; j < ms.size2 (); ++ j)
- ms (i, j) = 3 * i + j;
- std::cout << ms << std::endl;
- }
- </pre>
- <h4>Definition</h4>
- <p>Defined in the header matrix_proxy.hpp.</p>
- <h4>Template parameters</h4>
- <table border="1" summary="parameters">
- <tbody>
- <tr>
- <th>Parameter</th>
- <th>Description</th>
- <th>Default</th>
- </tr>
- <tr>
- <td><code>M</code></td>
- <td>The type of matrix referenced.</td>
- <td></td>
- </tr>
- </tbody>
- </table>
- <h4>Model of</h4>
- <p><a href="expression_concept.html#matrix_expression">Matrix Expression</a>
- .</p>
- <p>If the specified slices fall outside that of the index range of
- the matrix, then the <code>matrix_slice</code> is not a well formed
- Matrix Expression. That is, access to an element which is outside
- of the matrix is <i>undefined</i>.</p>
- <h4>Type requirements</h4>
- <p>None, except for those imposed by the requirements of <a href=
- "expression_concept.html#matrix_expression">Matrix Expression</a> .</p>
- <h4>Public base classes</h4>
- <p><code>matrix_expression<matrix_slice<M> ></code></p>
- <h4>Members</h4>
- <table border="1" summary="members">
- <tbody>
- <tr>
- <th>Member</th>
- <th>Description</th>
- </tr>
- <tr>
- <td><code>matrix_slice (matrix_type &data,<br />
- const slice &s1, const slice &s2)</code></td>
- <td>Constructs a sub matrix.</td>
- </tr>
- <tr>
- <td><code>size_type size1 () const</code></td>
- <td>Returns the number of rows.</td>
- </tr>
- <tr>
- <td><code>size_type size2 () const</code></td>
- <td>Returns the number of columns.</td>
- </tr>
- <tr>
- <td><code>const_reference operator () (size_type i, size_type j)
- const</code></td>
- <td>Returns the value of the <code>j</code>-th element in the
- <code>i</code>-th row.</td>
- </tr>
- <tr>
- <td><code>reference operator () (size_type i, size_type
- j)</code></td>
- <td>Returns a reference of the <code>j</code>-th element in the
- <code>i</code>-th row.</td>
- </tr>
- <tr>
- <td><code>matrix_slice &operator = (const matrix_slice
- &ms)</code></td>
- <td>The assignment operator.</td>
- </tr>
- <tr>
- <td><code>matrix_slice &assign_temporary (matrix_slice
- &ms)</code></td>
- <td>Assigns a temporary. May change the matrix slice
- <code>ms</code> .</td>
- </tr>
- <tr>
- <td><code>template<class AE><br />
- matrix_slice &operator = (const matrix_expression<AE>
- &ae)</code></td>
- <td>The extended assignment operator.</td>
- </tr>
- <tr>
- <td><code>template<class AE><br />
- matrix_slice &assign (const matrix_expression<AE>
- &ae)</code></td>
- <td>Assigns a matrix expression to the sub matrix. Left and right
- hand side of the assignment should be independent.</td>
- </tr>
- <tr>
- <td><code>template<class AE><br />
- matrix_slice &operator += (const matrix_expression<AE>
- &ae)</code></td>
- <td>A computed assignment operator. Adds the matrix expression to
- the sub matrix.</td>
- </tr>
- <tr>
- <td><code>template<class AE><br />
- matrix_slice &plus_assign (const matrix_expression<AE>
- &ae)</code></td>
- <td>Adds a matrix expression to the sub matrix. Left and right hand
- side of the assignment should be independent.</td>
- </tr>
- <tr>
- <td><code>template<class AE><br />
- matrix_slice &operator -= (const matrix_expression<AE>
- &ae)</code></td>
- <td>A computed assignment operator. Subtracts the matrix expression
- from the sub matrix.</td>
- </tr>
- <tr>
- <td><code>template<class AE><br />
- matrix_slice &minus_assign (const matrix_expression<AE>
- &ae)</code></td>
- <td>Subtracts a matrix expression from the sub matrix. Left and
- right hand side of the assignment should be independent.</td>
- </tr>
- <tr>
- <td><code>template<class AT><br />
- matrix_slice &operator *= (const AT &at)</code></td>
- <td>A computed assignment operator. Multiplies the sub matrix with
- a scalar.</td>
- </tr>
- <tr>
- <td><code>template<class AT><br />
- matrix_slice &operator /= (const AT &at)</code></td>
- <td>A computed assignment operator. Multiplies the sub matrix
- through a scalar.</td>
- </tr>
- <tr>
- <td><code>void swap (matrix_slice &ms)</code></td>
- <td>Swaps the contents of the sub matrices.</td>
- </tr>
- <tr>
- <td><code>const_iterator1 begin1 () const</code></td>
- <td>Returns a <code>const_iterator1</code> pointing to the
- beginning of the <code>matrix_slice</code>.</td>
- </tr>
- <tr>
- <td><code>const_iterator1 end1 () const</code></td>
- <td>Returns a <code>const_iterator1</code> pointing to the end of
- the <code>matrix_slice</code>.</td>
- </tr>
- <tr>
- <td><code>iterator1 begin1 ()</code></td>
- <td>Returns a <code>iterator1</code> pointing to the beginning of
- the <code>matrix_slice</code>.</td>
- </tr>
- <tr>
- <td><code>iterator1 end1 ()</code></td>
- <td>Returns a <code>iterator1</code> pointing to the end of the
- <code>matrix_slice</code>.</td>
- </tr>
- <tr>
- <td><code>const_iterator2 begin2 () const</code></td>
- <td>Returns a <code>const_iterator2</code> pointing to the
- beginning of the <code>matrix_slice</code>.</td>
- </tr>
- <tr>
- <td><code>const_iterator2 end2 () const</code></td>
- <td>Returns a <code>const_iterator2</code> pointing to the end of
- the <code>matrix_slice</code>.</td>
- </tr>
- <tr>
- <td><code>iterator2 begin2 ()</code></td>
- <td>Returns a <code>iterator2</code> pointing to the beginning of
- the <code>matrix_slice</code>.</td>
- </tr>
- <tr>
- <td><code>iterator2 end2 ()</code></td>
- <td>Returns a <code>iterator2</code> pointing to the end of the
- <code>matrix_slice</code>.</td>
- </tr>
- <tr>
- <td><code>const_reverse_iterator1 rbegin1 () const</code></td>
- <td>Returns a <code>const_reverse_iterator1</code> pointing to the
- beginning of the reversed <code>matrix_slice</code>.</td>
- </tr>
- <tr>
- <td><code>const_reverse_iterator1 rend1 () const</code></td>
- <td>Returns a <code>const_reverse_iterator1</code> pointing to the
- end of the reversed <code>matrix_slice</code>.</td>
- </tr>
- <tr>
- <td><code>reverse_iterator1 rbegin1 ()</code></td>
- <td>Returns a <code>reverse_iterator1</code> pointing to the
- beginning of the reversed <code>matrix_slice</code>.</td>
- </tr>
- <tr>
- <td><code>reverse_iterator1 rend1 ()</code></td>
- <td>Returns a <code>reverse_iterator1</code> pointing to the end of
- the reversed <code>matrix_slice</code>.</td>
- </tr>
- <tr>
- <td><code>const_reverse_iterator2 rbegin2 () const</code></td>
- <td>Returns a <code>const_reverse_iterator2</code> pointing to the
- beginning of the reversed <code>matrix_slice</code>.</td>
- </tr>
- <tr>
- <td><code>const_reverse_iterator2 rend2 () const</code></td>
- <td>Returns a <code>const_reverse_iterator2</code> pointing to the
- end of the reversed <code>matrix_slice</code>.</td>
- </tr>
- <tr>
- <td><code>reverse_iterator2 rbegin2 ()</code></td>
- <td>Returns a <code>reverse_iterator2</code> pointing to the
- beginning of the reversed <code>matrix_slice</code>.</td>
- </tr>
- <tr>
- <td><code>reverse_iterator2 rend2 ()</code></td>
- <td>Returns a <code>reverse_iterator2</code> pointing to the end of
- the reversed <code>matrix_slice</code>.</td>
- </tr>
- </tbody>
- </table>
- <h3>Simple Projections</h3>
- <h4>Description</h4>
- <p>The free <code>subslice</code> functions support the construction
- of matrix slices.</p>
- <h4>Prototypes</h4>
- <pre><code>
- template<class M>
- matrix_slice<M> subslice (M &data,
- M::size_type start1, M::difference_type stride1, M::size_type size1,
- M::size_type start2, M::difference_type stride2, M::size_type size2);
- template<class M>
- const matrix_slice<const M> subslice (const M &data,
- M::size_type start1, M::difference_type stride1, M::size_type size1,
- M::size_type start2, M::difference_type stride2, M::size_type size2);
- </code></pre>
- <h3>Generic Projections</h3>
- <h4>Description</h4>
- <p>The free <code>project</code> functions support the construction
- of matrix slices. Existing <code>matrix_slice</code>'s can be composed with further ranges or slices. The resulting slices are computed using this existing slices' <code>compose</code> function.</p>
- <h4>Prototypes</h4>
- <pre><code>
- template<class M>
- matrix_slice<M> project (M &data, const slice &s1, const slice &s2);
- template<class M>
- const matrix_slice<const M> project (const M &data, const slice &s1, const slice &s2);
- template<class M>
- matrix_slice<M> project (matrix_slice<M> &data, const range &r1, const range &r2);
- template<class M>
- const matrix_slice<M> project (const matrix_slice<M> &data, const range &r1, const range &r2);
- template<class M>
- matrix_slice<M> project (matrix_slice<M> &data, const slice &s1, const slice &s2);
- template<class M>
- const matrix_slice<M> project (const matrix_slice<M> &data, const slice &s1, const slice &s2);
- </code></pre>
- <h4>Definition</h4>
- <p>Defined in the header matrix_proxy.hpp.</p>
- <h4>Type requirements</h4>
- <ul>
- <li><code>M</code> is a model of <a href=
- "expression_concept.html#matrix_expression">Matrix Expression</a> .</li>
- </ul>
- <h4>Complexity</h4>
- <p>Quadratic depending from the size of the slices.</p>
- <h4>Examples</h4>
- <pre>
- #include <boost/numeric/ublas/matrix.hpp>
- #include <boost/numeric/ublas/matrix_proxy.hpp>
- #include <boost/numeric/ublas/io.hpp>
- int main () {
- using namespace boost::numeric::ublas;
- matrix<double> m (3, 3);
- for (unsigned i = 0; i < m.size1 (); ++ i)
- for (unsigned j = 0; j < m.size2 (); ++ j)
- project (m, slice (0, 1, 3), slice (0, 1, 3)) (i, j) = 3 * i + j;
- std::cout << project (m, slice (0, 1, 3), slice (0, 1, 3)) << std::endl;
- }
- </pre>
- <hr />
- <p>Copyright (©) 2000-2002 Joerg Walter, Mathias Koch<br />
- Use, modification and distribution are subject to the
- Boost Software License, Version 1.0.
- (See accompanying file LICENSE_1_0.txt
- or copy at <a href="http://www.boost.org/LICENSE_1_0.txt">
- http://www.boost.org/LICENSE_1_0.txt
- </a>).
- </p>
- <script type="text/javascript">
- (function($) {
- $('#toc').toc();
- })(jQuery);
- </script>
- </body>
- </html>
|