From 1f4a944064bc42284c33e6b755353d191cf288e8 Mon Sep 17 00:00:00 2001 From: astrojhgu Date: Mon, 15 Dec 2008 07:26:12 +0000 Subject: git-svn-id: file:///home/svn/opt_utilities@1 ed2142bd-67ad-457f-ba7c-d818d4011675 --- models/vecn.hpp | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 models/vecn.hpp (limited to 'models/vecn.hpp') diff --git a/models/vecn.hpp b/models/vecn.hpp new file mode 100644 index 0000000..cac1436 --- /dev/null +++ b/models/vecn.hpp @@ -0,0 +1,62 @@ +#ifndef VECN_HPP +#define VECN_HPP +#include +namespace opt_utilities +{ + template + class vecn + { + public: + T data[n]; + public: + T& operator[](int i) + { + return data[i]; + } + + const T& operator[](int i)const + { + return data[i]; + } + + vecn() + { + for(int i=0;i + std::istream& operator>>(std::istream& is,vecn& p) + { + for(int i=0;i>p[i]; + // std::cout< + std::ostream& operator<<(std::ostream& os,const vecn& p) + { + os<<'['; + for(int i=0;i