Top
Back: 4.18.1 vector declarations
Forward: 4.18.3 vector operations
FastBack: 4. Data types
FastForward: 5. Functions and system variables
Up: 4.18 vector
Top: Singular 2-0-4 Manual
Contents: Table of Contents
Index: F. Index
About: About This Document

4.18.2 vector expressions

A vector expression is:

  1. an identifier of type vector
  2. a function returning vector
  3. a poly expression (via the canonical embedding pp*gen(1))
  4. vector expressions combined by the arithmetic operations + or -
  5. a poly expression and a vector expression combined by the arithmetic operation *
  6. a type cast to vector using the brackets [ , ]

Example:

 
  // ordering gives priority to components:
  ring rr=0,(x,y,z),(c,dp);
  vector v=[x2+y3,2,0,x*y]+gen(6)*x6;
  v;
→ [y3+x2,2,0,xy,0,x6]
  vector w=[z3-x,3y];
  v-w;
→ [y3-z3+x2+x,-3y+2,0,xy,0,x6]
  v*(z+x);
→ [xy3+y3z+x3+x2z,2x+2z,0,x2y+xyz,0,x7+x6z]

See Type conversion and casting; ring.


Top Back: 4.18.1 vector declarations Forward: 4.18.3 vector operations FastBack: 4. Data types FastForward: 5. Functions and system variables Up: 4.18 vector Top: Singular 2-0-4 Manual Contents: Table of Contents Index: F. Index About: About This Document
            User manual for Singular version 2-0-4, October 2002, generated by texi2html.