File: v.h

package info (click to toggle)
neartree 3.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,060 kB
  • sloc: cpp: 7,826; ansic: 5,612; makefile: 442
file content (71 lines) | stat: -rw-r--r-- 2,714 bytes parent folder | download | duplicates (5)
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
//*
//*  v.h
//*  NearTree
//*
//*  Copyright 2001, 2008 Larry Andrews.  All rights reserved
//*  Revised 12 Dec 2008 for sourceforge release -- H. J. Bernstein


//**********************************************************************
//*                                                                    *
//* YOU MAY REDISTRIBUTE NearTree UNDER THE TERMS OF THE LGPL          *
//*                                                                    *
//**********************************************************************/

//************************* LGPL NOTICES *******************************
//*                                                                    *
//* This library is free software; you can redistribute it and/or      *
//* modify it under the terms of the GNU Lesser General Public         *
//* License as published by the Free Software Foundation; either       *
//* version 2.1 of the License, or (at your option) any later version. *
//*                                                                    *
//* This library is distributed in the hope that it will be useful,    *
//* but WITHOUT ANY WARRANTY; without even the implied warranty of     *
//* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU  *
//* Lesser General Public License for more details.                    *
//*                                                                    *
//* You should have received a copy of the GNU Lesser General Public   *
//* License along with this library; if not, write to the Free         *
//* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,    *
//* MA  02110-1301  USA                                                *
//*                                                                    *
//**********************************************************************/

// v.h: interface for the v class.
//
// This is just a trivial vector class in 3-space for the purpose
// of demonstrating the nearest neighbor template class. It is not
// designed to do anything important, and, as a consequence, it is
// very incomplete.
//
//  larry andrews, 2001
//
//////////////////////////////////////////////////////////////////////

#if !defined(V_H_INCLUDED)
#define V_H_INCLUDED


// #include <ostream.h>

class v  
{
public:
   v  operator- ( const v& v ) const;
   bool operator< ( const v& v ) const;

   operator double( ) const;
   v  ( const double& da, const double& db, const double& dc );
   v  ( const double& da );
   v  ( );
   ~v ( );
   double Norm( void ) const;

friend std::ostream& operator <<( std::ostream& os, const v& v );

private:
   bool   m_bIsDefined;
   double m_dvec[ 3 ];
};

#endif // !defined(V_H_INCLUDED)