void Multiply ( Scalar alpha, const Dense<Scalar>& A, const Vector<Scalar>& x, Vector<Scalar>& y ) { #ifndef RELEASE CallStackEntry entry("hmat_tools::Multiply (y := D x)"); #endif y.Resize( A.Height() ); if( A.Symmetric() ) { blas::Symv ( 'L', A.Height(), alpha, A.LockedBuffer(), A.LDim(), x.LockedBuffer(), 1, 0, y.Buffer(), 1 ); } else { blas::Gemv ( 'N', A.Height(), A.Width(), alpha, A.LockedBuffer(), A.LDim(), x.LockedBuffer(), 1, 0, y.Buffer(), 1 ); } }
void Multiply ( Scalar alpha, const LowRank<Scalar>& A, const Vector<Scalar>& x, Scalar beta, Vector<Scalar>& y ) { #ifndef RELEASE CallStackEntry entry("hmat_tools::Multiply (y := F x + y)"); #endif const int r = A.Rank(); // Form t := alpha (A.V)^[T,H] x Vector<Scalar> t( r ); const char option = 'T'; blas::Gemv ( option, A.Width(), r, alpha, A.V.LockedBuffer(), A.V.LDim(), x.LockedBuffer(), 1, 0, t.Buffer(), 1 ); // Form y := (A.U) t + beta y blas::Gemv ( 'N', A.Height(), r, 1, A.U.LockedBuffer(), A.U.LDim(), t.LockedBuffer(), 1, beta, y.Buffer(), 1 ); }
void DebugUpdateBoudingBox( GeometryBuffer* gb, const BoundingBox& box, Color color ) { struct Vertex { Vector3 pos; Color color; }; Vector<Vertex> vs; vs.Resize(24); size_t i = 0; ADD_BOX_FACE( 0, 2, 3, 1 ) // Front ADD_BOX_FACE( 0, 1, 5, 4 ) // Bottom ADD_BOX_FACE( 4, 5, 7, 6 ) // Back ADD_BOX_FACE( 2, 6, 7, 3 ) // Top ADD_BOX_FACE( 0, 4, 6, 2 ) // Left ADD_BOX_FACE( 1, 3, 7, 5 ) // Right for(i = 0; i < vs.Size(); i++) { vs[i].color = color; } gb->add((uint8*)vs.Buffer(), vs.Size()*sizeof(Vertex)); gb->forceRebuild(); }
void Packet::write(Vector<byte>& data) { write(data.Buffer(), data.Size()); }