resize

 

 

Overview

The resize function changes a Vector object {vector} size to the specified size {size}. If the Vector is enlarged the new spaces are filled with #void. If the Vector is downsized, the trailing values are dropped.

Structure

The resize function changes a Structure object {struct} size to the specified size {size}. If the Structure is expanded, the new spaces are filled with #void. If the object is downsized, the trailing values are dropped.

Dictionary

The resize function changes a Dictionary object {dict} size to the specified size {size}. If the Dictionary is expanded, the new spaces are filled with #void. If the object is downsized, the trailing values are dropped.

Directory

The resize function changes a Directory object {dir} size to the specified size {size}. If the Directory is expanded, the new spaces are filled with #void. If the object is downsized, the trailing values are dropped.

Matrix

The resize function changes a Matrix object {matrix} size to the specified size {size}. If the Matrix is enlarged the new spaces are filled with #void. If the Matrix is downsized, the trailing values are dropped.

NumMatrix

The resize function changes a NumMatrix object {matrix} size to the specified size {size}. If the NumMatrix is enlarged the new spaces are filled with #void. If the NumMatrix is downsized, the trailing values are dropped.

Usage

The resize function can be used to downsize or enlarge a dictionary, directory structure, vector or matrix in one step. It is more time efficient if the target size is known from the start, than expanding or contracting the dictionary, directory structure, vector or matrix one binding at a time.

 

Syntax


Expression:

(resize vector size)


Arguments Name Type Description
Argument:vectorVector FltVector IntVector NumVector ObjVector BitVector ShortVector The Vector to be resized
Argument:sizeInteger The target size (i.e. the number of bindings).

Returns:

Returns the updated vector.




Expression:

(resize struct size)


Arguments Name Type Description
Argument:structStructure The Structure to be resized
Argument:sizeInteger The target size (i.e. the number of bindings).

Returns:

Returns the updated structure




Expression:

(resize dict size)


Arguments Name Type Description
Argument:dictDictionary The Dictionary to be resized
Argument:sizeInteger The target size (i.e. the number of bindings).

Returns:

Returns the updated dictionary




Expression:

(resize dir size)


Arguments Name Type Description
Argument:dirDirectory The Directory to be resized
Argument:sizeInteger The target size (i.e. the number of bindings).

Returns:

Returns the updated directory




Expression:

(resize matrix size)


Arguments Name Type Description
Argument:matrixMatrix The Matrix to be resized
Argument:sizeInteger The target size (the Matrix is assumed to be of rank one) .

Returns:

Returns the updated matrix.




Expression:

(resize matrix rank dimensions)


Arguments Name Type Description
Argument:matrixMatrix The Matrix to be resized
Argument:rankInteger The target rank.
Argument:dimensionsInteger The target dimension list.

Returns:

Returns the updated matrix.




Expression:

(resize nummatrix size)


Arguments Name Type Description
Argument:nummatrixNumMatrix The NumMatrix to be resized
Argument:sizeInteger The target size (the NumMatrix is assumed to be of rank one) .

Returns:

Returns the updated matrix.




Expression:

(resize nummatrix rank dimensions)


Arguments Name Type Description
Argument:nummatrixNumMatrix The NumMatrix to be resized
Argument:rankInteger The target rank.
Argument:dimensionsInteger The target dimension list.

Returns:

Returns the updated nummatrix.



 

Examples

Here are a number of links to Lambda coding examples which contain this instruction in various use cases.

 

Argument Types

Here are the links to the data types of the function arguments.

Structure Dictionary Directory Vector
Integer NumMatrix Matrix ShortVector
FltVector IntVector NumVector ObjVector
BitVector

Here are also a number of links to functions having arguments with any of these data types.

++ += + /=
/ * -- -=
- addMethod addi appendWriteln
append apply avg badd
balance bdiv binaryInsert binaryNand
binaryNor binaryNot binaryNxor binarySearch
bitToIntegerVector bitToNumberVector bitwiseAnd bitwiseNand
bitwiseNor bitwiseNot bitwiseNxor bitwiseOr
bitwiseShiftLeft bitwiseShiftRight bitwiseXor bmod
bmul boolean cadd cdiv
cdr char character class
cmod cmul code compareEQ
compareGE compareGT compareLE compareLT
compareNE compare comparison cons
copy count csub day
days360 debugDetective defineStructure defstruct
deleteRows delete dimension display
divi evalInSyncLocalContext exit exportCsv
exportSbf exportTab fact fdisplay
fieldsOf fileClose fileCopy fileDisplay
fileErase fileOpen fileReadRecord fileRead
fileResize fileSeek fileWrite filewriteln
findBlock find floor fraction
freeBlock gcd getRecursionCount getSymbolTable
globalBinding hashString hour iadd
icompareEQ icompareGE icompareGT icompareLE
icompareLT icompareNE idiv imod
importCsv importSbf importTab imul
insertRows insert inside inspect
integer isAtom isBitVector isBoolean
isBound isByteVector isCharAlphabetic isCharAlphanumeric
isCharLowercase isCharName isCharNumeric isCharUppercase
isCharWhitespace isChar isCharacter isClass
isComplex isDate isDictionary isDirectory
isEqual isError isEven isFloatVector
isIdentical isInside isIntegerVector isInteger
isLambda isMatrix isMember isMoney
isNumberMatrix isNumberVector isNumber isObjectVector
isObject isPair isPcodeVector isString
isStructure isSymbol isText isType
isVector isub kurtosis lcm
left length list loadRepository
macroReplace makeDictionary makeGaussianMatrix makeGramMatrix
makeQuotedList makeStructure map mapc
matrixGaussianEliminate matrixGaussianSubstitute max median
member methodsOf mid min
minute mod modi money
month muli new number
objectToDictionary objectToDirectory objectToList objectToMatrix
objectToNumMatrix objectToNumVector objectToStructure objectToVector
offset pair parent parse
pointer preAllocateFixedMemoryBlocks product proprecord
putprop qt random randomize
range rank refAttributes refValues
ref remProp remove replace
rept resize reverse right
round saveImmediate saveObject saveRepository
second send setAttributes setBlock
setCar setCdr setLastCdr setq
sizeof skew sort sql
sqrt srandom stdev stdevp
stringToBVector stringToVector string subi
substitute substring sum sumsqr
super svmRegression system text
time type uniqueInsert var
varp vectorBinaryInnerProduct vectorBipolarInnerProduct vectorCosineInnerProduct
vectorCubeInnerProduct vectorDelete vectorExpInnerProduct vectorFill
vectorInnerProduct vectorLogInnerProduct vectorQuartInnerProduct vectorQuintInnerProduct
vectorSigmoidInnerProduct vectorSineInnerProduct vectorSquareInnerProduct vectorTanInnerProduct
vectorTanhInnerProduct writelg writeln year

Analytic Information Server (AIS)

AIS Component Systems

  • Smartbase Engine
  • QT C++ Libraries
  • MySQL Relational Database
  • AIS Lisp Libraries
  • Rapid Analytic Demo IDE