================ Lösungsvorschlag ================ ==== CODE (type=cc) ============================================================ #ifndef HPC_MATVEC_DENSEVECTOR_H #define HPC_MATVEC_DENSEVECTOR_H 1 #include #include namespace hpc { namespace matvec { template struct DenseVectorConstView; template struct DenseVectorView; template struct DenseVector { typedef T ElementType; typedef I Index; typedef DenseVector NoView; typedef DenseVectorConstView ConstView; typedef DenseVectorView View; DenseVector(Index length) : length(length), inc(1), data(new T[length]) { } ~DenseVector() { delete[] data; } const ElementType & operator()(Index i) const { assert(i struct DenseVectorView { typedef T ElementType; typedef I Index; typedef DenseVector NoView; typedef DenseVectorConstView ConstView; typedef DenseVectorView View; DenseVectorView(Index length, ElementType *data, Index inc) : length(length), inc(inc), data(data) { } const ElementType & operator()(Index i) const { assert(i struct DenseVectorConstView { typedef T ElementType; typedef I Index; typedef DenseVector NoView; typedef DenseVectorConstView ConstView; typedef DenseVectorView View; DenseVectorConstView(Index length, const ElementType *data, Index inc) : length(length), inc(inc), data(data) { } const ElementType & operator()(Index i) const { assert(i doc:index next -> doc:session19/page03 back -> doc:session19/page01