Dense Layer, Add

added the dense layer with a forward functions. I also made the add functions for most cases.
This commit is contained in:
2026-06-25 19:43:07 +02:00
parent 9b20278395
commit 189d605bfa
27 changed files with 1657 additions and 902 deletions
+90 -90
View File
@@ -39,8 +39,8 @@ events:
checks:
- "Detecting CXX compiler ABI info"
directories:
source: "/home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-iBVTGl"
binary: "/home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-iBVTGl"
source: "/home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-xLaUGp"
binary: "/home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-xLaUGp"
cmakeVariables:
CMAKE_CXX_FLAGS: ""
CMAKE_CXX_FLAGS_DEBUG: "-g"
@@ -49,13 +49,13 @@ events:
variable: "CMAKE_CXX_ABI_COMPILED"
cached: true
stdout: |
Change Dir: '/home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-iBVTGl'
Change Dir: '/home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-xLaUGp'
Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile cmTC_41a54/fast
/usr/bin/gmake -f CMakeFiles/cmTC_41a54.dir/build.make CMakeFiles/cmTC_41a54.dir/build
gmake[1]: Entering directory '/home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-iBVTGl'
Building CXX object CMakeFiles/cmTC_41a54.dir/CMakeCXXCompilerABI.cpp.o
/usr/bin/c++ -v -o CMakeFiles/cmTC_41a54.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake-3.28/Modules/CMakeCXXCompilerABI.cpp
Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile cmTC_d468c/fast
/usr/bin/gmake -f CMakeFiles/cmTC_d468c.dir/build.make CMakeFiles/cmTC_d468c.dir/build
gmake[1]: Entering directory '/home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-xLaUGp'
Building CXX object CMakeFiles/cmTC_d468c.dir/CMakeCXXCompilerABI.cpp.o
/usr/bin/c++ -v -o CMakeFiles/cmTC_d468c.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake-3.28/Modules/CMakeCXXCompilerABI.cpp
Using built-in specs.
COLLECT_GCC=/usr/bin/c++
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
@@ -65,8 +65,8 @@ events:
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.3.0 (Ubuntu 13.3.0-6ubuntu2~24.04.1)
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_41a54.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_41a54.dir/'
/usr/libexec/gcc/x86_64-linux-gnu/13/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE /usr/share/cmake-3.28/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpdir CMakeFiles/cmTC_41a54.dir/ -dumpbase CMakeCXXCompilerABI.cpp.cpp -dumpbase-ext .cpp -mtune=generic -march=x86-64 -version -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -fcf-protection -o /tmp/cc09Jdka.s
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_d468c.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_d468c.dir/'
/usr/libexec/gcc/x86_64-linux-gnu/13/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE /usr/share/cmake-3.28/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpdir CMakeFiles/cmTC_d468c.dir/ -dumpbase CMakeCXXCompilerABI.cpp.cpp -dumpbase-ext .cpp -mtune=generic -march=x86-64 -version -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -fcf-protection -o /tmp/ccY1NaKY.s
GNU C++17 (Ubuntu 13.3.0-6ubuntu2~24.04.1) version 13.3.0 (x86_64-linux-gnu)
compiled by GNU C version 13.3.0, GMP version 6.3.0, MPFR version 4.2.1, MPC version 1.3.1, isl version isl-0.26-GMP
@@ -87,15 +87,15 @@ events:
/usr/include
End of search list.
Compiler executable checksum: 7896445e4990772fdae9dc0659a99266
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_41a54.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_41a54.dir/'
as -v --64 -o CMakeFiles/cmTC_41a54.dir/CMakeCXXCompilerABI.cpp.o /tmp/cc09Jdka.s
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_d468c.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_d468c.dir/'
as -v --64 -o CMakeFiles/cmTC_d468c.dir/CMakeCXXCompilerABI.cpp.o /tmp/ccY1NaKY.s
GNU assembler version 2.42 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.42
COMPILER_PATH=/usr/libexec/gcc/x86_64-linux-gnu/13/:/usr/libexec/gcc/x86_64-linux-gnu/13/:/usr/libexec/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/13/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/13/:/usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/13/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/13/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_41a54.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_41a54.dir/CMakeCXXCompilerABI.cpp.'
Linking CXX executable cmTC_41a54
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_41a54.dir/link.txt --verbose=1
/usr/bin/c++ -v CMakeFiles/cmTC_41a54.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_41a54
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_d468c.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_d468c.dir/CMakeCXXCompilerABI.cpp.'
Linking CXX executable cmTC_d468c
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_d468c.dir/link.txt --verbose=1
/usr/bin/c++ -v CMakeFiles/cmTC_d468c.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_d468c
Using built-in specs.
COLLECT_GCC=/usr/bin/c++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-linux-gnu/13/lto-wrapper
@@ -108,10 +108,10 @@ events:
gcc version 13.3.0 (Ubuntu 13.3.0-6ubuntu2~24.04.1)
COMPILER_PATH=/usr/libexec/gcc/x86_64-linux-gnu/13/:/usr/libexec/gcc/x86_64-linux-gnu/13/:/usr/libexec/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/13/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/13/:/usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/13/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/13/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_41a54' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'cmTC_41a54.'
/usr/libexec/gcc/x86_64-linux-gnu/13/collect2 -plugin /usr/libexec/gcc/x86_64-linux-gnu/13/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/x86_64-linux-gnu/13/lto-wrapper -plugin-opt=-fresolution=/tmp/ccnZOIwX.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmTC_41a54 /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/13/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/13 -L/usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/13/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/13/../../.. CMakeFiles/cmTC_41a54.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/13/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/crtn.o
COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_41a54' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'cmTC_41a54.'
gmake[1]: Leaving directory '/home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-iBVTGl'
COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_d468c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'cmTC_d468c.'
/usr/libexec/gcc/x86_64-linux-gnu/13/collect2 -plugin /usr/libexec/gcc/x86_64-linux-gnu/13/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/x86_64-linux-gnu/13/lto-wrapper -plugin-opt=-fresolution=/tmp/cchzdDG7.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmTC_d468c /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/13/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/13 -L/usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/13/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/13/../../.. CMakeFiles/cmTC_d468c.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/13/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/crtn.o
COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_d468c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'cmTC_d468c.'
gmake[1]: Leaving directory '/home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-xLaUGp'
exitCode: 0
-
@@ -151,13 +151,13 @@ events:
message: |
Parsed CXX implicit link information:
link line regex: [^( *|.*[/\\])(ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\\]+-)?ld|collect2)[^/\\]*( |$)]
ignore line: [Change Dir: '/home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-iBVTGl']
ignore line: [Change Dir: '/home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-xLaUGp']
ignore line: []
ignore line: [Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile cmTC_41a54/fast]
ignore line: [/usr/bin/gmake -f CMakeFiles/cmTC_41a54.dir/build.make CMakeFiles/cmTC_41a54.dir/build]
ignore line: [gmake[1]: Entering directory '/home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-iBVTGl']
ignore line: [Building CXX object CMakeFiles/cmTC_41a54.dir/CMakeCXXCompilerABI.cpp.o]
ignore line: [/usr/bin/c++ -v -o CMakeFiles/cmTC_41a54.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake-3.28/Modules/CMakeCXXCompilerABI.cpp]
ignore line: [Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile cmTC_d468c/fast]
ignore line: [/usr/bin/gmake -f CMakeFiles/cmTC_d468c.dir/build.make CMakeFiles/cmTC_d468c.dir/build]
ignore line: [gmake[1]: Entering directory '/home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-xLaUGp']
ignore line: [Building CXX object CMakeFiles/cmTC_d468c.dir/CMakeCXXCompilerABI.cpp.o]
ignore line: [/usr/bin/c++ -v -o CMakeFiles/cmTC_d468c.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake-3.28/Modules/CMakeCXXCompilerABI.cpp]
ignore line: [Using built-in specs.]
ignore line: [COLLECT_GCC=/usr/bin/c++]
ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa]
@@ -167,8 +167,8 @@ events:
ignore line: [Thread model: posix]
ignore line: [Supported LTO compression algorithms: zlib zstd]
ignore line: [gcc version 13.3.0 (Ubuntu 13.3.0-6ubuntu2~24.04.1) ]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_41a54.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_41a54.dir/']
ignore line: [ /usr/libexec/gcc/x86_64-linux-gnu/13/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE /usr/share/cmake-3.28/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpdir CMakeFiles/cmTC_41a54.dir/ -dumpbase CMakeCXXCompilerABI.cpp.cpp -dumpbase-ext .cpp -mtune=generic -march=x86-64 -version -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -fcf-protection -o /tmp/cc09Jdka.s]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_d468c.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_d468c.dir/']
ignore line: [ /usr/libexec/gcc/x86_64-linux-gnu/13/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE /usr/share/cmake-3.28/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpdir CMakeFiles/cmTC_d468c.dir/ -dumpbase CMakeCXXCompilerABI.cpp.cpp -dumpbase-ext .cpp -mtune=generic -march=x86-64 -version -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -fcf-protection -o /tmp/ccY1NaKY.s]
ignore line: [GNU C++17 (Ubuntu 13.3.0-6ubuntu2~24.04.1) version 13.3.0 (x86_64-linux-gnu)]
ignore line: [ compiled by GNU C version 13.3.0 GMP version 6.3.0 MPFR version 4.2.1 MPC version 1.3.1 isl version isl-0.26-GMP]
ignore line: []
@@ -189,15 +189,15 @@ events:
ignore line: [ /usr/include]
ignore line: [End of search list.]
ignore line: [Compiler executable checksum: 7896445e4990772fdae9dc0659a99266]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_41a54.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_41a54.dir/']
ignore line: [ as -v --64 -o CMakeFiles/cmTC_41a54.dir/CMakeCXXCompilerABI.cpp.o /tmp/cc09Jdka.s]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_d468c.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_d468c.dir/']
ignore line: [ as -v --64 -o CMakeFiles/cmTC_d468c.dir/CMakeCXXCompilerABI.cpp.o /tmp/ccY1NaKY.s]
ignore line: [GNU assembler version 2.42 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.42]
ignore line: [COMPILER_PATH=/usr/libexec/gcc/x86_64-linux-gnu/13/:/usr/libexec/gcc/x86_64-linux-gnu/13/:/usr/libexec/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/13/:/usr/lib/gcc/x86_64-linux-gnu/]
ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/13/:/usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/13/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/13/../../../:/lib/:/usr/lib/]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_41a54.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_41a54.dir/CMakeCXXCompilerABI.cpp.']
ignore line: [Linking CXX executable cmTC_41a54]
ignore line: [/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_41a54.dir/link.txt --verbose=1]
ignore line: [/usr/bin/c++ -v CMakeFiles/cmTC_41a54.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_41a54 ]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_d468c.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles/cmTC_d468c.dir/CMakeCXXCompilerABI.cpp.']
ignore line: [Linking CXX executable cmTC_d468c]
ignore line: [/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_d468c.dir/link.txt --verbose=1]
ignore line: [/usr/bin/c++ -v CMakeFiles/cmTC_d468c.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_d468c ]
ignore line: [Using built-in specs.]
ignore line: [COLLECT_GCC=/usr/bin/c++]
ignore line: [COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-linux-gnu/13/lto-wrapper]
@@ -210,13 +210,13 @@ events:
ignore line: [gcc version 13.3.0 (Ubuntu 13.3.0-6ubuntu2~24.04.1) ]
ignore line: [COMPILER_PATH=/usr/libexec/gcc/x86_64-linux-gnu/13/:/usr/libexec/gcc/x86_64-linux-gnu/13/:/usr/libexec/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/13/:/usr/lib/gcc/x86_64-linux-gnu/]
ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/13/:/usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/13/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/13/../../../:/lib/:/usr/lib/]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_41a54' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'cmTC_41a54.']
link line: [ /usr/libexec/gcc/x86_64-linux-gnu/13/collect2 -plugin /usr/libexec/gcc/x86_64-linux-gnu/13/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/x86_64-linux-gnu/13/lto-wrapper -plugin-opt=-fresolution=/tmp/ccnZOIwX.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmTC_41a54 /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/13/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/13 -L/usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/13/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/13/../../.. CMakeFiles/cmTC_41a54.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/13/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/crtn.o]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_d468c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-dumpdir' 'cmTC_d468c.']
link line: [ /usr/libexec/gcc/x86_64-linux-gnu/13/collect2 -plugin /usr/libexec/gcc/x86_64-linux-gnu/13/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/x86_64-linux-gnu/13/lto-wrapper -plugin-opt=-fresolution=/tmp/cchzdDG7.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmTC_d468c /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/13/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/13 -L/usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/13/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/13/../../.. CMakeFiles/cmTC_d468c.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/13/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/crtn.o]
arg [/usr/libexec/gcc/x86_64-linux-gnu/13/collect2] ==> ignore
arg [-plugin] ==> ignore
arg [/usr/libexec/gcc/x86_64-linux-gnu/13/liblto_plugin.so] ==> ignore
arg [-plugin-opt=/usr/libexec/gcc/x86_64-linux-gnu/13/lto-wrapper] ==> ignore
arg [-plugin-opt=-fresolution=/tmp/ccnZOIwX.res] ==> ignore
arg [-plugin-opt=-fresolution=/tmp/cchzdDG7.res] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
arg [-plugin-opt=-pass-through=-lc] ==> ignore
@@ -234,7 +234,7 @@ events:
arg [-znow] ==> ignore
arg [-zrelro] ==> ignore
arg [-o] ==> ignore
arg [cmTC_41a54] ==> ignore
arg [cmTC_d468c] ==> ignore
arg [/usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/Scrt1.o] ==> obj [/usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/Scrt1.o]
arg [/usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/crti.o] ==> obj [/usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/crti.o]
arg [/usr/lib/gcc/x86_64-linux-gnu/13/crtbeginS.o] ==> obj [/usr/lib/gcc/x86_64-linux-gnu/13/crtbeginS.o]
@@ -246,7 +246,7 @@ events:
arg [-L/usr/lib/x86_64-linux-gnu] ==> dir [/usr/lib/x86_64-linux-gnu]
arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib]
arg [-L/usr/lib/gcc/x86_64-linux-gnu/13/../../..] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/13/../../..]
arg [CMakeFiles/cmTC_41a54.dir/CMakeCXXCompilerABI.cpp.o] ==> ignore
arg [CMakeFiles/cmTC_d468c.dir/CMakeCXXCompilerABI.cpp.o] ==> ignore
arg [-lstdc++] ==> lib [stdc++]
arg [-lm] ==> lib [m]
arg [-lgcc_s] ==> lib [gcc_s]
@@ -281,8 +281,8 @@ events:
- "CMakeLists.txt:77 (find_package)"
description: "Detecting CXX OpenMP compiler info"
directories:
source: "/home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-0Y8Dzz"
binary: "/home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-0Y8Dzz"
source: "/home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-a2mM1U"
binary: "/home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-a2mM1U"
cmakeVariables:
CMAKE_CXX_FLAGS: ""
CMAKE_CXX_FLAGS_DEBUG: "-g"
@@ -291,13 +291,13 @@ events:
variable: "OpenMP_COMPILE_RESULT_CXX_fopenmp"
cached: true
stdout: |
Change Dir: '/home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-0Y8Dzz'
Change Dir: '/home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-a2mM1U'
Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile cmTC_0b68f/fast
/usr/bin/gmake -f CMakeFiles/cmTC_0b68f.dir/build.make CMakeFiles/cmTC_0b68f.dir/build
gmake[1]: Entering directory '/home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-0Y8Dzz'
Building CXX object CMakeFiles/cmTC_0b68f.dir/OpenMPTryFlag.cpp.o
/usr/bin/c++ -fopenmp -v -std=c++11 -o CMakeFiles/cmTC_0b68f.dir/OpenMPTryFlag.cpp.o -c /home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-0Y8Dzz/OpenMPTryFlag.cpp
Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile cmTC_ae9b9/fast
/usr/bin/gmake -f CMakeFiles/cmTC_ae9b9.dir/build.make CMakeFiles/cmTC_ae9b9.dir/build
gmake[1]: Entering directory '/home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-a2mM1U'
Building CXX object CMakeFiles/cmTC_ae9b9.dir/OpenMPTryFlag.cpp.o
/usr/bin/c++ -fopenmp -v -std=c++11 -o CMakeFiles/cmTC_ae9b9.dir/OpenMPTryFlag.cpp.o -c /home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-a2mM1U/OpenMPTryFlag.cpp
Using built-in specs.
COLLECT_GCC=/usr/bin/c++
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
@@ -307,8 +307,8 @@ events:
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.3.0 (Ubuntu 13.3.0-6ubuntu2~24.04.1)
COLLECT_GCC_OPTIONS='-fopenmp' '-v' '-std=c++11' '-o' 'CMakeFiles/cmTC_0b68f.dir/OpenMPTryFlag.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-pthread' '-dumpdir' 'CMakeFiles/cmTC_0b68f.dir/'
/usr/libexec/gcc/x86_64-linux-gnu/13/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE -D_REENTRANT /home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-0Y8Dzz/OpenMPTryFlag.cpp -quiet -dumpdir CMakeFiles/cmTC_0b68f.dir/ -dumpbase OpenMPTryFlag.cpp.cpp -dumpbase-ext .cpp -mtune=generic -march=x86-64 -std=c++11 -version -fopenmp -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -fcf-protection -o /tmp/ccCnQ37x.s
COLLECT_GCC_OPTIONS='-fopenmp' '-v' '-std=c++11' '-o' 'CMakeFiles/cmTC_ae9b9.dir/OpenMPTryFlag.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-pthread' '-dumpdir' 'CMakeFiles/cmTC_ae9b9.dir/'
/usr/libexec/gcc/x86_64-linux-gnu/13/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE -D_REENTRANT /home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-a2mM1U/OpenMPTryFlag.cpp -quiet -dumpdir CMakeFiles/cmTC_ae9b9.dir/ -dumpbase OpenMPTryFlag.cpp.cpp -dumpbase-ext .cpp -mtune=generic -march=x86-64 -std=c++11 -version -fopenmp -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -fcf-protection -o /tmp/cczgKSOd.s
GNU C++11 (Ubuntu 13.3.0-6ubuntu2~24.04.1) version 13.3.0 (x86_64-linux-gnu)
compiled by GNU C version 13.3.0, GMP version 6.3.0, MPFR version 4.2.1, MPC version 1.3.1, isl version isl-0.26-GMP
@@ -329,15 +329,15 @@ events:
/usr/include
End of search list.
Compiler executable checksum: 7896445e4990772fdae9dc0659a99266
COLLECT_GCC_OPTIONS='-fopenmp' '-v' '-std=c++11' '-o' 'CMakeFiles/cmTC_0b68f.dir/OpenMPTryFlag.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-pthread' '-dumpdir' 'CMakeFiles/cmTC_0b68f.dir/'
as -v --64 -o CMakeFiles/cmTC_0b68f.dir/OpenMPTryFlag.cpp.o /tmp/ccCnQ37x.s
COLLECT_GCC_OPTIONS='-fopenmp' '-v' '-std=c++11' '-o' 'CMakeFiles/cmTC_ae9b9.dir/OpenMPTryFlag.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-pthread' '-dumpdir' 'CMakeFiles/cmTC_ae9b9.dir/'
as -v --64 -o CMakeFiles/cmTC_ae9b9.dir/OpenMPTryFlag.cpp.o /tmp/cczgKSOd.s
GNU assembler version 2.42 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.42
COMPILER_PATH=/usr/libexec/gcc/x86_64-linux-gnu/13/:/usr/libexec/gcc/x86_64-linux-gnu/13/:/usr/libexec/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/13/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/13/:/usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/13/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/13/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-fopenmp' '-v' '-std=c++11' '-o' 'CMakeFiles/cmTC_0b68f.dir/OpenMPTryFlag.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-pthread' '-dumpdir' 'CMakeFiles/cmTC_0b68f.dir/OpenMPTryFlag.cpp.'
Linking CXX executable cmTC_0b68f
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_0b68f.dir/link.txt --verbose=1
/usr/bin/c++ -fopenmp -v CMakeFiles/cmTC_0b68f.dir/OpenMPTryFlag.cpp.o -o cmTC_0b68f -v
COLLECT_GCC_OPTIONS='-fopenmp' '-v' '-std=c++11' '-o' 'CMakeFiles/cmTC_ae9b9.dir/OpenMPTryFlag.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-pthread' '-dumpdir' 'CMakeFiles/cmTC_ae9b9.dir/OpenMPTryFlag.cpp.'
Linking CXX executable cmTC_ae9b9
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_ae9b9.dir/link.txt --verbose=1
/usr/bin/c++ -fopenmp -v CMakeFiles/cmTC_ae9b9.dir/OpenMPTryFlag.cpp.o -o cmTC_ae9b9 -v
Using built-in specs.
COLLECT_GCC=/usr/bin/c++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-linux-gnu/13/lto-wrapper
@@ -351,10 +351,10 @@ events:
COMPILER_PATH=/usr/libexec/gcc/x86_64-linux-gnu/13/:/usr/libexec/gcc/x86_64-linux-gnu/13/:/usr/libexec/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/13/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/13/:/usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/13/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/13/../../../:/lib/:/usr/lib/
Reading specs from /usr/lib/gcc/x86_64-linux-gnu/13/libgomp.spec
COLLECT_GCC_OPTIONS='-fopenmp' '-v' '-o' 'cmTC_0b68f' '-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-pthread' '-dumpdir' 'cmTC_0b68f.'
/usr/libexec/gcc/x86_64-linux-gnu/13/collect2 -plugin /usr/libexec/gcc/x86_64-linux-gnu/13/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/x86_64-linux-gnu/13/lto-wrapper -plugin-opt=-fresolution=/tmp/cc3uGT27.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lpthread -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmTC_0b68f /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/13/crtbeginS.o /usr/lib/gcc/x86_64-linux-gnu/13/crtoffloadbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/13 -L/usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/13/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/13/../../.. CMakeFiles/cmTC_0b68f.dir/OpenMPTryFlag.cpp.o -lstdc++ -lm -lgomp -lgcc_s -lgcc -lpthread -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/13/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/crtn.o /usr/lib/gcc/x86_64-linux-gnu/13/crtoffloadend.o
COLLECT_GCC_OPTIONS='-fopenmp' '-v' '-o' 'cmTC_0b68f' '-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-pthread' '-dumpdir' 'cmTC_0b68f.'
gmake[1]: Leaving directory '/home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-0Y8Dzz'
COLLECT_GCC_OPTIONS='-fopenmp' '-v' '-o' 'cmTC_ae9b9' '-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-pthread' '-dumpdir' 'cmTC_ae9b9.'
/usr/libexec/gcc/x86_64-linux-gnu/13/collect2 -plugin /usr/libexec/gcc/x86_64-linux-gnu/13/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/x86_64-linux-gnu/13/lto-wrapper -plugin-opt=-fresolution=/tmp/ccTjC9Ya.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lpthread -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmTC_ae9b9 /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/13/crtbeginS.o /usr/lib/gcc/x86_64-linux-gnu/13/crtoffloadbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/13 -L/usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/13/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/13/../../.. CMakeFiles/cmTC_ae9b9.dir/OpenMPTryFlag.cpp.o -lstdc++ -lm -lgomp -lgcc_s -lgcc -lpthread -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/13/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/crtn.o /usr/lib/gcc/x86_64-linux-gnu/13/crtoffloadend.o
COLLECT_GCC_OPTIONS='-fopenmp' '-v' '-o' 'cmTC_ae9b9' '-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-pthread' '-dumpdir' 'cmTC_ae9b9.'
gmake[1]: Leaving directory '/home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-a2mM1U'
exitCode: 0
-
@@ -366,13 +366,13 @@ events:
message: |
Parsed CXX OpenMP implicit link information from above output:
link line regex: [^( *|.*[/\\])(ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\\]+-)?ld|collect2)[^/\\]*( |$)]
ignore line: [Change Dir: '/home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-0Y8Dzz']
ignore line: [Change Dir: '/home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-a2mM1U']
ignore line: []
ignore line: [Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile cmTC_0b68f/fast]
ignore line: [/usr/bin/gmake -f CMakeFiles/cmTC_0b68f.dir/build.make CMakeFiles/cmTC_0b68f.dir/build]
ignore line: [gmake[1]: Entering directory '/home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-0Y8Dzz']
ignore line: [Building CXX object CMakeFiles/cmTC_0b68f.dir/OpenMPTryFlag.cpp.o]
ignore line: [/usr/bin/c++ -fopenmp -v -std=c++11 -o CMakeFiles/cmTC_0b68f.dir/OpenMPTryFlag.cpp.o -c /home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-0Y8Dzz/OpenMPTryFlag.cpp]
ignore line: [Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile cmTC_ae9b9/fast]
ignore line: [/usr/bin/gmake -f CMakeFiles/cmTC_ae9b9.dir/build.make CMakeFiles/cmTC_ae9b9.dir/build]
ignore line: [gmake[1]: Entering directory '/home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-a2mM1U']
ignore line: [Building CXX object CMakeFiles/cmTC_ae9b9.dir/OpenMPTryFlag.cpp.o]
ignore line: [/usr/bin/c++ -fopenmp -v -std=c++11 -o CMakeFiles/cmTC_ae9b9.dir/OpenMPTryFlag.cpp.o -c /home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-a2mM1U/OpenMPTryFlag.cpp]
ignore line: [Using built-in specs.]
ignore line: [COLLECT_GCC=/usr/bin/c++]
ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa]
@@ -382,8 +382,8 @@ events:
ignore line: [Thread model: posix]
ignore line: [Supported LTO compression algorithms: zlib zstd]
ignore line: [gcc version 13.3.0 (Ubuntu 13.3.0-6ubuntu2~24.04.1) ]
ignore line: [COLLECT_GCC_OPTIONS='-fopenmp' '-v' '-std=c++11' '-o' 'CMakeFiles/cmTC_0b68f.dir/OpenMPTryFlag.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-pthread' '-dumpdir' 'CMakeFiles/cmTC_0b68f.dir/']
ignore line: [ /usr/libexec/gcc/x86_64-linux-gnu/13/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE -D_REENTRANT /home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-0Y8Dzz/OpenMPTryFlag.cpp -quiet -dumpdir CMakeFiles/cmTC_0b68f.dir/ -dumpbase OpenMPTryFlag.cpp.cpp -dumpbase-ext .cpp -mtune=generic -march=x86-64 -std=c++11 -version -fopenmp -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -fcf-protection -o /tmp/ccCnQ37x.s]
ignore line: [COLLECT_GCC_OPTIONS='-fopenmp' '-v' '-std=c++11' '-o' 'CMakeFiles/cmTC_ae9b9.dir/OpenMPTryFlag.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-pthread' '-dumpdir' 'CMakeFiles/cmTC_ae9b9.dir/']
ignore line: [ /usr/libexec/gcc/x86_64-linux-gnu/13/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE -D_REENTRANT /home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-a2mM1U/OpenMPTryFlag.cpp -quiet -dumpdir CMakeFiles/cmTC_ae9b9.dir/ -dumpbase OpenMPTryFlag.cpp.cpp -dumpbase-ext .cpp -mtune=generic -march=x86-64 -std=c++11 -version -fopenmp -fasynchronous-unwind-tables -fstack-protector-strong -Wformat -Wformat-security -fstack-clash-protection -fcf-protection -o /tmp/cczgKSOd.s]
ignore line: [GNU C++11 (Ubuntu 13.3.0-6ubuntu2~24.04.1) version 13.3.0 (x86_64-linux-gnu)]
ignore line: [ compiled by GNU C version 13.3.0 GMP version 6.3.0 MPFR version 4.2.1 MPC version 1.3.1 isl version isl-0.26-GMP]
ignore line: []
@@ -404,15 +404,15 @@ events:
ignore line: [ /usr/include]
ignore line: [End of search list.]
ignore line: [Compiler executable checksum: 7896445e4990772fdae9dc0659a99266]
ignore line: [COLLECT_GCC_OPTIONS='-fopenmp' '-v' '-std=c++11' '-o' 'CMakeFiles/cmTC_0b68f.dir/OpenMPTryFlag.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-pthread' '-dumpdir' 'CMakeFiles/cmTC_0b68f.dir/']
ignore line: [ as -v --64 -o CMakeFiles/cmTC_0b68f.dir/OpenMPTryFlag.cpp.o /tmp/ccCnQ37x.s]
ignore line: [COLLECT_GCC_OPTIONS='-fopenmp' '-v' '-std=c++11' '-o' 'CMakeFiles/cmTC_ae9b9.dir/OpenMPTryFlag.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-pthread' '-dumpdir' 'CMakeFiles/cmTC_ae9b9.dir/']
ignore line: [ as -v --64 -o CMakeFiles/cmTC_ae9b9.dir/OpenMPTryFlag.cpp.o /tmp/cczgKSOd.s]
ignore line: [GNU assembler version 2.42 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.42]
ignore line: [COMPILER_PATH=/usr/libexec/gcc/x86_64-linux-gnu/13/:/usr/libexec/gcc/x86_64-linux-gnu/13/:/usr/libexec/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/13/:/usr/lib/gcc/x86_64-linux-gnu/]
ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/13/:/usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/13/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/13/../../../:/lib/:/usr/lib/]
ignore line: [COLLECT_GCC_OPTIONS='-fopenmp' '-v' '-std=c++11' '-o' 'CMakeFiles/cmTC_0b68f.dir/OpenMPTryFlag.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-pthread' '-dumpdir' 'CMakeFiles/cmTC_0b68f.dir/OpenMPTryFlag.cpp.']
ignore line: [Linking CXX executable cmTC_0b68f]
ignore line: [/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_0b68f.dir/link.txt --verbose=1]
ignore line: [/usr/bin/c++ -fopenmp -v CMakeFiles/cmTC_0b68f.dir/OpenMPTryFlag.cpp.o -o cmTC_0b68f -v ]
ignore line: [COLLECT_GCC_OPTIONS='-fopenmp' '-v' '-std=c++11' '-o' 'CMakeFiles/cmTC_ae9b9.dir/OpenMPTryFlag.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-pthread' '-dumpdir' 'CMakeFiles/cmTC_ae9b9.dir/OpenMPTryFlag.cpp.']
ignore line: [Linking CXX executable cmTC_ae9b9]
ignore line: [/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_ae9b9.dir/link.txt --verbose=1]
ignore line: [/usr/bin/c++ -fopenmp -v CMakeFiles/cmTC_ae9b9.dir/OpenMPTryFlag.cpp.o -o cmTC_ae9b9 -v ]
ignore line: [Using built-in specs.]
ignore line: [COLLECT_GCC=/usr/bin/c++]
ignore line: [COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-linux-gnu/13/lto-wrapper]
@@ -426,13 +426,13 @@ events:
ignore line: [COMPILER_PATH=/usr/libexec/gcc/x86_64-linux-gnu/13/:/usr/libexec/gcc/x86_64-linux-gnu/13/:/usr/libexec/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/13/:/usr/lib/gcc/x86_64-linux-gnu/]
ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/13/:/usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/13/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/13/../../../:/lib/:/usr/lib/]
ignore line: [Reading specs from /usr/lib/gcc/x86_64-linux-gnu/13/libgomp.spec]
ignore line: [COLLECT_GCC_OPTIONS='-fopenmp' '-v' '-o' 'cmTC_0b68f' '-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-pthread' '-dumpdir' 'cmTC_0b68f.']
link line: [ /usr/libexec/gcc/x86_64-linux-gnu/13/collect2 -plugin /usr/libexec/gcc/x86_64-linux-gnu/13/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/x86_64-linux-gnu/13/lto-wrapper -plugin-opt=-fresolution=/tmp/cc3uGT27.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lpthread -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmTC_0b68f /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/13/crtbeginS.o /usr/lib/gcc/x86_64-linux-gnu/13/crtoffloadbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/13 -L/usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/13/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/13/../../.. CMakeFiles/cmTC_0b68f.dir/OpenMPTryFlag.cpp.o -lstdc++ -lm -lgomp -lgcc_s -lgcc -lpthread -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/13/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/crtn.o /usr/lib/gcc/x86_64-linux-gnu/13/crtoffloadend.o]
ignore line: [COLLECT_GCC_OPTIONS='-fopenmp' '-v' '-o' 'cmTC_ae9b9' '-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64' '-pthread' '-dumpdir' 'cmTC_ae9b9.']
link line: [ /usr/libexec/gcc/x86_64-linux-gnu/13/collect2 -plugin /usr/libexec/gcc/x86_64-linux-gnu/13/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/x86_64-linux-gnu/13/lto-wrapper -plugin-opt=-fresolution=/tmp/ccTjC9Ya.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lpthread -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmTC_ae9b9 /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/13/crtbeginS.o /usr/lib/gcc/x86_64-linux-gnu/13/crtoffloadbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/13 -L/usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/13/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/13/../../.. CMakeFiles/cmTC_ae9b9.dir/OpenMPTryFlag.cpp.o -lstdc++ -lm -lgomp -lgcc_s -lgcc -lpthread -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/13/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/crtn.o /usr/lib/gcc/x86_64-linux-gnu/13/crtoffloadend.o]
arg [/usr/libexec/gcc/x86_64-linux-gnu/13/collect2] ==> ignore
arg [-plugin] ==> ignore
arg [/usr/libexec/gcc/x86_64-linux-gnu/13/liblto_plugin.so] ==> ignore
arg [-plugin-opt=/usr/libexec/gcc/x86_64-linux-gnu/13/lto-wrapper] ==> ignore
arg [-plugin-opt=-fresolution=/tmp/cc3uGT27.res] ==> ignore
arg [-plugin-opt=-fresolution=/tmp/ccTjC9Ya.res] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
arg [-plugin-opt=-pass-through=-lpthread] ==> ignore
@@ -451,7 +451,7 @@ events:
arg [-znow] ==> ignore
arg [-zrelro] ==> ignore
arg [-o] ==> ignore
arg [cmTC_0b68f] ==> ignore
arg [cmTC_ae9b9] ==> ignore
arg [-L/usr/lib/gcc/x86_64-linux-gnu/13] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/13]
arg [-L/usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu]
arg [-L/usr/lib/gcc/x86_64-linux-gnu/13/../../../../lib] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/13/../../../../lib]
@@ -460,7 +460,7 @@ events:
arg [-L/usr/lib/x86_64-linux-gnu] ==> dir [/usr/lib/x86_64-linux-gnu]
arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib]
arg [-L/usr/lib/gcc/x86_64-linux-gnu/13/../../..] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/13/../../..]
arg [CMakeFiles/cmTC_0b68f.dir/OpenMPTryFlag.cpp.o] ==> ignore
arg [CMakeFiles/cmTC_ae9b9.dir/OpenMPTryFlag.cpp.o] ==> ignore
arg [-lstdc++] ==> lib [stdc++]
arg [-lm] ==> lib [m]
arg [-lgomp] ==> lib [gomp]
@@ -492,8 +492,8 @@ events:
- "CMakeLists.txt:77 (find_package)"
description: "Detecting CXX OpenMP version"
directories:
source: "/home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-kDANSf"
binary: "/home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-kDANSf"
source: "/home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-34MsZp"
binary: "/home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-34MsZp"
cmakeVariables:
CMAKE_CXX_FLAGS: ""
CMAKE_CXX_FLAGS_DEBUG: "-g"
@@ -502,17 +502,17 @@ events:
variable: "OpenMP_SPECTEST_CXX_"
cached: true
stdout: |
Change Dir: '/home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-kDANSf'
Change Dir: '/home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-34MsZp'
Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile cmTC_71bac/fast
/usr/bin/gmake -f CMakeFiles/cmTC_71bac.dir/build.make CMakeFiles/cmTC_71bac.dir/build
gmake[1]: Entering directory '/home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-kDANSf'
Building CXX object CMakeFiles/cmTC_71bac.dir/OpenMPCheckVersion.cpp.o
/usr/bin/c++ -fopenmp -std=c++11 -o CMakeFiles/cmTC_71bac.dir/OpenMPCheckVersion.cpp.o -c /home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-kDANSf/OpenMPCheckVersion.cpp
Linking CXX executable cmTC_71bac
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_71bac.dir/link.txt --verbose=1
/usr/bin/c++ -fopenmp CMakeFiles/cmTC_71bac.dir/OpenMPCheckVersion.cpp.o -o cmTC_71bac
gmake[1]: Leaving directory '/home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-kDANSf'
Run Build Command(s): /usr/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile cmTC_74a23/fast
/usr/bin/gmake -f CMakeFiles/cmTC_74a23.dir/build.make CMakeFiles/cmTC_74a23.dir/build
gmake[1]: Entering directory '/home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-34MsZp'
Building CXX object CMakeFiles/cmTC_74a23.dir/OpenMPCheckVersion.cpp.o
/usr/bin/c++ -fopenmp -std=c++11 -o CMakeFiles/cmTC_74a23.dir/OpenMPCheckVersion.cpp.o -c /home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-34MsZp/OpenMPCheckVersion.cpp
Linking CXX executable cmTC_74a23
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_74a23.dir/link.txt --verbose=1
/usr/bin/c++ -fopenmp CMakeFiles/cmTC_74a23.dir/OpenMPCheckVersion.cpp.o -o cmTC_74a23
gmake[1]: Leaving directory '/home/atlas/Documents/Git/panic/build/CMakeFiles/CMakeScratch/TryCompile-34MsZp'
exitCode: 0
...
+2 -2
View File
@@ -81,12 +81,12 @@ clean: CMakeFiles/panic.dir/clean
CMakeFiles/panic.dir/all:
$(MAKE) $(MAKESILENT) -f CMakeFiles/panic.dir/build.make CMakeFiles/panic.dir/depend
$(MAKE) $(MAKESILENT) -f CMakeFiles/panic.dir/build.make CMakeFiles/panic.dir/build
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --progress-dir=/home/atlas/Documents/Git/panic/build/CMakeFiles --progress-num=1,2,3,4,5 "Built target panic"
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --progress-dir=/home/atlas/Documents/Git/panic/build/CMakeFiles --progress-num=1,2,3,4,5,6,7,8 "Built target panic"
.PHONY : CMakeFiles/panic.dir/all
# Build rule for subdir invocation for target.
CMakeFiles/panic.dir/rule: cmake_check_build_system
$(CMAKE_COMMAND) -E cmake_progress_start /home/atlas/Documents/Git/panic/build/CMakeFiles 5
$(CMAKE_COMMAND) -E cmake_progress_start /home/atlas/Documents/Git/panic/build/CMakeFiles 8
$(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 CMakeFiles/panic.dir/all
$(CMAKE_COMMAND) -E cmake_progress_start /home/atlas/Documents/Git/panic/build/CMakeFiles 0
.PHONY : CMakeFiles/panic.dir/rule
+3
View File
@@ -6,6 +6,9 @@ cmake_policy(SET CMP0009 NEW)
file(GLOB_RECURSE NEW_GLOB LIST_DIRECTORIES false "/home/atlas/Documents/Git/panic/src/*.cpp")
set(OLD_GLOB
"/home/atlas/Documents/Git/panic/src/io/print_tensor.cpp"
"/home/atlas/Documents/Git/panic/src/math/add.cpp"
"/home/atlas/Documents/Git/panic/src/math/matmul.cpp"
"/home/atlas/Documents/Git/panic/src/neural_network/layer/layer_dense.cpp"
"/home/atlas/Documents/Git/panic/src/tensor/matrix.cpp"
"/home/atlas/Documents/Git/panic/src/tensor/vector.cpp"
)
@@ -10,6 +10,9 @@ set(CMAKE_DEPENDS_LANGUAGES
set(CMAKE_DEPENDS_DEPENDENCY_FILES
"/home/atlas/Documents/Git/panic/main.cpp" "CMakeFiles/panic.dir/main.cpp.o" "gcc" "CMakeFiles/panic.dir/main.cpp.o.d"
"/home/atlas/Documents/Git/panic/src/io/print_tensor.cpp" "CMakeFiles/panic.dir/src/io/print_tensor.cpp.o" "gcc" "CMakeFiles/panic.dir/src/io/print_tensor.cpp.o.d"
"/home/atlas/Documents/Git/panic/src/math/add.cpp" "CMakeFiles/panic.dir/src/math/add.cpp.o" "gcc" "CMakeFiles/panic.dir/src/math/add.cpp.o.d"
"/home/atlas/Documents/Git/panic/src/math/matmul.cpp" "CMakeFiles/panic.dir/src/math/matmul.cpp.o" "gcc" "CMakeFiles/panic.dir/src/math/matmul.cpp.o.d"
"/home/atlas/Documents/Git/panic/src/neural_network/layer/layer_dense.cpp" "CMakeFiles/panic.dir/src/neural_network/layer/layer_dense.cpp.o" "gcc" "CMakeFiles/panic.dir/src/neural_network/layer/layer_dense.cpp.o.d"
"/home/atlas/Documents/Git/panic/src/tensor/matrix.cpp" "CMakeFiles/panic.dir/src/tensor/matrix.cpp.o" "gcc" "CMakeFiles/panic.dir/src/tensor/matrix.cpp.o.d"
"/home/atlas/Documents/Git/panic/src/tensor/vector.cpp" "CMakeFiles/panic.dir/src/tensor/vector.cpp.o" "gcc" "CMakeFiles/panic.dir/src/tensor/vector.cpp.o.d"
)
+51 -3
View File
@@ -97,10 +97,52 @@ CMakeFiles/panic.dir/src/io/print_tensor.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling CXX source to assembly CMakeFiles/panic.dir/src/io/print_tensor.cpp.s"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/atlas/Documents/Git/panic/src/io/print_tensor.cpp -o CMakeFiles/panic.dir/src/io/print_tensor.cpp.s
CMakeFiles/panic.dir/src/math/add.cpp.o: CMakeFiles/panic.dir/flags.make
CMakeFiles/panic.dir/src/math/add.cpp.o: /home/atlas/Documents/Git/panic/src/math/add.cpp
CMakeFiles/panic.dir/src/math/add.cpp.o: CMakeFiles/panic.dir/compiler_depend.ts
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=/home/atlas/Documents/Git/panic/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Building CXX object CMakeFiles/panic.dir/src/math/add.cpp.o"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/panic.dir/src/math/add.cpp.o -MF CMakeFiles/panic.dir/src/math/add.cpp.o.d -o CMakeFiles/panic.dir/src/math/add.cpp.o -c /home/atlas/Documents/Git/panic/src/math/add.cpp
CMakeFiles/panic.dir/src/math/add.cpp.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing CXX source to CMakeFiles/panic.dir/src/math/add.cpp.i"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/atlas/Documents/Git/panic/src/math/add.cpp > CMakeFiles/panic.dir/src/math/add.cpp.i
CMakeFiles/panic.dir/src/math/add.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling CXX source to assembly CMakeFiles/panic.dir/src/math/add.cpp.s"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/atlas/Documents/Git/panic/src/math/add.cpp -o CMakeFiles/panic.dir/src/math/add.cpp.s
CMakeFiles/panic.dir/src/math/matmul.cpp.o: CMakeFiles/panic.dir/flags.make
CMakeFiles/panic.dir/src/math/matmul.cpp.o: /home/atlas/Documents/Git/panic/src/math/matmul.cpp
CMakeFiles/panic.dir/src/math/matmul.cpp.o: CMakeFiles/panic.dir/compiler_depend.ts
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=/home/atlas/Documents/Git/panic/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_4) "Building CXX object CMakeFiles/panic.dir/src/math/matmul.cpp.o"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/panic.dir/src/math/matmul.cpp.o -MF CMakeFiles/panic.dir/src/math/matmul.cpp.o.d -o CMakeFiles/panic.dir/src/math/matmul.cpp.o -c /home/atlas/Documents/Git/panic/src/math/matmul.cpp
CMakeFiles/panic.dir/src/math/matmul.cpp.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing CXX source to CMakeFiles/panic.dir/src/math/matmul.cpp.i"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/atlas/Documents/Git/panic/src/math/matmul.cpp > CMakeFiles/panic.dir/src/math/matmul.cpp.i
CMakeFiles/panic.dir/src/math/matmul.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling CXX source to assembly CMakeFiles/panic.dir/src/math/matmul.cpp.s"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/atlas/Documents/Git/panic/src/math/matmul.cpp -o CMakeFiles/panic.dir/src/math/matmul.cpp.s
CMakeFiles/panic.dir/src/neural_network/layer/layer_dense.cpp.o: CMakeFiles/panic.dir/flags.make
CMakeFiles/panic.dir/src/neural_network/layer/layer_dense.cpp.o: /home/atlas/Documents/Git/panic/src/neural_network/layer/layer_dense.cpp
CMakeFiles/panic.dir/src/neural_network/layer/layer_dense.cpp.o: CMakeFiles/panic.dir/compiler_depend.ts
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=/home/atlas/Documents/Git/panic/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_5) "Building CXX object CMakeFiles/panic.dir/src/neural_network/layer/layer_dense.cpp.o"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/panic.dir/src/neural_network/layer/layer_dense.cpp.o -MF CMakeFiles/panic.dir/src/neural_network/layer/layer_dense.cpp.o.d -o CMakeFiles/panic.dir/src/neural_network/layer/layer_dense.cpp.o -c /home/atlas/Documents/Git/panic/src/neural_network/layer/layer_dense.cpp
CMakeFiles/panic.dir/src/neural_network/layer/layer_dense.cpp.i: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing CXX source to CMakeFiles/panic.dir/src/neural_network/layer/layer_dense.cpp.i"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/atlas/Documents/Git/panic/src/neural_network/layer/layer_dense.cpp > CMakeFiles/panic.dir/src/neural_network/layer/layer_dense.cpp.i
CMakeFiles/panic.dir/src/neural_network/layer/layer_dense.cpp.s: cmake_force
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling CXX source to assembly CMakeFiles/panic.dir/src/neural_network/layer/layer_dense.cpp.s"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/atlas/Documents/Git/panic/src/neural_network/layer/layer_dense.cpp -o CMakeFiles/panic.dir/src/neural_network/layer/layer_dense.cpp.s
CMakeFiles/panic.dir/src/tensor/matrix.cpp.o: CMakeFiles/panic.dir/flags.make
CMakeFiles/panic.dir/src/tensor/matrix.cpp.o: /home/atlas/Documents/Git/panic/src/tensor/matrix.cpp
CMakeFiles/panic.dir/src/tensor/matrix.cpp.o: CMakeFiles/panic.dir/compiler_depend.ts
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=/home/atlas/Documents/Git/panic/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Building CXX object CMakeFiles/panic.dir/src/tensor/matrix.cpp.o"
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=/home/atlas/Documents/Git/panic/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_6) "Building CXX object CMakeFiles/panic.dir/src/tensor/matrix.cpp.o"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/panic.dir/src/tensor/matrix.cpp.o -MF CMakeFiles/panic.dir/src/tensor/matrix.cpp.o.d -o CMakeFiles/panic.dir/src/tensor/matrix.cpp.o -c /home/atlas/Documents/Git/panic/src/tensor/matrix.cpp
CMakeFiles/panic.dir/src/tensor/matrix.cpp.i: cmake_force
@@ -114,7 +156,7 @@ CMakeFiles/panic.dir/src/tensor/matrix.cpp.s: cmake_force
CMakeFiles/panic.dir/src/tensor/vector.cpp.o: CMakeFiles/panic.dir/flags.make
CMakeFiles/panic.dir/src/tensor/vector.cpp.o: /home/atlas/Documents/Git/panic/src/tensor/vector.cpp
CMakeFiles/panic.dir/src/tensor/vector.cpp.o: CMakeFiles/panic.dir/compiler_depend.ts
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=/home/atlas/Documents/Git/panic/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_4) "Building CXX object CMakeFiles/panic.dir/src/tensor/vector.cpp.o"
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=/home/atlas/Documents/Git/panic/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_7) "Building CXX object CMakeFiles/panic.dir/src/tensor/vector.cpp.o"
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/panic.dir/src/tensor/vector.cpp.o -MF CMakeFiles/panic.dir/src/tensor/vector.cpp.o.d -o CMakeFiles/panic.dir/src/tensor/vector.cpp.o -c /home/atlas/Documents/Git/panic/src/tensor/vector.cpp
CMakeFiles/panic.dir/src/tensor/vector.cpp.i: cmake_force
@@ -129,6 +171,9 @@ CMakeFiles/panic.dir/src/tensor/vector.cpp.s: cmake_force
panic_OBJECTS = \
"CMakeFiles/panic.dir/main.cpp.o" \
"CMakeFiles/panic.dir/src/io/print_tensor.cpp.o" \
"CMakeFiles/panic.dir/src/math/add.cpp.o" \
"CMakeFiles/panic.dir/src/math/matmul.cpp.o" \
"CMakeFiles/panic.dir/src/neural_network/layer/layer_dense.cpp.o" \
"CMakeFiles/panic.dir/src/tensor/matrix.cpp.o" \
"CMakeFiles/panic.dir/src/tensor/vector.cpp.o"
@@ -137,13 +182,16 @@ panic_EXTERNAL_OBJECTS =
panic: CMakeFiles/panic.dir/main.cpp.o
panic: CMakeFiles/panic.dir/src/io/print_tensor.cpp.o
panic: CMakeFiles/panic.dir/src/math/add.cpp.o
panic: CMakeFiles/panic.dir/src/math/matmul.cpp.o
panic: CMakeFiles/panic.dir/src/neural_network/layer/layer_dense.cpp.o
panic: CMakeFiles/panic.dir/src/tensor/matrix.cpp.o
panic: CMakeFiles/panic.dir/src/tensor/vector.cpp.o
panic: CMakeFiles/panic.dir/build.make
panic: /usr/lib/gcc/x86_64-linux-gnu/13/libgomp.so
panic: /usr/lib/x86_64-linux-gnu/libpthread.a
panic: CMakeFiles/panic.dir/link.txt
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --bold --progress-dir=/home/atlas/Documents/Git/panic/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_5) "Linking CXX executable panic"
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --bold --progress-dir=/home/atlas/Documents/Git/panic/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_8) "Linking CXX executable panic"
$(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/panic.dir/link.txt --verbose=$(VERBOSE)
# Rule to build all files generated by this target.
@@ -3,6 +3,12 @@ file(REMOVE_RECURSE
"CMakeFiles/panic.dir/main.cpp.o.d"
"CMakeFiles/panic.dir/src/io/print_tensor.cpp.o"
"CMakeFiles/panic.dir/src/io/print_tensor.cpp.o.d"
"CMakeFiles/panic.dir/src/math/add.cpp.o"
"CMakeFiles/panic.dir/src/math/add.cpp.o.d"
"CMakeFiles/panic.dir/src/math/matmul.cpp.o"
"CMakeFiles/panic.dir/src/math/matmul.cpp.o.d"
"CMakeFiles/panic.dir/src/neural_network/layer/layer_dense.cpp.o"
"CMakeFiles/panic.dir/src/neural_network/layer/layer_dense.cpp.o.d"
"CMakeFiles/panic.dir/src/tensor/matrix.cpp.o"
"CMakeFiles/panic.dir/src/tensor/matrix.cpp.o.d"
"CMakeFiles/panic.dir/src/tensor/vector.cpp.o"
+1 -1
View File
@@ -1 +1 @@
/usr/bin/c++ CMakeFiles/panic.dir/main.cpp.o CMakeFiles/panic.dir/src/io/print_tensor.cpp.o CMakeFiles/panic.dir/src/tensor/matrix.cpp.o CMakeFiles/panic.dir/src/tensor/vector.cpp.o -o panic /usr/lib/gcc/x86_64-linux-gnu/13/libgomp.so /usr/lib/x86_64-linux-gnu/libpthread.a
/usr/bin/c++ CMakeFiles/panic.dir/main.cpp.o CMakeFiles/panic.dir/src/io/print_tensor.cpp.o CMakeFiles/panic.dir/src/math/add.cpp.o CMakeFiles/panic.dir/src/math/matmul.cpp.o CMakeFiles/panic.dir/src/neural_network/layer/layer_dense.cpp.o CMakeFiles/panic.dir/src/tensor/matrix.cpp.o CMakeFiles/panic.dir/src/tensor/vector.cpp.o -o panic /usr/lib/gcc/x86_64-linux-gnu/13/libgomp.so /usr/lib/x86_64-linux-gnu/libpthread.a
+3
View File
@@ -3,4 +3,7 @@ CMAKE_PROGRESS_2 = 2
CMAKE_PROGRESS_3 = 3
CMAKE_PROGRESS_4 = 4
CMAKE_PROGRESS_5 = 5
CMAKE_PROGRESS_6 = 6
CMAKE_PROGRESS_7 = 7
CMAKE_PROGRESS_8 = 8
+1 -1
View File
@@ -1 +1 @@
5
8
+81
View File
@@ -178,6 +178,78 @@ src/io/print_tensor.cpp.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles/panic.dir/build.make CMakeFiles/panic.dir/src/io/print_tensor.cpp.s
.PHONY : src/io/print_tensor.cpp.s
src/math/add.o: src/math/add.cpp.o
.PHONY : src/math/add.o
# target to build an object file
src/math/add.cpp.o:
$(MAKE) $(MAKESILENT) -f CMakeFiles/panic.dir/build.make CMakeFiles/panic.dir/src/math/add.cpp.o
.PHONY : src/math/add.cpp.o
src/math/add.i: src/math/add.cpp.i
.PHONY : src/math/add.i
# target to preprocess a source file
src/math/add.cpp.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles/panic.dir/build.make CMakeFiles/panic.dir/src/math/add.cpp.i
.PHONY : src/math/add.cpp.i
src/math/add.s: src/math/add.cpp.s
.PHONY : src/math/add.s
# target to generate assembly for a file
src/math/add.cpp.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles/panic.dir/build.make CMakeFiles/panic.dir/src/math/add.cpp.s
.PHONY : src/math/add.cpp.s
src/math/matmul.o: src/math/matmul.cpp.o
.PHONY : src/math/matmul.o
# target to build an object file
src/math/matmul.cpp.o:
$(MAKE) $(MAKESILENT) -f CMakeFiles/panic.dir/build.make CMakeFiles/panic.dir/src/math/matmul.cpp.o
.PHONY : src/math/matmul.cpp.o
src/math/matmul.i: src/math/matmul.cpp.i
.PHONY : src/math/matmul.i
# target to preprocess a source file
src/math/matmul.cpp.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles/panic.dir/build.make CMakeFiles/panic.dir/src/math/matmul.cpp.i
.PHONY : src/math/matmul.cpp.i
src/math/matmul.s: src/math/matmul.cpp.s
.PHONY : src/math/matmul.s
# target to generate assembly for a file
src/math/matmul.cpp.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles/panic.dir/build.make CMakeFiles/panic.dir/src/math/matmul.cpp.s
.PHONY : src/math/matmul.cpp.s
src/neural_network/layer/layer_dense.o: src/neural_network/layer/layer_dense.cpp.o
.PHONY : src/neural_network/layer/layer_dense.o
# target to build an object file
src/neural_network/layer/layer_dense.cpp.o:
$(MAKE) $(MAKESILENT) -f CMakeFiles/panic.dir/build.make CMakeFiles/panic.dir/src/neural_network/layer/layer_dense.cpp.o
.PHONY : src/neural_network/layer/layer_dense.cpp.o
src/neural_network/layer/layer_dense.i: src/neural_network/layer/layer_dense.cpp.i
.PHONY : src/neural_network/layer/layer_dense.i
# target to preprocess a source file
src/neural_network/layer/layer_dense.cpp.i:
$(MAKE) $(MAKESILENT) -f CMakeFiles/panic.dir/build.make CMakeFiles/panic.dir/src/neural_network/layer/layer_dense.cpp.i
.PHONY : src/neural_network/layer/layer_dense.cpp.i
src/neural_network/layer/layer_dense.s: src/neural_network/layer/layer_dense.cpp.s
.PHONY : src/neural_network/layer/layer_dense.s
# target to generate assembly for a file
src/neural_network/layer/layer_dense.cpp.s:
$(MAKE) $(MAKESILENT) -f CMakeFiles/panic.dir/build.make CMakeFiles/panic.dir/src/neural_network/layer/layer_dense.cpp.s
.PHONY : src/neural_network/layer/layer_dense.cpp.s
src/tensor/matrix.o: src/tensor/matrix.cpp.o
.PHONY : src/tensor/matrix.o
@@ -241,6 +313,15 @@ help:
@echo "... src/io/print_tensor.o"
@echo "... src/io/print_tensor.i"
@echo "... src/io/print_tensor.s"
@echo "... src/math/add.o"
@echo "... src/math/add.i"
@echo "... src/math/add.s"
@echo "... src/math/matmul.o"
@echo "... src/math/matmul.i"
@echo "... src/math/matmul.s"
@echo "... src/neural_network/layer/layer_dense.o"
@echo "... src/neural_network/layer/layer_dense.i"
@echo "... src/neural_network/layer/layer_dense.s"
@echo "... src/tensor/matrix.o"
@echo "... src/tensor/matrix.i"
@echo "... src/tensor/matrix.s"
BIN
View File
Binary file not shown.
+9 -9
View File
@@ -52,40 +52,40 @@
namespace panic {
namespace constants{
//---------------------------------------------------------------------------------------------------------------------------
// Type Name : panic::pi
// Type Name : panic::constants::pi
//
// Description:
// Default difinition of pi (3.14159265358979323846) used inside PANIC.
// static_cast makes sure the right number of decimals are used when defining the constant.
//
// Underlying Type:
// panic::real_t
// panic::types::real_t
//---------------------------------------------------------------------------------------------------------------------------
static const panic::real_t pi = static_cast<panic::real_t>(3.14159265358979323846);
static const panic::types::real_t pi = static_cast<panic::types::real_t>(3.14159265358979323846);
//---------------------------------------------------------------------------------------------------------------------------
//
// Type Name : panic::tau
// Type Name : panic::constants::tau
//
// Description:
// Default difinition of tau (6.28318530717958647692) used inside PANIC.
// static_cast makes sure the right number of decimals are used when defining the constant.
//
// Underlying Type:
// panic::real_t
// panic::types::real_t
//---------------------------------------------------------------------------------------------------------------------------
static const panic::real_t tau = static_cast<panic::real_t>(6.28318530717958647692);
static const panic::types::real_t tau = static_cast<panic::types::real_t>(6.28318530717958647692);
//---------------------------------------------------------------------------------------------------------------------------
//
// Type Name : panic::e
// Type Name : panic::constants::e
//
// Description:
// Default difinition of eulers number, e (2.71828182845904523536) used inside PANIC.
// static_cast makes sure the right number of decimals are used when defining the constant.
//
// Underlying Type:
// panic::real_t
// panic::types::real_t
//---------------------------------------------------------------------------------------------------------------------------
static const panic::real_t e = static_cast<panic::real_t>(2.71828182845904523536);
static const panic::types::real_t e = static_cast<panic::types::real_t>(2.71828182845904523536);
} // namespace constants
} // namespace panic
+5 -4
View File
@@ -45,7 +45,7 @@
//---------------------------------------------------------------------------------------------------------------------------
// TYPE DESCRIPTION
//---------------------------------------------------------------------------------------------------------------------------
// Type Name : panic::uint_t
// Type Name : panic::types::uint_t
//
// Description:
// Default unsigned integer type used inside PANIC.
@@ -54,7 +54,7 @@
// uint32_t
//---------------------------------------------------------------------------------------------------------------------------
//
// Type Name : panic::int_t
// Type Name : panic::types::int_t
//
// Description:
// Default signed integer type used inside PANIC.
@@ -63,7 +63,7 @@
// int32_t
//---------------------------------------------------------------------------------------------------------------------------
//
// Type Name : panic::real_t
// Type Name : panic::types::real_t
//
// Description:
// Default floating-point type used inside PANIC.
@@ -73,11 +73,12 @@
//---------------------------------------------------------------------------------------------------------------------------
namespace panic {
namespace types{
typedef uint32_t uint_t;
typedef int32_t int_t;
typedef float real_t;
} // namespace types
} // namespace panic
+364
View File
@@ -0,0 +1,364 @@
/**++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*
* 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: math
* File Name: add.hpp
* Revision: 0.1.0
* Date: 25-06-2026
* Author: Michelle Bausager
*
* Description:
* Functions to add panic::tensor togther;
*
*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
#pragma one
//---------------------------------------------------------------------------------------------------------------------------
// INCLUDE DESCRIPTION
//---------------------------------------------------------------------------------------------------------------------------
#include <tensor/vector.hpp> // for panic::real_vector (uint_vector, int_vector)
#include <tensor/matrix.hpp> // for panic::real_matrix (uint_matrix, int_matrix)
//---------------------------------------------------------------------------------------------------------------------------
// DEFINE DESCRIPTION
//---------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------
// VARIABLE DESCRIPTION
//---------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------
// FUNCTION PROTOTYPE
//---------------------------------------------------------------------------------------------------------------------------
namespace panic{
namespace math{
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::math::add
//
// Description:
// Adds a scaler to a panic::tensor::vector
// c(2) = a(2) + k
//
// Inputs:
//
// a const panic::tensor::vector<T>&
//
// k const <T>
//
// Outputs:
// c panic::tensor::vector<T>&
//
// Returns:
// bool
//
// Notes:
// The c vector is resized if nessessary.
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
bool add(const panic::tensor::vector<T>& a, const T k, panic::tensor::vector<T>& c);
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::math::add
//
// Description:
// Adds a scaler to a panic::tensor::vector
// c(2) = a(2) + k
//
// Inputs:
//
// a const panic::tensor::vector<T>&
//
// k const <T>
//
// Outputs:
// None.
//
// Returns:
// c panic::tensor::vector<T>
//
// Notes:
// Makes new vector and returns the result.
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
panic::tensor::vector<T> add(const panic::tensor::vector<T>& a, const T k);
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::math::add
//
// Description:
// Adds two panic::tensor::vector
// c(2) = a(2) + b(2)
//
// Inputs:
//
// a const panic::tensor::vector<T>&
//
// b const panic::tensor::vector<T>&
//
// Outputs:
// c panic::tensor::vector<T>&
//
// Returns:
// bool
//
// Notes:
// If input vector dimentions are not correct, output is a empty vector and returns false.
// The c vector is resized if nessessary.
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
bool add(const panic::tensor::vector<T>& a, const panic::tensor::vector<T>& b, panic::tensor::vector<T>& c);
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::math::add
//
// Description:
// Adds two panic::tensor::vector
// c(2) = a(2) + b(2)
//
// Inputs:
//
// a const panic::tensor::vector<T>&
//
// b const panic::tensor::vector<T>&
//
// Outputs:
// None.
//
// Returns:
// c panic::tensor::vector<T>
//
// Notes:
// If input vector dimentions are not correct, return is an empty vector.
// Makes new vector and returns the result.
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
panic::tensor::vector<T> add(const panic::tensor::vector<T>& a, const panic::tensor::vector<T>& b);
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::math::add
//
// Description:
// Adds a scaler to a panic::tensor::matrix
// C(2,2) = A(2,2) + k
//
// Inputs:
//
// A const panic::tensor::matrix<T>&
//
// k const T
//
// Outputs:
// C panic::tensor::matrix<T>&
//
// Returns:
// bool
//
// Notes:
// The C matrix is resized if nessessary.
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
bool add(const panic::tensor::matrix<T>& A, const T k, panic::tensor::matrix<T>& C);
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::math::add
//
// Description:
// Adds a scaler to a panic::tensor::matrix
// C(2,2) = A(2,2) + k
//
// Inputs:
//
// A const panic::tensor::matrix<T>&
//
// k const T
//
// Outputs:
// None.
//
// Returns:
// C panic::tensor::matrix<T>
//
// Notes:
// Creates new matrix, C, for the result.
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
panic::tensor::matrix<T> add(const panic::tensor::matrix<T>& A, const T k);
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::math::add
//
// Description:
// Adds two panic::tensor::matrix
// C(2,2) = A(2,2) + B(2,2)
//
// Inputs:
//
// A const panic::tensor::matrix<T>&
//
// B const panic::tensor::matrix<T>&
//
// Outputs:
// C panic::tensor::matrix<T>&
//
// Returns:
// bool
//
// Notes:
// If input matrix dimentions are not correct, outputs an a empty matrix and returns false.
// The C matrix is resized if nessessary.
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
bool add(const panic::tensor::matrix<T>& A, const panic::tensor::matrix<T>& B, panic::tensor::matrix<T>& C);
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::math::add
//
// Description:
// Adds two panic::tensor::matrix
// C(2,2) = A(2,2) + B(2,2)
//
// Inputs:
//
// A const panic::tensor::matrix<T>&
//
// B const panic::tensor::matrix<T>&
//
// Outputs:
// None.
//
// Returns:
// C panic::tensor::matrix<T>
//
// Notes:
// If input matrix dimentions are not correct, returns an a empty matrix.
// Creates new matrix, C, for the result.
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
panic::tensor::matrix<T> add(const panic::tensor::matrix<T>& A, const panic::tensor::matrix<T>& B);
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::math::add_rowwise
//
// Description:
// Adds two panic::tensor::matrix
// C(2,3) = A(2,3) + b(2)
//
// Inputs:
//
// A const panic::tensor::matrix<T>&
//
// b const panic::tensor::vector<T>&
//
// Outputs:
// C panic::tensor::matrix&
//
// Returns:
// bool
//
// Notes:
// If input vector dimentions are not correct, outputs an a empty matrix and returns false.
// The C matrix is resized if nessessary.
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
bool add_rowwise(const panic::tensor::matrix<T>& A, const panic::tensor::vector<T>& b, panic::tensor::matrix<T>& C);
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::math::add_rowwise
//
// Description:
// Adds two panic::tensor::matrix
// C(2,3) = A(2,3) + b(2)
//
// Inputs:
//
// A const panic::tensor::matrix<T>&
//
// b const panic::tensor::vector<T>&
//
// Outputs:
// None.
//
// Returns:
// C panic::tensor::matrix<T>&
//
// Notes:
// If input vector dimentions are not correct, returns an a empty matrix.
// Creates new matrix, C, for the result.
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
panic::tensor::matrix<T> add_rowwise(const panic::tensor::matrix<T>& A, const panic::tensor::vector<T>& b);
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::math::add_colwise
//
// Description:
// Adds two panic::tensor::matrix
// C(2,3) = A(2,3) + b(3)
//
// Inputs:
//
// A const panic::tensor::matrix<T>&
//
// b const panic::tensor::vector<T>&
//
// Outputs:
// C panic::tensor::matrix&
//
// Returns:
// bool
//
// Notes:
// If input vector dimentions are not correct, outputs an a empty matrix and returns false.
// The C matrix is resized if nessessary.
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
bool add_colwise(const panic::tensor::matrix<T>& A, const panic::tensor::vector<T>& b, panic::tensor::matrix<T>& C);
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::math::add_colwise
//
// Description:
// Adds two panic::tensor::matrix
// C(2,3) = A(2,3) + b(3)
//
// Inputs:
//
// A const panic::tensor::matrix<T>&
//
// b const panic::tensor::vector<T>&
//
// Outputs:
// None.
//
// Returns:
// C panic::tensor::matrix<T>&
//
// Notes:
// If input vector dimentions are not correct, returns an a empty matrix.
// Creates new matrix, C, for the result.
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
panic::tensor::matrix<T> add_colwise(const panic::tensor::matrix<T>& A, const panic::tensor::vector<T>& b);
} // namespace math
} // namespace panic
+107
View File
@@ -0,0 +1,107 @@
/**++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*
* 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: math
* File Name: matmul.hpp
* Revision: 0.1.0
* Date: 24-06-2026
* Author: Michelle Bausager
*
* Description:
* Functions to print out tensors with std::cout << x std::endl;
*
*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
#pragma one
//---------------------------------------------------------------------------------------------------------------------------
// INCLUDE DESCRIPTION
//-----------------------------------------------------------------------------------------------------
#include <tensor/matrix.hpp> // for panic::real_matrix
//---------------------------------------------------------------------------------------------------------------------------
// DEFINE DESCRIPTION
//---------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------
// VARIABLE DESCRIPTION
//---------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------
// FUNCTION PROTOTYPE
//---------------------------------------------------------------------------------------------------------------------------
namespace panic{
namespace math{
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::math::matmul
//
// Description:
// Multiplies to panic::tensor::real_matrix
// C(2,4) = A(2,3) * B(3,4)
//
// Inputs:
//
// A const panic::tensor::real_matrix&
//
// B const panic::tensor::real_matrix&
//
// Outputs:
// C panic::tensor::real_matrix&
//
// Returns:
// bool
//
// Notes:
// If input matrix dimentions are not correct, output is a empty matrix and returns false.
// The C matrix is resized if nessessary.
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
bool matmul(const panic::tensor::matrix<T>& A, const panic::tensor::matrix<T>& B, panic::tensor::matrix<T>& C);
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::math::matmul
//
// Description:
// Multiplies to panic::tensor::real_matrix
// C(2,4) = A(2,3) * B(3,4)
//
// Inputs:
//
// A const panic::tensor::real_matrix&
//
// B const panic::tensor::real_matrix&
//
// Outputs:
// None.
//
// Returns:
// C panic::tensor::real_matrix&
//
// Notes:
// If input matrix dimentions are not correct, returns an a empty matrix.
// Creates new matrix, C, for the result.
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
panic::tensor::matrix<T> matmul(const panic::tensor::matrix<T>& A, const panic::tensor::matrix<T>& B);
} // namespace math
} // namespace panic
+16 -75
View File
@@ -22,13 +22,13 @@
*
* Project Name: PANIC
* Module Name: neural_network
* File Name: layer_dense.hpp
* File Name: layer.hpp
* Revision: 0.1.0
* Date: 23-06-2026
* Author: Michelle Bausager
*
* Description:
* Defines the dense layers used in neural network
* Defines the base layers struct used in pther layers in neural network
*
*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
#pragma once
@@ -36,6 +36,7 @@
// INCLUDE DESCRIPTION
//---------------------------------------------------------------------------------------------------------------------------
#include <config/types.hpp> // panic::uint_t, panic::int_t, and panic::real_t
#include <tensor/matrix.hpp> // panic::tensor::real_matrix (uint_matrix, int_matrix)
//---------------------------------------------------------------------------------------------------------------------------
// DEFINE DESCRIPTION
@@ -46,94 +47,34 @@
//---------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------
// Type Name : panic::neural_network::layer_dense
// Type Name : panic::neural_network::layer
//
// Description:
// A dense layer to use in neural networks
// A base layer to use in neural networks
//
// Member Variables:
// length panic::uint_t
// Number of elements in the vector.
//
// data panic::real_t*
// Pointer to the allocated vector data.
// None.
//
// Notes:
// This vector uses dynamic allocation with new[] and delete[].
// Copying performs a deep copy.
// This base layer should be used in all layers/activations that have a forward and backward function
// This is done so it's easy to make a list of layers in the model to loop over.
// The virtual means it should use derived object's version when called with a pointer.
// The =0 means the derviced object NEEDS to have these functions to work.
//
//---------------------------------------------------------------------------------------------------------------------------
namespace panic{
namespace tensor{
namespace neural_network{
template <typename T>
struct vector{
panic::uint_t length;
T* data;
struct layer{
// empty contructor
vector();
virtual ~layer() = default;
// contructor with size allocation
vector(panic::uint_t size);
// contructor with size allocation and sets it all to a value
vector(panic::uint_t size, T value);
// copy-contructor
// vector a(3);
// vector b = a;
vector(const vector& other);
// de-contructor, releases memory
~vector();
// copy-assignment
//vector a(5);
//vector b(3);
//b = a;
vector& operator=(const vector& other);
// function returns size.
// const tells compiler that the fuction don't edit the objert.
panic::uint_t size() const;
// function to resize data vector (I need a new that don't save the vlaues)
bool resize(panic::uint_t new_size);
// fill data with value
bool fill(T value);
// lets you read and write v[index]
T& operator[](panic::uint_t index);
// lets you read v[index] from a const vector
const T& operator[](panic::uint_t index) const;
// lets you read and write v.at(index)
T& at(panic::uint_t index);
// lets you read v.at(index) from a const vector
const T& at(panic::uint_t index) const;
virtual bool forward(const panic::tensor::real_matrix& inputs) = 0;
virtual bool backward(const panic::tensor::real_matrix& dinputs) = 0;
};
//---------------------------------------------------------------------------------------------------------------------------
// TYPE ALIASES
//---------------------------------------------------------------------------------------------------------------------------
typedef vector<panic::real_t> real_vector;
typedef vector<panic::int_t> int_vector;
typedef vector<panic::uint_t> uint_vector;
//---------------------------------------------------------------------------------------------------------------------------
// EXPLICIT TEMPLATE DECLARATION
//---------------------------------------------------------------------------------------------------------------------------
extern template struct vector<panic::real_t>;
extern template struct vector<panic::int_t>;
extern template struct vector<panic::uint_t>;
} // namespace tensor
} // namespace panic
+36 -74
View File
@@ -32,10 +32,14 @@
*
*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
#pragma once
//---------------------------------------------------------------------------------------------------------------------------
// INCLUDE DESCRIPTION
//---------------------------------------------------------------------------------------------------------------------------
#include <config/types.hpp> // panic::uint_t, panic::int_t, and panic::real_t
#include <neural_network/layer/layer.hpp> // for base layer struct
#include <tensor/vector.hpp>
#include <tensor/matrix.hpp>
//---------------------------------------------------------------------------------------------------------------------------
// DEFINE DESCRIPTION
@@ -45,96 +49,54 @@
// TYPE DESCRIPTION
//---------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------
// Type Name : panic::neural_network::layer_dense
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::neural_network::layer_dense
//
// Description:
// A dense layer to use in neural networks
// Dense/fully-connected neural network layer.
//
// Member Variables:
// length panic::uint_t
// Number of elements in the vector.
// Inputs:
// Samples x input size const panic::tensor::real_matrix&
//
// data panic::real_t*
// Pointer to the allocated vector data.
// Weight shape:
// input_size x neuron_count
//
// Bias shape:
// 1 x neuron_count
//
// Output shape:
// samples x neuron_count panic::tensor::real_matrix
//
// Notes:
// This vector uses dynamic allocation with new[] and delete[].
// Copying performs a deep copy.
//---------------------------------------------------------------------------------------------------------------------------
// forward(input) calculates:
//
// outputs = inputs * weights + biases
//--------------------------------------------------------------------------------------------------------------------------
namespace panic{
namespace tensor{
namespace neural_network{
template <typename T>
struct vector{
panic::uint_t length;
T* data;
struct layer_dense : public layer{
// empty contructor
vector();
panic::tensor::real_matrix weights;
panic::tensor::real_vector biases;
panic::tensor::real_matrix outputs;
// contructor with size allocation
vector(panic::uint_t size);
// Empthy contructor
layer_dense();
// contructor with size allocation and sets it all to a value
vector(panic::uint_t size, T value);
// Contructor with layer size
layer_dense(panic::types::uint_t input_size, panic::types::uint_t neurons);
// copy-contructor
// vector a(3);
// vector b = a;
vector(const vector& other);
// Decontructor (All internal variables has decontructors, so we can just use default)
~layer_dense() = default;
// de-contructor, releases memory
~vector();
// copy-assignment
//vector a(5);
//vector b(3);
//b = a;
vector& operator=(const vector& other);
// function returns size.
// const tells compiler that the fuction don't edit the objert.
panic::uint_t size() const;
// function to resize data vector (I need a new that don't save the vlaues)
bool resize(panic::uint_t new_size);
// fill data with value
bool fill(T value);
// lets you read and write v[index]
T& operator[](panic::uint_t index);
// lets you read v[index] from a const vector
const T& operator[](panic::uint_t index) const;
// lets you read and write v.at(index)
T& at(panic::uint_t index);
// lets you read v.at(index) from a const vector
const T& at(panic::uint_t index) const;
// Forward function for forward pass
bool forward(const panic::tensor::real_matrix& inputs);
// Backward pass
bool backward(const panic::tensor::real_matrix& dinpus);
};
//---------------------------------------------------------------------------------------------------------------------------
// TYPE ALIASES
//---------------------------------------------------------------------------------------------------------------------------
typedef vector<panic::real_t> real_vector;
typedef vector<panic::int_t> int_vector;
typedef vector<panic::uint_t> uint_vector;
//---------------------------------------------------------------------------------------------------------------------------
// EXPLICIT TEMPLATE DECLARATION
//---------------------------------------------------------------------------------------------------------------------------
extern template struct vector<panic::real_t>;
extern template struct vector<panic::int_t>;
extern template struct vector<panic::uint_t>;
} // namespace tensor
} // namespace panic
+16 -16
View File
@@ -70,19 +70,19 @@ namespace panic{
template <typename T>
struct matrix{
panic::uint_t n;
panic::uint_t m;
panic::uint_t length;
panic::types::uint_t n;
panic::types::uint_t m;
panic::types::uint_t length;
T* data;
// empty contructor
matrix();
// contructor with size allocation
matrix(panic::uint_t rows, panic::uint_t cols);
matrix(panic::types::uint_t rows, panic::types::uint_t cols);
// contructor with size allocation and sets it all to a value
matrix(panic::uint_t rows, panic::uint_t cols, T value);
matrix(panic::types::uint_t rows, panic::types::uint_t cols, T value);
// copy-contructor
// matrix A(3,3);
@@ -100,14 +100,14 @@ struct matrix{
// function returns rows.
// const tells compiler that the fuction don't edit the objert.
panic::uint_t rows() const;
panic::types::uint_t rows() const;
// function returns columns.
// const tells compiler that the fuction don't edit the objert.
panic::uint_t cols() const;
panic::types::uint_t cols() const;
// function to resize data vector
bool resize(panic::uint_t new_n, panic::uint_t new_m);
bool resize(panic::types::uint_t new_n, panic::types::uint_t new_m);
// fill data with value
bool fill(T value);
@@ -116,10 +116,10 @@ struct matrix{
// Example:
// A(1, 2)
// This is unchecked and fast.
T& operator()(panic::uint_t index_n, panic::uint_t index_m);
T& operator()(panic::types::uint_t index_n, panic::types::uint_t index_m);
// lets you read matrix data using row and column from a const matrix
const T& operator()(panic::uint_t index_n, panic::uint_t index_m) const;
const T& operator()(panic::types::uint_t index_n, panic::types::uint_t index_m) const;
};
@@ -128,17 +128,17 @@ struct matrix{
// TYPE ALIASES
//---------------------------------------------------------------------------------------------------------------------------
typedef matrix<panic::real_t> real_matrix;
typedef matrix<panic::int_t> int_matrix;
typedef matrix<panic::uint_t> uint_matrix;
typedef matrix<panic::types::real_t> real_matrix;
typedef matrix<panic::types::int_t> int_matrix;
typedef matrix<panic::types::uint_t> uint_matrix;
//---------------------------------------------------------------------------------------------------------------------------
// EXPLICIT TEMPLATE DECLARATION
//---------------------------------------------------------------------------------------------------------------------------
extern template struct matrix<panic::real_t>;
extern template struct matrix<panic::int_t>;
extern template struct matrix<panic::uint_t>;
extern template struct matrix<panic::types::real_t>;
extern template struct matrix<panic::types::int_t>;
extern template struct matrix<panic::types::uint_t>;
} // namespace tensor
+15 -15
View File
@@ -68,17 +68,17 @@ namespace panic{
template <typename T>
struct vector{
panic::uint_t length;
panic::types::uint_t length;
T* data;
// empty contructor
vector();
// contructor with size allocation
vector(panic::uint_t size);
vector(panic::types::uint_t size);
// contructor with size allocation and sets it all to a value
vector(panic::uint_t size, T value);
vector(panic::types::uint_t size, T value);
// copy-contructor
// vector a(3);
@@ -96,25 +96,25 @@ struct vector{
// function returns size.
// const tells compiler that the fuction don't edit the objert.
panic::uint_t size() const;
panic::types::uint_t size() const;
// function to resize data vector (I need a new that don't save the vlaues)
bool resize(panic::uint_t new_size);
bool resize(panic::types::uint_t new_size);
// fill data with value
bool fill(T value);
// lets you read and write v[index]
T& operator[](panic::uint_t index);
T& operator[](panic::types::uint_t index);
// lets you read v[index] from a const vector
const T& operator[](panic::uint_t index) const;
const T& operator[](panic::types::uint_t index) const;
// lets you read and write v.at(index)
T& at(panic::uint_t index);
T& at(panic::types::uint_t index);
// lets you read v.at(index) from a const vector
const T& at(panic::uint_t index) const;
const T& at(panic::types::uint_t index) const;
};
@@ -123,17 +123,17 @@ struct vector{
// TYPE ALIASES
//---------------------------------------------------------------------------------------------------------------------------
typedef vector<panic::real_t> real_vector;
typedef vector<panic::int_t> int_vector;
typedef vector<panic::uint_t> uint_vector;
typedef vector<panic::types::real_t> real_vector;
typedef vector<panic::types::int_t> int_vector;
typedef vector<panic::types::uint_t> uint_vector;
//---------------------------------------------------------------------------------------------------------------------------
// EXPLICIT TEMPLATE DECLARATION
//---------------------------------------------------------------------------------------------------------------------------
extern template struct vector<panic::real_t>;
extern template struct vector<panic::int_t>;
extern template struct vector<panic::uint_t>;
extern template struct vector<panic::types::real_t>;
extern template struct vector<panic::types::int_t>;
extern template struct vector<panic::types::uint_t>;
} // namespace tensor
+18 -2
View File
@@ -40,6 +40,9 @@
#include <tensor/vector.hpp>
#include <tensor/matrix.hpp>
#include <io/print_tensor.hpp>
#include <math/matmul.hpp>
#include <neural_network/layer/layer_dense.hpp>
#include <math/add.hpp>
//---------------------------------------------------------------------------------------------------------------------------
// DEFINE DESCRIPTION
@@ -52,11 +55,11 @@
// VARIABLE DESCRIPTION
//---------------------------------------------------------------------------------------------------------------------------
// Variable difinition like:
panic::real_t x = 2.4;
panic::types::real_t x = 2.4;
panic::tensor::real_vector a(3);
panic::tensor::uint_vector b(3);
panic::tensor::int_vector c(10);
panic::tensor::int_vector c(3);
panic::tensor::real_matrix A(2,2, 1);
panic::tensor::uint_matrix B(2,2, 2);
@@ -90,6 +93,19 @@ int main(void) {
panic::io::print_matrix(B);
panic::io::print_matrix(C);
panic::tensor::real_matrix A1(100, 100, 0.999/100);
panic::tensor::real_matrix A2(100, 100, 100);
for (panic::types::uint_t i = 0; i < 5; ++i)
{
std::cout << A2(0,0) << std::endl;
A2 = panic::math::matmul(A1, A2);
}
panic::tensor::real_matrix B1(25, 100, 100);
panic::neural_network::layer_dense dense(100,10);
std::cout << dense.forward(B1) << std::endl;
+11 -10
View File
@@ -22,7 +22,7 @@
*
* Project Name: PANIC
* Module Name: io
* File Name: print_tensor.hpp
* File Name: print_tensor.cpp
* Revision: 0.1.0
* Date: 21-06-2026
* Author: Michelle Bausager
@@ -36,6 +36,7 @@
// INCLUDE DESCRIPTION
//-----------------------------------------------------------------------------------------------------
#include <iostream> // for std::cout, std::endl
//#include <io/print_tensor.hpp>
#include <tensor/vector.hpp> // for panic::tensor::vector
#include <tensor/matrix.hpp>
@@ -64,7 +65,7 @@ namespace panic {
//--------------------------------------------------------------------------------------------------------------------------
void print_vector(const panic::tensor::uint_vector& v){
std::cout << "[";
for (panic::uint_t i = 0; i < v.size()-1; ++i){
for (panic::types::uint_t i = 0; i < v.size()-1; ++i){
std::cout << v[i] << ", ";
}
std::cout << v[v.size()-1]<< "]" << std::endl;
@@ -72,7 +73,7 @@ void print_vector(const panic::tensor::uint_vector& v){
}
void print_vector(const panic::tensor::int_vector& v){
std::cout << "[";
for (panic::uint_t i = 0; i < v.size()-1; ++i){
for (panic::types::uint_t i = 0; i < v.size()-1; ++i){
std::cout << v[i] << ", ";
}
std::cout << v[v.size()-1]<< "]" << std::endl;
@@ -80,7 +81,7 @@ void print_vector(const panic::tensor::int_vector& v){
}
void print_vector(const panic::tensor::real_vector& v){
std::cout << "[";
for (panic::uint_t i = 0; i < v.size()-1; ++i){
for (panic::types::uint_t i = 0; i < v.size()-1; ++i){
std::cout << v[i] << ", ";
}
std::cout << v[v.size()-1]<< "]" << std::endl;
@@ -98,9 +99,9 @@ void print_vector(const panic::tensor::real_vector& v){
//--------------------------------------------------------------------------------------------------------------------------
void print_matrix(const panic::tensor::uint_matrix& A){
std::cout << "[";
for (panic::uint_t i = 0; i < A.rows(); ++i){
for (panic::types::uint_t i = 0; i < A.rows(); ++i){
std::cout << "[";
for (panic::uint_t j = 0; j < A.cols(); ++j){
for (panic::types::uint_t j = 0; j < A.cols(); ++j){
std::cout << A(i,j) << ", ";
}
if (i < A.rows()-1){
@@ -113,9 +114,9 @@ void print_matrix(const panic::tensor::uint_matrix& A){
void print_matrix(const panic::tensor::int_matrix& A){
std::cout << "[";
for (panic::uint_t i = 0; i < A.rows(); ++i){
for (panic::types::uint_t i = 0; i < A.rows(); ++i){
std::cout << "[";
for (panic::uint_t j = 0; j < A.cols(); ++j){
for (panic::types::uint_t j = 0; j < A.cols(); ++j){
std::cout << A(i,j) << ", ";
}
if (i < A.rows()-1){
@@ -128,9 +129,9 @@ void print_matrix(const panic::tensor::int_matrix& A){
void print_matrix(const panic::tensor::real_matrix& A){
std::cout << "[";
for (panic::uint_t i = 0; i < A.rows(); ++i){
for (panic::types::uint_t i = 0; i < A.rows(); ++i){
std::cout << "[";
for (panic::uint_t j = 0; j < A.cols(); ++j){
for (panic::types::uint_t j = 0; j < A.cols(); ++j){
std::cout << A(i,j) << ", ";
}
if (i < A.rows()-1){
+563
View File
@@ -0,0 +1,563 @@
/**++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*
* 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: math
* File Name: add.cpp
* Revision: 0.1.0
* Date: 25-06-2026
* Author: Michelle Bausager
*
* Description:
* Functions to add panic::tensors togther;
*
*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
//---------------------------------------------------------------------------------------------------------------------------
// INCLUDE DESCRIPTION
//-----------------------------------------------------------------------------------------------------
#include <math/add.hpp>
#include <config/omp.hpp>
//#include <tensor/matrix.hpp> // for panic::tensor::real_matrix
//---------------------------------------------------------------------------------------------------------------------------
// DEFINE DESCRIPTION
//---------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------
// VARIABLE DESCRIPTION
//---------------------------------------------------------------------------------------------------------------------------
static const panic::types::uint_t add_omp_min_work = 10000;
//---------------------------------------------------------------------------------------------------------------------------
// FUNCTION PROTOTYPE
//---------------------------------------------------------------------------------------------------------------------------
namespace panic {
namespace math {
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::math::add
//
// Description:
// Adds a constant to a vector
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
bool add(const panic::tensor::vector<T>& a, const T k, panic::tensor::vector<T>& c){
if (!c.resize(a.size())){
return false;
}
PANIC_OMP_PARALLEL_FOR_IF(a.size() > add_omp_min_work)
for (panic::types::uint_t i = 0; i < a.size(); ++i){
c[i] = a[i] + k;
}
return true;
}
//---------------------------------------------------------------------------------------------------------------------------
// EXPLICIT TEMPLATE DECLARATION
//---------------------------------------------------------------------------------------------------------------------------
template bool add<panic::types::uint_t>(const panic::tensor::vector<panic::types::uint_t>& a,
const panic::types::uint_t k,
panic::tensor::vector<panic::types::uint_t>& c
);
template bool add<panic::types::int_t>(const panic::tensor::vector<panic::types::int_t>& a,
const panic::types::int_t k,
panic::tensor::vector<panic::types::int_t>& c
);
template bool add<panic::types::real_t>(const panic::tensor::vector<panic::types::real_t>& a,
const panic::types::real_t k,
panic::tensor::vector<panic::types::real_t>& c
);
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::math::add
//
// Description:
// Adds a constant to a vector
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
panic::tensor::vector<T> add(const panic::tensor::vector<T>& a, const T k){
panic::tensor::vector<T> c(a.size());
if (!add(a, k, c)){
return panic::tensor::vector<T>();
}
return c;
}
//---------------------------------------------------------------------------------------------------------------------------
// EXPLICIT TEMPLATE DECLARATION
//---------------------------------------------------------------------------------------------------------------------------
template panic::tensor::vector<panic::types::uint_t>
add(const panic::tensor::vector<panic::types::uint_t>& a,
const panic::types::uint_t k
);
template panic::tensor::vector<panic::types::int_t>
add(const panic::tensor::vector<panic::types::int_t>& a,
const panic::types::int_t k
);
template panic::tensor::vector<panic::types::real_t>
add(const panic::tensor::vector<panic::types::real_t>& a,
const panic::types::real_t k
);
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::math::add
//
// Description:
// Adds a vector to a vector
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
bool add(const panic::tensor::vector<T>& a, const panic::tensor::vector<T>& b, panic::tensor::vector<T>& c){
if (a.size() != b.size()){
return false;
}
if (!c.resize(a.size())){
return false;
}
PANIC_OMP_PARALLEL_FOR_IF(a.size() > add_omp_min_work)
for (panic::types::uint_t i = 0; i < a.size(); ++i){
c[i] = a[i] + b[i];
}
return true;
}
//---------------------------------------------------------------------------------------------------------------------------
// EXPLICIT TEMPLATE DECLARATION
//---------------------------------------------------------------------------------------------------------------------------
template bool add(const panic::tensor::vector<panic::types::uint_t>& a,
const panic::tensor::vector<panic::types::uint_t>& b,
panic::tensor::vector<panic::types::uint_t>& c
);
template bool add(const panic::tensor::vector<panic::types::int_t>& a,
const panic::tensor::vector<panic::types::int_t>& b,
panic::tensor::vector<panic::types::int_t>& c
);
template bool add(const panic::tensor::vector<panic::types::real_t>& a,
const panic::tensor::vector<panic::types::real_t>& b,
panic::tensor::vector<panic::types::real_t>& c
);
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::math::add
//
// Description:
// Adds a vector to a vector
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
panic::tensor::vector<T> add(const panic::tensor::vector<T>& a, const panic::tensor::vector<T>& b){
panic::tensor::vector<T> c(a.size());
if (!add(a, b, c)){
return panic::tensor::vector<T>();
}
return c;
}
//---------------------------------------------------------------------------------------------------------------------------
// EXPLICIT TEMPLATE DECLARATION
//---------------------------------------------------------------------------------------------------------------------------
template panic::tensor::vector<panic::types::uint_t>
add(const panic::tensor::vector<panic::types::uint_t>& a,
const panic::tensor::vector<panic::types::uint_t>& b
);
template panic::tensor::vector<panic::types::int_t>
add(const panic::tensor::vector<panic::types::int_t>& a,
const panic::tensor::vector<panic::types::int_t>& b
);
template panic::tensor::vector<panic::types::real_t>
add(const panic::tensor::vector<panic::types::real_t>& a,
const panic::tensor::vector<panic::types::real_t>& b
);
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::math::add
//
// Description:
// Adds a constant to a matrix
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
bool add(const panic::tensor::matrix<T>& A, const T k, panic::tensor::matrix<T>& C){
panic::types::uint_t rows = A.rows();
panic::types::uint_t cols = A.cols();
panic::types::uint_t work = rows*cols;
if ( !C.resize(rows, cols) ){
return false;
}
PANIC_OMP_PARALLEL_FOR_IF(work > add_omp_min_work)
for (panic::types::uint_t i = 0; i < rows; ++i){
for (panic::types::uint_t j = 0; j < cols; ++j){
C(i,j) = A(i,j) + k;
}
}
return true;
}
//---------------------------------------------------------------------------------------------------------------------------
// EXPLICIT TEMPLATE DECLARATION
//---------------------------------------------------------------------------------------------------------------------------
template bool add(const panic::tensor::matrix<panic::types::uint_t>& A,
const panic::types::uint_t k,
panic::tensor::matrix<panic::types::uint_t>& C
);
template bool add(const panic::tensor::matrix<panic::types::int_t>& A,
const panic::types::int_t k,
panic::tensor::matrix<panic::types::int_t>& C
);
template bool add(const panic::tensor::matrix<panic::types::real_t>& A,
const panic::types::real_t k,
panic::tensor::matrix<panic::types::real_t>& C
);
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::math::add
//
// Description:
// Adds a constant to a matrix
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
panic::tensor::matrix<T> add(const panic::tensor::matrix<T>& A, const T k){
panic::tensor::matrix<T> C;
if (!add(A, k, C)){
return panic::tensor::matrix<T>();
}
return C;
}
//---------------------------------------------------------------------------------------------------------------------------
// EXPLICIT TEMPLATE DECLARATION
//---------------------------------------------------------------------------------------------------------------------------
template panic::tensor::matrix<panic::types::uint_t>
add(const panic::tensor::matrix<panic::types::uint_t>& A,
const panic::types::uint_t k
);
template panic::tensor::matrix<panic::types::int_t>
add(const panic::tensor::matrix<panic::types::int_t>& A,
const panic::types::int_t k
);
template panic::tensor::matrix<panic::types::real_t>
add(const panic::tensor::matrix<panic::types::real_t>& A,
const panic::types::real_t k
);
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::math::add
//
// Description:
// Adds a matrix to a matrix
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
bool add(const panic::tensor::matrix<T>& A, const panic::tensor::matrix<T>& B, panic::tensor::matrix<T>& C){
panic::types::uint_t rows = A.rows();
panic::types::uint_t cols = A.cols();
panic::types::uint_t work = rows*cols;
if ( (rows != B.rows()) || (cols != B.cols())){
return false;
}
if ( !C.resize(rows, cols) ){
return false;
}
PANIC_OMP_PARALLEL_FOR_IF(work > add_omp_min_work)
for (panic::types::uint_t i = 0; i < rows; ++i){
for (panic::types::uint_t j = 0; j < cols; ++j){
C(i,j) = A(i,j) + B(i,j);
}
}
return true;
}
//---------------------------------------------------------------------------------------------------------------------------
// EXPLICIT TEMPLATE DECLARATION
//---------------------------------------------------------------------------------------------------------------------------
template bool add(const panic::tensor::matrix<panic::types::uint_t>& A,
const panic::tensor::matrix<panic::types::uint_t>& B,
panic::tensor::matrix<panic::types::uint_t>& C
);
template bool add(const panic::tensor::matrix<panic::types::int_t>& A,
const panic::tensor::matrix<panic::types::int_t>& B,
panic::tensor::matrix<panic::types::int_t>& C
);
template bool add(const panic::tensor::matrix<panic::types::real_t>& A,
const panic::tensor::matrix<panic::types::real_t>& B,
panic::tensor::matrix<panic::types::real_t>& C
);
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::math::add
//
// Description:
// Adds a matrix to a matrix
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
panic::tensor::matrix<T> add(const panic::tensor::matrix<T>& A, const panic::tensor::matrix<T>& B){
panic::tensor::matrix<T> C;
if (!add(A, B, C)){
return panic::tensor::matrix<T>();
}
return C;
}
//---------------------------------------------------------------------------------------------------------------------------
// EXPLICIT TEMPLATE DECLARATION
//---------------------------------------------------------------------------------------------------------------------------
template panic::tensor::matrix<panic::types::uint_t>
add(const panic::tensor::matrix<panic::types::uint_t>& A,
const panic::tensor::matrix<panic::types::uint_t>& B
);
template panic::tensor::matrix<panic::types::int_t>
add(const panic::tensor::matrix<panic::types::int_t>& A,
const panic::tensor::matrix<panic::types::int_t>& B
);
template panic::tensor::matrix<panic::types::real_t>
add(const panic::tensor::matrix<panic::types::real_t>& A,
const panic::tensor::matrix<panic::types::real_t>& B
);
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::math::add_rowwise
//
// Description:
// Adds a vector row-wise to a matrix
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
bool add_rowwise(const panic::tensor::matrix<T>& A, const panic::tensor::vector<T>& b, panic::tensor::matrix<T>& C){
panic::types::uint_t rows = A.rows();
panic::types::uint_t cols = A.cols();
panic::types::uint_t work = rows*cols;
if ( cols != b.size() ){
return false;
}
if ( !C.resize(rows, cols) ){
return false;
}
PANIC_OMP_PARALLEL_FOR_IF(work > add_omp_min_work)
for (panic::types::uint_t i = 0; i < rows; ++i){
for (panic::types::uint_t j = 0; j < cols; ++j){
C(i,j) = A(i,j) + b[j];
}
}
return true;
}
//---------------------------------------------------------------------------------------------------------------------------
// EXPLICIT TEMPLATE DECLARATION
//---------------------------------------------------------------------------------------------------------------------------
template bool add_rowwise(const panic::tensor::matrix<panic::types::uint_t>& A,
const panic::tensor::vector<panic::types::uint_t>& b,
panic::tensor::matrix<panic::types::uint_t>& C
);
template bool add_rowwise(const panic::tensor::matrix<panic::types::int_t>& A,
const panic::tensor::vector<panic::types::int_t>& b,
panic::tensor::matrix<panic::types::int_t>& C
);
template bool add_rowwise(const panic::tensor::matrix<panic::types::real_t>& A,
const panic::tensor::vector<panic::types::real_t>& b,
panic::tensor::matrix<panic::types::real_t>& C
);
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::math::add_rowwise
//
// Description:
// Adds a vector row-wise to a matrix
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
panic::tensor::matrix<T> add_rowwise(const panic::tensor::matrix<T>& A, const panic::tensor::vector<T>& b){
panic::tensor::matrix<T> C;
if (!add_rowwise(A, b, C)){
return panic::tensor::matrix<T>();
}
return C;
}
//---------------------------------------------------------------------------------------------------------------------------
// EXPLICIT TEMPLATE DECLARATION
//---------------------------------------------------------------------------------------------------------------------------
template panic::tensor::matrix<panic::types::uint_t>
add_rowwise(const panic::tensor::matrix<panic::types::uint_t>& A,
const panic::tensor::vector<panic::types::uint_t>& b
);
template panic::tensor::matrix<panic::types::int_t>
add_rowwise(const panic::tensor::matrix<panic::types::int_t>& A,
const panic::tensor::vector<panic::types::int_t>& b
);
template panic::tensor::matrix<panic::types::real_t>
add_rowwise(const panic::tensor::matrix<panic::types::real_t>& A,
const panic::tensor::vector<panic::types::real_t>& b
);
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::math::add_colwise
//
// Description:
// Adds a vector coloumn-wise to a matrix
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
bool add_colwise(const panic::tensor::matrix<T>& A, const panic::tensor::vector<T>& b, panic::tensor::matrix<T>& C){
panic::types::uint_t rows = A.rows();
panic::types::uint_t cols = A.cols();
panic::types::uint_t work = rows*cols;
if ( rows != b.size() ){
return false;
}
if ( !C.resize(rows, cols) ){
return false;
}
PANIC_OMP_PARALLEL_FOR_IF(work > add_omp_min_work)
for (panic::types::uint_t i = 0; i < rows; ++i){
const T temp = b[i];
for (panic::types::uint_t j = 0; j < cols; ++j){
C(i,j) = A(i,j) + temp;
}
}
return true;
}
//---------------------------------------------------------------------------------------------------------------------------
// EXPLICIT TEMPLATE DECLARATION
//---------------------------------------------------------------------------------------------------------------------------
template bool add_colwise(const panic::tensor::matrix<panic::types::uint_t>& A,
const panic::tensor::vector<panic::types::uint_t>& b,
panic::tensor::matrix<panic::types::uint_t>& C
);
template bool add_colwise(const panic::tensor::matrix<panic::types::int_t>& A,
const panic::tensor::vector<panic::types::int_t>& b,
panic::tensor::matrix<panic::types::int_t>& C
);
template bool add_colwise(const panic::tensor::matrix<panic::types::real_t>& A,
const panic::tensor::vector<panic::types::real_t>& b,
panic::tensor::matrix<panic::types::real_t>& C
);
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::math::add_colwise
//
// Description:
// Adds a vector coloumn-wise to a matrix
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
panic::tensor::matrix<T> add_colwise(const panic::tensor::matrix<T>& A, const panic::tensor::vector<T>& b){
panic::tensor::matrix<T> C;
if (!add_colwise(A, b, C)){
return panic::tensor::matrix<T>();
}
return C;
}
//---------------------------------------------------------------------------------------------------------------------------
// EXPLICIT TEMPLATE DECLARATION
//---------------------------------------------------------------------------------------------------------------------------
template panic::tensor::matrix<panic::types::uint_t>
add_colwise(const panic::tensor::matrix<panic::types::uint_t>& A,
const panic::tensor::vector<panic::types::uint_t>& b
);
template panic::tensor::matrix<panic::types::int_t>
add_colwise(const panic::tensor::matrix<panic::types::int_t>& A,
const panic::tensor::vector<panic::types::int_t>& b
);
template panic::tensor::matrix<panic::types::real_t>
add_colwise(const panic::tensor::matrix<panic::types::real_t>& A,
const panic::tensor::vector<panic::types::real_t>& b
);
} // namespace math
} // namespace panic
+169
View File
@@ -0,0 +1,169 @@
/**++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*
* 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: math
* File Name: matmul.cpp
* Revision: 0.1.0
* Date: 24-06-2026
* Author: Michelle Bausager
*
* Description:
* Functions to print out tensors with std::cout << x std::endl;
*
*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
//---------------------------------------------------------------------------------------------------------------------------
// INCLUDE DESCRIPTION
//-----------------------------------------------------------------------------------------------------
#include <math/matmul.hpp>
#include <tensor/matrix.hpp> // for panic::tensor::real_matrix
#include <config/omp.hpp>
//---------------------------------------------------------------------------------------------------------------------------
// DEFINE DESCRIPTION
//---------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------
// VARIABLE DESCRIPTION
//---------------------------------------------------------------------------------------------------------------------------
static const panic::types::uint_t matmul_omp_min_work = 10000;
//---------------------------------------------------------------------------------------------------------------------------
// FUNCTION PROTOTYPE
//---------------------------------------------------------------------------------------------------------------------------
namespace panic {
namespace math {
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::math::matmul
//
// Description:
// Multiply two matrices into C.
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
bool matmul(const panic::tensor::matrix<T>& A, const panic::tensor::matrix<T>& B, panic::tensor::matrix<T>& C){
const panic::types::uint_t rows = A.rows();
const panic::types::uint_t cols = B.cols();
const panic::types::uint_t inner = A.cols();
// Dimention mismacth
if( inner != B.rows()){
C.resize(0,0);
return false;
}
// In-place case: matmul(A, B, A) or matmul(A, B, B)
// This is not allowed since operation is unsafe.
// Use A = matmul(A, B) or B = matmul(A, B) instead.
if (&C == &A || &C == &B){
return false;
}
if (!C.resize(rows, cols)){
return false;
}
const panic::types::uint_t work = rows*cols*inner;
PANIC_OMP_PARALLEL_FOR_IF(work > matmul_omp_min_work)
for (panic::types::uint_t i = 0; i < rows; ++i){
for (panic::types::uint_t j = 0; j < cols; ++j){
T sum = static_cast<T>(0);
for (panic::types::uint_t k = 0; k < inner; ++k){
sum += A(i,k) * B(k,j);
}
C(i,j) = sum;
}
}
return true;
}
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::math::matmul
//
// Description:
// Multiply two matrices and returns the result.
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
panic::tensor::matrix<T> matmul(const panic::tensor::matrix<T>& A, const panic::tensor::matrix<T>& B){
panic::tensor::matrix<T> C;
if (!matmul(A,B,C)){
return panic::tensor::matrix<T>();
}
return C;
}
//---------------------------------------------------------------------------------------------------------------------------
// EXPLICIT TEMPLATE DECLARATION
//---------------------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------------------
// Function : bool matmul(const panic::tensor::matrix<T>& A, const panic::tensor::matrix<T>& B, panic::tensor::matrix<T>& C)
template bool matmul<panic::types::uint_t>(
const panic::tensor::matrix<panic::types::uint_t>& A,
const panic::tensor::matrix<panic::types::uint_t>& B,
panic::tensor::matrix<panic::types::uint_t>& C
);
template bool matmul<panic::types::int_t>(
const panic::tensor::matrix<panic::types::int_t>& A,
const panic::tensor::matrix<panic::types::int_t>& B,
panic::tensor::matrix<panic::types::int_t>& C
);
template bool matmul<panic::types::real_t>(
const panic::tensor::matrix<panic::types::real_t>& A,
const panic::tensor::matrix<panic::types::real_t>& B,
panic::tensor::matrix<panic::types::real_t>& C
);
//--------------------------------------------------------------------------------------------------------------------------
// Function : panic::tensor::matrix<T> matmul(const panic::tensor::matrix<T>& A, const panic::tensor::matrix<T>& B)
template panic::tensor::matrix<panic::types::uint_t> matmul<panic::types::uint_t>(
const panic::tensor::matrix<panic::types::uint_t>& A,
const panic::tensor::matrix<panic::types::uint_t>& B
);
template panic::tensor::matrix<panic::types::int_t> matmul<panic::types::int_t>(
const panic::tensor::matrix<panic::types::int_t>& A,
const panic::tensor::matrix<panic::types::int_t>& B
);
template panic::tensor::matrix<panic::types::real_t> matmul<panic::types::real_t>(
const panic::tensor::matrix<panic::types::real_t>& A,
const panic::tensor::matrix<panic::types::real_t>& B
);
} // namespace math
} // namespace panic
-329
View File
@@ -1,329 +0,0 @@
/**++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*
* 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: neural_network
* File Name: layer_dense.cpp
* Revision: 0.1.0
* Date: 23-06-2026
* Author: Michelle Bausager
*
* Description:
* Defines the dense layers used in neural network
*
*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
//---------------------------------------------------------------------------------------------------------------------------
// INCLUDE DESCRIPTION
//---------------------------------------------------------------------------------------------------------------------------
#include <tensor/vector.hpp>
#include <config/omp.hpp>
//---------------------------------------------------------------------------------------------------------------------------
// DEFINE DESCRIPTION
//---------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------
// TYPE DESCRIPTION
//---------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------
// VARIABLE DESCRIPTION
//---------------------------------------------------------------------------------------------------------------------------
static const panic::uint_t vector_omp_min_size = 10000;
//---------------------------------------------------------------------------------------------------------------------------
// FUNCTION PROTOTYPE
//---------------------------------------------------------------------------------------------------------------------------
namespace panic{
namespace tensor{
//--------------------------------------------------------------------------------------------------------------------------
// Constructor Name : panic::tensor::vector::vector
//
// Description:
// Creates an empty vector.
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
vector<T>::vector() {
length = 0;
data = 0;
}
//--------------------------------------------------------------------------------------------------------------------------
// Constructor Name : panic::tensor::vector::vector
//
// Description:
// Creates a vector with size allocation and initializes all values to zero.
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
vector<T>::vector(panic::uint_t size){
length = size;
if (length == 0){
data = 0;
return;
}
data = new T[length];
PANIC_OMP_PARALLEL_FOR_IF(length > vector_omp_min_size)
for (panic::uint_t i = 0; i < size; ++i){
data[i] = static_cast<T>(0);
}
}
//--------------------------------------------------------------------------------------------------------------------------
// Constructor Name : panic::tensor::vector::vector
//
// Description:
// Creates a vector with size allocation and initializes all values.
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
vector<T>::vector(panic::uint_t size, T value){
length = size;
if (size == 0){
data = 0;
return;
}
data = new T[size];
PANIC_OMP_PARALLEL_FOR_IF(length > vector_omp_min_size)
for (panic::uint_t i = 0; i < size; ++i){
data[i] = value;
}
}
//--------------------------------------------------------------------------------------------------------------------------
// Constructor Name : panic::tensor::vector::vector
//
// Description:
// Copy-contructor, makes a deep copy of another vector like this:
// vector a(3);
// vector b = a;
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
vector<T>::vector(const vector& other){
length = other.length;
if (length == 0){
data = 0;
return;
}
data = new T[length];
PANIC_OMP_PARALLEL_FOR_IF(length > vector_omp_min_size)
for (panic::uint_t i = 0; i < length; ++i){
data[i] = other.data[i];
}
}
//--------------------------------------------------------------------------------------------------------------------------
// Deconstructor Name : panic::tensor::vector::~vector
//
// Description:
// Deletes the data and releases the memory.
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
vector<T>::~vector(){
delete[] data;
data = 0;
length = 0;
}
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::tensor::vector::operator=
//
// Description:
// Copy-assignment. Copies from another vector like this:
// vector a(5);
// vector b(3);
// b = a;
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
vector<T>& vector<T>::operator=(const vector& other){
if (this == &other){
return *this;
}
T* new_data = 0;
if (other.length > 0){
new_data = new T[other.length];
PANIC_OMP_PARALLEL_FOR_IF(length > vector_omp_min_size)
for (panic::uint_t i = 0; i < other.length; ++i){
new_data[i] = other.data[i];
}
}
delete[] data;
data = new_data;
length = other.length;
return *this;
}
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::tensor::vector::resize
//
// Description:
// Returns the length/size of the vector
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
panic::uint_t vector<T>::size() const{
return length;
}
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::tensor::vector::resize
//
// Description:
// Resizes the vector to new length and keeps old values
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
bool vector<T>::resize(panic::uint_t new_size){
if (new_size == length){
return true;
}
if (new_size == 0){
data = 0;
length = 0;
return true;
}
T* new_data = new T[new_size];
panic::uint_t copy_size = length;
if (new_size < length){
copy_size = new_size;
}
PANIC_OMP_PARALLEL_FOR_IF(copy_size > vector_omp_min_size)
for (panic::uint_t i = 0; i < copy_size; ++i){
new_data[i] = data[i];
}
PANIC_OMP_PARALLEL_FOR_IF(copy_size - new_size > vector_omp_min_size)
for (panic::uint_t i = copy_size; i < new_size; ++i){
new_data[i] = static_cast<T>(0);
}
delete[] data;
data = new_data;
length = new_size;
return true;
}
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::tensor::vector::fill
//
// Description:
// Fills te vector with a value
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
bool vector<T>::fill(T value){
PANIC_OMP_PARALLEL_FOR_IF(length > vector_omp_min_size)
for (panic::uint_t i = 0; i < length; ++i){
data[i] = value;
}
return true;
}
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::tensor::vector::operator[]
//
// Description:
// Lets you read and write v[index]
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
T& vector<T>::operator[](panic::uint_t index){
return data[index];
}
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::tensor::vector::operator[]
//
// Description:
// Lets you read v[index] from a const vector
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
const T& vector<T>::operator[](panic::uint_t index) const{
return data[index];
}
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::tensor::vector::at
//
// Description:
// Lets you read and write v.at(index) with index bounse
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
T& vector<T>::at(panic::uint_t index){
if (index >= length){
return data[length-1];
}
return data[index];
}
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::tensor::vector::at
//
// Description:
// Lets you read v[index] from a const vector with index bounse
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
const T& vector<T>::at(panic::uint_t index) const{
if (index >= length){
return data[length-1];
}
return data[index];
}
//---------------------------------------------------------------------------------------------------------------------------
// EXPLICIT TEMPLATE INSTANTIATION
//---------------------------------------------------------------------------------------------------------------------------
template struct vector<panic::real_t>;
template struct vector<panic::int_t>;
template struct vector<panic::uint_t>;
} // namespace tensor
} // namespace panic
+46 -230
View File
@@ -35,8 +35,10 @@
//---------------------------------------------------------------------------------------------------------------------------
// INCLUDE DESCRIPTION
//---------------------------------------------------------------------------------------------------------------------------
#include <tensor/vector.hpp>
#include <neural_network/layer/layer_dense.hpp>
#include <config/omp.hpp>
#include <math/matmul.hpp>
#include <math/add.hpp>
//---------------------------------------------------------------------------------------------------------------------------
// DEFINE DESCRIPTION
@@ -49,97 +51,37 @@
//---------------------------------------------------------------------------------------------------------------------------
// VARIABLE DESCRIPTION
//---------------------------------------------------------------------------------------------------------------------------
static const panic::uint_t vector_omp_min_size = 10000;
static const panic::types::uint_t layer_dense_omp_min_size = 10000;
//---------------------------------------------------------------------------------------------------------------------------
// FUNCTION PROTOTYPE
//---------------------------------------------------------------------------------------------------------------------------
namespace panic{
namespace tensor{
namespace neural_network{
//--------------------------------------------------------------------------------------------------------------------------
// Constructor Name : panic::tensor::vector::vector
// Constructor Name : panic::neural_network::layer_dense
//
// Description:
// Creates an empty vector.
// Creates an empty layer.
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
vector<T>::vector() {
length = 0;
data = 0;
layer_dense::layer_dense() {
weights.resize(0,0);
biases.resize(0);
outputs.resize(0,0);
}
//--------------------------------------------------------------------------------------------------------------------------
// Constructor Name : panic::tensor::vector::vector
// Constructor Name : panic::neural_network::layer_dense
//
// Description:
// Creates a vector with size allocation and initializes all values to zero.
// Creates an empty layer.
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
vector<T>::vector(panic::uint_t size){
length = size;
if (length == 0){
data = 0;
return;
}
data = new T[length];
PANIC_OMP_PARALLEL_FOR_IF(length > vector_omp_min_size)
for (panic::uint_t i = 0; i < size; ++i){
data[i] = static_cast<T>(0);
}
}
//--------------------------------------------------------------------------------------------------------------------------
// Constructor Name : panic::tensor::vector::vector
//
// Description:
// Creates a vector with size allocation and initializes all values.
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
vector<T>::vector(panic::uint_t size, T value){
length = size;
if (size == 0){
data = 0;
return;
}
data = new T[size];
PANIC_OMP_PARALLEL_FOR_IF(length > vector_omp_min_size)
for (panic::uint_t i = 0; i < size; ++i){
data[i] = value;
}
}
//--------------------------------------------------------------------------------------------------------------------------
// Constructor Name : panic::tensor::vector::vector
//
// Description:
// Copy-contructor, makes a deep copy of another vector like this:
// vector a(3);
// vector b = a;
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
vector<T>::vector(const vector& other){
length = other.length;
if (length == 0){
data = 0;
return;
}
data = new T[length];
PANIC_OMP_PARALLEL_FOR_IF(length > vector_omp_min_size)
for (panic::uint_t i = 0; i < length; ++i){
data[i] = other.data[i];
}
layer_dense::layer_dense(panic::types::uint_t input_size, panic::types::uint_t neurons) {
weights.resize(input_size, neurons);
biases.resize(neurons);
outputs.resize(0,0);
}
//--------------------------------------------------------------------------------------------------------------------------
@@ -148,182 +90,56 @@ vector<T>::vector(const vector& other){
// Description:
// Deletes the data and releases the memory.
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
vector<T>::~vector(){
delete[] data;
data = 0;
length = 0;
}
//template <typename T>
//vector<T>::~vector(){
// delete[] data;
//
// data = 0;
// length = 0;
//}
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::tensor::vector::operator=
// Function Name : panic::neural_network::layer_dense.forward
//
// Description:
// Copy-assignment. Copies from another vector like this:
// vector a(5);
// vector b(3);
// b = a;
// Calculated the forward pass:
// outputs = inputs * weights + biases
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
vector<T>& vector<T>::operator=(const vector& other){
if (this == &other){
return *this;
bool layer_dense::forward(const panic::tensor::real_matrix& inputs){
if (inputs.cols() != weights.rows()){
return false;
}
T* new_data = 0;
if (other.length > 0){
new_data = new T[other.length];
PANIC_OMP_PARALLEL_FOR_IF(length > vector_omp_min_size)
for (panic::uint_t i = 0; i < other.length; ++i){
new_data[i] = other.data[i];
}
if (!outputs.resize(inputs.rows(), weights.cols())){
return false;
}
delete[] data;
data = new_data;
length = other.length;
return *this;
}
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::tensor::vector::resize
//
// Description:
// Returns the length/size of the vector
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
panic::uint_t vector<T>::size() const{
return length;
}
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::tensor::vector::resize
//
// Description:
// Resizes the vector to new length and keeps old values
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
bool vector<T>::resize(panic::uint_t new_size){
if (new_size == length){
return true;
if (!panic::math::matmul(inputs, weights, outputs)){
return false;
}
if (new_size == 0){
data = 0;
length = 0;
return true;
}
T* new_data = new T[new_size];
panic::uint_t copy_size = length;
if (new_size < length){
copy_size = new_size;
}
PANIC_OMP_PARALLEL_FOR_IF(copy_size > vector_omp_min_size)
for (panic::uint_t i = 0; i < copy_size; ++i){
new_data[i] = data[i];
}
PANIC_OMP_PARALLEL_FOR_IF(copy_size - new_size > vector_omp_min_size)
for (panic::uint_t i = copy_size; i < new_size; ++i){
new_data[i] = static_cast<T>(0);
}
delete[] data;
data = new_data;
length = new_size;
return true;
}
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::tensor::vector::fill
//
// Description:
// Fills te vector with a value
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
bool vector<T>::fill(T value){
PANIC_OMP_PARALLEL_FOR_IF(length > vector_omp_min_size)
for (panic::uint_t i = 0; i < length; ++i){
data[i] = value;
if (!panic::math::add_rowwise(outputs, biases, outputs)){
return false;
}
return true;
}
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::tensor::vector::operator[]
// Function Name : panic::neural_network::layer_dense.backward
//
// Description:
// Lets you read and write v[index]
// Calculated the backward pass:
// ??
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
T& vector<T>::operator[](panic::uint_t index){
return data[index];
bool layer_dense::backward(const panic::tensor::real_matrix& dinputs){
return true;
}
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::tensor::vector::operator[]
//
// Description:
// Lets you read v[index] from a const vector
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
const T& vector<T>::operator[](panic::uint_t index) const{
return data[index];
}
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::tensor::vector::at
//
// Description:
// Lets you read and write v.at(index) with index bounse
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
T& vector<T>::at(panic::uint_t index){
if (index >= length){
return data[length-1];
}
return data[index];
}
//--------------------------------------------------------------------------------------------------------------------------
// Function Name : panic::tensor::vector::at
//
// Description:
// Lets you read v[index] from a const vector with index bounse
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
const T& vector<T>::at(panic::uint_t index) const{
if (index >= length){
return data[length-1];
}
return data[index];
}
//---------------------------------------------------------------------------------------------------------------------------
// EXPLICIT TEMPLATE INSTANTIATION
//---------------------------------------------------------------------------------------------------------------------------
template struct vector<panic::real_t>;
template struct vector<panic::int_t>;
template struct vector<panic::uint_t>;
} // namespace tensor
} // namespace panic
} // namespace panic
+21 -21
View File
@@ -49,7 +49,7 @@
//---------------------------------------------------------------------------------------------------------------------------
// VARIABLE DESCRIPTION
//---------------------------------------------------------------------------------------------------------------------------
static const panic::uint_t matrix_omp_min_size = 10000;
static const panic::types::uint_t matrix_omp_min_size = 10000;
//---------------------------------------------------------------------------------------------------------------------------
// FUNCTION PROTOTYPE
@@ -79,7 +79,7 @@ matrix<T>::matrix() {
// Creates a matrix with size allocation and initializes all values to zero.
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
matrix<T>::matrix(panic::uint_t rows, panic::uint_t cols){
matrix<T>::matrix(panic::types::uint_t rows, panic::types::uint_t cols){
n = rows;
m = cols;
length = n*m;
@@ -92,7 +92,7 @@ matrix<T>::matrix(panic::uint_t rows, panic::uint_t cols){
data = new T[length];
PANIC_OMP_PARALLEL_FOR_IF(length > matrix_omp_min_size)
for (panic::uint_t i = 0; i < length; ++i){
for (panic::types::uint_t i = 0; i < length; ++i){
data[i] = static_cast<T>(0);
}
@@ -105,7 +105,7 @@ matrix<T>::matrix(panic::uint_t rows, panic::uint_t cols){
// Creates a matrix with size allocation and initializes all values.
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
matrix<T>::matrix(panic::uint_t rows, panic::uint_t cols, T value){
matrix<T>::matrix(panic::types::uint_t rows, panic::types::uint_t cols, T value){
n = rows;
m = cols;
length = n*m;
@@ -118,7 +118,7 @@ matrix<T>::matrix(panic::uint_t rows, panic::uint_t cols, T value){
data = new T[length];
PANIC_OMP_PARALLEL_FOR_IF(length > matrix_omp_min_size)
for (panic::uint_t i = 0; i < length; ++i){
for (panic::types::uint_t i = 0; i < length; ++i){
data[i] = value;
}
}
@@ -145,7 +145,7 @@ matrix<T>::matrix(const matrix& other){
data = new T[length];
PANIC_OMP_PARALLEL_FOR_IF(length > matrix_omp_min_size)
for (panic::uint_t i = 0; i < length; ++i){
for (panic::types::uint_t i = 0; i < length; ++i){
data[i] = other.data[i];
}
}
@@ -186,8 +186,8 @@ matrix<T>& matrix<T>::operator=(const matrix& other){
if (other.length > 0){
new_data = new T[other.length];
PANIC_OMP_PARALLEL_FOR_IF(length > matrix_omp_min_size)
for (panic::uint_t i = 0; i < other.length; ++i){
PANIC_OMP_PARALLEL_FOR_IF(other.length > matrix_omp_min_size)
for (panic::types::uint_t i = 0; i < other.length; ++i){
new_data[i] = other.data[i];
}
}
@@ -209,7 +209,7 @@ matrix<T>& matrix<T>::operator=(const matrix& other){
// Returns the length/size of the matrix
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
panic::uint_t matrix<T>::rows() const{
panic::types::uint_t matrix<T>::rows() const{
return n;
}
@@ -220,7 +220,7 @@ panic::uint_t matrix<T>::rows() const{
// Returns the length/size of the matrix
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
panic::uint_t matrix<T>::cols() const{
panic::types::uint_t matrix<T>::cols() const{
return m;
}
@@ -231,7 +231,7 @@ panic::uint_t matrix<T>::cols() const{
// Resizes the matrix to new dimentions and keeps old values
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
bool matrix<T>::resize(panic::uint_t new_n, panic::uint_t new_m){
bool matrix<T>::resize(panic::types::uint_t new_n, panic::types::uint_t new_m){
if ((new_n == n) && (new_m == m)){
return true;
@@ -247,22 +247,22 @@ bool matrix<T>::resize(panic::uint_t new_n, panic::uint_t new_m){
return true;
}
panic::uint_t new_length = new_n*new_m;
panic::types::uint_t new_length = new_n*new_m;
T* new_data = new T[new_length];
panic::uint_t copy_size = length;
panic::types::uint_t copy_size = length;
if (new_length < length){
copy_size = new_length;
}
PANIC_OMP_PARALLEL_FOR_IF(copy_size > matrix_omp_min_size)
for (panic::uint_t i = 0; i < copy_size; ++i){
for (panic::types::uint_t i = 0; i < copy_size; ++i){
new_data[i] = data[i];
}
PANIC_OMP_PARALLEL_FOR_IF(new_length - copy_size > matrix_omp_min_size)
for (panic::uint_t i = copy_size; i < new_length; ++i){
for (panic::types::uint_t i = copy_size; i < new_length; ++i){
new_data[i] = static_cast<T>(0);
}
@@ -286,7 +286,7 @@ bool matrix<T>::resize(panic::uint_t new_n, panic::uint_t new_m){
template <typename T>
bool matrix<T>::fill(T value){
PANIC_OMP_PARALLEL_FOR_IF(length > matrix_omp_min_size)
for (panic::uint_t i = 0; i < length; ++i){
for (panic::types::uint_t i = 0; i < length; ++i){
data[i] = value;
}
@@ -300,7 +300,7 @@ bool matrix<T>::fill(T value){
// Lets you read and write A(2,3)
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
T& matrix<T>::operator()(panic::uint_t index_n, panic::uint_t index_m){
T& matrix<T>::operator()(panic::types::uint_t index_n, panic::types::uint_t index_m){
return data[index_n*m + index_m];
}
@@ -312,7 +312,7 @@ T& matrix<T>::operator()(panic::uint_t index_n, panic::uint_t index_m){
// Lets you read A(2,3) from a const matrix
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
const T& matrix<T>::operator()(panic::uint_t index_n, panic::uint_t index_m) const{
const T& matrix<T>::operator()(panic::types::uint_t index_n, panic::types::uint_t index_m) const{
return data[index_n*m + index_m];
}
@@ -321,9 +321,9 @@ const T& matrix<T>::operator()(panic::uint_t index_n, panic::uint_t index_m) con
// EXPLICIT TEMPLATE INSTANTIATION
//---------------------------------------------------------------------------------------------------------------------------
template struct matrix<panic::real_t>;
template struct matrix<panic::int_t>;
template struct matrix<panic::uint_t>;
template struct matrix<panic::types::real_t>;
template struct matrix<panic::types::int_t>;
template struct matrix<panic::types::uint_t>;
} // namespace tensor
+20 -20
View File
@@ -49,7 +49,7 @@
//---------------------------------------------------------------------------------------------------------------------------
// VARIABLE DESCRIPTION
//---------------------------------------------------------------------------------------------------------------------------
static const panic::uint_t vector_omp_min_size = 10000;
static const panic::types::uint_t vector_omp_min_size = 10000;
//---------------------------------------------------------------------------------------------------------------------------
// FUNCTION PROTOTYPE
@@ -77,7 +77,7 @@ vector<T>::vector() {
// Creates a vector with size allocation and initializes all values to zero.
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
vector<T>::vector(panic::uint_t size){
vector<T>::vector(panic::types::uint_t size){
length = size;
if (length == 0){
@@ -88,7 +88,7 @@ vector<T>::vector(panic::uint_t size){
data = new T[length];
PANIC_OMP_PARALLEL_FOR_IF(length > vector_omp_min_size)
for (panic::uint_t i = 0; i < size; ++i){
for (panic::types::uint_t i = 0; i < size; ++i){
data[i] = static_cast<T>(0);
}
@@ -101,7 +101,7 @@ vector<T>::vector(panic::uint_t size){
// Creates a vector with size allocation and initializes all values.
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
vector<T>::vector(panic::uint_t size, T value){
vector<T>::vector(panic::types::uint_t size, T value){
length = size;
if (size == 0){
@@ -112,7 +112,7 @@ vector<T>::vector(panic::uint_t size, T value){
data = new T[size];
PANIC_OMP_PARALLEL_FOR_IF(length > vector_omp_min_size)
for (panic::uint_t i = 0; i < size; ++i){
for (panic::types::uint_t i = 0; i < size; ++i){
data[i] = value;
}
}
@@ -137,7 +137,7 @@ vector<T>::vector(const vector& other){
data = new T[length];
PANIC_OMP_PARALLEL_FOR_IF(length > vector_omp_min_size)
for (panic::uint_t i = 0; i < length; ++i){
for (panic::types::uint_t i = 0; i < length; ++i){
data[i] = other.data[i];
}
}
@@ -177,7 +177,7 @@ vector<T>& vector<T>::operator=(const vector& other){
new_data = new T[other.length];
PANIC_OMP_PARALLEL_FOR_IF(length > vector_omp_min_size)
for (panic::uint_t i = 0; i < other.length; ++i){
for (panic::types::uint_t i = 0; i < other.length; ++i){
new_data[i] = other.data[i];
}
}
@@ -197,7 +197,7 @@ vector<T>& vector<T>::operator=(const vector& other){
// Returns the length/size of the vector
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
panic::uint_t vector<T>::size() const{
panic::types::uint_t vector<T>::size() const{
return length;
}
@@ -208,7 +208,7 @@ panic::uint_t vector<T>::size() const{
// Resizes the vector to new length and keeps old values
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
bool vector<T>::resize(panic::uint_t new_size){
bool vector<T>::resize(panic::types::uint_t new_size){
if (new_size == length){
return true;
}
@@ -221,19 +221,19 @@ bool vector<T>::resize(panic::uint_t new_size){
}
T* new_data = new T[new_size];
panic::uint_t copy_size = length;
panic::types::uint_t copy_size = length;
if (new_size < length){
copy_size = new_size;
}
PANIC_OMP_PARALLEL_FOR_IF(copy_size > vector_omp_min_size)
for (panic::uint_t i = 0; i < copy_size; ++i){
for (panic::types::uint_t i = 0; i < copy_size; ++i){
new_data[i] = data[i];
}
PANIC_OMP_PARALLEL_FOR_IF(copy_size - new_size > vector_omp_min_size)
for (panic::uint_t i = copy_size; i < new_size; ++i){
for (panic::types::uint_t i = copy_size; i < new_size; ++i){
new_data[i] = static_cast<T>(0);
}
@@ -255,7 +255,7 @@ bool vector<T>::resize(panic::uint_t new_size){
template <typename T>
bool vector<T>::fill(T value){
PANIC_OMP_PARALLEL_FOR_IF(length > vector_omp_min_size)
for (panic::uint_t i = 0; i < length; ++i){
for (panic::types::uint_t i = 0; i < length; ++i){
data[i] = value;
}
@@ -269,7 +269,7 @@ bool vector<T>::fill(T value){
// Lets you read and write v[index]
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
T& vector<T>::operator[](panic::uint_t index){
T& vector<T>::operator[](panic::types::uint_t index){
return data[index];
}
@@ -280,7 +280,7 @@ T& vector<T>::operator[](panic::uint_t index){
// Lets you read v[index] from a const vector
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
const T& vector<T>::operator[](panic::uint_t index) const{
const T& vector<T>::operator[](panic::types::uint_t index) const{
return data[index];
}
@@ -291,7 +291,7 @@ const T& vector<T>::operator[](panic::uint_t index) const{
// Lets you read and write v.at(index) with index bounse
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
T& vector<T>::at(panic::uint_t index){
T& vector<T>::at(panic::types::uint_t index){
if (index >= length){
return data[length-1];
@@ -307,7 +307,7 @@ T& vector<T>::at(panic::uint_t index){
// Lets you read v[index] from a const vector with index bounse
//--------------------------------------------------------------------------------------------------------------------------
template <typename T>
const T& vector<T>::at(panic::uint_t index) const{
const T& vector<T>::at(panic::types::uint_t index) const{
if (index >= length){
return data[length-1];
}
@@ -320,9 +320,9 @@ const T& vector<T>::at(panic::uint_t index) const{
// EXPLICIT TEMPLATE INSTANTIATION
//---------------------------------------------------------------------------------------------------------------------------
template struct vector<panic::real_t>;
template struct vector<panic::int_t>;
template struct vector<panic::uint_t>;
template struct vector<panic::types::real_t>;
template struct vector<panic::types::int_t>;
template struct vector<panic::types::uint_t>;
} // namespace tensor