DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2008

    Unhappy matrix (was: Need help for C++!!!)

    I need someone to make my program on C++ A program introducing numerical values in a matrix "a" (3, 4). A program to transpose the matrix "a" in a new matrix "ta"(4, 3).

    This is for School, or my teacher will be verry angry with me, pls help me someone.!!

  2. #2
    Join Date
    Dec 2003
    This forum is not for us to do your homework for you. Try it, post what you have, and ask for some help is fine, but for us to do it for you, that is cheating and you learn nothing and we get stuck with someone at our job who knows nothing because he cheated through school, and then we have to do both his job and our own.... its an ugly world when that happens.

    However, on the grounds that if you turn this in you will still fail (once you cannot explain it) I will offer you my high speed xpose routine, in hopes that you learn something from it.

    Workspace is a global, because I need fast more than I need clean deep in my engine.

    Matrix& Matrix::operator! ()
    {//Standard matrix transpose (matlab uses ' but c++ cannot overload to use it)
    //NOT of a matrix is nonsense so ! fills in nicely here
    register unsigned int j;
    register unsigned int k;

    if(rows == 1 || cols ==1) //it would be nice to just flip rows and cols but result assign would be unsafe!
    WORKSPACE = *this;
    WORKSPACE.rows = cols;
    WORKSPACE.cols = rows;
    WORKSPACE.rows = cols;
    WORKSPACE.cols = rows;

    for(k = 0; k < rows; k++)
    for(j = 0; (j < cols); j++)
    WORKSPACE.data[j*rows + k] = data[k*cols +j];

  3. #3
    Join Date
    Nov 2003
    I wouldn't want your teacher to be very angry, which is what would probably happen if s/he found out you're asking other people to do your homework for you.
    Seriously, you need to show some effort on your side and come up with specific questions.
    Danny Kalev

Similar Threads

  1. Problem with Matrix template class
    By greenmile in forum C++
    Replies: 2
    Last Post: 10-16-2008, 10:09 PM
  2. need help in matrix in vc++
    By cmit in forum C++
    Replies: 7
    Last Post: 05-29-2008, 09:11 AM
  3. Matrix Problem
    By Peter_APIIT in forum C++
    Replies: 18
    Last Post: 06-09-2007, 04:32 AM
  4. Matrix Problem in C++
    By emmanuella in forum C++
    Replies: 2
    Last Post: 11-23-2006, 05:07 PM
  5. Free ASP.NET Web Matrix Design/Editor Tool Released
    By ASPSmith Training in forum dotnet.announcements
    Replies: 0
    Last Post: 06-18-2002, 03:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.