<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>HippoDraw Class Library</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> <link rel="shortcut icon" href="hippoApp.ico"> </head><body> <!-- Generated by Doxygen 1.6.2 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li><a href="dirs.html"><span>Directories</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <div class="navpath"><a class="el" href="dir_81660c05fb6bfb5c6c7ef0fee605ba15.html">datasrcs</a> </div> </div> <div class="contents"> <h1>DataColumn.cxx</h1><a href="DataColumn_8cxx.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <a name="l00012"></a>00012 <span class="preprocessor">#include "<a class="code" href="DataColumn_8h.html" title="hippodraw::DataColumn class interface.">DataColumn.h</a>"</span> <a name="l00013"></a>00013 <a name="l00014"></a>00014 <span class="keyword">using</span> std::vector; <a name="l00015"></a>00015 <a name="l00016"></a>00016 <span class="keyword">using namespace </span>hippodraw; <a name="l00017"></a>00017 <a name="l00018"></a>00018 DataColumn:: <a name="l00019"></a><a class="code" href="classhippodraw_1_1DataColumn.html#a8d2ef0651fbeee40ceaf0c56194b2d58">00019</a> DataColumn () <a name="l00020"></a>00020 { <a name="l00021"></a>00021 } <a name="l00022"></a>00022 <a name="l00023"></a>00023 <a class="code" href="classhippodraw_1_1DataColumn.html#a2b45006ad69246f1c78e8b5a84c64e8f" title="The destructor.">DataColumn::</a> <a name="l00024"></a><a class="code" href="classhippodraw_1_1DataColumn.html#a2b45006ad69246f1c78e8b5a84c64e8f">00024</a> <a class="code" href="classhippodraw_1_1DataColumn.html#a2b45006ad69246f1c78e8b5a84c64e8f" title="The destructor.">~DataColumn</a>() <a name="l00025"></a>00025 { <a name="l00026"></a>00026 } <a name="l00027"></a>00027 <a name="l00028"></a>00028 std::vector < double > & <a name="l00029"></a>00029 <a class="code" href="classhippodraw_1_1DataColumn.html#ad4c4c825a2ef6aebcc673b963c1b5caa" title="Returns the data.">DataColumn::</a> <a name="l00030"></a><a class="code" href="classhippodraw_1_1DataColumn.html#ad4c4c825a2ef6aebcc673b963c1b5caa">00030</a> <a class="code" href="classhippodraw_1_1DataColumn.html#ad4c4c825a2ef6aebcc673b963c1b5caa" title="Returns the data.">getData</a> () <a name="l00031"></a>00031 { <a name="l00032"></a>00032 <span class="keywordflow">return</span> <a class="code" href="classhippodraw_1_1DataColumn.html#a4beef6150b8113b6905091edcab101cc" title="The data.">m_double_data</a>; <a name="l00033"></a>00033 } <a name="l00034"></a>00034 <a name="l00035"></a>00035 <span class="keyword">const</span> std::vector < double > & <a name="l00036"></a>00036 <a class="code" href="classhippodraw_1_1DataColumn.html#ad4c4c825a2ef6aebcc673b963c1b5caa" title="Returns the data.">DataColumn::</a> <a name="l00037"></a><a class="code" href="classhippodraw_1_1DataColumn.html#adce10dd460a1ee887ee75ea6d9e9f8e2">00037</a> <a class="code" href="classhippodraw_1_1DataColumn.html#ad4c4c825a2ef6aebcc673b963c1b5caa" title="Returns the data.">getData</a> ()<span class="keyword"> const</span> <a name="l00038"></a>00038 <span class="keyword"></span>{ <a name="l00039"></a>00039 <span class="keywordflow">return</span> <a class="code" href="classhippodraw_1_1DataColumn.html#a4beef6150b8113b6905091edcab101cc" title="The data.">m_double_data</a>; <a name="l00040"></a>00040 } <a name="l00041"></a>00041 <a name="l00042"></a>00042 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a name="l00043"></a>00043 <a class="code" href="classhippodraw_1_1DataColumn.html#a5ab0c88eab0d088c621060d27e005eba" title="Gives the dimensionality of the data stored in each row of this branch.">DataColumn::</a> <a name="l00044"></a><a class="code" href="classhippodraw_1_1DataColumn.html#a5ab0c88eab0d088c621060d27e005eba">00044</a> <a class="code" href="classhippodraw_1_1DataColumn.html#a5ab0c88eab0d088c621060d27e005eba" title="Gives the dimensionality of the data stored in each row of this branch.">getRank</a> ()<span class="keyword"> const</span> <a name="l00045"></a>00045 <span class="keyword"></span>{ <a name="l00046"></a>00046 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classhippodraw_1_1DataColumn.html#a725e764d8ff6e3008f4494b38b7edca0" title="Returns the size of the column.">size</a> = <a class="code" href="classhippodraw_1_1DataColumn.html#a8538b3701a8876559372e73688ff5123" title="In case the data quantity we are dealing with is a vector/matrix store its dimensions...">m_shape</a>.size(); <a name="l00047"></a>00047 <a name="l00048"></a>00048 <span class="keywordflow">return</span> size; <a name="l00049"></a>00049 } <a name="l00050"></a>00050 <a name="l00051"></a>00051 <span class="keyword">const</span> std::vector < intptr_t > & <a name="l00052"></a>00052 <a class="code" href="classhippodraw_1_1DataColumn.html#a32626739f50d6b0652f8e8779e5405f8" title="Vector of the number of entries in the multidimensional data.">DataColumn::</a> <a name="l00053"></a><a class="code" href="classhippodraw_1_1DataColumn.html#a32626739f50d6b0652f8e8779e5405f8">00053</a> <a class="code" href="classhippodraw_1_1DataColumn.html#a32626739f50d6b0652f8e8779e5405f8" title="Vector of the number of entries in the multidimensional data.">getShape</a> () <a name="l00054"></a>00054 { <a name="l00055"></a>00055 <span class="keywordflow">return</span> <a class="code" href="classhippodraw_1_1DataColumn.html#a8538b3701a8876559372e73688ff5123" title="In case the data quantity we are dealing with is a vector/matrix store its dimensions...">m_shape</a>; <a name="l00056"></a>00056 } <a name="l00057"></a>00057 <a name="l00058"></a>00058 <span class="keywordtype">void</span> <a name="l00059"></a>00059 <a class="code" href="classhippodraw_1_1DataColumn.html#a4c46342ec9212eefc5a107c4964df8bf" title="Sets the shape of the data column.">DataColumn::</a> <a name="l00060"></a><a class="code" href="classhippodraw_1_1DataColumn.html#a4c46342ec9212eefc5a107c4964df8bf">00060</a> <a class="code" href="classhippodraw_1_1DataColumn.html#a4c46342ec9212eefc5a107c4964df8bf" title="Sets the shape of the data column.">setShape</a> ( <span class="keyword">const</span> std::vector < intptr_t > & <a class="code" href="namespacenum__util.html#a8570d9b34e8e9d714823c1b1986764f7">shape</a> ) <a name="l00061"></a>00061 { <a name="l00062"></a>00062 <a class="code" href="classhippodraw_1_1DataColumn.html#a8538b3701a8876559372e73688ff5123" title="In case the data quantity we are dealing with is a vector/matrix store its dimensions...">m_shape</a> = shape; <a name="l00063"></a>00063 } <a name="l00064"></a>00064 <a name="l00065"></a>00065 std::size_t <a name="l00066"></a>00066 <a class="code" href="classhippodraw_1_1DataColumn.html#a725e764d8ff6e3008f4494b38b7edca0" title="Returns the size of the column.">DataColumn::</a> <a name="l00067"></a><a class="code" href="classhippodraw_1_1DataColumn.html#a725e764d8ff6e3008f4494b38b7edca0">00067</a> <a class="code" href="classhippodraw_1_1DataColumn.html#a725e764d8ff6e3008f4494b38b7edca0" title="Returns the size of the column.">size</a> ( )<span class="keyword"> const</span> <a name="l00068"></a>00068 <span class="keyword"></span>{ <a name="l00069"></a>00069 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="namespacenum__util.html#a59851d76f9624ac3de899f818f9e0a6b">rank</a> = <a class="code" href="classhippodraw_1_1DataColumn.html#a8538b3701a8876559372e73688ff5123" title="In case the data quantity we are dealing with is a vector/matrix store its dimensions...">m_shape</a>.size (); <a name="l00070"></a>00070 std::size_t product = 1; <a name="l00071"></a>00071 <span class="keywordflow">for</span> ( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i < rank; i++ ) { <a name="l00072"></a>00072 product *= <a class="code" href="classhippodraw_1_1DataColumn.html#a8538b3701a8876559372e73688ff5123" title="In case the data quantity we are dealing with is a vector/matrix store its dimensions...">m_shape</a>[i]; <a name="l00073"></a>00073 } <a name="l00074"></a>00074 <a name="l00075"></a>00075 <span class="keywordflow">return</span> product; <a name="l00076"></a>00076 } <a name="l00077"></a>00077 <a name="l00078"></a>00078 <span class="keywordtype">void</span> <a name="l00079"></a>00079 <a class="code" href="classhippodraw_1_1DataColumn.html#ac8bb3912a3ce86b15842e79d0b421204" title="Clears the data array.">DataColumn::</a> <a name="l00080"></a><a class="code" href="classhippodraw_1_1DataColumn.html#ac8bb3912a3ce86b15842e79d0b421204">00080</a> <a class="code" href="classhippodraw_1_1DataColumn.html#ac8bb3912a3ce86b15842e79d0b421204" title="Clears the data array.">clear</a> () <a name="l00081"></a>00081 { <a name="l00082"></a>00082 <a class="code" href="classhippodraw_1_1DataColumn.html#a4beef6150b8113b6905091edcab101cc" title="The data.">m_double_data</a>.clear (); <a name="l00083"></a>00083 } <a name="l00084"></a>00084 <a name="l00085"></a>00085 <span class="keywordtype">double</span> * <a name="l00086"></a>00086 <a class="code" href="classhippodraw_1_1DataColumn.html#ab8e0ce93cb234c7e182c03c05ddf84fa" title="Returns pointer to the sub-array at row row.">DataColumn::</a> <a name="l00087"></a><a class="code" href="classhippodraw_1_1DataColumn.html#ab8e0ce93cb234c7e182c03c05ddf84fa">00087</a> <a class="code" href="classhippodraw_1_1DataColumn.html#ab8e0ce93cb234c7e182c03c05ddf84fa" title="Returns pointer to the sub-array at row row.">doubleArrayAt</a> ( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> row ) <a name="l00088"></a>00088 { <a name="l00089"></a>00089 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="namespacenum__util.html#a59851d76f9624ac3de899f818f9e0a6b">rank</a> = <a class="code" href="classhippodraw_1_1DataColumn.html#a8538b3701a8876559372e73688ff5123" title="In case the data quantity we are dealing with is a vector/matrix store its dimensions...">m_shape</a>.size (); <a name="l00090"></a>00090 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classhippodraw_1_1DataColumn.html#a725e764d8ff6e3008f4494b38b7edca0" title="Returns the size of the column.">size</a> = 1; <a name="l00091"></a>00091 <span class="keywordflow">for</span> ( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 1; i < rank; i++ ) { <a name="l00092"></a>00092 size *= <a class="code" href="classhippodraw_1_1DataColumn.html#a8538b3701a8876559372e73688ff5123" title="In case the data quantity we are dealing with is a vector/matrix store its dimensions...">m_shape</a> [ i ]; <a name="l00093"></a>00093 } <a name="l00094"></a>00094 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pos = row * size; <a name="l00095"></a>00095 <a name="l00096"></a>00096 <span class="keywordflow">return</span> & <a class="code" href="classhippodraw_1_1DataColumn.html#a4beef6150b8113b6905091edcab101cc" title="The data.">m_double_data</a> [ pos ]; <a name="l00097"></a>00097 } </pre></div></div> <hr size="1"><address style="align: right;"><small> Generated for HippoDraw Class Library by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border=0> </a> </small></address> </body> </html>