\hypertarget{classSPL_1_1Array1}{}\section{S\+P\+L\+:\+:Array1$<$ T $>$ Class Template Reference}
\label{classSPL_1_1Array1}\index{S\+P\+L\+::\+Array1$<$ T $>$@{S\+P\+L\+::\+Array1$<$ T $>$}}


A one-\/dimensional array class with lazy copying and reference counting.  




{\ttfamily \#include $<$Array1.\+hpp$>$}

\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
typedef T \hyperlink{classSPL_1_1Array1_a311173cccea806c24d7d8c4155b0c242}{Elem\+Type}
\begin{DoxyCompactList}\small\item\em The type of the elements in the array. \end{DoxyCompactList}\item 
typedef std\+::vector$<$ T $>$\+::iterator \hyperlink{classSPL_1_1Array1_afbab541c7454e32410576dfdc58e455a}{Iterator}
\begin{DoxyCompactList}\small\item\em A mutable iterator for the array elements. \end{DoxyCompactList}\item 
typedef std\+::vector$<$ T $>$\+::const\+\_\+iterator \hyperlink{classSPL_1_1Array1_a30bd3b9d88dbb00ecfb51bfc361b45e6}{Const\+Iterator}
\begin{DoxyCompactList}\small\item\em A constant iterator for the array elements. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{group__Array1_ga0329dc52323bbc6979775d165fc80735}{Array1} ()
\begin{DoxyCompactList}\small\item\em Create an empty array. \end{DoxyCompactList}\item 
\hyperlink{group__Array1_ga03dedb6ad081507706a349defc58d0f2}{Array1} (int size)
\begin{DoxyCompactList}\small\item\em Create an array of the specified size. \end{DoxyCompactList}\item 
\hyperlink{group__Array1_gae3e833ff7fadab8d51f2ef4f8db47e16}{Array1} (int size, const T \&value)
\begin{DoxyCompactList}\small\item\em Create an array of the given size with all elements initialized to the specified value. \end{DoxyCompactList}\item 
{\footnotesize template$<$class Input\+Iterator $>$ }\\\hyperlink{classSPL_1_1Array1_a066a9fce553a6fe72ff62c71a1bb9017}{Array1} (int size, Input\+Iterator data)
\begin{DoxyCompactList}\small\item\em Create an array of the specified size with the elements initialized to the data obtained from the given input iterator. \end{DoxyCompactList}\item 
\hyperlink{group__Array1_gad3f47c5c815cdc88370f2ef6683097d6}{Array1} (const \hyperlink{classSPL_1_1Array1}{Array1} \&a)
\begin{DoxyCompactList}\small\item\em Create a copy of an array. \end{DoxyCompactList}\item 
{\footnotesize template$<$class Other\+Type $>$ }\\\hyperlink{classSPL_1_1Array1_af66f76aafe293ef311a8485fd1faf6d6}{Array1} (const \hyperlink{classSPL_1_1Array1}{Array1}$<$ Other\+Type $>$ \&a)
\begin{DoxyCompactList}\small\item\em Create a copy of an array with elements of arbitrary type. \end{DoxyCompactList}\item 
\hyperlink{group__Array1_gad47e1f70d2926a7cd94048a99e9ed0a0}{$\sim$\+Array1} ()
\begin{DoxyCompactList}\small\item\em Destroy an array. \end{DoxyCompactList}\item 
\hyperlink{classSPL_1_1Array1}{Array1} \& \hyperlink{group__Array1_gacb52304faf02457c87eb274f450e7b69}{operator=} (const \hyperlink{classSPL_1_1Array1}{Array1} \&a)
\begin{DoxyCompactList}\small\item\em Assign one array to another. \end{DoxyCompactList}\item 
{\footnotesize template$<$class Other\+Type $>$ }\\\hyperlink{classSPL_1_1Array1}{Array1}$<$ T $>$ \& \hyperlink{group__Array1_ga74d97d88e0d790f0df65ef75d9d78ccc}{operator=} (const \hyperlink{classSPL_1_1Array1}{Array1}$<$ Other\+Type $>$ \&a)
\begin{DoxyCompactList}\small\item\em Assign an array with elements of arbitrary type to another array. \end{DoxyCompactList}\item 
\hyperlink{classSPL_1_1Array1}{Array1} \& \hyperlink{group__Array1_ga781a9c1ae5771f1eeacbd0e3f34511a0}{operator+=} (const \hyperlink{classSPL_1_1Array1}{Array1} \&a)
\begin{DoxyCompactList}\small\item\em Add another array (elementwise) to this array. \end{DoxyCompactList}\item 
\hyperlink{classSPL_1_1Array1}{Array1} \& \hyperlink{group__Array1_ga12c6163fc8a6d666f295504d526065f3}{operator-\/=} (const \hyperlink{classSPL_1_1Array1}{Array1} \&a)
\begin{DoxyCompactList}\small\item\em Subtract another array (elementwise) from this array. \end{DoxyCompactList}\item 
\hyperlink{classSPL_1_1Array1}{Array1} \& \hyperlink{group__Array1_gad241317edc9320696536736752d9f3ce}{operator$\ast$=} (const \hyperlink{classSPL_1_1Array1}{Array1} \&a)
\begin{DoxyCompactList}\small\item\em Multiply another array (elementwise) by this array. \end{DoxyCompactList}\item 
\hyperlink{classSPL_1_1Array1}{Array1} \& \hyperlink{group__Array1_ga88876672f2c621b95482ec592b87ea24}{operator/=} (const \hyperlink{classSPL_1_1Array1}{Array1} \&a)
\begin{DoxyCompactList}\small\item\em Divide this array (elementwise) by another array. \end{DoxyCompactList}\item 
\hyperlink{classSPL_1_1Array1}{Array1} \& \hyperlink{group__Array1_ga376b7afa793be5b86d81a24a7009523a}{operator+=} (const T \&value)
\begin{DoxyCompactList}\small\item\em Add the specified value to each element in the array. \end{DoxyCompactList}\item 
\hyperlink{classSPL_1_1Array1}{Array1} \& \hyperlink{group__Array1_ga3aa0f0810505d743f0991fe82fe8761d}{operator-\/=} (const T \&value)
\begin{DoxyCompactList}\small\item\em Subtract the specified value from each element in the array. \end{DoxyCompactList}\item 
\hyperlink{classSPL_1_1Array1}{Array1} \& \hyperlink{group__Array1_gad8bcb57672ac75987cf2f20b5c553f80}{operator$\ast$=} (const T \&value)
\begin{DoxyCompactList}\small\item\em Multiply each element in the array by the specified value. \end{DoxyCompactList}\item 
\hyperlink{classSPL_1_1Array1}{Array1} \& \hyperlink{group__Array1_gaa2d69f6f67d171915095efd52a915d9c}{operator/=} (const T \&value)
\begin{DoxyCompactList}\small\item\em Divide each element in the array by the specified value. \end{DoxyCompactList}\item 
int \hyperlink{group__Array1_ga40ca1a47b8dcf30c62a077731a446f68}{get\+Size} () const 
\begin{DoxyCompactList}\small\item\em Get the number of elements in the array. \end{DoxyCompactList}\item 
bool \hyperlink{group__Array1_ga8c3e937c2cdb761908e41e7d58314f60}{is\+Shared} () const 
\begin{DoxyCompactList}\small\item\em Is the data for this array shared with another array? \end{DoxyCompactList}\item 
bool \hyperlink{group__Array1_gadd22b0fdab726d8acb97d8c0d70618f9}{is\+Shared\+With} (const \hyperlink{classSPL_1_1Array1}{Array1} \&a) const 
\begin{DoxyCompactList}\small\item\em Is the data for this array shared with the specified array? \end{DoxyCompactList}\item 
T \& \hyperlink{group__Array1_ga7509a822795f412ccf869cc54e667139}{operator()} (int i)
\begin{DoxyCompactList}\small\item\em Get a mutable reference to the specified element in the array. \end{DoxyCompactList}\item 
const T \& \hyperlink{group__Array1_ga4b004d2309d7e55cc94545d7f1afefbb}{operator()} (int i) const 
\begin{DoxyCompactList}\small\item\em Get a const reference to the specified element in the array. \end{DoxyCompactList}\item 
\hyperlink{classSPL_1_1Array1_a30bd3b9d88dbb00ecfb51bfc361b45e6}{Const\+Iterator} \hyperlink{group__Array1_gab950e2f0e0f39aa3474fd7c602c6174c}{begin} () const 
\begin{DoxyCompactList}\small\item\em Get a const iterator referring to the first element in the array. \end{DoxyCompactList}\item 
\hyperlink{classSPL_1_1Array1_afbab541c7454e32410576dfdc58e455a}{Iterator} \hyperlink{group__Array1_gaf0263180ec4b8c33eb1ab0f540de9525}{begin} ()
\begin{DoxyCompactList}\small\item\em Get a mutable iterator referring to the first element in the array. \end{DoxyCompactList}\item 
\hyperlink{classSPL_1_1Array1_a30bd3b9d88dbb00ecfb51bfc361b45e6}{Const\+Iterator} \hyperlink{group__Array1_gab4583857ec2a6f99c7976203f23f5b3c}{end} () const 
\begin{DoxyCompactList}\small\item\em Get a const iterator referring to one past the last element in the array. \end{DoxyCompactList}\item 
\hyperlink{classSPL_1_1Array1_afbab541c7454e32410576dfdc58e455a}{Iterator} \hyperlink{group__Array1_gab92a9511b0ba27f0444f5955dd6e9882}{end} ()
\begin{DoxyCompactList}\small\item\em Get a mutable iterator referring to one past the last element in the array. \end{DoxyCompactList}\item 
void \hyperlink{group__Array1_ga9ab27a6b379cd8c6400a34b4403f5818}{resize} (int size)
\begin{DoxyCompactList}\small\item\em Change the size of the array. \end{DoxyCompactList}\item 
{\footnotesize template$<$class Input\+Iterator $>$ }\\void \hyperlink{group__Array1_ga4c1aefdad8a5faa11d7b2b89a7e1dd9e}{resize} (int size, Input\+Iterator data)
\begin{DoxyCompactList}\small\item\em Change the size of the array, initializing the resized array with the data obtained from the specified input iterator. \end{DoxyCompactList}\item 
T \hyperlink{group__Array1_ga7cdfb394640751daec1292d4541b457a}{max} () const 
\begin{DoxyCompactList}\small\item\em Get the maximum of the elements in the array. \end{DoxyCompactList}\item 
T \hyperlink{group__Array1_ga379859781345122977a941a7ad19b00b}{min} () const 
\begin{DoxyCompactList}\small\item\em Get the minimum of the elements in the array. \end{DoxyCompactList}\item 
T \hyperlink{group__Array1_gabaeafb94e1fcd85c57f5443312e7b24c}{sum} () const 
\begin{DoxyCompactList}\small\item\em Get the sum of the elements in the array. \end{DoxyCompactList}\item 
std\+::ostream \& \hyperlink{group__Array1_ga6fd14fda96835820941fca16712c9408}{output} (std\+::ostream \&out, int field\+Width) const 
\begin{DoxyCompactList}\small\item\em Output an array to a stream with a particular field width to be used for each element. \end{DoxyCompactList}\item 
int \hyperlink{group__Array1_gaddd2f7ebca392e2cc5e93ddbdb7e0a48}{load} (const char $\ast$file\+Name)
\begin{DoxyCompactList}\small\item\em Load an array from the file with the specified name. \end{DoxyCompactList}\item 
int \hyperlink{group__Array1_ga7eca1f2406a90dae0ebd236908e942fc}{save} (const char $\ast$file\+Name) const 
\begin{DoxyCompactList}\small\item\em Save an array to the file with the specified name. \end{DoxyCompactList}\item 
void \hyperlink{group__Array1_ga16e779585bc314916c69ac7f3b64590e}{fill} (const T \&value=T(0))
\begin{DoxyCompactList}\small\item\em Set all elements in the array to the specified value. \end{DoxyCompactList}\item 
void \hyperlink{group__Array1_gadcb9523059aa3af6c82e17f2381afcd4}{swap} (\hyperlink{classSPL_1_1Array1}{Array1} \&a)
\begin{DoxyCompactList}\small\item\em Swap the contents of the array with the contents of another array. \end{DoxyCompactList}\item 
void \hyperlink{group__Array1_gac67176ac375f6644c3b48dfe179eac23}{dump} (std\+::ostream \&out) const 
\begin{DoxyCompactList}\small\item\em Output information about an array to a stream for debugging. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
\subsubsection*{template$<$class T$>$class S\+P\+L\+::\+Array1$<$ T $>$}

A one-\/dimensional array class with lazy copying and reference counting. 

\subsection{Member Typedef Documentation}
\hypertarget{classSPL_1_1Array1_a30bd3b9d88dbb00ecfb51bfc361b45e6}{}\index{S\+P\+L\+::\+Array1@{S\+P\+L\+::\+Array1}!Const\+Iterator@{Const\+Iterator}}
\index{Const\+Iterator@{Const\+Iterator}!S\+P\+L\+::\+Array1@{S\+P\+L\+::\+Array1}}
\subsubsection[{Const\+Iterator}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ typedef std\+::vector$<$T$>$\+::const\+\_\+iterator {\bf S\+P\+L\+::\+Array1}$<$ T $>$\+::{\bf Const\+Iterator}}\label{classSPL_1_1Array1_a30bd3b9d88dbb00ecfb51bfc361b45e6}


A constant iterator for the array elements. 

\hypertarget{classSPL_1_1Array1_a311173cccea806c24d7d8c4155b0c242}{}\index{S\+P\+L\+::\+Array1@{S\+P\+L\+::\+Array1}!Elem\+Type@{Elem\+Type}}
\index{Elem\+Type@{Elem\+Type}!S\+P\+L\+::\+Array1@{S\+P\+L\+::\+Array1}}
\subsubsection[{Elem\+Type}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ typedef T {\bf S\+P\+L\+::\+Array1}$<$ T $>$\+::{\bf Elem\+Type}}\label{classSPL_1_1Array1_a311173cccea806c24d7d8c4155b0c242}


The type of the elements in the array. 

\hypertarget{classSPL_1_1Array1_afbab541c7454e32410576dfdc58e455a}{}\index{S\+P\+L\+::\+Array1@{S\+P\+L\+::\+Array1}!Iterator@{Iterator}}
\index{Iterator@{Iterator}!S\+P\+L\+::\+Array1@{S\+P\+L\+::\+Array1}}
\subsubsection[{Iterator}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ typedef std\+::vector$<$T$>$\+::iterator {\bf S\+P\+L\+::\+Array1}$<$ T $>$\+::{\bf Iterator}}\label{classSPL_1_1Array1_afbab541c7454e32410576dfdc58e455a}


A mutable iterator for the array elements. 



\subsection{Constructor \& Destructor Documentation}
\hypertarget{classSPL_1_1Array1_a066a9fce553a6fe72ff62c71a1bb9017}{}\index{S\+P\+L\+::\+Array1@{S\+P\+L\+::\+Array1}!Array1@{Array1}}
\index{Array1@{Array1}!S\+P\+L\+::\+Array1@{S\+P\+L\+::\+Array1}}
\subsubsection[{Array1}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ template$<$class Input\+Iterator $>$ {\bf S\+P\+L\+::\+Array1}$<$ T $>$\+::{\bf Array1} (
\begin{DoxyParamCaption}
\item[{int}]{size, }
\item[{Input\+Iterator}]{data}
\end{DoxyParamCaption}
)}\label{classSPL_1_1Array1_a066a9fce553a6fe72ff62c71a1bb9017}


Create an array of the specified size with the elements initialized to the data obtained from the given input iterator. 

\hypertarget{classSPL_1_1Array1_af66f76aafe293ef311a8485fd1faf6d6}{}\index{S\+P\+L\+::\+Array1@{S\+P\+L\+::\+Array1}!Array1@{Array1}}
\index{Array1@{Array1}!S\+P\+L\+::\+Array1@{S\+P\+L\+::\+Array1}}
\subsubsection[{Array1}]{\setlength{\rightskip}{0pt plus 5cm}template$<$class T$>$ template$<$class Other\+Type $>$ {\bf S\+P\+L\+::\+Array1}$<$ T $>$\+::{\bf Array1} (
\begin{DoxyParamCaption}
\item[{const {\bf Array1}$<$ Other\+Type $>$ \&}]{a}
\end{DoxyParamCaption}
)}\label{classSPL_1_1Array1_af66f76aafe293ef311a8485fd1faf6d6}


Create a copy of an array with elements of arbitrary type. 

Note\+: The type Other\+Type must be assignable to the type T. 

The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
\hyperlink{Array1_8hpp}{Array1.\+hpp}\end{DoxyCompactItemize}
