/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011 OpenFOAM Foundation Copyright (C) 2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . Description \*---------------------------------------------------------------------------*/ #include "IndirectList.H" #include "DynamicList.H" #include "IOstreams.H" #include "ListOps.H" #include "labelIndList.H" using namespace Foam; template void printInfo(const ListType& lst) { Info<< "addr: " << flatOutput(lst.addressing()) << nl << "list: " << flatOutput(lst) << nl << endl; } template void testFind(const T& val, const ListType& lst) { Info<< nl << "Search for "<< val << " in " << flatOutput(lst) << nl <<" found() = " << lst.found(val) <<" find() = " << lst.find(val) <<" rfind() = " << lst.rfind(val) <<" find(2) = " << lst.find(val, 2) <<" rfind(2) = " << lst.rfind(val, 2) << nl << nl; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Main program: int main(int argc, char *argv[]) { labelList completeList(20); labelList scratch(20); scratch = -1; forAll(completeList, i) { completeList[i] = 10*i; } Info<< "raw : " << flatOutput(completeList) << nl << endl; List