<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>CPPLapack: drovector-constructor.hpp Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">CPPLapack
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</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>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Friends</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="dir_a37d0dd275f7ec49ee26f1d33d1059f5.html">include</a>      </li>
      <li class="navelem"><a class="el" href="dir_47ae83ce72b19dd83e89a3e791f36dde.html">drovector-</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">drovector-constructor.hpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="drovector-constructor_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">//=============================================================================</span><span class="comment"></span>
<a name="l00002"></a>00002 <span class="comment">/*! drovector constructor */</span>
<a name="l00003"></a><a class="code" href="classdrovector.html#a4964ce154b9d9394f2a6133b63c32165">00003</a> <span class="keyword">inline</span> <a class="code" href="classdrovector.html#a4964ce154b9d9394f2a6133b63c32165">drovector::drovector</a>()
<a name="l00004"></a>00004 {VERBOSE_REPORT;<span class="comment"></span>
<a name="l00005"></a>00005 <span class="comment">  //////// initialize ////////</span>
<a name="l00006"></a>00006 <span class="comment"></span>  <a class="code" href="classdrovector.html#a08df95e527c85a13ed99c4a0fd2b303e" title="vector size">l</a> =0;
<a name="l00007"></a>00007   <a class="code" href="classdrovector.html#ad21f3c0c6f1bf31d7b506c1658f5b14e" title="vector capacity">cap</a> =0;
<a name="l00008"></a>00008   <a class="code" href="classdrovector.html#ac66f6cbcc4d7c345cce70528d0fef7bb" title="1D array to store vector data">array</a> =NULL;
<a name="l00009"></a>00009 }
<a name="l00010"></a>00010 
<a name="l00011"></a>00011 <span class="comment">//=============================================================================</span><span class="comment"></span>
<a name="l00012"></a>00012 <span class="comment">/*! drovector copy constructor */</span>
<a name="l00013"></a><a class="code" href="classdrovector.html#a192f66f0db6a97ee99310f0bef87aad5">00013</a> <span class="keyword">inline</span> <a class="code" href="classdrovector.html#a4964ce154b9d9394f2a6133b63c32165">drovector::drovector</a>(<span class="keyword">const</span> <a class="code" href="classdrovector.html" title="Real Double-precision Row Vector Class.">drovector</a>&amp; vec)
<a name="l00014"></a>00014 {VERBOSE_REPORT;<span class="comment"></span>
<a name="l00015"></a>00015 <span class="comment">  //////// initialize ////////</span>
<a name="l00016"></a>00016 <span class="comment"></span>  <a class="code" href="classdrovector.html#a08df95e527c85a13ed99c4a0fd2b303e" title="vector size">l</a> =vec.<a class="code" href="classdrovector.html#a08df95e527c85a13ed99c4a0fd2b303e" title="vector size">l</a>;
<a name="l00017"></a>00017   <a class="code" href="classdrovector.html#ad21f3c0c6f1bf31d7b506c1658f5b14e" title="vector capacity">cap</a> =vec.<a class="code" href="classdrovector.html#ad21f3c0c6f1bf31d7b506c1658f5b14e" title="vector capacity">cap</a>;
<a name="l00018"></a>00018   <a class="code" href="classdrovector.html#ac66f6cbcc4d7c345cce70528d0fef7bb" title="1D array to store vector data">array</a> =<span class="keyword">new</span> <span class="keywordtype">double</span>[<a class="code" href="classdrovector.html#ad21f3c0c6f1bf31d7b506c1658f5b14e" title="vector capacity">cap</a>];
<a name="l00019"></a>00019   <span class="comment"></span>
<a name="l00020"></a>00020 <span class="comment">  //////// copy ////////</span>
<a name="l00021"></a>00021 <span class="comment"></span>  dcopy_(<a class="code" href="classdrovector.html#a08df95e527c85a13ed99c4a0fd2b303e" title="vector size">l</a>, vec.<a class="code" href="classdrovector.html#ac66f6cbcc4d7c345cce70528d0fef7bb" title="1D array to store vector data">array</a>, 1, <a class="code" href="classdrovector.html#ac66f6cbcc4d7c345cce70528d0fef7bb" title="1D array to store vector data">array</a>, 1);
<a name="l00022"></a>00022 }
<a name="l00023"></a>00023 
<a name="l00024"></a>00024 <span class="comment">//=============================================================================</span><span class="comment"></span>
<a name="l00025"></a>00025 <span class="comment">/*! drovector constructor to cast _drovector */</span>
<a name="l00026"></a><a class="code" href="classdrovector.html#adba050ef687c686af9af235e67bf15cf">00026</a> <span class="keyword">inline</span> <a class="code" href="classdrovector.html#a4964ce154b9d9394f2a6133b63c32165">drovector::drovector</a>(<span class="keyword">const</span> <a class="code" href="class__drovector.html" title="(DO NOT USE) Smart-temporary Real Double-precision Row Vector Class">_drovector</a>&amp; vec)
<a name="l00027"></a>00027 {VERBOSE_REPORT;<span class="comment"></span>
<a name="l00028"></a>00028 <span class="comment">  //////// initialize ////////</span>
<a name="l00029"></a>00029 <span class="comment"></span>  <a class="code" href="classdrovector.html#a08df95e527c85a13ed99c4a0fd2b303e" title="vector size">l</a> =vec.<a class="code" href="class__drovector.html#a1d5f575560f3516140f1649301a9504f" title="vector size">l</a>;
<a name="l00030"></a>00030   <a class="code" href="classdrovector.html#ad21f3c0c6f1bf31d7b506c1658f5b14e" title="vector capacity">cap</a> =vec.<a class="code" href="class__drovector.html#a0418c22f6035746dc1afd427720edbd3" title="vector capacity">cap</a>;
<a name="l00031"></a>00031   <a class="code" href="classdrovector.html#ac66f6cbcc4d7c345cce70528d0fef7bb" title="1D array to store vector data">array</a> =vec.<a class="code" href="class__drovector.html#ab4da9120db2bce05aa080e9d39cf1604" title="1D array to store vector data">array</a>;
<a name="l00032"></a>00032   
<a name="l00033"></a>00033   vec.<a class="code" href="class__drovector.html#a7a8841a35e43ad6b64c90abce2f3044d">nullify</a>();
<a name="l00034"></a>00034 }
<a name="l00035"></a>00035 
<a name="l00036"></a>00036 <span class="comment">//=============================================================================</span><span class="comment"></span>
<a name="l00037"></a>00037 <span class="comment">/*! drovector constructor with size specification */</span>
<a name="l00038"></a><a class="code" href="classdrovector.html#a6957aa2dec472d7d43f9b12aaa02fea9">00038</a> <span class="keyword">inline</span> <a class="code" href="classdrovector.html#a4964ce154b9d9394f2a6133b63c32165">drovector::drovector</a>(<span class="keyword">const</span> <span class="keywordtype">long</span>&amp; _l, <span class="keyword">const</span> <span class="keywordtype">long</span> margin)
<a name="l00039"></a>00039 {VERBOSE_REPORT;
<a name="l00040"></a>00040 <span class="preprocessor">#ifdef  CPPL_DEBUG</span>
<a name="l00041"></a>00041 <span class="preprocessor"></span>  <span class="keywordflow">if</span>( _l&lt;0 || margin&lt;0 ){
<a name="l00042"></a>00042     ERROR_REPORT;
<a name="l00043"></a>00043     std::cerr &lt;&lt; <span class="stringliteral">&quot;Vector size must be positive integers. &quot;</span> &lt;&lt; std::endl
<a name="l00044"></a>00044               &lt;&lt; <span class="stringliteral">&quot;Your input was (&quot;</span> &lt;&lt; _l &lt;&lt; <span class="stringliteral">&quot;).&quot;</span> &lt;&lt; std::endl;
<a name="l00045"></a>00045     exit(1);
<a name="l00046"></a>00046   }
<a name="l00047"></a>00047 <span class="preprocessor">#endif//CPPL_DEBUG</span>
<a name="l00048"></a>00048 <span class="preprocessor"></span>  <span class="comment"></span>
<a name="l00049"></a>00049 <span class="comment">  //////// initialize ////////</span>
<a name="l00050"></a>00050 <span class="comment"></span>  <a class="code" href="classdrovector.html#a08df95e527c85a13ed99c4a0fd2b303e" title="vector size">l</a> =_l;
<a name="l00051"></a>00051   <a class="code" href="classdrovector.html#ad21f3c0c6f1bf31d7b506c1658f5b14e" title="vector capacity">cap</a> =<a class="code" href="classdrovector.html#a08df95e527c85a13ed99c4a0fd2b303e" title="vector size">l</a>+margin;
<a name="l00052"></a>00052   <a class="code" href="classdrovector.html#ac66f6cbcc4d7c345cce70528d0fef7bb" title="1D array to store vector data">array</a> =<span class="keyword">new</span> <span class="keywordtype">double</span>[<a class="code" href="classdrovector.html#ad21f3c0c6f1bf31d7b506c1658f5b14e" title="vector capacity">cap</a>];
<a name="l00053"></a>00053 }
<a name="l00054"></a>00054 
<a name="l00055"></a>00055 <span class="comment">//=============================================================================</span><span class="comment"></span>
<a name="l00056"></a>00056 <span class="comment">/*! drovector constructor with filename */</span>
<a name="l00057"></a><a class="code" href="classdrovector.html#a810c5a1e7b3f0fc69d6aa664c6f10406">00057</a> <span class="keyword">inline</span> <a class="code" href="classdrovector.html#a4964ce154b9d9394f2a6133b63c32165">drovector::drovector</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* filename)
<a name="l00058"></a>00058 {VERBOSE_REPORT;
<a name="l00059"></a>00059   <a class="code" href="classdrovector.html#ac66f6cbcc4d7c345cce70528d0fef7bb" title="1D array to store vector data">array</a> =NULL;
<a name="l00060"></a>00060   <a class="code" href="classdrovector.html#ab65a83db3881b9e2462b205222756b08">read</a>(filename);
<a name="l00061"></a>00061 }
<a name="l00062"></a>00062 <span class="comment"></span>
<a name="l00063"></a>00063 <span class="comment">///////////////////////////////////////////////////////////////////////////////</span>
<a name="l00064"></a>00064 <span class="comment">///////////////////////////////////////////////////////////////////////////////</span>
<a name="l00065"></a>00065 <span class="comment">///////////////////////////////////////////////////////////////////////////////</span>
<a name="l00066"></a>00066 <span class="comment"></span>
<a name="l00067"></a>00067 <span class="comment">//=============================================================================</span><span class="comment"></span>
<a name="l00068"></a>00068 <span class="comment">/*! drovector destructor */</span>
<a name="l00069"></a><a class="code" href="classdrovector.html#a450f34daa3867f3dfb3e22302a9d3c0d">00069</a> <span class="keyword">inline</span> <a class="code" href="classdrovector.html#a450f34daa3867f3dfb3e22302a9d3c0d">drovector::~drovector</a>()
<a name="l00070"></a>00070 {VERBOSE_REPORT;
<a name="l00071"></a>00071   <span class="keyword">delete</span> [] <a class="code" href="classdrovector.html#ac66f6cbcc4d7c345cce70528d0fef7bb" title="1D array to store vector data">array</a>;
<a name="l00072"></a>00072 }
</pre></div></div><!-- contents -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Friends</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>
