2
0
mirror of https://github.com/boostorg/ublas.git synced 2026-02-21 03:22:14 +00:00
Files
ublas/doc/doxyfiles/html/a00628_source.html
David Bellot 64ba5b055d new doxyfiles
svn path=/trunk/libs/numeric/ublas/; revision=75573
2011-11-20 14:50:03 +00:00

354 lines
30 KiB
HTML

<!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 http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Boost.uBlas: operation_sparse.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.3 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<script type="text/javascript">
function hasClass(ele,cls) {
return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)'));
}
function addClass(ele,cls) {
if (!this.hasClass(ele,cls)) ele.className += " "+cls;
}
function removeClass(ele,cls) {
if (hasClass(ele,cls)) {
var reg = new RegExp('(\\s|^)'+cls+'(\\s|$)');
ele.className=ele.className.replace(reg,' ');
}
}
function toggleVisibility(linkObj) {
var base = linkObj.getAttribute('id');
var summary = document.getElementById(base + '-summary');
var content = document.getElementById(base + '-content');
var trigger = document.getElementById(base + '-trigger');
if ( hasClass(linkObj,'closed') ) {
summary.style.display = 'none';
content.style.display = 'block';
trigger.src = 'open.png';
removeClass(linkObj,'closed');
addClass(linkObj,'opened');
} else if ( hasClass(linkObj,'opened') ) {
summary.style.display = 'block';
content.style.display = 'none';
trigger.src = 'closed.png';
removeClass(linkObj,'opened');
addClass(linkObj,'closed');
}
return false;
}
</script>
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="logo boost ublas.png"></td>
<td style="padding-left: 0.5em;">
<div id="projectname">Boost.uBlas&#160;<span id="projectnumber">1.49</span></div>
<div id="projectbrief">Linear Algebra in C++: matrices, vectors and numeric algorithms</div>
</td>
</tr>
</tbody>
</table>
</div>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
<li><a href="globals.html"><span>File&#160;Members</span></a></li>
</ul>
</div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
initNavTree('a00628.html','');
</script>
<div id="doc-content">
<div class="header">
<div class="headertitle">
<h1>operation_sparse.hpp</h1> </div>
</div>
<div class="contents">
<a href="a00628.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">//</span>
<a name="l00002"></a>00002 <span class="comment">// Copyright (c) 2000-2002</span>
<a name="l00003"></a>00003 <span class="comment">// Joerg Walter, Mathias Koch</span>
<a name="l00004"></a>00004 <span class="comment">//</span>
<a name="l00005"></a>00005 <span class="comment">// Distributed under the Boost Software License, Version 1.0. (See</span>
<a name="l00006"></a>00006 <span class="comment">// accompanying file LICENSE_1_0.txt or copy at</span>
<a name="l00007"></a>00007 <span class="comment">// http://www.boost.org/LICENSE_1_0.txt)</span>
<a name="l00008"></a>00008 <span class="comment">//</span>
<a name="l00009"></a>00009 <span class="comment">// The authors gratefully acknowledge the support of</span>
<a name="l00010"></a>00010 <span class="comment">// GeNeSys mbH &amp; Co. KG in producing this work.</span>
<a name="l00011"></a>00011 <span class="comment">//</span>
<a name="l00012"></a>00012
<a name="l00013"></a>00013 <span class="preprocessor">#ifndef _BOOST_UBLAS_OPERATION_SPARSE_</span>
<a name="l00014"></a>00014 <span class="preprocessor"></span><span class="preprocessor">#define _BOOST_UBLAS_OPERATION_SPARSE_</span>
<a name="l00015"></a>00015 <span class="preprocessor"></span>
<a name="l00016"></a>00016 <span class="preprocessor">#include &lt;boost/numeric/ublas/traits.hpp&gt;</span>
<a name="l00017"></a>00017
<a name="l00018"></a>00018 <span class="comment">// These scaled additions were borrowed from MTL unashamedly.</span>
<a name="l00019"></a>00019 <span class="comment">// But Alexei Novakov had a lot of ideas to improve these. Thanks.</span>
<a name="l00020"></a>00020
<a name="l00021"></a>00021 <span class="keyword">namespace </span>boost { <span class="keyword">namespace </span>numeric { <span class="keyword">namespace </span>ublas {
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="keyword">template</span>&lt;<span class="keyword">class</span> M, <span class="keyword">class</span> E1, <span class="keyword">class</span> E2, <span class="keyword">class</span> TRI&gt;
<a name="l00024"></a>00024 <a class="code" href="a00603.html#a578c14139742374e9a04e5afcb6cd24c">BOOST_UBLAS_INLINE</a>
<a name="l00025"></a>00025 M &amp;
<a name="l00026"></a><a class="code" href="a00595.html#a6c1c7a398bc5813a4e53c1fe0b9c1f7e">00026</a> <a class="code" href="a00595.html#a6c1c7a398bc5813a4e53c1fe0b9c1f7e">sparse_prod</a> (<span class="keyword">const</span> <a class="code" href="a00251.html" title="Base class for Matrix Expression models.">matrix_expression&lt;E1&gt;</a> &amp;e1,
<a name="l00027"></a>00027 <span class="keyword">const</span> <a class="code" href="a00251.html" title="Base class for Matrix Expression models.">matrix_expression&lt;E2&gt;</a> &amp;e2,
<a name="l00028"></a>00028 M &amp;m, TRI,
<a name="l00029"></a>00029 <a class="code" href="a00369.html">row_major_tag</a>) {
<a name="l00030"></a>00030 <span class="keyword">typedef</span> M matrix_type;
<a name="l00031"></a>00031 <span class="keyword">typedef</span> TRI triangular_restriction;
<a name="l00032"></a>00032 <span class="keyword">typedef</span> <span class="keyword">const</span> E1 expression1_type;
<a name="l00033"></a>00033 <span class="keyword">typedef</span> <span class="keyword">const</span> E2 expression2_type;
<a name="l00034"></a>00034 <span class="keyword">typedef</span> <span class="keyword">typename</span> M::size_type size_type;
<a name="l00035"></a>00035 <span class="keyword">typedef</span> <span class="keyword">typename</span> M::value_type value_type;
<a name="l00036"></a>00036
<a name="l00037"></a>00037 <span class="comment">// ISSUE why is there a dense vector here?</span>
<a name="l00038"></a>00038 <a class="code" href="a00481.html" title="A dense vector of values of type T.">vector&lt;value_type&gt;</a> temporary (e2 ().<a class="code" href="a00658.html#a981c2ed31bf42bd03499d4ee32444141">size2</a> ());
<a name="l00039"></a>00039 temporary.<a class="code" href="a00481.html#aad56668044d71db97be9e44db273f09a" title="Clear the vector, i.e. set all values to the zero value.">clear</a> ();
<a name="l00040"></a>00040 <span class="keyword">typename</span> expression1_type::const_iterator1 it1 (e1 ().<a class="code" href="a00595.html#a006ba58a3f4c88d8e8e76e44db481757" title="An object generator that returns a begin1 manipulator.">begin1</a> ());
<a name="l00041"></a>00041 <span class="keyword">typename</span> expression1_type::const_iterator1 it1_end (e1 ().end1 ());
<a name="l00042"></a>00042 <span class="keywordflow">while</span> (it1 != it1_end) {
<a name="l00043"></a>00043 size_type jb (temporary.<a class="code" href="a00481.html#a1b9ef7522219d74ebd27bab25e4b6841" title="Return the size of the vector.">size</a> ());
<a name="l00044"></a>00044 size_type je (0);
<a name="l00045"></a>00045 <span class="preprocessor">#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION</span>
<a name="l00046"></a>00046 <span class="preprocessor"></span> <span class="keyword">typename</span> expression1_type::const_iterator2 it2 (it1.begin ());
<a name="l00047"></a>00047 <span class="keyword">typename</span> expression1_type::const_iterator2 it2_end (it1.end ());
<a name="l00048"></a>00048 <span class="preprocessor">#else</span>
<a name="l00049"></a>00049 <span class="preprocessor"></span> <span class="keyword">typename</span> expression1_type::const_iterator2 it2 (<a class="code" href="a00595.html#ae2297dd9051333c2ec1d0f63175f66fe" title="An iterator to the first element of the given vector expression.">boost::numeric::ublas::begin</a> (it1, iterator1_tag ()));
<a name="l00050"></a>00050 <span class="keyword">typename</span> expression1_type::const_iterator2 it2_end (<a class="code" href="a00595.html#a5e8a7fc1352cd3e148064608dad9f38d" title="An iterator to the last element of the given vector expression.">boost::numeric::ublas::end</a> (it1, iterator1_tag ()));
<a name="l00051"></a>00051 <span class="preprocessor">#endif</span>
<a name="l00052"></a>00052 <span class="preprocessor"></span> <span class="keywordflow">while</span> (it2 != it2_end) {
<a name="l00053"></a>00053 <span class="comment">// temporary.plus_assign (*it2 * row (e2 (), it2.index2 ()));</span>
<a name="l00054"></a>00054 <a class="code" href="a00276.html">matrix_row&lt;expression2_type&gt;</a> mr (e2 (), it2.index2 ());
<a name="l00055"></a>00055 <span class="keyword">typename</span> <a class="code" href="a00277.html">matrix_row&lt;expression2_type&gt;::const_iterator</a> itr (mr.begin ());
<a name="l00056"></a>00056 <span class="keyword">typename</span> <a class="code" href="a00277.html">matrix_row&lt;expression2_type&gt;::const_iterator</a> itr_end (mr.end ());
<a name="l00057"></a>00057 <span class="keywordflow">while</span> (itr != itr_end) {
<a name="l00058"></a>00058 size_type j (itr.index ());
<a name="l00059"></a>00059 temporary (j) += *it2 * *itr;
<a name="l00060"></a>00060 jb = (std::min) (jb, j);
<a name="l00061"></a>00061 je = (std::max) (je, j);
<a name="l00062"></a>00062 ++ itr;
<a name="l00063"></a>00063 }
<a name="l00064"></a>00064 ++ it2;
<a name="l00065"></a>00065 }
<a name="l00066"></a>00066 <span class="keywordflow">for</span> (size_type j = jb; j &lt; je + 1; ++ j) {
<a name="l00067"></a>00067 <span class="keywordflow">if</span> (temporary (j) != value_type<span class="comment">/*zero*/</span>()) {
<a name="l00068"></a>00068 <span class="comment">// FIXME we&#39;ll need to extend the container interface!</span>
<a name="l00069"></a>00069 <span class="comment">// m.push_back (it1.index1 (), j, temporary (j));</span>
<a name="l00070"></a>00070 <span class="comment">// FIXME What to do with adaptors?</span>
<a name="l00071"></a>00071 <span class="comment">// m.insert (it1.index1 (), j, temporary (j));</span>
<a name="l00072"></a>00072 <span class="keywordflow">if</span> (triangular_restriction::other (it1.index1 (), j))
<a name="l00073"></a>00073 m (it1.index1 (), j) = temporary (j);
<a name="l00074"></a>00074 temporary (j) = value_type<span class="comment">/*zero*/</span>();
<a name="l00075"></a>00075 }
<a name="l00076"></a>00076 }
<a name="l00077"></a>00077 ++ it1;
<a name="l00078"></a>00078 }
<a name="l00079"></a>00079 <span class="keywordflow">return</span> m;
<a name="l00080"></a>00080 }
<a name="l00081"></a>00081
<a name="l00082"></a>00082 <span class="keyword">template</span>&lt;<span class="keyword">class</span> M, <span class="keyword">class</span> E1, <span class="keyword">class</span> E2, <span class="keyword">class</span> TRI&gt;
<a name="l00083"></a>00083 <a class="code" href="a00603.html#a578c14139742374e9a04e5afcb6cd24c">BOOST_UBLAS_INLINE</a>
<a name="l00084"></a>00084 M &amp;
<a name="l00085"></a><a class="code" href="a00595.html#a4cc6d1c9e20b0acdfa6272f3ff5965b8">00085</a> <a class="code" href="a00595.html#a6c1c7a398bc5813a4e53c1fe0b9c1f7e">sparse_prod</a> (<span class="keyword">const</span> <a class="code" href="a00251.html" title="Base class for Matrix Expression models.">matrix_expression&lt;E1&gt;</a> &amp;e1,
<a name="l00086"></a>00086 <span class="keyword">const</span> <a class="code" href="a00251.html" title="Base class for Matrix Expression models.">matrix_expression&lt;E2&gt;</a> &amp;e2,
<a name="l00087"></a>00087 M &amp;m, TRI,
<a name="l00088"></a>00088 <a class="code" href="a00052.html">column_major_tag</a>) {
<a name="l00089"></a>00089 <span class="keyword">typedef</span> M matrix_type;
<a name="l00090"></a>00090 <span class="keyword">typedef</span> TRI triangular_restriction;
<a name="l00091"></a>00091 <span class="keyword">typedef</span> <span class="keyword">const</span> E1 expression1_type;
<a name="l00092"></a>00092 <span class="keyword">typedef</span> <span class="keyword">const</span> E2 expression2_type;
<a name="l00093"></a>00093 <span class="keyword">typedef</span> <span class="keyword">typename</span> M::size_type size_type;
<a name="l00094"></a>00094 <span class="keyword">typedef</span> <span class="keyword">typename</span> M::value_type value_type;
<a name="l00095"></a>00095
<a name="l00096"></a>00096 <span class="comment">// ISSUE why is there a dense vector here?</span>
<a name="l00097"></a>00097 <a class="code" href="a00481.html" title="A dense vector of values of type T.">vector&lt;value_type&gt;</a> temporary (e1 ().<a class="code" href="a00658.html#a979596ba6e2373d596e34c2a73809cf6">size1</a> ());
<a name="l00098"></a>00098 temporary.<a class="code" href="a00481.html#aad56668044d71db97be9e44db273f09a" title="Clear the vector, i.e. set all values to the zero value.">clear</a> ();
<a name="l00099"></a>00099 <span class="keyword">typename</span> expression2_type::const_iterator2 it2 (e2 ().<a class="code" href="a00595.html#a0a5c2ce4e11de4e7ea5ccd122073052c" title="An object generator that returns a begin2 manipulator to be used to traverse a matrix.">begin2</a> ());
<a name="l00100"></a>00100 <span class="keyword">typename</span> expression2_type::const_iterator2 it2_end (e2 ().end2 ());
<a name="l00101"></a>00101 <span class="keywordflow">while</span> (it2 != it2_end) {
<a name="l00102"></a>00102 size_type ib (temporary.<a class="code" href="a00481.html#a1b9ef7522219d74ebd27bab25e4b6841" title="Return the size of the vector.">size</a> ());
<a name="l00103"></a>00103 size_type ie (0);
<a name="l00104"></a>00104 <span class="preprocessor">#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION</span>
<a name="l00105"></a>00105 <span class="preprocessor"></span> <span class="keyword">typename</span> expression2_type::const_iterator1 it1 (it2.begin ());
<a name="l00106"></a>00106 <span class="keyword">typename</span> expression2_type::const_iterator1 it1_end (it2.end ());
<a name="l00107"></a>00107 <span class="preprocessor">#else</span>
<a name="l00108"></a>00108 <span class="preprocessor"></span> <span class="keyword">typename</span> expression2_type::const_iterator1 it1 (<a class="code" href="a00595.html#ae2297dd9051333c2ec1d0f63175f66fe" title="An iterator to the first element of the given vector expression.">boost::numeric::ublas::begin</a> (it2, iterator2_tag ()));
<a name="l00109"></a>00109 <span class="keyword">typename</span> expression2_type::const_iterator1 it1_end (<a class="code" href="a00595.html#a5e8a7fc1352cd3e148064608dad9f38d" title="An iterator to the last element of the given vector expression.">boost::numeric::ublas::end</a> (it2, iterator2_tag ()));
<a name="l00110"></a>00110 <span class="preprocessor">#endif</span>
<a name="l00111"></a>00111 <span class="preprocessor"></span> <span class="keywordflow">while</span> (it1 != it1_end) {
<a name="l00112"></a>00112 <span class="comment">// column (m, it2.index2 ()).plus_assign (*it1 * column (e1 (), it1.index1 ()));</span>
<a name="l00113"></a>00113 <a class="code" href="a00247.html">matrix_column&lt;expression1_type&gt;</a> mc (e1 (), it1.index1 ());
<a name="l00114"></a>00114 <span class="keyword">typename</span> <a class="code" href="a00248.html">matrix_column&lt;expression1_type&gt;::const_iterator</a> itc (mc.begin ());
<a name="l00115"></a>00115 <span class="keyword">typename</span> <a class="code" href="a00248.html">matrix_column&lt;expression1_type&gt;::const_iterator</a> itc_end (mc.end ());
<a name="l00116"></a>00116 <span class="keywordflow">while</span> (itc != itc_end) {
<a name="l00117"></a>00117 size_type i (itc.index ());
<a name="l00118"></a>00118 temporary (i) += *it1 * *itc;
<a name="l00119"></a>00119 ib = (std::min) (ib, i);
<a name="l00120"></a>00120 ie = (std::max) (ie, i);
<a name="l00121"></a>00121 ++ itc;
<a name="l00122"></a>00122 }
<a name="l00123"></a>00123 ++ it1;
<a name="l00124"></a>00124 }
<a name="l00125"></a>00125 <span class="keywordflow">for</span> (size_type i = ib; i &lt; ie + 1; ++ i) {
<a name="l00126"></a>00126 <span class="keywordflow">if</span> (temporary (i) != value_type<span class="comment">/*zero*/</span>()) {
<a name="l00127"></a>00127 <span class="comment">// FIXME we&#39;ll need to extend the container interface!</span>
<a name="l00128"></a>00128 <span class="comment">// m.push_back (i, it2.index2 (), temporary (i));</span>
<a name="l00129"></a>00129 <span class="comment">// FIXME What to do with adaptors?</span>
<a name="l00130"></a>00130 <span class="comment">// m.insert (i, it2.index2 (), temporary (i));</span>
<a name="l00131"></a>00131 <span class="keywordflow">if</span> (triangular_restriction::other (i, it2.index2 ()))
<a name="l00132"></a>00132 m (i, it2.index2 ()) = temporary (i);
<a name="l00133"></a>00133 temporary (i) = value_type<span class="comment">/*zero*/</span>();
<a name="l00134"></a>00134 }
<a name="l00135"></a>00135 }
<a name="l00136"></a>00136 ++ it2;
<a name="l00137"></a>00137 }
<a name="l00138"></a>00138 <span class="keywordflow">return</span> m;
<a name="l00139"></a>00139 }
<a name="l00140"></a>00140
<a name="l00141"></a>00141 <span class="comment">// Dispatcher</span>
<a name="l00142"></a>00142 <span class="keyword">template</span>&lt;<span class="keyword">class</span> M, <span class="keyword">class</span> E1, <span class="keyword">class</span> E2, <span class="keyword">class</span> TRI&gt;
<a name="l00143"></a>00143 <a class="code" href="a00603.html#a578c14139742374e9a04e5afcb6cd24c">BOOST_UBLAS_INLINE</a>
<a name="l00144"></a>00144 M &amp;
<a name="l00145"></a><a class="code" href="a00595.html#aafa8ff376f8f72c47e8957423e4f0b5a">00145</a> <a class="code" href="a00595.html#a6c1c7a398bc5813a4e53c1fe0b9c1f7e">sparse_prod</a> (<span class="keyword">const</span> <a class="code" href="a00251.html" title="Base class for Matrix Expression models.">matrix_expression&lt;E1&gt;</a> &amp;e1,
<a name="l00146"></a>00146 <span class="keyword">const</span> <a class="code" href="a00251.html" title="Base class for Matrix Expression models.">matrix_expression&lt;E2&gt;</a> &amp;e2,
<a name="l00147"></a>00147 M &amp;m, TRI, <span class="keywordtype">bool</span> init = <span class="keyword">true</span>) {
<a name="l00148"></a>00148 <span class="keyword">typedef</span> <span class="keyword">typename</span> M::value_type value_type;
<a name="l00149"></a>00149 <span class="keyword">typedef</span> TRI triangular_restriction;
<a name="l00150"></a>00150 <span class="keyword">typedef</span> <span class="keyword">typename</span> M::orientation_category orientation_category;
<a name="l00151"></a>00151
<a name="l00152"></a>00152 <span class="keywordflow">if</span> (init)
<a name="l00153"></a>00153 m.assign (<a class="code" href="a00587.html" title="A matrix with all values of type T equal to zero.">zero_matrix&lt;value_type&gt;</a> (e1 ().<a class="code" href="a00658.html#a979596ba6e2373d596e34c2a73809cf6">size1</a> (), e2 ().<a class="code" href="a00658.html#a981c2ed31bf42bd03499d4ee32444141">size2</a> ()));
<a name="l00154"></a>00154 <span class="keywordflow">return</span> <a class="code" href="a00595.html#a6c1c7a398bc5813a4e53c1fe0b9c1f7e">sparse_prod</a> (e1, e2, m, triangular_restriction (), orientation_category ());
<a name="l00155"></a>00155 }
<a name="l00156"></a>00156 <span class="keyword">template</span>&lt;<span class="keyword">class</span> M, <span class="keyword">class</span> E1, <span class="keyword">class</span> E2, <span class="keyword">class</span> TRI&gt;
<a name="l00157"></a>00157 <a class="code" href="a00603.html#a578c14139742374e9a04e5afcb6cd24c">BOOST_UBLAS_INLINE</a>
<a name="l00158"></a>00158 M
<a name="l00159"></a><a class="code" href="a00595.html#a2d2c3210220ad40f0d8e2076a52485f8">00159</a> <a class="code" href="a00595.html#a6c1c7a398bc5813a4e53c1fe0b9c1f7e">sparse_prod</a> (<span class="keyword">const</span> <a class="code" href="a00251.html" title="Base class for Matrix Expression models.">matrix_expression&lt;E1&gt;</a> &amp;e1,
<a name="l00160"></a>00160 <span class="keyword">const</span> <a class="code" href="a00251.html" title="Base class for Matrix Expression models.">matrix_expression&lt;E2&gt;</a> &amp;e2,
<a name="l00161"></a>00161 TRI) {
<a name="l00162"></a>00162 <span class="keyword">typedef</span> M matrix_type;
<a name="l00163"></a>00163 <span class="keyword">typedef</span> TRI triangular_restriction;
<a name="l00164"></a>00164
<a name="l00165"></a>00165 matrix_type m (e1 ().<a class="code" href="a00658.html#a979596ba6e2373d596e34c2a73809cf6">size1</a> (), e2 ().<a class="code" href="a00658.html#a981c2ed31bf42bd03499d4ee32444141">size2</a> ());
<a name="l00166"></a>00166 <span class="comment">// FIXME needed for c_matrix?!</span>
<a name="l00167"></a>00167 <span class="comment">// return sparse_prod (e1, e2, m, triangular_restriction (), false);</span>
<a name="l00168"></a>00168 <span class="keywordflow">return</span> <a class="code" href="a00595.html#a6c1c7a398bc5813a4e53c1fe0b9c1f7e">sparse_prod</a> (e1, e2, m, triangular_restriction (), <span class="keyword">true</span>);
<a name="l00169"></a>00169 }
<a name="l00170"></a>00170 <span class="keyword">template</span>&lt;<span class="keyword">class</span> M, <span class="keyword">class</span> E1, <span class="keyword">class</span> E2&gt;
<a name="l00171"></a>00171 <a class="code" href="a00603.html#a578c14139742374e9a04e5afcb6cd24c">BOOST_UBLAS_INLINE</a>
<a name="l00172"></a>00172 M &amp;
<a name="l00173"></a><a class="code" href="a00595.html#a451b4470986845262656ad781d3ffcb1">00173</a> <a class="code" href="a00595.html#a6c1c7a398bc5813a4e53c1fe0b9c1f7e">sparse_prod</a> (<span class="keyword">const</span> <a class="code" href="a00251.html" title="Base class for Matrix Expression models.">matrix_expression&lt;E1&gt;</a> &amp;e1,
<a name="l00174"></a>00174 <span class="keyword">const</span> <a class="code" href="a00251.html" title="Base class for Matrix Expression models.">matrix_expression&lt;E2&gt;</a> &amp;e2,
<a name="l00175"></a>00175 M &amp;m, <span class="keywordtype">bool</span> init = <span class="keyword">true</span>) {
<a name="l00176"></a>00176 <span class="keyword">typedef</span> <span class="keyword">typename</span> M::value_type value_type;
<a name="l00177"></a>00177 <span class="keyword">typedef</span> <span class="keyword">typename</span> M::orientation_category orientation_category;
<a name="l00178"></a>00178
<a name="l00179"></a>00179 <span class="keywordflow">if</span> (init)
<a name="l00180"></a>00180 m.assign (<a class="code" href="a00587.html" title="A matrix with all values of type T equal to zero.">zero_matrix&lt;value_type&gt;</a> (e1 ().<a class="code" href="a00658.html#a979596ba6e2373d596e34c2a73809cf6">size1</a> (), e2 ().<a class="code" href="a00658.html#a981c2ed31bf42bd03499d4ee32444141">size2</a> ()));
<a name="l00181"></a>00181 <span class="keywordflow">return</span> <a class="code" href="a00595.html#a6c1c7a398bc5813a4e53c1fe0b9c1f7e">sparse_prod</a> (e1, e2, m, <a class="code" href="a00028.html">full</a> (), orientation_category ());
<a name="l00182"></a>00182 }
<a name="l00183"></a>00183 <span class="keyword">template</span>&lt;<span class="keyword">class</span> M, <span class="keyword">class</span> E1, <span class="keyword">class</span> E2&gt;
<a name="l00184"></a>00184 <a class="code" href="a00603.html#a578c14139742374e9a04e5afcb6cd24c">BOOST_UBLAS_INLINE</a>
<a name="l00185"></a>00185 M
<a name="l00186"></a><a class="code" href="a00595.html#aaebe0c11ad6f20f6062d7866f6b9a2e5">00186</a> <a class="code" href="a00595.html#a6c1c7a398bc5813a4e53c1fe0b9c1f7e">sparse_prod</a> (<span class="keyword">const</span> <a class="code" href="a00251.html" title="Base class for Matrix Expression models.">matrix_expression&lt;E1&gt;</a> &amp;e1,
<a name="l00187"></a>00187 <span class="keyword">const</span> <a class="code" href="a00251.html" title="Base class for Matrix Expression models.">matrix_expression&lt;E2&gt;</a> &amp;e2) {
<a name="l00188"></a>00188 <span class="keyword">typedef</span> M matrix_type;
<a name="l00189"></a>00189
<a name="l00190"></a>00190 matrix_type m (e1 ().<a class="code" href="a00658.html#a979596ba6e2373d596e34c2a73809cf6">size1</a> (), e2 ().<a class="code" href="a00658.html#a981c2ed31bf42bd03499d4ee32444141">size2</a> ());
<a name="l00191"></a>00191 <span class="comment">// FIXME needed for c_matrix?!</span>
<a name="l00192"></a>00192 <span class="comment">// return sparse_prod (e1, e2, m, full (), false);</span>
<a name="l00193"></a>00193 <span class="keywordflow">return</span> <a class="code" href="a00595.html#a6c1c7a398bc5813a4e53c1fe0b9c1f7e">sparse_prod</a> (e1, e2, m, <a class="code" href="a00028.html">full</a> (), <span class="keyword">true</span>);
<a name="l00194"></a>00194 }
<a name="l00195"></a>00195
<a name="l00196"></a>00196 }}}
<a name="l00197"></a>00197
<a name="l00198"></a>00198 <span class="preprocessor">#endif</span>
</pre></div></div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="a00628.html">operation_sparse.hpp</a> </li>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Defines</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<small>
<small>
<small>
<table width="100%">
<tr>
<td align="right">
Copyright &#169; 2010-2011 David Bellot - Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">Boost Software License, Version 1.0.</a>
</td>
</tr>
</table>
</small>
</small>
</small>