Find the Running Median

  • + 6 comments

    Hi, wrodgers,

    For the syntax of "Matrix & operator +":
    "Matrix &" means that the resulting matrix (*this) is returned using "pass by reference"; Of course you can also use "pass by value" or "pass by pointer". I used "pass by reference" here in order to consume less memory.

    "operator" is a fixed keyword;

    "+" is the operator that to be overloaded.

    The type of "y.a" is vector >, which means a vector of VECTORS. "y.a.size()" is the size of vector, while "y.a[0].size()" is the size of VECTOR. The capital VECTOR here has no other meanings but only to distinguish from vector.

    "this" is the pointer (Matrix *) of the current obj. "*this" is the content (Matrix) of the current obj.

    Welcome more questions if the above explanation is not clear or has mistakes.