Subversion Repositories gelsvn

Rev

Rev 12 | Rev 45 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 12 Rev 43
Line 6... Line 6...
6
namespace CGLA {
6
namespace CGLA {
7
 
7
 
8
  template<class T, class V, int N>
8
  template<class T, class V, int N>
9
    class ArithVecFloat: public ArithVec<T,V,N>
9
    class ArithVecFloat: public ArithVec<T,V,N>
10
    {
10
    {
11
#define for_all_i(expr) for(int i=0;i<N;i++) {expr;}
-
 
12
 
-
 
13
    public:
11
    public:
14
	  
12
	  
15
      ArithVecFloat() 
13
      ArithVecFloat() 
16
	{
14
	{
17
#ifndef NDEBUG
15
#ifndef NDEBUG
18
	  for_all_i(data[i]=CGLA_INIT_VALUE);
16
	  std::fill_n(data, N, CGLA_INIT_VALUE);
19
#endif
17
#endif
20
	}
18
	}
21
	  
19
	  
22
      ArithVecFloat(T a): 
20
      ArithVecFloat(T a): 
23
	ArithVec<T,V,N>(a) {}
21
	ArithVec<T,V,N>(a) {}
Line 57... Line 55...
57
  template<class T, class V, int N>
55
  template<class T, class V, int N>
58
    inline V normalize(const ArithVecFloat<T,V,N>& v) 
56
    inline V normalize(const ArithVecFloat<T,V,N>& v) 
59
    {
57
    {
60
      return v/v.length();
58
      return v/v.length();
61
    }
59
    }
62
#undef for_all_i
-
 
63
}
60
}
64
 
61
 
65
#endif
62
#endif
66
 
63