Computer Algebra Kit (c) 1993,00 by Comp.Alg.Objects. All Rights Reserved.

**Maturity Index:** Relatively mature

There are methods to access, insert and remove scalars. It's also possible to place or replace a scalar directly at a given index. See the documentation on **eachScalar** to access the scalar at a given index.

**Note:** Vector objects are meant for computational tasks. They are no substitute for List or Collection objects, that are better suited for the purpose of storing objects.

+Creates a vector containing references to the scalars fromcollection:aCltn

+Creates a new vector withscalarZero:aScalarZeronumScalars:(int)numScalars

-Returns a new vector.copy

-Returns a new vector. SendsdeepCopy

-Returns the zero scalar element.scalarZero

- (int)Returns the number of scalar objects in the vector. Returns 0 if the vector is empty. The first scalar in the vector is at index 0, the last scalar atnumScalars

-InsertsinsertScalar:aScalar

-InsertsinsertScalar:aScalarat:(int)i

-Removes (and returns) the first scalar in the vector (the scalar at index 0). ReturnsremoveScalar

To remove a scalar, the reference count of the vector should be equal to one.while (c = [vector removeScalar]) { /* do something with c */ }

-Removes and returns the i-th scalar in the vector. IfremoveScalarAt:(int)i

-Frees the scalar at positionplaceScalar:aScalarat:(int)i

-Similar toreplaceScalarAt:(int)iwith:aScalar

-Returns a new collection containing new references to the scalars in the vector.asCollection

-Returns a new vector, whose scalars are the numerical value of the scalars of the original vector.asNumerical

-Returns a new vector, whose scalars are the value of the scalars of the original vector modasModp:(unsigned short)p

-Puts a vector with fractional scalars on a common denominator. Returns a new vector with integral scalars, and, by reference, the common denominator of the scalars in the vector.onCommonDenominator:(id *)denominator

-Returns a new sequence object that gives access to the scalars of the vector.eachScalar

- (float)Returns thefloatValueAt:(int)i

- (int)Returns theintValueAt:(int)i

-Returns a vector of the same dimension as the object that receives the message, but all filled with zero scalars.zero

-Returns aaddScalar:sat:(int)i

**See also:** insertScalar:at:, replaceScalar:at:

-Returns asubtractScalar:sat:(int)i

-Returns a new scalar product, the dot product of the vector by itself, defined as the sum of squares of the scalars in the vector.dotSquare

-Returns a new scalar product, the dot product of the vectordotMultiply:aVector

-Returns a new vector, the product ofmultiplyLeftMatrix:aMatrix

-Prints, between braces, a comma separated list of the scalars (by sendingprintOn:(IOD)aFile