add vectors
This commit is contained in:
@@ -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;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user