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


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

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

  1. #1
    Join Date
    Dec 2008
    Posts
    1

    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
    Posts
    3,366
    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;
    return(WORKSPACE);
    }
    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];
    }
    }
    return(WORKSPACE);
    }

  3. #3
    Join Date
    Nov 2003
    Posts
    4,118
    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, 11:09 PM
  2. need help in matrix in vc++
    By cmit in forum C++
    Replies: 7
    Last Post: 05-29-2008, 10:11 AM
  3. Matrix Problem
    By Peter_APIIT in forum C++
    Replies: 18
    Last Post: 06-09-2007, 05:32 AM
  4. Matrix Problem in C++
    By emmanuella in forum C++
    Replies: 2
    Last Post: 11-23-2006, 06: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, 04: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
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

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