Blaze 3.9
Loading...
Searching...
No Matches
DVecDVecCrossExpr.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_EXPRESSIONS_DVECDVECCROSSEXPR_H_
36#define _BLAZE_MATH_EXPRESSIONS_DVECDVECCROSSEXPR_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
43#include <utility>
44#include <blaze/math/Aliases.h>
56#include <blaze/math/SIMD.h>
63#include <blaze/util/Assert.h>
65#include <blaze/util/mpl/If.h>
66#include <blaze/util/Types.h>
67
68
69namespace blaze {
70
71//=================================================================================================
72//
73// CLASS DVECDVECCROSSEXPR
74//
75//=================================================================================================
76
77//*************************************************************************************************
84template< typename VT1 // Type of the left-hand side dense vector
85 , typename VT2 // Type of the right-hand side dense vector
86 , bool TF > // Transpose flag
88 : public CrossExpr< DenseVector< DVecDVecCrossExpr<VT1,VT2,TF>, TF > >
89 , private Computation
90{
91 private:
92 //**Type definitions****************************************************************************
101 //**********************************************************************************************
102
103 //**Return type evaluation**********************************************************************
105
110 static constexpr bool returnExpr = ( !IsTemporary_v<RN1> && !IsTemporary_v<RN2> );
111
113 using ExprReturnType = decltype( ( std::declval<RN1>() * std::declval<RN2>() ) -
114 ( std::declval<RN1>() * std::declval<RN2>() ) );
115 //**********************************************************************************************
116
117 public:
118 //**Type definitions****************************************************************************
121
124
128
131
134 , const DVecDVecCrossExpr&
135 , const ResultType >;
136
138 using LeftOperand = If_t< IsExpression_v<VT1>, const VT1, const VT1& >;
139
141 using RightOperand = If_t< IsExpression_v<VT2>, const VT2, const VT2& >;
142
145
148 //**********************************************************************************************
149
150 //**ConstIterator class definition**************************************************************
154 {
155 public:
156 //**Type definitions*************************************************************************
157 using IteratorCategory = std::random_access_iterator_tag;
162
163 // STL iterator requirements
169 //*******************************************************************************************
170
171 //**Constructor******************************************************************************
178 inline BLAZE_DEVICE_CALLABLE ConstIterator( const LeftOperand& left, const RightOperand& right, size_t index )
179 : left_ ( left ) // Reference to the left-hand side operand
180 , right_( right ) // Reference to the right-hand side operand
181 , index_( index ) // Index to the current element of the cross product
182 {}
183 //*******************************************************************************************
184
185 //**Addition assignment operator*************************************************************
192 index_ += inc;
193 return *this;
194 }
195 //*******************************************************************************************
196
197 //**Subtraction assignment operator**********************************************************
204 index_ -= dec;
205 return *this;
206 }
207 //*******************************************************************************************
208
209 //**Prefix increment operator****************************************************************
215 ++index_;
216 return *this;
217 }
218 //*******************************************************************************************
219
220 //**Postfix increment operator***************************************************************
226 return ConstIterator( left_, right_, ++index_ );
227 }
228 //*******************************************************************************************
229
230 //**Prefix decrement operator****************************************************************
236 --index_;
237 return *this;
238 }
239 //*******************************************************************************************
240
241 //**Postfix decrement operator***************************************************************
247 return ConstIterator( left_, right_, --index_ );
248 }
249 //*******************************************************************************************
250
251 //**Element access operator******************************************************************
257 BLAZE_INTERNAL_ASSERT( index_ < 3UL, "Invalid vector access index" );
258 if( index_ == 0UL )
259 return left_[1UL] * right_[2UL] - left_[2UL] * right_[1UL];
260 else if( index_ == 1UL )
261 return left_[2UL] * right_[0UL] - left_[0UL] * right_[2UL];
262 else
263 return left_[0UL] * right_[1UL] - left_[1UL] * right_[0UL];
264 }
265 //*******************************************************************************************
266
267 //**Load function****************************************************************************
272 inline auto load() const noexcept {
273 BLAZE_INTERNAL_ASSERT( index_ == 0UL, "Invalid vector access index" );
274 LT x( serial( left_ ) ); // Evaluation of the left-hand side dense vector operand
275 RT y( serial( right_ ) ); // Evaluation of the right-hand side dense vector operand
276 return setall( x[1UL] * y[2UL] - x[2UL] * y[1UL]
277 , x[2UL] * y[0UL] - x[0UL] * y[2UL]
278 , x[0UL] * y[1UL] - x[1UL] * y[0UL] );
279 }
280 //*******************************************************************************************
281
282 //**Equality operator************************************************************************
288 inline BLAZE_DEVICE_CALLABLE bool operator==( const ConstIterator& rhs ) const {
289 return index_ == rhs.index_;
290 }
291 //*******************************************************************************************
292
293 //**Inequality operator**********************************************************************
299 inline BLAZE_DEVICE_CALLABLE bool operator!=( const ConstIterator& rhs ) const {
300 return index_ != rhs.index_;
301 }
302 //*******************************************************************************************
303
304 //**Less-than operator***********************************************************************
310 inline BLAZE_DEVICE_CALLABLE bool operator<( const ConstIterator& rhs ) const {
311 return index_ < rhs.index_;
312 }
313 //*******************************************************************************************
314
315 //**Greater-than operator********************************************************************
321 inline BLAZE_DEVICE_CALLABLE bool operator>( const ConstIterator& rhs ) const {
322 return index_ > rhs.index_;
323 }
324 //*******************************************************************************************
325
326 //**Less-or-equal-than operator**************************************************************
332 inline BLAZE_DEVICE_CALLABLE bool operator<=( const ConstIterator& rhs ) const {
333 return index_ <= rhs.index_;
334 }
335 //*******************************************************************************************
336
337 //**Greater-or-equal-than operator***********************************************************
343 inline BLAZE_DEVICE_CALLABLE bool operator>=( const ConstIterator& rhs ) const {
344 return index_ >= rhs.index_;
345 }
346 //*******************************************************************************************
347
348 //**Subtraction operator*********************************************************************
355 return index_ - rhs.index_;
356 }
357 //*******************************************************************************************
358
359 //**Addition operator************************************************************************
366 friend inline BLAZE_DEVICE_CALLABLE const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
367 return ConstIterator( it.left_, it.right_, it.index_ + inc );
368 }
369 //*******************************************************************************************
370
371 //**Addition operator************************************************************************
378 friend inline BLAZE_DEVICE_CALLABLE const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
379 return ConstIterator( it.left_, it.right_, it.index_ + inc );
380 }
381 //*******************************************************************************************
382
383 //**Subtraction operator*********************************************************************
390 friend inline BLAZE_DEVICE_CALLABLE const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
391 return ConstIterator( it.left_, it.right_, it.index_ - dec );
392 }
393 //*******************************************************************************************
394
395 private:
396 //**Member variables*************************************************************************
399 size_t index_;
400 //*******************************************************************************************
401 };
402 //**********************************************************************************************
403
404 //**Compilation flags***************************************************************************
406 static constexpr bool simdEnabled = ( SIMDTrait<ElementType>::size >= 3UL );
407
409 static constexpr bool smpAssignable = false;
410 //**********************************************************************************************
411
412 //**Constructor*********************************************************************************
418 inline DVecDVecCrossExpr( const VT1& lhs, const VT2& rhs ) noexcept
419 : lhs_( lhs ) // Left-hand side dense vector of the cross product expression
420 , rhs_( rhs ) // Right-hand side dense vector of the cross product expression
421 {
422 BLAZE_INTERNAL_ASSERT( lhs.size() == 3UL, "Invalid vector size" );
423 BLAZE_INTERNAL_ASSERT( rhs.size() == 3UL, "Invalid vector size" );
424 }
425 //**********************************************************************************************
426
427 //**Subscript operator**************************************************************************
433 inline ReturnType operator[]( size_t index ) const {
434 BLAZE_INTERNAL_ASSERT( index < 3UL, "Invalid vector access index" );
435
436 if( index == 0UL )
437 return lhs_[1UL] * rhs_[2UL] - lhs_[2UL] * rhs_[1UL];
438 else if( index == 1UL )
439 return lhs_[2UL] * rhs_[0UL] - lhs_[0UL] * rhs_[2UL];
440 else
441 return lhs_[0UL] * rhs_[1UL] - lhs_[1UL] * rhs_[0UL];
442 }
443 //**********************************************************************************************
444
445 //**At function*********************************************************************************
452 inline ReturnType at( size_t index ) const {
453 if( index >= 3UL ) {
454 BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
455 }
456 return (*this)[index];
457 }
458 //**********************************************************************************************
459
460 //**Load function*******************************************************************************
466 BLAZE_ALWAYS_INLINE auto load( size_t index ) const noexcept {
467 BLAZE_INTERNAL_ASSERT( index == 0UL, "Invalid vector access index" );
468 LT x( serial( lhs_ ) ); // Evaluation of the left-hand side dense vector operand
469 RT y( serial( rhs_ ) ); // Evaluation of the right-hand side dense vector operand
470 return setall( x[1UL] * y[2UL] - x[2UL] * y[1UL]
471 , x[2UL] * y[0UL] - x[0UL] * y[2UL]
472 , x[0UL] * y[1UL] - x[1UL] * y[0UL] );
473 }
474 //**********************************************************************************************
475
476 //**Begin function******************************************************************************
481 inline ConstIterator begin() const {
482 return ConstIterator( lhs_, rhs_, 0UL );
483 }
484 //**********************************************************************************************
485
486 //**End function********************************************************************************
491 inline ConstIterator end() const {
492 return ConstIterator( lhs_, rhs_, 3UL );
493 }
494 //**********************************************************************************************
495
496 //**Size function*******************************************************************************
501 constexpr size_t size() const noexcept {
502 return 3UL;
503 }
504 //**********************************************************************************************
505
506 //**Left operand access*************************************************************************
511 inline LeftOperand leftOperand() const noexcept {
512 return lhs_;
513 }
514 //**********************************************************************************************
515
516 //**Right operand access************************************************************************
521 inline RightOperand rightOperand() const noexcept {
522 return rhs_;
523 }
524 //**********************************************************************************************
525
526 //**********************************************************************************************
532 template< typename T >
533 inline bool canAlias( const T* alias ) const noexcept {
534 return ( lhs_.canAlias( alias ) || rhs_.canAlias( alias ) );
535 }
536 //**********************************************************************************************
537
538 //**********************************************************************************************
544 template< typename T >
545 inline bool isAliased( const T* alias ) const noexcept {
546 return ( lhs_.isAliased( alias ) || rhs_.isAliased( alias ) );
547 }
548 //**********************************************************************************************
549
550 private:
551 //**Member variables****************************************************************************
554 //**********************************************************************************************
555
556 //**Assignment to dense vectors*****************************************************************
568 template< typename VT > // Type of the target dense vector
569 friend inline void assign( DenseVector<VT,TF>& lhs, const DVecDVecCrossExpr& rhs )
570 {
572
573 BLAZE_INTERNAL_ASSERT( (*lhs).size() == 3UL, "Invalid vector size" );
574 BLAZE_INTERNAL_ASSERT( (*rhs).size() == 3UL, "Invalid vector size" );
575
576 LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
577 RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense vector operand
578
579 (*lhs)[0] = x[1UL]*y[2UL] - x[2UL]*y[1UL];
580 (*lhs)[1] = x[2UL]*y[0UL] - x[0UL]*y[2UL];
581 (*lhs)[2] = x[0UL]*y[1UL] - x[1UL]*y[0UL];
582 }
584 //**********************************************************************************************
585
586 //**Assignment to sparse vectors****************************************************************
598 template< typename VT > // Type of the target sparse vector
599 friend inline void assign( SparseVector<VT,TF>& lhs, const DVecDVecCrossExpr& rhs )
600 {
602
606
607 BLAZE_INTERNAL_ASSERT( (*lhs).size() == 3UL, "Invalid vector size" );
608 BLAZE_INTERNAL_ASSERT( (*rhs).size() == 3UL, "Invalid vector size" );
609
610 const ResultType tmp( serial( rhs ) );
611 assign( *lhs, tmp );
612 }
614 //**********************************************************************************************
615
616 //**Addition assignment to dense vectors********************************************************
628 template< typename VT > // Type of the target dense vector
629 friend inline void addAssign( DenseVector<VT,TF>& lhs, const DVecDVecCrossExpr& rhs )
630 {
632
633 BLAZE_INTERNAL_ASSERT( (*lhs).size() == 3UL, "Invalid vector size" );
634 BLAZE_INTERNAL_ASSERT( (*rhs).size() == 3UL, "Invalid vector size" );
635
636 LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
637 RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense vector operand
638
639 (*lhs)[0] += x[1UL]*y[2UL] - x[2UL]*y[1UL];
640 (*lhs)[1] += x[2UL]*y[0UL] - x[0UL]*y[2UL];
641 (*lhs)[2] += x[0UL]*y[1UL] - x[1UL]*y[0UL];
642 }
644 //**********************************************************************************************
645
646 //**Addition assignment to sparse vectors*******************************************************
647 // No special implementation for the addition assignment to sparse vectors.
648 //**********************************************************************************************
649
650 //**Subtraction assignment to dense vectors*****************************************************
662 template< typename VT > // Type of the target dense vector
663 friend inline void subAssign( DenseVector<VT,TF>& lhs, const DVecDVecCrossExpr& rhs )
664 {
666
667 BLAZE_INTERNAL_ASSERT( (*lhs).size() == 3UL, "Invalid vector size" );
668 BLAZE_INTERNAL_ASSERT( (*rhs).size() == 3UL, "Invalid vector size" );
669
670 LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
671 RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense vector operand
672
673 (*lhs)[0] -= x[1UL]*y[2UL] - x[2UL]*y[1UL];
674 (*lhs)[1] -= x[2UL]*y[0UL] - x[0UL]*y[2UL];
675 (*lhs)[2] -= x[0UL]*y[1UL] - x[1UL]*y[0UL];
676 }
678 //**********************************************************************************************
679
680 //**Subtraction assignment to sparse vectors****************************************************
681 // No special implementation for the subtraction assignment to sparse vectors.
682 //**********************************************************************************************
683
684 //**Multiplication assignment to dense vectors**************************************************
696 template< typename VT > // Type of the target dense vector
697 friend inline void multAssign( DenseVector<VT,TF>& lhs, const DVecDVecCrossExpr& rhs )
698 {
700
701 BLAZE_INTERNAL_ASSERT( (*lhs).size() == 3UL, "Invalid vector size" );
702 BLAZE_INTERNAL_ASSERT( (*rhs).size() == 3UL, "Invalid vector size" );
703
704 LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
705 RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense vector operand
706
707 (*lhs)[0] *= x[1UL]*y[2UL] - x[2UL]*y[1UL];
708 (*lhs)[1] *= x[2UL]*y[0UL] - x[0UL]*y[2UL];
709 (*lhs)[2] *= x[0UL]*y[1UL] - x[1UL]*y[0UL];
710 }
712 //**********************************************************************************************
713
714 //**Multiplication assignment to sparse vectors*************************************************
715 // No special implementation for the multiplication assignment to sparse vectors.
716 //**********************************************************************************************
717
718 //**Division assignment to dense vectors********************************************************
730 template< typename VT > // Type of the target dense vector
731 friend inline void divAssign( DenseVector<VT,TF>& lhs, const DVecDVecCrossExpr& rhs )
732 {
734
735 BLAZE_INTERNAL_ASSERT( (*lhs).size() == 3UL, "Invalid vector size" );
736 BLAZE_INTERNAL_ASSERT( (*rhs).size() == 3UL, "Invalid vector size" );
737
738 LT x( serial( rhs.lhs_ ) ); // Evaluation of the left-hand side dense vector operand
739 RT y( serial( rhs.rhs_ ) ); // Evaluation of the right-hand side dense vector operand
740
741 (*lhs)[0] /= x[1UL]*y[2UL] - x[2UL]*y[1UL];
742 (*lhs)[1] /= x[2UL]*y[0UL] - x[0UL]*y[2UL];
743 (*lhs)[2] /= x[0UL]*y[1UL] - x[1UL]*y[0UL];
744 }
746 //**********************************************************************************************
747
748 //**Division assignment to sparse vectors*******************************************************
749 // No special implementation for the division assignment to sparse vectors.
750 //**********************************************************************************************
751
752 //**Compile time checks*************************************************************************
759 //**********************************************************************************************
760};
761//*************************************************************************************************
762
763
764
765
766//=================================================================================================
767//
768// GLOBAL BINARY ARITHMETIC OPERATORS
769//
770//=================================================================================================
771
772//*************************************************************************************************
797template< typename VT1 // Type of the left-hand side dense vector
798 , typename VT2 // Type of the right-hand side dense vector
799 , bool TF > // Transpose flag
800inline decltype(auto)
801 operator%( const DenseVector<VT1,TF>& lhs, const DenseVector<VT2,TF>& rhs )
802{
804
805 if( (*lhs).size() != 3UL || (*rhs).size() != 3UL ) {
806 BLAZE_THROW_INVALID_ARGUMENT( "Invalid vector size for cross product" );
807 }
808
809 using ReturnType = const DVecDVecCrossExpr<VT1,VT2,TF>;
810 return ReturnType( *lhs, *rhs );
811}
812//*************************************************************************************************
813
814
815
816
817//=================================================================================================
818//
819// ISPADDED SPECIALIZATIONS
820//
821//=================================================================================================
822
823//*************************************************************************************************
825template< typename VT1, typename VT2, bool TF >
826struct IsPadded< DVecDVecCrossExpr<VT1,VT2,TF> >
827 : public BoolConstant< DVecDVecCrossExpr<VT1,VT2,TF>::simdEnabled >
828{};
830//*************************************************************************************************
831
832} // namespace blaze
833
834#endif
Header file for auxiliary alias declarations.
typename T::ReturnType ReturnType_t
Alias declaration for nested ReturnType type definitions.
Definition Aliases.h:470
typename T::CompositeType CompositeType_t
Alias declaration for nested CompositeType type definitions.
Definition Aliases.h:110
typename T::TransposeType TransposeType_t
Alias declaration for nested TransposeType type definitions.
Definition Aliases.h:550
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.
Definition Aliases.h:190
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.
Definition Aliases.h:450
Header file for run time assertion macros.
Constraint on the transpose flag of vector types.
Header file for the cross product trait.
Header file for the function trace functionality.
Header file for the If class template.
Header file for the IsComputation type trait class.
Header file for the IsExpression type trait class.
Header file for the IsPadded type trait.
Header file for the IsTemporary type trait class.
Deactivation of problematic macros.
Header file for all SIMD functionality.
Iterator over the elements of the dense vector.
Definition DVecDVecCrossExpr.h:154
BLAZE_DEVICE_CALLABLE ConstIterator & operator++()
Pre-increment operator.
Definition DVecDVecCrossExpr.h:214
BLAZE_DEVICE_CALLABLE ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition DVecDVecCrossExpr.h:256
friend BLAZE_DEVICE_CALLABLE const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition DVecDVecCrossExpr.h:366
ElementType * PointerType
Pointer return type.
Definition DVecDVecCrossExpr.h:159
auto load() const noexcept
Access to the SIMD elements of the vector.
Definition DVecDVecCrossExpr.h:272
BLAZE_DEVICE_CALLABLE bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition DVecDVecCrossExpr.h:299
IteratorCategory iterator_category
The iterator category.
Definition DVecDVecCrossExpr.h:164
size_t index_
Index to the current element of the cross product.
Definition DVecDVecCrossExpr.h:399
BLAZE_DEVICE_CALLABLE bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition DVecDVecCrossExpr.h:310
BLAZE_DEVICE_CALLABLE ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition DVecDVecCrossExpr.h:203
ValueType value_type
Type of the underlying elements.
Definition DVecDVecCrossExpr.h:165
ReferenceType reference
Reference return type.
Definition DVecDVecCrossExpr.h:167
BLAZE_DEVICE_CALLABLE ConstIterator(const LeftOperand &left, const RightOperand &right, size_t index)
Constructor for the ConstIterator class.
Definition DVecDVecCrossExpr.h:178
BLAZE_DEVICE_CALLABLE DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition DVecDVecCrossExpr.h:354
BLAZE_DEVICE_CALLABLE bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition DVecDVecCrossExpr.h:321
ElementType & ReferenceType
Reference return type.
Definition DVecDVecCrossExpr.h:160
BLAZE_DEVICE_CALLABLE bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition DVecDVecCrossExpr.h:288
friend BLAZE_DEVICE_CALLABLE const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition DVecDVecCrossExpr.h:378
ElementType ValueType
Type of the underlying elements.
Definition DVecDVecCrossExpr.h:158
ptrdiff_t DifferenceType
Difference between two iterators.
Definition DVecDVecCrossExpr.h:161
BLAZE_DEVICE_CALLABLE const ConstIterator operator++(int)
Post-increment operator.
Definition DVecDVecCrossExpr.h:225
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition DVecDVecCrossExpr.h:157
BLAZE_DEVICE_CALLABLE ConstIterator & operator--()
Pre-decrement operator.
Definition DVecDVecCrossExpr.h:235
DifferenceType difference_type
Difference between two iterators.
Definition DVecDVecCrossExpr.h:168
BLAZE_DEVICE_CALLABLE ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition DVecDVecCrossExpr.h:191
const LeftOperand & left_
Iterator to the current left-hand side element.
Definition DVecDVecCrossExpr.h:397
const RightOperand & right_
Iterator to the current right-hand side element.
Definition DVecDVecCrossExpr.h:398
friend BLAZE_DEVICE_CALLABLE const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition DVecDVecCrossExpr.h:390
BLAZE_DEVICE_CALLABLE const ConstIterator operator--(int)
Post-decrement operator.
Definition DVecDVecCrossExpr.h:246
BLAZE_DEVICE_CALLABLE bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition DVecDVecCrossExpr.h:332
PointerType pointer
Pointer return type.
Definition DVecDVecCrossExpr.h:166
BLAZE_DEVICE_CALLABLE bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition DVecDVecCrossExpr.h:343
Expression object for dense vector-dense vector cross products.
Definition DVecDVecCrossExpr.h:90
If_t< IsComputation_v< VT1 >, const StaticVector< ET1, 3UL, TF >, CT1 > LT
Composite type of the left-hand side dense vector expression.
Definition DVecDVecCrossExpr.h:144
static constexpr bool returnExpr
Compilation switch for the selection of the subscript operator return type.
Definition DVecDVecCrossExpr.h:110
ConstIterator begin() const
Returns an iterator to the first non-zero element of the dense vector.
Definition DVecDVecCrossExpr.h:481
BLAZE_ALWAYS_INLINE auto load(size_t index) const noexcept
Access to the SIMD elements of the vector.
Definition DVecDVecCrossExpr.h:466
ElementType_t< ResultType > ElementType
Resulting element type.
Definition DVecDVecCrossExpr.h:127
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition DVecDVecCrossExpr.h:409
DVecDVecCrossExpr< VT1, VT2, TF > This
Type of this DVecDVecCrossExpr instance.
Definition DVecDVecCrossExpr.h:120
CrossExpr< DenseVector< This, TF > > BaseType
Base type of this DVecDVecCrossExpr instance.
Definition DVecDVecCrossExpr.h:123
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition DVecDVecCrossExpr.h:452
ReturnType_t< VT2 > RN2
Return type of the right-hand side dense vector expression.
Definition DVecDVecCrossExpr.h:96
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition DVecDVecCrossExpr.h:533
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition DVecDVecCrossExpr.h:545
If_t< IsComputation_v< VT2 >, const StaticVector< ET2, 3UL, TF >, CT2 > RT
Composite type of the right-hand side dense vector expression.
Definition DVecDVecCrossExpr.h:147
constexpr size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition DVecDVecCrossExpr.h:501
decltype((std::declval< RN1 >() *std::declval< RN2 >()) -(std::declval< RN1 >() *std::declval< RN2 >())) ExprReturnType
Expression return type for the subscript operator.
Definition DVecDVecCrossExpr.h:113
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense vector operand.
Definition DVecDVecCrossExpr.h:511
ReturnType_t< VT1 > RN1
Return type of the left-hand side dense vector expression.
Definition DVecDVecCrossExpr.h:95
CompositeType_t< VT1 > CT1
Composite type of the left-hand side dense vector expression.
Definition DVecDVecCrossExpr.h:97
ElementType_t< VT1 > ET1
Element type of the left-hand side dense vector expression.
Definition DVecDVecCrossExpr.h:99
static constexpr bool simdEnabled
Compilation switch for the expression template evaluation strategy.
Definition DVecDVecCrossExpr.h:406
If_t< IsExpression_v< VT2 >, const VT2, const VT2 & > RightOperand
Composite type of the right-hand side dense vector expression.
Definition DVecDVecCrossExpr.h:141
LeftOperand lhs_
Left-hand side dense vector of the cross product expression.
Definition DVecDVecCrossExpr.h:552
If_t< IsExpression_v< VT1 >, const VT1, const VT1 & > LeftOperand
Composite type of the left-hand side dense vector expression.
Definition DVecDVecCrossExpr.h:138
RightOperand rhs_
Right-hand side dense vector of the cross product expression.
Definition DVecDVecCrossExpr.h:553
DVecDVecCrossExpr(const VT1 &lhs, const VT2 &rhs) noexcept
Constructor for the DVecDVecCrossExpr class.
Definition DVecDVecCrossExpr.h:418
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition DVecDVecCrossExpr.h:126
const If_t< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition DVecDVecCrossExpr.h:130
ResultType_t< VT1 > RT1
Result type of the left-hand side dense vector expression.
Definition DVecDVecCrossExpr.h:93
CompositeType_t< VT2 > CT2
Composite type of the right-hand side dense vector expression.
Definition DVecDVecCrossExpr.h:98
If_t< !RequiresEvaluation_v< VT1 > &&!RequiresEvaluation_v< VT2 >, const DVecDVecCrossExpr &, const ResultType > CompositeType
Data type for composite expression templates.
Definition DVecDVecCrossExpr.h:133
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition DVecDVecCrossExpr.h:433
ElementType_t< VT2 > ET2
Element type of the right-hand side dense vector expression.
Definition DVecDVecCrossExpr.h:100
CrossTrait_t< RT1, RT2 > ResultType
Result type for expression template evaluations.
Definition DVecDVecCrossExpr.h:125
ResultType_t< VT2 > RT2
Result type of the right-hand side dense vector expression.
Definition DVecDVecCrossExpr.h:94
ConstIterator end() const
Returns an iterator just past the last non-zero element of the dense vector.
Definition DVecDVecCrossExpr.h:491
RightOperand rightOperand() const noexcept
Returns the right-hand side dense vector operand.
Definition DVecDVecCrossExpr.h:521
Base class for N-dimensional dense vectors.
Definition DenseVector.h:77
SIMD characteristics of data types.
Definition SIMDTrait.h:297
Base class for sparse vectors.
Definition SparseVector.h:72
Efficient implementation of a fixed-sized vector.
Definition StaticVector.h:230
Pointer difference type of the Blaze library.
Constraint on the data type.
Constraint on the data type.
Header file for the Computation base class.
Header file for the CrossExpr base class.
Header file for the DenseVector base class.
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition DMatSerialExpr.h:812
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.
Definition RequiresEvaluation.h:81
#define BLAZE_CONSTRAINT_MUST_BE_VECTOR_WITH_TRANSPOSE_FLAG(T, TF)
Constraint on the data type.
Definition TransposeFlag.h:63
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_VECTOR_TYPE(T)
Constraint on the data type.
Definition DenseVector.h:61
typename CrossTrait< T1, T2 >::Type CrossTrait_t
Auxiliary alias declaration for the CrossTrait class template.
Definition CrossTrait.h:138
constexpr bool RequiresEvaluation_v
Auxiliary variable template for the RequiresEvaluation type trait.
Definition RequiresEvaluation.h:91
constexpr bool IsTemporary_v
Auxiliary variable template for the IsTemporary type trait.
Definition IsTemporary.h:88
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition Assert.h:101
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > setall(T v0, Ts... vs) noexcept
Sets all values in a SIMD vector to the given 1-byte integral values.
Definition Setall.h:153
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition Inline.h:85
#define BLAZE_DEVICE_CALLABLE
Conditional macro that sets host and device attributes when compiled with CUDA.
Definition HostDevice.h:94
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.
Definition Exception.h:331
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.
Definition Exception.h:235
#define BLAZE_FUNCTION_TRACE
Function trace macro.
Definition FunctionTrace.h:94
typename If< Condition >::template Type< T1, T2 > If_t
Auxiliary alias template for the If class template.
Definition If.h:108
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.
Definition IntegralConstant.h:110
Header file for the exception macros of the math module.
Constraint on the data type.
Header file for all forward declarations for dense vectors and matrices.
Header file for all forward declarations for expression class templates.
Header file for the serial shim.
Base class for all compute expression templates.
Definition Computation.h:68
Base class for all cross product expression templates.
Definition CrossExpr.h:68
Header file for basic type definitions.