All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Row.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_VIEWS_ROW_H_
36 #define _BLAZE_MATH_VIEWS_ROW_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
54 #include <blaze/util/EnableIf.h>
56 #include <blaze/util/Types.h>
57 
58 
59 namespace blaze {
60 
61 //=================================================================================================
62 //
63 // GLOBAL RESTRUCTURING OPERATORS
64 //
65 //=================================================================================================
66 
67 //*************************************************************************************************
79 template< typename MT // Type of the matrix
80  , bool SO > // Storage order
81 inline typename EnableIf< IsMatMatAddExpr<MT>, typename RowExprTrait<MT>::Type >::Type
82  row( const Matrix<MT,SO>& matrix, size_t index )
83 {
85 
86  return row( (~matrix).leftOperand(), index ) + row( (~matrix).rightOperand(), index );
87 }
89 //*************************************************************************************************
90 
91 
92 //*************************************************************************************************
104 template< typename MT // Type of the matrix
105  , bool SO > // Storage order
106 inline typename EnableIf< IsMatMatSubExpr<MT>, typename RowExprTrait<MT>::Type >::Type
107  row( const Matrix<MT,SO>& matrix, size_t index )
108 {
110 
111  return row( (~matrix).leftOperand(), index ) - row( (~matrix).rightOperand(), index );
112 }
114 //*************************************************************************************************
115 
116 
117 //*************************************************************************************************
129 template< typename MT // Type of the matrix
130  , bool SO > // Storage order
131 inline typename EnableIf< IsMatMatMultExpr<MT>, typename RowExprTrait<MT>::Type >::Type
132  row( const Matrix<MT,SO>& matrix, size_t index )
133 {
135 
136  return row( (~matrix).leftOperand(), index ) * (~matrix).rightOperand();
137 }
139 //*************************************************************************************************
140 
141 
142 //*************************************************************************************************
153 template< typename MT // Type of the matrix
154  , bool SO > // Storage order
155 inline typename EnableIf< IsVecTVecMultExpr<MT>, typename RowExprTrait<MT>::Type >::Type
156  row( const Matrix<MT,SO>& matrix, size_t index )
157 {
159 
160  return (~matrix).leftOperand()[index] * (~matrix).rightOperand();
161 }
163 //*************************************************************************************************
164 
165 
166 //*************************************************************************************************
178 template< typename MT // Type of the matrix
179  , bool SO > // Storage order
180 inline typename EnableIf< IsMatScalarMultExpr<MT>, typename RowExprTrait<MT>::Type >::Type
181  row( const Matrix<MT,SO>& matrix, size_t index )
182 {
184 
185  return row( (~matrix).leftOperand(), index ) * (~matrix).rightOperand();
186 }
188 //*************************************************************************************************
189 
190 
191 //*************************************************************************************************
203 template< typename MT // Type of the matrix
204  , bool SO > // Storage order
205 inline typename EnableIf< IsMatScalarDivExpr<MT>, typename RowExprTrait<MT>::Type >::Type
206  row( const Matrix<MT,SO>& matrix, size_t index )
207 {
209 
210  return row( (~matrix).leftOperand(), index ) / (~matrix).rightOperand();
211 }
213 //*************************************************************************************************
214 
215 
216 //*************************************************************************************************
228 template< typename MT // Type of the matrix
229  , bool SO > // Storage order
230 inline typename EnableIf< IsMatAbsExpr<MT>, typename RowExprTrait<MT>::Type >::Type
231  row( const Matrix<MT,SO>& matrix, size_t index )
232 {
234 
235  return abs( row( (~matrix).operand(), index ) );
236 }
238 //*************************************************************************************************
239 
240 
241 //*************************************************************************************************
253 template< typename MT // Type of the matrix
254  , bool SO > // Storage order
255 inline typename EnableIf< IsMatEvalExpr<MT>, typename RowExprTrait<MT>::Type >::Type
256  row( const Matrix<MT,SO>& matrix, size_t index )
257 {
259 
260  return eval( row( (~matrix).operand(), index ) );
261 }
263 //*************************************************************************************************
264 
265 
266 //*************************************************************************************************
278 template< typename MT // Type of the matrix
279  , bool SO > // Storage order
280 inline typename EnableIf< IsMatTransExpr<MT>, typename RowExprTrait<MT>::Type >::Type
281  row( const Matrix<MT,SO>& matrix, size_t index )
282 {
284 
285  return trans( column( (~matrix).operand(), index ) );
286 }
288 //*************************************************************************************************
289 
290 } // namespace blaze
291 
292 #endif
DisableIf< Or< IsComputation< MT >, IsTransExpr< MT > >, DenseColumn< MT > >::Type column(DenseMatrix< MT, SO > &dm, size_t index)
Creating a view on a specific column of the given dense matrix.
Definition: DenseColumn.h:3026
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:446
const DMatAbsExpr< MT, SO > abs(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the absolute values of each single element of dm.
Definition: DMatAbsExpr.h:739
Header file for the IsMatMatAddExpr type trait class.
Header file for the IsMatTransExpr type trait class.
Header file for the IsMatAbsExpr type trait class.
Header file for the IsVecTVecMultExpr type trait class.
Header file for the IsMatMatMultExpr type trait class.
Header file for the IsMatScalarMultExpr type trait class.
Header file for the IsMatEvalExpr type trait class.
Header file for the RowExprTrait class template.
Header file for the EnableIf class template.
Header file for the Matrix base class.
Header file for the IsMatScalarDivExpr type trait class.
DisableIf< Or< IsComputation< MT >, IsTransExpr< MT > >, DenseRow< MT > >::Type row(DenseMatrix< MT, SO > &dm, size_t index)
Creating a view on a specific row of the given dense matrix.
Definition: DenseRow.h:3025
const DMatEvalExpr< MT, SO > eval(const DenseMatrix< MT, SO > &dm)
Forces the evaluation of the given dense matrix expression dm.
Definition: DMatEvalExpr.h:395
Header file for the IsMatMatSubExpr type trait class.
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
Header file for basic type definitions.
Header file for the FunctionTrace class.