Subversion Repositories gelsvn

Rev

Rev 2 | Rev 43 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 10
Line 43... Line 43...
43
	protected:
43
	protected:
44
 
44
 
45
		/// Construct 0 matrix
45
		/// Construct 0 matrix
46
		ArithMatFloat() 
46
		ArithMatFloat() 
47
		{
47
		{
-
 
48
#ifndef NDEBUG
48
			for_all_i(data[i]=HVT(ScalarType(0)));
49
			for_all_i(data[i]=HVT(CGLA_INIT_VALUE));
-
 
50
#endif
49
		}
51
		}
50
 
52
 
51
		/// Construct a matrix where all entries are the same.
53
		/// Construct a matrix where all entries are the same.
52
		explicit ArithMatFloat(ScalarType x)
54
		explicit ArithMatFloat(ScalarType x)
53
		{
55
		{
Line 315... Line 317...
315
									ArithMatFloat<VVT,HVT,MT,ROWS1>& m)
317
									ArithMatFloat<VVT,HVT,MT,ROWS1>& m)
316
	{
318
	{
317
		int cols = ArithMatFloat<VVT,HVT,MT,ROWS1>::get_h_dim();
319
		int cols = ArithMatFloat<VVT,HVT,MT,ROWS1>::get_h_dim();
318
		for(int i=0;i<ROWS1;i++)
320
		for(int i=0;i<ROWS1;i++)
319
			for(int j=0;j<cols;j++)
321
			for(int j=0;j<cols;j++)
-
 
322
				{
-
 
323
					m[i][j] = 0;
320
				for(int k=0;k<ROWS2;k++)
324
					for(int k=0;k<ROWS2;k++)
321
					m[i][j] += m1[i][k] * m2[k][j]; 
325
						m[i][j] += m1[i][k] * m2[k][j]; 
-
 
326
				}
322
	}
327
	}
323
 
328
 
324
 
329
 
325
	/** Transpose. See the discussion on mul if you are curious as to why
330
	/** Transpose. See the discussion on mul if you are curious as to why
326
			I don't simply return the transpose. */
331
			I don't simply return the transpose. */
Line 347... Line 352...
347
		int rows1 = M1::get_v_dim();
352
		int rows1 = M1::get_v_dim();
348
		int rows2 = M2::get_v_dim();
353
		int rows2 = M2::get_v_dim();
349
 
354
 
350
		for(int i=0;i<rows1;i++)
355
		for(int i=0;i<rows1;i++)
351
			for(int j=0;j<cols;j++)
356
			for(int j=0;j<cols;j++)
-
 
357
				{
-
 
358
					m[i][j] = 0;
352
				for(int k=0;k<rows2;k++)
359
					for(int k=0;k<rows2;k++)
353
					m[i][j] += m1[i][k] * m2[k][j];
360
						m[i][j] += m1[i][k] * m2[k][j];
-
 
361
				}
354
	}
362
	}
355
 
363
 
356
 
364
 
357
	/** Transpose. See the discussion on mul if you are curious as to why
365
	/** Transpose. See the discussion on mul if you are curious as to why
358
			I don't simply return the transpose. */
366
			I don't simply return the transpose. */