Changeset dfed1c for src/base/index.cpp


Ignore:
Timestamp:
Nov 22, 2011, 9:22:10 PM (14 years ago)
Author:
Julian Iseringhausen <isering@…>
Children:
facba0
Parents:
66f24d
Message:

Major vmg update.

git-svn-id: https://svn.version.fz-juelich.de/scafacos/trunk@1136 5161e1c8-67bf-11de-9fd5-51895aff932f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/base/index.cpp

    r66f24d rdfed1c  
    1414#include "base/vector.hpp"
    1515
    16 using namespace VMG;
     16using VMG::Index;
     17using VMG::Vector;
     18
     19Index::Index(const Index& rhs)
     20{
     21  std::memcpy(this->i, rhs.i, 3*sizeof(int));
     22}
    1723
    1824Index::Index(const Vector& vec)
     
    2329}
    2430
    25 Index::Index(const Stencil::iterator& iter)
    26 {
    27   i[0] = iter->m;
    28   i[1] = iter->n;
    29   i[2] = iter->o;
    30 }
    31 
    32 const Vector Index::operator+(const Vector& rhs) const
     31Vector Index::operator+(const Vector& rhs) const
    3332{
    3433  return Vector(*this) += rhs;
    3534}
    3635
    37 const Vector Index::operator-(const Vector& rhs) const
     36Vector Index::operator-(const Vector& rhs) const
    3837{
    3938  return Vector(*this) -= rhs;
    4039}
    4140
    42 const Vector Index::operator*(const Vector& rhs) const
     41Vector Index::operator*(const Vector& rhs) const
    4342{
    4443  return Vector(*this) *= rhs;
    4544}
    4645
    47 const Vector Index::operator/(const Vector& rhs) const
     46Vector Index::operator/(const Vector& rhs) const
    4847{
    4948  return Vector(*this) /= rhs;
    5049}
    5150
    52 const Vector Index::operator+(const vmg_float& rhs) const
     51Vector Index::operator+(const vmg_float& rhs) const
    5352{
    5453  return Vector(*this) += rhs;
    5554}
    5655
    57 const Vector Index::operator-(const vmg_float& rhs) const
     56Vector Index::operator-(const vmg_float& rhs) const
    5857{
    5958  return Vector(*this) -= rhs;
    6059}
    6160
    62 const Vector Index::operator*(const vmg_float& rhs) const
     61Vector Index::operator*(const vmg_float& rhs) const
    6362{
    6463  return Vector(*this) *= rhs;
    6564}
    6665
    67 const Vector Index::operator/(const vmg_float& rhs) const
     66Vector Index::operator/(const vmg_float& rhs) const
    6867{
    6968  return Vector(*this) /= rhs;
     
    9392}
    9493
    95 std::ostream& operator<<(std::ostream& out, const Index& base)
     94std::ostream& VMG::operator<<(std::ostream& out, const Index& index)
    9695{
    97   return out << "{" << base.X() << " " << base.Y() << " " << base.Z() << "}";
     96  out << "{" << index.X() << " " << index.Y() << " " << index.Z() << "}";
     97
     98  return out;
    9899}
Note: See TracChangeset for help on using the changeset viewer.