#ifndef __AMSCPPNARRAY_HPP__ #define __AMSCPPNARRAY_HPP__ #include #include #include #include #include #include #include namespace ams { namespace narray { typedef int64_t narray_size_t; static const int narray_success = 1; static const int narray_failure = -1; //problem size at which to begin using threaded operations static const narray_size_t narray_thread_sz = 5000; //maximum number of threads to use static const int narray_max_threads = 50; template class narray { public: narray_size_t length; T *data; narray(); narray(const narray& other); narray& operator=(const narray& other); narray& operator=(const std::vector& other); narray(const std::initializer_list initlist); ~narray(); int resize(const narray_size_t newlength); T& operator[](const narray_size_t ind); const T& operator[](const narray_size_t ind) const; T& at(const narray_size_t ind); const T& at(const narray_size_t ind) const; void clear(); //erases all elements, sets size to 0 void setall(const T& val); //sets all elements to val //Comparators //Operations }; void test_narray1(); }; //end namespace narray }; //end namespace ams #include #endif