// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2008-2009 Guillaume Saupin <guillaume.saupin@cea.fr> // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If a copy of the MPL was not distributed // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
/** Stores a skyline set of values in three structures : * The diagonal elements * The upper elements * The lower elements *
*/ template<typename Scalar> class SkylineStorage { typedeftypename NumTraits<Scalar>::Real RealScalar; typedef SparseIndex Index; public:
void reserve(Index size, Index upperProfileSize, Index lowerProfileSize, Index upperSize, Index lowerSize) {
Index newAllocatedSize = size + upperSize + lowerSize; if (newAllocatedSize > m_allocatedSize)
reallocate(size, upperProfileSize, lowerProfileSize, upperSize, lowerSize);
}
inlinevoid reallocate(Index diagSize, Index upperProfileSize, Index lowerProfileSize, Index upperSize, Index lowerSize) {
Scalar* diag = new Scalar[diagSize];
Scalar* upper = new Scalar[upperSize];
Scalar* lower = new Scalar[lowerSize];
Index* upperProfile = new Index[upperProfileSize];
Index* lowerProfile = new Index[lowerProfileSize];
Index copyDiagSize = (std::min)(diagSize, m_diagSize);
Index copyUpperSize = (std::min)(upperSize, m_upperSize);
Index copyLowerSize = (std::min)(lowerSize, m_lowerSize);
Index copyUpperProfileSize = (std::min)(upperProfileSize, m_upperProfileSize);
Index copyLowerProfileSize = (std::min)(lowerProfileSize, m_lowerProfileSize);
public:
Scalar* m_diag;
Scalar* m_upper;
Scalar* m_lower;
Index* m_upperProfile;
Index* m_lowerProfile;
Index m_diagSize;
Index m_upperSize;
Index m_lowerSize;
Index m_upperProfileSize;
Index m_lowerProfileSize;
Index m_allocatedSize;
};
} // end namespace Eigen
#endif// EIGEN_SKYLINE_STORAGE_H
Messung V0.5
¤ Dauer der Verarbeitung: 0.16 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.