/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- 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 2 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA \*---------------------------------------------------------------------------*/ #include "ListOps.H" #include "SubList.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template inline Foam::CompactListList::CompactListList() : size_(0) {} template inline Foam::CompactListList::CompactListList ( const label nRows, const label nData ) : size_(nRows), offsets_(nRows+1, 0), m_(nData) {} template inline Foam::CompactListList::CompactListList ( const label nRows, const label nData, const T& t ) : size_(nRows), offsets_(nRows+1, 0), m_(nData, t) {} template inline Foam::autoPtr > Foam::CompactListList::clone() const { return autoPtr > ( new CompactListList(*this) ); } // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template inline const Foam::CompactListList& Foam::CompactListList::null() { return *reinterpret_cast< CompactListList* >(0); } template inline Foam::label Foam::CompactListList::size() const { return size_; } template inline bool Foam::CompactListList::empty() const { return !size_; } template inline const Foam::List& Foam::CompactListList::offsets() const { return offsets_; } template inline Foam::List& Foam::CompactListList::offsets() { return offsets_; } template inline const Foam::List& Foam::CompactListList::m() const { return m_; } template inline Foam::List& Foam::CompactListList::m() { return m_; } template inline Foam::label Foam::CompactListList::index ( const label i, const label j ) const { return offsets_[i] + j; } template inline Foam::label Foam::CompactListList::whichRow(const label i) const { if (i < 0 || i >= m_.size()) { FatalErrorIn ( "CompactListList::whichRow(const label) const" ) << "Index " << i << " outside 0.." << m_.size() << abort(FatalError); } return findLower(offsets_, i+1); } template inline Foam::label Foam::CompactListList::whichColumn ( const label row, const label i ) const { return i - index(row, 0); } template inline Foam::Xfer > Foam::CompactListList::xfer() { return xferMove(*this); } template inline void Foam::CompactListList::resize(const label nRows) { this->setSize(nRows); } template inline void Foam::CompactListList::resize ( const label nRows, const label nData ) { this->setSize(nRows, nData); } template inline void Foam::CompactListList::resize ( const label nRows, const label nData, const T& t ) { this->setSize(nRows, nData, t); } template inline void Foam::CompactListList::resize ( const UList