initial push
This commit is contained in:
@@ -31,8 +31,14 @@
|
||||
* <short description of what this file/module does>
|
||||
*
|
||||
*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
// includes like:
|
||||
// #include <stdint.h>
|
||||
//---------------------------------------------------------------------------------------------------------------------------
|
||||
// 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
|
||||
@@ -45,7 +51,7 @@
|
||||
// VARIABLE DESCRIPTION
|
||||
//---------------------------------------------------------------------------------------------------------------------------
|
||||
// Variable difinition like:
|
||||
// static uint32_t AmountOfCool = 0;
|
||||
panic::real_t x = 2.4;
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -54,64 +60,16 @@
|
||||
// Function prototypes like:
|
||||
// static void TestLeds(void);
|
||||
|
||||
int main(void) {
|
||||
|
||||
panic::tensor::vector a(3);
|
||||
a[2] = 1.2;
|
||||
panic::io::print(a);
|
||||
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;
|
||||
|
||||
|
||||
// Function description like:
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
// Function Name : panic::math::matmul_serial
|
||||
//
|
||||
// Description:
|
||||
// Performs serial matrix multiplication:
|
||||
//
|
||||
// out = a * b
|
||||
//
|
||||
// Inputs:
|
||||
// a const panic::Matrix&
|
||||
// Left-hand input matrix.
|
||||
//
|
||||
// b const panic::Matrix&
|
||||
// Right-hand input matrix.
|
||||
//
|
||||
// Outputs:
|
||||
// out panic::Matrix&
|
||||
// Output matrix. Must be allocated before calling this function.
|
||||
// The function writes the result into this matrix.
|
||||
//
|
||||
// Returns:
|
||||
// panic::Status
|
||||
// panic::Status::Ok Matrix multiplication completed successfully.
|
||||
// panic::Status::SizeError Matrix dimensions are incompatible.
|
||||
// panic::Status::NullError One or more internal data pointers are null.
|
||||
//
|
||||
// Notes:
|
||||
// This function does not allocate memory.
|
||||
// The output matrix must have dimensions
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
// or
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
// Function Name : panic::math::sqrt
|
||||
//
|
||||
// Description:
|
||||
// Computes an approximation of the square root of a scalar value.
|
||||
//
|
||||
// Inputs:
|
||||
// x panic::float_t
|
||||
// Input value.
|
||||
//
|
||||
// Outputs:
|
||||
// None.
|
||||
//
|
||||
// Returns:
|
||||
// panic::float_t
|
||||
// Approximate square root of x.
|
||||
//
|
||||
// Notes:
|
||||
// This implementation is written from scratch and is intended to be readable
|
||||
// and portable rather than maximally optimized.
|
||||
//--------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user