git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@397 331e1502-861f-0410-8da2-ba01fb791d7f
140 lines
13 KiB
HTML
140 lines
13 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
|
|
<title>ParadisEO-MOEO: moeoObjectiveVectorDouble.h Source File</title>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css">
|
|
<link href="tabs.css" rel="stylesheet" type="text/css">
|
|
</head><body>
|
|
<!-- Generated by Doxygen 1.4.7 -->
|
|
<div class="tabs">
|
|
<ul>
|
|
<li><a href="main.html"><span>Main Page</span></a></li>
|
|
<li><a href="classes.html"><span>Classes</span></a></li>
|
|
<li id="current"><a href="files.html"><span>Files</span></a></li>
|
|
<li>
|
|
<form action="search.php" method="get">
|
|
<table cellspacing="0" cellpadding="0" border="0">
|
|
<tr>
|
|
<td><label> <u>S</u>earch for </label></td>
|
|
<td><input type="text" name="query" value="" size="20" accesskey="s"/></td>
|
|
</tr>
|
|
</table>
|
|
</form>
|
|
</li>
|
|
</ul></div>
|
|
<h1>moeoObjectiveVectorDouble.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-</span>
|
|
<a name="l00002"></a>00002
|
|
<a name="l00003"></a>00003 <span class="comment">//-----------------------------------------------------------------------------</span>
|
|
<a name="l00004"></a>00004 <span class="comment">// moeoObjectiveVectorDouble.h</span>
|
|
<a name="l00005"></a>00005 <span class="comment">// (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007</span>
|
|
<a name="l00006"></a>00006 <span class="comment">/*</span>
|
|
<a name="l00007"></a>00007 <span class="comment"> This library...</span>
|
|
<a name="l00008"></a>00008 <span class="comment"></span>
|
|
<a name="l00009"></a>00009 <span class="comment"> Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr</span>
|
|
<a name="l00010"></a>00010 <span class="comment"> */</span>
|
|
<a name="l00011"></a>00011 <span class="comment">//-----------------------------------------------------------------------------</span>
|
|
<a name="l00012"></a>00012
|
|
<a name="l00013"></a>00013 <span class="preprocessor">#ifndef MOEOOBJECTIVEVECTORDOUBLE_H_</span>
|
|
<a name="l00014"></a>00014 <span class="preprocessor"></span><span class="preprocessor">#define MOEOOBJECTIVEVECTORDOUBLE_H_</span>
|
|
<a name="l00015"></a>00015 <span class="preprocessor"></span>
|
|
<a name="l00016"></a>00016 <span class="preprocessor">#include <iostream></span>
|
|
<a name="l00017"></a>00017 <span class="preprocessor">#include <math.h></span>
|
|
<a name="l00018"></a>00018 <span class="preprocessor">#include <comparator/moeoObjectiveObjectiveVectorComparator.h></span>
|
|
<a name="l00019"></a>00019 <span class="preprocessor">#include <comparator/moeoParetoObjectiveVectorComparator.h></span>
|
|
<a name="l00020"></a>00020 <span class="preprocessor">#include <core/moeoObjectiveVector.h></span>
|
|
<a name="l00021"></a>00021
|
|
<a name="l00026"></a>00026 <span class="keyword">template</span> < <span class="keyword">class</span> ObjectiveVectorTraits >
|
|
<a name="l00027"></a><a class="code" href="classmoeoObjectiveVectorDouble.html">00027</a> <span class="keyword">class </span><a class="code" href="classmoeoObjectiveVectorDouble.html">moeoObjectiveVectorDouble</a> : <span class="keyword">public</span> <a class="code" href="classmoeoObjectiveVector.html">moeoObjectiveVector</a> < ObjectiveVectorTraits, double >
|
|
<a name="l00028"></a>00028 {
|
|
<a name="l00029"></a>00029 <span class="keyword">public</span>:
|
|
<a name="l00030"></a>00030
|
|
<a name="l00031"></a>00031 <span class="keyword">using</span> moeoObjectiveVector < ObjectiveVectorTraits, double >::size;
|
|
<a name="l00032"></a>00032 <span class="keyword">using</span> moeoObjectiveVector < ObjectiveVectorTraits, double >::operator[];
|
|
<a name="l00033"></a>00033
|
|
<a name="l00037"></a><a class="code" href="classmoeoObjectiveVectorDouble.html#9d4c470ac87733521084175552874837">00037</a> <a class="code" href="classmoeoObjectiveVectorDouble.html#9d4c470ac87733521084175552874837">moeoObjectiveVectorDouble</a>(<span class="keywordtype">double</span> _value = 0.0) : <a class="code" href="classmoeoObjectiveVector.html">moeoObjectiveVector</a> < ObjectiveVectorTraits, double > (_value)
|
|
<a name="l00038"></a>00038 {}
|
|
<a name="l00039"></a>00039
|
|
<a name="l00040"></a>00040
|
|
<a name="l00045"></a><a class="code" href="classmoeoObjectiveVectorDouble.html#99f4a743424ed8384ad97fd36e3123d9">00045</a> <a class="code" href="classmoeoObjectiveVectorDouble.html#9d4c470ac87733521084175552874837">moeoObjectiveVectorDouble</a>(std::vector < double > & _v) : <a class="code" href="classmoeoObjectiveVector.html">moeoObjectiveVector</a> < ObjectiveVectorTraits, double > (_v)
|
|
<a name="l00046"></a>00046 {}
|
|
<a name="l00047"></a>00047
|
|
<a name="l00048"></a>00048
|
|
<a name="l00054"></a><a class="code" href="classmoeoObjectiveVectorDouble.html#f4aa764abee12a28ae30ae6bb23083f4">00054</a> <span class="keywordtype">bool</span> <a class="code" href="classmoeoObjectiveVectorDouble.html#f4aa764abee12a28ae30ae6bb23083f4">dominates</a>(<span class="keyword">const</span> moeoObjectiveVectorDouble < ObjectiveVectorTraits > & _other)<span class="keyword"> const</span>
|
|
<a name="l00055"></a>00055 <span class="keyword"> </span>{
|
|
<a name="l00056"></a>00056 moeoParetoObjectiveVectorComparator < moeoObjectiveVectorDouble<ObjectiveVectorTraits> > comparator;
|
|
<a name="l00057"></a>00057 <span class="keywordflow">return</span> comparator(_other, *<span class="keyword">this</span>);
|
|
<a name="l00058"></a>00058 }
|
|
<a name="l00059"></a>00059
|
|
<a name="l00060"></a>00060
|
|
<a name="l00065"></a><a class="code" href="classmoeoObjectiveVectorDouble.html#cf09615e1a38924ee4fb6250047f9d77">00065</a> <span class="keywordtype">bool</span> <a class="code" href="classmoeoObjectiveVectorDouble.html#cf09615e1a38924ee4fb6250047f9d77">operator==</a>(<span class="keyword">const</span> moeoObjectiveVectorDouble < ObjectiveVectorTraits > & _other)<span class="keyword"> const</span>
|
|
<a name="l00066"></a>00066 <span class="keyword"> </span>{
|
|
<a name="l00067"></a>00067 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0; i < size(); i++)
|
|
<a name="l00068"></a>00068 {
|
|
<a name="l00069"></a>00069 <span class="keywordflow">if</span> ( fabs(<span class="keyword">operator</span>[](i) - _other[i]) > ObjectiveVectorTraits::tolerance() )
|
|
<a name="l00070"></a>00070 {
|
|
<a name="l00071"></a>00071 <span class="keywordflow">return</span> <span class="keyword">false</span>;
|
|
<a name="l00072"></a>00072 }
|
|
<a name="l00073"></a>00073 }
|
|
<a name="l00074"></a>00074 <span class="keywordflow">return</span> <span class="keyword">true</span>;
|
|
<a name="l00075"></a>00075 }
|
|
<a name="l00076"></a>00076
|
|
<a name="l00077"></a>00077
|
|
<a name="l00082"></a><a class="code" href="classmoeoObjectiveVectorDouble.html#367e69818ebe05a932510e6516c54fdb">00082</a> <span class="keywordtype">bool</span> <a class="code" href="classmoeoObjectiveVectorDouble.html#367e69818ebe05a932510e6516c54fdb">operator!=</a>(<span class="keyword">const</span> moeoObjectiveVectorDouble < ObjectiveVectorTraits > & _other)<span class="keyword"> const</span>
|
|
<a name="l00083"></a>00083 <span class="keyword"> </span>{
|
|
<a name="l00084"></a>00084 <span class="keywordflow">return</span> ! <a class="code" href="classmoeoObjectiveVectorDouble.html#cf09615e1a38924ee4fb6250047f9d77">operator==</a>(_other);
|
|
<a name="l00085"></a>00085 }
|
|
<a name="l00086"></a>00086
|
|
<a name="l00087"></a>00087
|
|
<a name="l00093"></a><a class="code" href="classmoeoObjectiveVectorDouble.html#5616d7504e6b29848ca38b52e9eb44e0">00093</a> <span class="keywordtype">bool</span> operator<(const moeoObjectiveVectorDouble < ObjectiveVectorTraits > & _other) <span class="keyword">const</span>
|
|
<a name="l00094"></a>00094 {
|
|
<a name="l00095"></a>00095 <a class="code" href="classmoeoObjectiveObjectiveVectorComparator.html">moeoObjectiveObjectiveVectorComparator</a> < moeoObjectiveVectorDouble < ObjectiveVectorTraits > > cmp;
|
|
<a name="l00096"></a>00096 <span class="keywordflow">return</span> cmp(*<span class="keyword">this</span>, _other);
|
|
<a name="l00097"></a>00097 }
|
|
<a name="l00098"></a>00098
|
|
<a name="l00099"></a>00099
|
|
<a name="l00105"></a><a class="code" href="classmoeoObjectiveVectorDouble.html#50de392d10bd90ad125f26efb8ea5f3d">00105</a> <span class="keywordtype">bool</span> <a class="code" href="classmoeoObjectiveVectorDouble.html#50de392d10bd90ad125f26efb8ea5f3d">operator></a>(<span class="keyword">const</span> moeoObjectiveVectorDouble < ObjectiveVectorTraits > & _other)<span class="keyword"> const</span>
|
|
<a name="l00106"></a>00106 <span class="keyword"> </span>{
|
|
<a name="l00107"></a>00107 <span class="keywordflow">return</span> _other < *<span class="keyword">this</span>;
|
|
<a name="l00108"></a>00108 }
|
|
<a name="l00109"></a>00109
|
|
<a name="l00110"></a>00110
|
|
<a name="l00116"></a><a class="code" href="classmoeoObjectiveVectorDouble.html#11728f07ebd7d72fe331679913888d3f">00116</a> <span class="keywordtype">bool</span> operator<=(const moeoObjectiveVectorDouble < ObjectiveVectorTraits > & _other) <span class="keyword">const</span>
|
|
<a name="l00117"></a>00117 {
|
|
<a name="l00118"></a>00118 <span class="keywordflow">return</span> <span class="keyword">operator</span>==(_other) || <a class="code" href="classmoeoObjectiveVectorDouble.html#5616d7504e6b29848ca38b52e9eb44e0">operator<</a>(_other);
|
|
<a name="l00119"></a>00119 }
|
|
<a name="l00120"></a>00120
|
|
<a name="l00121"></a>00121
|
|
<a name="l00127"></a><a class="code" href="classmoeoObjectiveVectorDouble.html#74057cd0d8325513d186aea6034d7901">00127</a> <span class="keywordtype">bool</span> <a class="code" href="classmoeoObjectiveVectorDouble.html#74057cd0d8325513d186aea6034d7901">operator>=</a>(<span class="keyword">const</span> moeoObjectiveVectorDouble < ObjectiveVectorTraits > & _other)<span class="keyword"> const</span>
|
|
<a name="l00128"></a>00128 <span class="keyword"> </span>{
|
|
<a name="l00129"></a>00129 <span class="keywordflow">return</span> <a class="code" href="classmoeoObjectiveVectorDouble.html#cf09615e1a38924ee4fb6250047f9d77">operator==</a>(_other) || <a class="code" href="classmoeoObjectiveVectorDouble.html#50de392d10bd90ad125f26efb8ea5f3d">operator></a>(_other);
|
|
<a name="l00130"></a>00130 }
|
|
<a name="l00131"></a>00131
|
|
<a name="l00132"></a>00132 };
|
|
<a name="l00133"></a>00133
|
|
<a name="l00134"></a>00134
|
|
<a name="l00140"></a>00140 <span class="keyword">template</span> < <span class="keyword">class</span> ObjectiveVectorTraits >
|
|
<a name="l00141"></a>00141 std::ostream & operator<<(std::ostream & _os, const moeoObjectiveVectorDouble < ObjectiveVectorTraits > & _objectiveVector)
|
|
<a name="l00142"></a>00142 {
|
|
<a name="l00143"></a>00143 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0; i<_objectiveVector.size(); i++)
|
|
<a name="l00144"></a>00144 {
|
|
<a name="l00145"></a>00145 _os << _objectiveVector[i] << <span class="charliteral">'\t'</span>;
|
|
<a name="l00146"></a>00146 }
|
|
<a name="l00147"></a>00147 <span class="keywordflow">return</span> _os;
|
|
<a name="l00148"></a>00148 }
|
|
<a name="l00149"></a>00149
|
|
<a name="l00155"></a>00155 <span class="keyword">template</span> < <span class="keyword">class</span> ObjectiveVectorTraits >
|
|
<a name="l00156"></a>00156 std::istream & <a class="codeRef" doxygen="eo.doxytag:../../../paradiseo-eo/doc/html/" href="../../../paradiseo-eo/doc/html/namespacemlp.html#5d53663b214d7a4ecfb5729b191bf660">operator>></a>(std::istream & _is, moeoObjectiveVectorDouble < ObjectiveVectorTraits > & _objectiveVector)
|
|
<a name="l00157"></a>00157 {
|
|
<a name="l00158"></a>00158 _objectiveVector = moeoObjectiveVectorDouble < ObjectiveVectorTraits > ();
|
|
<a name="l00159"></a>00159 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0; i<_objectiveVector.size(); i++)
|
|
<a name="l00160"></a>00160 {
|
|
<a name="l00161"></a>00161 _is >> _objectiveVector[i];
|
|
<a name="l00162"></a>00162 }
|
|
<a name="l00163"></a>00163 <span class="keywordflow">return</span> _is;
|
|
<a name="l00164"></a>00164 }
|
|
<a name="l00165"></a>00165
|
|
<a name="l00166"></a>00166 <span class="preprocessor">#endif </span><span class="comment">/*MOEOOBJECTIVEVECTORDOUBLE_H_*/</span>
|
|
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Tue Jun 26 15:13:04 2007 for ParadisEO-MOEO by
|
|
<a href="http://www.doxygen.org/index.html">
|
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
|
|
</body>
|
|
</html>
|