예제 #1
0
// Outputs T^ijk V_i summing over ith (1st 2nd or 3rd) index. eg i = 
// 1: M_ij = T^kij V_k
// 2: M_ij = T^jki V_k
// 3: M_ij = T^ijk V_k
// so the matrix indices are just in order from L-R AFTER summed index.
DoubleMatrix Tensor::dotProd(const DoubleVector & V, int i) const {
  DoubleMatrix result(3, 3);

  int j, k, l;
  for (j=1; j<=3; j++)
    for (k=1; k<=3; k++)
      switch(i) {
      case 1: 
	for (l=1; l<=3; l++) 
	  result(j, k) += display(l, j, k) * V.display(l);
	break; 
      case 2:
	for (l=1; l<=3; l++) 
	  result(j, k) += display(k, l, j) * V.display(l); 
	break;
      case 3:
	for (l=1; l<=3; l++) 
	  result(j, k) += display(j, k, l) * V.display(l); 
	break;
      default:
	ostringstream ii;
	ii << "sum out of range in dot product " << *this << "*" 
	   << V << "(" << V.displayStart() << "," << V.displayEnd() << ")"
	   << " on " << i << "th index.\n"; 
	throw ii.str();
      }
  return result;
}
예제 #2
0
파일: nmssmsusy.cpp 프로젝트: McLenin/gm2
void NmssmSusy::set(const DoubleVector & y) {
  assert(y.displayEnd() - y.displayStart() + 1 >= numNMssmPars);
  MssmSusy::set(y);
  sVev = y.display(34);
  lambda = y.display(35);
  kappa = y.display(36);
  mupr = y.display(37);
  xiF = y.display(38);
}
예제 #3
0
파일: linalg.cpp 프로젝트: McLenin/gm2
void DoubleVector::append(const DoubleVector& v)
{
   const size_t old_size = x.size();
   std::valarray<double> y(x); // old vector
   x.resize(old_size + v.size());
   end = start + x.size() - 1;
   for (size_t i = 0; i < y.size(); ++i)
      x[i] = y[i];
   for (size_t i = 0; i < v.size(); ++i)
      x[i + old_size] = v(i + v.displayStart());
}
예제 #4
0
void StandardModel<Two_scale>::setAllGauge(const DoubleVector& v)
{
   assert(v.displayStart() == 1 && v.displayEnd() == 3);
   g = v;
}