Menu

repmat functionality.

2007-06-28
2012-09-15
  • Mark Dobossy

    Mark Dobossy - 2007-06-28

    I just posted a header file in the tracker that replicates the repmat function in matlab. There are two functions- one for replicating a matrix, and one for replicating a vector.

    I had one question about how I was converting the vector into either a 1xn matrix or an nx1 matrix. It seems that I have to do either vector.T() or vector.T().T(). Is there a better way to do this?

    As a side note- I haven't given up on the vector sorting. I am working on a few optimizations and will be uploading some code in a few days.

     
    • Adam Piątyszek

      Adam Piątyszek - 2007-06-28

      Hi Mark,

      First of all, thanks for your contribution of the repmap() function. I will try to take care of it as soon as possible.

      As for the conversion problem of vectors, you should know that vectors in IT++ are treated as column ones by default. So to have a matrix of size nx1 you just need to use Mat<> constructor, e.g.

      vec v = randn(5);
      mat M(v);

      Eventually you can use reshape function:

      mat M = reshape(v, v.size(), 1); // nx1 matrix
      mat M = reshape(v, 1, v.size()); // 1xn matrix

      BR,
      /ediap

       
    • Mark Dobossy

      Mark Dobossy - 2007-06-28

      Ok, I made a couple minor changes to the vector conversion, and have uploaded a new version of the repmat.h file to the tracker.

      One last question- I am assuming the comments above each function are for automatically generated documentation. What software do you use, and is there a document that describes the various options (e.g.: \param describes an input parameter, \notes lets you attach notes).

       
      • Adam Piątyszek

        Adam Piątyszek - 2007-06-28

        We use Doxygen for generating the reference documentation in HTML format. More info on http://www.doxygen.org

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.