メインページ   クラス階層   構成   ファイル一覧   構成メンバ   ファイルメンバ  

oct-cmplx.h

解説を見る。
00001 /*
00002 
00003 Copyright (C) 1996, 1997 John W. Eaton
00004 
00005 This file is part of Octave.
00006 
00007 Octave is free software; you can redistribute it and/or modify it
00008 under the terms of the GNU General Public License as published by the
00009 Free Software Foundation; either version 2, or (at your option) any
00010 later version.
00011 
00012 Octave is distributed in the hope that it will be useful, but WITHOUT
00013 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00014 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00015 for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with Octave; see the file COPYING.  If not, write to the Free
00019 Software Foundation, 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00020 
00021 */
00022 
00023 #if !defined (octave_oct_cmplx_h)
00024 #define octave_oct_cmplx_h 1
00025 
00026 // By using this file instead of <complex>, we can easily avoid buggy
00027 // implementations of the standard complex data type (if needed).
00028 
00029 #include <complex>
00030 
00031 typedef std::complex<double> Complex;
00032 
00033 #if defined (CXX_ISO_COMPLIANT_LIBRARY)
00034 
00035 // If namespaces don't work, we will end up with some infinite looping.
00036 
00037 inline double
00038 real (const Complex& z)
00039 {
00040   return std::real (z);
00041 }
00042 
00043 inline double
00044 imag (const Complex& z)
00045 {
00046   return std::imag (z);
00047 }
00048 
00049 inline double
00050 abs (const Complex& z)
00051 {
00052   return std::abs (z);
00053 }
00054 
00055 inline double
00056 arg (const Complex& z)
00057 {
00058   return std::arg (z);
00059 }
00060 
00061 inline double
00062 norm (const Complex& z)
00063 {
00064   return std::norm (z);
00065 }
00066 
00067 inline Complex
00068 conj (const Complex& z)
00069 {
00070   return std::conj (z);
00071 }
00072 
00073 inline Complex
00074 polar (const double& x, const double& y);
00075 
00076 inline Complex
00077 cos (const Complex& z)
00078 {
00079   return std::cos (z);
00080 }
00081 
00082 inline Complex
00083 cosh (const Complex& z)
00084 {
00085   return std::cosh (z);
00086 }
00087 
00088 inline Complex
00089 exp (const Complex& z)
00090 {
00091   return std::exp (z);
00092 }
00093 
00094 inline Complex
00095 log (const Complex& z)
00096 {
00097   return std::log (z);
00098 }
00099 
00100 inline Complex
00101 log10 (const Complex& z)
00102 {
00103   return std::log10 (z);
00104 }
00105 
00106 inline Complex
00107 pow (const Complex& z, int n)
00108 {
00109   return std::pow (z, n);
00110 }
00111 
00112 inline Complex
00113 pow (const Complex& z, const double& x)
00114 {
00115   // XXX FIXME XXX -- this should not be needed, but it avoids a bug
00116   // in some versions of libstdc++ (3.3.x and possibly others).
00117 
00118   return std::pow (z, Complex (x));
00119 }
00120 
00121 inline Complex
00122 pow (const Complex& z1, const Complex& z2)
00123 {
00124   return std::pow (z1, z2);
00125 }
00126 
00127 inline Complex
00128 pow (const double& x, const Complex& z)
00129 {
00130   return std::pow (x, z);
00131 }
00132 
00133 inline Complex
00134 sin (const Complex& z)
00135 {
00136   return std::sin (z);
00137 }
00138 
00139 inline Complex
00140 sinh (const Complex& z)
00141 {
00142   return std::sinh (z);
00143 }
00144 
00145 inline Complex
00146 sqrt (const Complex& z)
00147 {
00148   return std::sqrt (z);
00149 }
00150 
00151 inline Complex
00152 tan (const Complex& z)
00153 {
00154   return std::tan (z);
00155 }
00156 
00157 inline Complex
00158 tanh (const Complex& z)
00159 {
00160   return std::tanh (z);
00161 }
00162 
00163 #endif
00164 
00165 #endif
00166 
00167 /*
00168 ;;; Local Variables: ***
00169 ;;; mode: C++ ***
00170 ;;; End: ***
00171 */

Wed Dec 29 11:52:06 2004に生成されました。 doxygen1.2.18
SEO [PR] 爆速!無料ブログ 無料ホームページ開設 無料ライブ放送