Files
panic/main.cpp
T
2026-06-23 15:07:55 +02:00

81 lines
3.1 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: <module-name>
* File Name: <file-name>
* Revision: 0.1.0
* Date: <yyyy-mm-dd>
* Author: Michelle Bausager
*
* Description:
* <short description of what this file/module does>
*
*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
//---------------------------------------------------------------------------------------------------------------------------
// INCLUDE DESCRIPTION
//---------------------------------------------------------------------------------------------------------------------------
#include <iostream> // std::cout, std::endl
#include <config/types.hpp> // include types to use
#include <config/constants.hpp> // Math constants
#include <tensor/vector.hpp>
#include <io/print_tensor.hpp>
//---------------------------------------------------------------------------------------------------------------------------
// DEFINE DESCRIPTION
//---------------------------------------------------------------------------------------------------------------------------
// difinitions like:
// #define TEST_FALG 1
//---------------------------------------------------------------------------------------------------------------------------
// VARIABLE DESCRIPTION
//---------------------------------------------------------------------------------------------------------------------------
// Variable difinition like:
panic::real_t x = 2.4;
//---------------------------------------------------------------------------------------------------------------------------
// FUNCTION PROTOTYPE
//---------------------------------------------------------------------------------------------------------------------------
// Function prototypes like:
// static void TestLeds(void);
int main(void) {
panic::tensor::real_vector a(3);
panic::tensor::uint_vector b(3);
panic::tensor::int_vector c(3);
a[2] = 1.2;
b[2] = 3;
c[2] = -3;
panic::io::print(a);
panic::io::print(b);
panic::io::print(c);
std::cout << a[100] << std::endl;
std::cout << a.at(100) << std::endl;
std::cout << panic::pi << std::endl;
std::cout << 1.23249238423847 << std::endl;
return 0;
}