Browse Source

add vectors

master
christian 6 years ago
parent
commit
d50a8c9ed9
1 changed files with 25 additions and 0 deletions
  1. +25
    -0
      ws2019/ipi/uebungen/vectors.cc

+ 25
- 0
ws2019/ipi/uebungen/vectors.cc View File

@@ -0,0 +1,25 @@
#include <iostream>
#include <vector>

template <class T, int N>
class Vector {
public:
Vector<T,N> operator+(const Vector<T,N>& y); // Vektoraddition
//T operator*(const Vector<T,n>& y); // Skalarprodukt
private:
std::vector<T> _vector[N];
};

template <class A, int N>
Vector<A,N> Vector<A, N>::operator+(const Vector<B,N>& y) {
//for(int i = 0; i < _vector.last; i++) {
// std::cout << _vector[i] << std::endl;
//}
return y;
}

int main() {
Vector<double, 3> a;
Vector<double, 3> b;
b = a+a;
}

Loading…
Cancel
Save