Nub in

From APL Wiki
Revision as of 16:42, 27 January 2024 by Marshall (talk | contribs) (Created page with ":''The name "self-classify" may also refer to the related function Classify, which returns a vector of indices instead of a boolean matrix.'' {{Built-in|Nub in|<nowiki>=</nowiki>}}, '''nub-classify''', or '''self-classify''', is a monadic function that indicates which unique cell each of its argument cells matches. It returns a boolean matrix where the first axis corresponds to unique cells and the second to all cells, and might be implemented as <sy...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The name "self-classify" may also refer to the related function Classify, which returns a vector of indices instead of a boolean matrix.
=

Nub in (=), nub-classify, or self-classify, is a monadic function that indicates which unique cell each of its argument cells matches. It returns a boolean matrix where the first axis corresponds to unique cells and the second to all cells, and might be implemented as {(∪⍵)∘.≡⍵} or ∪∘.≡⊢ in a nested APL (in SHARP APL, (≡⍤0) must be used in place of ). The function was defined in A Dictionary of APL and is implemented by SAX and J. However, it is deprecated in J because of the result size, which can be quadratic in the size of the argument, and Roger Hui eventually began to use "self-classify" to refer to the Classify function instead.

Documentation


APL built-ins [edit]
Primitives (Timeline) Functions
Scalar
Monadic ConjugateNegateSignumReciprocalMagnitudeExponentialNatural LogarithmFloorCeilingFactorialNotPi TimesRollTypeImaginarySquare Root
Dyadic AddSubtractTimesDivideResiduePowerLogarithmMinimumMaximumBinomialComparison functionsBoolean functions (And, Or, Nand, Nor) ∙ GCDLCMCircularComplexRoot
Non-Scalar
Structural ShapeReshapeTallyDepthRavelEnlistTableCatenateReverseRotateTransposeRazeMixSplitEncloseNestCut (K)PairLinkPartitioned EnclosePartition
Selection FirstPickTakeDropUniqueIdentityStopSelectReplicateExpandSet functions (IntersectionUnionWithout) ∙ Bracket indexingIndexCartesian ProductSort
Selector Index generatorGradeIndex OfInterval IndexIndicesDealPrefix and suffix vectors
Computational MatchNot MatchMembershipFindNub SieveEncodeDecodeMatrix InverseMatrix DivideFormatExecuteMaterialiseRange
Operators Monadic EachCommuteConstantReplicateExpandReduceWindowed ReduceScanOuter ProductKeyI-BeamSpawnFunction axis
Dyadic BindCompositions (Compose, Reverse Compose, Beside, Withe, Atop, Over) ∙ Inner ProductDeterminantPowerAtUnderRankDepthVariantStencilCutDirect definition (operator)
Quad names Index originComparison toleranceMigration levelAtomic vector