Commit 2e5500e1 by Francois Gygi

Update util/kpgen files

parent c67d4c31
......@@ -17,7 +17,6 @@
// double 3-vectors
//
////////////////////////////////////////////////////////////////////////////////
// $Id: D3vector.h,v 1.8 2008-09-08 15:56:18 fgygi Exp $
#ifndef D3VECTOR_H
#define D3VECTOR_H
......@@ -46,6 +45,14 @@ class D3vector
else return z;
}
double operator[] (const int &i) const
{
assert(i>=0 && i <3);
if ( i == 0 ) return x;
else if ( i == 1 ) return y;
else return z;
}
bool operator==(const D3vector &rhs) const
{
return x == rhs.x && y == rhs.y && z == rhs.z;
......@@ -142,7 +149,7 @@ class D3vector
return sqrt( a.x * a.x + a.y * a.y + a.z * a.z );
}
friend double norm( const D3vector& a )
friend double norm2( const D3vector& a )
{
return a.x * a.x + a.y * a.y + a.z * a.z;
}
......
kpgen: kpgen.cpp D3vector.h
g++ -o $@ $^
g++ -o $@ kpgen.cpp
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment