Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Sacado_MP_Vector_SFS.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Stokhos Package
4 //
5 // Copyright 2009 NTESS and the Stokhos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef SACADO_MP_VECTOR_SFS_HPP
11 #define SACADO_MP_VECTOR_SFS_HPP
12 
13 #include "Stokhos_ConfigDefs.h"
14 
15 #ifdef HAVE_STOKHOS_SACADO
16 
17 //#include "Sacado_MP_Vector.hpp"
19 
20 namespace Sacado {
21 
22  namespace MP {
23 
25  template <typename ordinal_t, typename value_t, int Num, typename device_t>
26  class Vector< Stokhos::StaticFixedStorage<ordinal_t,value_t,Num,device_t> >{
27  public:
28 
31  typedef Storage storage_type;
32 
33  typedef typename storage_type::value_type value_type;
36  typedef typename storage_type::pointer pointer;
37  typedef typename storage_type::volatile_pointer volatile_pointer;
38  typedef typename storage_type::const_pointer const_pointer;
39  typedef typename storage_type::const_volatile_pointer const_volatile_pointer;
40  typedef typename storage_type::reference reference;
41  typedef typename storage_type::volatile_reference volatile_reference;
42  typedef typename storage_type::const_reference const_reference;
43  typedef typename storage_type::const_volatile_reference const_volatile_reference;
44 
45  typedef typename execution_space::memory_space memory_space;
46  typedef typename Stokhos::MemoryTraits<memory_space> MemTraits;
47 
49  typedef typename ScalarType<value_type>::type scalar_type;
50 
52  template < class NewStorageType >
53  struct apply {
54  typedef Vector< NewStorageType > type;
55  };
56 
58  static const int num_args = 1;
59 
60 #if STOKHOS_ALIGN_MEMORY
61  KOKKOS_INLINE_FUNCTION
62  static void* operator new(std::size_t sz) {
63  return MemTraits::alloc(sz);
64  }
65  KOKKOS_INLINE_FUNCTION
66  static void* operator new[](std::size_t sz) {
67  return MemTraits::alloc(sz);
68  }
69  KOKKOS_INLINE_FUNCTION
70  static void* operator new(std::size_t sz, void* ptr) {
71  return ptr;
72  }
73  KOKKOS_INLINE_FUNCTION
74  static void* operator new[](std::size_t sz, void* ptr) {
75  return ptr;
76  }
77  KOKKOS_INLINE_FUNCTION
78  static void operator delete(void* ptr) {
79  MemTraits::free(ptr);
80  }
81  KOKKOS_INLINE_FUNCTION
82  static void operator delete[](void* ptr) {
83  MemTraits::free(ptr);
84  }
85  KOKKOS_INLINE_FUNCTION
86  static void operator delete(void* ptr, void*) {
87  MemTraits::free(ptr);
88  }
89  KOKKOS_INLINE_FUNCTION
90  static void operator delete[](void* ptr, void*) {
91  MemTraits::free(ptr);
92  }
93 #endif
94 
96 
99  KOKKOS_INLINE_FUNCTION
100  Vector() : s(1) {}
101 
103 
106  KOKKOS_INLINE_FUNCTION
107  Vector(const value_type& x) : s(1,x) {}
108 
110 
114  KOKKOS_INLINE_FUNCTION
115  Vector(ordinal_type sz, pointer v, bool owned) : s(sz,v,owned) {}
116 
118 
121  KOKKOS_INLINE_FUNCTION
122  Vector(ordinal_type sz, const value_type& x) : s(sz,x) {}
123 
125  KOKKOS_INLINE_FUNCTION
126  Vector(const storage_type& ss) : s(ss) {}
127 
129  KOKKOS_INLINE_FUNCTION
130  Vector(const Vector& x) : s(x.s) {}
131 
133  KOKKOS_INLINE_FUNCTION
134  Vector(const volatile Vector& x) : s(x.s) {}
135 
137 
140  Vector(std::initializer_list<value_type> l) : s(l.size(), l.begin()) {}
141 
143  KOKKOS_INLINE_FUNCTION
144  ~Vector() {}
145 
147  KOKKOS_INLINE_FUNCTION
148  void init(const value_type& v) { s.init(v); }
149 
151  KOKKOS_INLINE_FUNCTION
152  void init(const value_type& v) volatile { s.init(v); }
153 
155  KOKKOS_INLINE_FUNCTION
156  void init(const value_type* v) { s.init(v); }
157 
159  KOKKOS_INLINE_FUNCTION
160  void init(const value_type* v) volatile { s.init(v); }
161 
163  template <typename S>
164  KOKKOS_INLINE_FUNCTION
165  void init(const Vector<S>& v) {
166  s.init(v.s.coeff(), v.s.size());
167  }
168 
170  template <typename S>
171  KOKKOS_INLINE_FUNCTION
172  void init(const Vector<S>& v) volatile {
173  s.init(v.s.coeff(), v.s.size());
174  }
175 
177  KOKKOS_INLINE_FUNCTION
178  void load(value_type* v) { s.load(v); }
179 
181  KOKKOS_INLINE_FUNCTION
182  void load(value_type* v) volatile { s.load(v); }
183 
185  template <typename S>
186  KOKKOS_INLINE_FUNCTION
187  void load(Vector<S>& v) { s.load(v.s.coeff()); }
188 
190  template <typename S>
191  KOKKOS_INLINE_FUNCTION
192  void load(Vector<S>& v) volatile { s.load(v.s.coeff()); }
193 
195 
198  KOKKOS_INLINE_FUNCTION
199  void reset(ordinal_type sz_new) {}
200 
202 
205  KOKKOS_INLINE_FUNCTION
206  void reset(ordinal_type sz_new) volatile {}
207 
209 
218  KOKKOS_INLINE_FUNCTION
219  void copyForWrite() volatile { }
220 
222  KOKKOS_INLINE_FUNCTION
223  bool isEqualTo(const Vector& x) const {
224  typedef IsEqual<value_type> IE;
225  bool eq = true;
226  for (ordinal_type i=0; i<this->size(); i++)
227  eq = eq && IE::eval(x.coeff(i), this->coeff(i));
228  return eq;
229  }
230 
232  KOKKOS_INLINE_FUNCTION
233  bool isEqualTo(const Vector& x) const volatile {
234  typedef IsEqual<value_type> IE;
235  bool eq = true;
236  for (ordinal_type i=0; i<this->size(); i++)
237  eq = eq && IE::eval(x.coeff(i), this->coeff(i));
238  return eq;
239  }
240 
245 
247  KOKKOS_INLINE_FUNCTION
248  Vector& operator=(const value_type& x) {
249  s.init(x);
250  return *this;
251  }
252 
254  KOKKOS_INLINE_FUNCTION
255  /*volatile*/ Vector& operator=(const value_type& x) volatile {
256  s.init(x);
257  return const_cast<Vector&>(*this);
258  }
259 
261  KOKKOS_INLINE_FUNCTION
262  Vector& operator=(const Vector& x) {
263  if (this != &x) {
264  s = x.s;
265  }
266 
267  return *this;
268  }
269 
271  KOKKOS_INLINE_FUNCTION
272  Vector& operator=(const volatile Vector& x) {
273  if (this != &x) {
274  s = x.s;
275  }
276 
277  return *this;
278  }
279 
281  KOKKOS_INLINE_FUNCTION
282  /*volatile*/ Vector& operator=(const Vector& x) volatile {
283  if (this != &x) {
284  s = x.s;
285  }
286 
287  return const_cast<Vector&>(*this);
288  }
289 
291  KOKKOS_INLINE_FUNCTION
292  /*volatile*/ Vector& operator=(const volatile Vector& x) volatile {
293  if (this != &x) {
294  s = x.s;
295  }
296 
297  return const_cast<Vector&>(*this);
298  }
299 
301 
306  KOKKOS_INLINE_FUNCTION
308  const volatile storage_type& storage() const volatile { return s; }
309 
311  KOKKOS_INLINE_FUNCTION
312  const storage_type& storage() const { return s; }
313 
315  KOKKOS_INLINE_FUNCTION
316  volatile storage_type& storage() volatile { return s; }
317 
319  KOKKOS_INLINE_FUNCTION
320  storage_type& storage() { return s; }
321 
326 
328  KOKKOS_INLINE_FUNCTION
329  const_volatile_reference val() const volatile { return s[0]; }
330 
332  KOKKOS_INLINE_FUNCTION
333  const_reference val() const { return s[0]; }
334 
336  KOKKOS_INLINE_FUNCTION
337  volatile_reference val() volatile { return s[0]; }
338 
340  KOKKOS_INLINE_FUNCTION
341  reference val() { return s[0]; }
342 
344 
349 
351  KOKKOS_INLINE_FUNCTION
352  static ordinal_type size() { return storage_type::size();}
353 
355  KOKKOS_INLINE_FUNCTION
356  static bool hasFastAccess(ordinal_type sz) { return true; }
357 
359  KOKKOS_INLINE_FUNCTION
360  const_pointer coeff() const { return s.coeff();}
361 
363  KOKKOS_INLINE_FUNCTION
364  const_volatile_pointer coeff() const volatile { return s.coeff();}
365 
367  KOKKOS_INLINE_FUNCTION
368  volatile_pointer coeff() volatile { return s.coeff();}
369 
371  KOKKOS_INLINE_FUNCTION
372  pointer coeff() { return s.coeff();}
373 
375  KOKKOS_INLINE_FUNCTION
376  value_type coeff(ordinal_type i) const volatile { return s[i]; }
377 
379  KOKKOS_INLINE_FUNCTION
380  value_type coeff(ordinal_type i) const { return s[i]; }
381 
383  KOKKOS_INLINE_FUNCTION
384  value_type coeff(ordinal_type i) volatile { return s[i]; }
385 
387  KOKKOS_INLINE_FUNCTION
388  value_type coeff(ordinal_type i) { return s[i]; }
389 
391  KOKKOS_INLINE_FUNCTION
392  const_volatile_reference fastAccessCoeff(ordinal_type i) const volatile {
393  return s[i];}
394 
396  KOKKOS_INLINE_FUNCTION
397  const_reference fastAccessCoeff(ordinal_type i) const {
398  return s[i];}
399 
401  KOKKOS_INLINE_FUNCTION
402  volatile_reference fastAccessCoeff(ordinal_type i) volatile {
403  return s[i];}
404 
406  KOKKOS_INLINE_FUNCTION
407  reference fastAccessCoeff(ordinal_type i) {
408  return s[i];}
409 
411  KOKKOS_INLINE_FUNCTION
412  const_volatile_reference operator[](ordinal_type i) const volatile {
413  return s[i];}
414 
416  KOKKOS_INLINE_FUNCTION
417  const_reference operator[](ordinal_type i) const {
418  return s[i];}
419 
421  KOKKOS_INLINE_FUNCTION
422  volatile_reference operator[](ordinal_type i) volatile {
423  return s[i];}
424 
426  KOKKOS_INLINE_FUNCTION
427  reference operator[](ordinal_type i) {
428  return s[i];}
429 
430  template <int i>
431  KOKKOS_INLINE_FUNCTION
432  value_type getCoeff() const volatile {
433  return s.template getCoeff<i>(); }
434 
435  template <int i>
436  KOKKOS_INLINE_FUNCTION
437  value_type getCoeff() const {
438  return s.template getCoeff<i>(); }
439 
440  template <int i>
441  KOKKOS_INLINE_FUNCTION
442  volatile_reference getCoeff() volatile {
443  return s.template getCoeff<i>(); }
444 
445  template <int i>
446  KOKKOS_INLINE_FUNCTION
447  reference getCoeff() {
448  return s.template getCoeff<i>(); }
449 
451  KOKKOS_INLINE_FUNCTION
452  pointer begin() { return s.coeff(); }
453 
455  KOKKOS_INLINE_FUNCTION
456  const_pointer begin() const { return s.coeff(); }
457 
459  KOKKOS_INLINE_FUNCTION
460  volatile_pointer begin() volatile { return s.coeff(); }
461 
463  KOKKOS_INLINE_FUNCTION
464  const_volatile_pointer begin() const volatile { return s.coeff(); }
465 
467  KOKKOS_INLINE_FUNCTION
468  const_pointer cbegin() const { return s.coeff(); }
469 
471  KOKKOS_INLINE_FUNCTION
472  const_volatile_pointer cbegin() const volatile { return s.coeff(); }
473 
475  KOKKOS_INLINE_FUNCTION
476  pointer end() { return s.coeff() + s.size(); }
477 
479  KOKKOS_INLINE_FUNCTION
480  const_pointer end() const { return s.coeff() + s.size(); }
481 
483  KOKKOS_INLINE_FUNCTION
484  volatile_pointer end() volatile { return s.coeff() + s.size(); }
485 
487  KOKKOS_INLINE_FUNCTION
488  const_volatile_pointer end() const volatile { return s.coeff() + s.size(); }
489 
491  KOKKOS_INLINE_FUNCTION
492  const_pointer cend() const { return s.coeff()+ s.size(); }
493 
495  KOKKOS_INLINE_FUNCTION
496  const_volatile_pointer cend() const volatile { return s.coeff()+ s.size(); }
497 
499 
504 
506  KOKKOS_INLINE_FUNCTION
507  Vector& operator += (const value_type& x) {
508 #ifdef STOKHOS_HAVE_PRAGMA_IVDEP
509 #pragma ivdep
510 #endif
511 #ifdef STOKHOS_HAVE_PRAGMA_VECTOR_ALIGNED
512 #pragma vector aligned
513 #endif
514 #ifdef STOKHOS_HAVE_PRAGMA_UNROLL
515 #pragma unroll
516 #endif
517  for (ordinal_type i=0; i<s.size(); i++)
518  s[i] += x;
519  return *this;
520  }
521 
523  KOKKOS_INLINE_FUNCTION
524  Vector& operator += (const volatile value_type& x) {
525 #ifdef STOKHOS_HAVE_PRAGMA_IVDEP
526 #pragma ivdep
527 #endif
528 #ifdef STOKHOS_HAVE_PRAGMA_VECTOR_ALIGNED
529 #pragma vector aligned
530 #endif
531 #ifdef STOKHOS_HAVE_PRAGMA_UNROLL
532 #pragma unroll
533 #endif
534  for (ordinal_type i=0; i<s.size(); i++)
535  s[i] += x;
536  return *this;
537  }
538 
540  KOKKOS_INLINE_FUNCTION
541  /*volatile*/ Vector& operator += (const value_type& x) volatile {
542 #ifdef STOKHOS_HAVE_PRAGMA_IVDEP
543 #pragma ivdep
544 #endif
545 #ifdef STOKHOS_HAVE_PRAGMA_VECTOR_ALIGNED
546 #pragma vector aligned
547 #endif
548 #ifdef STOKHOS_HAVE_PRAGMA_UNROLL
549 #pragma unroll
550 #endif
551  for (ordinal_type i=0; i<s.size(); i++)
552  s[i] += x;
553  return const_cast<Vector&>(*this);
554  }
555 
557  KOKKOS_INLINE_FUNCTION
558  /*volatile*/ Vector& operator += (const volatile value_type& x) volatile {
559 #ifdef STOKHOS_HAVE_PRAGMA_IVDEP
560 #pragma ivdep
561 #endif
562 #ifdef STOKHOS_HAVE_PRAGMA_VECTOR_ALIGNED
563 #pragma vector aligned
564 #endif
565 #ifdef STOKHOS_HAVE_PRAGMA_UNROLL
566 #pragma unroll
567 #endif
568  for (ordinal_type i=0; i<s.size(); i++)
569  s[i] += x;
570  return const_cast<Vector&>(*this);
571  }
572 
574  KOKKOS_INLINE_FUNCTION
575  Vector& operator -= (const value_type& x) {
576 #ifdef STOKHOS_HAVE_PRAGMA_IVDEP
577 #pragma ivdep
578 #endif
579 #ifdef STOKHOS_HAVE_PRAGMA_VECTOR_ALIGNED
580 #pragma vector aligned
581 #endif
582 #ifdef STOKHOS_HAVE_PRAGMA_UNROLL
583 #pragma unroll
584 #endif
585  for (ordinal_type i=0; i<s.size(); i++)
586  s[i] -= x;
587  return *this;
588  }
589 
591  KOKKOS_INLINE_FUNCTION
592  Vector& operator -= (const volatile value_type& x) {
593 #ifdef STOKHOS_HAVE_PRAGMA_IVDEP
594 #pragma ivdep
595 #endif
596 #ifdef STOKHOS_HAVE_PRAGMA_VECTOR_ALIGNED
597 #pragma vector aligned
598 #endif
599 #ifdef STOKHOS_HAVE_PRAGMA_UNROLL
600 #pragma unroll
601 #endif
602  for (ordinal_type i=0; i<s.size(); i++)
603  s[i] -= x;
604  return *this;
605  }
606 
608  KOKKOS_INLINE_FUNCTION
609  /*volatile*/ Vector& operator -= (const value_type& x) volatile {
610 #ifdef STOKHOS_HAVE_PRAGMA_IVDEP
611 #pragma ivdep
612 #endif
613 #ifdef STOKHOS_HAVE_PRAGMA_VECTOR_ALIGNED
614 #pragma vector aligned
615 #endif
616 #ifdef STOKHOS_HAVE_PRAGMA_UNROLL
617 #pragma unroll
618 #endif
619  for (ordinal_type i=0; i<s.size(); i++)
620  s[i] -= x;
621  return const_cast<Vector&>(*this);
622  }
623 
625  KOKKOS_INLINE_FUNCTION
626  /*volatile*/ Vector& operator -= (const volatile value_type& x) volatile {
627 #ifdef STOKHOS_HAVE_PRAGMA_IVDEP
628 #pragma ivdep
629 #endif
630 #ifdef STOKHOS_HAVE_PRAGMA_VECTOR_ALIGNED
631 #pragma vector aligned
632 #endif
633 #ifdef STOKHOS_HAVE_PRAGMA_UNROLL
634 #pragma unroll
635 #endif
636  for (ordinal_type i=0; i<s.size(); i++)
637  s[i] -= x;
638  return const_cast<Vector&>(*this);
639  }
640 
642  KOKKOS_INLINE_FUNCTION
643  Vector& operator *= (const value_type& x) {
644 #ifdef STOKHOS_HAVE_PRAGMA_IVDEP
645 #pragma ivdep
646 #endif
647 #ifdef STOKHOS_HAVE_PRAGMA_VECTOR_ALIGNED
648 #pragma vector aligned
649 #endif
650 #ifdef STOKHOS_HAVE_PRAGMA_UNROLL
651 #pragma unroll
652 #endif
653  for (ordinal_type i=0; i<s.size(); i++)
654  s[i] *= x;
655  return *this;
656  }
657 
659  KOKKOS_INLINE_FUNCTION
660  Vector& operator *= (const volatile value_type& x) {
661 #ifdef STOKHOS_HAVE_PRAGMA_IVDEP
662 #pragma ivdep
663 #endif
664 #ifdef STOKHOS_HAVE_PRAGMA_VECTOR_ALIGNED
665 #pragma vector aligned
666 #endif
667 #ifdef STOKHOS_HAVE_PRAGMA_UNROLL
668 #pragma unroll
669 #endif
670  for (ordinal_type i=0; i<s.size(); i++)
671  s[i] *= x;
672  return *this;
673  }
674 
676  KOKKOS_INLINE_FUNCTION
677  /*volatile*/ Vector& operator *= (const value_type& x) volatile {
678 #ifdef STOKHOS_HAVE_PRAGMA_IVDEP
679 #pragma ivdep
680 #endif
681 #ifdef STOKHOS_HAVE_PRAGMA_VECTOR_ALIGNED
682 #pragma vector aligned
683 #endif
684 #ifdef STOKHOS_HAVE_PRAGMA_UNROLL
685 #pragma unroll
686 #endif
687  for (ordinal_type i=0; i<s.size(); i++)
688  s[i] *= x;
689  return const_cast<Vector&>(*this);
690  }
691 
693  KOKKOS_INLINE_FUNCTION
694  /*volatile*/ Vector& operator *= (const volatile value_type& x) volatile {
695 #ifdef STOKHOS_HAVE_PRAGMA_IVDEP
696 #pragma ivdep
697 #endif
698 #ifdef STOKHOS_HAVE_PRAGMA_VECTOR_ALIGNED
699 #pragma vector aligned
700 #endif
701 #ifdef STOKHOS_HAVE_PRAGMA_UNROLL
702 #pragma unroll
703 #endif
704  for (ordinal_type i=0; i<s.size(); i++)
705  s[i] *= x;
706  return const_cast<Vector&>(*this);
707  }
708 
710  KOKKOS_INLINE_FUNCTION
711  Vector& operator /= (const value_type& x) {
712 #ifdef STOKHOS_HAVE_PRAGMA_IVDEP
713 #pragma ivdep
714 #endif
715 #ifdef STOKHOS_HAVE_PRAGMA_VECTOR_ALIGNED
716 #pragma vector aligned
717 #endif
718 #ifdef STOKHOS_HAVE_PRAGMA_UNROLL
719 #pragma unroll
720 #endif
721  for (ordinal_type i=0; i<s.size(); i++)
722  s[i] /= x;
723  return *this;
724  }
725 
727  KOKKOS_INLINE_FUNCTION
728  Vector& operator /= (const volatile value_type& x) {
729 #ifdef STOKHOS_HAVE_PRAGMA_IVDEP
730 #pragma ivdep
731 #endif
732 #ifdef STOKHOS_HAVE_PRAGMA_VECTOR_ALIGNED
733 #pragma vector aligned
734 #endif
735 #ifdef STOKHOS_HAVE_PRAGMA_UNROLL
736 #pragma unroll
737 #endif
738  for (ordinal_type i=0; i<s.size(); i++)
739  s[i] /= x;
740  return *this;
741  }
742 
744  KOKKOS_INLINE_FUNCTION
745  /*volatile*/ Vector& operator /= (const value_type& x) volatile {
746 #ifdef STOKHOS_HAVE_PRAGMA_IVDEP
747 #pragma ivdep
748 #endif
749 #ifdef STOKHOS_HAVE_PRAGMA_VECTOR_ALIGNED
750 #pragma vector aligned
751 #endif
752 #ifdef STOKHOS_HAVE_PRAGMA_UNROLL
753 #pragma unroll
754 #endif
755  for (ordinal_type i=0; i<s.size(); i++)
756  s[i] /= x;
757  return const_cast<Vector&>(*this);
758  }
759 
761  KOKKOS_INLINE_FUNCTION
762  /*volatile*/ Vector& operator /= (const volatile value_type& x) volatile {
763 #ifdef STOKHOS_HAVE_PRAGMA_IVDEP
764 #pragma ivdep
765 #endif
766 #ifdef STOKHOS_HAVE_PRAGMA_VECTOR_ALIGNED
767 #pragma vector aligned
768 #endif
769 #ifdef STOKHOS_HAVE_PRAGMA_UNROLL
770 #pragma unroll
771 #endif
772  for (ordinal_type i=0; i<s.size(); i++)
773  s[i] /= x;
774  return const_cast<Vector&>(*this);
775  }
776 
778  KOKKOS_INLINE_FUNCTION
779  Vector& operator += (const Vector& x) {
780 #ifdef STOKHOS_HAVE_PRAGMA_IVDEP
781 #pragma ivdep
782 #endif
783 #ifdef STOKHOS_HAVE_PRAGMA_VECTOR_ALIGNED
784 #pragma vector aligned
785 #endif
786 #ifdef STOKHOS_HAVE_PRAGMA_UNROLL
787 #pragma unroll
788 #endif
789  for (ordinal_type i=0; i<s.size(); i++)
790  s[i] += x.fastAccessCoeff(i);
791  return *this;
792  }
793 
795  KOKKOS_INLINE_FUNCTION
796  Vector& operator += (const volatile Vector& x) {
797  *this = *this + x;
798  return *this;
799  }
800 
802  KOKKOS_INLINE_FUNCTION
803  /*volatile*/ Vector& operator += (const Vector& x) volatile {
804  *this = *this + x;
805  return const_cast<Vector&>(*this);
806  }
807 
809  KOKKOS_INLINE_FUNCTION
810  /*volatile*/ Vector& operator += (const volatile Vector& x) volatile {
811  *this = *this + x;
812  return const_cast<Vector&>(*this);
813  }
814 
816  KOKKOS_INLINE_FUNCTION
817  Vector& operator -= (const Vector& x) {
818  *this = *this - x;
819  return *this;
820  }
821 
823  KOKKOS_INLINE_FUNCTION
824  Vector& operator -= (const volatile Vector& x) {
825  *this = *this - x;
826  return *this;
827  }
828 
830  KOKKOS_INLINE_FUNCTION
831  /*volatile*/ Vector& operator -= (const Vector& x) volatile {
832  *this = *this - x;
833  return const_cast<Vector&>(*this);
834  }
835 
837  KOKKOS_INLINE_FUNCTION
838  /*volatile*/ Vector& operator -= (const volatile Vector& x) volatile {
839  *this = *this - x;
840  return const_cast<Vector&>(*this);
841  }
842 
844  KOKKOS_INLINE_FUNCTION
845  Vector& operator *= (const Vector& x) {
846  *this = *this * x;
847  return *this;
848  }
849 
851  KOKKOS_INLINE_FUNCTION
852  Vector& operator *= (const volatile Vector& x) {
853  *this = *this * x;
854  return *this;
855  }
856 
858  KOKKOS_INLINE_FUNCTION
859  /*volatile*/ Vector& operator *= (const Vector& x) volatile {
860  *this = *this * x;
861  return const_cast<Vector&>(*this);
862  }
863 
865  KOKKOS_INLINE_FUNCTION
866  /*volatile*/ Vector& operator *= (const volatile Vector& x) volatile {
867  *this = *this * x;
868  return const_cast<Vector&>(*this);
869  }
870 
872  KOKKOS_INLINE_FUNCTION
873  Vector& operator /= (const Vector& x) {
874  *this = *this / x;
875  return *this;
876  }
877 
879  KOKKOS_INLINE_FUNCTION
880  Vector& operator /= (const volatile Vector& x) {
881  *this = *this / x;
882  return *this;
883  }
884 
886  KOKKOS_INLINE_FUNCTION
887  /*volatile*/ Vector& operator /= (const Vector& x) volatile {
888  *this = *this / x;
889  return const_cast<Vector&>(*this);
890  }
891 
893  KOKKOS_INLINE_FUNCTION
894  /*volatile*/ Vector& operator /= (const volatile Vector& x) volatile {
895  *this = *this / x;
896  return const_cast<Vector&>(*this);
897  }
898 
900  KOKKOS_INLINE_FUNCTION
901  Vector& operator++() {
902  for (ordinal_type i=0; i<s.size(); i++)
903  ++(s[i]);
904  return *this;
905  }
906 
908  KOKKOS_INLINE_FUNCTION
909  volatile Vector& operator++() volatile {
910  for (ordinal_type i=0; i<s.size(); i++)
911  ++(s[i]);
912  return *this;
913  }
914 
916  KOKKOS_INLINE_FUNCTION
917  Vector operator++(int) {
918  Vector tmp(*this);
919  ++(*this);
920  return tmp;
921  }
922 
924  KOKKOS_INLINE_FUNCTION
925  Vector operator++(int) volatile {
926  Vector tmp(*this);
927  ++(*this);
928  return tmp;
929  }
930 
932  KOKKOS_INLINE_FUNCTION
933  Vector& operator--() {
934  for (ordinal_type i=0; i<s.size(); i++)
935  --(s[i]);
936  return *this;
937  }
938 
940  KOKKOS_INLINE_FUNCTION
941  volatile Vector& operator--() volatile {
942  for (ordinal_type i=0; i<s.size(); i++)
943  --(s[i]);
944  return *this;
945  }
946 
948  KOKKOS_INLINE_FUNCTION
949  Vector operator--(int) {
950  Vector tmp(*this);
951  --(*this);
952  return tmp;
953  }
954 
956  KOKKOS_INLINE_FUNCTION
957  Vector operator--(int) volatile {
958  Vector tmp(*this);
959  --(*this);
960  return tmp;
961  }
962 
964 
965  KOKKOS_INLINE_FUNCTION
966  std::string name() const volatile { return "x"; }
967 
968  protected:
969 
970  Storage s;
971 
972  }; // class Vector
973 
974  //------------------------------------------------------------------------
975  //------------------------------------------------------------------------
976 
977  } // namespace MP
978 
979 } // namespace Sacado
980 
982 
983 #endif // HAVE_STOKHOS_SACADO
984 
985 #endif // SACADO_MP_VECTOR_SFS_HPP
Stokhos::StandardStorage< int, double > storage_type
Stokhos::StandardStorage< int, double > Storage
Statically allocated storage class.
Kokkos::DefaultExecutionSpace execution_space
Traits class encapsulting memory alignment.
expr1 expr1 expr1 expr2 expr1 expr1 c expr2 expr1 c fastAccessCoeff(j)-expr2.val(j)
expr val()