コード例 #1
0
ファイル: matrix3.cpp プロジェクト: cerber4s/survival
Matrix3 Matrix3::operator*(double factor) const
{
  Matrix3 out;
  int i, j;
  for (i = 0; i < 3; i++) 
  {
    for (j = 0; j < 3; j++)
    {
          out.Set(i, j, out.Get(i, j) * factor);
    }
  }
  return out;
}
コード例 #2
0
ファイル: matrix3.cpp プロジェクト: cerber4s/survival
Matrix3 Matrix3::operator*(const Matrix3& other) const
{
  Matrix3 out;
  int i, j, k;
  double t;
  for (i = 0; i < 3; i++) 
  {
    for (j = 0; j < 3; j++) 
    {
      t = 0.0;
      for (k = 0; k < 3; k++) 
      {
        t += Get(i, k) * other.Get(k, j);
      }
      out.Set(i, j, t);
    }
  }
  return out;
}
コード例 #3
0
ファイル: MolSceneGraph.cpp プロジェクト: airvine/spinachgui
    void SetMatrix(const Matrix3& mat3) {
	//Set the elements of the matrix that matter (others will have been
	//set to 0 in the constructor, so there isn't any need to set them
	//again) 
	/*Calc eigenvectors here*/
	evec_x=Vector3(1.0,0.0,0.0);
	evec_y=Vector3(0.0,1.0,0.0);
	evec_z=Vector3(0.0,0.0,1.0);

	mat[0 ]=abs(mat3.Get(0,0));
	mat[1 ]=abs(mat3.Get(0,1));
	mat[2 ]=abs(mat3.Get(0,2));
			
	mat[4 ]=abs(mat3.Get(1,0));
	mat[5 ]=abs(mat3.Get(1,1));
	mat[6 ]=abs(mat3.Get(1,2));
			
	mat[8 ]=abs(mat3.Get(2,0));
	mat[9 ]=abs(mat3.Get(2,1));
	mat[10]=abs(mat3.Get(2,2));

	trace=mat3.Trace();
    }