up previous next
NewFreeModule

create a new FreeModule

Syntax
NewFreeModule(R: RING, N: INT): MODULE
NewFreeModule(R: RING, Shifts: MAT): MODULE

Description
This function returns a free module which can be used as any programming variable.

NOTE: as for rings, calling twice NewFreeModule will produce two different modules, even with identical input: equality test is performed on the pointers.

This function does accept shifts from version CoCoA-5.0.4.

Example
/**/  use R ::= QQ[x,y];
/**/  F := NewFreeModule(R, 3);
/**/  zero(F);
[0, 0, 0]
/**/ type(zero(F));  -- is NOT a LIST
MODULEELEM
/**/ gens(F);
[[1, 0, 0], [0, 1, 0], [0, 0, 1]]

/**/ F := NewFreeModule(R, matrix([[1],[2],[3]])); -- shifts
/**/ [wdeg(e) | e in gens(F)];
[[1], [2], [3]]

See Also