added arbitrariy sized matrix
This commit is contained in:
parent
c97be3a28f
commit
4ef94d4cb2
23
include/LinAlg/matrixmxn.h
Normal file
23
include/LinAlg/matrixmxn.h
Normal 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
|
@ -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
8
src/matrixmxn.cpp
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
//
|
||||||
|
// Created by nb on 21.07.24.
|
||||||
|
//
|
||||||
|
#include "LinAlg/matrixmxn.h"
|
||||||
|
|
||||||
|
namespace LinAlg{
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user