/**++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * * * PANIC * Portable Algorithms and Numerics In C++ * * Scientific computing from scratch, with feeling. * * Copyright (c) 2026 Michelle Bausager * * This file is part of PANIC. * * PANIC is free software licensed under the GNU General Public License v3.0 or later. * You may redistribute and/or modify it under the terms of the GPL. * * PANIC 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 LICENSE file for the full license text. * * SPDX-License-Identifier: GPL-3.0-or-later * *++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * * Project Name: PANIC * Module Name: tensor * File Name: eye.hpp * Revision: 0.1.0 * Date: 31-07-2026 * Author: Michelle Bausager * * Description: * Functions to generate eye matrices * *++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ #pragma once #include // for panic::vector #include namespace panic{ namespace tensor{ /** * @brief Outputs an eye matrix * * Computes: * @code * @endcode * * @tparam T Numeric element type. * @param size Number or rows and columns. * @param A Output matrix * * @return true if @p A was resized and filled successfully. * @return false if resizing @p A failed. * * @note This overload writes the result into an existing vector to avoid * unnecessary temporary allocations. */ template bool eye(const panic::types::uint_t size, panic::tensor::matrix A); /** * @brief Returns a eye matrix * * Computes: * @code * @endcode * * @param T Numeric element type. * @param size Number of rows and columns. * * @return A new vector containing the result. * @return An empty vector if the operation fails. * * @note This overload is convenient, but may allocate a new vector. */ //template //panic::tensor::matrix eye(const T size); } // namespace tensor } // namespace panic