Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 2f6559b7006594cad03af173263c219e > files > 1910

mrpt-doc-0.9.4-0.1.20110110svn2383.fc15.i686.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>The MRPT project: GeneralMatrixMatrix.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<div align="left"><a href="http://www.mrpt.org/">Main MRPT website</a> &gt; <b>C++ reference</b> </div>
<div align="right">
<a href="index.html"><img border="0" src="mrpt_logo.png" alt="MRPT logo"></a>
</div>
<!-- Generated by Doxygen 1.7.2 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div class="navigation" id="top">
  <div class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</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">
            <form id="FSearchBox" action="search.php" method="get">
              <img id="MSearchSelect" src="search/mag.png" alt=""/>
              <input type="text" id="MSearchField" name="query" value="Search" size="20" accesskey="S" 
                     onfocus="searchBox.OnSearchFieldFocus(true)" 
                     onblur="searchBox.OnSearchFieldFocus(false)"/>
            </form>
          </span><span class="right"></span>
        </div>
      </li>
    </ul>
  </div>
  <div 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 class="header">
  <div class="headertitle">
<h1>GeneralMatrixMatrix.h</h1>  </div>
</div>
<div class="contents">
<a href="_general_matrix_matrix_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// This file is part of Eigen, a lightweight C++ template library</span>
<a name="l00002"></a>00002 <span class="comment">// for linear algebra.</span>
<a name="l00003"></a>00003 <span class="comment">//</span>
<a name="l00004"></a>00004 <span class="comment">// Copyright (C) 2008-2009 Gael Guennebaud &lt;gael.guennebaud@inria.fr&gt;</span>
<a name="l00005"></a>00005 <span class="comment">//</span>
<a name="l00006"></a>00006 <span class="comment">// Eigen is free software; you can redistribute it and/or</span>
<a name="l00007"></a>00007 <span class="comment">// modify it under the terms of the GNU Lesser General Public</span>
<a name="l00008"></a>00008 <span class="comment">// License as published by the Free Software Foundation; either</span>
<a name="l00009"></a>00009 <span class="comment">// version 3 of the License, or (at your option) any later version.</span>
<a name="l00010"></a>00010 <span class="comment">//</span>
<a name="l00011"></a>00011 <span class="comment">// Alternatively, you can redistribute it and/or</span>
<a name="l00012"></a>00012 <span class="comment">// modify it under the terms of the GNU General Public License as</span>
<a name="l00013"></a>00013 <span class="comment">// published by the Free Software Foundation; either version 2 of</span>
<a name="l00014"></a>00014 <span class="comment">// the License, or (at your option) any later version.</span>
<a name="l00015"></a>00015 <span class="comment">//</span>
<a name="l00016"></a>00016 <span class="comment">// Eigen is distributed in the hope that it will be useful, but WITHOUT ANY</span>
<a name="l00017"></a>00017 <span class="comment">// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS</span>
<a name="l00018"></a>00018 <span class="comment">// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the</span>
<a name="l00019"></a>00019 <span class="comment">// GNU General Public License for more details.</span>
<a name="l00020"></a>00020 <span class="comment">//</span>
<a name="l00021"></a>00021 <span class="comment">// You should have received a copy of the GNU Lesser General Public</span>
<a name="l00022"></a>00022 <span class="comment">// License and a copy of the GNU General Public License along with</span>
<a name="l00023"></a>00023 <span class="comment">// Eigen. If not, see &lt;http://www.gnu.org/licenses/&gt;.</span>
<a name="l00024"></a>00024 
<a name="l00025"></a>00025 <span class="preprocessor">#ifndef EIGEN_GENERAL_MATRIX_MATRIX_H</span>
<a name="l00026"></a>00026 <span class="preprocessor"></span><span class="preprocessor">#define EIGEN_GENERAL_MATRIX_MATRIX_H</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span>
<a name="l00028"></a>00028 <span class="keyword">namespace </span>internal {
<a name="l00029"></a>00029 
<a name="l00030"></a>00030 <span class="keyword">template</span>&lt;<span class="keyword">typename</span> _LhsScalar, <span class="keyword">typename</span> _RhsScalar&gt; <span class="keyword">class </span>level3_blocking;
<a name="l00031"></a>00031 
<a name="l00032"></a>00032 <span class="comment">/* Specialization for a row-major destination matrix =&gt; simple transposition of the product */</span>
<a name="l00033"></a>00033 <span class="keyword">template</span>&lt;
<a name="l00034"></a>00034   <span class="keyword">typename</span> Index,
<a name="l00035"></a>00035   <span class="keyword">typename</span> LhsScalar, <span class="keywordtype">int</span> LhsStorageOrder, <span class="keywordtype">bool</span> ConjugateLhs,
<a name="l00036"></a>00036   <span class="keyword">typename</span> RhsScalar, <span class="keywordtype">int</span> RhsStorageOrder, <span class="keywordtype">bool</span> ConjugateRhs&gt;
<a name="l00037"></a><a class="code" href="structinternal_1_1general__matrix__matrix__product_3_01_index_00_01_lhs_scalar_00_01_lhs_storageb39fc0aafb14dbd6d81827255b32778d.html">00037</a> <span class="keyword">struct </span>general_matrix_matrix_product&lt;Index,LhsScalar,LhsStorageOrder,ConjugateLhs,RhsScalar,RhsStorageOrder,ConjugateRhs,<a class="code" href="_constants_8h.html#aab4d131ba129f519b9e2bd349dc19e3aa1e16fa1b92ed7a058cd4ce7a9a0db044">RowMajor</a>&gt;
<a name="l00038"></a>00038 {
<a name="l00039"></a><a class="code" href="structinternal_1_1general__matrix__matrix__product_3_01_index_00_01_lhs_scalar_00_01_lhs_storageb39fc0aafb14dbd6d81827255b32778d.html#a96356a911773bb9896883b03ffd10b62">00039</a>   <span class="keyword">typedef</span> <span class="keyword">typename</span> scalar_product_traits&lt;LhsScalar, RhsScalar&gt;::ReturnType <a class="code" href="structinternal_1_1general__matrix__matrix__product_3_01_index_00_01_lhs_scalar_00_01_lhs_storageb39fc0aafb14dbd6d81827255b32778d.html#a96356a911773bb9896883b03ffd10b62">ResScalar</a>;
<a name="l00040"></a><a class="code" href="structinternal_1_1general__matrix__matrix__product_3_01_index_00_01_lhs_scalar_00_01_lhs_storageb39fc0aafb14dbd6d81827255b32778d.html#ae2becaf71904333751699d5c45481a58">00040</a>   <span class="keyword">static</span> <a class="code" href="_macros_8h.html#af2b60117c00a6e75812de43bfe7db3b1">EIGEN_STRONG_INLINE</a> <span class="keywordtype">void</span> run(
<a name="l00041"></a>00041     Index rows, Index cols, Index depth,
<a name="l00042"></a>00042     <span class="keyword">const</span> LhsScalar* lhs, Index lhsStride,
<a name="l00043"></a>00043     <span class="keyword">const</span> RhsScalar* rhs, Index rhsStride,
<a name="l00044"></a>00044     <a class="code" href="structinternal_1_1general__matrix__matrix__product_3_01_index_00_01_lhs_scalar_00_01_lhs_storageb39fc0aafb14dbd6d81827255b32778d.html#a96356a911773bb9896883b03ffd10b62">ResScalar</a>* res, Index resStride,
<a name="l00045"></a>00045     <a class="code" href="structinternal_1_1general__matrix__matrix__product_3_01_index_00_01_lhs_scalar_00_01_lhs_storageb39fc0aafb14dbd6d81827255b32778d.html#a96356a911773bb9896883b03ffd10b62">ResScalar</a> alpha,
<a name="l00046"></a>00046     <a class="code" href="classinternal_1_1level3__blocking.html">level3_blocking&lt;RhsScalar,LhsScalar&gt;</a>&amp; blocking,
<a name="l00047"></a>00047     <a class="code" href="structinternal_1_1_gemm_parallel_info.html">GemmParallelInfo&lt;Index&gt;</a>* info = 0)
<a name="l00048"></a>00048   {
<a name="l00049"></a>00049     <span class="comment">// transpose the product such that the result is column major</span>
<a name="l00050"></a>00050     general_matrix_matrix_product&lt;Index,
<a name="l00051"></a>00051       RhsScalar, RhsStorageOrder==<a class="code" href="_constants_8h.html#aab4d131ba129f519b9e2bd349dc19e3aa1e16fa1b92ed7a058cd4ce7a9a0db044">RowMajor</a> ? <a class="code" href="_constants_8h.html#aab4d131ba129f519b9e2bd349dc19e3aac86184b0e3be936fbfd20249a057a0bf">ColMajor</a> : <a class="code" href="_constants_8h.html#aab4d131ba129f519b9e2bd349dc19e3aa1e16fa1b92ed7a058cd4ce7a9a0db044">RowMajor</a>, ConjugateRhs,
<a name="l00052"></a>00052       LhsScalar, LhsStorageOrder==<a class="code" href="_constants_8h.html#aab4d131ba129f519b9e2bd349dc19e3aa1e16fa1b92ed7a058cd4ce7a9a0db044">RowMajor</a> ? <a class="code" href="_constants_8h.html#aab4d131ba129f519b9e2bd349dc19e3aac86184b0e3be936fbfd20249a057a0bf">ColMajor</a> : <a class="code" href="_constants_8h.html#aab4d131ba129f519b9e2bd349dc19e3aa1e16fa1b92ed7a058cd4ce7a9a0db044">RowMajor</a>, ConjugateLhs,
<a name="l00053"></a>00053       <a class="code" href="_constants_8h.html#aab4d131ba129f519b9e2bd349dc19e3aac86184b0e3be936fbfd20249a057a0bf">ColMajor</a>&gt;
<a name="l00054"></a>00054     ::run(cols,rows,depth,rhs,rhsStride,lhs,lhsStride,res,resStride,alpha,blocking,info);
<a name="l00055"></a>00055   }
<a name="l00056"></a>00056 };
<a name="l00057"></a>00057 
<a name="l00058"></a>00058 <span class="comment">/*  Specialization for a col-major destination matrix</span>
<a name="l00059"></a>00059 <span class="comment"> *    =&gt; Blocking algorithm following Goto&#39;s paper */</span>
<a name="l00060"></a>00060 <span class="keyword">template</span>&lt;
<a name="l00061"></a>00061   <span class="keyword">typename</span> Index,
<a name="l00062"></a>00062   <span class="keyword">typename</span> LhsScalar, <span class="keywordtype">int</span> LhsStorageOrder, <span class="keywordtype">bool</span> ConjugateLhs,
<a name="l00063"></a>00063   <span class="keyword">typename</span> RhsScalar, <span class="keywordtype">int</span> RhsStorageOrder, <span class="keywordtype">bool</span> ConjugateRhs&gt;
<a name="l00064"></a><a class="code" href="structinternal_1_1general__matrix__matrix__product_3_01_index_00_01_lhs_scalar_00_01_lhs_storageb8690137b4470d63e77aeaf8f5d8cf0a.html">00064</a> <span class="keyword">struct </span>general_matrix_matrix_product&lt;Index,LhsScalar,LhsStorageOrder,ConjugateLhs,RhsScalar,RhsStorageOrder,ConjugateRhs,<a class="code" href="_constants_8h.html#aab4d131ba129f519b9e2bd349dc19e3aac86184b0e3be936fbfd20249a057a0bf">ColMajor</a>&gt;
<a name="l00065"></a>00065 {
<a name="l00066"></a><a class="code" href="structinternal_1_1general__matrix__matrix__product_3_01_index_00_01_lhs_scalar_00_01_lhs_storageb8690137b4470d63e77aeaf8f5d8cf0a.html#a1c3aec3fa934c925ae1ec780401fe660">00066</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> scalar_product_traits&lt;LhsScalar, RhsScalar&gt;::ReturnType <a class="code" href="structinternal_1_1general__matrix__matrix__product_3_01_index_00_01_lhs_scalar_00_01_lhs_storageb8690137b4470d63e77aeaf8f5d8cf0a.html#a1c3aec3fa934c925ae1ec780401fe660">ResScalar</a>;
<a name="l00067"></a><a class="code" href="structinternal_1_1general__matrix__matrix__product_3_01_index_00_01_lhs_scalar_00_01_lhs_storageb8690137b4470d63e77aeaf8f5d8cf0a.html#a844fbbe2bf6a85212da98cff909c227a">00067</a> <span class="keyword">static</span> <span class="keywordtype">void</span> run(Index rows, Index cols, Index depth,
<a name="l00068"></a>00068   <span class="keyword">const</span> LhsScalar* _lhs, Index lhsStride,
<a name="l00069"></a>00069   <span class="keyword">const</span> RhsScalar* _rhs, Index rhsStride,
<a name="l00070"></a>00070   <a class="code" href="structinternal_1_1general__matrix__matrix__product_3_01_index_00_01_lhs_scalar_00_01_lhs_storageb8690137b4470d63e77aeaf8f5d8cf0a.html#a1c3aec3fa934c925ae1ec780401fe660">ResScalar</a>* res, Index resStride,
<a name="l00071"></a>00071   <a class="code" href="structinternal_1_1general__matrix__matrix__product_3_01_index_00_01_lhs_scalar_00_01_lhs_storageb8690137b4470d63e77aeaf8f5d8cf0a.html#a1c3aec3fa934c925ae1ec780401fe660">ResScalar</a> alpha,
<a name="l00072"></a>00072   <a class="code" href="classinternal_1_1level3__blocking.html">level3_blocking&lt;LhsScalar,RhsScalar&gt;</a>&amp; blocking,
<a name="l00073"></a>00073   <a class="code" href="structinternal_1_1_gemm_parallel_info.html">GemmParallelInfo&lt;Index&gt;</a>* info = 0)
<a name="l00074"></a>00074 {
<a name="l00075"></a>00075   <a class="code" href="classinternal_1_1const__blas__data__mapper.html">const_blas_data_mapper&lt;LhsScalar, Index, LhsStorageOrder&gt;</a> lhs(_lhs,lhsStride);
<a name="l00076"></a>00076   <a class="code" href="classinternal_1_1const__blas__data__mapper.html">const_blas_data_mapper&lt;RhsScalar, Index, RhsStorageOrder&gt;</a> rhs(_rhs,rhsStride);
<a name="l00077"></a>00077 
<a name="l00078"></a>00078   <span class="keyword">typedef</span> <a class="code" href="classinternal_1_1gebp__traits.html">gebp_traits&lt;LhsScalar,RhsScalar&gt;</a> Traits;
<a name="l00079"></a>00079 
<a name="l00080"></a>00080   Index kc = blocking.<a class="code" href="classinternal_1_1level3__blocking.html#ac850011181ff4dde45ffd60bc547c495">kc</a>();                 <span class="comment">// cache block size along the K direction</span>
<a name="l00081"></a>00081   Index mc = std::min(rows,blocking.<a class="code" href="classinternal_1_1level3__blocking.html#a90d7cf2e4be0897492456b347c2291ef">mc</a>());  <span class="comment">// cache block size along the M direction</span>
<a name="l00082"></a>00082   <span class="comment">//Index nc = blocking.nc(); // cache block size along the N direction</span>
<a name="l00083"></a>00083 
<a name="l00084"></a>00084   <a class="code" href="structinternal_1_1gemm__pack__lhs.html">gemm_pack_lhs&lt;LhsScalar, Index, Traits::mr, Traits::LhsProgress, LhsStorageOrder&gt;</a> pack_lhs;
<a name="l00085"></a>00085   gemm_pack_rhs&lt;RhsScalar, Index, Traits::nr, RhsStorageOrder&gt; pack_rhs;
<a name="l00086"></a>00086   <a class="code" href="structinternal_1_1gebp__kernel.html">gebp_kernel&lt;LhsScalar, RhsScalar, Index, Traits::mr, Traits::nr, ConjugateLhs, ConjugateRhs&gt;</a> gebp;
<a name="l00087"></a>00087 
<a name="l00088"></a>00088 <span class="preprocessor">#ifdef EIGEN_HAS_OPENMP</span>
<a name="l00089"></a>00089 <span class="preprocessor"></span>  <span class="keywordflow">if</span>(info)
<a name="l00090"></a>00090   {
<a name="l00091"></a>00091     <span class="comment">// this is the parallel version!</span>
<a name="l00092"></a>00092     Index tid = omp_get_thread_num();
<a name="l00093"></a>00093     Index threads = omp_get_num_threads();
<a name="l00094"></a>00094     
<a name="l00095"></a>00095     std::size_t sizeA = kc*mc;
<a name="l00096"></a>00096     std::size_t sizeW = kc*Traits::WorkSpaceFactor;
<a name="l00097"></a>00097     LhsScalar* blockA = <a class="code" href="_memory_8h.html#aee85ba01ac0fcb29ee431d41166a552c">ei_aligned_stack_new</a>(LhsScalar, sizeA);
<a name="l00098"></a>00098     RhsScalar* w = <a class="code" href="_memory_8h.html#aee85ba01ac0fcb29ee431d41166a552c">ei_aligned_stack_new</a>(RhsScalar, sizeW);
<a name="l00099"></a>00099     RhsScalar* blockB = blocking.<a class="code" href="classinternal_1_1level3__blocking.html#a24824aa660da824b9ab23c0c2aa5c3dc">blockB</a>();
<a name="l00100"></a>00100     <a class="code" href="_macros_8h.html#a4e742b5a08636a61784c0e173b61e710">eigen_internal_assert</a>(blockB!=0);
<a name="l00101"></a>00101 
<a name="l00102"></a>00102     <span class="comment">// For each horizontal panel of the rhs, and corresponding vertical panel of the lhs...</span>
<a name="l00103"></a>00103     <span class="keywordflow">for</span>(Index k=0; k&lt;depth; k+=kc)
<a name="l00104"></a>00104     {
<a name="l00105"></a>00105       <span class="keyword">const</span> Index actual_kc = std::min(k+kc,depth)-k; <span class="comment">// =&gt; rows of B&#39;, and cols of the A&#39;</span>
<a name="l00106"></a>00106 
<a name="l00107"></a>00107       <span class="comment">// In order to reduce the chance that a thread has to wait for the other,</span>
<a name="l00108"></a>00108       <span class="comment">// let&#39;s start by packing A&#39;.</span>
<a name="l00109"></a>00109       pack_lhs(blockA, &amp;lhs(0,k), lhsStride, actual_kc, mc);
<a name="l00110"></a>00110 
<a name="l00111"></a>00111       <span class="comment">// Pack B_k to B&#39; in a parallel fashion:</span>
<a name="l00112"></a>00112       <span class="comment">// each thread packs the sub block B_k,j to B&#39;_j where j is the thread id.</span>
<a name="l00113"></a>00113 
<a name="l00114"></a>00114       <span class="comment">// However, before copying to B&#39;_j, we have to make sure that no other thread is still using it,</span>
<a name="l00115"></a>00115       <span class="comment">// i.e., we test that info[tid].users equals 0.</span>
<a name="l00116"></a>00116       <span class="comment">// Then, we set info[tid].users to the number of threads to mark that all other threads are going to use it.</span>
<a name="l00117"></a>00117       <span class="keywordflow">while</span>(info[tid].users!=0) {}
<a name="l00118"></a>00118       info[tid].users += threads;
<a name="l00119"></a>00119 
<a name="l00120"></a>00120       pack_rhs(blockB+info[tid].rhs_start*actual_kc, &amp;rhs(k,info[tid].rhs_start), rhsStride, actual_kc, info[tid].rhs_length);
<a name="l00121"></a>00121 
<a name="l00122"></a>00122       <span class="comment">// Notify the other threads that the part B&#39;_j is ready to go.</span>
<a name="l00123"></a>00123       info[tid].sync = k;
<a name="l00124"></a>00124 
<a name="l00125"></a>00125       <span class="comment">// Computes C_i += A&#39; * B&#39; per B&#39;_j</span>
<a name="l00126"></a>00126       <span class="keywordflow">for</span>(Index shift=0; shift&lt;threads; ++shift)
<a name="l00127"></a>00127       {
<a name="l00128"></a>00128         Index j = (tid+shift)%threads;
<a name="l00129"></a>00129 
<a name="l00130"></a>00130         <span class="comment">// At this point we have to make sure that B&#39;_j has been updated by the thread j,</span>
<a name="l00131"></a>00131         <span class="comment">// we use testAndSetOrdered to mimic a volatile access.</span>
<a name="l00132"></a>00132         <span class="comment">// However, no need to wait for the B&#39; part which has been updated by the current thread!</span>
<a name="l00133"></a>00133         <span class="keywordflow">if</span>(shift&gt;0)
<a name="l00134"></a>00134           <span class="keywordflow">while</span>(info[j].sync!=k) {}
<a name="l00135"></a>00135 
<a name="l00136"></a>00136         gebp(res+info[j].rhs_start*resStride, resStride, blockA, blockB+info[j].rhs_start*actual_kc, mc, actual_kc, info[j].rhs_length, alpha, -1,-1,0,0, w);
<a name="l00137"></a>00137       }
<a name="l00138"></a>00138 
<a name="l00139"></a>00139       <span class="comment">// Then keep going as usual with the remaining A&#39;</span>
<a name="l00140"></a>00140       <span class="keywordflow">for</span>(Index i=mc; i&lt;rows; i+=mc)
<a name="l00141"></a>00141       {
<a name="l00142"></a>00142         <span class="keyword">const</span> Index actual_mc = std::min(i+mc,rows)-i;
<a name="l00143"></a>00143 
<a name="l00144"></a>00144         <span class="comment">// pack A_i,k to A&#39;</span>
<a name="l00145"></a>00145         pack_lhs(blockA, &amp;lhs(i,k), lhsStride, actual_kc, actual_mc);
<a name="l00146"></a>00146 
<a name="l00147"></a>00147         <span class="comment">// C_i += A&#39; * B&#39;</span>
<a name="l00148"></a>00148         gebp(res+i, resStride, blockA, blockB, actual_mc, actual_kc, cols, alpha, -1,-1,0,0, w);
<a name="l00149"></a>00149       }
<a name="l00150"></a>00150 
<a name="l00151"></a>00151       <span class="comment">// Release all the sub blocks B&#39;_j of B&#39; for the current thread,</span>
<a name="l00152"></a>00152       <span class="comment">// i.e., we simply decrement the number of users by 1</span>
<a name="l00153"></a>00153       <span class="keywordflow">for</span>(Index j=0; j&lt;threads; ++j)
<a name="l00154"></a>00154         #pragma omp atomic
<a name="l00155"></a>00155         --(info[j].users);
<a name="l00156"></a>00156     }
<a name="l00157"></a>00157 
<a name="l00158"></a>00158     <a class="code" href="_memory_8h.html#a0dda359e16727545fb258618dd7bc817">ei_aligned_stack_delete</a>(LhsScalar, blockA, kc*mc);
<a name="l00159"></a>00159     <a class="code" href="_memory_8h.html#a0dda359e16727545fb258618dd7bc817">ei_aligned_stack_delete</a>(RhsScalar, w, sizeW);
<a name="l00160"></a>00160   }
<a name="l00161"></a>00161   <span class="keywordflow">else</span>
<a name="l00162"></a>00162 <span class="preprocessor">#endif // EIGEN_HAS_OPENMP</span>
<a name="l00163"></a>00163 <span class="preprocessor"></span>  {
<a name="l00164"></a>00164     <a class="code" href="_macros_8h.html#a7cf6d5b460def34dc4e6acf42889b6a9">EIGEN_UNUSED_VARIABLE</a>(info);
<a name="l00165"></a>00165 
<a name="l00166"></a>00166     <span class="comment">// this is the sequential version!</span>
<a name="l00167"></a>00167     std::size_t sizeA = kc*mc;
<a name="l00168"></a>00168     std::size_t sizeB = kc*cols;
<a name="l00169"></a>00169     std::size_t sizeW = kc*Traits::WorkSpaceFactor;
<a name="l00170"></a>00170     LhsScalar *blockA = blocking.<a class="code" href="classinternal_1_1level3__blocking.html#ab34ad616870844b4be69b9377a4a1bbc">blockA</a>()==0 ? <a class="code" href="_memory_8h.html#aee85ba01ac0fcb29ee431d41166a552c">ei_aligned_stack_new</a>(LhsScalar, sizeA) : blocking.<a class="code" href="classinternal_1_1level3__blocking.html#ab34ad616870844b4be69b9377a4a1bbc">blockA</a>();
<a name="l00171"></a>00171     RhsScalar *blockB = blocking.<a class="code" href="classinternal_1_1level3__blocking.html#a24824aa660da824b9ab23c0c2aa5c3dc">blockB</a>()==0 ? <a class="code" href="_memory_8h.html#aee85ba01ac0fcb29ee431d41166a552c">ei_aligned_stack_new</a>(RhsScalar, sizeB) : blocking.<a class="code" href="classinternal_1_1level3__blocking.html#a24824aa660da824b9ab23c0c2aa5c3dc">blockB</a>();
<a name="l00172"></a>00172     RhsScalar *blockW = blocking.<a class="code" href="classinternal_1_1level3__blocking.html#adb5d1fa94a938d218df54f9072f6cfda">blockW</a>()==0 ? <a class="code" href="_memory_8h.html#aee85ba01ac0fcb29ee431d41166a552c">ei_aligned_stack_new</a>(RhsScalar, sizeW) : blocking.<a class="code" href="classinternal_1_1level3__blocking.html#adb5d1fa94a938d218df54f9072f6cfda">blockW</a>();
<a name="l00173"></a>00173 
<a name="l00174"></a>00174     <span class="comment">// For each horizontal panel of the rhs, and corresponding panel of the lhs...</span>
<a name="l00175"></a>00175     <span class="comment">// (==GEMM_VAR1)</span>
<a name="l00176"></a>00176     <span class="keywordflow">for</span>(Index k2=0; k2&lt;depth; k2+=kc)
<a name="l00177"></a>00177     {
<a name="l00178"></a>00178       <span class="keyword">const</span> Index actual_kc = std::min(k2+kc,depth)-k2;
<a name="l00179"></a>00179 
<a name="l00180"></a>00180       <span class="comment">// OK, here we have selected one horizontal panel of rhs and one vertical panel of lhs.</span>
<a name="l00181"></a>00181       <span class="comment">// =&gt; Pack rhs&#39;s panel into a sequential chunk of memory (L2 caching)</span>
<a name="l00182"></a>00182       <span class="comment">// Note that this panel will be read as many times as the number of blocks in the lhs&#39;s</span>
<a name="l00183"></a>00183       <span class="comment">// vertical panel which is, in practice, a very low number.</span>
<a name="l00184"></a>00184       pack_rhs(blockB, &amp;rhs(k2,0), rhsStride, actual_kc, cols);
<a name="l00185"></a>00185 
<a name="l00186"></a>00186 
<a name="l00187"></a>00187       <span class="comment">// For each mc x kc block of the lhs&#39;s vertical panel...</span>
<a name="l00188"></a>00188       <span class="comment">// (==GEPP_VAR1)</span>
<a name="l00189"></a>00189       <span class="keywordflow">for</span>(Index i2=0; i2&lt;rows; i2+=mc)
<a name="l00190"></a>00190       {
<a name="l00191"></a>00191         <span class="keyword">const</span> Index actual_mc = std::min(i2+mc,rows)-i2;
<a name="l00192"></a>00192 
<a name="l00193"></a>00193         <span class="comment">// We pack the lhs&#39;s block into a sequential chunk of memory (L1 caching)</span>
<a name="l00194"></a>00194         <span class="comment">// Note that this block will be read a very high number of times, which is equal to the number of</span>
<a name="l00195"></a>00195         <span class="comment">// micro vertical panel of the large rhs&#39;s panel (e.g., cols/4 times).</span>
<a name="l00196"></a>00196         pack_lhs(blockA, &amp;lhs(i2,k2), lhsStride, actual_kc, actual_mc);
<a name="l00197"></a>00197 
<a name="l00198"></a>00198         <span class="comment">// Everything is packed, we can now call the block * panel kernel:</span>
<a name="l00199"></a>00199         gebp(res+i2, resStride, blockA, blockB, actual_mc, actual_kc, cols, alpha, -1, -1, 0, 0, blockW);
<a name="l00200"></a>00200 
<a name="l00201"></a>00201       }
<a name="l00202"></a>00202     }
<a name="l00203"></a>00203 
<a name="l00204"></a>00204     <span class="keywordflow">if</span>(blocking.<a class="code" href="classinternal_1_1level3__blocking.html#ab34ad616870844b4be69b9377a4a1bbc">blockA</a>()==0) <a class="code" href="_memory_8h.html#a0dda359e16727545fb258618dd7bc817">ei_aligned_stack_delete</a>(LhsScalar, blockA, sizeA);
<a name="l00205"></a>00205     <span class="keywordflow">if</span>(blocking.<a class="code" href="classinternal_1_1level3__blocking.html#a24824aa660da824b9ab23c0c2aa5c3dc">blockB</a>()==0) <a class="code" href="_memory_8h.html#a0dda359e16727545fb258618dd7bc817">ei_aligned_stack_delete</a>(RhsScalar, blockB, sizeB);
<a name="l00206"></a>00206     <span class="keywordflow">if</span>(blocking.<a class="code" href="classinternal_1_1level3__blocking.html#adb5d1fa94a938d218df54f9072f6cfda">blockW</a>()==0) <a class="code" href="_memory_8h.html#a0dda359e16727545fb258618dd7bc817">ei_aligned_stack_delete</a>(RhsScalar, blockW, sizeW);
<a name="l00207"></a>00207   }
<a name="l00208"></a>00208 }
<a name="l00209"></a>00209 
<a name="l00210"></a>00210 };
<a name="l00211"></a>00211 
<a name="l00212"></a>00212 <span class="comment">/*********************************************************************************</span>
<a name="l00213"></a>00213 <span class="comment">*  Specialization of GeneralProduct&lt;&gt; for &quot;large&quot; GEMM, i.e.,</span>
<a name="l00214"></a>00214 <span class="comment">*  implementation of the high level wrapper to general_matrix_matrix_product</span>
<a name="l00215"></a>00215 <span class="comment">**********************************************************************************/</span>
<a name="l00216"></a>00216 
<a name="l00217"></a>00217 <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Lhs, <span class="keyword">typename</span> Rhs&gt;
<a name="l00218"></a><a class="code" href="structinternal_1_1traits_3_01_general_product_3_01_lhs_00_01_rhs_00_01_gemm_product_01_4_01_4.html">00218</a> <span class="keyword">struct </span>traits&lt;<a class="code" href="class_general_product.html" title="Expression of the product of two general matrices or vectors.">GeneralProduct</a>&lt;Lhs,Rhs,<a class="code" href="_constants_8h.html#a843b6364885d3a1a47722e792b0368ecaedaaabe5f05a7e48571843a21cf1f9bc">GemmProduct</a>&gt; &gt;
<a name="l00219"></a>00219  : traits&lt;ProductBase&lt;GeneralProduct&lt;Lhs,Rhs,GemmProduct&gt;, Lhs, Rhs&gt; &gt;
<a name="l00220"></a>00220 {};
<a name="l00221"></a>00221 
<a name="l00222"></a>00222 <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Scalar, <span class="keyword">typename</span> Index, <span class="keyword">typename</span> Gemm, <span class="keyword">typename</span> Lhs, <span class="keyword">typename</span> Rhs, <span class="keyword">typename</span> Dest, <span class="keyword">typename</span> BlockingType&gt;
<a name="l00223"></a><a class="code" href="structinternal_1_1gemm__functor.html">00223</a> <span class="keyword">struct </span><a class="code" href="structinternal_1_1gemm__functor.html">gemm_functor</a>
<a name="l00224"></a>00224 {
<a name="l00225"></a><a class="code" href="structinternal_1_1gemm__functor.html#ae381a3edc70eaf842d6cceeaccd2d6af">00225</a>   <a class="code" href="structinternal_1_1gemm__functor.html#ae381a3edc70eaf842d6cceeaccd2d6af">gemm_functor</a>(<span class="keyword">const</span> Lhs&amp; lhs, <span class="keyword">const</span> Rhs&amp; rhs, Dest&amp; dest, Scalar actualAlpha,
<a name="l00226"></a>00226                   BlockingType&amp; blocking)
<a name="l00227"></a>00227     : <a class="code" href="structinternal_1_1gemm__functor.html#a14f3a984cb49bf595a15b3592eb84d96">m_lhs</a>(lhs), <a class="code" href="structinternal_1_1gemm__functor.html#aa797a6d5328455f061af3d232c54bfcc">m_rhs</a>(rhs), <a class="code" href="structinternal_1_1gemm__functor.html#a6242525b858bf8ee95ac0bfa0817a075">m_dest</a>(dest), <a class="code" href="structinternal_1_1gemm__functor.html#af176505335155f76effdd97584e5f60b">m_actualAlpha</a>(actualAlpha), <a class="code" href="structinternal_1_1gemm__functor.html#abc0c02820929d9c20786fb119bcd102b">m_blocking</a>(blocking)
<a name="l00228"></a>00228   {}
<a name="l00229"></a>00229 
<a name="l00230"></a><a class="code" href="structinternal_1_1gemm__functor.html#a5af02b68f4d2fb132cee9cd15b595437">00230</a>   <span class="keywordtype">void</span> <a class="code" href="structinternal_1_1gemm__functor.html#a5af02b68f4d2fb132cee9cd15b595437">initParallelSession</a>()<span class="keyword"> const</span>
<a name="l00231"></a>00231 <span class="keyword">  </span>{
<a name="l00232"></a>00232     <a class="code" href="structinternal_1_1gemm__functor.html#abc0c02820929d9c20786fb119bcd102b">m_blocking</a>.allocateB();
<a name="l00233"></a>00233   }
<a name="l00234"></a>00234 
<a name="l00235"></a><a class="code" href="structinternal_1_1gemm__functor.html#a0dc2fe4727735f0d2d6e4339ff95d17e">00235</a>   <span class="keywordtype">void</span> <a class="code" href="structinternal_1_1gemm__functor.html#a0dc2fe4727735f0d2d6e4339ff95d17e">operator() </a>(Index <a class="code" href="_block_methods_8h.html#ad62dcaf648cca25e9318da34c9840799" title="This is the const version of row().">row</a>, Index rows, Index <a class="code" href="_block_methods_8h.html#a390f7c534678354959dd587080b82c2c" title="This is the const version of col().">col</a>=0, Index cols=-1, <a class="code" href="structinternal_1_1_gemm_parallel_info.html">GemmParallelInfo&lt;Index&gt;</a>* info=0)<span class="keyword"> const</span>
<a name="l00236"></a>00236 <span class="keyword">  </span>{
<a name="l00237"></a>00237     <span class="keywordflow">if</span>(cols==-1)
<a name="l00238"></a>00238       cols = <a class="code" href="structinternal_1_1gemm__functor.html#aa797a6d5328455f061af3d232c54bfcc">m_rhs</a>.cols();
<a name="l00239"></a>00239 
<a name="l00240"></a>00240     Gemm::run(rows, cols, <a class="code" href="structinternal_1_1gemm__functor.html#a14f3a984cb49bf595a15b3592eb84d96">m_lhs</a>.cols(),
<a name="l00241"></a>00241               <span class="comment">/*(const Scalar*)*/</span>&amp;<a class="code" href="structinternal_1_1gemm__functor.html#a14f3a984cb49bf595a15b3592eb84d96">m_lhs</a>.coeffRef(row,0), <a class="code" href="structinternal_1_1gemm__functor.html#a14f3a984cb49bf595a15b3592eb84d96">m_lhs</a>.outerStride(),
<a name="l00242"></a>00242               <span class="comment">/*(const Scalar*)*/</span>&amp;<a class="code" href="structinternal_1_1gemm__functor.html#aa797a6d5328455f061af3d232c54bfcc">m_rhs</a>.coeffRef(0,<a class="code" href="_block_methods_8h.html#a390f7c534678354959dd587080b82c2c" title="This is the const version of col().">col</a>), <a class="code" href="structinternal_1_1gemm__functor.html#aa797a6d5328455f061af3d232c54bfcc">m_rhs</a>.outerStride(),
<a name="l00243"></a>00243               (Scalar*)&amp;(<a class="code" href="structinternal_1_1gemm__functor.html#a6242525b858bf8ee95ac0bfa0817a075">m_dest</a>.coeffRef(row,<a class="code" href="_block_methods_8h.html#a390f7c534678354959dd587080b82c2c" title="This is the const version of col().">col</a>)), <a class="code" href="structinternal_1_1gemm__functor.html#a6242525b858bf8ee95ac0bfa0817a075">m_dest</a>.outerStride(),
<a name="l00244"></a>00244               <a class="code" href="structinternal_1_1gemm__functor.html#af176505335155f76effdd97584e5f60b">m_actualAlpha</a>, <a class="code" href="structinternal_1_1gemm__functor.html#abc0c02820929d9c20786fb119bcd102b">m_blocking</a>, info);
<a name="l00245"></a>00245   }
<a name="l00246"></a>00246 
<a name="l00247"></a>00247   <span class="keyword">protected</span>:
<a name="l00248"></a><a class="code" href="structinternal_1_1gemm__functor.html#a14f3a984cb49bf595a15b3592eb84d96">00248</a>     <span class="keyword">const</span> Lhs&amp; <a class="code" href="structinternal_1_1gemm__functor.html#a14f3a984cb49bf595a15b3592eb84d96">m_lhs</a>;
<a name="l00249"></a><a class="code" href="structinternal_1_1gemm__functor.html#aa797a6d5328455f061af3d232c54bfcc">00249</a>     <span class="keyword">const</span> Rhs&amp; <a class="code" href="structinternal_1_1gemm__functor.html#aa797a6d5328455f061af3d232c54bfcc">m_rhs</a>;
<a name="l00250"></a><a class="code" href="structinternal_1_1gemm__functor.html#a6242525b858bf8ee95ac0bfa0817a075">00250</a>     Dest&amp; <a class="code" href="structinternal_1_1gemm__functor.html#a6242525b858bf8ee95ac0bfa0817a075">m_dest</a>;
<a name="l00251"></a><a class="code" href="structinternal_1_1gemm__functor.html#af176505335155f76effdd97584e5f60b">00251</a>     Scalar <a class="code" href="structinternal_1_1gemm__functor.html#af176505335155f76effdd97584e5f60b">m_actualAlpha</a>;
<a name="l00252"></a><a class="code" href="structinternal_1_1gemm__functor.html#abc0c02820929d9c20786fb119bcd102b">00252</a>     BlockingType&amp; <a class="code" href="structinternal_1_1gemm__functor.html#abc0c02820929d9c20786fb119bcd102b">m_blocking</a>;
<a name="l00253"></a>00253 };
<a name="l00254"></a>00254 
<a name="l00255"></a>00255 <span class="keyword">template</span>&lt;<span class="keywordtype">int</span> StorageOrder, <span class="keyword">typename</span> LhsScalar, <span class="keyword">typename</span> RhsScalar, <span class="keywordtype">int</span> MaxRows, <span class="keywordtype">int</span> MaxCols, <span class="keywordtype">int</span> MaxDepth,
<a name="l00256"></a>00256 <span class="keywordtype">bool</span> FiniteAtCompileTime = MaxRows!=<a class="code" href="_constants_8h.html#adc9da5be31bdce40c25a92c27999c0e3" title="This value means that a quantity is not known at compile-time, and that instead the value is stored i...">Dynamic</a> &amp;&amp; MaxCols!=<a class="code" href="_constants_8h.html#adc9da5be31bdce40c25a92c27999c0e3" title="This value means that a quantity is not known at compile-time, and that instead the value is stored i...">Dynamic</a> &amp;&amp; MaxDepth != <a class="code" href="_constants_8h.html#adc9da5be31bdce40c25a92c27999c0e3" title="This value means that a quantity is not known at compile-time, and that instead the value is stored i...">Dynamic</a>&gt; <span class="keyword">class </span>gemm_blocking_space;
<a name="l00257"></a>00257 
<a name="l00258"></a>00258 <span class="keyword">template</span>&lt;<span class="keyword">typename</span> _LhsScalar, <span class="keyword">typename</span> _RhsScalar&gt;
<a name="l00259"></a><a class="code" href="classinternal_1_1level3__blocking.html">00259</a> <span class="keyword">class </span><a class="code" href="classinternal_1_1level3__blocking.html">level3_blocking</a>
<a name="l00260"></a>00260 {
<a name="l00261"></a><a class="code" href="classinternal_1_1level3__blocking.html#a56ec8417f4adfa9856ba29a908a7198e">00261</a>     <span class="keyword">typedef</span> _LhsScalar <a class="code" href="classinternal_1_1level3__blocking.html#a56ec8417f4adfa9856ba29a908a7198e">LhsScalar</a>;
<a name="l00262"></a><a class="code" href="classinternal_1_1level3__blocking.html#a9092a24f80ce9c71c00cf345c841bd99">00262</a>     <span class="keyword">typedef</span> _RhsScalar <a class="code" href="classinternal_1_1level3__blocking.html#a9092a24f80ce9c71c00cf345c841bd99">RhsScalar</a>;
<a name="l00263"></a>00263 
<a name="l00264"></a>00264   <span class="keyword">protected</span>:
<a name="l00265"></a><a class="code" href="classinternal_1_1level3__blocking.html#a631d79fced5d0181208f717b3d7a62b3">00265</a>     <a class="code" href="classinternal_1_1level3__blocking.html#a56ec8417f4adfa9856ba29a908a7198e">LhsScalar</a>* <a class="code" href="classinternal_1_1level3__blocking.html#a631d79fced5d0181208f717b3d7a62b3">m_blockA</a>;
<a name="l00266"></a><a class="code" href="classinternal_1_1level3__blocking.html#a99dff8be49c89662adbf5355c95c8ba6">00266</a>     <a class="code" href="classinternal_1_1level3__blocking.html#a9092a24f80ce9c71c00cf345c841bd99">RhsScalar</a>* <a class="code" href="classinternal_1_1level3__blocking.html#a99dff8be49c89662adbf5355c95c8ba6">m_blockB</a>;
<a name="l00267"></a><a class="code" href="classinternal_1_1level3__blocking.html#a613b468146f7856990f11ca056f2fde6">00267</a>     <a class="code" href="classinternal_1_1level3__blocking.html#a9092a24f80ce9c71c00cf345c841bd99">RhsScalar</a>* <a class="code" href="classinternal_1_1level3__blocking.html#a613b468146f7856990f11ca056f2fde6">m_blockW</a>;
<a name="l00268"></a>00268 
<a name="l00269"></a><a class="code" href="classinternal_1_1level3__blocking.html#aa5f85ee8d0d6198084ee63ae2b13cf5d">00269</a>     <a class="code" href="_xpr_helper_8h.html#a0cd03d34614dcb302c968e4fe1391ca3">DenseIndex</a> <a class="code" href="classinternal_1_1level3__blocking.html#aa5f85ee8d0d6198084ee63ae2b13cf5d">m_mc</a>;
<a name="l00270"></a><a class="code" href="classinternal_1_1level3__blocking.html#a031a50813adc2fde0bfa4db3819b93c8">00270</a>     <a class="code" href="_xpr_helper_8h.html#a0cd03d34614dcb302c968e4fe1391ca3">DenseIndex</a> <a class="code" href="classinternal_1_1level3__blocking.html#a031a50813adc2fde0bfa4db3819b93c8">m_nc</a>;
<a name="l00271"></a><a class="code" href="classinternal_1_1level3__blocking.html#a2c786eedcfe3e3c0cc8f987b70cd7a54">00271</a>     <a class="code" href="_xpr_helper_8h.html#a0cd03d34614dcb302c968e4fe1391ca3">DenseIndex</a> <a class="code" href="classinternal_1_1level3__blocking.html#a2c786eedcfe3e3c0cc8f987b70cd7a54">m_kc</a>;
<a name="l00272"></a>00272 
<a name="l00273"></a>00273   <span class="keyword">public</span>:
<a name="l00274"></a>00274 
<a name="l00275"></a><a class="code" href="classinternal_1_1level3__blocking.html#a9254729a58b2b891d1a2f51d49ca2779">00275</a>     <a class="code" href="classinternal_1_1level3__blocking.html#a9254729a58b2b891d1a2f51d49ca2779">level3_blocking</a>()
<a name="l00276"></a>00276       : <a class="code" href="classinternal_1_1level3__blocking.html#a631d79fced5d0181208f717b3d7a62b3">m_blockA</a>(0), <a class="code" href="classinternal_1_1level3__blocking.html#a99dff8be49c89662adbf5355c95c8ba6">m_blockB</a>(0), <a class="code" href="classinternal_1_1level3__blocking.html#a613b468146f7856990f11ca056f2fde6">m_blockW</a>(0), <a class="code" href="classinternal_1_1level3__blocking.html#aa5f85ee8d0d6198084ee63ae2b13cf5d">m_mc</a>(0), <a class="code" href="classinternal_1_1level3__blocking.html#a031a50813adc2fde0bfa4db3819b93c8">m_nc</a>(0), <a class="code" href="classinternal_1_1level3__blocking.html#a2c786eedcfe3e3c0cc8f987b70cd7a54">m_kc</a>(0)
<a name="l00277"></a>00277     {}
<a name="l00278"></a>00278 
<a name="l00279"></a><a class="code" href="classinternal_1_1level3__blocking.html#a90d7cf2e4be0897492456b347c2291ef">00279</a>     <span class="keyword">inline</span> <a class="code" href="_xpr_helper_8h.html#a0cd03d34614dcb302c968e4fe1391ca3">DenseIndex</a> <a class="code" href="classinternal_1_1level3__blocking.html#a90d7cf2e4be0897492456b347c2291ef">mc</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classinternal_1_1level3__blocking.html#aa5f85ee8d0d6198084ee63ae2b13cf5d">m_mc</a>; }
<a name="l00280"></a><a class="code" href="classinternal_1_1level3__blocking.html#a58ba1d46586eeadad68190980f997d9a">00280</a>     <span class="keyword">inline</span> <a class="code" href="_xpr_helper_8h.html#a0cd03d34614dcb302c968e4fe1391ca3">DenseIndex</a> <a class="code" href="classinternal_1_1level3__blocking.html#a58ba1d46586eeadad68190980f997d9a">nc</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classinternal_1_1level3__blocking.html#a031a50813adc2fde0bfa4db3819b93c8">m_nc</a>; }
<a name="l00281"></a><a class="code" href="classinternal_1_1level3__blocking.html#ac850011181ff4dde45ffd60bc547c495">00281</a>     <span class="keyword">inline</span> <a class="code" href="_xpr_helper_8h.html#a0cd03d34614dcb302c968e4fe1391ca3">DenseIndex</a> <a class="code" href="classinternal_1_1level3__blocking.html#ac850011181ff4dde45ffd60bc547c495">kc</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classinternal_1_1level3__blocking.html#a2c786eedcfe3e3c0cc8f987b70cd7a54">m_kc</a>; }
<a name="l00282"></a>00282 
<a name="l00283"></a><a class="code" href="classinternal_1_1level3__blocking.html#ab34ad616870844b4be69b9377a4a1bbc">00283</a>     <span class="keyword">inline</span> <a class="code" href="classinternal_1_1level3__blocking.html#a56ec8417f4adfa9856ba29a908a7198e">LhsScalar</a>* <a class="code" href="classinternal_1_1level3__blocking.html#ab34ad616870844b4be69b9377a4a1bbc">blockA</a>() { <span class="keywordflow">return</span> <a class="code" href="classinternal_1_1level3__blocking.html#a631d79fced5d0181208f717b3d7a62b3">m_blockA</a>; }
<a name="l00284"></a><a class="code" href="classinternal_1_1level3__blocking.html#a24824aa660da824b9ab23c0c2aa5c3dc">00284</a>     <span class="keyword">inline</span> <a class="code" href="classinternal_1_1level3__blocking.html#a9092a24f80ce9c71c00cf345c841bd99">RhsScalar</a>* <a class="code" href="classinternal_1_1level3__blocking.html#a24824aa660da824b9ab23c0c2aa5c3dc">blockB</a>() { <span class="keywordflow">return</span> <a class="code" href="classinternal_1_1level3__blocking.html#a99dff8be49c89662adbf5355c95c8ba6">m_blockB</a>; }
<a name="l00285"></a><a class="code" href="classinternal_1_1level3__blocking.html#adb5d1fa94a938d218df54f9072f6cfda">00285</a>     <span class="keyword">inline</span> <a class="code" href="classinternal_1_1level3__blocking.html#a9092a24f80ce9c71c00cf345c841bd99">RhsScalar</a>* <a class="code" href="classinternal_1_1level3__blocking.html#adb5d1fa94a938d218df54f9072f6cfda">blockW</a>() { <span class="keywordflow">return</span> <a class="code" href="classinternal_1_1level3__blocking.html#a613b468146f7856990f11ca056f2fde6">m_blockW</a>; }
<a name="l00286"></a>00286 };
<a name="l00287"></a>00287 
<a name="l00288"></a>00288 <span class="keyword">template</span>&lt;<span class="keywordtype">int</span> StorageOrder, <span class="keyword">typename</span> _LhsScalar, <span class="keyword">typename</span> _RhsScalar, <span class="keywordtype">int</span> MaxRows, <span class="keywordtype">int</span> MaxCols, <span class="keywordtype">int</span> MaxDepth&gt;
<a name="l00289"></a><a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_a118060e3a2bec126bcfa21d4db73b33.html">00289</a> <span class="keyword">class </span>gemm_blocking_space&lt;StorageOrder,_LhsScalar,_RhsScalar,MaxRows, MaxCols, MaxDepth, true&gt;
<a name="l00290"></a>00290   : <span class="keyword">public</span> <a class="code" href="classinternal_1_1level3__blocking.html">level3_blocking</a>&lt;
<a name="l00291"></a>00291       typename conditional&lt;StorageOrder==RowMajor,_RhsScalar,_LhsScalar&gt;::type,
<a name="l00292"></a>00292       typename conditional&lt;StorageOrder==RowMajor,_LhsScalar,_RhsScalar&gt;::type&gt;
<a name="l00293"></a>00293 {
<a name="l00294"></a>00294     <span class="keyword">enum</span> {
<a name="l00295"></a><a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_a118060e3a2bec126bcfa21d4db73b33.html#ace153ac59b40c94e25c85ffd0406d1dea751bcdbdd0720c2104e93452298f0777">00295</a>       <a class="code" href="class_transpose.html" title="Expression of the transpose of a matrix.">Transpose</a> = StorageOrder==<a class="code" href="_constants_8h.html#aab4d131ba129f519b9e2bd349dc19e3aa1e16fa1b92ed7a058cd4ce7a9a0db044">RowMajor</a>,
<a name="l00296"></a><a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_a118060e3a2bec126bcfa21d4db73b33.html#ace153ac59b40c94e25c85ffd0406d1dea9b56561d7c361dcba4351a36ffbcc212">00296</a>       ActualRows = <a class="code" href="class_transpose.html" title="Expression of the transpose of a matrix.">Transpose</a> ? MaxCols : MaxRows,
<a name="l00297"></a><a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_a118060e3a2bec126bcfa21d4db73b33.html#ace153ac59b40c94e25c85ffd0406d1deaf3a60b1e65ae2f6d3ca891b3c2eb36a1">00297</a>       ActualCols = <a class="code" href="class_transpose.html" title="Expression of the transpose of a matrix.">Transpose</a> ? MaxRows : MaxCols
<a name="l00298"></a>00298     };
<a name="l00299"></a><a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_a118060e3a2bec126bcfa21d4db73b33.html#a97e2ebd71af234637ca0dddaacab1816">00299</a>     <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="structinternal_1_1conditional.html#a58c51b4d2c9507e2a55f691372378842">conditional&lt;Transpose,_RhsScalar,_LhsScalar&gt;::type</a> <a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_a118060e3a2bec126bcfa21d4db73b33.html#a97e2ebd71af234637ca0dddaacab1816">LhsScalar</a>;
<a name="l00300"></a><a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_a118060e3a2bec126bcfa21d4db73b33.html#ac9ad97ef09dc470262895cc6068f484d">00300</a>     <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="structinternal_1_1conditional.html#a58c51b4d2c9507e2a55f691372378842">conditional&lt;Transpose,_LhsScalar,_RhsScalar&gt;::type</a> <a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_a118060e3a2bec126bcfa21d4db73b33.html#ac9ad97ef09dc470262895cc6068f484d">RhsScalar</a>;
<a name="l00301"></a><a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_a118060e3a2bec126bcfa21d4db73b33.html#aee3b8409df99759bb79ea715edd3601a">00301</a>     <span class="keyword">typedef</span> <a class="code" href="classinternal_1_1gebp__traits.html">gebp_traits&lt;LhsScalar,RhsScalar&gt;</a> <a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_a118060e3a2bec126bcfa21d4db73b33.html#aee3b8409df99759bb79ea715edd3601a">Traits</a>;
<a name="l00302"></a>00302     <span class="keyword">enum</span> {
<a name="l00303"></a><a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_a118060e3a2bec126bcfa21d4db73b33.html#ab8180e3dcf75d9aa321deb5f87742e70a8575c546ba5a2eec20e006aeb6f67199">00303</a>       SizeA = ActualRows * MaxDepth,
<a name="l00304"></a><a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_a118060e3a2bec126bcfa21d4db73b33.html#ab8180e3dcf75d9aa321deb5f87742e70abf5bcd745abd37eefe17891c274b14ad">00304</a>       SizeB = ActualCols * MaxDepth,
<a name="l00305"></a><a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_a118060e3a2bec126bcfa21d4db73b33.html#ab8180e3dcf75d9aa321deb5f87742e70a4567d50a112e69876b0fb55a29e7ead6">00305</a>       SizeW = MaxDepth * Traits::WorkSpaceFactor
<a name="l00306"></a>00306     };
<a name="l00307"></a>00307 
<a name="l00308"></a><a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_a118060e3a2bec126bcfa21d4db73b33.html#abe049b20ffebef7100d7135f2a4197b2">00308</a>     <a class="code" href="_macros_8h.html#ac507b2a5b118b428ea7af180982e1fef">EIGEN_ALIGN16</a> <a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_a118060e3a2bec126bcfa21d4db73b33.html#a97e2ebd71af234637ca0dddaacab1816">LhsScalar</a> m_staticA[SizeA];
<a name="l00309"></a><a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_a118060e3a2bec126bcfa21d4db73b33.html#a9ddbcb66b9a2a0db5d5b14b85e4fc0db">00309</a>     <a class="code" href="_macros_8h.html#ac507b2a5b118b428ea7af180982e1fef">EIGEN_ALIGN16</a> <a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_a118060e3a2bec126bcfa21d4db73b33.html#ac9ad97ef09dc470262895cc6068f484d">RhsScalar</a> m_staticB[SizeB];
<a name="l00310"></a><a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_a118060e3a2bec126bcfa21d4db73b33.html#adc34ffab6e46a6ec8885b3aba496b871">00310</a>     <a class="code" href="_macros_8h.html#ac507b2a5b118b428ea7af180982e1fef">EIGEN_ALIGN16</a> <a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_a118060e3a2bec126bcfa21d4db73b33.html#ac9ad97ef09dc470262895cc6068f484d">RhsScalar</a> m_staticW[SizeW];
<a name="l00311"></a>00311 
<a name="l00312"></a>00312   <span class="keyword">public</span>:
<a name="l00313"></a>00313 
<a name="l00314"></a><a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_a118060e3a2bec126bcfa21d4db73b33.html#a1664bf6142ceeccb5f256df411cd403a">00314</a>     gemm_blocking_space(<a class="code" href="_xpr_helper_8h.html#a0cd03d34614dcb302c968e4fe1391ca3">DenseIndex</a> <span class="comment">/*rows*/</span>, <a class="code" href="_xpr_helper_8h.html#a0cd03d34614dcb302c968e4fe1391ca3">DenseIndex</a> <span class="comment">/*cols*/</span>, <a class="code" href="_xpr_helper_8h.html#a0cd03d34614dcb302c968e4fe1391ca3">DenseIndex</a> <span class="comment">/*depth*/</span>)
<a name="l00315"></a>00315     {
<a name="l00316"></a>00316       this-&gt;m_mc = ActualRows;
<a name="l00317"></a>00317       this-&gt;m_nc = ActualCols;
<a name="l00318"></a>00318       this-&gt;m_kc = MaxDepth;
<a name="l00319"></a>00319       this-&gt;m_blockA = m_staticA;
<a name="l00320"></a>00320       this-&gt;m_blockB = m_staticB;
<a name="l00321"></a>00321       this-&gt;m_blockW = m_staticW;
<a name="l00322"></a>00322     }
<a name="l00323"></a>00323 
<a name="l00324"></a><a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_a118060e3a2bec126bcfa21d4db73b33.html#ad9dd1a3dbe2816a4541a21d08743e011">00324</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_a118060e3a2bec126bcfa21d4db73b33.html#ad9dd1a3dbe2816a4541a21d08743e011">allocateA</a>() {}
<a name="l00325"></a><a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_a118060e3a2bec126bcfa21d4db73b33.html#ac7b0797440a1b5edc3b5e431caadbd22">00325</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_a118060e3a2bec126bcfa21d4db73b33.html#ac7b0797440a1b5edc3b5e431caadbd22">allocateB</a>() {}
<a name="l00326"></a><a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_a118060e3a2bec126bcfa21d4db73b33.html#a5c7f82027246ff2bae64fb347d0f2297">00326</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_a118060e3a2bec126bcfa21d4db73b33.html#a5c7f82027246ff2bae64fb347d0f2297">allocateW</a>() {}
<a name="l00327"></a><a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_a118060e3a2bec126bcfa21d4db73b33.html#ad7a06eebc20f58b1ded1d0921de35248">00327</a>     <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_a118060e3a2bec126bcfa21d4db73b33.html#ad7a06eebc20f58b1ded1d0921de35248">allocateAll</a>() {}
<a name="l00328"></a>00328 };
<a name="l00329"></a>00329 
<a name="l00330"></a>00330 <span class="keyword">template</span>&lt;<span class="keywordtype">int</span> StorageOrder, <span class="keyword">typename</span> _LhsScalar, <span class="keyword">typename</span> _RhsScalar, <span class="keywordtype">int</span> MaxRows, <span class="keywordtype">int</span> MaxCols, <span class="keywordtype">int</span> MaxDepth&gt;
<a name="l00331"></a><a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_07034202288e13504a5f04344da1012a.html">00331</a> <span class="keyword">class </span>gemm_blocking_space&lt;StorageOrder,_LhsScalar,_RhsScalar,MaxRows, MaxCols, MaxDepth, false&gt;
<a name="l00332"></a>00332   : <span class="keyword">public</span> <a class="code" href="classinternal_1_1level3__blocking.html">level3_blocking</a>&lt;
<a name="l00333"></a>00333       typename conditional&lt;StorageOrder==RowMajor,_RhsScalar,_LhsScalar&gt;::type,
<a name="l00334"></a>00334       typename conditional&lt;StorageOrder==RowMajor,_LhsScalar,_RhsScalar&gt;::type&gt;
<a name="l00335"></a>00335 {
<a name="l00336"></a>00336     <span class="keyword">enum</span> {
<a name="l00337"></a><a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_07034202288e13504a5f04344da1012a.html#a5b8d7d48b2d8aa4656d6f179509751dca6e4a7480d814b204a8291dc6c65d2b21">00337</a>       <a class="code" href="class_transpose.html" title="Expression of the transpose of a matrix.">Transpose</a> = StorageOrder==<a class="code" href="_constants_8h.html#aab4d131ba129f519b9e2bd349dc19e3aa1e16fa1b92ed7a058cd4ce7a9a0db044">RowMajor</a>
<a name="l00338"></a>00338     };
<a name="l00339"></a><a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_07034202288e13504a5f04344da1012a.html#abebbe9c031b97310a2bba778d7c71136">00339</a>     <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="structinternal_1_1conditional.html#a58c51b4d2c9507e2a55f691372378842">conditional&lt;Transpose,_RhsScalar,_LhsScalar&gt;::type</a> <a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_07034202288e13504a5f04344da1012a.html#abebbe9c031b97310a2bba778d7c71136">LhsScalar</a>;
<a name="l00340"></a><a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_07034202288e13504a5f04344da1012a.html#a5b9cdf168458478aa4fff0514146b9b0">00340</a>     <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="structinternal_1_1conditional.html#a58c51b4d2c9507e2a55f691372378842">conditional&lt;Transpose,_LhsScalar,_RhsScalar&gt;::type</a> <a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_07034202288e13504a5f04344da1012a.html#a5b9cdf168458478aa4fff0514146b9b0">RhsScalar</a>;
<a name="l00341"></a><a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_07034202288e13504a5f04344da1012a.html#afcf1b07df52be8e173f04ff483957952">00341</a>     <span class="keyword">typedef</span> <a class="code" href="classinternal_1_1gebp__traits.html">gebp_traits&lt;LhsScalar,RhsScalar&gt;</a> <a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_07034202288e13504a5f04344da1012a.html#afcf1b07df52be8e173f04ff483957952">Traits</a>;
<a name="l00342"></a>00342 
<a name="l00343"></a><a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_07034202288e13504a5f04344da1012a.html#a3e54020aac452b1ea1237c9fe4321925">00343</a>     <a class="code" href="_xpr_helper_8h.html#a0cd03d34614dcb302c968e4fe1391ca3">DenseIndex</a> <a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_07034202288e13504a5f04344da1012a.html#a3e54020aac452b1ea1237c9fe4321925">m_sizeA</a>;
<a name="l00344"></a><a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_07034202288e13504a5f04344da1012a.html#a8f0a43dc5fc3839874e9939c2cc7d58b">00344</a>     <a class="code" href="_xpr_helper_8h.html#a0cd03d34614dcb302c968e4fe1391ca3">DenseIndex</a> <a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_07034202288e13504a5f04344da1012a.html#a8f0a43dc5fc3839874e9939c2cc7d58b">m_sizeB</a>;
<a name="l00345"></a><a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_07034202288e13504a5f04344da1012a.html#a1936ac1ddd65774ec56d3855b0f1fb52">00345</a>     <a class="code" href="_xpr_helper_8h.html#a0cd03d34614dcb302c968e4fe1391ca3">DenseIndex</a> <a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_07034202288e13504a5f04344da1012a.html#a1936ac1ddd65774ec56d3855b0f1fb52">m_sizeW</a>;
<a name="l00346"></a>00346 
<a name="l00347"></a>00347   <span class="keyword">public</span>:
<a name="l00348"></a>00348 
<a name="l00349"></a><a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_07034202288e13504a5f04344da1012a.html#a6e2739966d6457864964dadc5fc12ec8">00349</a>     gemm_blocking_space(<a class="code" href="_xpr_helper_8h.html#a0cd03d34614dcb302c968e4fe1391ca3">DenseIndex</a> rows, <a class="code" href="_xpr_helper_8h.html#a0cd03d34614dcb302c968e4fe1391ca3">DenseIndex</a> cols, <a class="code" href="_xpr_helper_8h.html#a0cd03d34614dcb302c968e4fe1391ca3">DenseIndex</a> depth)
<a name="l00350"></a>00350     {
<a name="l00351"></a>00351       this-&gt;m_mc = <a class="code" href="class_transpose.html" title="Expression of the transpose of a matrix.">Transpose</a> ? cols : rows;
<a name="l00352"></a>00352       this-&gt;m_nc = <a class="code" href="class_transpose.html" title="Expression of the transpose of a matrix.">Transpose</a> ? rows : cols;
<a name="l00353"></a>00353       this-&gt;m_kc = depth;
<a name="l00354"></a>00354 
<a name="l00355"></a>00355       computeProductBlockingSizes&lt;LhsScalar,RhsScalar&gt;(this-&gt;m_kc, this-&gt;m_mc, this-&gt;m_nc);
<a name="l00356"></a>00356       m_sizeA = this-&gt;m_mc * this-&gt;m_kc;
<a name="l00357"></a>00357       m_sizeB = this-&gt;m_kc * this-&gt;m_nc;
<a name="l00358"></a>00358       m_sizeW = this-&gt;m_kc*Traits::WorkSpaceFactor;
<a name="l00359"></a>00359     }
<a name="l00360"></a>00360 
<a name="l00361"></a><a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_07034202288e13504a5f04344da1012a.html#afbebfa3a219c522079f33e5784a2a176">00361</a>     <span class="keywordtype">void</span> allocateA()
<a name="l00362"></a>00362     {
<a name="l00363"></a>00363       <span class="keywordflow">if</span>(this-&gt;m_blockA==0)
<a name="l00364"></a>00364         this-&gt;m_blockA = aligned_new&lt;LhsScalar&gt;(m_sizeA);
<a name="l00365"></a>00365     }
<a name="l00366"></a>00366 
<a name="l00367"></a><a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_07034202288e13504a5f04344da1012a.html#ad385ed188ebdf90f5b87d219492cdb1f">00367</a>     <span class="keywordtype">void</span> allocateB()
<a name="l00368"></a>00368     {
<a name="l00369"></a>00369       <span class="keywordflow">if</span>(this-&gt;m_blockB==0)
<a name="l00370"></a>00370         this-&gt;m_blockB = aligned_new&lt;RhsScalar&gt;(m_sizeB);
<a name="l00371"></a>00371     }
<a name="l00372"></a>00372 
<a name="l00373"></a><a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_07034202288e13504a5f04344da1012a.html#a19a0f003f7571d8dc828b4e90435f6a9">00373</a>     <span class="keywordtype">void</span> allocateW()
<a name="l00374"></a>00374     {
<a name="l00375"></a>00375       <span class="keywordflow">if</span>(this-&gt;m_blockW==0)
<a name="l00376"></a>00376         this-&gt;m_blockW = aligned_new&lt;RhsScalar&gt;(m_sizeW);
<a name="l00377"></a>00377     }
<a name="l00378"></a>00378 
<a name="l00379"></a><a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_07034202288e13504a5f04344da1012a.html#aa6ed23949677a5550e0168acb4f63bf5">00379</a>     <span class="keywordtype">void</span> allocateAll()
<a name="l00380"></a>00380     {
<a name="l00381"></a>00381       allocateA();
<a name="l00382"></a>00382       allocateB();
<a name="l00383"></a>00383       allocateW();
<a name="l00384"></a>00384     }
<a name="l00385"></a>00385 
<a name="l00386"></a><a class="code" href="classinternal_1_1gemm__blocking__space_3_01_storage_order_00_01___lhs_scalar_00_01___rhs_scalar_07034202288e13504a5f04344da1012a.html#a67d7c740412a9080ba39875f6ebb5edd">00386</a>     ~gemm_blocking_space()
<a name="l00387"></a>00387     {
<a name="l00388"></a>00388       <a class="code" href="namespaceinternal.html#afd34f96e0c9f261a3eff04647a7768b0">aligned_delete</a>(this-&gt;m_blockA, m_sizeA);
<a name="l00389"></a>00389       <a class="code" href="namespaceinternal.html#afd34f96e0c9f261a3eff04647a7768b0">aligned_delete</a>(this-&gt;m_blockB, m_sizeB);
<a name="l00390"></a>00390       <a class="code" href="namespaceinternal.html#afd34f96e0c9f261a3eff04647a7768b0">aligned_delete</a>(this-&gt;m_blockW, m_sizeW);
<a name="l00391"></a>00391     }
<a name="l00392"></a>00392 };
<a name="l00393"></a>00393 
<a name="l00394"></a>00394 } <span class="comment">// end namespace internal</span>
<a name="l00395"></a>00395 
<a name="l00396"></a>00396 <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Lhs, <span class="keyword">typename</span> Rhs&gt;
<a name="l00397"></a><a class="code" href="class_general_product_3_01_lhs_00_01_rhs_00_01_gemm_product_01_4.html">00397</a> <span class="keyword">class </span><a class="code" href="class_general_product.html" title="Expression of the product of two general matrices or vectors.">GeneralProduct</a>&lt;Lhs, Rhs, <a class="code" href="_constants_8h.html#a843b6364885d3a1a47722e792b0368ecaedaaabe5f05a7e48571843a21cf1f9bc">GemmProduct</a>&gt;
<a name="l00398"></a>00398   : <span class="keyword">public</span> <a class="code" href="class_product_base.html">ProductBase</a>&lt;GeneralProduct&lt;Lhs,Rhs,GemmProduct&gt;, Lhs, Rhs&gt;
<a name="l00399"></a>00399 {
<a name="l00400"></a>00400     <span class="keyword">enum</span> {
<a name="l00401"></a><a class="code" href="class_general_product_3_01_lhs_00_01_rhs_00_01_gemm_product_01_4.html#a6e74261b4661e7df0dd4b078b69da93dade60681a72962eccc1620f82786d12ce">00401</a>       MaxDepthAtCompileTime = <a class="code" href="_macros_8h.html#af2d58514e6156c4da2d4af66fafd0b12">EIGEN_SIZE_MIN_PREFER_FIXED</a>(Lhs::MaxColsAtCompileTime,Rhs::MaxRowsAtCompileTime)
<a name="l00402"></a>00402     };
<a name="l00403"></a>00403   <span class="keyword">public</span>:
<a name="l00404"></a>00404     <a class="code" href="_product_base_8h.html#a5ed95888271cec1a1a76ef08ff3774ed">EIGEN_PRODUCT_PUBLIC_INTERFACE</a>(<a class="code" href="class_general_product.html" title="Expression of the product of two general matrices or vectors.">GeneralProduct</a>)
<a name="l00405"></a>00405     
<a name="l00406"></a><a class="code" href="class_general_product_3_01_lhs_00_01_rhs_00_01_gemm_product_01_4.html#a2ea434009034f45d87bed164bc5d9806">00406</a>     typedef typename  Lhs::<a class="code" href="class_dense_base.html#a6a6c17e367430ca95523eb3fe7db9076">Scalar</a> <a class="code" href="class_general_product_3_01_lhs_00_01_rhs_00_01_gemm_product_01_4.html#a2ea434009034f45d87bed164bc5d9806">LhsScalar</a>;
<a name="l00407"></a><a class="code" href="class_general_product_3_01_lhs_00_01_rhs_00_01_gemm_product_01_4.html#a6fb96e9001f3a7afea1054b79ca61d2a">00407</a>     typedef typename  Rhs::<a class="code" href="class_dense_base.html#a6a6c17e367430ca95523eb3fe7db9076">Scalar</a> <a class="code" href="class_general_product_3_01_lhs_00_01_rhs_00_01_gemm_product_01_4.html#a6fb96e9001f3a7afea1054b79ca61d2a">RhsScalar</a>;
<a name="l00408"></a><a class="code" href="class_general_product_3_01_lhs_00_01_rhs_00_01_gemm_product_01_4.html#ad8757c883ea19fdfc18e2618c738d766">00408</a>     typedef           <a class="code" href="class_dense_base.html#a6a6c17e367430ca95523eb3fe7db9076">Scalar</a>      <a class="code" href="class_general_product_3_01_lhs_00_01_rhs_00_01_gemm_product_01_4.html#ad8757c883ea19fdfc18e2618c738d766">ResScalar</a>;
<a name="l00409"></a>00409 
<a name="l00410"></a><a class="code" href="class_general_product_3_01_lhs_00_01_rhs_00_01_gemm_product_01_4.html#afe59706f2d8be9f484ac91679f9bb1e6">00410</a>     <a class="code" href="class_general_product.html" title="Expression of the product of two general matrices or vectors.">GeneralProduct</a>(const Lhs&amp; lhs, const Rhs&amp; rhs) : <a class="code" href="class_dense_coeffs_base.html">Base</a>(lhs,rhs)
<a name="l00411"></a>00411     {
<a name="l00412"></a>00412       <span class="keyword">typedef</span> <a class="code" href="structinternal_1_1scalar__product__op.html">internal::scalar_product_op&lt;LhsScalar,RhsScalar&gt;</a> BinOp;
<a name="l00413"></a>00413       <a class="code" href="_cwise_binary_op_8h.html#aa74c2010558ea2f2bb8d6b1ebafd4d58">EIGEN_CHECK_BINARY_COMPATIBILIY</a>(BinOp,LhsScalar,RhsScalar);
<a name="l00414"></a>00414     }
<a name="l00415"></a>00415 
<a name="l00416"></a><a class="code" href="class_general_product_3_01_lhs_00_01_rhs_00_01_gemm_product_01_4.html#a6af103bada090fcec811f503ceda9a7a">00416</a>     <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Dest&gt; <span class="keywordtype">void</span> scaleAndAddTo(Dest&amp; dst, <a class="code" href="class_dense_base.html#a6a6c17e367430ca95523eb3fe7db9076">Scalar</a> alpha)<span class="keyword"> const</span>
<a name="l00417"></a>00417 <span class="keyword">    </span>{
<a name="l00418"></a>00418       <a class="code" href="_macros_8h.html#acaa7ba89800cfe18d5fd6eed620aea9c">eigen_assert</a>(dst.rows()==m_lhs.rows() &amp;&amp; dst.cols()==m_rhs.cols());
<a name="l00419"></a>00419 
<a name="l00420"></a>00420       <span class="keyword">const</span> <a class="code" href="class_product_base.html#a8d36c550c5f59678c59300f70fb23996">ActualLhsType</a> lhs = LhsBlasTraits::extract(m_lhs);
<a name="l00421"></a>00421       <span class="keyword">const</span> <a class="code" href="class_product_base.html#a1974b63e35917d6c0db750d9ec10abc1">ActualRhsType</a> rhs = RhsBlasTraits::extract(m_rhs);
<a name="l00422"></a>00422 
<a name="l00423"></a>00423       <a class="code" href="class_dense_base.html#a6a6c17e367430ca95523eb3fe7db9076">Scalar</a> actualAlpha = alpha * LhsBlasTraits::extractScalarFactor(m_lhs)
<a name="l00424"></a>00424                                  * RhsBlasTraits::extractScalarFactor(m_rhs);
<a name="l00425"></a>00425 
<a name="l00426"></a>00426       <span class="keyword">typedef</span> internal::gemm_blocking_space&lt;(Dest::Flags&amp;<a class="code" href="group__flags.html#ga7bd49e7b260e869e10fb9dc4fd081a85" title="for a matrix, this means that the storage order is row-major.">RowMajorBit</a>) ? <a class="code" href="_constants_8h.html#aab4d131ba129f519b9e2bd349dc19e3aa1e16fa1b92ed7a058cd4ce7a9a0db044">RowMajor</a> : <a class="code" href="_constants_8h.html#aab4d131ba129f519b9e2bd349dc19e3aac86184b0e3be936fbfd20249a057a0bf">ColMajor</a>,<a class="code" href="class_general_product_3_01_lhs_00_01_rhs_00_01_gemm_product_01_4.html#a2ea434009034f45d87bed164bc5d9806">LhsScalar</a>,<a class="code" href="class_general_product_3_01_lhs_00_01_rhs_00_01_gemm_product_01_4.html#a6fb96e9001f3a7afea1054b79ca61d2a">RhsScalar</a>,
<a name="l00427"></a>00427               Dest::MaxRowsAtCompileTime,Dest::MaxColsAtCompileTime,MaxDepthAtCompileTime&gt; BlockingType;
<a name="l00428"></a>00428 
<a name="l00429"></a>00429       <span class="keyword">typedef</span> <a class="code" href="structinternal_1_1gemm__functor.html">internal::gemm_functor</a>&lt;
<a name="l00430"></a>00430         <a class="code" href="class_dense_base.html#a6a6c17e367430ca95523eb3fe7db9076">Scalar</a>, <a class="code" href="class_dense_base.html#a059039d9d011413c873e6ae05ee912b6" title="The type of indices.">Index</a>,
<a name="l00431"></a>00431         internal::general_matrix_matrix_product&lt;
<a name="l00432"></a>00432           Index,
<a name="l00433"></a>00433           <a class="code" href="class_general_product_3_01_lhs_00_01_rhs_00_01_gemm_product_01_4.html#a2ea434009034f45d87bed164bc5d9806">LhsScalar</a>, (_ActualLhsType::Flags&amp;<a class="code" href="group__flags.html#ga7bd49e7b260e869e10fb9dc4fd081a85" title="for a matrix, this means that the storage order is row-major.">RowMajorBit</a>) ? <a class="code" href="_constants_8h.html#aab4d131ba129f519b9e2bd349dc19e3aa1e16fa1b92ed7a058cd4ce7a9a0db044">RowMajor</a> : ColMajor, <span class="keywordtype">bool</span>(LhsBlasTraits::NeedToConjugate),
<a name="l00434"></a>00434           <a class="code" href="class_general_product_3_01_lhs_00_01_rhs_00_01_gemm_product_01_4.html#a6fb96e9001f3a7afea1054b79ca61d2a">RhsScalar</a>, (_ActualRhsType::Flags&amp;<a class="code" href="group__flags.html#ga7bd49e7b260e869e10fb9dc4fd081a85" title="for a matrix, this means that the storage order is row-major.">RowMajorBit</a>) ? <a class="code" href="_constants_8h.html#aab4d131ba129f519b9e2bd349dc19e3aa1e16fa1b92ed7a058cd4ce7a9a0db044">RowMajor</a> : ColMajor, <span class="keywordtype">bool</span>(RhsBlasTraits::NeedToConjugate),
<a name="l00435"></a>00435           (Dest::Flags&amp;<a class="code" href="group__flags.html#ga7bd49e7b260e869e10fb9dc4fd081a85" title="for a matrix, this means that the storage order is row-major.">RowMajorBit</a>) ? <a class="code" href="_constants_8h.html#aab4d131ba129f519b9e2bd349dc19e3aa1e16fa1b92ed7a058cd4ce7a9a0db044">RowMajor</a> : ColMajor&gt;,
<a name="l00436"></a>00436         <a class="code" href="class_product_base.html#aa0d76474a888b024c9b9cf085c3e3ca9">_ActualLhsType</a>, <a class="code" href="class_product_base.html#a33a3eaad27f27ea5cc639435ba3543fb">_ActualRhsType</a>, Dest, BlockingType&gt; GemmFunctor;
<a name="l00437"></a>00437 
<a name="l00438"></a>00438       BlockingType blocking(dst.rows(), dst.cols(), lhs.cols());
<a name="l00439"></a>00439 
<a name="l00440"></a>00440       internal::parallelize_gemm&lt;(Dest::MaxRowsAtCompileTime&gt;32 || Dest::MaxRowsAtCompileTime==<a class="code" href="_constants_8h.html#adc9da5be31bdce40c25a92c27999c0e3" title="This value means that a quantity is not known at compile-time, and that instead the value is stored i...">Dynamic</a>)&gt;(GemmFunctor(lhs, rhs, dst, actualAlpha, blocking), this-&gt;rows(), this-&gt;cols(), Dest::Flags&amp;<a class="code" href="group__flags.html#ga7bd49e7b260e869e10fb9dc4fd081a85" title="for a matrix, this means that the storage order is row-major.">RowMajorBit</a>);
<a name="l00441"></a>00441     }
<a name="l00442"></a>00442 };
<a name="l00443"></a>00443 
<a name="l00444"></a>00444 <span class="preprocessor">#endif // EIGEN_GENERAL_MATRIX_MATRIX_H</span>
</pre></div></div>
</div>
<br><hr><br> <table border="0" width="100%"> <tr> <td> Page generated by <a href="http://www.doxygen.org" target="_blank">Doxygen 1.7.2</a> for MRPT 0.9.4 SVN: at Mon Jan 10 22:30:30 UTC 2011</td><td></td> <td width="100"> </td> <td width="150">  </td></tr> </table> </body></html>