5.2.1.1 Vector Objects

class Vector
Vector( parent)

Instances of class Vector have the following methods (in addition to inherited methods and special methods):

base_field,$  $ base_ring,$  $ copy,$  $ degree,$  $ denominator,$  $ dict,$  $ entries,$  $ get,$  $ height,$  $ is_dense,$  $ is_sparse,$  $ is_vector,$  $ list,$  $ nonzero_positions,$  $ parent,$  $ rational_reconstruction,$  $ set,$  $ str_latex

These methods are defined as follows:

base_field( )

base_ring( )

copy( )

degree( )

denominator( )

dict( )

entries( )

get( i)

get is meant to be more efficient than getitem, because it does not do any error checking.

height( )

is_dense( )

is_sparse( )

is_vector( )

list( )

nonzero_positions( )

Returns the sorted list of integers i such that self[i] != 0.

parent( )

rational_reconstruction( )

set( i, x)

set is meant to be more efficient than setitem, because it does not do any error checking or coercion. Use with care.

str_latex( )

Print a latex representation of self. For example, if self is [1,2,3,4], the following latex is generated: (1,2,3,4)

Instances of class Vector also have the following special methods:

__abs__( )

__add__( right)

__cmp__( right)

__getitem__( i)

__invert__( )

__mod__( p)

__mul__( right)

__neg__( )

__pos__( )

__pow__( n)

__rmul__( left)

__setitem__( i, x)

__str__( )

__sub__( right)

See About this document... for information on suggesting changes.