Sophie

Sophie

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

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: VectorwiseOp.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>VectorwiseOp.h</h1>  </div>
</div>
<div class="contents">
<a href="_vectorwise_op_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-2010 Gael Guennebaud &lt;gael.guennebaud@inria.fr&gt;</span>
<a name="l00005"></a>00005 <span class="comment">// Copyright (C) 2006-2008 Benoit Jacob &lt;jacob.benoit.1@gmail.com&gt;</span>
<a name="l00006"></a>00006 <span class="comment">//</span>
<a name="l00007"></a>00007 <span class="comment">// Eigen is free software; you can redistribute it and/or</span>
<a name="l00008"></a>00008 <span class="comment">// modify it under the terms of the GNU Lesser General Public</span>
<a name="l00009"></a>00009 <span class="comment">// License as published by the Free Software Foundation; either</span>
<a name="l00010"></a>00010 <span class="comment">// version 3 of the License, or (at your option) any later version.</span>
<a name="l00011"></a>00011 <span class="comment">//</span>
<a name="l00012"></a>00012 <span class="comment">// Alternatively, you can redistribute it and/or</span>
<a name="l00013"></a>00013 <span class="comment">// modify it under the terms of the GNU General Public License as</span>
<a name="l00014"></a>00014 <span class="comment">// published by the Free Software Foundation; either version 2 of</span>
<a name="l00015"></a>00015 <span class="comment">// the License, or (at your option) any later version.</span>
<a name="l00016"></a>00016 <span class="comment">//</span>
<a name="l00017"></a>00017 <span class="comment">// Eigen is distributed in the hope that it will be useful, but WITHOUT ANY</span>
<a name="l00018"></a>00018 <span class="comment">// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS</span>
<a name="l00019"></a>00019 <span class="comment">// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the</span>
<a name="l00020"></a>00020 <span class="comment">// GNU General Public License for more details.</span>
<a name="l00021"></a>00021 <span class="comment">//</span>
<a name="l00022"></a>00022 <span class="comment">// You should have received a copy of the GNU Lesser General Public</span>
<a name="l00023"></a>00023 <span class="comment">// License and a copy of the GNU General Public License along with</span>
<a name="l00024"></a>00024 <span class="comment">// Eigen. If not, see &lt;http://www.gnu.org/licenses/&gt;.</span>
<a name="l00025"></a>00025 
<a name="l00026"></a>00026 <span class="preprocessor">#ifndef EIGEN_PARTIAL_REDUX_H</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span><span class="preprocessor">#define EIGEN_PARTIAL_REDUX_H</span>
<a name="l00028"></a>00028 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00029"></a>00029 <span class="comment">/** \class PartialReduxExpr</span>
<a name="l00030"></a>00030 <span class="comment">  * \ingroup Core_Module</span>
<a name="l00031"></a>00031 <span class="comment">  *</span>
<a name="l00032"></a>00032 <span class="comment">  * \brief Generic expression of a partially reduxed matrix</span>
<a name="l00033"></a>00033 <span class="comment">  *</span>
<a name="l00034"></a>00034 <span class="comment">  * \param MatrixType the type of the matrix we are applying the redux operation</span>
<a name="l00035"></a>00035 <span class="comment">  * \param MemberOp type of the member functor</span>
<a name="l00036"></a>00036 <span class="comment">  * \param Direction indicates the direction of the redux (Vertical or Horizontal)</span>
<a name="l00037"></a>00037 <span class="comment">  *</span>
<a name="l00038"></a>00038 <span class="comment">  * This class represents an expression of a partial redux operator of a matrix.</span>
<a name="l00039"></a>00039 <span class="comment">  * It is the return type of some VectorwiseOp functions,</span>
<a name="l00040"></a>00040 <span class="comment">  * and most of the time this is the only way it is used.</span>
<a name="l00041"></a>00041 <span class="comment">  *</span>
<a name="l00042"></a>00042 <span class="comment">  * \sa class VectorwiseOp</span>
<a name="l00043"></a>00043 <span class="comment">  */</span>
<a name="l00044"></a>00044 
<a name="l00045"></a>00045 <span class="keyword">template</span>&lt; <span class="keyword">typename</span> MatrixType, <span class="keyword">typename</span> MemberOp, <span class="keywordtype">int</span> Direction&gt;
<a name="l00046"></a>00046 <span class="keyword">class </span><a class="code" href="class_partial_redux_expr.html" title="Generic expression of a partially reduxed matrix.">PartialReduxExpr</a>;
<a name="l00047"></a>00047 
<a name="l00048"></a>00048 <span class="keyword">namespace </span>internal {
<a name="l00049"></a>00049 <span class="keyword">template</span>&lt;<span class="keyword">typename</span> MatrixType, <span class="keyword">typename</span> MemberOp, <span class="keywordtype">int</span> Direction&gt;
<a name="l00050"></a><a class="code" href="structinternal_1_1traits_3_01_partial_redux_expr_3_01_matrix_type_00_01_member_op_00_01_direction_01_4_01_4.html">00050</a> <span class="keyword">struct </span>traits&lt;<a class="code" href="class_partial_redux_expr.html" title="Generic expression of a partially reduxed matrix.">PartialReduxExpr</a>&lt;MatrixType, MemberOp, Direction&gt; &gt;
<a name="l00051"></a>00051  : traits&lt;MatrixType&gt;
<a name="l00052"></a>00052 {
<a name="l00053"></a><a class="code" href="structinternal_1_1traits_3_01_partial_redux_expr_3_01_matrix_type_00_01_member_op_00_01_direction_01_4_01_4.html#aff14430e025bc7abfeb018b0b488c720">00053</a>   <span class="keyword">typedef</span> <span class="keyword">typename</span> MemberOp::result_type <a class="code" href="structinternal_1_1traits_3_01_partial_redux_expr_3_01_matrix_type_00_01_member_op_00_01_direction_01_4_01_4.html#aff14430e025bc7abfeb018b0b488c720">Scalar</a>;
<a name="l00054"></a><a class="code" href="structinternal_1_1traits_3_01_partial_redux_expr_3_01_matrix_type_00_01_member_op_00_01_direction_01_4_01_4.html#a57870e9d0bc9b277604308d897e0dffc">00054</a>   <span class="keyword">typedef</span> <span class="keyword">typename</span> traits&lt;MatrixType&gt;::StorageKind <a class="code" href="structinternal_1_1traits_3_01_partial_redux_expr_3_01_matrix_type_00_01_member_op_00_01_direction_01_4_01_4.html#a57870e9d0bc9b277604308d897e0dffc">StorageKind</a>;
<a name="l00055"></a><a class="code" href="structinternal_1_1traits_3_01_partial_redux_expr_3_01_matrix_type_00_01_member_op_00_01_direction_01_4_01_4.html#a1565cae49a767c53b73a4fa39b1d6591">00055</a>   <span class="keyword">typedef</span> <span class="keyword">typename</span> traits&lt;MatrixType&gt;::XprKind <a class="code" href="structinternal_1_1traits_3_01_partial_redux_expr_3_01_matrix_type_00_01_member_op_00_01_direction_01_4_01_4.html#a1565cae49a767c53b73a4fa39b1d6591">XprKind</a>;
<a name="l00056"></a><a class="code" href="structinternal_1_1traits_3_01_partial_redux_expr_3_01_matrix_type_00_01_member_op_00_01_direction_01_4_01_4.html#aaca62bbddfff48a0a3a6a2765a251d6c">00056</a>   <span class="keyword">typedef</span> <span class="keyword">typename</span> MatrixType::Scalar <a class="code" href="structinternal_1_1traits_3_01_partial_redux_expr_3_01_matrix_type_00_01_member_op_00_01_direction_01_4_01_4.html#aaca62bbddfff48a0a3a6a2765a251d6c">InputScalar</a>;
<a name="l00057"></a><a class="code" href="structinternal_1_1traits_3_01_partial_redux_expr_3_01_matrix_type_00_01_member_op_00_01_direction_01_4_01_4.html#ac1922f734087e7621afb7bb8a1c5e55e">00057</a>   <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="structinternal_1_1nested.html">nested&lt;MatrixType&gt;::type</a> <a class="code" href="structinternal_1_1traits_3_01_partial_redux_expr_3_01_matrix_type_00_01_member_op_00_01_direction_01_4_01_4.html#ac1922f734087e7621afb7bb8a1c5e55e">MatrixTypeNested</a>;
<a name="l00058"></a><a class="code" href="structinternal_1_1traits_3_01_partial_redux_expr_3_01_matrix_type_00_01_member_op_00_01_direction_01_4_01_4.html#aa309d29f2f3898b22bc1df8fe66457b5">00058</a>   <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="structinternal_1_1remove__all.html#a563ebdff4a8ca3825b500e7efb95c4bc">remove_all&lt;MatrixTypeNested&gt;::type</a> <a class="code" href="structinternal_1_1traits_3_01_partial_redux_expr_3_01_matrix_type_00_01_member_op_00_01_direction_01_4_01_4.html#aa309d29f2f3898b22bc1df8fe66457b5">_MatrixTypeNested</a>;
<a name="l00059"></a>00059   <span class="keyword">enum</span> {
<a name="l00060"></a><a class="code" href="structinternal_1_1traits_3_01_partial_redux_expr_3_01_matrix_type_00_01_member_op_00_01_direction_01_4_01_4.html#ac5b21e914f6e42019a9defe115089346aa24f7b1e8e9ccd602af66ff92468e486">00060</a>     RowsAtCompileTime = Direction==<a class="code" href="_constants_8h.html#a8ef30fa9c08e08c8706653571f9f5b81a2434cd8c1a594a4cdaa250f86639c600">Vertical</a>   ? 1 : MatrixType::RowsAtCompileTime,
<a name="l00061"></a><a class="code" href="structinternal_1_1traits_3_01_partial_redux_expr_3_01_matrix_type_00_01_member_op_00_01_direction_01_4_01_4.html#ac5b21e914f6e42019a9defe115089346afc43522e7e22f942461864e324518fb0">00061</a>     ColsAtCompileTime = Direction==<a class="code" href="_constants_8h.html#a8ef30fa9c08e08c8706653571f9f5b81a7d5f78c516bedc0a066182a6fd606b8b">Horizontal</a> ? 1 : MatrixType::ColsAtCompileTime,
<a name="l00062"></a><a class="code" href="structinternal_1_1traits_3_01_partial_redux_expr_3_01_matrix_type_00_01_member_op_00_01_direction_01_4_01_4.html#ac5b21e914f6e42019a9defe115089346afa9406210afe3cbb2bbee950eda22ee2">00062</a>     MaxRowsAtCompileTime = Direction==<a class="code" href="_constants_8h.html#a8ef30fa9c08e08c8706653571f9f5b81a2434cd8c1a594a4cdaa250f86639c600">Vertical</a>   ? 1 : MatrixType::MaxRowsAtCompileTime,
<a name="l00063"></a><a class="code" href="structinternal_1_1traits_3_01_partial_redux_expr_3_01_matrix_type_00_01_member_op_00_01_direction_01_4_01_4.html#ac5b21e914f6e42019a9defe115089346a6b6ab894e0928b0b9ead88ae1794f1c7">00063</a>     MaxColsAtCompileTime = Direction==<a class="code" href="_constants_8h.html#a8ef30fa9c08e08c8706653571f9f5b81a7d5f78c516bedc0a066182a6fd606b8b">Horizontal</a> ? 1 : MatrixType::MaxColsAtCompileTime,
<a name="l00064"></a><a class="code" href="structinternal_1_1traits_3_01_partial_redux_expr_3_01_matrix_type_00_01_member_op_00_01_direction_01_4_01_4.html#ac5b21e914f6e42019a9defe115089346accb8440cf7b6e57c5520f4aad3f34e57">00064</a>     Flags0 = (<span class="keywordtype">unsigned</span> int)_MatrixTypeNested::Flags &amp; <a class="code" href="_constants_8h.html#ab3a408f1142a07c31e28ff8b51175c74">HereditaryBits</a>,
<a name="l00065"></a><a class="code" href="structinternal_1_1traits_3_01_partial_redux_expr_3_01_matrix_type_00_01_member_op_00_01_direction_01_4_01_4.html#ac5b21e914f6e42019a9defe115089346a8a9db4c7281c56b64d25bd5554bd765b">00065</a>     Flags = (Flags0 &amp; ~<a class="code" href="group__flags.html#ga7bd49e7b260e869e10fb9dc4fd081a85" title="for a matrix, this means that the storage order is row-major.">RowMajorBit</a>) | (RowsAtCompileTime == 1 ? <a class="code" href="group__flags.html#ga7bd49e7b260e869e10fb9dc4fd081a85" title="for a matrix, this means that the storage order is row-major.">RowMajorBit</a> : 0),
<a name="l00066"></a><a class="code" href="structinternal_1_1traits_3_01_partial_redux_expr_3_01_matrix_type_00_01_member_op_00_01_direction_01_4_01_4.html#ac5b21e914f6e42019a9defe115089346a87aab273c38cde95af5600f85d41656b">00066</a>     TraversalSize = Direction==<a class="code" href="_constants_8h.html#a8ef30fa9c08e08c8706653571f9f5b81a2434cd8c1a594a4cdaa250f86639c600">Vertical</a> ? RowsAtCompileTime : ColsAtCompileTime
<a name="l00067"></a>00067   };
<a name="l00068"></a>00068 <span class="preprocessor">  #if EIGEN_GNUC_AT_LEAST(3,4)</span>
<a name="l00069"></a>00069 <span class="preprocessor"></span>  <span class="keyword">typedef</span> <span class="keyword">typename</span> MemberOp::template Cost&lt;InputScalar,int(TraversalSize)&gt; <a class="code" href="structinternal_1_1traits_3_01_partial_redux_expr_3_01_matrix_type_00_01_member_op_00_01_direction_01_4_01_4.html#ae524703eac7d986b218fbb2915d3206b">CostOpType</a>;
<a name="l00070"></a>00070 <span class="preprocessor">  #else</span>
<a name="l00071"></a><a class="code" href="structinternal_1_1traits_3_01_partial_redux_expr_3_01_matrix_type_00_01_member_op_00_01_direction_01_4_01_4.html#ae524703eac7d986b218fbb2915d3206b">00071</a> <span class="preprocessor"></span>  <span class="keyword">typedef</span> <span class="keyword">typename</span> MemberOp::template Cost&lt;InputScalar,TraversalSize&gt; <a class="code" href="structinternal_1_1traits_3_01_partial_redux_expr_3_01_matrix_type_00_01_member_op_00_01_direction_01_4_01_4.html#ae524703eac7d986b218fbb2915d3206b">CostOpType</a>;
<a name="l00072"></a>00072 <span class="preprocessor">  #endif</span>
<a name="l00073"></a>00073 <span class="preprocessor"></span>  <span class="keyword">enum</span> {
<a name="l00074"></a><a class="code" href="structinternal_1_1traits_3_01_partial_redux_expr_3_01_matrix_type_00_01_member_op_00_01_direction_01_4_01_4.html#a306fc4ddedfb02af1df6a50a8c4921acad6a5efba1a9810f62391d773c9a50442">00074</a>     CoeffReadCost = TraversalSize * traits&lt;_MatrixTypeNested&gt;::CoeffReadCost + int(CostOpType::value)
<a name="l00075"></a>00075   };
<a name="l00076"></a>00076 };
<a name="l00077"></a>00077 }
<a name="l00078"></a>00078 
<a name="l00079"></a>00079 <span class="keyword">template</span>&lt; <span class="keyword">typename</span> MatrixType, <span class="keyword">typename</span> MemberOp, <span class="keywordtype">int</span> Direction&gt;
<a name="l00080"></a><a class="code" href="class_partial_redux_expr.html">00080</a> <span class="keyword">class </span><a class="code" href="class_partial_redux_expr.html" title="Generic expression of a partially reduxed matrix.">PartialReduxExpr</a> : internal::no_assignment_operator,
<a name="l00081"></a>00081   <span class="keyword">public</span> internal::dense_xpr_base&lt; PartialReduxExpr&lt;MatrixType, MemberOp, Direction&gt; &gt;::<a class="code" href="classinternal_1_1dense__xpr__base_1_1type.html">type</a>
<a name="l00082"></a>00082 {
<a name="l00083"></a>00083   <span class="keyword">public</span>:
<a name="l00084"></a>00084 
<a name="l00085"></a><a class="code" href="class_partial_redux_expr.html#a53b279e8b3385481fb19c13a59da16de">00085</a>     <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="structinternal_1_1dense__xpr__base.html">internal::dense_xpr_base&lt;PartialReduxExpr&gt;::type</a> <a class="code" href="class_partial_redux_expr.html#a53b279e8b3385481fb19c13a59da16de">Base</a>;
<a name="l00086"></a>00086     <a class="code" href="_macros_8h.html#ab29ea1da9635d033ca44cf26ad6fa0cf">EIGEN_DENSE_PUBLIC_INTERFACE</a>(<a class="code" href="class_partial_redux_expr.html" title="Generic expression of a partially reduxed matrix.">PartialReduxExpr</a>)
<a name="l00087"></a><a class="code" href="class_partial_redux_expr.html#a026f6b5647e8af755f49358f8b9f398e">00087</a>     typedef typename internal::traits&lt;<a class="code" href="class_partial_redux_expr.html" title="Generic expression of a partially reduxed matrix.">PartialReduxExpr</a>&gt;::<a class="code" href="class_partial_redux_expr.html#a026f6b5647e8af755f49358f8b9f398e">MatrixTypeNested</a> <a class="code" href="class_partial_redux_expr.html#a026f6b5647e8af755f49358f8b9f398e">MatrixTypeNested</a>;
<a name="l00088"></a><a class="code" href="class_partial_redux_expr.html#af1896d50d6e4d9c20d3c2aa73aee7447">00088</a>     typedef typename internal::traits&lt;<a class="code" href="class_partial_redux_expr.html" title="Generic expression of a partially reduxed matrix.">PartialReduxExpr</a>&gt;::<a class="code" href="class_partial_redux_expr.html#af1896d50d6e4d9c20d3c2aa73aee7447">_MatrixTypeNested</a> <a class="code" href="class_partial_redux_expr.html#af1896d50d6e4d9c20d3c2aa73aee7447">_MatrixTypeNested</a>;
<a name="l00089"></a>00089 
<a name="l00090"></a><a class="code" href="class_partial_redux_expr.html#a2e34dae3ed53b5185dd8493612cdcc0b">00090</a>     <a class="code" href="class_partial_redux_expr.html" title="Generic expression of a partially reduxed matrix.">PartialReduxExpr</a>(const MatrixType&amp; mat, const MemberOp&amp; func = MemberOp())
<a name="l00091"></a>00091       : m_matrix(mat), m_functor(func) {}
<a name="l00092"></a>00092 
<a name="l00093"></a><a class="code" href="class_partial_redux_expr.html#a132de1ab0c12449eb50a92fe59c1fd85">00093</a>     Index <a class="code" href="class_partial_redux_expr.html#a132de1ab0c12449eb50a92fe59c1fd85">rows</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> (Direction==<a class="code" href="_constants_8h.html#a8ef30fa9c08e08c8706653571f9f5b81a2434cd8c1a594a4cdaa250f86639c600">Vertical</a>   ? 1 : m_matrix.rows()); }
<a name="l00094"></a><a class="code" href="class_partial_redux_expr.html#ade6ba8c97133e75989d68aa5adb0cdff">00094</a>     Index <a class="code" href="class_partial_redux_expr.html#ade6ba8c97133e75989d68aa5adb0cdff">cols</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> (Direction==<a class="code" href="_constants_8h.html#a8ef30fa9c08e08c8706653571f9f5b81a7d5f78c516bedc0a066182a6fd606b8b">Horizontal</a> ? 1 : m_matrix.cols()); }
<a name="l00095"></a>00095 
<a name="l00096"></a><a class="code" href="class_partial_redux_expr.html#ac14e97fb21ca838681c098a56ac5a793">00096</a>     <a class="code" href="_macros_8h.html#af2b60117c00a6e75812de43bfe7db3b1">EIGEN_STRONG_INLINE</a> <span class="keyword">const</span> Scalar coeff(Index i, Index j)<span class="keyword"> const</span>
<a name="l00097"></a>00097 <span class="keyword">    </span>{
<a name="l00098"></a>00098       <span class="keywordflow">if</span> (Direction==<a class="code" href="_constants_8h.html#a8ef30fa9c08e08c8706653571f9f5b81a2434cd8c1a594a4cdaa250f86639c600">Vertical</a>)
<a name="l00099"></a>00099         <span class="keywordflow">return</span> m_functor(m_matrix.col(j));
<a name="l00100"></a>00100       <span class="keywordflow">else</span>
<a name="l00101"></a>00101         <span class="keywordflow">return</span> m_functor(m_matrix.row(i));
<a name="l00102"></a>00102     }
<a name="l00103"></a>00103 
<a name="l00104"></a><a class="code" href="class_partial_redux_expr.html#a476ddd2913d4569039ecc9ba94b133e2">00104</a>     <span class="keyword">const</span> Scalar coeff(Index index)<span class="keyword"> const</span>
<a name="l00105"></a>00105 <span class="keyword">    </span>{
<a name="l00106"></a>00106       <span class="keywordflow">if</span> (Direction==<a class="code" href="_constants_8h.html#a8ef30fa9c08e08c8706653571f9f5b81a2434cd8c1a594a4cdaa250f86639c600">Vertical</a>)
<a name="l00107"></a>00107         <span class="keywordflow">return</span> m_functor(m_matrix.col(index));
<a name="l00108"></a>00108       <span class="keywordflow">else</span>
<a name="l00109"></a>00109         <span class="keywordflow">return</span> m_functor(m_matrix.row(index));
<a name="l00110"></a>00110     }
<a name="l00111"></a>00111 
<a name="l00112"></a>00112   <span class="keyword">protected</span>:
<a name="l00113"></a><a class="code" href="class_partial_redux_expr.html#a2fcdb28629c5ec9a2a6316e4b37e5a9a">00113</a>     <span class="keyword">const</span> <a class="code" href="class_partial_redux_expr.html#a026f6b5647e8af755f49358f8b9f398e">MatrixTypeNested</a> <a class="code" href="class_partial_redux_expr.html#a2fcdb28629c5ec9a2a6316e4b37e5a9a">m_matrix</a>;
<a name="l00114"></a><a class="code" href="class_partial_redux_expr.html#a3dfaaa54862c84c1aa2308fc9d8fc03e">00114</a>     <span class="keyword">const</span> MemberOp <a class="code" href="class_partial_redux_expr.html#a3dfaaa54862c84c1aa2308fc9d8fc03e">m_functor</a>;
<a name="l00115"></a>00115 };
<a name="l00116"></a>00116 
<a name="l00117"></a><a class="code" href="_vectorwise_op_8h.html#a86253cd67c16821514cc4fbf30f9eb6b">00117</a> <span class="preprocessor">#define EIGEN_MEMBER_FUNCTOR(MEMBER,COST)                               \</span>
<a name="l00118"></a>00118 <span class="preprocessor">  template &lt;typename ResultType&gt;                                        \</span>
<a name="l00119"></a>00119 <span class="preprocessor">  struct member_##MEMBER {                                           \</span>
<a name="l00120"></a>00120 <span class="preprocessor">    EIGEN_EMPTY_STRUCT_CTOR(member_##MEMBER)                         \</span>
<a name="l00121"></a>00121 <span class="preprocessor">    typedef ResultType result_type;                                     \</span>
<a name="l00122"></a>00122 <span class="preprocessor">    template&lt;typename Scalar, int Size&gt; struct Cost                     \</span>
<a name="l00123"></a>00123 <span class="preprocessor">    { enum { value = COST }; };                                         \</span>
<a name="l00124"></a>00124 <span class="preprocessor">    template&lt;typename XprType&gt;                                          \</span>
<a name="l00125"></a>00125 <span class="preprocessor">    EIGEN_STRONG_INLINE ResultType operator()(const XprType&amp; mat) const \</span>
<a name="l00126"></a>00126 <span class="preprocessor">    { return mat.MEMBER(); } \</span>
<a name="l00127"></a>00127 <span class="preprocessor">  }</span>
<a name="l00128"></a>00128 <span class="preprocessor"></span>
<a name="l00129"></a>00129 <span class="keyword">namespace </span>internal {
<a name="l00130"></a>00130 
<a name="l00131"></a>00131 <a class="code" href="namespaceinternal.html#ae50d8a6dd4f7e1b9ba61a9c9cb765e5c">EIGEN_MEMBER_FUNCTOR</a>(squaredNorm, Size * <a class="code" href="struct_num_traits.html" title="Holds information about the various numeric (i.e.">NumTraits&lt;Scalar&gt;::MulCost</a> + (Size-1)*<a class="code" href="struct_num_traits.html" title="Holds information about the various numeric (i.e.">NumTraits&lt;Scalar&gt;::AddCost</a>);
<a name="l00132"></a>00132 <a class="code" href="namespaceinternal.html#ae50d8a6dd4f7e1b9ba61a9c9cb765e5c">EIGEN_MEMBER_FUNCTOR</a>(<a class="code" href="namespacemrpt_1_1math.html#ad5fc47ed8886ef4bc6028a73946a22b8">norm</a>, (Size+5) * <a class="code" href="struct_num_traits.html" title="Holds information about the various numeric (i.e.">NumTraits&lt;Scalar&gt;::MulCost</a> + (Size-1)*<a class="code" href="struct_num_traits.html" title="Holds information about the various numeric (i.e.">NumTraits&lt;Scalar&gt;::AddCost</a>);
<a name="l00133"></a>00133 <a class="code" href="namespaceinternal.html#ae50d8a6dd4f7e1b9ba61a9c9cb765e5c">EIGEN_MEMBER_FUNCTOR</a>(stableNorm, (Size+5) * <a class="code" href="struct_num_traits.html" title="Holds information about the various numeric (i.e.">NumTraits&lt;Scalar&gt;::MulCost</a> + (Size-1)*<a class="code" href="struct_num_traits.html" title="Holds information about the various numeric (i.e.">NumTraits&lt;Scalar&gt;::AddCost</a>);
<a name="l00134"></a>00134 <a class="code" href="namespaceinternal.html#ae50d8a6dd4f7e1b9ba61a9c9cb765e5c">EIGEN_MEMBER_FUNCTOR</a>(blueNorm, (Size+5) * <a class="code" href="struct_num_traits.html" title="Holds information about the various numeric (i.e.">NumTraits&lt;Scalar&gt;::MulCost</a> + (Size-1)*<a class="code" href="struct_num_traits.html" title="Holds information about the various numeric (i.e.">NumTraits&lt;Scalar&gt;::AddCost</a>);
<a name="l00135"></a>00135 <a class="code" href="namespaceinternal.html#ae50d8a6dd4f7e1b9ba61a9c9cb765e5c">EIGEN_MEMBER_FUNCTOR</a>(hypotNorm, (Size-1) * functor_traits&lt;scalar_hypot_op&lt;Scalar&gt; &gt;::Cost );
<a name="l00136"></a>00136 <a class="code" href="namespaceinternal.html#ae50d8a6dd4f7e1b9ba61a9c9cb765e5c">EIGEN_MEMBER_FUNCTOR</a>(<a class="code" href="namespacemrpt_1_1math.html#a73bb4427a78a19d9b7dc9feeb7c13b5a" title="Computes the sum of all the elements.">sum</a>, (Size-1)*<a class="code" href="struct_num_traits.html" title="Holds information about the various numeric (i.e.">NumTraits&lt;Scalar&gt;::AddCost</a>);
<a name="l00137"></a>00137 <a class="code" href="namespaceinternal.html#ae50d8a6dd4f7e1b9ba61a9c9cb765e5c">EIGEN_MEMBER_FUNCTOR</a>(<a class="code" href="eigen__plugins_8h.html#a378ef7ee1218e4aa29b595c6e0f8ee4a" title="Computes the mean of the entire matrix.">mean</a>, (Size-1)*<a class="code" href="struct_num_traits.html" title="Holds information about the various numeric (i.e.">NumTraits&lt;Scalar&gt;::AddCost</a> + <a class="code" href="struct_num_traits.html" title="Holds information about the various numeric (i.e.">NumTraits&lt;Scalar&gt;::MulCost</a>);
<a name="l00138"></a>00138 <a class="code" href="namespaceinternal.html#ae50d8a6dd4f7e1b9ba61a9c9cb765e5c">EIGEN_MEMBER_FUNCTOR</a>(minCoeff, (Size-1)*<a class="code" href="struct_num_traits.html" title="Holds information about the various numeric (i.e.">NumTraits&lt;Scalar&gt;::AddCost</a>);
<a name="l00139"></a>00139 <a class="code" href="namespaceinternal.html#ae50d8a6dd4f7e1b9ba61a9c9cb765e5c">EIGEN_MEMBER_FUNCTOR</a>(maxCoeff, (Size-1)*<a class="code" href="struct_num_traits.html" title="Holds information about the various numeric (i.e.">NumTraits&lt;Scalar&gt;::AddCost</a>);
<a name="l00140"></a>00140 <a class="code" href="namespaceinternal.html#ae50d8a6dd4f7e1b9ba61a9c9cb765e5c">EIGEN_MEMBER_FUNCTOR</a>(all, (Size-1)*<a class="code" href="struct_num_traits.html" title="Holds information about the various numeric (i.e.">NumTraits&lt;Scalar&gt;::AddCost</a>);
<a name="l00141"></a>00141 <a class="code" href="namespaceinternal.html#ae50d8a6dd4f7e1b9ba61a9c9cb765e5c">EIGEN_MEMBER_FUNCTOR</a>(any, (Size-1)*<a class="code" href="struct_num_traits.html" title="Holds information about the various numeric (i.e.">NumTraits&lt;Scalar&gt;::AddCost</a>);
<a name="l00142"></a>00142 <a class="code" href="namespaceinternal.html#ae50d8a6dd4f7e1b9ba61a9c9cb765e5c">EIGEN_MEMBER_FUNCTOR</a>(count, (Size-1)*<a class="code" href="struct_num_traits.html" title="Holds information about the various numeric (i.e.">NumTraits&lt;Scalar&gt;::AddCost</a>);
<a name="l00143"></a>00143 <a class="code" href="namespaceinternal.html#ae50d8a6dd4f7e1b9ba61a9c9cb765e5c">EIGEN_MEMBER_FUNCTOR</a>(prod, (Size-1)*<a class="code" href="struct_num_traits.html" title="Holds information about the various numeric (i.e.">NumTraits&lt;Scalar&gt;::MulCost</a>);
<a name="l00144"></a>00144 
<a name="l00145"></a>00145 
<a name="l00146"></a>00146 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> BinaryOp, <span class="keyword">typename</span> Scalar&gt;
<a name="l00147"></a><a class="code" href="structinternal_1_1member__redux.html">00147</a> <span class="keyword">struct </span><a class="code" href="structinternal_1_1member__redux.html">member_redux</a> {
<a name="l00148"></a>00148   <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="structinternal_1_1result__of.html">result_of</a>&lt;
<a name="l00149"></a>00149                      BinaryOp(Scalar)
<a name="l00150"></a><a class="code" href="structinternal_1_1member__redux.html#a6bd7e3fd89d8b0d44b3ab08c0a0ec3bf">00150</a>                    &gt;<a class="code" href="classinternal_1_1dense__xpr__base_1_1type.html">::type</a>  <a class="code" href="structinternal_1_1member__redux.html#a6bd7e3fd89d8b0d44b3ab08c0a0ec3bf">result_type</a>;
<a name="l00151"></a><a class="code" href="structinternal_1_1member__redux_1_1_cost.html">00151</a>   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> _Scalar, <span class="keywordtype">int</span> Size&gt; <span class="keyword">struct </span><a class="code" href="structinternal_1_1member__redux_1_1_cost.html">Cost</a>
<a name="l00152"></a><a class="code" href="structinternal_1_1member__redux_1_1_cost.html#ab07f6e699a9d0d803249ea4d1d3c3d47a8cabdd216abfc21485eba27223a074a0">00152</a>   { <span class="keyword">enum</span> { value = (Size-1) * <a class="code" href="structinternal_1_1functor__traits.html">functor_traits&lt;BinaryOp&gt;::Cost</a> }; };
<a name="l00153"></a><a class="code" href="structinternal_1_1member__redux.html#aa5d3f803a65adf99ade59b25caf26d54">00153</a>   <a class="code" href="structinternal_1_1member__redux.html#aa5d3f803a65adf99ade59b25caf26d54">member_redux</a>(<span class="keyword">const</span> BinaryOp func) : m_functor(func) {}
<a name="l00154"></a>00154   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Derived&gt;
<a name="l00155"></a><a class="code" href="structinternal_1_1member__redux.html#afc67f77dd0fc4d380c5d52ba18bd66dc">00155</a>   <span class="keyword">inline</span> <a class="code" href="structinternal_1_1member__redux.html#a6bd7e3fd89d8b0d44b3ab08c0a0ec3bf">result_type</a> operator()(<span class="keyword">const</span> <a class="code" href="class_dense_base.html" title="Base class for all dense matrices, vectors, and arrays.">DenseBase&lt;Derived&gt;</a>&amp; mat)<span class="keyword"> const</span>
<a name="l00156"></a>00156 <span class="keyword">  </span>{ <span class="keywordflow">return</span> mat.redux(m_functor); }
<a name="l00157"></a><a class="code" href="structinternal_1_1member__redux.html#a3861fc4722718ff86e621d0255639a86">00157</a>   <span class="keyword">const</span> BinaryOp <a class="code" href="structinternal_1_1member__redux.html#a3861fc4722718ff86e621d0255639a86">m_functor</a>;
<a name="l00158"></a>00158 };
<a name="l00159"></a>00159 }
<a name="l00160"></a>00160 <span class="comment"></span>
<a name="l00161"></a>00161 <span class="comment">/** \class VectorwiseOp</span>
<a name="l00162"></a>00162 <span class="comment">  * \ingroup Core_Module</span>
<a name="l00163"></a>00163 <span class="comment">  *</span>
<a name="l00164"></a>00164 <span class="comment">  * \brief Pseudo expression providing partial reduction operations</span>
<a name="l00165"></a>00165 <span class="comment">  *</span>
<a name="l00166"></a>00166 <span class="comment">  * \param ExpressionType the type of the object on which to do partial reductions</span>
<a name="l00167"></a>00167 <span class="comment">  * \param Direction indicates the direction of the redux (Vertical or Horizontal)</span>
<a name="l00168"></a>00168 <span class="comment">  *</span>
<a name="l00169"></a>00169 <span class="comment">  * This class represents a pseudo expression with partial reduction features.</span>
<a name="l00170"></a>00170 <span class="comment">  * It is the return type of DenseBase::colwise() and DenseBase::rowwise()</span>
<a name="l00171"></a>00171 <span class="comment">  * and most of the time this is the only way it is used.</span>
<a name="l00172"></a>00172 <span class="comment">  *</span>
<a name="l00173"></a>00173 <span class="comment">  * Example: \include MatrixBase_colwise.cpp</span>
<a name="l00174"></a>00174 <span class="comment">  * Output: \verbinclude MatrixBase_colwise.out</span>
<a name="l00175"></a>00175 <span class="comment">  *</span>
<a name="l00176"></a>00176 <span class="comment">  * \sa DenseBase::colwise(), DenseBase::rowwise(), class PartialReduxExpr</span>
<a name="l00177"></a>00177 <span class="comment">  */</span>
<a name="l00178"></a><a class="code" href="class_vectorwise_op.html">00178</a> <span class="keyword">template</span>&lt;<span class="keyword">typename</span> ExpressionType, <span class="keywordtype">int</span> Direction&gt; <span class="keyword">class </span><a class="code" href="class_vectorwise_op.html" title="Pseudo expression providing partial reduction operations.">VectorwiseOp</a>
<a name="l00179"></a>00179 {
<a name="l00180"></a>00180   <span class="keyword">public</span>:
<a name="l00181"></a>00181 
<a name="l00182"></a><a class="code" href="class_vectorwise_op.html#a3164b3e4f983105c0198bbbc66b9d27b">00182</a>     <span class="keyword">typedef</span> <span class="keyword">typename</span> ExpressionType::Scalar <a class="code" href="class_vectorwise_op.html#a3164b3e4f983105c0198bbbc66b9d27b">Scalar</a>;
<a name="l00183"></a><a class="code" href="class_vectorwise_op.html#a5efb4ab2ff2d41e0c07bdadaa4f07887">00183</a>     <span class="keyword">typedef</span> <span class="keyword">typename</span> ExpressionType::RealScalar <a class="code" href="class_vectorwise_op.html#a5efb4ab2ff2d41e0c07bdadaa4f07887">RealScalar</a>;
<a name="l00184"></a><a class="code" href="class_vectorwise_op.html#a97eff6b62df16580881d4d9b6310fff9">00184</a>     <span class="keyword">typedef</span> <span class="keyword">typename</span> ExpressionType::Index <a class="code" href="class_vectorwise_op.html#a97eff6b62df16580881d4d9b6310fff9">Index</a>;
<a name="l00185"></a>00185     <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="structinternal_1_1conditional.html">internal::conditional&lt;internal::must_nest_by_value&lt;ExpressionType&gt;::ret</a>,
<a name="l00186"></a><a class="code" href="class_vectorwise_op.html#a4c37a952eaf7abcbf246eedd24898994">00186</a>         ExpressionType, ExpressionType&amp;&gt;<a class="code" href="classinternal_1_1dense__xpr__base_1_1type.html">::type</a> <a class="code" href="class_vectorwise_op.html#a4c37a952eaf7abcbf246eedd24898994">ExpressionTypeNested</a>;
<a name="l00187"></a><a class="code" href="class_vectorwise_op.html#aeb44d01021febea1c16ca88120901bb7">00187</a>     <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="structinternal_1_1remove__all.html#a563ebdff4a8ca3825b500e7efb95c4bc">internal::remove_all&lt;ExpressionTypeNested&gt;::type</a> <a class="code" href="class_vectorwise_op.html#aeb44d01021febea1c16ca88120901bb7">ExpressionTypeNestedCleaned</a>;
<a name="l00188"></a>00188 
<a name="l00189"></a>00189     <span class="keyword">template</span>&lt;<span class="keyword">template</span>&lt;<span class="keyword">typename</span> _Scalar&gt; <span class="keyword">class </span>Functor,
<a name="l00190"></a><a class="code" href="struct_vectorwise_op_1_1_return_type.html">00190</a>                       <span class="keyword">typename</span> <a class="code" href="class_vectorwise_op.html#a3164b3e4f983105c0198bbbc66b9d27b">Scalar</a>=<span class="keyword">typename</span> internal::traits&lt;ExpressionType&gt;::Scalar&gt; <span class="keyword">struct </span><a class="code" href="struct_vectorwise_op_1_1_return_type.html">ReturnType</a>
<a name="l00191"></a>00191     {
<a name="l00192"></a>00192       <span class="keyword">typedef</span> <a class="code" href="class_partial_redux_expr.html" title="Generic expression of a partially reduxed matrix.">PartialReduxExpr</a>&lt;ExpressionType,
<a name="l00193"></a>00193                                Functor&lt;Scalar&gt;,
<a name="l00194"></a>00194                                Direction
<a name="l00195"></a><a class="code" href="struct_vectorwise_op_1_1_return_type.html#a706ce105d834fbfd5a12fad26084e9b4">00195</a>                               &gt; <a class="code" href="struct_vectorwise_op_1_1_return_type.html#a706ce105d834fbfd5a12fad26084e9b4">Type</a>;
<a name="l00196"></a>00196     };
<a name="l00197"></a>00197 
<a name="l00198"></a><a class="code" href="struct_vectorwise_op_1_1_redux_return_type.html">00198</a>     <span class="keyword">template</span>&lt;<span class="keyword">typename</span> BinaryOp&gt; <span class="keyword">struct </span><a class="code" href="struct_vectorwise_op_1_1_redux_return_type.html">ReduxReturnType</a>
<a name="l00199"></a>00199     {
<a name="l00200"></a>00200       <span class="keyword">typedef</span> <a class="code" href="class_partial_redux_expr.html" title="Generic expression of a partially reduxed matrix.">PartialReduxExpr</a>&lt;ExpressionType,
<a name="l00201"></a>00201                                <a class="code" href="structinternal_1_1member__redux.html">internal::member_redux&lt;BinaryOp,typename internal::traits&lt;ExpressionType&gt;::Scalar</a>&gt;,
<a name="l00202"></a>00202                                Direction
<a name="l00203"></a><a class="code" href="struct_vectorwise_op_1_1_redux_return_type.html#a9f79851719e5e5cb59b0102b1bb170a6">00203</a>                               &gt; <a class="code" href="struct_vectorwise_op_1_1_redux_return_type.html#a9f79851719e5e5cb59b0102b1bb170a6">Type</a>;
<a name="l00204"></a>00204     };
<a name="l00205"></a>00205 
<a name="l00206"></a>00206     <span class="keyword">enum</span> {
<a name="l00207"></a><a class="code" href="class_vectorwise_op.html#a75a1aad595fa9aaecbeff16aa4584edfa4f3fc78c8bce5d358dbafb50c6612415">00207</a>       IsVertical   = (Direction==<a class="code" href="_constants_8h.html#a8ef30fa9c08e08c8706653571f9f5b81a2434cd8c1a594a4cdaa250f86639c600">Vertical</a>) ? 1 : 0,
<a name="l00208"></a><a class="code" href="class_vectorwise_op.html#a75a1aad595fa9aaecbeff16aa4584edfa64e8ba440fef5bfe0d6a5c64d1ae27d6">00208</a>       IsHorizontal = (Direction==<a class="code" href="_constants_8h.html#a8ef30fa9c08e08c8706653571f9f5b81a7d5f78c516bedc0a066182a6fd606b8b">Horizontal</a>) ? 1 : 0
<a name="l00209"></a>00209     };
<a name="l00210"></a>00210 
<a name="l00211"></a>00211   <span class="keyword">protected</span>:
<a name="l00212"></a>00212 <span class="comment"></span>
<a name="l00213"></a>00213 <span class="comment">    /** \internal</span>
<a name="l00214"></a>00214 <span class="comment">      * \returns the i-th subvector according to the \c Direction */</span>
<a name="l00215"></a>00215     <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="structinternal_1_1conditional.html">internal::conditional</a>&lt;Direction==<a class="code" href="_constants_8h.html#a8ef30fa9c08e08c8706653571f9f5b81a2434cd8c1a594a4cdaa250f86639c600">Vertical</a>,
<a name="l00216"></a>00216                                <span class="keyword">typename</span> ExpressionType::ColXpr,
<a name="l00217"></a><a class="code" href="class_vectorwise_op.html#ab037bf4012992a410e712c54a893bc11">00217</a>                                <span class="keyword">typename</span> ExpressionType::RowXpr&gt;<a class="code" href="classinternal_1_1dense__xpr__base_1_1type.html">::type</a> <a class="code" href="class_vectorwise_op.html#ab037bf4012992a410e712c54a893bc11">SubVector</a>;
<a name="l00218"></a><a class="code" href="class_vectorwise_op.html#a49bf28239f7ffffc04c00a704fab0c9e">00218</a>     <a class="code" href="class_cwise_unary_op.html" title="Generic expression where a coefficient-wise unary operator is applied to an expression.">SubVector</a> subVector(<a class="code" href="class_vectorwise_op.html#a97eff6b62df16580881d4d9b6310fff9">Index</a> i)
<a name="l00219"></a>00219     {
<a name="l00220"></a>00220       <span class="keywordflow">return</span> <a class="code" href="class_cwise_unary_op.html" title="Generic expression where a coefficient-wise unary operator is applied to an expression.">SubVector</a>(m_matrix.derived(),i);
<a name="l00221"></a>00221     }
<a name="l00222"></a>00222 <span class="comment"></span>
<a name="l00223"></a>00223 <span class="comment">    /** \internal</span>
<a name="l00224"></a>00224 <span class="comment">      * \returns the number of subvectors in the direction \c Direction */</span>
<a name="l00225"></a><a class="code" href="class_vectorwise_op.html#a7413507159cadfa0da30a8d66eb33262">00225</a>     <a class="code" href="class_vectorwise_op.html#a97eff6b62df16580881d4d9b6310fff9">Index</a> subVectors()<span class="keyword"> const</span>
<a name="l00226"></a>00226 <span class="keyword">    </span>{ <span class="keywordflow">return</span> Direction==<a class="code" href="_constants_8h.html#a8ef30fa9c08e08c8706653571f9f5b81a2434cd8c1a594a4cdaa250f86639c600">Vertical</a>?m_matrix.cols():m_matrix.rows(); }
<a name="l00227"></a>00227 
<a name="l00228"></a><a class="code" href="struct_vectorwise_op_1_1_extended_type.html">00228</a>     <span class="keyword">template</span>&lt;<span class="keyword">typename</span> OtherDerived&gt; <span class="keyword">struct </span><a class="code" href="struct_vectorwise_op_1_1_extended_type.html">ExtendedType</a> {
<a name="l00229"></a>00229       <span class="keyword">typedef</span> <a class="code" href="class_replicate.html" title="Expression of the multiple replication of a matrix or vector.">Replicate</a>&lt;OtherDerived,
<a name="l00230"></a>00230                         Direction==<a class="code" href="_constants_8h.html#a8ef30fa9c08e08c8706653571f9f5b81a2434cd8c1a594a4cdaa250f86639c600">Vertical</a>   ? 1 : ExpressionType::RowsAtCompileTime,
<a name="l00231"></a><a class="code" href="struct_vectorwise_op_1_1_extended_type.html#ab8b89f23f988de5d21b8de9210d93ca2">00231</a>                         Direction==<a class="code" href="_constants_8h.html#a8ef30fa9c08e08c8706653571f9f5b81a7d5f78c516bedc0a066182a6fd606b8b">Horizontal</a> ? 1 : ExpressionType::ColsAtCompileTime&gt; <a class="code" href="struct_vectorwise_op_1_1_extended_type.html#ab8b89f23f988de5d21b8de9210d93ca2">Type</a>;
<a name="l00232"></a>00232     };
<a name="l00233"></a>00233 <span class="comment"></span>
<a name="l00234"></a>00234 <span class="comment">    /** \internal</span>
<a name="l00235"></a>00235 <span class="comment">      * Replicates a vector to match the size of \c *this */</span>
<a name="l00236"></a>00236     <span class="keyword">template</span>&lt;<span class="keyword">typename</span> OtherDerived&gt;
<a name="l00237"></a>00237     <span class="keyword">typename</span> <a class="code" href="class_replicate.html" title="Expression of the multiple replication of a matrix or vector.">ExtendedType&lt;OtherDerived&gt;::Type</a>
<a name="l00238"></a><a class="code" href="class_vectorwise_op.html#a9f6105a912c12dafd2693cce47fdd321">00238</a>     extendedTo(<span class="keyword">const</span> <a class="code" href="class_dense_base.html" title="Base class for all dense matrices, vectors, and arrays.">DenseBase&lt;OtherDerived&gt;</a>&amp; other)<span class="keyword"> const</span>
<a name="l00239"></a>00239 <span class="keyword">    </span>{
<a name="l00240"></a>00240       <a class="code" href="_static_assert_8h.html#ac04a73705a0aa1d66c4b80f6338db904">EIGEN_STATIC_ASSERT_VECTOR_ONLY</a>(OtherDerived);
<a name="l00241"></a>00241       <span class="keywordflow">return</span> <span class="keyword">typename</span> <a class="code" href="namespace_architecture.html#a7ae6186419ae33e4d9019df7b18d883e">ExtendedType&lt;OtherDerived&gt;::Type</a>
<a name="l00242"></a>00242                       (other.derived(),
<a name="l00243"></a>00243                        Direction==<a class="code" href="_constants_8h.html#a8ef30fa9c08e08c8706653571f9f5b81a2434cd8c1a594a4cdaa250f86639c600">Vertical</a>   ? 1 : m_matrix.rows(),
<a name="l00244"></a>00244                        Direction==<a class="code" href="_constants_8h.html#a8ef30fa9c08e08c8706653571f9f5b81a7d5f78c516bedc0a066182a6fd606b8b">Horizontal</a> ? 1 : m_matrix.cols());
<a name="l00245"></a>00245     }
<a name="l00246"></a>00246 
<a name="l00247"></a>00247   <span class="keyword">public</span>:
<a name="l00248"></a>00248 
<a name="l00249"></a><a class="code" href="class_vectorwise_op.html#afc90486fe18eea5b5acd5340dc09bb25">00249</a>     <span class="keyword">inline</span> <a class="code" href="class_vectorwise_op.html#afc90486fe18eea5b5acd5340dc09bb25">VectorwiseOp</a>(ExpressionType&amp; matrix) : m_matrix(matrix) {}
<a name="l00250"></a>00250 <span class="comment"></span>
<a name="l00251"></a>00251 <span class="comment">    /** \internal */</span>
<a name="l00252"></a><a class="code" href="class_vectorwise_op.html#a5aa4962b112cc8dd35ff923687d3a043">00252</a>     <span class="keyword">inline</span> <span class="keyword">const</span> ExpressionType&amp; <a class="code" href="class_vectorwise_op.html#a5aa4962b112cc8dd35ff923687d3a043">_expression</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> m_matrix; }
<a name="l00253"></a>00253 <span class="comment"></span>
<a name="l00254"></a>00254 <span class="comment">    /** \returns a row or column vector expression of \c *this reduxed by \a func</span>
<a name="l00255"></a>00255 <span class="comment">      *</span>
<a name="l00256"></a>00256 <span class="comment">      * The template parameter \a BinaryOp is the type of the functor</span>
<a name="l00257"></a>00257 <span class="comment">      * of the custom redux operator. Note that func must be an associative operator.</span>
<a name="l00258"></a>00258 <span class="comment">      *</span>
<a name="l00259"></a>00259 <span class="comment">      * \sa class VectorwiseOp, DenseBase::colwise(), DenseBase::rowwise()</span>
<a name="l00260"></a>00260 <span class="comment">      */</span>
<a name="l00261"></a>00261     <span class="keyword">template</span>&lt;<span class="keyword">typename</span> BinaryOp&gt;
<a name="l00262"></a>00262     <span class="keyword">const</span> <span class="keyword">typename</span> <a class="code" href="namespace_architecture.html#a7ae6186419ae33e4d9019df7b18d883e">ReduxReturnType&lt;BinaryOp&gt;::Type</a>
<a name="l00263"></a><a class="code" href="class_vectorwise_op.html#a0597316a227814fca2b8f1ad686328be">00263</a>     redux(<span class="keyword">const</span> BinaryOp&amp; func = BinaryOp())<span class="keyword"> const</span>
<a name="l00264"></a>00264 <span class="keyword">    </span>{ <span class="keywordflow">return</span> <span class="keyword">typename</span> <a class="code" href="namespace_architecture.html#a7ae6186419ae33e4d9019df7b18d883e">ReduxReturnType&lt;BinaryOp&gt;::Type</a>(_expression(), func); }
<a name="l00265"></a>00265 <span class="comment"></span>
<a name="l00266"></a>00266 <span class="comment">    /** \returns a row (or column) vector expression of the smallest coefficient</span>
<a name="l00267"></a>00267 <span class="comment">      * of each column (or row) of the referenced expression.</span>
<a name="l00268"></a>00268 <span class="comment">      *</span>
<a name="l00269"></a>00269 <span class="comment">      * Example: \include PartialRedux_minCoeff.cpp</span>
<a name="l00270"></a>00270 <span class="comment">      * Output: \verbinclude PartialRedux_minCoeff.out</span>
<a name="l00271"></a>00271 <span class="comment">      *</span>
<a name="l00272"></a>00272 <span class="comment">      * \sa DenseBase::minCoeff() */</span>
<a name="l00273"></a><a class="code" href="class_vectorwise_op.html#aa420b20aacb4e2327edaa1ae96b6a870">00273</a>     <span class="keyword">const</span> <span class="keyword">typename</span> <a class="code" href="class_partial_redux_expr.html" title="Generic expression of a partially reduxed matrix.">ReturnType&lt;internal::member_minCoeff&gt;::Type</a> minCoeff()<span class="keyword"> const</span>
<a name="l00274"></a>00274 <span class="keyword">    </span>{ <span class="keywordflow">return</span> _expression(); }
<a name="l00275"></a>00275 <span class="comment"></span>
<a name="l00276"></a>00276 <span class="comment">    /** \returns a row (or column) vector expression of the largest coefficient</span>
<a name="l00277"></a>00277 <span class="comment">      * of each column (or row) of the referenced expression.</span>
<a name="l00278"></a>00278 <span class="comment">      *</span>
<a name="l00279"></a>00279 <span class="comment">      * Example: \include PartialRedux_maxCoeff.cpp</span>
<a name="l00280"></a>00280 <span class="comment">      * Output: \verbinclude PartialRedux_maxCoeff.out</span>
<a name="l00281"></a>00281 <span class="comment">      *</span>
<a name="l00282"></a>00282 <span class="comment">      * \sa DenseBase::maxCoeff() */</span>
<a name="l00283"></a><a class="code" href="class_vectorwise_op.html#a1559cc0542edad78c595ac0976ef93e2">00283</a>     <span class="keyword">const</span> <span class="keyword">typename</span> <a class="code" href="class_partial_redux_expr.html" title="Generic expression of a partially reduxed matrix.">ReturnType&lt;internal::member_maxCoeff&gt;::Type</a> maxCoeff()<span class="keyword"> const</span>
<a name="l00284"></a>00284 <span class="keyword">    </span>{ <span class="keywordflow">return</span> _expression(); }
<a name="l00285"></a>00285 <span class="comment"></span>
<a name="l00286"></a>00286 <span class="comment">    /** \returns a row (or column) vector expression of the squared norm</span>
<a name="l00287"></a>00287 <span class="comment">      * of each column (or row) of the referenced expression.</span>
<a name="l00288"></a>00288 <span class="comment">      *</span>
<a name="l00289"></a>00289 <span class="comment">      * Example: \include PartialRedux_squaredNorm.cpp</span>
<a name="l00290"></a>00290 <span class="comment">      * Output: \verbinclude PartialRedux_squaredNorm.out</span>
<a name="l00291"></a>00291 <span class="comment">      *</span>
<a name="l00292"></a>00292 <span class="comment">      * \sa DenseBase::squaredNorm() */</span>
<a name="l00293"></a><a class="code" href="class_vectorwise_op.html#afbd1acd8c639baca09b48d2c4c29dd39">00293</a>     <span class="keyword">const</span> <span class="keyword">typename</span> <a class="code" href="class_partial_redux_expr.html" title="Generic expression of a partially reduxed matrix.">ReturnType&lt;internal::member_squaredNorm,RealScalar&gt;::Type</a> squaredNorm()<span class="keyword"> const</span>
<a name="l00294"></a>00294 <span class="keyword">    </span>{ <span class="keywordflow">return</span> _expression(); }
<a name="l00295"></a>00295 <span class="comment"></span>
<a name="l00296"></a>00296 <span class="comment">    /** \returns a row (or column) vector expression of the norm</span>
<a name="l00297"></a>00297 <span class="comment">      * of each column (or row) of the referenced expression.</span>
<a name="l00298"></a>00298 <span class="comment">      *</span>
<a name="l00299"></a>00299 <span class="comment">      * Example: \include PartialRedux_norm.cpp</span>
<a name="l00300"></a>00300 <span class="comment">      * Output: \verbinclude PartialRedux_norm.out</span>
<a name="l00301"></a>00301 <span class="comment">      *</span>
<a name="l00302"></a>00302 <span class="comment">      * \sa DenseBase::norm() */</span>
<a name="l00303"></a><a class="code" href="class_vectorwise_op.html#a6109df84cedb633949aee420a51a55c9">00303</a>     <span class="keyword">const</span> <span class="keyword">typename</span> <a class="code" href="class_partial_redux_expr.html" title="Generic expression of a partially reduxed matrix.">ReturnType&lt;internal::member_norm,RealScalar&gt;::Type</a> <a class="code" href="namespacemrpt_1_1math.html#ad5fc47ed8886ef4bc6028a73946a22b8">norm</a>()<span class="keyword"> const</span>
<a name="l00304"></a>00304 <span class="keyword">    </span>{ <span class="keywordflow">return</span> _expression(); }
<a name="l00305"></a>00305 
<a name="l00306"></a>00306 <span class="comment"></span>
<a name="l00307"></a>00307 <span class="comment">    /** \returns a row (or column) vector expression of the norm</span>
<a name="l00308"></a>00308 <span class="comment">      * of each column (or row) of the referenced expression, using</span>
<a name="l00309"></a>00309 <span class="comment">      * blue&#39;s algorithm.</span>
<a name="l00310"></a>00310 <span class="comment">      *</span>
<a name="l00311"></a>00311 <span class="comment">      * \sa DenseBase::blueNorm() */</span>
<a name="l00312"></a><a class="code" href="class_vectorwise_op.html#a5b84fe9fde8ec265fc64557e07e38453">00312</a>     <span class="keyword">const</span> <span class="keyword">typename</span> <a class="code" href="class_partial_redux_expr.html" title="Generic expression of a partially reduxed matrix.">ReturnType&lt;internal::member_blueNorm,RealScalar&gt;::Type</a> blueNorm()<span class="keyword"> const</span>
<a name="l00313"></a>00313 <span class="keyword">    </span>{ <span class="keywordflow">return</span> _expression(); }
<a name="l00314"></a>00314 
<a name="l00315"></a>00315 <span class="comment"></span>
<a name="l00316"></a>00316 <span class="comment">    /** \returns a row (or column) vector expression of the norm</span>
<a name="l00317"></a>00317 <span class="comment">      * of each column (or row) of the referenced expression, avoiding</span>
<a name="l00318"></a>00318 <span class="comment">      * underflow and overflow.</span>
<a name="l00319"></a>00319 <span class="comment">      *</span>
<a name="l00320"></a>00320 <span class="comment">      * \sa DenseBase::stableNorm() */</span>
<a name="l00321"></a><a class="code" href="class_vectorwise_op.html#a281f38be841744917589eb750cf39524">00321</a>     <span class="keyword">const</span> <span class="keyword">typename</span> <a class="code" href="class_partial_redux_expr.html" title="Generic expression of a partially reduxed matrix.">ReturnType&lt;internal::member_stableNorm,RealScalar&gt;::Type</a> stableNorm()<span class="keyword"> const</span>
<a name="l00322"></a>00322 <span class="keyword">    </span>{ <span class="keywordflow">return</span> _expression(); }
<a name="l00323"></a>00323 
<a name="l00324"></a>00324 <span class="comment"></span>
<a name="l00325"></a>00325 <span class="comment">    /** \returns a row (or column) vector expression of the norm</span>
<a name="l00326"></a>00326 <span class="comment">      * of each column (or row) of the referenced expression, avoiding</span>
<a name="l00327"></a>00327 <span class="comment">      * underflow and overflow using a concatenation of hypot() calls.</span>
<a name="l00328"></a>00328 <span class="comment">      *</span>
<a name="l00329"></a>00329 <span class="comment">      * \sa DenseBase::hypotNorm() */</span>
<a name="l00330"></a><a class="code" href="class_vectorwise_op.html#ae49ad5dc0180c204ebff8133e19d65df">00330</a>     <span class="keyword">const</span> <span class="keyword">typename</span> <a class="code" href="class_partial_redux_expr.html" title="Generic expression of a partially reduxed matrix.">ReturnType&lt;internal::member_hypotNorm,RealScalar&gt;::Type</a> hypotNorm()<span class="keyword"> const</span>
<a name="l00331"></a>00331 <span class="keyword">    </span>{ <span class="keywordflow">return</span> _expression(); }
<a name="l00332"></a>00332 <span class="comment"></span>
<a name="l00333"></a>00333 <span class="comment">    /** \returns a row (or column) vector expression of the sum</span>
<a name="l00334"></a>00334 <span class="comment">      * of each column (or row) of the referenced expression.</span>
<a name="l00335"></a>00335 <span class="comment">      *</span>
<a name="l00336"></a>00336 <span class="comment">      * Example: \include PartialRedux_sum.cpp</span>
<a name="l00337"></a>00337 <span class="comment">      * Output: \verbinclude PartialRedux_sum.out</span>
<a name="l00338"></a>00338 <span class="comment">      *</span>
<a name="l00339"></a>00339 <span class="comment">      * \sa DenseBase::sum() */</span>
<a name="l00340"></a><a class="code" href="class_vectorwise_op.html#a2e19a402e1bf3ad092fb1ccab077d63b">00340</a>     <span class="keyword">const</span> <span class="keyword">typename</span> <a class="code" href="class_partial_redux_expr.html" title="Generic expression of a partially reduxed matrix.">ReturnType&lt;internal::member_sum&gt;::Type</a> <a class="code" href="namespacemrpt_1_1math.html#a73bb4427a78a19d9b7dc9feeb7c13b5a" title="Computes the sum of all the elements.">sum</a>()<span class="keyword"> const</span>
<a name="l00341"></a>00341 <span class="keyword">    </span>{ <span class="keywordflow">return</span> _expression(); }
<a name="l00342"></a>00342 <span class="comment"></span>
<a name="l00343"></a>00343 <span class="comment">    /** \returns a row (or column) vector expression of the mean</span>
<a name="l00344"></a>00344 <span class="comment">    * of each column (or row) of the referenced expression.</span>
<a name="l00345"></a>00345 <span class="comment">    *</span>
<a name="l00346"></a>00346 <span class="comment">    * \sa DenseBase::mean() */</span>
<a name="l00347"></a><a class="code" href="class_vectorwise_op.html#a78b5f3209b0e37bc91cb137561731bce">00347</a>     <span class="keyword">const</span> <span class="keyword">typename</span> <a class="code" href="class_partial_redux_expr.html" title="Generic expression of a partially reduxed matrix.">ReturnType&lt;internal::member_mean&gt;::Type</a> <a class="code" href="eigen__plugins_8h.html#a378ef7ee1218e4aa29b595c6e0f8ee4a" title="Computes the mean of the entire matrix.">mean</a>()<span class="keyword"> const</span>
<a name="l00348"></a>00348 <span class="keyword">    </span>{ <span class="keywordflow">return</span> _expression(); }
<a name="l00349"></a>00349 <span class="comment"></span>
<a name="l00350"></a>00350 <span class="comment">    /** \returns a row (or column) vector expression representing</span>
<a name="l00351"></a>00351 <span class="comment">      * whether \b all coefficients of each respective column (or row) are \c true.</span>
<a name="l00352"></a>00352 <span class="comment">      *</span>
<a name="l00353"></a>00353 <span class="comment">      * \sa DenseBase::all() */</span>
<a name="l00354"></a><a class="code" href="class_vectorwise_op.html#ae5924d54e3b16872acfbea9645cf0de3">00354</a>     <span class="keyword">const</span> <span class="keyword">typename</span> <a class="code" href="class_partial_redux_expr.html" title="Generic expression of a partially reduxed matrix.">ReturnType&lt;internal::member_all&gt;::Type</a> all()<span class="keyword"> const</span>
<a name="l00355"></a>00355 <span class="keyword">    </span>{ <span class="keywordflow">return</span> _expression(); }
<a name="l00356"></a>00356 <span class="comment"></span>
<a name="l00357"></a>00357 <span class="comment">    /** \returns a row (or column) vector expression representing</span>
<a name="l00358"></a>00358 <span class="comment">      * whether \b at \b least one coefficient of each respective column (or row) is \c true.</span>
<a name="l00359"></a>00359 <span class="comment">      *</span>
<a name="l00360"></a>00360 <span class="comment">      * \sa DenseBase::any() */</span>
<a name="l00361"></a><a class="code" href="class_vectorwise_op.html#aa1044d4a0a3da94d0674e94c9de6b8e3">00361</a>     <span class="keyword">const</span> <span class="keyword">typename</span> <a class="code" href="class_partial_redux_expr.html" title="Generic expression of a partially reduxed matrix.">ReturnType&lt;internal::member_any&gt;::Type</a> any()<span class="keyword"> const</span>
<a name="l00362"></a>00362 <span class="keyword">    </span>{ <span class="keywordflow">return</span> _expression(); }
<a name="l00363"></a>00363 <span class="comment"></span>
<a name="l00364"></a>00364 <span class="comment">    /** \returns a row (or column) vector expression representing</span>
<a name="l00365"></a>00365 <span class="comment">      * the number of \c true coefficients of each respective column (or row).</span>
<a name="l00366"></a>00366 <span class="comment">      *</span>
<a name="l00367"></a>00367 <span class="comment">      * Example: \include PartialRedux_count.cpp</span>
<a name="l00368"></a>00368 <span class="comment">      * Output: \verbinclude PartialRedux_count.out</span>
<a name="l00369"></a>00369 <span class="comment">      *</span>
<a name="l00370"></a>00370 <span class="comment">      * \sa DenseBase::count() */</span>
<a name="l00371"></a><a class="code" href="class_vectorwise_op.html#ae276490da639d95d26b78977bded5eaa">00371</a>     <span class="keyword">const</span> <a class="code" href="class_partial_redux_expr.html" title="Generic expression of a partially reduxed matrix.">PartialReduxExpr&lt;ExpressionType, internal::member_count&lt;Index&gt;</a>, Direction&gt; count()<span class="keyword"> const</span>
<a name="l00372"></a>00372 <span class="keyword">    </span>{ <span class="keywordflow">return</span> _expression(); }
<a name="l00373"></a>00373 <span class="comment"></span>
<a name="l00374"></a>00374 <span class="comment">    /** \returns a row (or column) vector expression of the product</span>
<a name="l00375"></a>00375 <span class="comment">      * of each column (or row) of the referenced expression.</span>
<a name="l00376"></a>00376 <span class="comment">      *</span>
<a name="l00377"></a>00377 <span class="comment">      * Example: \include PartialRedux_prod.cpp</span>
<a name="l00378"></a>00378 <span class="comment">      * Output: \verbinclude PartialRedux_prod.out</span>
<a name="l00379"></a>00379 <span class="comment">      *</span>
<a name="l00380"></a>00380 <span class="comment">      * \sa DenseBase::prod() */</span>
<a name="l00381"></a><a class="code" href="class_vectorwise_op.html#a5063086947550ed7e91530f00af1e224">00381</a>     <span class="keyword">const</span> <span class="keyword">typename</span> <a class="code" href="class_partial_redux_expr.html" title="Generic expression of a partially reduxed matrix.">ReturnType&lt;internal::member_prod&gt;::Type</a> prod()<span class="keyword"> const</span>
<a name="l00382"></a>00382 <span class="keyword">    </span>{ <span class="keywordflow">return</span> _expression(); }
<a name="l00383"></a>00383 
<a name="l00384"></a>00384 <span class="comment"></span>
<a name="l00385"></a>00385 <span class="comment">    /** \returns a matrix expression</span>
<a name="l00386"></a>00386 <span class="comment">      * where each column (or row) are reversed.</span>
<a name="l00387"></a>00387 <span class="comment">      *</span>
<a name="l00388"></a>00388 <span class="comment">      * Example: \include Vectorwise_reverse.cpp</span>
<a name="l00389"></a>00389 <span class="comment">      * Output: \verbinclude Vectorwise_reverse.out</span>
<a name="l00390"></a>00390 <span class="comment">      *</span>
<a name="l00391"></a>00391 <span class="comment">      * \sa DenseBase::reverse() */</span>
<a name="l00392"></a><a class="code" href="class_vectorwise_op.html#a668ac8070a12a09e4538a924ec0a6e16">00392</a>     <span class="keyword">const</span> <a class="code" href="class_reverse.html" title="Expression of the reverse of a vector or matrix.">Reverse&lt;ExpressionType, Direction&gt;</a> reverse()<span class="keyword"> const</span>
<a name="l00393"></a>00393 <span class="keyword">    </span>{ <span class="keywordflow">return</span> <a class="code" href="class_reverse.html" title="Expression of the reverse of a vector or matrix.">Reverse&lt;ExpressionType, Direction&gt;</a>( _expression() ); }
<a name="l00394"></a>00394 
<a name="l00395"></a><a class="code" href="class_vectorwise_op.html#ac7c7e7850dae2a4c8ed2d957886b6ded">00395</a>     <span class="keyword">typedef</span> <a class="code" href="class_replicate.html" title="Expression of the multiple replication of a matrix or vector.">Replicate&lt;ExpressionType,Direction==Vertical?Dynamic:1,Direction==Horizontal?Dynamic:1&gt;</a> <a class="code" href="class_vectorwise_op.html#ac7c7e7850dae2a4c8ed2d957886b6ded">ReplicateReturnType</a>;
<a name="l00396"></a>00396     <span class="keyword">const</span> <a class="code" href="class_replicate.html" title="Expression of the multiple replication of a matrix or vector.">ReplicateReturnType</a> replicate(<a class="code" href="class_vectorwise_op.html#a97eff6b62df16580881d4d9b6310fff9">Index</a> factor) <span class="keyword">const</span>;
<a name="l00397"></a>00397 <span class="comment"></span>
<a name="l00398"></a>00398 <span class="comment">    /**</span>
<a name="l00399"></a>00399 <span class="comment">      * \return an expression of the replication of each column (or row) of \c *this</span>
<a name="l00400"></a>00400 <span class="comment">      *</span>
<a name="l00401"></a>00401 <span class="comment">      * Example: \include DirectionWise_replicate.cpp</span>
<a name="l00402"></a>00402 <span class="comment">      * Output: \verbinclude DirectionWise_replicate.out</span>
<a name="l00403"></a>00403 <span class="comment">      *</span>
<a name="l00404"></a>00404 <span class="comment">      * \sa VectorwiseOp::replicate(Index), DenseBase::replicate(), class Replicate</span>
<a name="l00405"></a>00405 <span class="comment">      */</span>
<a name="l00406"></a>00406     <span class="comment">// NOTE implemented here because of sunstudio&#39;s compilation errors</span>
<a name="l00407"></a>00407     <span class="keyword">template</span>&lt;<span class="keywordtype">int</span> Factor&gt; <span class="keyword">const</span> <a class="code" href="class_replicate.html" title="Expression of the multiple replication of a matrix or vector.">Replicate&lt;ExpressionType,(IsVertical?Factor:1),(IsHorizontal?Factor:1)&gt;</a>
<a name="l00408"></a><a class="code" href="class_vectorwise_op.html#a1e2e5d161e8de8d5554dc81e1758ff12">00408</a>     replicate(<a class="code" href="class_vectorwise_op.html#a97eff6b62df16580881d4d9b6310fff9">Index</a> factor = Factor)<span class="keyword"> const</span>
<a name="l00409"></a>00409 <span class="keyword">    </span>{
<a name="l00410"></a>00410       <span class="keywordflow">return</span> <a class="code" href="class_replicate.html" title="Expression of the multiple replication of a matrix or vector.">Replicate&lt;ExpressionType,Direction==Vertical?Factor:1,Direction==Horizontal?Factor:1&gt;</a>
<a name="l00411"></a>00411           (_expression(),Direction==<a class="code" href="_constants_8h.html#a8ef30fa9c08e08c8706653571f9f5b81a2434cd8c1a594a4cdaa250f86639c600">Vertical</a>?factor:1,Direction==<a class="code" href="_constants_8h.html#a8ef30fa9c08e08c8706653571f9f5b81a7d5f78c516bedc0a066182a6fd606b8b">Horizontal</a>?factor:1);
<a name="l00412"></a>00412     }
<a name="l00413"></a>00413 <span class="comment"></span>
<a name="l00414"></a>00414 <span class="comment">/////////// Artithmetic operators ///////////</span>
<a name="l00415"></a>00415 <span class="comment"></span><span class="comment"></span>
<a name="l00416"></a>00416 <span class="comment">    /** Copies the vector \a other to each subvector of \c *this */</span>
<a name="l00417"></a>00417     <span class="keyword">template</span>&lt;<span class="keyword">typename</span> OtherDerived&gt;
<a name="l00418"></a><a class="code" href="class_vectorwise_op.html#a383e06b8e65fb2efd3b4f37cde2f90b4">00418</a>     ExpressionType&amp; operator=(<span class="keyword">const</span> <a class="code" href="class_dense_base.html" title="Base class for all dense matrices, vectors, and arrays.">DenseBase&lt;OtherDerived&gt;</a>&amp; other)
<a name="l00419"></a>00419     {
<a name="l00420"></a>00420       <a class="code" href="_static_assert_8h.html#ac04a73705a0aa1d66c4b80f6338db904">EIGEN_STATIC_ASSERT_VECTOR_ONLY</a>(OtherDerived)
<a name="l00421"></a>00421       <span class="comment">//eigen_assert((m_matrix.isNull()) == (other.isNull())); FIXME</span>
<a name="l00422"></a>00422       <span class="keywordflow">for</span>(<a class="code" href="class_vectorwise_op.html#a97eff6b62df16580881d4d9b6310fff9">Index</a> j=0; j&lt;subVectors(); ++j)
<a name="l00423"></a>00423         subVector(j) = other;
<a name="l00424"></a>00424       <span class="keywordflow">return</span> <span class="keyword">const_cast&lt;</span>ExpressionType&amp;<span class="keyword">&gt;</span>(m_matrix);
<a name="l00425"></a>00425     }
<a name="l00426"></a>00426 <span class="comment"></span>
<a name="l00427"></a>00427 <span class="comment">    /** Adds the vector \a other to each subvector of \c *this */</span>
<a name="l00428"></a>00428     <span class="keyword">template</span>&lt;<span class="keyword">typename</span> OtherDerived&gt;
<a name="l00429"></a><a class="code" href="class_vectorwise_op.html#aca2c4b90f6f896c52454443cdc3f2a6c">00429</a>     ExpressionType&amp; <a class="code" href="namespacemrpt_1_1math.html#a681da18da05e92bd76b70f7a25132e77" title="a+=b (element-wise sum)">operator+=</a>(<span class="keyword">const</span> <a class="code" href="class_dense_base.html" title="Base class for all dense matrices, vectors, and arrays.">DenseBase&lt;OtherDerived&gt;</a>&amp; other)
<a name="l00430"></a>00430     {
<a name="l00431"></a>00431       <a class="code" href="_static_assert_8h.html#ac04a73705a0aa1d66c4b80f6338db904">EIGEN_STATIC_ASSERT_VECTOR_ONLY</a>(OtherDerived)
<a name="l00432"></a>00432       <span class="keywordflow">for</span>(<a class="code" href="class_vectorwise_op.html#a97eff6b62df16580881d4d9b6310fff9">Index</a> j=0; j&lt;subVectors(); ++j)
<a name="l00433"></a>00433         subVector(j) += other.derived();
<a name="l00434"></a>00434       <span class="keywordflow">return</span> <span class="keyword">const_cast&lt;</span>ExpressionType&amp;<span class="keyword">&gt;</span>(m_matrix);
<a name="l00435"></a>00435     }
<a name="l00436"></a>00436 <span class="comment"></span>
<a name="l00437"></a>00437 <span class="comment">    /** Substracts the vector \a other to each subvector of \c *this */</span>
<a name="l00438"></a>00438     <span class="keyword">template</span>&lt;<span class="keyword">typename</span> OtherDerived&gt;
<a name="l00439"></a><a class="code" href="class_vectorwise_op.html#a930309b22ca2cba3d7d4c68c69ac07ad">00439</a>     ExpressionType&amp; operator-=(<span class="keyword">const</span> <a class="code" href="class_dense_base.html" title="Base class for all dense matrices, vectors, and arrays.">DenseBase&lt;OtherDerived&gt;</a>&amp; other)
<a name="l00440"></a>00440     {
<a name="l00441"></a>00441       <a class="code" href="_static_assert_8h.html#ac04a73705a0aa1d66c4b80f6338db904">EIGEN_STATIC_ASSERT_VECTOR_ONLY</a>(OtherDerived)
<a name="l00442"></a>00442       <span class="keywordflow">for</span>(<a class="code" href="class_vectorwise_op.html#a97eff6b62df16580881d4d9b6310fff9">Index</a> j=0; j&lt;subVectors(); ++j)
<a name="l00443"></a>00443         subVector(j) -= other.derived();
<a name="l00444"></a>00444       <span class="keywordflow">return</span> <span class="keyword">const_cast&lt;</span>ExpressionType&amp;<span class="keyword">&gt;</span>(m_matrix);
<a name="l00445"></a>00445     }
<a name="l00446"></a>00446 <span class="comment"></span>
<a name="l00447"></a>00447 <span class="comment">    /** Returns the expression of the sum of the vector \a other to each subvector of \c *this */</span>
<a name="l00448"></a>00448     <span class="keyword">template</span>&lt;<span class="keyword">typename</span> OtherDerived&gt; <a class="code" href="_macros_8h.html#af2b60117c00a6e75812de43bfe7db3b1">EIGEN_STRONG_INLINE</a>
<a name="l00449"></a>00449     <a class="code" href="class_cwise_binary_op.html" title="Generic expression where a coefficient-wise binary operator is applied to two expressions.">CwiseBinaryOp&lt;internal::scalar_sum_op&lt;Scalar&gt;</a>,
<a name="l00450"></a>00450                   ExpressionTypeNestedCleaned,
<a name="l00451"></a>00451                   <span class="keyword">typename</span> <a class="code" href="namespace_architecture.html#a7ae6186419ae33e4d9019df7b18d883e">ExtendedType&lt;OtherDerived&gt;::Type</a>&gt;
<a name="l00452"></a><a class="code" href="class_vectorwise_op.html#a68f6ca2b34fde07f2f6c0f3c3f48ee09">00452</a>     <a class="code" href="namespacemrpt_1_1math.html#ae492c3103a9d255d39e3406c9e2f884f" title="a+b (element-wise sum)">operator+</a>(<span class="keyword">const</span> <a class="code" href="class_dense_base.html" title="Base class for all dense matrices, vectors, and arrays.">DenseBase&lt;OtherDerived&gt;</a>&amp; other)<span class="keyword"> const</span>
<a name="l00453"></a>00453 <span class="keyword">    </span>{
<a name="l00454"></a>00454       <a class="code" href="_static_assert_8h.html#ac04a73705a0aa1d66c4b80f6338db904">EIGEN_STATIC_ASSERT_VECTOR_ONLY</a>(OtherDerived);
<a name="l00455"></a>00455       <span class="keywordflow">return</span> m_matrix + extendedTo(other.derived());
<a name="l00456"></a>00456     }
<a name="l00457"></a>00457 <span class="comment"></span>
<a name="l00458"></a>00458 <span class="comment">    /** Returns the expression of the difference between each subvector of \c *this and the vector \a other */</span>
<a name="l00459"></a>00459     <span class="keyword">template</span>&lt;<span class="keyword">typename</span> OtherDerived&gt;
<a name="l00460"></a>00460     <a class="code" href="class_cwise_binary_op.html" title="Generic expression where a coefficient-wise binary operator is applied to two expressions.">CwiseBinaryOp&lt;internal::scalar_difference_op&lt;Scalar&gt;</a>,
<a name="l00461"></a>00461                   ExpressionTypeNestedCleaned,
<a name="l00462"></a>00462                   <span class="keyword">typename</span> <a class="code" href="namespace_architecture.html#a7ae6186419ae33e4d9019df7b18d883e">ExtendedType&lt;OtherDerived&gt;::Type</a>&gt;
<a name="l00463"></a><a class="code" href="class_vectorwise_op.html#ac727e70ee1d0afa280b88cc51d8056b7">00463</a>     <a class="code" href="namespacemrpt_1_1math.html#a41dd79738f6a27f4b63ee22080eec843" title="Unary minus operator for 3D points.">operator-</a>(<span class="keyword">const</span> <a class="code" href="class_dense_base.html" title="Base class for all dense matrices, vectors, and arrays.">DenseBase&lt;OtherDerived&gt;</a>&amp; other)<span class="keyword"> const</span>
<a name="l00464"></a>00464 <span class="keyword">    </span>{
<a name="l00465"></a>00465       <a class="code" href="_static_assert_8h.html#ac04a73705a0aa1d66c4b80f6338db904">EIGEN_STATIC_ASSERT_VECTOR_ONLY</a>(OtherDerived);
<a name="l00466"></a>00466       <span class="keywordflow">return</span> m_matrix - extendedTo(other.derived());
<a name="l00467"></a>00467     }
<a name="l00468"></a>00468 <span class="comment"></span>
<a name="l00469"></a>00469 <span class="comment">/////////// Geometry module ///////////</span>
<a name="l00470"></a>00470 <span class="comment"></span>
<a name="l00471"></a>00471     <a class="code" href="class_homogeneous.html">Homogeneous&lt;ExpressionType,Direction&gt;</a> homogeneous() <span class="keyword">const</span>;
<a name="l00472"></a>00472 
<a name="l00473"></a><a class="code" href="class_vectorwise_op.html#a33136b2e478c971d04f8caadaefbf8e5">00473</a>     <span class="keyword">typedef</span> <span class="keyword">typename</span> ExpressionType::PlainObject <a class="code" href="class_vectorwise_op.html#a33136b2e478c971d04f8caadaefbf8e5">CrossReturnType</a>;
<a name="l00474"></a>00474     <span class="keyword">template</span>&lt;<span class="keyword">typename</span> OtherDerived&gt;
<a name="l00475"></a>00475     <span class="keyword">const</span> <a class="code" href="class_vectorwise_op.html#a33136b2e478c971d04f8caadaefbf8e5">CrossReturnType</a> cross(<span class="keyword">const</span> <a class="code" href="class_matrix_base.html" title="Base class for all dense matrices, vectors, and expressions.">MatrixBase&lt;OtherDerived&gt;</a>&amp; other) <span class="keyword">const</span>;
<a name="l00476"></a>00476 
<a name="l00477"></a>00477     <span class="keyword">enum</span> {
<a name="l00478"></a><a class="code" href="class_vectorwise_op.html#a2fede9096318654af1b498d7448ee299af5cb89f6e78173d227fa34fdeb7aa8c7">00478</a>       HNormalized_Size = Direction==<a class="code" href="_constants_8h.html#a8ef30fa9c08e08c8706653571f9f5b81a2434cd8c1a594a4cdaa250f86639c600">Vertical</a> ? internal::traits&lt;ExpressionType&gt;::RowsAtCompileTime
<a name="l00479"></a>00479                                              : internal::traits&lt;ExpressionType&gt;::ColsAtCompileTime,
<a name="l00480"></a><a class="code" href="class_vectorwise_op.html#a2fede9096318654af1b498d7448ee299ad267a79b0ad9113359cd23e28d1307bd">00480</a>       HNormalized_SizeMinusOne = HNormalized_Size==<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> ? <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> : HNormalized_Size-1
<a name="l00481"></a>00481     };
<a name="l00482"></a>00482     <span class="keyword">typedef</span> <a class="code" href="class_block.html" title="Expression of a fixed-size or dynamic-size block.">Block</a>&lt;<span class="keyword">const</span> ExpressionType,
<a name="l00483"></a>00483                   Direction==<a class="code" href="_constants_8h.html#a8ef30fa9c08e08c8706653571f9f5b81a2434cd8c1a594a4cdaa250f86639c600">Vertical</a>   ? int(HNormalized_SizeMinusOne)
<a name="l00484"></a>00484                                         : int(internal::traits&lt;ExpressionType&gt;::RowsAtCompileTime),
<a name="l00485"></a>00485                   Direction==<a class="code" href="_constants_8h.html#a8ef30fa9c08e08c8706653571f9f5b81a7d5f78c516bedc0a066182a6fd606b8b">Horizontal</a> ? int(HNormalized_SizeMinusOne)
<a name="l00486"></a>00486                                         : int(internal::traits&lt;ExpressionType&gt;::ColsAtCompileTime)&gt;
<a name="l00487"></a><a class="code" href="class_vectorwise_op.html#a739d88a6e3c97170aaa6d1c7ffb8d27d">00487</a>             <a class="code" href="class_block.html" title="Expression of a fixed-size or dynamic-size block.">HNormalized_Block</a>;
<a name="l00488"></a>00488     <span class="keyword">typedef</span> <a class="code" href="class_block.html" title="Expression of a fixed-size or dynamic-size block.">Block</a>&lt;<span class="keyword">const</span> ExpressionType,
<a name="l00489"></a>00489                   Direction==<a class="code" href="_constants_8h.html#a8ef30fa9c08e08c8706653571f9f5b81a2434cd8c1a594a4cdaa250f86639c600">Vertical</a>   ? 1 : int(internal::traits&lt;ExpressionType&gt;::RowsAtCompileTime),
<a name="l00490"></a>00490                   Direction==<a class="code" href="_constants_8h.html#a8ef30fa9c08e08c8706653571f9f5b81a7d5f78c516bedc0a066182a6fd606b8b">Horizontal</a> ? 1 : int(internal::traits&lt;ExpressionType&gt;::ColsAtCompileTime)&gt;
<a name="l00491"></a><a class="code" href="class_vectorwise_op.html#a22241b54f15bfe5e48b806fff2b5b6da">00491</a>             <a class="code" href="class_vectorwise_op.html#a22241b54f15bfe5e48b806fff2b5b6da">HNormalized_Factors</a>;
<a name="l00492"></a>00492     <span class="keyword">typedef</span> <a class="code" href="class_cwise_binary_op.html" title="Generic expression where a coefficient-wise binary operator is applied to two expressions.">CwiseBinaryOp&lt;internal::scalar_quotient_op&lt;typename internal::traits&lt;ExpressionType&gt;::Scalar</a>&gt;,
<a name="l00493"></a>00493                 <a class="code" href="class_block.html" title="Expression of a fixed-size or dynamic-size block.">HNormalized_Block</a>,
<a name="l00494"></a>00494                 <a class="code" href="class_replicate.html" title="Expression of the multiple replication of a matrix or vector.">Replicate</a>&lt;<a class="code" href="class_block.html" title="Expression of a fixed-size or dynamic-size block.">HNormalized_Factors</a>,
<a name="l00495"></a>00495                   Direction==<a class="code" href="_constants_8h.html#a8ef30fa9c08e08c8706653571f9f5b81a2434cd8c1a594a4cdaa250f86639c600">Vertical</a>   ? HNormalized_SizeMinusOne : 1,
<a name="l00496"></a>00496                   Direction==<a class="code" href="_constants_8h.html#a8ef30fa9c08e08c8706653571f9f5b81a7d5f78c516bedc0a066182a6fd606b8b">Horizontal</a> ? HNormalized_SizeMinusOne : 1&gt; &gt;
<a name="l00497"></a><a class="code" href="class_vectorwise_op.html#aa49c9ed7b0b9229d0b34ad3f83f8db84">00497</a>             <a class="code" href="class_vectorwise_op.html#aa49c9ed7b0b9229d0b34ad3f83f8db84">HNormalizedReturnType</a>;
<a name="l00498"></a>00498 
<a name="l00499"></a>00499     <span class="keyword">const</span> <a class="code" href="class_cwise_binary_op.html" title="Generic expression where a coefficient-wise binary operator is applied to two expressions.">HNormalizedReturnType</a> hnormalized() <span class="keyword">const</span>;
<a name="l00500"></a>00500 
<a name="l00501"></a>00501   <span class="keyword">protected</span>:
<a name="l00502"></a><a class="code" href="class_vectorwise_op.html#afa06b572c282eb97e31b9aa1cab123d9">00502</a>     <a class="code" href="class_cwise_unary_op.html" title="Generic expression where a coefficient-wise unary operator is applied to an expression.">ExpressionTypeNested</a> <a class="code" href="class_vectorwise_op.html#afa06b572c282eb97e31b9aa1cab123d9">m_matrix</a>;
<a name="l00503"></a>00503 };
<a name="l00504"></a>00504 <span class="comment"></span>
<a name="l00505"></a>00505 <span class="comment">/** \returns a VectorwiseOp wrapper of *this providing additional partial reduction operations</span>
<a name="l00506"></a>00506 <span class="comment">  *</span>
<a name="l00507"></a>00507 <span class="comment">  * Example: \include MatrixBase_colwise.cpp</span>
<a name="l00508"></a>00508 <span class="comment">  * Output: \verbinclude MatrixBase_colwise.out</span>
<a name="l00509"></a>00509 <span class="comment">  *</span>
<a name="l00510"></a>00510 <span class="comment">  * \sa rowwise(), class VectorwiseOp</span>
<a name="l00511"></a>00511 <span class="comment">  */</span>
<a name="l00512"></a>00512 <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Derived&gt;
<a name="l00513"></a>00513 <span class="keyword">inline</span> <span class="keyword">const</span> <span class="keyword">typename</span> <a class="code" href="class_vectorwise_op.html" title="Pseudo expression providing partial reduction operations.">DenseBase&lt;Derived&gt;::ConstColwiseReturnType</a>
<a name="l00514"></a><a class="code" href="class_dense_base.html#aa2703c82bd57872537560fdff48e8012">00514</a> <a class="code" href="class_dense_base.html" title="Base class for all dense matrices, vectors, and arrays.">DenseBase&lt;Derived&gt;::colwise</a>()<span class="keyword"> const</span>
<a name="l00515"></a>00515 <span class="keyword"></span>{
<a name="l00516"></a>00516   <span class="keywordflow">return</span> derived();
<a name="l00517"></a>00517 }
<a name="l00518"></a>00518 <span class="comment"></span>
<a name="l00519"></a>00519 <span class="comment">/** \returns a writable VectorwiseOp wrapper of *this providing additional partial reduction operations</span>
<a name="l00520"></a>00520 <span class="comment">  *</span>
<a name="l00521"></a>00521 <span class="comment">  * \sa rowwise(), class VectorwiseOp</span>
<a name="l00522"></a>00522 <span class="comment">  */</span>
<a name="l00523"></a>00523 <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Derived&gt;
<a name="l00524"></a>00524 <span class="keyword">inline</span> <span class="keyword">typename</span> <a class="code" href="class_vectorwise_op.html" title="Pseudo expression providing partial reduction operations.">DenseBase&lt;Derived&gt;::ColwiseReturnType</a>
<a name="l00525"></a><a class="code" href="class_dense_base.html#a39acd2eb18f4cb8d9eb485cd683c321e">00525</a> <a class="code" href="class_dense_base.html" title="Base class for all dense matrices, vectors, and arrays.">DenseBase&lt;Derived&gt;::colwise</a>()
<a name="l00526"></a>00526 {
<a name="l00527"></a>00527   <span class="keywordflow">return</span> derived();
<a name="l00528"></a>00528 }
<a name="l00529"></a>00529 <span class="comment"></span>
<a name="l00530"></a>00530 <span class="comment">/** \returns a VectorwiseOp wrapper of *this providing additional partial reduction operations</span>
<a name="l00531"></a>00531 <span class="comment">  *</span>
<a name="l00532"></a>00532 <span class="comment">  * Example: \include MatrixBase_rowwise.cpp</span>
<a name="l00533"></a>00533 <span class="comment">  * Output: \verbinclude MatrixBase_rowwise.out</span>
<a name="l00534"></a>00534 <span class="comment">  *</span>
<a name="l00535"></a>00535 <span class="comment">  * \sa colwise(), class VectorwiseOp</span>
<a name="l00536"></a>00536 <span class="comment">  */</span>
<a name="l00537"></a>00537 <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Derived&gt;
<a name="l00538"></a>00538 <span class="keyword">inline</span> <span class="keyword">const</span> <span class="keyword">typename</span> <a class="code" href="class_vectorwise_op.html" title="Pseudo expression providing partial reduction operations.">DenseBase&lt;Derived&gt;::ConstRowwiseReturnType</a>
<a name="l00539"></a><a class="code" href="class_dense_base.html#a9f2c2d576be65a61cbd3917e2527b407">00539</a> <a class="code" href="class_dense_base.html" title="Base class for all dense matrices, vectors, and arrays.">DenseBase&lt;Derived&gt;::rowwise</a>()<span class="keyword"> const</span>
<a name="l00540"></a>00540 <span class="keyword"></span>{
<a name="l00541"></a>00541   <span class="keywordflow">return</span> derived();
<a name="l00542"></a>00542 }
<a name="l00543"></a>00543 <span class="comment"></span>
<a name="l00544"></a>00544 <span class="comment">/** \returns a writable VectorwiseOp wrapper of *this providing additional partial reduction operations</span>
<a name="l00545"></a>00545 <span class="comment">  *</span>
<a name="l00546"></a>00546 <span class="comment">  * \sa colwise(), class VectorwiseOp</span>
<a name="l00547"></a>00547 <span class="comment">  */</span>
<a name="l00548"></a>00548 <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Derived&gt;
<a name="l00549"></a>00549 <span class="keyword">inline</span> <span class="keyword">typename</span> <a class="code" href="class_vectorwise_op.html" title="Pseudo expression providing partial reduction operations.">DenseBase&lt;Derived&gt;::RowwiseReturnType</a>
<a name="l00550"></a><a class="code" href="class_dense_base.html#a386730aafe66beb7e3efacdd9c1e5d0e">00550</a> <a class="code" href="class_dense_base.html" title="Base class for all dense matrices, vectors, and arrays.">DenseBase&lt;Derived&gt;::rowwise</a>()
<a name="l00551"></a>00551 {
<a name="l00552"></a>00552   <span class="keywordflow">return</span> derived();
<a name="l00553"></a>00553 }
<a name="l00554"></a>00554 
<a name="l00555"></a>00555 <span class="preprocessor">#endif // EIGEN_PARTIAL_REDUX_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>