struct SparseElement { int Col; double Entry; }; struct SparseRow { bool FindElement(UINT Col, SparseElement* &Output); Vector Data; }; class SparseMatrix { public: void Init(UINT _Size); void PushElement(UINT Row, UINT Col, double Entry); void Transpose(SparseMatrix &O); Vector Rows; UINT Size; }; void Multiply(Vector &Output, SparseMatrix &M, Vector &V); void Multiply(Vector &Output, double D, Vector &V); void Multiply(Vector &Output, Vector &V, double D); double Multiply(Vector &L, Vector &R); void Add(Vector &Output, Vector &L, Vector &R); void Subtract(Vector &Output, Vector &L, Vector &R);