MathGroup Archive 2000

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Transposing a triangular matrix.


Regarding transposing a triangular matrix (in list form), Rob Pratt has 
shown me a smart way by using Table to deal with an upper triangular 
input. According to his illustration I added the function for lower 
triangular input cases as below.

Wen-Feng
--------
upperTriTranspose[lis_List]:=Table[lis[[i,k+1-i]],{k,Length[lis]},{i,k}]
lowerTriTranspose[lis_List]:=
  Table[lis[[i,k]],{k,Length[lis]},{i,k, Length[lis]}]
triTranpose[lst_List]:=If[lowerTriMatrixQ[lst], 
      Return[lowerTriTranspose[lst]];,
      If[upperTriMatrixQ[lst],
        Return[upperTriTranspose[lst]];,
        Print["Not a triangular list!"]]];


  • Prev by Date: Re: Exponential curve fit
  • Next by Date: RealTime3D documentation or help
  • Previous by thread: Re: Transposing a triangular matrix.
  • Next by thread: "Best" ComplexityFunction Setting ?