Esempio n. 1
0
bool dng_vector::operator== (const dng_vector &v) const
	{
	
	if (Count () != v.Count ())
		{
		
		return false;
		
		}
	
	for (uint32 j = 0; j < Count (); j++)	
		{
		
		if (fData [j] != v.fData [j])
			{
			
			return false;
			
			}
		
		}
			
	return true;
	
	}
Esempio n. 2
0
dng_vector operator* (const dng_matrix &A,
					  const dng_vector &B)
	{
	
	if (A.Cols () != B.Count ())
		{
		
		ThrowMatrixMath ();
					 
		}
	
	dng_vector C (A.Rows ());
	
	for (uint32 j = 0; j < C.Count (); j++)
		{
		
		C [j] = 0.0;
		
		for (uint32 m = 0; m < A.Cols (); m++)
			{
			
			real64 aa = A [j] [m];
			
			real64 bb = B [m];
			
			C [j] += aa * bb;
			
			}
		
		}
			
	return C;

	}
Esempio n. 3
0
void PrintMatrix(const char *title, const dng_vector &v)
{
  int i;
  if(title) {
    std::cout << title << "=";
  }
  for(i=0; i<v.Count(); i++) {
    std::cout << " " << v[i];
  }
  std::cout << std::endl;
}