vector class
authorRoland Hieber <rhieber@gaffel.ibr.cs.tu-bs.de>
Tue, 12 Jan 2010 23:12:44 +0000 (00:12 +0100)
committerRoland Hieber <rhieber@gaffel.ibr.cs.tu-bs.de>
Tue, 12 Jan 2010 23:12:44 +0000 (00:12 +0100)
.cproject [new file with mode: 0644]
.gitignore [new file with mode: 0644]
.project [new file with mode: 0644]
Vec3f.cxx
Vec3f.hxx

diff --git a/.cproject b/.cproject
new file mode 100644 (file)
index 0000000..571a5eb
--- /dev/null
+++ b/.cproject
@@ -0,0 +1,209 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?>
+
+<cproject>
+<storageModule moduleId="org.eclipse.cdt.core.settings">
+<cconfiguration id="0.2095806474">
+<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="0.2095806474" moduleId="org.eclipse.cdt.core.settings" name="Default">
+<externalSettings/>
+<extensions>
+<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+</extensions>
+</storageModule>
+<storageModule moduleId="cdtBuildSystem" version="4.0.0">
+<configuration artifactName="MicroTrace01" buildProperties="" description="" id="0.2095806474" name="Default" parent="org.eclipse.cdt.build.core.prefbase.cfg">
+<folderInfo id="0.2095806474." name="/" resourcePath="">
+<toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.68488632" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain">
+<targetPlatform id="org.eclipse.cdt.build.core.prefbase.toolchain.68488632.87519969" name=""/>
+<builder id="org.eclipse.cdt.build.core.settings.default.builder.1006486910" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
+<tool id="org.eclipse.cdt.build.core.settings.holder.libs.310036409" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/>
+<tool id="org.eclipse.cdt.build.core.settings.holder.2063093098" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
+<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1249719671" languageId="org.eclipse.cdt.core.assembly" languageName="Assembly" sourceContentType="org.eclipse.cdt.core.asmSource" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
+</tool>
+<tool id="org.eclipse.cdt.build.core.settings.holder.1709318073" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder">
+<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.839936121" languageId="org.eclipse.cdt.core.g++" languageName="GNU C++" sourceContentType="org.eclipse.cdt.core.cxxSource,org.eclipse.cdt.core.cxxHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
+</tool>
+<tool id="org.eclipse.cdt.build.core.settings.holder.103734587" name="GNU C" superClass="org.eclipse.cdt.build.core.settings.holder">
+<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.711344945" languageId="org.eclipse.cdt.core.gcc" languageName="GNU C" sourceContentType="org.eclipse.cdt.core.cSource,org.eclipse.cdt.core.cHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
+</tool>
+</toolChain>
+</folderInfo>
+</configuration>
+</storageModule>
+<storageModule moduleId="scannerConfiguration">
+<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
+<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="makefileGenerator">
+<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<scannerConfigBuildInfo instanceId="0.2095806474">
+<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
+<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="makefileGenerator">
+<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
+<buildOutputProvider>
+<openAction enabled="true" filePath=""/>
+<parser enabled="true"/>
+</buildOutputProvider>
+<scannerInfoProvider id="specsFile">
+<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
+<parser enabled="true"/>
+</scannerInfoProvider>
+</profile>
+</scannerConfigBuildInfo>
+</storageModule>
+<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+</cconfiguration>
+</storageModule>
+<storageModule moduleId="cdtBuildSystem" version="4.0.0">
+<project id="MicroTrace01.null.759633973" name="MicroTrace01"/>
+</storageModule>
+</cproject>
diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..3c86eb8
--- /dev/null
@@ -0,0 +1,2 @@
+*.o
+MicroTrace
diff --git a/.project b/.project
new file mode 100644 (file)
index 0000000..6a4bde3
--- /dev/null
+++ b/.project
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>MicroTrace01</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+                       <triggers>clean,full,incremental,</triggers>
+                       <arguments>
+                               <dictionary>
+                                       <key>?name?</key>
+                                       <value></value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.append_environment</key>
+                                       <value>true</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.autoBuildTarget</key>
+                                       <value>all</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.buildArguments</key>
+                                       <value></value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.buildCommand</key>
+                                       <value>make</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
+                                       <value>clean</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.contents</key>
+                                       <value>org.eclipse.cdt.make.core.activeConfigSettings</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+                                       <value>false</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+                                       <value>true</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.enableFullBuild</key>
+                                       <value>true</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.fullBuildTarget</key>
+                                       <value>all</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.stopOnError</key>
+                                       <value>true</value>
+                               </dictionary>
+                               <dictionary>
+                                       <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+                                       <value>true</value>
+                               </dictionary>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.cdt.core.ccnature</nature>
+               <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+               <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+               <nature>org.eclipse.cdt.core.cnature</nature>
+       </natures>
+</projectDescription>
index c063913..8dfa3d7 100644 (file)
--- a/Vec3f.cxx
+++ b/Vec3f.cxx
 
 #include "Vec3f.hxx"
 
 
 #include "Vec3f.hxx"
 
-Vec3f::Vec3f()
-{
+Vec3f::Vec3f() {
+}
 
 
+Vec3f::Vec3f(float x, float y, float z) {
+       m_values[0] = x;
+       m_values[0] = y;
+       m_values[0] = z;
 }
 
 }
 
-Vec3f::Vec3f(float x, float y, float z)
-{
+Vec3f::~Vec3f() {
+}
 
 
+Vec3f::Vec3f(const Vec3f& o) {
+       for (size_t i = 0; i < DIM; i++) {
+               m_values[i] = o.m_values[i];
+       }
 }
 
 }
 
-Vec3f::~Vec3f()
-{
+Vec3f& Vec3f::operator=(const Vec3f& o) {
+       for (size_t i = 0; i < DIM; i++) {
+               m_values[i] = o.m_values[i];
+       }
+       return *this;
 }
 
 }
 
-Vec3f::Vec3f(const Vec3f& o)
-{
+float Vec3f::operator|(const Vec3f& o) {
 
 
+       return dot(o);
 }
 
 }
 
-Vec3f& 
-Vec3f::operator=(const Vec3f& o)
-{
-  
-  return *this;
+float Vec3f::dot(const Vec3f& o) {
+       float prod = 0;
+       for (size_t i = 0; i < DIM; i++) {
+               prod += m_values[i] * o.m_values[i];
+       }
+       return prod;
 }
 
 }
 
-float 
-Vec3f::operator|(const Vec3f& o)
-{
-  
-  return 0.0f;
+Vec3f Vec3f::operator%(const Vec3f& o) {
+       return cross(o);
 }
 
 }
 
-float 
-Vec3f::dot(const Vec3f& o)
-{
-  
-  return 0.0f;
+Vec3f Vec3f::cross(const Vec3f& o) {
+       return Vec3f(m_values[1] * o.m_values[2] - m_values[2] * o.m_values[1],
+               m_values[2] * o.m_values[0] - m_values[0] * o.m_values[2], m_values[0]
+                       * o.m_values[1] - m_values[1] * o.m_values[0]);
 }
 }
-  
-Vec3f 
-Vec3f::operator%(const Vec3f& o)
-{
 
 
-  return Vec3f();
-}
+void Vec3f::normalize() {
 
 
-Vec3f 
-Vec3f::cross(const Vec3f& o)
-{
-  
-  return Vec3f();
-}
-  
-void 
-Vec3f::normalize()
-{
-  
 }
 
 }
 
-float 
-Vec3f::norm() const
-{
-  return 0.0f;
+float Vec3f::norm() const {
+       return sqrt(m_values[0] * m_values[0] + m_values[1] * m_values[1]
+               + m_values[2] * m_values[2]);
 }
 
 }
 
-Vec3f 
-Vec3f::operator*(const float t) const
-{
-  return Vec3f();
+Vec3f Vec3f::operator*(const float t) const {
+       Vec3f v(*this);
+       return v *= t;
 }
 
 }
 
-Vec3f& 
-Vec3f::operator*=(const float t)
-{
-  return *this;
+Vec3f& Vec3f::operator*=(const float t) {
+    for (unsigned int i = 0; i < 3; ++i) {
+        m_values[i] *= f;
+    }
+       return *this;
 }
 
 }
 
-Vec3f 
-Vec3f::operator/(const float t) const
-{
-  return Vec3f();
+Vec3f Vec3f::operator/(const float t) const {
+       Vec3f v(*this);
+    return v /= f;
 }
 
 }
 
-Vec3f& 
-Vec3f::operator/=(const float t)
-{
-  return *this;
+Vec3f& Vec3f::operator/=(const float t) {
+    for (unsigned int i = 0; i < 3; ++i) {
+        m_values[i] /= f;
+    }
+       return *this;
 }
 
 // example implementation of a standard operator
 }
 
 // example implementation of a standard operator
-Vec3f 
-Vec3f::operator+(const Vec3f& o) const
-{
-  Vec3f v(*this);
-  
-  return v += o;
+Vec3f Vec3f::operator+(const Vec3f& o) const {
+       Vec3f v(*this);
+       return v += o;
 }
 
 // example implementation of an in-place operator
 }
 
 // example implementation of an in-place operator
-Vec3f& 
-Vec3f::operator+=(const Vec3f& o)
-{
-  for(unsigned int i = 0; i < 3; ++i)
-    {
-      m_values[i] += o.m_values[i];
-    }
-  
-  return *this;
+Vec3f& Vec3f::operator+=(const Vec3f& o) {
+       for (unsigned int i = 0; i < 3; ++i) {
+               m_values[i] += o.m_values[i];
+       }
+       return *this;
 }
 }
-  
-Vec3f 
-Vec3f::operator-(const Vec3f& o) const
-{
-  return Vec3f();
+
+Vec3f Vec3f::operator-(const Vec3f& o) const {
+    Vec3f v(*this);
+    return v -= o;
 }
 
 }
 
-Vec3f& 
-Vec3f::operator-=(const Vec3f& o)
-{
-  return *this;
+Vec3f& Vec3f::operator-=(const Vec3f& o) {
+    for (unsigned int i = 0; i < 3; ++i) {
+        m_values[i] -= o.m_values[i];
+    }
+       return *this;
 }
 }
-  
-Vec3f 
-Vec3f::operator*(const Vec3f& o) const
-{
-  return Vec3f();
+
+Vec3f Vec3f::operator*(const Vec3f& o) const {
+    Vec3f v(*this);
+    return v *= o;
 }
 
 }
 
-Vec3f& 
-Vec3f::operator*=(const Vec3f& o)
-{
-  return *this;
+Vec3f& Vec3f::operator*=(const Vec3f& o) {
+    for (unsigned int i = 0; i < 3; ++i) {
+        m_values[i] *= o.m_values[i];
+    }
+       return *this;
 }
 
 }
 
-Vec3f 
-Vec3f::operator/(const Vec3f& o) const
-{
-  return Vec3f();
+Vec3f Vec3f::operator/(const Vec3f& o) const {
+    Vec3f v(*this);
+    return v /= o;
 }
 
 }
 
-Vec3f& 
-Vec3f::operator/=(const Vec3f& o)
-{
-  return *this;
+Vec3f& Vec3f::operator/=(const Vec3f& o) {
+    for (unsigned int i = 0; i < 3; ++i) {
+        m_values[i] /= o.m_values[i];
+    }
+       return *this;
 }
 
 }
 
-float 
-Vec3f::operator[](unsigned int i) const
-{
-  return 0.0f;
+float Vec3f::operator[](unsigned int i) const {
+       assert(i < DIM);
+       return m_values[i];
 }
 
 }
 
-float& 
-Vec3f::operator[](unsigned int i)
-{
-  assert(i < 3);
-  return m_values[i];
+float& Vec3f::operator[](unsigned int i) {
+       assert(i < DIM);
+       return m_values[i];
 }
 }
index 74f304b..7f0c77d 100644 (file)
--- a/Vec3f.hxx
+++ b/Vec3f.hxx
@@ -4,7 +4,6 @@
 #include <cmath>
 #include <iostream>
 
 #include <cmath>
 #include <iostream>
 
-
 #ifndef MIN
 #define MIN(a,b) ((a)<(b)?(a):(b))
 #define MAX(a,b) ((a)>(b)?(a):(b))
 #ifndef MIN
 #define MIN(a,b) ((a)<(b)?(a):(b))
 #define MAX(a,b) ((a)>(b)?(a):(b))
 #define Epsilon 1E-4
 #define Infinity HUGE_VAL
 
 #define Epsilon 1E-4
 #define Infinity HUGE_VAL
 
+// dimension
+#define DIM 3
+
 //! Standard operators and useful methods for 3d vectors
 //! Fill in the missing parts in Vec3f.cxx
 //! Standard operators and useful methods for 3d vectors
 //! Fill in the missing parts in Vec3f.cxx
-class Vec3f 
-{
+class Vec3f {
 public:
 public:
-  Vec3f();
-  Vec3f(float x, float y, float z);
-  
-  ~Vec3f();
-
-  Vec3f(const Vec3f& o);
-  Vec3f& operator=(const Vec3f& o);
-
-  //! dot product
-  float operator|(const Vec3f& o);
-  float dot(const Vec3f& o);
-  
-  //! cross product
-  Vec3f operator%(const Vec3f& o);
-  Vec3f cross(const Vec3f& o);
-  
-  //! normalize vector
-  void normalize();
-  //! length of a vector
-  float norm() const;
-
-  //! (self-)multiply with scalar
-  Vec3f operator*(const float t) const;
-  Vec3f& operator*=(const float t);
-
-  //! (self-)division by scalar
-  Vec3f operator/(const float t) const;
-  Vec3f& operator/=(const float t);
-
-  //! vector (self-)addition
-  Vec3f operator+(const Vec3f& o) const;
-  Vec3f& operator+=(const Vec3f& o);
-  
-  //! vector (self-)subtraction
-  Vec3f operator-(const Vec3f& o) const;
-  Vec3f& operator-=(const Vec3f& o);
-  
-  //! component-wise multiplication of two vectors
-  Vec3f operator*(const Vec3f& o) const;
-  Vec3f& operator*=(const Vec3f& o);
-
-  //! component-wise division of two vectors
-  Vec3f operator/(const Vec3f& o) const;
-  Vec3f& operator/=(const Vec3f& o);
-
-  //! element access functions ( read-only and read-write )
-  float operator[](unsigned int i) const;
-  float& operator[](unsigned int i);
+       Vec3f();
+       Vec3f(float x, float y, float z);
+
+       ~Vec3f();
+
+       Vec3f(const Vec3f& o);
+       Vec3f& operator=(const Vec3f& o);
+
+       //! dot product
+       float operator|(const Vec3f& o);
+       float dot(const Vec3f& o);
+
+       //! cross product
+       Vec3f operator%(const Vec3f& o);
+       Vec3f cross(const Vec3f& o);
+
+       //! normalize vector
+       void normalize();
+       //! length of a vector
+       float norm() const;
+
+       //! (self-)multiply with scalar
+       Vec3f operator*(const float t) const;
+       Vec3f& operator*=(const float t);
+
+       //! (self-)division by scalar
+       Vec3f operator/(const float t) const;
+       Vec3f& operator/=(const float t);
+
+       //! vector (self-)addition
+       Vec3f operator+(const Vec3f& o) const;
+       Vec3f& operator+=(const Vec3f& o);
+
+       //! vector (self-)subtraction
+       Vec3f operator-(const Vec3f& o) const;
+       Vec3f& operator-=(const Vec3f& o);
+
+       //! component-wise multiplication of two vectors
+       Vec3f operator*(const Vec3f& o) const;
+       Vec3f& operator*=(const Vec3f& o);
+
+       //! component-wise division of two vectors
+       Vec3f operator/(const Vec3f& o) const;
+       Vec3f& operator/=(const Vec3f& o);
+
+       //! element access functions ( read-only and read-write )
+       float operator[](unsigned int i) const;
+       float& operator[](unsigned int i);
+
 private:
 private:
-  float m_values[3];
+       float m_values[3];
 };
 
 };
 
-inline std::ostream& operator<<(std::ostream& o, const Vec3f& v)
-{
-  o << "(" << v[0] << "," << v[1] << "," << v[2] << ")";
-  return o;
+inline std::ostream& operator<<(std::ostream& o, const Vec3f& v) {
+       o << "(" << v[0] << "," << v[1] << "," << v[2] << ")";
+       return o;
 }
 
 #endif
 
 }
 
 #endif
 
-
This page took 0.042032 seconds and 4 git commands to generate.