File: MAdVector3.h

package info (click to toggle)
madlib 1.3.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,196 kB
  • sloc: cpp: 39,851; sh: 10,041; makefile: 473
file content (71 lines) | stat: -rw-r--r-- 2,160 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// -*- C++ -*-

#ifndef _H_MADVECTOR3
#define _H_MADVECTOR3

#ifdef _HAVE_GMSH_
  
#include "gmsh/SVector3.h"
namespace MAd {
  typedef SVector3 vec3;
}

#else
  
#include "MAdMessage.h"

namespace MAd {

  class MAdVector3
  {
  public:
    MAdVector3() {
      MAdMsgSgl::instance().error(__LINE__,__FILE__,
                                  "Metric not implemented in MAdLib, Gmsh required");
    }
    MAdVector3(double x, double y, double z) {
      MAdMsgSgl::instance().error(__LINE__,__FILE__,
                                  "Metric not implemented in MAdLib, Gmsh required");
    }
    MAdVector3(double v) {
      MAdMsgSgl::instance().error(__LINE__,__FILE__,
                                  "Metric not implemented in MAdLib, Gmsh required");
    }
    MAdVector3(const double *array) {
      MAdMsgSgl::instance().error(__LINE__,__FILE__,
                                  "Metric not implemented in MAdLib, Gmsh required");
    }
    MAdVector3(const MAdVector3& v) {
      MAdMsgSgl::instance().error(__LINE__,__FILE__,
                                  "Metric not implemented in MAdLib, Gmsh required");
    }
    inline double x(void) const { return -1.; }
    inline double y(void) const { return -1.; }
    inline double z(void) const { return -1.; }
    inline double norm() { return -1.; }
    inline double normSq() { return -1.; }
    double normalize() { return -1.; }
    void negate() {}  
    double &operator[](int i){ }
    double operator[](int i) const { return -1.; }
    double &operator()(int i){ }
    double operator()(int i) const { return -1.; }
    MAdVector3 & operator += (const MAdVector3 &a) { return *this; }
    MAdVector3 & operator -= (const MAdVector3 &a) { return *this; }
    MAdVector3 & operator *= (const MAdVector3 &a) { return *this; }
    MAdVector3 & operator *= (const double v) { return *this; }
    MAdVector3 & operator = (double v) { return *this; }
    operator double *() { return NULL; }
    void print(std::string name="") const {}
  };
  
  typedef MAdVector3 vec3;
  
  inline MAdVector3 crossprod(const MAdVector3 &a, const MAdVector3 &b)
  { return MAdVector3(); }

}

#endif

#endif