Subversion Repositories gelsvn

Rev

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

Rev 45 Rev 46
Line 344... Line 344...
344
	  {
344
	  {
345
	    m[i][j] = a[i] * b[j];
345
	    m[i][j] = a[i] * b[j];
346
	  }
346
	  }
347
    }
347
    }
348
 
348
 
-
 
349
  /** Compute the outer product of a and b using an arbitrary 
-
 
350
      binary operation: op(a, transpose(b)). This is 
-
 
351
      a matrix with a::rows and b::columns. */
-
 
352
  template <class VVT, class HVT, class MT, int ROWS, class BinOp>
-
 
353
    void outer_product(const VVT& a, const HVT& b, 
-
 
354
		       ArithMatFloat<VVT,HVT,MT,ROWS>& m, BinOp op)
-
 
355
    {
-
 
356
      int R = VVT::get_dim();
-
 
357
      int C = HVT::get_dim();
-
 
358
      for(int i=0;i<R;++i)
-
 
359
	for(int j=0;j<C;++j)
-
 
360
	  {
-
 
361
	    m[i][j] = op(a[i], b[j]);
-
 
362
	  }
-
 
363
    }
-
 
364
 
349
  /** Copy a matrix to another matrix, cell by cell.
365
  /** Copy a matrix to another matrix, cell by cell.
350
      This conversion that takes a const matrix as first argument
366
      This conversion that takes a const matrix as first argument
351
      (source) and a non-const matrix as second argument
367
      (source) and a non-const matrix as second argument
352
      (destination). The contents of the first matrix is simply copied
368
      (destination). The contents of the first matrix is simply copied
353
      to the second matrix. 
369
      to the second matrix.