transpose of a nx1 matrix

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • sangeetha

    transpose of a nx1 matrix

    Hi,
    i need to transpose a nx1 matrix to 1xn matrix inorder to multiply
    with nxn matrix in c language ...
    can anyone help in this coding ..the nx1 matrix is pi[i] the data type
    is double *pi..this is used through out the program ..now i need this
    transpose for further calculations... .

    Kindly help as soon as possible.....if this is not possible kindly
    suggest me something...
  • imanpreet@gmail.com

    #2
    Re: transpose of a nx1 matrix

    911 is busy. Please call later.

    Comment

    • Michael Mair

      #3
      Re: transpose of a nx1 matrix

      sangeetha wrote:[color=blue]
      > Hi,
      > i need to transpose a nx1 matrix to 1xn matrix inorder to multiply
      > with nxn matrix in c language ...
      > can anyone help in this coding ..the nx1 matrix is pi[i] the data type
      > is double *pi..this is used through out the program ..now i need this
      > transpose for further calculations... .
      >
      > Kindly help as soon as possible.....if this is not possible kindly
      > suggest me something...[/color]

      I suggest you write the code for the matrix multiplication,
      have a long look at it and try to find out what happens if
      you exchange your index variables. If you still have problems,
      then come back here -- with code.

      -Michael
      --
      E-Mail: Mine is an /at/ gmx /dot/ de address.

      Comment

      • Kiru Sengal

        #4
        Re: transpose of a nx1 matrix

        sangeetha wrote:[color=blue]
        > Hi,
        > i need to transpose a nx1 matrix to 1xn matrix inorder to multiply
        > with nxn matrix in c language ...
        > can anyone help in this coding ..the nx1 matrix is pi[i] the data[/color]
        type[color=blue]
        > is double *pi..this is used through out the program ..now i need this
        > transpose for further calculations... .
        >
        > Kindly help as soon as possible.....if this is not possible kindly
        > suggest me something...[/color]


        General notes about transposes of matrices:

        If A = B^t, then A is the transpose of B

        and also if B = b(i,j) then A = a(j,i)

        ---

        Writing code to find A given B (general transpose algorithm) is much
        easier than writing code to mulitply two matrices. If you are the one
        who coded your matrix multiplying functions, then you should have no
        problem doing this.


        In your case, you are starting with a column vector and require
        transposing to a row vector. Just treat the column vector as a row
        vector whenever you need the transpose (an array with one dimension can
        be treated as a column or a row). Just pass your column vector to the
        matrix multiplying function (along with your nxn matrix) in a way that
        the function thinks it's receiving a row vector. More specific help
        will require more details about the current state of your code.


        Good luck.

        Comment

        • sangeetha

          #5
          Re: transpose of a nx1 matrix

          CAN EXPLAIN ME WITH THE CODING ....


          "Kiru Sengal" <kiru.sengal@gm ail.com> wrote in message news:<110844850 2.434498.19080@ l41g2000cwc.goo glegroups.com>. ..[color=blue]
          > sangeetha wrote:[color=green]
          > > Hi,
          > > i need to transpose a nx1 matrix to 1xn matrix inorder to multiply
          > > with nxn matrix in c language ...
          > > can anyone help in this coding ..the nx1 matrix is pi[i] the data[/color]
          > type[color=green]
          > > is double *pi..this is used through out the program ..now i need this
          > > transpose for further calculations... .
          > >
          > > Kindly help as soon as possible.....if this is not possible kindly
          > > suggest me something...[/color]
          >
          >
          > General notes about transposes of matrices:
          >
          > If A = B^t, then A is the transpose of B
          >
          > and also if B = b(i,j) then A = a(j,i)
          >
          > ---
          >
          > Writing code to find A given B (general transpose algorithm) is much
          > easier than writing code to mulitply two matrices. If you are the one
          > who coded your matrix multiplying functions, then you should have no
          > problem doing this.
          >
          >
          > In your case, you are starting with a column vector and require
          > transposing to a row vector. Just treat the column vector as a row
          > vector whenever you need the transpose (an array with one dimension can
          > be treated as a column or a row). Just pass your column vector to the
          > matrix multiplying function (along with your nxn matrix) in a way that
          > the function thinks it's receiving a row vector. More specific help
          > will require more details about the current state of your code.
          >
          >
          > Good luck.[/color]

          Comment

          • sangeetha

            #6
            Re: transpose of a nx1 matrix

            CAN YOU EXPLAIN ME WITH THE CODING...


            "Kiru Sengal" <kiru.sengal@gm ail.com> wrote in message news:<110844850 2.434498.19080@ l41g2000cwc.goo glegroups.com>. ..[color=blue]
            > sangeetha wrote:[color=green]
            > > Hi,
            > > i need to transpose a nx1 matrix to 1xn matrix inorder to multiply
            > > with nxn matrix in c language ...
            > > can anyone help in this coding ..the nx1 matrix is pi[i] the data[/color]
            > type[color=green]
            > > is double *pi..this is used through out the program ..now i need this
            > > transpose for further calculations... .
            > >
            > > Kindly help as soon as possible.....if this is not possible kindly
            > > suggest me something...[/color]
            >
            >
            > General notes about transposes of matrices:
            >
            > If A = B^t, then A is the transpose of B
            >
            > and also if B = b(i,j) then A = a(j,i)
            >
            > ---
            >
            > Writing code to find A given B (general transpose algorithm) is much
            > easier than writing code to mulitply two matrices. If you are the one
            > who coded your matrix multiplying functions, then you should have no
            > problem doing this.
            >
            >
            > In your case, you are starting with a column vector and require
            > transposing to a row vector. Just treat the column vector as a row
            > vector whenever you need the transpose (an array with one dimension can
            > be treated as a column or a row). Just pass your column vector to the
            > matrix multiplying function (along with your nxn matrix) in a way that
            > the function thinks it's receiving a row vector. More specific help
            > will require more details about the current state of your code.
            >
            >
            > Good luck.[/color]

            Comment

            • E. Robert Tisdale

              #7
              Re: transpose of a nx1 matrix

              sangeetha wrote:[color=blue]
              >
              > I need to transpose a nx1 matrix to 1xn matrix
              > in order to multiply with nxn matrix in C.[/color]

              No. You don't.
              [color=blue]
              > Can anyone help in this coding?
              > The nx1 matrix is pi[i] the data type is double *pi.
              > This is used through out the program.
              > Now I need this transpose for further calculations.
              >
              > Kindly help as soon as possible.
              > If this is not possible kindly suggest me something.[/color]

              The C computer programming language doesn't know anything
              about matrices, rows or columns.
              Your 1-dimensional array

              double pi[];

              can represent either a row or a column.
              you don't need to "transpose" it.

              Comment

              • Dawn Minnis

                #8
                Re: transpose of a nx1 matrix

                >> I need to transpose a nx1 matrix to 1xn matrix[color=blue][color=green]
                >> in order to multiply with nxn matrix in C.[/color]
                >
                > No. You don't.
                >[color=green]
                >> The nx1 matrix is pi[i] the data type is double *pi.
                >> Now I need this transpose for further calculations.[/color]
                >
                > The C computer programming language doesn't know anything
                > about matrices, rows or columns.
                > Your 1-dimensional array
                >
                > double pi[];
                >
                > can represent either a row or a column.
                > you don't need to "transpose" it.
                >[/color]

                Oh - Good spotting Robert

                If all your matricies are one dimensional then transposition does not come
                into play. However, if you have ordinary matricies that need transposed
                then it is all in the way you traverse the array. A series of nested for
                loops to be exact. If you can read Fortran code take a look at
                http://www.netlib.org/blas/dgemm.f for code to multiply 2 dimensional
                matricies.

                Regards
                Dawn


                Comment

                Working...