13 #ifndef __APPFRAME_CONSTRAINED_MATRIX_H
14 #define __APPFRAME_CONSTRAINED_MATRIX_H
16 #include <boost/shared_ptr.hpp>
17 #include <lac/pointer_matrix.h>
18 #include <lac/constraint_matrix.h>
21 template <
class VECTOR>
26 template <
class MATRIX>
30 void vmult(VECTOR& dst,
const VECTOR& src)
const;
31 void vmult_add(VECTOR& dst,
const VECTOR& src)
const;
32 void Tvmult(VECTOR& dst,
const VECTOR& src)
const;
33 void Tvmult_add(VECTOR& dst,
const VECTOR& src)
const;
35 boost::shared_ptr<PointerMatrixBase<VECTOR> >
matrix;
42 template <
class VECTOR>
43 template <
class MATRIX>
47 matrix = boost::shared_ptr<PointerMatrixBase<VECTOR> > (new_pointer_matrix_base(m, VECTOR()));
54 template <
class VECTOR>
64 template <
class VECTOR>
68 GrowingVectorMemory<VECTOR> mem;
69 VECTOR* tmp = mem.alloc();
70 tmp->reinit(src,
true);
74 constraints->condense(*tmp);
76 constraints->distribute(*tmp);
78 matrix->vmult(dst, *tmp);
81 constraints->distribute(dst);
83 constraints->condense(dst);
90 template <
class VECTOR>
94 GrowingVectorMemory<VECTOR> mem;
95 VECTOR* tmp = mem.alloc();
96 VECTOR* tmp2 = mem.alloc();
97 tmp->reinit(src,
true);
101 constraints->condense(*tmp);
103 constraints->distribute(*tmp);
105 matrix->vmult(*tmp2, *tmp);
108 constraints->distribute(*tmp2);
110 constraints->condense(*tmp2);
119 template <
class VECTOR>
123 GrowingVectorMemory<VECTOR> mem;
124 VECTOR* tmp = mem.alloc();
125 tmp->reinit(src,
true);
128 matrix->Tvmult(dst, *tmp);
129 constraints->condense(dst);
135 template <
class VECTOR>
139 GrowingVectorMemory<VECTOR> mem;
140 VECTOR* tmp = mem.alloc();
141 VECTOR* tmp2 = mem.alloc();
142 tmp->reinit(src,
true);
145 matrix->Tvmult(*tmp2, *tmp);
146 constraints->condense(*tmp2);