uniqueInsert

 

 

Overview

The uniqueInsert function destructively inserts the specified new object {obj} into the Vector at the specified location. If the {obj} argument does not exist in the Vector , the Vector is increased in size to accommodate the {obj}. If the {obj} is already in the Vector, no insertion is made. The index where the new {obj} was inserted or (if already in the Vector) the index where the object was found will be returned by the uniqueInsert function.

Structure

The uniqueInsert function destructively inserts the specified new value into the Structure at the specified location. If the key argument {newKey} does not exist in the Structure, the Structure is increased in size to accommodate the new key. If the key is already in the Structure, no insertion is made. The index where the new key was inserted or (if already in the Structure) the index where the key was found will be returned by the uniqueInsert function.

Matrix

The uniqueInsert function destructively inserts the specified new object {obj} into the Matrix at the specified location. If the {obj} argument does not exist in the Matrix , the Matrix is increased in size to accommodate the {obj}. If the {obj} is already in the Matrix, no insertion is made. The index where the new {obj} was inserted or (if already in the Matrix) the index where the object was found will be returned by the uniqueInsert function.

NumMatrix

The uniqueInsert function destructively inserts the specified new object {obj} into the NumMatrix at the specified location. If the {obj} argument does not exist in the NumMatrix , the NumMatrix is increased in size to accommodate the {obj}. If the {obj} is already in the NumMatrix, no insertion is made. The index where the new {obj} was inserted or (if already in the NumMatrix) the index where the object was found will be returned by the uniqueInsert function.

Usage

The uniqueInsert function is used whenever you want to install a new object into a vector. Also the uniqueInsert function behaves like the binaryInsert function except the target vector is not in sorted order.

Structure

The uniqueInsert function is used whenever you want to install a new key into a structure. Also the uniqueInsert function behaves like the binaryInsert function except the target structure is not in sorted order.

Matrix

The uniqueInsert function is used whenever you want to install a new object into a matrix. Also the uniqueInsert function behaves like the binaryInsert function except the target matrix is not in sorted order.

NumMatrix

The uniqueInsert function is used whenever you want to install a new object into a NumMatrix. Also the uniqueInsert function behaves like the binaryInsert function except the target matrix is not in sorted order.

 

Syntax


Expression:

(uniqueInsert vector obj)


Arguments Name Type Description
Argument:vectorVector NumVector ObjVector IntVector FltVector ShortVector The Vector to be updated.
Argument:objCharacter String Symbol Vector BitVector ByteVector IntVector FltVector ObjVector Structure Dictionary Directory ShortVector Matrix NumMatrix Integer Float Number Complex The object to be installed.

Returns:

The index where the object was installed or where the object was found.




Expression:

(uniqueInsert struct newkey)


Arguments Name Type Description
Argument:structStructure The structure to be updated.
Argument:newkeySymbol The new key to be installed in the Structure.

Returns:

The index where the key was installed or where the key was found.




Expression:

(uniqueInsert matrix obj)


Arguments Name Type Description
Argument:matrixMatrix The Matrix to be updated.
Argument:objCharacter String Symbol Vector BitVector ByteVector IntVector FltVector ObjVector Structure Dictionary Directory Matrix NumMatrix Integer Float Number Complex The object to be installed.

Returns:

The index where the object was installed or where the object was found.




Expression:

(uniqueInsert nummatrix obj)


Arguments Name Type Description
Argument:nummatrixNumMatrix The NumMatrix to be updated.
Argument:objCharacter String Symbol Vector BitVector ByteVector IntVector FltVector ObjVector Structure Dictionary Directory Matrix NumMatrix Integer Float Number Complex The object to be installed.

Returns:

The index where the object was installed or where the object was found.



 

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 Symbol Integer Character
String Symbol Vector BitVector
ByteVector IntVector FltVector ObjVector
Structure Dictionary Directory ShortVector
Matrix NumMatrix Integer Float
Number Complex

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

++ += + /=
/ *= * --
-= - abs acos
add1 addMethod addi appendWriteln
append apply argument arithmetic
asin atan 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 ccompareEQ
ccompareGE ccompareGT ccompareLE ccompareLT
ccompareNE cdiv cdr char
character class clean closeLog
cmod cmul code compareEQ
compareGE compareGT compareLE compareLT
compareNE compare comparison complex
compress conjugate cons copy
cos cosh count csub
date day days360 debugBrowsableProcs
debugDetective debugEval debug decode
defchild defclass define(macro) defineStructure
define defmacro defmethod deforphan
defriend defstruct defun deg
deleteRows delete dimension disassemble
display divi downcase encode
evalInSyncLocalContext eval exit exp
exportCsv exportSbf exportTab expt
fact fdisplay fieldsOf fileClose
fileCopy fileDir fileDisplay fileEraseDir
fileErase fileExists fileMakeDir fileOpen
fileReadAll fileReadRecord fileRead fileResize
fileSeek fileSizeOf fileWriteAll fileWrite
filewriteln findBlock find floor
fraction freeBlock gc gcd
getGlobalValue getRecursionCount getSymbolTable getTickCount
globalBinding hashString hour iadd
icompareEQ icompareGE icompareGT icompareLE
icompareLT icompareNE idiv imaginary
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
isExact isFloatVector isIdentical isInexact
isInside isIntegerVector isInteger isLambda
isMatrix isMember isMoney isNegative
isNull isNumberMatrix isNumberVector isNumber
isObjectVector isObject isOdd isPair
isPcodeVector isPositive isString isStructure
isSymbol isText isType isVector
isZero isub julian kurtosis
lcm left length list
loadModule loadObject loadRepository loadWorkspace
lock log10 log2 log
logbase macroReplace makeDictionary makeGaussianMatrix
makeGramMatrix makeQuotedList makeQuotedSymbol makeStructure
map mapc matrixGaussianEliminate matrixGaussianSubstitute
max median member methodsOf
mid min minute mod
modi money month muli
nadd ncompareEQ ncompareGE ncompareGT
ncompareLE ncompareLT ncompareNE ndiv
new nmod nmul now
nsub number objectToDictionary objectToDirectory
objectToList objectToMatrix objectToNumMatrix objectToNumVector
objectToStructure objectToVector offset openLog
pair parent parse pi
pointer preAllocateFixedMemoryBlocks product proplist
proprecord putprop qt rad
random randomize range rank
real refAttributes refValues ref
remProp remove rename replace
rept resize reverse right
round run saveImmediate saveModule
saveObject saveRepository saveWorkspace second
send setAttributes setBlock setCar
setCdr setLastCdr set setf
setq sigmoid sign sin
sinh sizeof skew sleep
sort sql sqrt srandom
stdev stdevp stringCiEQ stringCiGE
stringCiGT stringCiLE stringCiLT stringCiNE
stringFill stringToBVector stringToVector string
sub1 subi submit substitute
substringCiEQ substringCiGE substringCiGT substringCiLE
substringCiLT substringCiNE substringEQ substringFill
substringGE substringGT substringLE substringLT
substringNE substring sum sumsqr
super svmRegression symbolToTypeCode symbol
system tan tanh text
time trim type uncompress
uniqueInsert unlock upcase 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