runPosIC, initializeGlobally

This commit is contained in:
Aik-Siong Koh
2023-05-27 21:43:09 -06:00
parent 6a577c052c
commit 9ddbdca742
139 changed files with 2401 additions and 431 deletions

View File

@@ -10,5 +10,16 @@ namespace MbD {
Vector(size_t count) : Array<T>(count) {}
Vector(size_t count, const T& value) : Array<T>(count, value) {}
Vector(std::initializer_list<T> list) : Array<T>{ list } {}
double dot(std::shared_ptr<Vector<T>> vec);
};
template<typename T>
inline double Vector<T>::dot(std::shared_ptr<Vector<T>> vec)
{
size_t n = this->size();
double answer = 0.0;
for (size_t i = 0; i < n; i++) {
answer += this->at(i) * vec->at(i);
}
return answer;
}
}