added arbitrariy sized matrix

This commit is contained in:
Karl-Wilfried Zimmer 2024-07-21 15:31:51 +02:00
parent c97be3a28f
commit 4ef94d4cb2
3 changed files with 32 additions and 1 deletions

View File

@ -0,0 +1,23 @@
//
// Created by nb on 21.07.24.
//
#ifndef VOLSVECS_MATRIXMXN_H
#define VOLSVECS_MATRIXMXN_H
namespace LinAlg{
template<short m,short n>
class Matrix{
protected:
int static getIndex(short x, short y){
if(x>=m) return -1;
if(y>=n) return -2;
return x+y*n;
}
private:
double _entris[m*n];
};
}
#endif //VOLSVECS_MATRIXMXN_H

View File

@ -1,7 +1,7 @@
file(GLOB HEADER_LIST CONFIGURE_DEPENDS "${PROJECT_SOURCE_DIR}/include/*") file(GLOB HEADER_LIST CONFIGURE_DEPENDS "${PROJECT_SOURCE_DIR}/include/*")
file(GLOB SOURCE_LIST CONFIGURE_DEPENDS "${PROJECT_SOURCE_DIR}/src/*") file(GLOB SOURCE_LIST CONFIGURE_DEPENDS "${PROJECT_SOURCE_DIR}/src/*")
add_library(volsvecs block.cpp vector3.cpp ${HEADER_LIST}) add_library(volsvecs ${SOURCE_LIST} ${HEADER_LIST})
add_library(VolumesVectors::volsvecs ALIAS volsvecs) add_library(VolumesVectors::volsvecs ALIAS volsvecs)
target_include_directories(volsvecs PUBLIC "${PROJECT_SOURCE_DIR}/include") target_include_directories(volsvecs PUBLIC "${PROJECT_SOURCE_DIR}/include")

8
src/matrixmxn.cpp Normal file
View File

@ -0,0 +1,8 @@
//
// Created by nb on 21.07.24.
//
#include "LinAlg/matrixmxn.h"
namespace LinAlg{
}