xvector6.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "xvector5.h"
4 
5 namespace nmx::gsl::vec {
6 
11 template<class T>
12 class IVProperties : public IGslContainer<T, gsl_vector, 5>
13 {
15 
16 public:
17  //sind alle Elemente 0?
18  inline bool is_null() const { //
19  return gsl_vector_isnull(gsl()) == 1;
20  }
21 
22  //sind alle elemente >0 ?
23  inline bool is_pos() const { //
24  return gsl_vector_ispos(gsl()) == 1;
25  }
26 
27  //sind alle Elemente <0
28  inline bool is_neg() const { //
29  return gsl_vector_isneg(gsl()) == 1;
30  }
31 
32  //sind alle Elemente nicht negativ?
33  inline bool is_nonneg() const { //
34  return gsl_vector_isnonneg(gsl()) == 1;
35  }
36 
43  inline friend bool operator==(const T &v1, const T &v2) {
44  return gsl_vector_equal(v1.gsl(), v2.gsl()) == 1;
45  }
46 
53  inline friend bool operator!=(const T &v1, const T &v2) {
54  return gsl_vector_equal(v1.gsl(), v2.gsl()) != 1;
55  }
56 };
57 
58 } // namespace nmx::gsl::vec
friend bool operator!=(const T &v1, const T &v2)
operator == prüfe ob zwei Vektoren gleich sind
Definition: xvector6.h:53
bool is_nonneg() const
Definition: xvector6.h:33
The IVEqual class Informationen über die Elemente eines Vektors und Vergleichsoperatoren.
Definition: xvector6.h:12
friend bool operator==(const T &v1, const T &v2)
operator == prüfe ob zwei Vektoren gleich sind
Definition: xvector6.h:43
const gsl_vector * gsl() const
ermöglicht direkten Zugriff auf gsl-Funktionen
Definition: xvector0.h:18
The IGslContainer struct Basisklasse für gsl-Vektoren und Matrizen.
Definition: xvector0.h:13