// Copyright (C) 2026 Kiyotsugu Arai // SPDX-License-Identifier: LGPL-3.0-or-later // matrix.cpp — explicit instantiation of Matrix (float, double) // // This compiles the float/double Matrix code into sangi_matrix.lib exactly once, // suppressing template re-instantiation in each TU. // It pairs with the extern template declarations on the header side. // In this TU, disable extern template and generate the actual entities here #define SANGI_MATRIX_EXPLICIT_INSTANTIATION #include // The implementation body of Matrix::solve() lives in solvers.hpp, so // include solvers.hpp here as well to ensure that the explicit instantiation // (Matrix, Matrix) resolves all member functions. #include namespace sangi { // --------------------------------------------------------------------------- // detail::DynamicMatrixStorage // --------------------------------------------------------------------------- template class detail::DynamicMatrixStorage; template class detail::DynamicMatrixStorage; // --------------------------------------------------------------------------- // detail::MatrixBase> // --------------------------------------------------------------------------- template class detail::MatrixBase>; template class detail::MatrixBase>; // --------------------------------------------------------------------------- // Matrix // --------------------------------------------------------------------------- template class Matrix; template class Matrix; // --------------------------------------------------------------------------- // Free functions // --------------------------------------------------------------------------- template Matrix power(const Matrix&, unsigned int); template Matrix power(const Matrix&, unsigned int); template std::ostream& operator<<(std::ostream&, const Matrix&); template std::ostream& operator<<(std::ostream&, const Matrix&); template std::string toLatex(const Matrix&, const std::string&, std::size_t); template std::string toLatex(const Matrix&, const std::string&, std::size_t); template Matrix zeros(std::size_t, std::size_t); template Matrix zeros(std::size_t, std::size_t); template Matrix ones(std::size_t, std::size_t); template Matrix ones(std::size_t, std::size_t); template Matrix identity(std::size_t); template Matrix identity(std::size_t); } // namespace sangi