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; }
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; }
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; }