85 lines
2.2 KiB
C++
85 lines
2.2 KiB
C++
/**++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
*
|
|
* 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: io
|
|
* File Name: print_tensor.hpp
|
|
* Revision: 0.1.1
|
|
* Date: 23-06-2026
|
|
* Author: Michelle Bausager
|
|
*
|
|
* Description:
|
|
* Functions to print out tensors with std::cout << x std::endl;
|
|
*
|
|
*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
|
#pragma once
|
|
|
|
#include <tensor/vector.hpp> // for panic::vector
|
|
#include <tensor/matrix.hpp> // for panic::matrix
|
|
|
|
|
|
namespace panic{
|
|
namespace io{
|
|
|
|
/**
|
|
* @brief prints out vector to iostream.
|
|
*
|
|
* Computes:
|
|
* @code
|
|
* print_vector(a)
|
|
* @endcode
|
|
*
|
|
* @tparam T Numeric element type.
|
|
* @param a Input vector.
|
|
*
|
|
* @return true if @p a was successfully printed.
|
|
* @return false if printing of @p c failed.
|
|
*
|
|
* @note N/A
|
|
*/
|
|
template <typename T>
|
|
bool print_vector(const panic::tensor::vector<T>& v);
|
|
|
|
/**
|
|
* @brief prints out matrix to iostream.
|
|
*
|
|
* Computes:
|
|
* @code
|
|
* print_matrix(a)
|
|
* @endcode
|
|
*
|
|
* @tparam T Numeric element type.
|
|
* @param A Input matrix.
|
|
*
|
|
* @return true if @p A was successfully printed.
|
|
* @return false if printing of @p C failed.
|
|
*
|
|
* @note N/A
|
|
*/
|
|
template <typename T>
|
|
bool print_matrix(const panic::tensor::matrix<T>& A);
|
|
|
|
|
|
|
|
|
|
} // namespace io
|
|
} // namespace panic
|