DenseLinAlgPack: Concreate C++ Classes for Dense Blas-Compatible Linear Algebra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
DenseLinAlgPack_LinAlgOpPackDecl.hpp
1 // @HEADER
2 // ***********************************************************************
3 //
4 // Moocho: Multi-functional Object-Oriented arCHitecture for Optimization
5 // Copyright (2003) Sandia Corporation
6 //
7 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8 // license for use of this work by or on behalf of the U.S. Government.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Roscoe A. Bartlett (rabartl@sandia.gov)
38 //
39 // ***********************************************************************
40 // @HEADER
41 
42 #ifndef LIN_ALG_OP_PACK_DECL_H
43 #define LIN_ALG_OP_PACK_DECL_H
44 
45 #include "DenseLinAlgPack_DVectorOp.hpp"
46 #include "DenseLinAlgPack_DMatrixOp.hpp"
47 
48 namespace LinAlgOpPack {
49 
50 typedef DenseLinAlgPack::value_type value_type;
51 
56 
57 using DenseLinAlgPack::Vt_S;
58 using DenseLinAlgPack::Vp_StV;
59 using DenseLinAlgPack::Vp_StMtV;
60 using DenseLinAlgPack::V_InvMtV;
61 using DenseLinAlgPack::Mp_StM;
62 using DenseLinAlgPack::Mp_StMtM;
63 using DenseLinAlgPack::M_StInvMtM;
64 
65 // //////////////////////////////////////////////////////////////////////////////
66 // //////////////////////////////////////////////////////////////////////////////
67 /* * @name Default Linear Algebra implementation operations.
68  *
69  * These are template functions that can be used to perform simpler
70  * linear algebra operations given more elaborate ones. The idea is that
71  * for each combination of vector and matrix types, the BLAS like operations
72  * must be provided and then these template functions provide related
73  * linear algebra operations. The user can override these default implementations
74  * by defining the exact functions himself.
75  *
76  * Warning\\
77  * In general it is not allowed for the lhs argument to be used in the rhs expression.
78  * Concidering aliasing would have make the operations much more complicated.
79  * So unless you are sure that it is okay, do not use a vector or matrix object
80  * in both the lhs and rhs expressions.
81  *
82  * The nameing covension for these functions is the same as for the linear algebra
83  * functions for #DVectorSlice# and #DMatrixSlice#.
84  */
85 // @{
86 
87 // //////////////////////////////////////////////////////////////////////////////
88 // ///////////////////////////////////////////////////////////////////////////////
89 /* * @name Level 1 BLAS for Vectors
90  *
91  * For these functions to work for the type V the following function must
92  * be defined:
93  *
94  * // vs_lhs += alpha * V_rhs \\
95  * void Vp_StV(DVectorSlice* vs_lhs, value_type alpha, const V& V_rhs);
96  *
97  * The rest of these level 1 BLAS functions implement the variations.
98  */
99 // @{
100 
101 // //////////////////////////////////////////////////////////////////////////////
102 /* * @name += operations
103  */
104 // @{
105 
107 /* * vs_lhs += V_rhs.
108  *
109  * Calls: #Vp_StV(vs_lhs,1.0,V_rhs);#
110  */
111 template <class V>
112 void Vp_V(DVectorSlice* vs_lhs, const V& V_rhs);
113 
114 // end += operations
115 // @}
116 
117 // //////////////////////////////////////////////////////////////////////////////
118 /* * @name = operations with DVector as lhs
119  */
120 // @{
121 
123 /* * v_lhs = V_rhs.
124  *
125  * Calls: #Vp_V(&(*v_lhs)(),V_rhs);#
126  */
127 template <class V>
128 void assign(DVector* v_lhs, const V& V_rhs);
129 
131 /* * v_lhs = alpha * V_rhs.
132  *
133  * Calls: #Vp_StV(&(*v_lhs)(),alpha,V_rhs);#
134  */
135 template <class V>
136 void V_StV(DVector* v_lhs, value_type alpha, const V& V_rhs);
137 
139 /* * v_lhs = - V_rhs.
140  *
141  * Calls: #V_StV(&(*v_lhs)(),-1.0,V_rhs);#
142  */
143 template <class V>
144 void V_mV(DVector* v_lhs, const V& V_rhs);
145 
147 /* * v_lhs = V1_rhs1 + V2_rhs2.
148  *
149  * Calls: #Vp_V(&(*v_lhs)(),V1_rhs1); Vp_V(&(*v_lhs)(),V1_rhs2);#
150  */
151 template <class V1, class V2>
152 void V_VpV(DVector* v_lhs, const V1& V1_rhs1, const V2& V2_rhs2);
153 
155 /* * v_lhs = V_rhs1 - V_rhs2.
156  *
157  * Calls: #Vp_V(&(*v_lhs)(),V1_rhs1); Vp_StV(&(*v_lhs)(),-1.0,V2_rhs2);#
158  */
159 template <class V1, class V2>
160 void V_VmV(DVector* v_lhs, const V1& V1_rhs1, const V2& V2_rhs2);
162 /* * v_lhs = alpha * V_rhs1 + vs_rhs2.
163  *
164  * Calls: #Vp_StV(&(*v_lhs)(),alpha,V_rhs1);#
165  */
166 template <class V>
167 void V_StVpV(DVector* v_lhs, value_type alpha, const V& V_rhs1
168  , const DVectorSlice& vs_rhs2);
169 
170 // end = operations with DVector as lhs
171 // @}
172 
173 // //////////////////////////////////////////////////////////////////////////////
174 /* * @name = operations with DVectorSlice as lhs
175  */
176 // @{
177 
179 /* * vs_lhs = V_rhs.
180  *
181  * Calls: #Vp_V(vs_lhs,V_rhs);#
182  */
183 template <class V>
184 void assign(DVectorSlice* vs_lhs, const V& V_rhs);
185 
187 /* * vs_lhs = alpha * V_rhs.
188  *
189  * Calls: #Vp_StV(vs_lhs,alpha,V_rhs);#
190  */
191 template <class V>
192 void V_StV(DVectorSlice* vs_lhs, value_type alpha, const V& V_rhs);
193 
195 /* * vs_lhs = - V_rhs.
196  *
197  * Calls: #V_StV(vs_lhs,-1.0,V_rhs);#
198  */
199 template <class V>
200 void V_mV(DVectorSlice* vs_lhs, const V& V_rhs);
201 
203 /* * vs_lhs = V1_rhs1 + V2_rhs2.
204  *
205  * Calls: #Vp_V(vs_lhs,V1_rhs1); Vp_V(vs_lhs,V1_rhs2);#
206  */
207 template <class V1, class V2>
208 void V_VpV(DVectorSlice* vs_lhs, const V1& V1_rhs1, const V2& V2_rhs2);
209 
211 /* * vs_lhs = V_rhs1 - V_rhs2.
212  *
213  * Calls: #Vp_V(vs_lhs,V1_rhs1); Vp_StV(vs_lhs,-1.0,V2_rhs2);#
214  */
215 template <class V1, class V2>
216 void V_VmV(DVectorSlice* vs_lhs, const V1& V1_rhs1, const V2& V2_rhs2);
217 
219 /* * vs_lhs = alpha * V_rhs1 + vs_rhs2.
220  *
221  * Calls: #Vp_StV(vs_lhs,alpha,V_rhs1);#
222  */
223 template <class V>
224 void V_StVpV(DVectorSlice* vs_lhs, value_type alpha, const V& V_rhs1
225  , const DVectorSlice& vs_rhs2);
226 
227 // end = operations with DVectorSlice as lhs
228 // @}
229 
230 // end Level 1 BLAS for Vectors
231 // @}
232 
233 // //////////////////////////////////////////////////////////////////////////////
234 // ///////////////////////////////////////////////////////////////////////////////
235 /* * @name Level 1 BLAS for Matrices
236  *
237  * For these functions to work for the type M the following function must
238  * be defined:
239  *
240  * // gms_lhs += alpha * op(M_rhs) \\
241  * void Mp_StM(DMatrixSlice* vs_lhs, value_type alpha, const V& V_rhs, BLAS_Cpp::Transp);
242  *
243  * The rest of these level 1 BLAS functions implement the variations.
244  */
245 // @{
246 
247 // //////////////////////////////////////////////////////////////////////////////
248 /* * @name += operations
249  */
250 // @{
251 
253 /* * gms_lhs += op(M_rhs).
254  *
255  * Calls: #Mp_StM(gms_lhs,1.0,M_rhs,trans_rhs);#
256  */
257 template <class M>
258 void Mp_M(DMatrixSlice* gms_lhs, const M& M_rhs, BLAS_Cpp::Transp trans_rhs);
259 
260 // end += operations
261 // @}
262 
263 // //////////////////////////////////////////////////////////////////////////////
264 /* * @name = operations with DMatrix as lhs
265  */
266 // @{
267 
269 /* * gm_lhs = op(M_rhs).
270  *
271  * Calls: #Mp_M(&(*gm_lhs)(),M_rhs,trans_rhs);#
272  */
273 template <class M>
274 void assign(DMatrix* gm_lhs, const M& M_rhs, BLAS_Cpp::Transp trans_rhs);
275 
277 /* * gm_lhs = alpha * M_rhs.
278  *
279  * Calls: #Mp_StM(&(*gm_lhs)(),alpha,M_rhs,trans_rhs);#
280  */
281 template <class M>
282 void M_StM(DMatrix* v_lhs, value_type alpha, const M& M_rhs
283  , BLAS_Cpp::Transp trans_rhs);
284 
286 /* * gm_lhs = - op(M_rhs).
287  *
288  * Calls: #M_StM(&(*gm_lhs)(),-1.0,M_rhs,trans_rhs);#
289  */
290 template <class M>
291 void M_mM(DMatrix* gm_lhs, const M& M_rhs, BLAS_Cpp::Transp trans_rhs) ;
292 
294 /* * gm_lhs = op(M1_rhs1) + op(M2_rhs2).
295  *
296  * Calls: #Mp_M(&(*gm_lhs)(),M1_rhs1,trans_rhs1); Mp_M(&(*gm_lhs)(),M1_rhs2,trans_rhs2);#
297  */
298 template <class M1, class M2>
299 void M_MpM(DMatrix* gm_lhs, const M1& M1_rhs1, BLAS_Cpp::Transp trans_rhs1
300  , const M2& M2_rhs2, BLAS_Cpp::Transp trans_rhs2);
301 
303 /* * gm_lhs = op(M_rhs1) - op(M_rhs2).
304  *
305  * Calls: #Mp_M(&(*gm_lhs)(),M1_rhs1,trans_rhs1); Mp_StM(&(*gm_lhs)(),-1.0,M2_rhs2,trans_rhs2);#
306  */
307 template <class M1, class M2>
308 void M_MmM(DMatrix* gm_lhs, const M1& M1_rhs1, BLAS_Cpp::Transp trans_rhs1
309  , const M2& M2_rhs2, BLAS_Cpp::Transp trans_rhs2);
310 
312 /* * gm_lhs = alpha * op(M_rhs1) + op(gms_rhs2).
313  *
314  * Calls: #Mp_StM(&(*gm_lhs)(),alpha,M_rhs1,trans_rhs1);#
315  */
316 template <class M>
317 void M_StMpM(DMatrix* gm_lhs, value_type alpha, const M& M_rhs1, BLAS_Cpp::Transp trans_rhs1
318  , const DMatrixSlice& gms_rhs2, BLAS_Cpp::Transp trans_rhs2);
319 
320 // end = operations with DMatrix as lhs
321 // @}
322 
323 // //////////////////////////////////////////////////////////////////////////////
324 /* * @name = operations with DMatrixSlice as lhs
325  */
326 // @{
327 
329 /* * gms_lhs = op(M_rhs).
330  *
331  * Calls: #Mp_M(gms_lhs,M_rhs,trans_rhs);#
332  */
333 template <class M>
334 void assign(DMatrixSlice* gms_lhs, const M& M_rhs, BLAS_Cpp::Transp trans_rhs);
335 
337 /* * gm_lhs = alpha * M_rhs.
338  *
339  * Calls: #Mp_StM(&(*gm_lhs)(),alpha,M_rhs,trans_rhs);#
340  */
341 template <class M>
342 void M_StM(DMatrixSlice* gms_lhs, value_type alpha, const M& M_rhs
343  , BLAS_Cpp::Transp trans_rhs);
344 
346 /* * gm_lhs = - op(M_rhs).
347  *
348  * Calls: #M_StM(&(*gm_lhs)(),-1.0,M_rhs,trans_rhs);#
349  */
350 template <class M>
351 void M_mM(DMatrixSlice* gms_lhs, const M& M_rhs, BLAS_Cpp::Transp trans_rhs) ;
352 
354 /* * gms_lhs = op(M1_rhs1) + op(M2_rhs2).
355  *
356  * Calls: #Mp_M(gms_lhs,M1_rhs1,trans_rhs1); Mp_M(gms_lhs,M1_rhs2,trans_rhs2);#
357  */
358 template <class M1, class M2>
359 void M_MpM(DMatrixSlice* gms_lhs, const M1& M1_rhs1, BLAS_Cpp::Transp trans_rhs1
360  , const M2& M2_rhs2, BLAS_Cpp::Transp trans_rhs2);
361 
363 /* * gms_lhs = op(M_rhs1) - op(M_rhs2).
364  *
365  * Calls: #Mp_M(gms_lhs,M1_rhs1,trans_rhs1); Mp_StM(gms_lhs,-1.0,M2_rhs2,trans_rhs2);#
366  */
367 template <class M1, class M2>
368 void M_MmM(DMatrixSlice* gms_lhs, const M1& M1_rhs1, BLAS_Cpp::Transp trans_rhs1
369  , const M2& M2_rhs2, BLAS_Cpp::Transp trans_rhs2);
370 
372 /* * gms_lhs = alpha * op(M_rhs1) + op(gms_rhs2).
373  *
374  * Calls: #Mp_StM(gms_lhs,alpha,M_rhs1,trans_rhs1);#
375  */
376 template <class M>
377 void M_StMpM(DMatrixSlice* gms_lhs, value_type alpha, const M& M_rhs1, BLAS_Cpp::Transp trans_rhs1
378  , const DMatrixSlice& gms_rhs2, BLAS_Cpp::Transp trans_rhs2);
379 
380 // end = operations with DMatrixSlice as lhs
381 // @}
382 
383 // end Level 1 BLAS for Matrices
384 // @}
385 
386 // //////////////////////////////////////////////////////////////////////////////
387 // ///////////////////////////////////////////////////////////////////////
388 /* * @name Level 2 BLAS
389  *
390  * These operations implement variations on the Level-2 BLAS operation:\\
391  *
392  * vs_lhs = alpha * op(M_rhs1) * V_rhs2 + beta * vs_lhs
393  */
394 // @{
395 
396 // //////////////////////////////////////////////////////////////////////////////
397 /* * @name += operations
398  */
399 // @{
400 
402 /* * vs_lhs += op(M_rhs1) * V_rhs2.
403  *
404  * Calls: #Vp_StMtV(vs_lhs,1.0,M_rhs1,trans_rhs1,V_rhs2);#
405  */
406 template <class M, class V>
407 void Vp_MtV(DVectorSlice* vs_lhs, const M& M_rhs1, BLAS_Cpp::Transp trans_rhs1
408  , const V& V_rhs2);
409 
411 /* * vs_lhs = op(M_rhs1) * V_rhs2 + beta * vs_lhs.
412  *
413  * Calls: #Vp_StMtV(vs_lhs,1.0,M_rhs1,trans_rhs1,V_rhs2,beta);#
414  */
415 template <class M, class V>
416 void Vp_MtV(DVectorSlice* vs_lhs, const M& M_rhs1, BLAS_Cpp::Transp trans_rhs1
417  , const V& V_rhs2, value_type beta);
418 
419 // end += operations
420 // @}
421 
422 // //////////////////////////////////////////////////////////////////////////////
423 /* * @name = operations with DVector as lhs
424  */
425 // @{
426 
428 /* * v_lhs = alpha * op(M_rhs1) * V_rhs2.
429  *
430  * Calls: #Vp_StMtV(&(*v_lhs)(),alpha,M_rhs1,trans_rhs1,V_rhs2);#
431  */
432 template <class M, class V>
433 void V_StMtV(DVector* v_lhs, value_type alpha, const M& M_rhs1
434  , BLAS_Cpp::Transp trans_rhs1, const V& V_rhs2);
435 
437 /* * v_lhs = op(M_rhs1) * V_rhs2.
438  *
439  * Calls: #Vp_MtV(&(*v_lhs)(),M_rhs1,trans_rhs1,V_rhs2);#
440  */
441 template <class M, class V>
442 void V_MtV(DVector* v_lhs, const M& M_rhs1, BLAS_Cpp::Transp trans_rhs1
443  , const V& V_rhs2);
444 
445 // end = operations with DVector as lhs
446 // @}
447 
448 // //////////////////////////////////////////////////////////////////////////////
449 /* * @name = operations with DVectorSlice as lhs
450  */
451 // @{
452 
454 /* * vs_lhs = alpha * op(M_rhs1) * V_rhs2.
455  *
456  * Calls: #Vp_StMtV(vs_lhs,alpha,M_rhs1,trans_rhs1,V_rhs2);#
457  */
458 template <class M, class V>
459 void V_StMtV(DVectorSlice* vs_lhs, value_type alpha, const M& M_rhs1
460  , BLAS_Cpp::Transp trans_rhs1, const V& V_rhs2);
461 
463 /* * vs_lhs = op(M_rhs1) * V_rhs2.
464  *
465  * Calls: #Vp_MtV(vs_lhs,M_rhs1,trans_rhs1,V_rhs2);#
466  */
467 template <class M, class V>
468 void V_MtV(DVectorSlice* vs_lhs, const M& M_rhs1, BLAS_Cpp::Transp trans_rhs1
469  , const V& V_rhs2);
470 
471 // end = operations with DVectorSlice as lhs
472 // @}
473 
474 // end Level 2 BLAS
475 // @}
476 
477 // //////////////////////////////////////////////////////////////////////////////
478 // //////////////////////////////////////////////////////////////////////////////
479 /* * @name Level 3 BLAS
480  *
481  * These operations are based on the Level-3 BLAS operation:
482  *
483  * gms_lhs = alpha * op(M1_rhs1) * op(M2_rhs2) + beta * gms_lhs
484  */
485 // @{
486 
487 // //////////////////////////////////////////////////////////////////////////////
488 /* * @name += operations
489  */
490 // @{
491 
493 /* * gms_lhs += op(M1_rhs1) * op(M2_rhs2).
494  *
495  * Calls: #Mp_StMtM(gms_lhs,1.0,M1_rhs1,trans_rhs1,M2_rhs2,trans_rhs2);#
496  */
497 template <class M1, class M2>
498 void Mp_MtM(DMatrixSlice* gms_lhs, const M1& M1_rhs1, BLAS_Cpp::Transp trans_rhs1
499  , const M2& M2_rhs2, BLAS_Cpp::Transp trans_rhs2);
500 
502 /* * gms_lhs = op(M1_rhs1) * op(M2_rhs2) + beta * gms_rhs.
503  *
504  * Calls: #Mp_StMtM(gms_lhs,1.0,M1_rhs1,trans_rhs1,M2_rhs2,trans_rhs2,beta);#
505  */
506 template <class M1, class M2>
507 void Mp_MtM(DMatrixSlice* gms_lhs, const M1& M1_rhs1, BLAS_Cpp::Transp trans_rhs1
508  , const M2& M2_rhs2, BLAS_Cpp::Transp trans_rhs2, value_type beta);
509 
510 // end += operations
511 // @}
512 
513 // //////////////////////////////////////////////////////////////////////////////
514 /* * @name = operations with DMatrix as lhs
515  */
516 // @{
517 
519 /* * gm_lhs = alpha * op(M1_rhs1) * op(M2_rhs2).
520  *
521  * Calls: #Mp_StMtM(&(*gm_lhs)(),alpha,M1_rhs1,trans_rhs1,M2_rhs2,trans_rhs2);#
522  */
523 template <class M1, class M2>
524 void M_StMtM(DMatrix* gm_lhs, value_type alpha, const M1& M1_rhs1
525  , BLAS_Cpp::Transp trans_rhs1, const M2& M2_rhs2, BLAS_Cpp::Transp trans_rhs2);
526 
528 /* * gm_lhs = op(M1_rhs1) * op(M2_rhs2).
529  *
530  * Calls: #Mp_MtM(&(*gm_lhs)(),M1_rhs1,trans_rhs1,M2_rhs2,trans_rhs2);#
531  */
532 template <class M1, class M2>
533 void M_MtM(DMatrix* gm_lhs, const M1& M1_rhs1
534  , BLAS_Cpp::Transp trans_rhs1, const M2& M2_rhs2, BLAS_Cpp::Transp trans_rhs2);
535 
536 // end = operations with DMatrix as lhs
537 // @}
538 
539 // //////////////////////////////////////////////////////////////////////////////
540 /* * @name = operations with DMatrixSlice as lhs
541  */
542 // @{
543 
545 /* * gms_lhs = alpha * op(M1_rhs1) * op(M2_rhs2).
546  *
547  * Calls: #Mp_StMtM(gms_lhs,alpha,M1_rhs1,trans_rhs1,M2_rhs2,trans_rhs2);#
548  */
549 template <class M1, class M2>
550 void M_StMtM(DMatrixSlice* gms_lhs, value_type alpha, const M1& M1_rhs1
551  , BLAS_Cpp::Transp trans_rhs1, const M2& M2_rhs2, BLAS_Cpp::Transp trans_rhs2);
552 
554 /* * gms_lhs = op(M1_rhs1) * op(M2_rhs2).
555  *
556  * Calls: #Mp_MtM(gms_lhs,M1_rhs1,trans_rhs1,M2_rhs2,trans_rhs2);#
557  */
558 template <class M1, class M2>
559 void M_MtM(DMatrixSlice* gms_lhs, const M1& M1_rhs1
560  , BLAS_Cpp::Transp trans_rhs1, const M2& M2_rhs2, BLAS_Cpp::Transp trans_rhs2);
561 // end = operations with DMatrixSlice as lhs
562 // @}
563 
564 // end Level 3 BLAS
565 // @}
566 
567 // end Default Linear Algebra Implementations
568 // @}
569 
570 // ///////////////////////////////////////////////////////////////////////////
571 // ///////////////////////////////////////////////////////////////////////////
572 // Inline definitions
573 
574 // ///////////////////////////////////////////////////////////////////////////////
575 // Level 1 BLAS for Vectors
576 
577 // vs_lhs += V_rhs.
578 template <class V>
579 inline
580 void Vp_V(DVectorSlice* vs_lhs, const V& V_rhs) {
581  Vp_StV(vs_lhs,1.0,V_rhs);
582 }
583 
584 // v_lhs = - V_rhs.
585 template <class V>
586 inline
587 void V_mV(DVector* v_lhs, const V& V_rhs) {
588  V_StV(v_lhs,-1.0,V_rhs);
589 }
590 
591 // vs_lhs = - V_rhs.
592 template <class V>
593 inline
594 void V_mV(DVectorSlice* vs_lhs, const V& V_rhs) {
595  V_StV(vs_lhs,-1.0,V_rhs);
596 }
597 
598 // ///////////////////////////////////////////////////////////////////////////////
599 // Level 1 BLAS for Matrices
600 
601 // gms_lhs += op(M_rhs).
602 template <class M>
603 inline
604 void Mp_M(DMatrixSlice* gms_lhs, const M& M_rhs, BLAS_Cpp::Transp trans_rhs) {
605  Mp_StM(gms_lhs,1.0,M_rhs,trans_rhs);
606 }
607 
608 // gm_lhs = - op(M_rhs).
609 template <class M>
610 inline
611 void M_mM(DMatrix* gm_lhs, const M& M_rhs, BLAS_Cpp::Transp trans_rhs) {
612  M_StM(gm_lhs,-1.0,M_rhs,trans_rhs);
613 }
614 
615 // gms_lhs = - op(M_rhs).
616 template <class M>
617 inline
618 void M_mM(DMatrixSlice* gms_lhs, const M& M_rhs, BLAS_Cpp::Transp trans_rhs) {
619  M_StM(gms_lhs,-1.0,M_rhs,trans_rhs);
620 }
621 
622 // ///////////////////////////////////////////////////////////////////////
623 // Level 2 BLAS
624 
625 // vs_lhs += op(M_rhs1) * V_rhs2.
626 template <class M, class V>
627 inline
628 void Vp_MtV(DVectorSlice* vs_lhs, const M& M_rhs1, BLAS_Cpp::Transp trans_rhs1
629  , const V& V_rhs2)
630 {
631  Vp_StMtV(vs_lhs,1.0,M_rhs1,trans_rhs1,V_rhs2);
632 }
633 
634 // vs_lhs = op(M_rhs1) * V_rhs2 + beta * vs_lhs.
635 template <class M, class V>
636 inline
637 void Vp_MtV(DVectorSlice* vs_lhs, const M& M_rhs1, BLAS_Cpp::Transp trans_rhs1
638  , const V& V_rhs2, value_type beta)
639 {
640  Vp_StMtV(vs_lhs,1.0,M_rhs1,trans_rhs1,V_rhs2,beta);
641 }
642 
643 // //////////////////////////////////////////////////////////////////////////////
644 // Level 3 BLAS
645 
646 // gms_lhs += op(M1_rhs1) * op(M2_rhs2).
647 template <class M1, class M2>
648 inline
649 void Mp_MtM(DMatrixSlice* gms_lhs, const M1& M1_rhs1, BLAS_Cpp::Transp trans_rhs1
650  , const M2& M2_rhs2, BLAS_Cpp::Transp trans_rhs2)
651 {
652  Mp_StMtM(gms_lhs,1.0,M1_rhs1,trans_rhs1,M2_rhs2,trans_rhs2);
653 }
654 
655 // gms_lhs = op(M1_rhs1) * op(M2_rhs2) + beta * gms_rhs.
656 template <class M1, class M2>
657 inline
658 void Mp_MtM(DMatrixSlice* gms_lhs, const M1& M1_rhs1, BLAS_Cpp::Transp trans_rhs1
659  , const M2& M2_rhs2, BLAS_Cpp::Transp trans_rhs2, value_type beta)
660 {
661  Mp_StMtM(gms_lhs,1.0,M1_rhs1,trans_rhs1,M2_rhs2,trans_rhs2,beta);
662 }
663 
664 
665 } // end namespace LinAlgOpPack
666 
667 
668 #endif // LIN_ALG_OP_PACK_DECL_H
Transp