up previous next
ColMat

single column matrix

Syntax
ColMat(L: LIST): MAT
ColMat(R: RING, L: LIST): MAT

Description
This function returns the matrix whose only column consists of the elements of the list L .

The first form produces a matrix over QQ if all entries in L are of type INT or RAT . If L contains any entries of type RINGELEM then the matrix is over the ring these elements belong to.

The second form produces a matrix over R , and requires that the elements of L be INT , RAT or RINGELEM belonging to R .

Example
/**/  ColMat([3,4,5]);
matrix(QQ,
 [[3],
  [4],
  [5]])

/**/  RingOf(It);  -- default ring is QQ
QQ

/**/  ColMat(ZZ, [3,4,5]);
matrix(ZZ,
 [[3],
  [4],
  [5]])
/**/  RingOf(It);
ZZ

See Also