VLcorrelate

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
Introduced first in SolidGeometry 4.9, Creation date: 2020-08-22, Last change: 2025-09-14

returns the indices of a list in another list

Description

This function finds the indices of some vertices in a longer list. For a complete remapping use function "maprows".
bi=findVL(VL,ai); bi=ai(bi)
maprows is extremely and unbeatable fast

See Also: maprows , reversesortindex , VLFLreorder

Example Illustration

 missing image of VLcorrelate(NVL,VL,thr)

Syntax

vi=VLcorrelate(NVL,VL,[thr])

Input Parameter

NVL: Long vertex list to search in; must not be unique, first entry is returned
VL: Second vertex list to find in NVL
thr: optional index list to search for

Output Parameter

vi: index in NVL

Examples


VL1=rounddiv(rand(20,3)*100,5)-50, VL2=rounddiv(rand(20,3)*100,5)-50
VLcorrelate(VL1,ELunsort(VL1))
VLcorrelate([VL1;VL2],ELunsort(VL1))
VLcorrelate([VL1],[ELunsort(VL1);ELunsort(VL2)])




Copyright 2020-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Algorithm (Workflow)

This function, VLcorrelate, is designed to find the indices of vertices from a shorter list (VL) within a longer list (NVL). It returns the indices of the first occurrence of each vertex from VL in NVL.

Input Parameters

Output

Algorithm Steps

  1. Initialize the output vector vi with NaN values, having the same number of rows as VL.
  2. Iterate over each vertex in VL:

Example Usage

The function can be used to correlate vertices from two lists, as shown in the examples:

Algorithm explaination created using ChatGPT on 2025-08-19 01:25. (Please note: No guarantee for the correctness of this explanation)

Last html export of this page out of FM database by TL: 2025-09-21