summaryrefslogtreecommitdiff
path: root/src/BlendFunc/BlendFunc_Tensor.cxx
blob: 2b1fc450337d0bb390ab54837b827561e29f1435 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// File:	BlendFunc_Tensor.cxx
// Created:	Thu Dec  5 09:52:07 1996
// Author:	Philippe MANGIN
//		<pmn@sgi29>


#include <BlendFunc_Tensor.ixx>

#include <TColStd_Array1OfReal.hxx>
#include <math_Vector.hxx>
#include <math_Matrix.hxx>
//#include <math_StackMemoryManager.hxx>
//#include <math_Memory.hxx>

BlendFunc_Tensor::BlendFunc_Tensor(const Standard_Integer NbRow, 
				   const Standard_Integer NbCol, 
				   const Standard_Integer NbMat) :
                                   Tab(1,NbRow*NbMat*NbCol),
				   nbrow( NbRow ),
				   nbcol( NbCol ),
				   nbmat( NbMat ),
				   nbmtcl( NbMat*NbCol )
{
}

void BlendFunc_Tensor::Init(const Standard_Real InitialValue)
{
// Standard_Integer I, T = nbrow * nbcol *  nbmat;
// for (I=1; I<=T; I++) {Tab(I) = InitialValue;}
  Tab.Init(InitialValue);
}

void BlendFunc_Tensor::Multiply(const math_Vector& Right, 
				math_Matrix& M) const 
{
  Standard_Integer i, j, k;
  Standard_Real Somme;
  for ( i=1; i<=nbrow; i++) {
    for ( j=1; j<=nbcol; j++) {
       Somme = 0;
       for ( k=1; k<=nbmat; k++) {
	 Somme += Value(i,j,k)*Right(k);
       }
       M(i,j) = Somme;
     }
  }
}