C-XSC - A C++ Class Library for Extended Scientific Computing
2.5.4
|
00001 /* 00002 ** CXSC is a C++ library for eXtended Scientific Computing (V 2.5.4) 00003 ** 00004 ** Copyright (C) 1990-2000 Institut fuer Angewandte Mathematik, 00005 ** Universitaet Karlsruhe, Germany 00006 ** (C) 2000-2014 Wiss. Rechnen/Softwaretechnologie 00007 ** Universitaet Wuppertal, Germany 00008 ** 00009 ** This library is free software; you can redistribute it and/or 00010 ** modify it under the terms of the GNU Library General Public 00011 ** License as published by the Free Software Foundation; either 00012 ** version 2 of the License, or (at your option) any later version. 00013 ** 00014 ** This library is distributed in the hope that it will be useful, 00015 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 ** Library General Public License for more details. 00018 ** 00019 ** You should have received a copy of the GNU Library General Public 00020 ** License along with this library; if not, write to the Free 00021 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00022 */ 00023 00024 /* CVS $Id: civeccmat.inl,v 1.24 2014/01/30 17:23:44 cxsc Exp $ */ 00025 00026 // Here are definitions for civector x cmatrix-Functions 00027 #ifndef _CXSC_CIVECCMAT_INL_INCLUDED 00028 #define _CXSC_CIVECCMAT_INL_INCLUDED 00029 00030 namespace cxsc { 00031 00032 INLINE civector::civector(const cmatrix &sl) 00033 #if(CXSC_INDEX_CHECK) 00034 throw(ERROR_CMATRIX_TYPE_CAST_OF_THICK_OBJ) 00035 #else 00036 throw() 00037 #endif 00038 { _vmconstr<civector,cmatrix,cinterval>(*this,sl); } 00039 INLINE civector::civector(const cmatrix_slice &sl) 00040 #if(CXSC_INDEX_CHECK) 00041 throw(ERROR_CMATRIX_TYPE_CAST_OF_THICK_OBJ) 00042 #else 00043 throw() 00044 #endif 00045 { _vmsconstr<civector,cmatrix_slice,cinterval>(*this,sl); } 00046 INLINE civector::civector(const cmatrix_subv &v) throw():l(v.lb),u(v.ub),size(v.size) 00047 { 00048 dat=new cinterval[size]; 00049 for (int i=0, j=v.start;i<v.size;i++,j+=v.offset) 00050 dat[i]=v.dat[j]; 00051 } 00052 INLINE civector _civector(const cmatrix &sl) 00053 #if(CXSC_INDEX_CHECK) 00054 throw(ERROR_CMATRIX_TYPE_CAST_OF_THICK_OBJ) 00055 #else 00056 throw() 00057 #endif 00058 { return civector(sl); } 00059 INLINE civector _civector(const cmatrix_slice &sl) 00060 #if(CXSC_INDEX_CHECK) 00061 throw(ERROR_CMATRIX_TYPE_CAST_OF_THICK_OBJ) 00062 #else 00063 throw() 00064 #endif 00065 { return civector(sl); } 00066 00067 INLINE void SetInf(civector &iv,const cmatrix_subv &rv) 00068 #if(CXSC_INDEX_CHECK) 00069 throw(ERROR_CIMATRIX_OP_WITH_WRONG_DIM) 00070 #else 00071 throw() 00072 #endif 00073 { _vmvsetinf(iv,rv); } 00074 INLINE void SetSup(civector &iv,const cmatrix_subv &rv) 00075 #if(CXSC_INDEX_CHECK) 00076 throw(ERROR_CIMATRIX_OP_WITH_WRONG_DIM) 00077 #else 00078 throw() 00079 #endif 00080 { _vmvsetsup(iv,rv); } 00081 INLINE void SetInf(civector_slice &iv,const cmatrix_subv &rv) 00082 #if(CXSC_INDEX_CHECK) 00083 throw(ERROR_CIMATRIX_OP_WITH_WRONG_DIM) 00084 #else 00085 throw() 00086 #endif 00087 { _vsvsetinf(iv,cvector(rv)); } 00088 INLINE void SetSup(civector_slice &iv,const cmatrix_subv &rv) 00089 #if(CXSC_INDEX_CHECK) 00090 throw(ERROR_CIMATRIX_OP_WITH_WRONG_DIM) 00091 #else 00092 throw() 00093 #endif 00094 { _vsvsetsup(iv,cvector(rv)); } 00095 00096 INLINE void UncheckedSetInf(civector &iv,const cmatrix_subv &rv) 00097 #if(CXSC_INDEX_CHECK) 00098 throw(ERROR_CIMATRIX_OP_WITH_WRONG_DIM) 00099 #else 00100 throw() 00101 #endif 00102 { _vmvusetinf(iv,rv); } 00103 INLINE void UncheckedSetSup(civector &iv,const cmatrix_subv &rv) 00104 #if(CXSC_INDEX_CHECK) 00105 throw(ERROR_CIMATRIX_OP_WITH_WRONG_DIM) 00106 #else 00107 throw() 00108 #endif 00109 { _vmvusetsup(iv,rv); } 00110 INLINE void UncheckedSetInf(civector_slice &iv,const cmatrix_subv &rv) 00111 #if(CXSC_INDEX_CHECK) 00112 throw(ERROR_CIMATRIX_OP_WITH_WRONG_DIM) 00113 #else 00114 throw() 00115 #endif 00116 { _vsvusetinf(iv,cvector(rv)); } 00117 INLINE void UncheckedSetSup(civector_slice &iv,const cmatrix_subv &rv) 00118 #if(CXSC_INDEX_CHECK) 00119 throw(ERROR_CIMATRIX_OP_WITH_WRONG_DIM) 00120 #else 00121 throw() 00122 #endif 00123 { _vsvusetsup(iv,cvector(rv)); } 00124 00125 INLINE civector &civector::operator =(const cmatrix_subv &mv) throw() { return _vmvassign<civector,cmatrix_subv,cinterval>(*this,mv); } 00126 INLINE civector_slice &civector_slice::operator =(const cmatrix_subv &mv) throw() { return _vsvassign(*this,cvector(mv)); } 00127 INLINE civector &civector::operator =(const cmatrix &m) 00128 #if(CXSC_INDEX_CHECK) 00129 throw(ERROR_CMATRIX_TYPE_CAST_OF_THICK_OBJ) 00130 #else 00131 throw() 00132 #endif 00133 { return _vmassign<civector,cmatrix,cinterval>(*this,m); } 00134 INLINE civector &civector::operator =(const cmatrix_slice &m) 00135 #if(CXSC_INDEX_CHECK) 00136 throw(ERROR_CMATRIX_TYPE_CAST_OF_THICK_OBJ) 00137 #else 00138 throw() 00139 #endif 00140 { return _vmassign<civector,cmatrix,cinterval>(*this,cmatrix(m)); } 00141 INLINE civector_slice &civector_slice::operator =(const cmatrix &m) 00142 #if(CXSC_INDEX_CHECK) 00143 throw(ERROR__OP_WITH_WRONG_DIM<cvector>,ERROR_CMATRIX_TYPE_CAST_OF_THICK_OBJ) 00144 #else 00145 throw() 00146 #endif 00147 { return _vsvassign(*this,cvector(m)); } 00148 INLINE civector_slice & civector_slice::operator =(const cmatrix_slice &m) 00149 #if(CXSC_INDEX_CHECK) 00150 throw(ERROR__OP_WITH_WRONG_DIM<cvector>,ERROR_CMATRIX_TYPE_CAST_OF_THICK_OBJ) 00151 #else 00152 throw() 00153 #endif 00154 { return _vsvassign(*this,civector(cmatrix(m))); } 00155 00156 INLINE civector operator *(const cmatrix &m,const civector &v) 00157 #if(CXSC_INDEX_CHECK) 00158 throw(ERROR_CMATRIX_OP_WITH_WRONG_DIM) 00159 #else 00160 throw() 00161 #endif 00162 { return _mvcimult<cmatrix,civector,civector>(m,v); } 00163 INLINE civector operator *(const cmatrix_slice &ms,const civector &v) 00164 #if(CXSC_INDEX_CHECK) 00165 throw(ERROR_CMATRIX_OP_WITH_WRONG_DIM) 00166 #else 00167 throw() 00168 #endif 00169 { return _msvcimult<cmatrix_slice,civector,civector>(ms,v); } 00170 INLINE civector operator *(const civector &v,const cmatrix &m) 00171 #if(CXSC_INDEX_CHECK) 00172 throw(ERROR_CMATRIX_OP_WITH_WRONG_DIM) 00173 #else 00174 throw() 00175 #endif 00176 { return _vmcimult<civector,cmatrix,civector>(v,m); } 00177 INLINE civector operator *(const civector &v,const cmatrix_slice &ms) 00178 #if(CXSC_INDEX_CHECK) 00179 throw(ERROR_CMATRIX_OP_WITH_WRONG_DIM) 00180 #else 00181 throw() 00182 #endif 00183 { return _vmscimult<civector,cmatrix_slice,civector>(v,ms); } 00184 INLINE civector &operator *=(civector &v,const cmatrix &m) 00185 #if(CXSC_INDEX_CHECK) 00186 throw(ERROR_CMATRIX_OP_WITH_WRONG_DIM) 00187 #else 00188 throw() 00189 #endif 00190 { return _vmcimultassign<civector,cmatrix,cinterval>(v,m); } 00191 INLINE civector &operator *=(civector &v,const cmatrix_slice &ms) 00192 #if(CXSC_INDEX_CHECK) 00193 throw(ERROR_CMATRIX_OP_WITH_WRONG_DIM) 00194 #else 00195 throw() 00196 #endif 00197 { return _vmscimultassign<civector,cmatrix_slice,cinterval>(v,ms); } 00198 00199 INLINE civector operator *(const civector_slice &v,const cmatrix &m) 00200 #if(CXSC_INDEX_CHECK) 00201 throw(ERROR_CMATRIX_OP_WITH_WRONG_DIM) 00202 #else 00203 throw() 00204 #endif 00205 { return _vmcimult<civector,cmatrix,civector>(civector(v),m); } 00206 INLINE civector_slice &civector_slice::operator *=(const cmatrix &m) 00207 #if(CXSC_INDEX_CHECK) 00208 throw(ERROR_CMATRIX_OP_WITH_WRONG_DIM) 00209 #else 00210 throw() 00211 #endif 00212 { return _vsmcimultassign<civector_slice,cmatrix,cinterval>(*this,m); } 00213 00214 INLINE civector operator *(const ivector &v,const cmatrix &m) 00215 #if(CXSC_INDEX_CHECK) 00216 throw(ERROR_CIMATRIX_OP_WITH_WRONG_DIM) 00217 #else 00218 throw() 00219 #endif 00220 { return _vmcimult<ivector,cmatrix,civector>(v,m); } 00221 INLINE civector operator *(const ivector &v,const cmatrix_slice &ms) 00222 #if(CXSC_INDEX_CHECK) 00223 throw(ERROR_CIMATRIX_OP_WITH_WRONG_DIM) 00224 #else 00225 throw() 00226 #endif 00227 { return _vmscimult<ivector,cmatrix_slice,civector>(v,ms); } 00228 INLINE civector operator *(const ivector_slice &v,const cmatrix &m) 00229 #if(CXSC_INDEX_CHECK) 00230 throw(ERROR_CIMATRIX_OP_WITH_WRONG_DIM) 00231 #else 00232 throw() 00233 #endif 00234 { return _vmcimult<civector,cmatrix,civector>(civector(v),m); } 00235 INLINE civector operator *(const cmatrix &m,const ivector &v) 00236 #if(CXSC_INDEX_CHECK) 00237 throw(ERROR_CIMATRIX_OP_WITH_WRONG_DIM) 00238 #else 00239 throw() 00240 #endif 00241 { return _mvcimult<cmatrix,ivector,civector>(m,v); } 00242 INLINE civector operator *(const cmatrix_slice &ms,const ivector &v) 00243 #if(CXSC_INDEX_CHECK) 00244 throw(ERROR_CIMATRIX_OP_WITH_WRONG_DIM) 00245 #else 00246 throw() 00247 #endif 00248 { return _msvcimult<cmatrix_slice,ivector,civector>(ms,v); } 00249 00250 } // namespace cxsc 00251 00252 #endif 00253