integer vector types

This commit is contained in:
2026-04-13 12:16:10 -04:00
parent e3be5a8a2c
commit 4530ed3603
23 changed files with 757 additions and 126 deletions

View File

@ -155,9 +155,9 @@ def v_operatorbk1(dim,dtype):
lnss = ""
vname = vtypename(dim,dtype)
lnsh += "\t{} float& operator[](const int &I);\n".format(cudadec)
lnsh += f"\t{cudadec} {dtype}& operator[](const int &I);\n"
lnss += "\t{} float& {}::operator[](const int &I)\n".format(cudadec,vname)
lnss += f"\t{cudadec} {dtype}& {vname}::operator[](const int &I)\n"
lnss += "\t{\n"
lnss += "\t\tswitch(I)\n\t\t{\n"
for I in range(0,dim):
@ -174,9 +174,9 @@ def v_operatorbk2(dim,dtype):
lnss = ""
vname = vtypename(dim,dtype)
lnsh += "\t{} const float& operator[](const int &I) const;\n".format(cudadec)
lnsh += f"\t{cudadec} const {dtype}& operator[](const int &I) const;\n"
lnss += "\t{} const float& {}::operator[](const int &I) const\n".format(cudadec,vname)
lnss += f"\t{cudadec} const {dtype}& {vname}::operator[](const int &I) const\n"
lnss += "\t{\n"
lnss += "\t\tswitch(I)\n\t\t{\n"
for I in range(0,dim):
@ -580,9 +580,9 @@ def moperatorbk1(dim,dtype):
lnss = ""
mname = mtypename(dim,dtype)
lnsh += f"\t{cudadec} float& operator[](const int &I);\n"
lnsh += f"\t{cudadec} {dtype}& operator[](const int &I);\n"
lnss += f"\t{cudadec} float& {mname}::operator[](const int &I)\n"
lnss += f"\t{cudadec} {dtype}& {mname}::operator[](const int &I)\n"
lnss += "\t{\n"
lnss += "\t\tswitch(I)\n\t\t{\n"
for I in range(0,dim*dim):
@ -601,9 +601,9 @@ def moperatorbk2(dim,dtype):
lnss = ""
mname = mtypename(dim,dtype)
lnsh += f"\t{cudadec} const float& operator[](const int &I) const;\n"
lnsh += f"\t{cudadec} const {dtype}& operator[](const int &I) const;\n"
lnss += f"\t{cudadec} const float& {mname}::operator[](const int &I) const\n"
lnss += f"\t{cudadec} const {dtype}& {mname}::operator[](const int &I) const\n"
lnss += "\t{\n"
lnss += "\t\tswitch(I)\n\t\t{\n"
for I in range(0,dim*dim):
@ -622,9 +622,9 @@ def moperatorbk3(dim,dtype):
lnss = ""
mname = mtypename(dim,dtype)
lnsh += f"\t{cudadec} float& operator()(const int &I, const int &J);\n"
lnsh += f"\t{cudadec} {dtype}& operator()(const int &I, const int &J);\n"
lnss += f"\t{cudadec} float& {mname}::operator()(const int &I, const int &J)\n"
lnss += f"\t{cudadec} {dtype}& {mname}::operator()(const int &I, const int &J)\n"
lnss += "\t{\n"
lnss += f"\t\treturn (*this)[I+{dim}*J];\n"
lnss += "\t}\n\n"
@ -636,9 +636,9 @@ def moperatorbk4(dim,dtype):
lnss = ""
mname = mtypename(dim,dtype)
lnsh += f"\t{cudadec} const float& operator()(const int &I, const int &J) const;\n"
lnsh += f"\t{cudadec} const {dtype}& operator()(const int &I, const int &J) const;\n"
lnss += f"\t{cudadec} const float& {mname}::operator()(const int &I, const int &J) const\n"
lnss += f"\t{cudadec} const {dtype}& {mname}::operator()(const int &I, const int &J) const\n"
lnss += "\t{\n"
lnss += f"\t\treturn (*this)[I+{dim}*J];\n"
lnss += "\t}\n\n"
@ -650,9 +650,9 @@ def moperatorbk5(dim,dtype):
lnss = ""
mname = mtypename(dim,dtype)
lnsh += f"\t{cudadec} float& at(const int &I, const int &J);\n"
lnsh += f"\t{cudadec} {dtype}& at(const int &I, const int &J);\n"
lnss += f"\t{cudadec} float& {mname}::at(const int &I, const int &J)\n"
lnss += f"\t{cudadec} {dtype}& {mname}::at(const int &I, const int &J)\n"
lnss += "\t{\n"
lnss += f"\t\treturn (*this)[I+{dim}*J];\n"
lnss += "\t}\n\n"
@ -664,9 +664,9 @@ def moperatorbk6(dim,dtype):
lnss = ""
mname = mtypename(dim,dtype)
lnsh += f"\t{cudadec} const float& at(const int &I, const int &J) const;\n"
lnsh += f"\t{cudadec} const {dtype}& at(const int &I, const int &J) const;\n"
lnss += f"\t{cudadec} const float& {mname}::at(const int &I, const int &J) const\n"
lnss += f"\t{cudadec} const {dtype}& {mname}::at(const int &I, const int &J) const\n"
lnss += "\t{\n"
lnss += f"\t\treturn (*this)[I+{dim}*J];\n"
lnss += "\t}\n\n"
@ -680,7 +680,7 @@ def mdataoperator1(dim,dtype):
lnss = ""
mname = mtypename(dim,dtype)
lnsh += f"{cudadec} {dtype}* data(); //pointer to float{dim*dim} representation of matrix\n"
lnsh += f"{cudadec} {dtype}* data(); //pointer to {dtype}{dim*dim} representation of matrix\n"
lnss += f"{cudadec} {dtype}* {mname}::data()\n"
lnss += "{\n"
@ -694,7 +694,7 @@ def mdataoperator2(dim,dtype):
lnss = ""
mname = mtypename(dim,dtype)
lnsh += f"{cudadec} const {dtype}* data() const; //pointer to float{dim*dim} representation of matrix\n"
lnsh += f"{cudadec} const {dtype}* data() const; //pointer to {dtype}{dim*dim} representation of matrix\n"
lnss += f"{cudadec} const {dtype}* {mname}::data() const\n"
lnss += "{\n"