Debian Codegraph @

src/femlib/RNM_op.hpp

raw symbols SCIP
1 // ********** DO NOT REMOVE THIS BANNER **********cxx . . $ `<file>/src/femlib/RNM_op.hpp`/
2 // ORIG-DATE: 29 fev 2000
3 // -*- Mode : c++ -*-
4 //
5 // SUMMARY : array modelisation
6 // USAGE : LGPL
7 // ORG : LJLL Universite Pierre et Marie Curie, Paris, FRANCE
8 // AUTHOR : Frederic Hecht
9 // E-MAIL : [email protected]
10 //
11
12 /*
13
14
15
16 Freefem++ is free software; you can redistribute it and/or modify
17 it under the terms of the GNU Lesser General Public License as published by
18 the Free Software Foundation; either version 2.1 of the License, or
19 (at your option) any later version.
20
21 Freefem++ is distributed in the hope that it will be useful,
22 but WITHOUT ANY WARRANTY; without even the implied warranty of
23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 GNU Lesser General Public License for more details.
25
26 You should have received a copy of the GNU Lesser General Public License
27 along with Freefem++; if not, write to the Free Software
28 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29
30
31 */
32
33
34 // #ifndef RNM_OP_HPP_ //NO: multiple call
35 // #define RNM_OP_HPP_
36
37 template<class R>
38 KNM_cxx . . $ KNM_#<R> & KNM_cxx . . $ KNM_#<R>::operatorcxx . . $ KNM_#`operator*=`(4616c25a4a1ef90b). opercxx . . $ `src/femlib/RNM_tpl.hpp:350:9`! (const outProduct_KN_cxx . . $ outProduct_KN_#<R> & u)
39 {
40 // *this oper A* t B
41 K_throwassertcxx . . $ `src/femlib/RNM.hpp:68:9`! (shapei.SameShape(u.a) && shapej.SameShape(u.b) );
42 long n= Ncxx . . $ KNM_#N(57a65ae535d7db84).(), m= Mcxx . . $ KNM_#M(57a65ae535d7db84).();
43
44 R * ai(u.acxx . . $ outProduct_KN_#a.),cc, c= u.ccxx . . $ outProduct_KN_#c.;
45 long stepi=u.acxx . . $ outProduct_KN_#a..step;
46 R * bj, *bb(u.bcxx . . $ outProduct_KN_#b.);
47 long stepj=u.bcxx . . $ outProduct_KN_#b..step;
48 KN_cxx . . $ KN_#<const_Rcxx . . $ `src/femlib/RNM.hpp:47:9`!> li((*this)(0,'.')); // first line
49 int stepij= li.stepcxx . . $ ShapeOfArray#step.;
50 for (long i=0;i<n;i++,cxx . . $ `operator,`(5d54d1eb02c625aa).ai += stepi,cxx . . $ `operator,`(5d54d1eb02c625aa).++li)
51 {
52 cc= c *cxx . . $ `operator*`(5e477dcd6678548f). *ai;
53 R * mij = li;
54 bj = bb;
55 for (long j=0; j<m; j++,cxx . . $ `operator,`(5d54d1eb02c625aa). bj += stepj,cxx . . $ `operator,`(5d54d1eb02c625aa). mij += stepij )
56 *mij opercxx . . $ `src/femlib/RNM_tpl.hpp:350:9`! cc *cxx . . $ `operator*`(5e477dcd6678548f). RNMcxx . . $ RNM/::conjcxx . . $ RNM/conj(569b37c916856981).(*bj) ;
57 }
58 return *this;
59 }
60 template<class R>
61 KNM_cxx . . $ KNM_#<R> & KNM_cxx . . $ KNM_#<R>::operatorcxx . . $ KNM_#`operator*=`(3d1acf8813cfabf). opercxx . . $ `src/femlib/RNM_tpl.hpp:350:9`! (const ConjKNM_cxx . . $ ConjKNM_#<R> & u)
62 {
63 K_throwassertcxx . . $ `src/femlib/RNM.hpp:68:9`!( N() == u.N() && M() == u.M() );
64 if (this->vcxx . . $ KN_#v. !=cxx . . $ std/`operator!=`(bf4c77cd91c4b201). u.tcxx . . $ KNM_#t(ecf0bb476d78f105).().v)
65 for(int i=0;i<cxx . . $ std/`operator<`(c2ad8cf295ccec45).Ncxx . . $ KNM_#N(57a65ae535d7db84).();++i)
66 for(int j=0;j<cxx . . $ std/`operator<`(c2ad8cf295ccec45).Mcxx . . $ KNM_#M(57a65ae535d7db84).();++j)
67 KNM_cxx . . $ KNM_#<R>::operatorcxx . . $ KNM_#`operator()`(8306f3247559581b). () (i,j) opercxx . . $ `src/femlib/RNM_tpl.hpp:350:9`! RNMcxx . . $ RNM/::conjcxx . . $ RNM/conj(569b37c916856981).( u(i,j));
68 else {
69 KNMcxx . . $ KNM#<R> v(u);
70 for(int i=0;i<cxx . . $ std/`operator<`(c2ad8cf295ccec45).Ncxx . . $ KNM_#N(57a65ae535d7db84).();++i)
71 for(int j=0;j<cxx . . $ std/`operator<`(c2ad8cf295ccec45).Mcxx . . $ KNM_#M(57a65ae535d7db84).();++j)
72 KNM_cxx . . $ KNM_#<R>::operatorcxx . . $ KNM_#`operator()`(8306f3247559581b). () (i,j) opercxx . . $ `src/femlib/RNM_tpl.hpp:350:9`! RNMcxx . . $ RNM/::conjcxx . . $ RNM/conj(569b37c916856981).( v(i,j));
73 }
74 return *this;
75 }
76
77
78 template<class R>
79 template<class A,class B,class C,class D>
80 KN_cxx . . $ KN_#<R>& KN_cxx . . $ KN_#<R>::operatorcxx . . $ KN_#`operator*=`(8398d997250bee43). opercxx . . $ `src/femlib/RNM_tpl.hpp:350:9`! (const F_KN_cxx . . $ F_KN_#<A,B,C,D> & u) {
81 K_throwassertcxx . . $ `src/femlib/RNM.hpp:68:9`! ( u.check(this->N()) );
82 R * l(vcxx . . $ KN_#v.); // first line
83 for (long i=0;i<cxx . . $ std/`operator<`(c2ad8cf295ccec45).ncxx . . $ ShapeOfArray#n.;i++,cxx . . $ `operator,`(5d54d1eb02c625aa).l += stepcxx . . $ ShapeOfArray#step.)
84 *l opercxx . . $ `src/femlib/RNM_tpl.hpp:350:9`! u[i];
85 return *this;}
86
87 template<class R>
88 KN_cxx . . $ KN_#<R>& KN_cxx . . $ KN_#<R>::operatorcxx . . $ KN_#`operator*=`(da9b58924cf5f869). opercxx . . $ `src/femlib/RNM_tpl.hpp:350:9`! (const SetArraycxx . . $ SetArray#<R> & u) {
89 R * l(vcxx . . $ KN_#v.); // first line
90 for (long i=0;i<cxx . . $ std/`operator<`(c2ad8cf295ccec45).ncxx . . $ ShapeOfArray#n.;i++,cxx . . $ `operator,`(5d54d1eb02c625aa).l += stepcxx . . $ ShapeOfArray#step.)
91 *l opercxx . . $ `src/femlib/RNM_tpl.hpp:350:9`! u[i];
92 return *this;}
93
94
95
96 template<class R>
97 KN_cxx . . $ KN_#<R>& KN_cxx . . $ KN_#<R>::operatorcxx . . $ KN_#`operator*=`(ec0727c6bfcceda). opercxx . . $ `src/femlib/RNM_tpl.hpp:350:9`! (const Mul_KNM_KN_cxx . . $ Mul_KNM_KN_#<R> & u) {
98 K_throwassertcxx . . $ `src/femlib/RNM.hpp:68:9`! (SameShape(u.A.shapei) && !constant());
99 R * l(vcxx . . $ KN_#v.); KN_cxx . . $ KN_#<const_Rcxx . . $ `src/femlib/RNM.hpp:47:9`!> li(u.Acxx . . $ Mul_KNM_KN_#A.(0,'.')); // first line
100 for (long i=0;i<cxx . . $ std/`operator<`(c2ad8cf295ccec45).ncxx . . $ ShapeOfArray#n.;i++,cxx . . $ `operator,`(5d54d1eb02c625aa).l += stepcxx . . $ ShapeOfArray#step.,cxx . . $ `operator,`(5d54d1eb02c625aa).++li)
101 *l opercxx . . $ `src/femlib/RNM_tpl.hpp:350:9`! (li,cxx . . $ `operator,`(5d54d1eb02c625aa).u.bcxx . . $ Mul_KNM_KN_#b.);
102 return *this;}
103
104 template<class R>
105 KN_cxx . . $ KN_#<R>& KN_cxx . . $ KN_#<R>::operatorcxx . . $ KN_#`operator*=`(8a732bf9d054f192). opercxx . . $ `src/femlib/RNM_tpl.hpp:350:9`! (const Mul_KNMh_KN_cxx . . $ Mul_KNMh_KN_#<R> & u) {
106 K_throwassertcxx . . $ `src/femlib/RNM.hpp:68:9`! (SameShape(u.A.shapej) && !constant());
107 R * l(vcxx . . $ KN_#v.); KN_cxx . . $ KN_#<const_Rcxx . . $ `src/femlib/RNM.hpp:47:9`!> lj(u.Acxx . . $ Mul_KNMh_KN_#A.('.',0)); // first line
108 for (long i=0;i<cxx . . $ std/`operator<`(c2ad8cf295ccec45).ncxx . . $ ShapeOfArray#n.;i++,cxx . . $ `operator,`(5d54d1eb02c625aa).l += stepcxx . . $ ShapeOfArray#step.,cxx . . $ `operator,`(5d54d1eb02c625aa).++lj)
109 *l opercxx . . $ `src/femlib/RNM_tpl.hpp:350:9`! (conjcxx . . $ conj(2b83efd3c47e3158).(lj),cxx . . $ `operator,`(5d54d1eb02c625aa).u.bcxx . . $ Mul_KNMh_KN_#b.);
110 return *this;}
111
112
113 template<class R>
114 KN_cxx . . $ KN_#<R>& KN_cxx . . $ KN_#<R>::operatorcxx . . $ KN_#`operator*=`(6cd6f85aa7f44c93). opercxx . . $ `src/femlib/RNM_tpl.hpp:350:9`! (const DotStar_KN_cxx . . $ DotStar_KN_#<R> & u) {
115 K_throwassertcxx . . $ `src/femlib/RNM.hpp:68:9`!(u.a.N() == N() );
116 long stepa(u.acxx . . $ DotStar_KN_#a..step),stepb(u.bcxx . . $ DotStar_KN_#b..step);
117 R * l(vcxx . . $ KN_#v.); const_Rcxx . . $ `src/femlib/RNM.hpp:47:9`! *aa(u.acxx . . $ DotStar_KN_#a.), *bb(u.bcxx . . $ DotStar_KN_#b.);
118 for (long i=0;i<cxx . . $ std/`operator<`(c2ad8cf295ccec45).ncxx . . $ ShapeOfArray#n.;i++,cxx . . $ `operator,`(5d54d1eb02c625aa).l += stepcxx . . $ ShapeOfArray#step.,cxx . . $ `operator,`(5d54d1eb02c625aa). aa +=stepa,cxx . . $ `operator,`(5d54d1eb02c625aa). bb += stepb)
119 *l opercxx . . $ `src/femlib/RNM_tpl.hpp:350:9`! *aa *cxx . . $ `operator*`(5e477dcd6678548f). *bb;
120 return *this;
121 }
122 template<class R>
123 KN_cxx . . $ KN_#<R>& KN_cxx . . $ KN_#<R>::operatorcxx . . $ KN_#`operator*=`(f1e3e688c4a8b0ad). opercxx . . $ `src/femlib/RNM_tpl.hpp:350:9`! (const DotSlash_KN_cxx . . $ DotSlash_KN_#<R> & u) {
124 K_throwassertcxx . . $ `src/femlib/RNM.hpp:68:9`!(u.a.N() == N() );
125 long stepa(u.acxx . . $ DotSlash_KN_#a..step),stepb(u.bcxx . . $ DotSlash_KN_#b..step);
126 R * l(vcxx . . $ KN_#v.); const_Rcxx . . $ `src/femlib/RNM.hpp:47:9`! *aa(u.acxx . . $ DotSlash_KN_#a.), *bb(u.bcxx . . $ DotSlash_KN_#b.);
127 for (long i=0;i<cxx . . $ std/`operator<`(c2ad8cf295ccec45).ncxx . . $ ShapeOfArray#n.;i++,cxx . . $ `operator,`(5d54d1eb02c625aa).l += stepcxx . . $ ShapeOfArray#step.,cxx . . $ `operator,`(5d54d1eb02c625aa). aa +=stepa,cxx . . $ `operator,`(5d54d1eb02c625aa). bb += stepb)
128 *l opercxx . . $ `src/femlib/RNM_tpl.hpp:350:9`! *aa /cxx . . $ `operator/`(42306a5d7abcb141). *bb;
129 return *this;
130 }
131
132
133 template<class R>
134 KN_cxx . . $ KN_#<R>& KN_cxx . . $ KN_#<R>::operatorcxx . . $ KN_#`operator*=`(b06fa4cdd604427a). opercxx . . $ `src/femlib/RNM_tpl.hpp:350:9`! (const Add_KN_cxx . . $ Add_KN_#<R> & u) {
135 K_throwassertcxx . . $ `src/femlib/RNM.hpp:68:9`!(u.a.N() == N() );
136 long stepa(u.acxx . . $ Add_KN_#a..step),stepb(u.bcxx . . $ Add_KN_#b..step);
137 R * l(vcxx . . $ KN_#v.); const_Rcxx . . $ `src/femlib/RNM.hpp:47:9`! *aa(u.acxx . . $ Add_KN_#a.), *bb(u.bcxx . . $ Add_KN_#b.);
138 for (long i=0;i<cxx . . $ std/`operator<`(c2ad8cf295ccec45).ncxx . . $ ShapeOfArray#n.;i++,cxx . . $ `operator,`(5d54d1eb02c625aa).l += stepcxx . . $ ShapeOfArray#step.,cxx . . $ `operator,`(5d54d1eb02c625aa). aa +=stepa,cxx . . $ `operator,`(5d54d1eb02c625aa). bb += stepb)
139 *l opercxx . . $ `src/femlib/RNM_tpl.hpp:350:9`! *aa+cxx . . $ operator+(1e5c6daf58b7d733).*bb;
140 return *this;
141 }
142
143 template<class R>
144 KN_cxx . . $ KN_#<R>& KN_cxx . . $ KN_#<R>::operatorcxx . . $ KN_#`operator*=`(741c6906cb09ced2). opercxx . . $ `src/femlib/RNM_tpl.hpp:350:9`! (const Sub_KN_cxx . . $ Sub_KN_#<R> & u) {
145 K_throwassertcxx . . $ `src/femlib/RNM.hpp:68:9`!(u.a.N() == N() );
146 long stepa(u.acxx . . $ Sub_KN_#a..step),stepb(u.bcxx . . $ Sub_KN_#b..step);
147 R * l(vcxx . . $ KN_#v.); const_Rcxx . . $ `src/femlib/RNM.hpp:47:9`! *aa(u.acxx . . $ Sub_KN_#a.), *bb(u.bcxx . . $ Sub_KN_#b.);
148 for (long i=0;i<cxx . . $ std/`operator<`(c2ad8cf295ccec45).ncxx . . $ ShapeOfArray#n.;i++,cxx . . $ `operator,`(5d54d1eb02c625aa).l += stepcxx . . $ ShapeOfArray#step.,cxx . . $ `operator,`(5d54d1eb02c625aa). aa +=stepa,cxx . . $ `operator,`(5d54d1eb02c625aa). bb += stepb)
149 *l opercxx . . $ `src/femlib/RNM_tpl.hpp:350:9`! *aa-cxx . . $ operator-(15566f6da80679d9).*bb;
150 return *this;
151 }
152
153 template<class R>
154 KN_cxx . . $ KN_#<R>& KN_cxx . . $ KN_#<R>::operatorcxx . . $ KN_#`operator*=`(cbae598d8e63b3bd). opercxx . . $ `src/femlib/RNM_tpl.hpp:350:9`! (const Mulc_KN_cxx . . $ Mulc_KN_#<R> & u) {
155 K_throwassertcxx . . $ `src/femlib/RNM.hpp:68:9`!(u.a.N() == N() );
156 long stepa(u.acxx . . $ Mulc_KN_#a..step);
157 R * l(vcxx . . $ KN_#v.); const_Rcxx . . $ `src/femlib/RNM.hpp:47:9`! *aa(u.acxx . . $ Mulc_KN_#a.),bb(u.bcxx . . $ Mulc_KN_#b.) ;
158 for (long i=0;i<cxx . . $ std/`operator<`(c2ad8cf295ccec45).ncxx . . $ ShapeOfArray#n.;i++,cxx . . $ `operator,`(5d54d1eb02c625aa).l += stepcxx . . $ ShapeOfArray#step.,cxx . . $ `operator,`(5d54d1eb02c625aa). aa +=stepa)
159 *l opercxx . . $ `src/femlib/RNM_tpl.hpp:350:9`! *aa *cxx . . $ `operator*`(5e477dcd6678548f). bb;
160 return *this;
161 }
162 template<class R>
163 KN_cxx . . $ KN_#<R>& KN_cxx . . $ KN_#<R>::operatorcxx . . $ KN_#`operator*=`(d9ebc01edf573933). opercxx . . $ `src/femlib/RNM_tpl.hpp:350:9`! (const Divc_KN_cxx . . $ Divc_KN_#<R> & u) {
164 K_throwassertcxx . . $ `src/femlib/RNM.hpp:68:9`!(u.a.N() == N() );
165 long stepa(u.acxx . . $ Divc_KN_#a..step);
166 R * l(vcxx . . $ KN_#v.); const_Rcxx . . $ `src/femlib/RNM.hpp:47:9`! *aa(u.acxx . . $ Divc_KN_#a.),bb(u.bcxx . . $ Divc_KN_#b.) ;
167 for (long i=0;i<cxx . . $ std/`operator<`(c2ad8cf295ccec45).ncxx . . $ ShapeOfArray#n.;i++,cxx . . $ `operator,`(5d54d1eb02c625aa).l += stepcxx . . $ ShapeOfArray#step.,cxx . . $ `operator,`(5d54d1eb02c625aa). aa +=stepa)
168 *l opercxx . . $ `src/femlib/RNM_tpl.hpp:350:9`! bb /cxx . . $ `operator/`(42306a5d7abcb141). *aa ;
169 return *this;
170 }
171
172 template<class R>
173 KN_cxx . . $ KN_#<R>& KN_cxx . . $ KN_#<R>::operatorcxx . . $ KN_#`operator*=`(e0110571065b85ca). opercxx . . $ `src/femlib/RNM_tpl.hpp:350:9`! (const Add_Mulc_KN_cxx . . $ Add_Mulc_KN_#<R> & u) {
174 K_throwassertcxx . . $ `src/femlib/RNM.hpp:68:9`!(u.a.N() == N() );
175 const long stepa(u.acxx . . $ Add_Mulc_KN_#a..step),stepb(u.bcxx . . $ Add_Mulc_KN_#b..step);
176 const R ca(u.cacxx . . $ Add_Mulc_KN_#ca.),cb(u.cbcxx . . $ Add_Mulc_KN_#cb.);
177 R * l(vcxx . . $ KN_#v.);
178 const R *aa(u.acxx . . $ Add_Mulc_KN_#a.),*bb(u.bcxx . . $ Add_Mulc_KN_#b.);
179 for (long i=0;i<cxx . . $ std/`operator<`(c2ad8cf295ccec45).ncxx . . $ ShapeOfArray#n.;i++,cxx . . $ `operator,`(5d54d1eb02c625aa).l += stepcxx . . $ ShapeOfArray#step.,cxx . . $ `operator,`(5d54d1eb02c625aa). aa +=stepa,cxx . . $ `operator,`(5d54d1eb02c625aa). bb += stepb)
180 *l opercxx . . $ `src/femlib/RNM_tpl.hpp:350:9`! *aa*cxx . . $ `operator*`(5e477dcd6678548f).ca +cxx . . $ operator+(1e5c6daf58b7d733). *bb*cxx . . $ `operator*`(5e477dcd6678548f).cb;
181 return *this;
182 }
183
184 template<class R>
185 KN_cxx . . $ KN_#<R>& KN_cxx . . $ KN_#<R>::operatorcxx . . $ KN_#`operator*=`(c23d863173f1f060). opercxx . . $ `src/femlib/RNM_tpl.hpp:350:9`! (const if_arth_KN_cxx . . $ if_arth_KN_#<R> & u) {
186 K_throwassertcxx . . $ `src/femlib/RNM.hpp:68:9`!(u.a.N() == N() );
187 R zero=R();
188 const long stepa(u.acxx . . $ if_arth_KN_#a..step),stepb(u.bcxx . . $ if_arth_KN_#b..step),stepc(u.ccxx . . $ if_arth_KN_#c..step);
189 R * l(vcxx . . $ KN_#v.);
190 const R *aa(u.acxx . . $ if_arth_KN_#a.),*bb(u.bcxx . . $ if_arth_KN_#b.),*cc(u.ccxx . . $ if_arth_KN_#c.);
191 for (long i=0;i<cxx . . $ std/`operator<`(c2ad8cf295ccec45).ncxx . . $ ShapeOfArray#n.;i++,cxx . . $ `operator,`(5d54d1eb02c625aa).l += stepcxx . . $ ShapeOfArray#step.,cxx . . $ `operator,`(5d54d1eb02c625aa). aa +=stepa,cxx . . $ `operator,`(5d54d1eb02c625aa). bb += stepb ,cxx . . $ `operator,`(5d54d1eb02c625aa). cc += stepc)
192 *l opercxx . . $ `src/femlib/RNM_tpl.hpp:350:9`! ( (*aa !=cxx . . $ std/`operator!=`(bf4c77cd91c4b201). zero) ? *bb : *cc);
193 return *this;
194 }
195
196 // #endif //RNM_OP_HPP_